Feature: add Equalize Digital tab to WP 7.0+ Plugins screen - #1720
Feature: add Equalize Digital tab to WP 7.0+ Plugins screen#1720SteveJonesDev wants to merge 7 commits into
Conversation
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>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 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. ChangesPlugin List Tab Feature
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
admin/class-admin.phpadmin/class-plugin-list-tab.php
- 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>
There was a problem hiding this comment.
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 winReturn plain text from
plugins_list_status_text(no HTML/count placeholder)
plugins_list_status_textoutput is escaped and core appends the plugin count using its own<span class="count">…</span>, so returningEqualize 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
📒 Files selected for processing (2)
admin/class-admin.phpadmin/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>
pattonwebz
left a comment
There was a problem hiding this comment.
Just one comment about unneeded _nx use. Otherwise seems good to me.
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>
|
Holding on this PR to see if this Trac ticket makes it into core. https://core.trac.wordpress.org/ticket/65359 |
What changed
Adds a new
Plugin_List_Tabclass (admin/class-plugin-list-tab.php) and wires it intoAdmin::init().The class hooks into two filters introduced in WordPress 7.0:
plugins_list— appends anequalize-digitalstatus group containing every installed plugin whoseAuthorURIcontainsequalizedigital.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_listandplugins_list_status_textto 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
AuthorURIcontainingequalizedigital.com— reliable across both the free and Pro plugins without hardcoding slugs.MINIMUM_FOR_TAB), so the tab won't appear for users who only have one Equalize Digital plugin installed.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit