Link Extension for XFN

Description

The XFN Relationship Link Extension seamlessly integrates XFN (XHTML Friends Network) relationship options into WordPress’s native link interface. This plugin enhances every block that supports links—including Paragraph, Button, Navigation, List, and more—with comprehensive relationship tagging capabilities through an intuitive collapsible interface.

XFN is a simple way to represent human relationships using hyperlinks. By adding XFN relationships to your links, you can indicate how you’re connected to the people and organizations you link to, creating a more semantic and meaningful web.

Key Features

Complete XFN 1.1 Specification Support

This plugin implements the full XFN 1.1 specification with all relationship categories:

  • Friendship relationships: contact, acquaintance, friend
  • Physical relationships: met (have you met this person?)
  • Professional relationships: co-worker, colleague
  • Geographical relationships: co-resident, neighbor
  • Family relationships: child, parent, sibling, spouse, kin
  • Romantic relationships: muse, crush, date, sweetheart
  • Identity relationships: me (link to yourself)

Dual Interface Integration with Collapsible Design

The plugin provides XFN controls in two convenient locations, both featuring a clean collapsible interface:

  • Link Advanced Panel (Always enabled): Collapsible XFN section in link popovers for inline links – works immediately after installation
  • Inspector Controls (Optional): Panel in the block sidebar for Button, Image, Navigation, and Embed blocks – enable in Settings Link Extension for XFN

Seamless Integration with WordPress

The plugin extends the existing link interfaces without disrupting your workflow:

  • Works with Paragraph, Button, Navigation, List, Embed, and all other link-supporting blocks
  • Compatible with both Post Editor and Site Editor
  • Preserves existing rel attributes (nofollow, noopener, noreferrer)
  • No configuration required – works immediately after activation
  • Clean collapsible interface matches WordPress design patterns

Advanced User Interface with Collapsible Sections

The relationship selection interface is designed for optimal usability with modern collapsible design:

  • Collapsible XFN sections: Clean toggle buttons with expand/collapse animation
  • Visual relationship pills: Color-coded indicators show active relationships at a glance
  • Count badges: Quickly see how many relationships are active without expanding
  • Intelligent grouping: Related options are logically organized by category within sections
  • Button groups: Modern toggle-style buttons for easy relationship selection
  • Mutual exclusivity: Button groups prevent conflicting relationships (e.g., can’t be both “friend” and “acquaintance”)
  • Multi-selection support: Checkbox-style groups allow multiple compatible relationships
  • Real-time validation: Prevents invalid relationship combinations
  • Smooth animations: Fluid expand/collapse transitions

How to Add XFN Relationships to Links

Quick Start

After installation, XFN options are immediately available for inline links (links within paragraphs, headings, lists).

To use XFN with Button, Image, Navigation, and Embed blocks, go to Settings Link Extension for XFN and enable Inspector Controls.

Method 1: Using Link Advanced Panel (Always Available)

  1. Create or edit an inline link in any block (Paragraph, List, etc.)
  2. In the link popover, click “Advanced” to expand additional options
  3. Find the “XFN” collapsible section and click to expand
  4. Select relationships using the organized button groups
  5. See your active relationships in the summary pills
  6. Click “Apply” to save your XFN relationships

Method 2: Using Inspector Controls (Enable in Settings)

  1. Go to Settings Link Extension for XFN and enable Inspector Controls
  2. Select a Button, Image, Navigation, or Embed block
  3. Look in the right sidebar – “XFN Relationships” panel opens by default
  4. Select relationships using radio buttons and checkboxes organized by category
  5. Relationships save automatically as you select them
  6. View active relationships in the summary section with color-coded pills

Understanding XFN Relationship Categories

Friendship Relationships (Choose One)

These are mutually exclusive – you can only select one friendship level per person:

  • contact: Someone you know how to get in touch with
  • acquaintance: Someone you’ve met but don’t know well
  • friend: Someone you consider a friend

Physical Meeting

  • met: Check this if you’ve met this person face-to-face

Professional Relationships (Multiple Allowed)

  • co-worker: Someone you work with at the same company
  • colleague: Someone in your professional field or industry

Geographical Relationships (Choose One)

  • co-resident: Someone who lives in the same residence
  • neighbor: Someone who lives nearby

Family Relationships (Choose One)

  • child: Your child
  • parent: Your parent
  • sibling: Your brother or sister
  • spouse: Your husband, wife, or domestic partner
  • kin: Other family relation

Romantic Relationships (Multiple Allowed)

  • muse: Someone who inspires you
  • crush: Someone you have romantic feelings for
  • date: Someone you’re dating
  • sweetheart: Someone you have a romantic relationship with

Identity

  • me: A link to your own content or profiles

Integration with Popular Blocks

Button Block

Use the Inspector Controls for quick relationship assignment. The XFN Relationships panel opens by default, letting you select relationships that save automatically.

Navigation Block

Enhance your site navigation with relationship context using the Inspector Controls. Mark links to your social profiles, partner sites, or affiliated organizations with the organized collapsible interface.

Embed Block

Add semantic meaning to embedded content from YouTube, Twitter, and other platforms. Use the Inspector Controls to indicate relationships with embedded content creators, marking videos from colleagues, friends, or your own channels. Perfect for blogrolls, resource pages, and content aggregation.

Paragraph Block (Inline Links)

For inline links within paragraph content, use the collapsible XFN section in the link popover’s Advanced area to add relationship context without overwhelming the interface.

List Block

Build relationship-rich link lists using the Link Advanced Panel for inline links or Inspector Controls for block-level links. The collapsible sections make it easy to manage multiple relationships across list items.

Cover Block and Media & Text Block

Add relationship context to overlay links and media-associated links using the Link Advanced Panel for inline links or Inspector Controls for block-level elements.

Technical Implementation

Source Code & Build Tools

This plugin uses build tools to compile and optimize code for production.

All uncompiled, human-readable source code is included in the plugin’s src/ directory and is publicly available on GitHub.

Source files (uncompiled):
* JavaScript: src/index.js (main plugin logic)
* Styles: src/editor.scss (editor styles)
* Additional: src/view.js, src/edit.js, src/save.js

Compiled files (production):
* JavaScript: build/index.js, build/view.js
* Styles: build/index.css, build/index-rtl.css

Build tools:
* Build system: WordPress Scripts (webpack-based)
* Required: Node.js 14+ and npm
* Build command: npm run build
* Development mode: npm start (watches for file changes)

How to rebuild from source:
1. Clone or download from GitHub: https://github.com/courtneyr-dev/xfn-link-extension
2. Install dependencies: npm install
3. Build production files: npm run build
4. Output will be in the build/ directory

GitHub repository (complete source): https://github.com/courtneyr-dev/xfn-link-extension

Rel Attribute Management

The plugin intelligently manages the HTML rel attribute:

  • Combines XFN relationships with existing rel values
  • Preserves SEO-important attributes like nofollow
  • Maintains security attributes like noopener and noreferrer
  • Uses space-separated format per HTML specification
  • Validates relationship combinations to prevent conflicts

Data Persistence

  • Relationships are stored in the standard HTML rel attribute
  • No custom database tables or meta fields required
  • Compatible with all WordPress import/export tools
  • Relationships survive theme changes and plugin deactivation

Performance Optimized

  • Lightweight JavaScript bundle under 12KB gzipped
  • Lazy-loaded collapsible sections only when accessed
  • No impact on frontend performance
  • Uses WordPress core components for consistency
  • Smooth animations without performance penalties

Migration from Other XFN Plugins

If you’re migrating from another XFN plugin:

  1. Classic Editor plugins: Existing XFN data in post meta will be preserved
  2. Custom rel attributes: Any existing rel values are maintained
  3. Manual XFN: Manually entered XFN relationships in rel attributes work immediately

Troubleshooting

XFN options don’t appear in floating toolbar

  1. Check block type: Only blocks that are entirely links (Button, Navigation Link, etc.) show the XFN toolbar button
  2. Verify WordPress version: Requires WordPress 6.4 or later
  3. Clear browser cache: Try refreshing the page or clearing browser cache
  4. Check for block selection: Ensure the block is properly selected

