PHPackages                             kleinweb/user-profile-block - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kleinweb/user-profile-block

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

kleinweb/user-profile-block
===========================

A WordPress Gutenberg block that displays user profile cards with social media links

2.0.0(4mo ago)033GPL-2.0-or-laterPHPPHP ^8.3CI failing

Since Dec 18Pushed 4mo agoCompare

[ Source](https://github.com/kleinweb/user-profile-block)[ Packagist](https://packagist.org/packages/kleinweb/user-profile-block)[ Docs](https://github.com/kleinweb/user-profile-block)[ RSS](/packages/kleinweb-user-profile-block/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (18)Versions (7)Used By (0)

User Profile Block
==================

[](#user-profile-block)

A WordPress Gutenberg block that displays user profile cards with social media links. Built with modern PHP (8.3+), PHP-DI dependency injection, and Vite for frontend assets.

Features
--------

[](#features)

- Gutenberg block for displaying author social links
- Supports 10 social platforms: LinkedIn, Instagram, X (Twitter), Facebook, TikTok, YouTube, Threads, Bluesky, Substack, and Medium
- Automatic post author detection with Co-Authors Plus support
- Manual user selection for custom profile displays
- Configurable author name linking with site-wide default override
- Accessible markup with proper ARIA labels
- Server-side rendered for optimal performance

Requirements
------------

[](#requirements)

- PHP 8.3+
- WordPress 6.4+
- Node.js 20+
- Composer 2+

Installation
------------

[](#installation)

```
composer install
pnpm install
pnpm build
```

Symlink or copy the plugin to your WordPress `wp-content/plugins/`directory and activate.

Usage
-----

[](#usage)

### Adding Social Links to Users

[](#adding-social-links-to-users)

Navigate to **Users &gt; Your Profile** in the WordPress admin. You'll find fields for each supported social platform under the "Social Links" section. Enter the full URL for each profile.

### Using the Block

[](#using-the-block)

1. In the block editor, add the **User Profile** block (found in the "Klein College" category)
2. By default, it displays the current post's author(s)
3. Use the block settings to:
    - Toggle "Show post author" on/off
    - Toggle "Link author name to profile" on/off
    - Select additional users manually

The block only renders if the selected user(s) have at least one social link configured.

### Customizing the Default Author Link Behavior

[](#customizing-the-default-author-link-behavior)

By default, author names link to their WordPress author archive page. Sites can change this default using a filter:

```
// Disable author profile links by default
add_filter('kleinweb_user_profile_block_link_to_author_page_default', '__return_false');
```

Individual blocks can still override this via the block settings toggle.

Development
-----------

[](#development)

### Asset Development

[](#asset-development)

```
# Start Vite dev server with HMR
pnpm dev

# Build for production
pnpm build

# Type check
pnpm check
```

### PHP Quality

[](#php-quality)

```
# Run all linters (PHPCS + PHPStan)
composer lint

# Auto-fix issues
composer fix

# Static analysis only
composer phpstan
```

### Testing

[](#testing)

```
# Unit tests (Brain Monkey - fast, no WordPress)
composer test:unit

# Integration tests (wp-browser - requires WordPress)
composer test:integration

# All tests
composer test
```

### Full Check

[](#full-check)

```
just check
```

Architecture
------------

[](#architecture)

### Service Container

[](#service-container)

The plugin uses PHP-DI for dependency injection. Entry point is `user-profile-block.php` which initializes `ServiceContainer`.

```
// Access services
$service = \Kleinweb\UserProfile\plugin()->get(SomeService::class);
```

### PHP 8 Attributes

[](#php-8-attributes)

Blocks and meta fields are registered using PHP 8 attributes:

```
#[Block(name: 'user-profile')]
final class UserProfile
{
    public function render(
        array $attributes,
        string $content,
        WP_Block $block,
    ): string {
        // Server-side render
    }
}
```

```
#[Meta(
    key: 'linkedin_url',
    objectType: 'user',
    type: 'string',
    showInRest: true,
)]
public string $linkedinUrl = '';
```

### Directory Structure

[](#directory-structure)

```
user-profile-block/
├── config/                  # Container configuration
├── public/build/            # Compiled assets (gitignored)
├── resources/
│   ├── blocks/              # Gutenberg block source
│   │   └── user-profile/    # User Profile block
│   ├── css/                 # Stylesheets
│   └── js/
│       ├── editor/          # Block editor scripts
│       ├── frontend/        # Public-facing scripts
│       └── settings/        # Admin settings page
├── src/
│   ├── Blocks/              # Block PHP classes
│   ├── Container/           # Service container
│   ├── Meta/                # Meta field registration
│   ├── Support/             # Utilities (Vite, ServiceProvider)
│   └── Users/               # User profile fields
├── tests/
│   ├── Integration/         # wp-browser integration tests
│   └── Unit/                # Brain Monkey unit tests
└── user-profile-block.php   # Main plugin file

```

Supported Social Platforms
--------------------------

[](#supported-social-platforms)

PlatformMeta KeyLinkedIn`linkedin_url`Instagram`instagram_url`X/Twitter`twitter_url`Facebook`facebook_url`TikTok`tiktok_url`YouTube`youtube_url`Threads`threads_url`Bluesky`bluesky_url`Substack`substack_url`Medium`medium_url`License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance77

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

6

Last Release

125d ago

Major Versions

1.1.0 → 2.0.02026-01-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/d14eb8a5d34e840d980cc5f0f4a6172968c47a20ba5aa3af2e7ccb964acbf06d?d=identicon)[montchr](/maintainers/montchr)

---

Top Contributors

[![astratagem](https://avatars.githubusercontent.com/u/1757914?v=4)](https://github.com/astratagem "astratagem (28 commits)")

---

Tags

gutenberg-blockswordpress-plugin

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kleinweb-user-profile-block/health.svg)

```
[![Health](https://phpackages.com/badges/kleinweb-user-profile-block/health.svg)](https://phpackages.com/packages/kleinweb-user-profile-block)
```

###  Alternatives

[infinum/eightshift-libs

WordPress libs developed by Eightshift team to use in modern WordPress.

63118.9k3](/packages/infinum-eightshift-libs)[drupal-code-builder/drupal-code-builder

Code generator for Drupal

27241.1k1](/packages/drupal-code-builder-drupal-code-builder)[php-di/zf1-bridge

Integrates PHP-DI to Zend Framework 1

27457.8k1](/packages/php-di-zf1-bridge)[sansec/composer-integrity-plugin

5624.2k1](/packages/sansec-composer-integrity-plugin)[php-di/symfony-bridge

Integrates PHP-DI to Symfony

17168.2k](/packages/php-di-symfony-bridge)[okapi/aop

PHP AOP is a PHP library that provides a powerful Aspect Oriented Programming (AOP) implementation for PHP.

3812.0k](/packages/okapi-aop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
