Skip to content

Conversation

obenland
Copy link
Member

@obenland obenland commented Sep 4, 2025

Summary

Adds a Yoast SEO integration that creates a site health check to ensure media pages are enabled when media attachments are configured for ActivityPub federation.

Fixes #2134

Proposed changes:

  • New Yoast_Seo integration class: Checks if Yoast SEO's "Enable media pages" setting is properly configured for ActivityPub
  • Conditional activation: Only runs when both Yoast SEO is active AND attachment post type is supported by ActivityPub
  • Site health integration: Adds a dedicated site health test that:
    • Shows "good" status (green) when media pages are enabled
    • Shows "recommended" status (orange) when media pages are disabled, with instructions to enable them
  • Direct settings link: Provides a clickable link to the exact Yoast SEO settings page for easy configuration
  • Comprehensive tests: Full test coverage including attachment support detection, media pages status checking, and site health test scenarios

Why this change is needed:

When Yoast SEO's media pages are disabled, WordPress attachment URLs redirect to the media file itself rather than displaying an attachment page. This breaks ActivityPub federation of media because:

  1. ActivityPub clients expect to find structured data on attachment pages
  2. Media interactions (likes, shares, comments) need a proper page to target
  3. The media becomes unfederated even when attachment post type is enabled

Testing instructions:

  1. Install Yoast SEO plugin
  2. Enable attachment post type in ActivityPub settings
  3. Go to Tools > Site Health > Info tab
  4. Check the site health tests - you should see "Yoast SEO Media Pages Test"
  5. Try both scenarios:
    • Yoast media pages enabled: Should show green "good" status
    • Yoast media pages disabled: Should show orange "recommended" status with link to settings

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Minor

Type

  • Added - for new features

Message

Add Yoast SEO integration for media pages site health check

Fixes #2134

- Add Yoast_Seo integration class that checks media pages setting
- Only runs when attachment post type is configured for ActivityPub federation
- Recommends enabling media pages when disabled for proper media federation
- Provides direct link to Yoast SEO settings for easy configuration
- Includes comprehensive test coverage for all scenarios
@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 14:05
@obenland obenland self-assigned this Sep 4, 2025
@obenland obenland requested a review from pfefferle September 4, 2025 14:05
@github-actions github-actions bot added the [Focus] Compatibility Ensuring the plugin plays well with other plugins label Sep 4, 2025
Changed the test key from 'activitypub_yoast_media_pages' to 'activitypub_yoast_seo_media_pages' in both the integration and test files for consistency and clarity.
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Yoast SEO integration that provides a site health check to ensure media pages are properly configured when ActivityPub federation is enabled for media attachments.

  • Adds new Yoast_Seo integration class with site health functionality
  • Conditionally registers site health test only when both Yoast SEO is active and attachment post type is supported
  • Provides actionable feedback with direct links to Yoast SEO settings for configuration

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
integration/class-yoast-seo.php New integration class implementing site health tests for Yoast SEO media pages configuration
integration/load.php Adds conditional initialization of Yoast SEO integration when plugin is detected
tests/integration/class-test-yoast-seo.php Comprehensive test coverage for the new integration including edge cases and different configuration scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Compatibility Ensuring the plugin plays well with other plugins
Projects
None yet
2 participants