-
Notifications
You must be signed in to change notification settings - Fork 19
added: plugin action links class to add Settings and Get Pro links #1051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SteveJonesDev
merged 14 commits into
develop
from
steve/pro-190-plugin-action-links-add-get-accessibility-checker-pro-and
Jul 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f120582
added: plugin Action Links class and styles for admin interface
SteveJonesDev 4921b4e
refactor: Plugin_Action_Links constructor and update method signature…
SteveJonesDev 2fbe24e
fix: Add conditional check for EDAC_PLUGIN_FILE in init_hooks method
SteveJonesDev 8130835
fix: Add conditional check for EDAC_KEY_VALID in plugin_action_links …
SteveJonesDev b39ebe9
fix: Correct method name in init_hooks and update docblock for add_pl…
SteveJonesDev 2723257
refactor: Remove constructor and improve URL escaping in action links
SteveJonesDev 36f16c4
Update translation files (POT/JSON)
SteveJonesDev c7f040d
Merge pull request #1052 from equalizedigital/update-translations/ste…
SteveJonesDev ed55e76
test: Add unit tests for Plugin_Action_Links methods and functionality
SteveJonesDev 4c4e8e7
fix: Update assertion in init_hooks test to check for filter registra…
SteveJonesDev 55b5ab7
test: Refactor setupMocks method to define constants and mock functio…
SteveJonesDev 26165ae
test: Update add_plugin_action_links tests to check pro link visibili…
SteveJonesDev afa15f5
doc: Add missing @since annotation to Plugin_Action_Links class and i…
SteveJonesDev f72d9ca
Update admin/class-plugin-action-links.php
SteveJonesDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
| /** | ||
| * Plugin Action Links class file for the Accessibility Checker plugin. | ||
| * | ||
| * @package Accessibility_Checker | ||
| */ | ||
|
|
||
| namespace EDAC\Admin; | ||
|
|
||
| /** | ||
| * Plugin Action Links handling class. | ||
| */ | ||
| class Plugin_Action_Links { | ||
|
|
||
| /** | ||
| * Initialize hooks. | ||
| * | ||
| * @return void | ||
| */ | ||
| public function init_hooks(): void { | ||
| add_filter( 'plugin_action_links_' . plugin_basename( EDAC_PLUGIN_FILE ), [ $this, 'plugin_action_links' ] ); | ||
| } | ||
|
|
||
| /** | ||
| * Plugin action links. | ||
| * | ||
| * Adds action links to the plugin list table | ||
| * | ||
| * Fired by `plugin_action_links` filter. | ||
| * | ||
| * @since 1.27.0 | ||
| * @access public | ||
| * | ||
| * @param array $links An array of plugin action links. | ||
| * | ||
| * @return array An array of plugin action links. | ||
| */ | ||
| public function plugin_action_links( $links ) { // phpcs:ignore Generic.NamingConventions.ConstructorName.OldStyle | ||
|
SteveJonesDev marked this conversation as resolved.
Outdated
|
||
| $settings_link = sprintf( | ||
| '<a href="%1$s">%2$s</a>', | ||
| admin_url( 'admin.php?page=accessibility_checker_settings' ), | ||
|
SteveJonesDev marked this conversation as resolved.
Outdated
|
||
| esc_html__( 'Settings', 'accessibility-checker' ) | ||
| ); | ||
|
|
||
| array_unshift( $links, $settings_link ); | ||
|
|
||
| // Add Pro link if not already pro version. | ||
| if ( ! EDAC_KEY_VALID ) { | ||
| $go_pro_text = esc_html__( 'Get Pro', 'accessibility-checker' ); | ||
|
|
||
| $links['go_pro'] = sprintf( | ||
| '<a href="%1$s" target="_blank" class="edac-plugin-action-links__go-pro" aria-label="%2$s">%3$s</a>', | ||
| edac_link_wrapper( 'https://equalizedigital.com/accessibility-checker/pricing/', 'plugin-action-links', 'get-pro-link', false ), | ||
|
SteveJonesDev marked this conversation as resolved.
Outdated
|
||
| esc_attr__( 'Get Accessibility Checker Pro, opens in new window', 'accessibility-checker' ), | ||
| $go_pro_text | ||
| ); | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| return $links; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.