XFN section won’t expand in link popover

  1. Check Advanced section: XFN options appear when you click “Advanced” in the link popover, then look for the “XFN” toggle
  2. Try clicking the toggle: The XFN section requires an additional click to expand
  3. Verify in block editor: Plugin only works with Gutenberg blocks, not Classic Editor
  4. Check browser console: Look for JavaScript errors that might prevent interaction

Collapsible sections not animating smoothly

  1. Check browser compatibility: Ensure you’re using a modern, supported browser
  2. Verify CSS loading: Check that plugin stylesheets are loading properly
  3. Test in incognito mode: Rule out browser extension interference
  4. Disable other plugins: Test for plugin conflicts by temporarily disabling other plugins

Count badges not updating

  1. Try refreshing: Sometimes a page refresh resolves display issues
  2. Check JavaScript console: Look for errors that might prevent updates
  3. Test relationship changes: Make sure you’re actually changing relationships
  4. Verify plugin activation: Ensure the plugin is properly activated

Relationships not saving properly

  1. Check browser console: Look for JavaScript errors that might prevent saving
  2. Verify user permissions: Ensure you have permission to edit the content
  3. Test with default theme: Temporarily switch to a default WordPress theme
  4. Disable other plugins: Test for plugin conflicts by temporarily disabling other plugins

Keyboard navigation issues with collapsible sections

  1. Test tab order: Use Tab key to navigate to toggle buttons
  2. Try space/enter: Space or Enter should expand/collapse sections
  3. Use arrow keys: Arrow keys work within expanded button groups
  4. Check browser settings: Ensure keyboard navigation is enabled in browser settings

Screen reader compatibility with collapsible interface

  1. Test with multiple screen readers: NVDA, JAWS, and VoiceOver are all supported
  2. Check expansion announcements: Section state changes should be announced
  3. Verify ARIA states: All collapsible elements should have proper ARIA attributes
  4. Update screen reader: Ensure you’re using a current version of your screen reader

Screenshots

  • XFN Link Extension interface showing collapsible relationship sections with button groups for selecting friendships, professional connections, and other XFN categories, plus visual pills displaying active relationship selections

Blocks

This plugin provides 1 block.

  • XFN Relationship Link Extension Extends the native Gutenberg link interface to include XFN (XHTML Friends Network) relationship options across all blocks that support links.

Installation

  1. Upload the plugin files to the /wp-content/plugins/link-extension-for-xfn directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. No configuration required – XFN options will immediately appear in:
    • Link Advanced Panel (Always available): Collapsible XFN section in the Advanced area of link popovers for inline links
    • Inspector Controls (Optional): Panel in the block sidebar for Button, Image, Navigation, and Embed blocks – enable in Settings Link Extension for XFN
  4. Start adding relationship context to your links using the intuitive collapsible interface

FAQ

Where can I access XFN relationship options?

XFN controls are available in two locations, both featuring collapsible interfaces:
1. Link Advanced Panel (Always available): In the Advanced section of inline link popovers as a collapsible “XFN” section
2. Inspector Controls (Enable in Settings): In the block settings sidebar under “XFN Relationships” panel for Button, Image, Navigation, and Embed blocks

Why use a collapsible interface?

The collapsible design keeps the interface clean and uncluttered while providing full access to XFN features:
* Count badges show active relationships at a glance
* Expand only when needed to reduce visual noise
* Consistent with WordPress design patterns
* Accessible with proper ARIA states
* Mobile friendly with touch-optimized toggles

What is XFN and why should I use it?

XFN (XHTML Friends Network) is a simple way to represent human relationships using hyperlinks. It adds semantic meaning to your links by describing how you’re connected to the people and organizations you link to. This creates a richer, more meaningful web where relationships between people and content are explicit.

Does the collapsible interface affect accessibility?

No, the collapsible interface enhances accessibility by:
* Reducing cognitive load by showing only relevant information
* Providing proper ARIA states for screen readers
* Supporting full keyboard navigation including expand/collapse
* Maintaining focus management when sections open and close
* Offering visual and semantic cues about content state

Does this affect my SEO or page speed?

No negative impact on either. The plugin adds standard HTML rel attributes that search engines understand. The JavaScript only loads in the WordPress editor, not on your public pages. The collapsible interface has no impact on frontend performance.

Can I use this with Classic Editor?

