{"id":34847722,"url":"https://github.com/kleinweb/user-profile-block","last_synced_at":"2026-05-22T22:35:00.342Z","repository":{"id":329303813,"uuid":"1118503264","full_name":"kleinweb/user-profile-block","owner":"kleinweb","description":"A WordPress Gutenberg block that displays user profile cards with social media links","archived":false,"fork":false,"pushed_at":"2026-01-13T16:27:23.000Z","size":531,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T18:39:38.008Z","etag":null,"topics":["gutenberg-blocks","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kleinweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-17T21:19:09.000Z","updated_at":"2026-01-13T16:27:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kleinweb/user-profile-block","commit_stats":null,"previous_names":["kleinweb/user-profile-block"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kleinweb/user-profile-block","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinweb%2Fuser-profile-block","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinweb%2Fuser-profile-block/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinweb%2Fuser-profile-block/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinweb%2Fuser-profile-block/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kleinweb","download_url":"https://codeload.github.com/kleinweb/user-profile-block/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kleinweb%2Fuser-profile-block/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33374438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-22T21:56:13.512Z","status":"ssl_error","status_checked_at":"2026-05-22T21:56:10.769Z","response_time":265,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gutenberg-blocks","wordpress-plugin"],"created_at":"2025-12-25T18:53:21.348Z","updated_at":"2026-05-22T22:35:00.335Z","avatar_url":"https://github.com/kleinweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2025-2026 Temple University \u003ckleinweb@temple.edu\u003e\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\u003e\n\n# User Profile Block\n\nA WordPress Gutenberg block that displays user profile cards with social\nmedia links. Built with modern PHP (8.3+), PHP-DI dependency injection,\nand Vite for frontend assets.\n\n## Features\n\n- Gutenberg block for displaying author social links\n- Supports 10 social platforms: LinkedIn, Instagram, X (Twitter), Facebook,\n  TikTok, YouTube, Threads, Bluesky, Substack, and Medium\n- Automatic post author detection with Co-Authors Plus support\n- Manual user selection for custom profile displays\n- Configurable author name linking with site-wide default override\n- Accessible markup with proper ARIA labels\n- Server-side rendered for optimal performance\n\n## Requirements\n\n- PHP 8.3+\n- WordPress 6.4+\n- Node.js 20+\n- Composer 2+\n\n## Installation\n\n```bash\ncomposer install\npnpm install\npnpm build\n```\n\nSymlink or copy the plugin to your WordPress `wp-content/plugins/`\ndirectory and activate.\n\n## Usage\n\n### Adding Social Links to Users\n\nNavigate to **Users \u003e Your Profile** in the WordPress admin. You'll find\nfields for each supported social platform under the \"Social Links\" section.\nEnter the full URL for each profile.\n\n### Using the Block\n\n1. In the block editor, add the **User Profile** block\n   (found in the \"Klein College\" category)\n2. By default, it displays the current post's author(s)\n3. Use the block settings to:\n   - Toggle \"Show post author\" on/off\n   - Toggle \"Link author name to profile\" on/off\n   - Select additional users manually\n\nThe block only renders if the selected user(s) have at least one social\nlink configured.\n\n### Customizing the Default Author Link Behavior\n\nBy default, author names link to their WordPress author archive page.\nSites can change this default using a filter:\n\n```php\n// Disable author profile links by default\nadd_filter('kleinweb_user_profile_block_link_to_author_page_default', '__return_false');\n```\n\nIndividual blocks can still override this via the block settings toggle.\n\n## Development\n\n### Asset Development\n\n```bash\n# Start Vite dev server with HMR\npnpm dev\n\n# Build for production\npnpm build\n\n# Type check\npnpm check\n```\n\n### PHP Quality\n\n```bash\n# Run all linters (PHPCS + PHPStan)\ncomposer lint\n\n# Auto-fix issues\ncomposer fix\n\n# Static analysis only\ncomposer phpstan\n```\n\n### Testing\n\n```bash\n# Unit tests (Brain Monkey - fast, no WordPress)\ncomposer test:unit\n\n# Integration tests (wp-browser - requires WordPress)\ncomposer test:integration\n\n# All tests\ncomposer test\n```\n\n### Full Check\n\n```bash\njust check\n```\n\n## Architecture\n\n### Service Container\n\nThe plugin uses PHP-DI for dependency injection. Entry point is\n`user-profile-block.php` which initializes `ServiceContainer`.\n\n```php\n// Access services\n$service = \\Kleinweb\\UserProfile\\plugin()-\u003eget(SomeService::class);\n```\n\n### PHP 8 Attributes\n\nBlocks and meta fields are registered using PHP 8 attributes:\n\n```php\n#[Block(name: 'user-profile')]\nfinal class UserProfile\n{\n    public function render(\n        array $attributes,\n        string $content,\n        WP_Block $block,\n    ): string {\n        // Server-side render\n    }\n}\n```\n\n```php\n#[Meta(\n    key: 'linkedin_url',\n    objectType: 'user',\n    type: 'string',\n    showInRest: true,\n)]\npublic string $linkedinUrl = '';\n```\n\n### Directory Structure\n\n```text\nuser-profile-block/\n├── config/                  # Container configuration\n├── public/build/            # Compiled assets (gitignored)\n├── resources/\n│   ├── blocks/              # Gutenberg block source\n│   │   └── user-profile/    # User Profile block\n│   ├── css/                 # Stylesheets\n│   └── js/\n│       ├── editor/          # Block editor scripts\n│       ├── frontend/        # Public-facing scripts\n│       └── settings/        # Admin settings page\n├── src/\n│   ├── Blocks/              # Block PHP classes\n│   ├── Container/           # Service container\n│   ├── Meta/                # Meta field registration\n│   ├── Support/             # Utilities (Vite, ServiceProvider)\n│   └── Users/               # User profile fields\n├── tests/\n│   ├── Integration/         # wp-browser integration tests\n│   └── Unit/                # Brain Monkey unit tests\n└── user-profile-block.php   # Main plugin file\n```\n\n## Supported Social Platforms\n\n| Platform  | Meta Key        |\n| --------- | --------------- |\n| LinkedIn  | `linkedin_url`  |\n| Instagram | `instagram_url` |\n| X/Twitter | `twitter_url`   |\n| Facebook  | `facebook_url`  |\n| TikTok    | `tiktok_url`    |\n| YouTube   | `youtube_url`   |\n| Threads   | `threads_url`   |\n| Bluesky   | `bluesky_url`   |\n| Substack  | `substack_url`  |\n| Medium    | `medium_url`    |\n\n## License\n\nGPL-2.0-or-later\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleinweb%2Fuser-profile-block","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkleinweb%2Fuser-profile-block","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkleinweb%2Fuser-profile-block/lists"}