Skip to content

Commit

Permalink
Merge pull request #626 from equalizedigital/release/1.12.0
Browse files Browse the repository at this point in the history
Release v1.12.0
  • Loading branch information
pattonwebz committed May 15, 2024
2 parents 74ec4d3 + f921ce7 commit 6039627
Show file tree
Hide file tree
Showing 24 changed files with 462 additions and 854 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/deploy-on-release-to-dot-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,3 @@ jobs:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
BUILD_DIR: ./dist/${{ github.event.repository.name }}/

- name: Upload release asset
if: github.event.release # can only run in context of a release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.dist-build.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
15 changes: 13 additions & 2 deletions accessibility-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Accessibility Checker
* Plugin URI: https://a11ychecker.com
* Description: Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.
* Version: 1.11.2
* Version: 1.12.0
* Author: Equalize Digital
* Author URI: https://equalizedigital.com
* License: GPL-2.0+
Expand All @@ -35,7 +35,7 @@

// Current plugin version.
if ( ! defined( 'EDAC_VERSION' ) ) {
define( 'EDAC_VERSION', '1.11.2' );
define( 'EDAC_VERSION', '1.12.0' );
}

// Current database version.
Expand Down Expand Up @@ -149,6 +149,17 @@ function edac_register_rules() {
// If we got this far, this is the 1st time we called this function.
// We need to load the rules from the filesystem, and apply any filters.
$default_rules = include __DIR__ . '/includes/rules.php';
/**
* Filter the default rules.
*
* Allows removing or adding rules. If you are adding a rule make
* sure you have added a function matching the pattern:
* `edac_rule_{$rule_id}`.
*
* @since 1.4.0
*
* @param array $default_rules The default rules.
*/
$default_rules = apply_filters( 'edac_filter_register_rules', $default_rules );

return $default_rules;
Expand Down
7 changes: 7 additions & 0 deletions admin/class-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ public function edac_review_notice_ajax() {
* @return string
*/
public function edac_password_protected_notice_text() {
/**
* Filter the password protected notice text.
*
* @since 1.4.0
*
* @param string $text The password protected notice text.
*/
return apply_filters(
'edac_filter_password_protected_notice_text',
sprintf(
Expand Down
15 changes: 15 additions & 0 deletions admin/class-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ function ( $a, $b ) {
$rules = array_merge( $error_rules, $warning_rules, $passed_rules );

if ( $rules ) {
/**
* Filters if a user can ignore issues.
*
* @since 1.4.0
*
* @allowed bool True if allowed, false if not
*/
$ignore_permission = apply_filters( 'edac_ignore_permission', true );
foreach ( $rules as $rule ) {
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Using direct query for interacting with custom database, safe variable used for table name, caching not required for one time operation.
Expand Down Expand Up @@ -509,6 +516,14 @@ public function readability() {
}
}

/**
* Filter the content used for reading grade readability analysis.
*
* @since 1.4.0
*
* @param string $content The content to be filtered.
* @param int $post_id The post ID.
*/
$content = apply_filters( 'edac_filter_readability_content', $content, $post_id );
$content = wp_filter_nohtml_kses( $content );
$content = str_replace( ']]>', ']]>', $content );
Expand Down
10 changes: 9 additions & 1 deletion admin/class-insert-rule-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,15 @@ public function insert( object $post, string $rule, string $ruletype, string $ru
// Insert new records.
if ( ! $results ) {

// filter post types.
/**
* Filter the rule data before inserting it into the database.
*
* This data will be sanitized after the filter is applied.
*
* @since 1.4.0
*
* @param array $rule_data The rule data.
*/
$rule_data = apply_filters( 'edac_filter_insert_rule_data', $rule_data );

// Sanitize rule data since it is filtered, and we can't be sure
Expand Down
10 changes: 10 additions & 0 deletions admin/class-meta-boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,18 @@ public function register_meta_boxes(): void {
* @return void
*/
public function render(): void {
/**
* Fires before the meta box is rendered.
*
* @since 1.10.0
*/
do_action( 'edac_before_meta_box' );
include_once plugin_dir_path( __DIR__ ) . 'partials/custom-meta-box.php';
/**
* Fires after the meta box is rendered.
*
* @since 1.10.0
*/
do_action( 'edac_after_meta_box' );
}
}
2 changes: 2 additions & 0 deletions admin/class-scans-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ function ( $item ) {
$formatting['passed_percentage_formatted'] = Helpers::format_percentage( $data['passed_percentage'] );
$formatting['avg_issue_density_percentage_formatted'] = Helpers::format_percentage( $data['avg_issue_density_percentage'] );

$formatting['cached_at_formatted'] = Helpers::format_date( $data['cached_at'], true );

$data = array_merge( $data, $formatting );

if ( $data['posts_scanned'] > 0 ) {
Expand Down
2 changes: 1 addition & 1 deletion admin/class-welcome-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static function render_summary() {
<div class="edac-inner-row">
<?php if ( $summary['fullscan_completed_at'] > 0 ) : ?>
<div class="edac-stat-number edac-timestamp-to-local">
<?php echo esc_html( $summary['fullscan_completed_at_formatted'] ); ?>
<?php echo isset( $summary['cached_at_formatted'] ) ? esc_html( $summary['cached_at_formatted'] ) : esc_html( $summary['fullscan_completed_at_formatted'] ); ?>
</div>
<?php else : ?>
<div class="edac-stat-number">
Expand Down
12 changes: 10 additions & 2 deletions admin/site-health/class-information.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Information {
*/
public function __construct() {
}

/**
* Initialize class hooks.
*
Expand Down Expand Up @@ -63,7 +63,15 @@ private function get_edac_data() {
$information[ $key ] = $class->get();
}

// Allow extensions to add their own debug information that's specific to EDAC.
/**
* Filter the debug information.
*
* Allows extensions to add their own debug information that's specific to EDAC.
*
* @since 1.6.10
*
* @param array $information The debug information.
*/
return apply_filters( 'edac_debug_information', $information );
}
}
34 changes: 34 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
Newer versions can be found in readme.txt.

= 1.9.3 =
* Updated: capability checks for the welcome page, dashboard widget, and admin notices

= 1.9.2 =
* Fixed: filtered rules are not passed to the frontend highlighter, avoiding 'null' state issues
* Updated: frontend highlighter buttons to be disabled until issues are confirmed
* Updated: frontend highlighter buttons to show only after we know there are issues to display
* Updated: frontend highlighter to not show buttons if none are returned

= 1.9.1 =
* Updated: `edac_include_rules_files to fire on init action to fix the `edac_filter_register_rules` filter timing

= 1.9.0 =
* Created: class that creates the accessibility statement on activation
* Removed: custom database query that checked for existing accessibility statement in exchange for the `get_page_by_path()` function
* Fixed: bug with trying to compare the simplified summary ordinal value and added fallback
* Removed: `wp_send_json_error()` from `simplified_summary` Ajax function when the simplified summary is empty
* Added: simplified summary grade*level, message, and icon logic to the `summary()` Ajax
* Fixed: issue with the submit button text showing as `Submit Query` in Firefox.
* Updated: missing transcript rule to skip certain types of links
* Added: missing UTM parameters to the welcome page URLs.
* Removed: legacy system information code
* Removed: cbschuld/browser.php composer package
* Added: class structure for site health
* Added: site health health information for free, pro, and audit history plugins
* Added: update database class
* Removed: `edac_before_page_render` functions from the main file
* Added: frontend validate class
* Added: frontend validate unit tests
* Removed: unused new window warning meta update functions
* Fixed: front end highlight focus issue
* Added: summary generator class to replace the `edac_summary()` function
* Deprecated: `edac_summary()` function

= 1.8.1 =
* Fixed: false positives on the incorrect heading order rule
* Added: fallback to determine ordinal when php intl extension is not installed
Expand Down
42 changes: 42 additions & 0 deletions includes/classes/class-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ public function set_post_scan_results( $request ) {

try {

/**
* Fires before the validation process starts.
*
* This is only running in the JS check context.
*
* @since 1.5.0
*
* @param int $post_id The post ID.
* @param string $type The type of validation which is always 'js' in this path.
*/
do_action( 'edac_before_validate', $post_id, 'js' );

$violations = $request['violations'];
Expand Down Expand Up @@ -234,16 +244,48 @@ public function set_post_scan_results( $request ) {
//phpcs:ignore Generic.Commenting.Todo.TaskFound, Squiz.PHP.CommentedOutCode.Found
// TODO: add support storing $violation['selector'], $violation['tags'].

/**
* Fires before a rule is run against the content.
*
* This is only running in the JS check context.
*
* @since 1.5.0
*
* @param int $post_id The post ID.
* @param string $rule_id The rule ID.
* @param string $type The type of validation which is always 'js' in this path.
*/
do_action( 'edac_before_rule', $post_id, $rule_id, 'js' );

( new Insert_Rule_Data() )->insert( $post, $rule_id, $impact, $html );

/**
* Fires after a rule is run against the content.
*
* This is only running in the JS check context.
*
* @since 1.5.0
*
* @param int $post_id The post ID.
* @param string $rule_id The rule ID.
* @param string $type The type of validation which is always 'js' in this path.
*/
do_action( 'edac_after_rule', $post_id, $rule_id, 'js' );

}
}
}

/**
* Fires after the validation process is complete.
*
* This is only running in the JS check context.
*
* @since 1.5.0
*
* @param int $post_id The post ID.
* @param string $type The type of validation which is always 'js' in this path.
*/
do_action( 'edac_after_validate', $post_id, 'js' );

// remove corrected records.
Expand Down
9 changes: 8 additions & 1 deletion includes/classes/class-simplified-summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,16 @@ public function output_simplified_summary( $content ) {
*/
public function simplified_summary_markup( $post ) {
$simplified_summary = get_post_meta( $post, '_edac_simplified_summary', true )
? get_post_meta( $post, '_edac_simplified_summary', true )
? get_post_meta( $post, '_edac_simplified_summary', true )
: '';

/**
* Filter the heading that gets output before the simplified summary inside an <h2> tag.
*
* @since 1.4.0
*
* @param string $simplified_summary_heading The simplified summary heading.
*/
$simplified_summary_heading = apply_filters(
'edac_filter_simplified_summary_heading',
esc_html__( 'Simplified Summary', 'accessibility-checker' )
Expand Down
7 changes: 7 additions & 0 deletions includes/helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ function edac_custom_post_types() {
* @return array
*/
function edac_post_types() {
/**
* Filter the post types that the plugin will check.
*
* @since 1.4.0
*
* @param array $post_types post types.
*/
$post_types = apply_filters( 'edac_filter_post_types', [ 'post', 'page' ] );

// remove duplicates.
Expand Down
8 changes: 7 additions & 1 deletion includes/options-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ function edac_add_options_page() {
return;
}

// settings panel filter.
/**
* Filter the capability required to access the settings page.
*
* @since 1.4.0
*
* @param string $settings_capability The capability required to access the settings page.
*/
$settings_capability = apply_filters( 'edac_filter_settings_capability', 'manage_options' );

add_submenu_page(
Expand Down

0 comments on commit 6039627

Please sign in to comment.