This plugin is designed for the Gutenberg block editor (WordPress 5.0+). For Classic Editor, you would need a different XFN plugin or manually add rel attributes to your links.

What happens if I deactivate the plugin?

Your XFN relationships remain in your content as standard rel attributes. They just won’t be editable through the collapsible user interface anymore. Your content is never damaged or modified.

Can I control which sections are expanded by default?

Currently, all collapsible sections start in the collapsed state to maintain a clean interface. We’re considering user preferences for default states in future versions.

Does this work with all themes?

Yes! XFN relationships are standard HTML attributes that work with any theme. The editing interface uses WordPress core components and follows WordPress design patterns for consistency across all admin themes.

Can I customize the collapsible behavior?

The current version provides the standard collapsible behavior. We’re considering customization options for animation speed and default states based on user feedback.

Is this compatible with page builders?

This plugin works with the native WordPress block editor. Compatibility with third-party page builders depends on whether they use WordPress’s standard link interface and support collapsible components.

How do I see the XFN relationships on my published pages?

XFN relationships appear in the HTML rel attribute of links. You can view them by inspecting the page source or using browser developer tools. They’re primarily for semantic markup rather than visual display.

Can I use this for business relationships?

Absolutely! XFN includes professional relationships (co-worker, colleague) and can be used to indicate business partnerships, vendor relationships, and professional networks. The collapsible interface makes it easy to manage multiple professional relationships.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Link Extension for XFN” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.3

  • Fixed: WordPress Playground blueprint now works correctly with proper JSON structure
  • Fixed: Demo page now publishes (not draft) and lands at /xfn-demo/ for immediate access
  • Fixed: Button blocks now correctly include rel attribute in rendered HTML
  • Fixed: Content filters disabled to preserve XFN rel attributes in demo
  • Improved: Enhanced demo content with visual indicators, testing instructions, and results table
  • Improved: Better inline link examples showing multiple XFN attributes working together
  • Technical: Blueprint uses runPHPWithOptions with environment variables (Playground best practice)
  • Technical: Added login: true for automatic authentication in Playground demo
  • Technical: CORS-enabled development server for local blueprint testing

1.0.2

  • Added: Full embed block support (YouTube, Twitter, WordPress embeds, etc.)
  • Added: Server-side filter to output XFN attributes on frontend for embed blocks
  • Added: WordPress Playground blueprint for live preview on WordPress.org
  • Added: Comprehensive demo post with inline links, buttons, and embeds showing multiple XFN attributes
  • Fixed: Blueprint.json now in correct location for WordPress.org Playground integration
  • Fixed: Embed blocks now properly output XFN relationships to frontend HTML (rel or data-xfn-rel)
  • Updated: Documentation to include embed block support throughout
  • Updated: Inspector Controls now support core/embed block type
  • Technical: Added xfn_render_embed_block() filter hooking into render_block

1.0.1

  • Fixed: Corrected plugin naming throughout – now consistently uses “Link Extension for XFN”
  • Fixed: Installation directory path in readme (xfn-link-extension link-extension-for-xfn)
  • Fixed: Settings menu now displays as “Settings Link Extension for XFN”
  • Fixed: Changed Contributors to Developers in plugin header for proper WordPress.org display
  • Updated: All documentation and user-facing strings to use correct plugin name
  • Updated: Error messages and console logs to reference correct settings path

1.0.0

  • Initial release with full XFN 1.1 specification support
  • Dual interface integration: Inspector Controls and Link Advanced Panel
  • Modern collapsible interface design with smooth animations
  • Count badges for quick relationship status overview
  • Seamless integration with WordPress native link interface
  • Complete accessibility implementation with WCAG 2.2 AA compliance
  • Support for all link-supporting blocks in Gutenberg editor
  • Visual relationship pills with color-coded categories
  • Intelligent mutual exclusivity and multi-selection handling
  • Comprehensive keyboard navigation and screen reader support
  • Collapsible sections with proper ARIA states and focus management
  • Performance optimized with lazy loading and minimal bundle size
  • Preservation of existing rel attributes (nofollow, noopener)
  • Extensive internationalization with translation-ready strings
  • Responsive design with mobile-friendly collapsible toggles
  • High contrast mode support for enhanced accessibility