Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions admin/AdminPage/FixesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public function __construct( $settings_capability ) {

/**
* Add the settings sections and fields and setup it's tabs and filter in for the content.
*
* @return void
*/
public function add_page() {

Expand Down Expand Up @@ -116,6 +118,8 @@ public function add_slug_to_admin_notices( $slugs ) {

/**
* Render the page.
*
* @return void
*/
public function render_page() {
include_once EDAC_PLUGIN_DIR . 'partials/admin-page/fixes-page.php';
Expand All @@ -125,6 +129,8 @@ public function render_page() {
* Register the settings sections for this options page.
*
* Sections are passed through a filter so that other plugins can add their own.
*
* @return void
*/
public function register_settings_sections() {

Expand Down Expand Up @@ -172,6 +178,8 @@ public function register_settings_sections() {
* Register the settings fields and settings for this options page.
*
* It passed through a filter so that other plugins can add their own settings.
*
* @return void
*/
public function register_fields_and_settings() {
/**
Expand Down Expand Up @@ -215,6 +223,8 @@ public function register_fields_and_settings() {

/**
* Callback for the general settings section that renders a description for it.
*
* @return void
*/
public function fixes_section_general_cb() {
echo '<p>' . esc_html__( 'These fixes help improve accessibility by modifying HTML elements and behaviors on your site.', 'accessibility-checker' ) . '</p>';
Expand Down
1 change: 1 addition & 0 deletions admin/AdminPage/FixesSettingType/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ trait Checkbox {
* Render a checkbox input.
*
* @param array $args The arguments for the checkbox. This is expected to have a name and a description.
* @return void
*/
public static function checkbox( $args ) {

Expand Down
1 change: 1 addition & 0 deletions admin/AdminPage/FixesSettingType/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ trait Text {
* Render a text input.
*
* @param array $args The arguments for the text input. This is expected to have a name and a description.
* @return void
*/
public static function text( $args ) {
// We need a name and a description or the text field is useless.
Expand Down
4 changes: 4 additions & 0 deletions admin/AdminPage/PageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ public function __construct( $settings_capability );

/**
* Add the page to the admin menu and register any settings.
*
* @return void
*/
public function add_page();

/**
* Render the page.
*
* @return void
*/
public function render_page();
}
1 change: 1 addition & 0 deletions admin/class-activation-redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Activation_Redirect {
* Initialize the activation redirect.
*
* @since 1.36.0
* @return void
*/
public function init(): void {
add_action( 'admin_init', [ $this, 'maybe_redirect_to_welcome' ] );
Expand Down
1 change: 1 addition & 0 deletions admin/class-admin-footer-text.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Admin_Footer_Text {
* Initialize the admin footer text filter.
*
* @since 1.27.0
* @return void
*/
public function init() {
add_filter( 'admin_footer_text', [ $this, 'filter_footer_text' ] );
Expand Down
4 changes: 3 additions & 1 deletion admin/class-enqueue-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public function __construct() {

/**
* Enqueue the scripts and styles.
*
* @return void
*/
public static function enqueue() {
self::enqueue_styles();
Expand Down Expand Up @@ -108,7 +110,7 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
$debug = false;
}

wp_enqueue_script( 'edac-editor-app', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/editorApp.bundle.js', false, EDAC_VERSION, false );
wp_enqueue_script( 'edac-editor-app', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/editorApp.bundle.js', [], EDAC_VERSION, false );
wp_set_script_translations( 'edac-editor-app', 'accessibility-checker', plugin_dir_path( EDAC_PLUGIN_FILE ) . 'languages' );

// If this is the frontpage or homepage, preview URLs won't work. Use the live URL.
Expand Down
2 changes: 2 additions & 0 deletions admin/class-frontend-highlight.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function get_issues( $post_id ) {

/**
* AJAX handler function for frontend highlighting requests.
*
* @return void
*/
public function ajax() {

Expand Down
19 changes: 10 additions & 9 deletions admin/class-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ function ( $item ) {
/**
* Localizes the format of a number.
*
* @param int $number number to format.
* @param integer $precision number of decimals.
* @return integer
* @param int|float $number number to format.
* @param integer $precision number of decimals.
* @return string|false
*/
public static function format_number( $number, $precision = 0 ) {

Expand All @@ -62,9 +62,9 @@ public static function format_number( $number, $precision = 0 ) {
/**
* Localizes the format of a percentage.
*
* @param init $number number to format.
* @param integer $precision number of decimals.
* @return integer
* @param int|float $number number to format.
* @param integer $precision number of decimals.
* @return string|int|float
*/
public static function format_percentage( $number, $precision = 2 ) {

Expand All @@ -91,9 +91,9 @@ public static function format_percentage( $number, $precision = 2 ) {
/**
* Localizes the format of a date.
*
* @param string $date date to format.
* @param boolean $include_time whether to include time in the formatted date.
* @return integer
* @param int|string $date date to format, as a Unix timestamp or date string.
* @param boolean $include_time whether to include time in the formatted date.
* @return string
*/
public static function format_date( $date, $include_time = false ) {

Expand Down Expand Up @@ -191,6 +191,7 @@ public static function is_domain_loopback( $domain ) {
* Filter out inactive rules from the results returned.
*
* @param array $results The results to filter.
* @return array
*/
public static function filter_results_to_only_active_rules( $results ): array {
// determine which rules are active.
Expand Down
2 changes: 1 addition & 1 deletion admin/class-issues-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Issues_Query {
*
* @param array $filter [post_types, rule_types, rule_slugs].
* @param integer $record_limit Max number of records we'll query.
* @param string $flags Flag used to determine how ignored issues sould be handled.
* @param int $flags Flag used to determine how ignored issues sould be handled.
*/
public function __construct( $filter = [], $record_limit = 100000, $flags = self::FLAG_EXCLUDE_IGNORED ) {
$valid_filters = [
Expand Down
1 change: 1 addition & 0 deletions admin/class-orphaned-issues-cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public function get_orphaned_post_ids(): array {
* @since 1.29.0
*
* @param int $post_id The orphaned post ID.
* @return void
*/
public function delete_orphaned_post( int $post_id ) {
Purge_Post_Data::delete_post( $post_id );
Expand Down
2 changes: 1 addition & 1 deletion admin/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Settings {
/**
* Gets a list of post statuses that are scannable.
*
* @var array
* @return array
*/
public static function get_scannable_post_statuses() {
/**
Expand Down
2 changes: 2 additions & 0 deletions admin/class-update-database.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public function __construct() {

/**
* Initialize WordPress hooks
*
* @return void
*/
public function init_hooks() {
add_action( 'admin_init', [ $this, 'edac_update_database' ], 10 );
Expand Down
2 changes: 1 addition & 1 deletion admin/class-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function render_dashboard_scan_summary() {
<a href="/wp-admin/admin.php?page=accessibility_checker_settings">Edit Accessibility Checker Settings</a>
</div>';

$meetup_html = edac_get_upcoming_meetups_html( 'wordpress-accessibility-meetup-group', 2, 4 );
$meetup_html = edac_get_upcoming_meetups_html( 'wordpress-accessibility-meetup-group', 2, '4' );
if ( ! empty( $meetup_html ) ) {
$html .= '
<hr class="edac-hr" />
Expand Down
6 changes: 4 additions & 2 deletions admin/opt-in/class-email-opt-in.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Email_Opt_In {

/**
* Checks if the current user already opted in.
*
* @return bool
*/
public static function user_already_subscribed(): bool {
return (bool) get_user_meta(
Expand Down Expand Up @@ -57,8 +59,8 @@ public static function should_show_modal(): bool {
*/
public function enqueue_scripts() {

wp_enqueue_style( 'email-opt-in-form', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/css/emailOptIn.css', false, EDAC_VERSION, 'all' );
wp_enqueue_script( 'email-opt-in-form', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/emailOptIn.bundle.js', false, EDAC_VERSION, true );
wp_enqueue_style( 'email-opt-in-form', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/css/emailOptIn.css', [], EDAC_VERSION, 'all' );
wp_enqueue_script( 'email-opt-in-form', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/emailOptIn.bundle.js', [], EDAC_VERSION, true );
wp_set_script_translations( 'email-opt-in-form', 'accessibility-checker', plugins_url( 'languages', EDAC_PLUGIN_FILE ) );

wp_localize_script(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public static function get_type(): string {

/**
* Register anything needed for the fix.
*
* @return void
*/
public function register(): void {
add_filter(
Expand Down Expand Up @@ -97,6 +99,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix.
*
* @return void
*/
public function run(): void {
// Intentionally left empty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix for adding the comment and search form labels.
*
* @return void
Comment on lines 116 to +118
*/
public function run(): void {

Expand Down
4 changes: 4 additions & 0 deletions includes/classes/Fixes/Fix/AddNewWindowWarningFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix for adding the comment and search form labels.
*
* @return void
Comment on lines 91 to +93
*/
public function run(): void {
if ( ! get_option( 'edac_fix_' . $this->get_slug(), false ) ) {
Expand Down Expand Up @@ -125,6 +127,8 @@ function ( $data ) {

/**
* Add the styles for the new window warning.
*
* @return void
*/
public function add_styles() {
$font_url = EDAC_PLUGIN_URL . 'assets/fonts';
Expand Down
4 changes: 4 additions & 0 deletions includes/classes/Fixes/Fix/BlockPDFUploadsFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public static function get_type(): string {

/**
* Register setting.
*
* @return void
*/
public function register(): void {
// Add the settings field for the fix.
Expand Down Expand Up @@ -91,6 +93,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix.
*
* @return void
*/
public function run() {
// Intentionally empty - this run method should be implemented in an extension class.
Expand Down
2 changes: 2 additions & 0 deletions includes/classes/Fixes/Fix/CommentSearchLabelFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix for adding the comment and search form labels.
*
* @return void
*/
public function run(): void {

Expand Down
2 changes: 2 additions & 0 deletions includes/classes/Fixes/Fix/MetaViewportScalableFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix setting a scalable meta viewport tag.
*
* @return void
*/
public function run(): void {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix for adding the comment and search form labels.
*
* @return void
Comment on lines 89 to +91
*/
public function run(): void {
if ( ! get_option( 'edac_fix_' . $this->get_slug(), false ) ) {
Expand Down
5 changes: 4 additions & 1 deletion includes/classes/Fixes/Fix/SkipLinkFix.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ public function get_fields_array( array $fields = [] ): array {

/**
* Run the fix for adding the skip link to the site.
*
* @return void
*/
public function run() {
if ( ! get_option( 'edac_fix_add_skip_link', false ) ) {
return null;
return;
}

add_action( 'wp_body_open', [ $this, 'add_skip_link' ] );
Expand All @@ -133,6 +135,7 @@ public function run() {
return;
}

$targets = [];
$targets_list = explode( ',', $targets_string );

foreach ( $targets_list as $target ) {
Expand Down
4 changes: 4 additions & 0 deletions includes/classes/Fixes/FixInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public static function get_type(): string;
*
* Fixes are responsible for implementing their own 'run' method and binding it in here
* if they are not just simple hooks.
*
* @return void
*/
public function register(): void;

Expand All @@ -59,6 +61,8 @@ public function get_fields_array( array $fields = [] ): array;
* Run the fix.
*
* This will be called in admin only, frontend only or everywhere depending on the fix type.
*
* @return void
*/
public function run();
}
Loading
Loading