PluginProbe
Equalize Digital Accessibility Checker – WCAG, ADA, EAA and Section 508 compliance / trunk
Equalize Digital Accessibility Checker – WCAG, ADA, EAA and Section 508 compliance vtrunk
1.49.0 1.48.0 1.47.0 1.46.0 1.45.0 1.44.1 1.43.0 1.42.1 1.42.0 1.41.0 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.11.1 1.11.2 1.12.0 1.13.0 1.13.1 1.14.0 1.14.1 1.14.2 1.14.3 1.15.0 All 88 releases
accessibility-checker / accessibility-checker.php

accessibility-checker.php in Equalize Digital Accessibility Checker – WCAG, ADA, EAA and Section 508 compliance trunk, at accessibility-checker.php

166 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Accessibility Checker Plugin.
4 *
5 * @package Accessibility_Checker
6 * @link https://a11ychecker.com
7 * @since 1.0.0
8 *
9 * @wordpress-plugin
10 * Plugin Name: Accessibility Checker
11 * Plugin URI: https://equalizedigital.com/accessibility-checker
12 * Description: Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.
13 * Version: 1.49.0
14 * Requires PHP: 7.4
15 * WC requires at least: 7.1
16 * WC tested up to: 11.0
17 * Author: Equalize Digital
18 * Author URI: https://equalizedigital.com
19 * License: GPL-2.0+
20 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
21 * Text Domain: accessibility-checker
22 * Domain Path: /languages
23 */
24
25 use EDAC\Inc\Plugin;
26
27 // If this file is called directly, abort.
28 if ( ! defined( 'WPINC' ) ) {
29 die;
30 }
31
32 // Include plugin dependency.
33 require_once ABSPATH . 'wp-admin/includes/plugin.php';
34
35 /**
36 * Setup constants.
37 */
38
39 // Current plugin version.
40 if ( ! defined( 'EDAC_VERSION' ) ) {
41 define( 'EDAC_VERSION', '1.49.0' );
42 }
43
44 // Current database version.
45 if ( ! defined( 'EDAC_DB_VERSION' ) ) {
46 define( 'EDAC_DB_VERSION', '1.0.7' );
47 }
48
49 // Plugin Folder Path.
50 if ( ! defined( 'EDAC_PLUGIN_DIR' ) ) {
51 define( 'EDAC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
52 }
53
54 // Plugin Folder URL.
55 if ( ! defined( 'EDAC_PLUGIN_URL' ) ) {
56 define( 'EDAC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
57 }
58
59 // Plugin Root File.
60 if ( ! defined( 'EDAC_PLUGIN_FILE' ) ) {
61 define( 'EDAC_PLUGIN_FILE', __FILE__ );
62 }
63
64 /**
65 * Key Valid.
66 */
67 define(
68 'EDAC_KEY_VALID',
69 'valid' === get_option( 'edacp_license_status' )
70 );
71
72 // Enable EDAC_DEBUG mode.
73 if ( ! defined( 'EDAC_DEBUG' ) ) {
74 define( 'EDAC_DEBUG', false );
75 }
76
77 // Default ref is empty - we don't ref links, but it can be filtered by providers.
78 if ( ! defined( 'EDAC_REF_PARAM' ) ) {
79 define( 'EDAC_REF_PARAM', '' );
80 }
81
82 // SVG Icons.
83 define( 'EDAC_SVG_IGNORE_ICON', file_get_contents( __DIR__ . '/assets/images/ignore-icon.svg' ) );
84
85
86 /**
87 * Plugin Activation & Deactivation
88 */
89 register_activation_hook( __FILE__, 'edac_activation' );
90 register_deactivation_hook( __FILE__, 'edac_deactivation' );
91
92 /**
93 * Declare compatibility with WooCommerce's High-Performance Order Storage.
94 *
95 * This plugin does not read or write order data, so it is compatible
96 * regardless of whether HPOS is enabled. No-op when WooCommerce is not
97 * active, since this hook is only fired by WooCommerce itself.
98 *
99 * @since 1.48.0
100 */
101 add_action(
102 'before_woocommerce_init',
103 function () {
104 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
105 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__ );
106 }
107 }
108 );
109
110 /* ***************************** CLASS AUTOLOADING *************************** */
111 if ( file_exists( plugin_dir_path( __FILE__ ) . 'vendor/autoload.php' ) ) {
112 include_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
113 }
114
115 if ( class_exists( 'EDAC\Inc\Plugin' ) ) {
116 new Plugin();
117 }
118
119 /**
120 * Import Resources
121 */
122 require_once plugin_dir_path( __FILE__ ) . 'includes/deprecated/deprecated.php';
123 require_once plugin_dir_path( __FILE__ ) . 'includes/activation.php';
124 require_once plugin_dir_path( __FILE__ ) . 'includes/deactivation.php';
125 require_once plugin_dir_path( __FILE__ ) . 'includes/helper-functions.php';
126 require_once plugin_dir_path( __FILE__ ) . 'includes/options-page.php';
127
128 /**
129 * Filters and Actions
130 */
131 add_action( 'admin_menu', 'edac_add_options_page' );
132 add_action( 'admin_init', 'edac_register_setting' );
133
134 /**
135 * Gets an array of default filters,
136 * and applies the rules `edac_filter_register_rules` filter to it.
137 *
138 * @return array
139 */
140 function edac_register_rules() {
141
142 // Use a static variable to avoid multiple calls to the filesystem.
143 static $default_rules = null;
144 if ( ! is_null( $default_rules ) ) {
145 return $default_rules;
146 }
147
148 // Use the new class-based rules system.
149 $default_rules = \EqualizeDigital\AccessibilityChecker\Rules\RuleRegistry::load_rules();
150
151 /**
152 * Filter the default rules.
153 *
154 * Allows removing or adding rules. If you are adding a rule make
155 * sure you have added a function matching the pattern:
156 * `edac_rule_{$rule_id}`.
157 *
158 * @since 1.4.0
159 *
160 * @param array $default_rules The default rules.
161 */
162 $default_rules = apply_filters( 'edac_filter_register_rules', $default_rules );
163
164 return $default_rules;
165 }
166