Skip to content

Feature: add Equalize Digital tab to WP 7.0+ Plugins screen - #1720

Draft
SteveJonesDev wants to merge 7 commits into
developfrom
claude/sleepy-haslett-08c6bd
Draft

Feature: add Equalize Digital tab to WP 7.0+ Plugins screen#1720
SteveJonesDev wants to merge 7 commits into
developfrom
claude/sleepy-haslett-08c6bd

Conversation

@SteveJonesDev

@SteveJonesDev SteveJonesDev commented May 27, 2026

Copy link
Copy Markdown
Member

What changed

Adds a new Plugin_List_Tab class (admin/class-plugin-list-tab.php) and wires it into Admin::init().

The class hooks into two filters introduced in WordPress 7.0:

  • plugins_list — appends an equalize-digital status group containing every installed plugin whose AuthorURI contains equalizedigital.com. The tab only appears when 2 or more such plugins are found (matching the convention used by Yoast and others).
  • plugins_list_status_text — returns the "Equalize Digital" label for that tab.

Both hooks are version-gated behind version_compare( $wp_version, '7.0-alpha0', '<' ) so the behaviour is a no-op on older WordPress installs.

Why

WordPress 7.0 added plugins_list and plugins_list_status_text to let plugin authors surface a branded tab on the Plugins screen for their suite of plugins. This gives Equalize Digital users a convenient way to filter and view all Equalize Digital plugins in one place.

Reviewer notes

  • Detection is done via AuthorURI containing equalizedigital.com — reliable across both the free and Pro plugins without hardcoding slugs.
  • Minimum threshold is 2 plugins (MINIMUM_FOR_TAB), so the tab won't appear for users who only have one Equalize Digital plugin installed.
  • No changes to existing behaviour on WordPress < 7.0.

Test plan

  • Install two or more Equalize Digital plugins on a WordPress 7.0+ site and verify the "Equalize Digital" tab appears on the Plugins screen
  • Verify the tab correctly filters to only Equalize Digital plugins
  • Confirm no tab appears when only one Equalize Digital plugin is installed
  • Confirm no regressions on WordPress < 7.0 (hooks should not be registered)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Adds a custom "Equalize Digital" tab on the WordPress Plugins screen (visible on WordPress 7.0+ when three or more Equalize Digital plugins are installed).
    • Shows a plural-aware, accessibility-friendly status label that reflects the number of grouped plugins and reduces noise by requiring a higher threshold before grouping.

Review Change Stack

Hooks into the new plugins_list and plugins_list_status_text filters
(introduced in WordPress 7.0) to surface an "Equalize Digital" tab on
the Plugins screen whenever two or more Equalize Digital plugins are
installed. Mirrors the pattern used by other plugin vendors (e.g. Yoast).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8b1083bb-a3e0-4c55-99d6-56c12fecf36b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Plugin_List_Tab to group plugins whose AuthorURI contains equalizedigital.com into an Equalize Digital status bucket on the Plugins screen (WP ≥ 7.0); the tab appears only when at least three matching plugins exist. Admin::init() instantiates and wires the feature.

Changes

Plugin List Tab Feature

Layer / File(s) Summary
File bootstrap and class declaration
admin/class-plugin-list-tab.php
Adds ABSPATH guard and Plugin_List_Tab class with MINIMUM_FOR_TAB = 3 and STATUS_SLUG.
Hook registration (init_hooks)
admin/class-plugin-list-tab.php
init_hooks() registers plugins_list and plugins_list_status_text filters conditionally for WordPress >= 7.0-alpha0.
Plugin detection, filtering, and status text
admin/class-plugin-list-tab.php
is_equalize_digital_plugin() checks AuthorURI for equalizedigital.com; filter_plugins_list() collects matches from the all bucket and sets plugins['equalize-digital'] when count ≥ 3; get_status_text() returns localized label via _nx() with accessibility-checker text domain.
Admin initialization integration
admin/class-admin.php
Admin::init() now instantiates Plugin_List_Tab and calls init_hooks() after Plugin_Row_Meta initialization.

Sequence Diagram

sequenceDiagram
  participant WP as WordPress Plugins Screen
  participant Filters as WP Filters
  participant ListTab as Plugin_List_Tab
  WP->>Filters: apply plugins_list(all)
  Filters->>ListTab: filter_plugins_list(all)
  ListTab->>ListTab: inspect plugin headers (AuthorURI)
  ListTab->>ListTab: collect equalize-digital matches
  ListTab->>Filters: return modified buckets (including equalize-digital)
  WP->>Filters: apply plugins_list_status_text(type, count)
  Filters->>ListTab: get_status_text(type, count)
  ListTab->>Filters: return localized status label
  Filters->>WP: render tabs with Equalize Digital bucket
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

codex

Suggested reviewers

  • pattonwebz

Poem

🐰 I hopped through plugin lists at dawn,
Scanned AuthorURIs across the lawn.
Three friends found, a tab I made,
Equalize Digital neatly displayed.
A little hop, a tidy spawn.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature: adding an Equalize Digital tab to the WordPress Plugins screen for version 7.0+, which is clearly reflected in the code changes adding Plugin_List_Tab.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/sleepy-haslett-08c6bd

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the Plugin_List_Tab class to register a custom "Equalize Digital" tab on the WordPress Plugins screen for WP 7.0+ when multiple Equalize Digital plugins are active. The feedback recommends incorporating the standard WordPress count placeholder <span>(%s)</span> in the status text, defensively checking that $plugins['all'] is an array before iterating, and using the case-insensitive stripos function to robustly match the author URI.

