Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
54eb791
Filter the post types at save time
pattonwebz Aug 5, 2025
d9439d5
Show metabox on the virtual post
pattonwebz Aug 6, 2025
99cbbde
Add filter for customizable post view link in AJAX response
pattonwebz Aug 6, 2025
c45b2f5
Refactor post ID retrieval to use a filter for enhanced flexibility
pattonwebz Aug 11, 2025
6e5703f
Refactor filter name for virtual page links
pattonwebz Aug 12, 2025
d983812
Hide readability section for virtual pages with display:none
pattonwebz Aug 12, 2025
271affd
Refactor post type retrieval to use filter for scannable post types
pattonwebz Aug 12, 2025
df67427
No longer need to check for old pro settings class
pattonwebz Aug 18, 2025
ab13da2
Return pro value right away if pro get_scannable_posts_types exists
pattonwebz Aug 18, 2025
6142569
Include 'Archives' as a custom post type in
pattonwebz Aug 18, 2025
069d9e4
refactored: virtual page check to use dedicated function for improved…
SteveJonesDev Aug 18, 2025
0873d1e
Fire an action before clearing cpt issues
pattonwebz Aug 18, 2025
e345aed
added: unit tests for edac_is_virtual_page function to enhance coverage
SteveJonesDev Aug 18, 2025
6e5e3ed
Merge pull request #1201 from equalizedigital/steve/no-issue/update-c…
SteveJonesDev Aug 18, 2025
f2bd12e
Allow scannable posts to cover virtual posts
pattonwebz Aug 20, 2025
bc4bc75
Fix a badly named filter name
pattonwebz Aug 20, 2025
0c5ff01
Refactor to use Settings::get_scannable_post_types() for post type re…
pattonwebz Aug 21, 2025
e4310ca
Don't output archive as a scannable post type in settings or visible …
pattonwebz Aug 21, 2025
fd255b7
Merge remote-tracking branch 'origin/develop' into william/pro-169-fi…
pattonwebz Aug 21, 2025
15e4287
Add a flag to skip over filtering in virtual post type to the scannables
pattonwebz Aug 21, 2025
0942007
Skip the filtering when getting scannable_post_types in 2 places
pattonwebz Aug 21, 2025
8b7c400
Refactor virtual page references to use VirtualItem
pattonwebz Aug 21, 2025
1479e49
Refactor virtual content namespace and class references
pattonwebz Aug 21, 2025
b42c504
Add system settings section to options page and move the delete setti…
pattonwebz Aug 25, 2025
cc29ba6
Add helper to check if Pro version of the plugin is active and in use
pattonwebz Aug 25, 2025
b926db8
Genericize the pro upsell bubble name, classes and markers
pattonwebz Aug 25, 2025
f2c626e
Update 'General Settings' to 'Scan Settings' on options page
pattonwebz Aug 25, 2025
7b2fe61
Include some pro setting upsells here with nulling sanitizer callbacks
pattonwebz Aug 25, 2025
3da0f7a
Fix pro upsell tagging with utm-content
pattonwebz Aug 25, 2025
6cd7e6c
Rename scan speed settings for consistency and back compatibility
pattonwebz Aug 25, 2025
7cf16c9
Add settings fields for ignoring user roles and simplified summary he…
pattonwebz Aug 25, 2025
2841157
Update some names of scan settings to be edacp for consistency with w…
pattonwebz Aug 25, 2025
1fe997b
Refactor sanitization functions for scan speed and remove Pro-only fe…
pattonwebz Aug 25, 2025
6b7f7d1
Deregister all the settings registration that happens in pro plugin
pattonwebz Aug 25, 2025
fe5688c
Move the taxonomy scanning checkbox enable/disable code info free
pattonwebz Aug 25, 2025
bc5c1ce
Refactor pro settings sanitization for backwards compatibility
pattonwebz Aug 25, 2025
89d8213
Add option to ignore user roles during activation
pattonwebz Aug 25, 2025
b255202
Make edac_is_pro slightly more rigid
pattonwebz Aug 26, 2025
ec9da2c
Run the inline upsell bubble code if the classes exist on the page
pattonwebz Aug 26, 2025
1a6228f
Fix some label_for vales
pattonwebz Aug 26, 2025
04d33f6
Fix a mismatched label_for
pattonwebz Aug 26, 2025
aa56926
Move the Archive checkbox toggle code to inside existing window load …
pattonwebz Aug 26, 2025
93be94e
Handle disabled state on the fieldset for screen readers as well when…
pattonwebz Aug 26, 2025
ab9bdb2
Add some desciptions and labeling to some callbacks, use `selected()`…
pattonwebz Aug 26, 2025
c150739
Harden the upsell url generation against possible missing values
pattonwebz Aug 26, 2025
90aa188
fix some line endings and whitespace in helpers file
pattonwebz Aug 26, 2025
96a5305
Remove extra + character on line
pattonwebz Aug 26, 2025
0e4b108
Add some initial defaults for saving values on some settings when not…
pattonwebz Aug 26, 2025
7622b19
Handle possible array name keys in bubble upsell link generation
pattonwebz Aug 26, 2025
953d1e9
Merge branch 'william/pro-169-filter-post-types-at-save-time' into wi…
pattonwebz Aug 26, 2025
800271c
Update mock class in test to reflect the current path and name in pro
pattonwebz Aug 26, 2025
c59d654
Merge pull request #1208 from equalizedigital/william/no-issue/move-p…
pattonwebz Aug 26, 2025
f4bf0b2
Refactor post type change detection to compare sorted arrays
pattonwebz Aug 26, 2025
9d1d6af
Add a Permission section for ignore permissions setting
pattonwebz Aug 26, 2025
23e8fe6
Update documentation for virtual page check to use VirtualItemType:PO…
pattonwebz Aug 26, 2025
8a4c686
Add back in the old upsell bubble class for back compat
pattonwebz Aug 26, 2025
819c1c1
Update the scan settings messaging
pattonwebz Aug 26, 2025
d99c4ca
Use a more direct comparison for types before and after setting save
pattonwebz Aug 26, 2025
0a3b14b
Update messaging for settings permission section
pattonwebz Aug 26, 2025
f5b5fea
Do 'edac_pro_setting_saving_checkbox' when saving archive scan setting
pattonwebz Aug 27, 2025
a61432c
Remove an unused sanitizer wrapper
pattonwebz Aug 27, 2025
0ab9548
Refactor scan stats handling to improve clarity
pattonwebz Aug 27, 2025
57cce49
Use edac_is_pro helper instead of direct constant check
pattonwebz Aug 27, 2025
4fc1925
Make comment more clear
pattonwebz Aug 27, 2025
e2dca0b
Make edac_get_origin_url_for_virtual_page accept string as first param
pattonwebz Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion admin/class-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,17 @@ function ( $a, $b ) {

if ( ! isset( $rule['viewable'] ) || $rule['viewable'] ) {

$post_view_link = apply_filters(
'edac_details_post_view_link',
$postid
);
Comment on lines +491 to +498

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.

🛠️ Refactor suggestion

Add PHPDoc documentation for the new filter hook.

The filter hook implementation is correct and follows the edac_ prefix convention, but it lacks proper documentation. According to the coding guidelines, all custom hooks should be documented with clear descriptions and parameter types.

Add PHPDoc documentation above the filter:

+			/**
+			 * Filters the URL used for the "View on page" link in accessibility issue details.
+			 *
+			 * This filter allows customization of the URL, which is particularly useful for
+			 * virtual pages or custom post types that may need special URL handling.
+			 *
+			 * @since [version]
+			 *
+			 * @param int $postid The post ID for which to generate the view link.
+			 * @return string The URL to use for the "View on page" link.
+			 */
 			$post_view_link = apply_filters(
 				'edac_details_post_view_link',
 				$postid
 			);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$post_view_link = apply_filters(
'edac_details_post_view_link',
$postid
);
/**
* Filters the URL used for the "View on page" link in accessibility issue details.
*
* This filter allows customization of the URL, which is particularly useful for
* virtual pages or custom post types that may need special URL handling.
*
* @since [version]
*
* @param int $postid The post ID for which to generate the view link.
* @return string The URL to use for the "View on page" link.
*/
$post_view_link = apply_filters(
'edac_details_post_view_link',
$postid
);
🤖 Prompt for AI Agents
In admin/class-ajax.php around lines 491 to 494, the new filter hook
'edac_details_post_view_link' lacks PHPDoc documentation. Add a PHPDoc block
above the apply_filters call describing the filter's purpose, the expected
parameter type (post ID as an integer), and the return type. Follow the existing
coding guidelines for documenting custom hooks with clear descriptions and
parameter annotations.


$url = add_query_arg(
[
'edac' => $id,
'edac_nonce' => wp_create_nonce( 'edac_highlight' ),
],
get_the_permalink( $postid )
is_string( $post_view_link ) ? $post_view_link : get_the_permalink( $postid )
);

// Translators: %d is the issue ID.
Expand Down
2 changes: 1 addition & 1 deletion admin/class-meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function init_hooks(): void {
* @return void
*/
public function register_meta_boxes(): void {
$post_types = get_option( 'edac_post_types' );
$post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );

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.

💡 Verification agent

🧩 Analysis chain

Filter name doesn't follow coding guidelines.

The filter name uses edacp_ prefix instead of the required edac_ prefix as specified in the coding guidelines.

Apply this diff to use the correct prefix:

-		$post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
+		$post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );

Please verify that this filter name change is applied consistently across the codebase:


🏁 Script executed:

#!/bin/bash
# Description: Check for consistent usage of the filter name across the codebase
# Expected: All occurrences should use the same filter name

echo "Searching for the current filter name with edacp_ prefix:"
rg "edacp_fill_site_scan_scannable_post_types" -A 2 -B 2

echo -e "\nSearching for similar filter names with edac_ prefix:"
rg "edac_fill_site_scan_scannable_post_types" -A 2 -B 2

echo -e "\nSearching for all edacp_ prefixed filters:"
rg "edacp_" -A 1 -B 1

Length of output: 4640


Filter hook prefix should use edac_ instead of edacp_

Coding guidelines require a edac_ prefix for custom hooks and filters. We currently have two occurrences of edacp_fill_site_scan_scannable_post_types that need updating:

• includes/classes/class-rest-api.php
• admin/class-meta-boxes.php

Proposed diffs:

diff --git a/includes/classes/class-rest-api.php b/includes/classes/class-rest-api.php
--- a/includes/classes/class-rest-api.php
+++ b/includes/classes/class-rest-api.php
-        $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
+        $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
diff --git a/admin/class-meta-boxes.php b/admin/class-meta-boxes.php
--- a/admin/class-meta-boxes.php
+++ b/admin/class-meta-boxes.php
-        $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
+        $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );

Also, search the codebase for any remaining edacp_fill_site_scan_scannable_post_types references (documentation, tests, external integrations) to ensure consistency.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
// admin/class-meta-boxes.php
- $post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
+ $post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', get_option( 'edac_post_types' ) );
🤖 Prompt for AI Agents
In admin/class-meta-boxes.php at line 34, the filter hook prefix is incorrectly
using 'edacp_' instead of the required 'edac_'. Change the filter hook name from
'edacp_fill_site_scan_scannable_post_types' to
'edac_fill_site_scan_scannable_post_types'. Additionally, search the entire
codebase for any other occurrences of
'edacp_fill_site_scan_scannable_post_types' including in
includes/classes/class-rest-api.php, documentation, tests, and external
integrations, and update them to use the correct 'edac_' prefix for consistency.

if ( $post_types ) {
foreach ( $post_types as $post_type ) {
add_meta_box(
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/class-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function set_post_scan_results( $request ) {
}

$post_type = get_post_type( $post );
$post_types = Helpers::get_option_as_array( 'edac_post_types' );
$post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );

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.

medium

The filter name edacp_fill_site_scan_scannable_post_types is quite long and potentially misleading. The context here is saving results for a single post scan, not a 'site scan'. A more concise and accurate name would improve readability and maintainability. Consider renaming it to something like edacp_scannable_post_types to better reflect its purpose and align with the naming conventions of other hooks in the project.

$post_types = apply_filters( 'edacp_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );

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.

⚠️ Potential issue

Use edac_ prefix for the custom filter hook.

The filter name edacp_fill_site_scan_scannable_post_types doesn't follow the established edac_ prefix convention used throughout the codebase for custom hooks and filters.

Apply this diff to use the correct prefix:

-		$post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
+		$post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$post_types = apply_filters( 'edacp_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
$post_types = apply_filters( 'edac_fill_site_scan_scannable_post_types', Helpers::get_option_as_array( 'edac_post_types' ) );
🤖 Prompt for AI Agents
In includes/classes/class-rest-api.php at line 300, the filter hook name uses
the incorrect prefix 'edacp_'. Change the filter name from
'edacp_fill_site_scan_scannable_post_types' to
'edac_fill_site_scan_scannable_post_types' to follow the established 'edac_'
prefix convention used in the codebase.

if ( empty( $post_types ) || ! in_array( $post_type, $post_types, true ) ) {

return new \WP_REST_Response( [ 'message' => 'The post type is not set to be scanned.' ], 400 );
Expand Down