Comment thread admin/class-plugin-list-tab.php Outdated
Comment thread admin/class-plugin-list-tab.php Outdated
Comment thread admin/class-plugin-list-tab.php Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@admin/class-plugin-list-tab.php`:
- Line 121: The AuthorURI check is case-sensitive because it uses strpos on
$plugin_data['AuthorURI']; change it to a case-insensitive match (e.g., replace
strpos with stripos or compare strtolower(parsed host) against
'equalizedigital.com') so AuthorURI host casing variants are detected; update
the return expression that currently references $plugin_data['AuthorURI'] to use
a case-insensitive comparison instead.
- Around line 8-22: The class currently declared as EDAC\Admin\Plugin_List_Tab
should be renamed and namespaced to follow PSR-4 and project standards: change
the namespace to EqualizeDigital\AccessibilityChecker (replace EDAC\Admin) and
rename the class Plugin_List_Tab to a CamelCase name such as PluginListTab;
update all references to Plugin_List_Tab to the new PluginListTab symbol and
ensure the file name matches the class (PluginListTab.php) and PSR-4 autoloading
rules so the class is discoverable by the autoloader.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: caff8773-554d-42c4-b084-21ee935d0aea

📥 Commits

Reviewing files that changed from the base of the PR and between 51f70d0 and 19777b0.

📒 Files selected for processing (2)
  • admin/class-admin.php
  • admin/class-plugin-list-tab.php

Comment thread admin/class-plugin-list-tab.php Outdated
Comment thread admin/class-plugin-list-tab.php Outdated
SteveJonesDev and others added 2 commits May 27, 2026 13:46
- Use stripos for case-insensitive AuthorURI matching
- Guard foreach with is_array check on plugins['all']
- Add <span class="count">(%s)</span> placeholder to status text
  so WordPress renders the plugin count next to the tab label

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…in namespace

New admin classes use EqualizeDigital\AccessibilityChecker\Admin (not EDAC\Admin).
Updated the use statement in Admin to match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
admin/class-plugin-list-tab.php (1)

99-106: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Return plain text from plugins_list_status_text (no HTML/count placeholder)

plugins_list_status_text output is escaped and core appends the plugin count using its own <span class="count">…</span>, so returning Equalize Digital <span class="count">(%s)</span> will render escaped markup and cause incorrect/duplicated count display.

💡 Proposed fix
-		// translators: %s: Number of plugins.
-		return \_nx( 'Equalize Digital <span class="count">(%s)</span>', 'Equalize Digital <span class="count">(%s)</span>', $count, 'plugin status', 'accessibility-checker' );
+		return \_nx( 'Equalize Digital', 'Equalize Digital', $count, 'plugin status', 'accessibility-checker' );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@admin/class-plugin-list-tab.php` around lines 99 - 106, The method
get_status_text currently returns HTML with a count placeholder which gets
escaped and duplicates core's count; change it to return plain translated text
without any HTML or '%s' placeholder when self::STATUS_SLUG === $type. Replace
the current \_nx call with one that supplies plain singular and plural strings
(both "Equalize Digital") and the same $count and context (e.g., use _nx(
'Equalize Digital', 'Equalize Digital', $count, 'plugin status',
'accessibility-checker' )) so the core can append its own <span
class="count">…</span>.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@admin/class-plugin-list-tab.php`:
- Around line 99-106: The method get_status_text currently returns HTML with a
count placeholder which gets escaped and duplicates core's count; change it to
return plain translated text without any HTML or '%s' placeholder when
self::STATUS_SLUG === $type. Replace the current \_nx call with one that
supplies plain singular and plural strings (both "Equalize Digital") and the
same $count and context (e.g., use _nx( 'Equalize Digital', 'Equalize Digital',
$count, 'plugin status', 'accessibility-checker' )) so the core can append its
own <span class="count">…</span>.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 798d84e2-4440-4b30-8b8d-7d3057248449

📥 Commits

Reviewing files that changed from the base of the PR and between 5400218 and 09e8cee.

📒 Files selected for processing (2)
  • admin/class-admin.php
  • admin/class-plugin-list-tab.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • admin/class-admin.php

WordPress core calls esc_html() on the filter return value then appends
its own <span class="count">…</span>. Returning HTML with a (%s)
placeholder caused the tags to render as visible escaped entities and
the count to appear twice. Plain text lets core format the label correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SteveJonesDev
SteveJonesDev requested a review from pattonwebz May 27, 2026 19:00

@pattonwebz pattonwebz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just one comment about unneeded _nx use. Otherwise seems good to me.

Comment thread admin/class-plugin-list-tab.php Outdated
SteveJonesDev and others added 2 commits May 27, 2026 15:52
With only 2 plugins the filter tab adds little value; 3 ensures the
user has a meaningful suite of plugins before the tab appears.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'Equalize Digital' is a brand name that doesn't inflect, and the tab
only appears with 3+ plugins so the singular form is unreachable.
__ is sufficient and avoids a pointless duplicate translation string.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@SteveJonesDev

Copy link
Copy Markdown
Member Author

Holding on this PR to see if this Trac ticket makes it into core. https://core.trac.wordpress.org/ticket/65359

@SteveJonesDev
SteveJonesDev marked this pull request as draft May 27, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants