PluginProbe ʕ •ᴥ•ʔ
Web Accessibility Toolkit – Accessibility Checker & ARIA for WCAG, Section 508 & ADA Compliance / 1.5.10
Web Accessibility Toolkit – Accessibility Checker & ARIA for WCAG, Section 508 & ADA Compliance v1.5.10
trunk 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6
aria-accessibility-toolkit / aria-accessibility-toolkit.php
aria-accessibility-toolkit Last commit date
assets 6 months ago frontend 6 months ago includes 6 months ago aria-accessibility-toolkit.php 6 months ago index.php 6 months ago readme.txt 6 months ago
aria-accessibility-toolkit.php
134 lines
1 <?php
2 /**
3 * Plugin Name: Web Accessibility Toolkit
4 * Description: Scan your site for accessibility issues and apply fixes to help comply with Web Content Accessibility Guidelines.
5 * Author: WCAGforWP
6 * Author URI: https://wcagforwp.com
7 * Version: 1.5.10
8 * Text Domain: aria-accessibility-toolkit
9 * License: GPL2 or later
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) exit;
14
15
16 final class ARIAAT_Main {
17
18 /**
19 * @var The one true instance
20 * @since 1.0.0
21 */
22 protected static $_instance = null;
23
24 public $version = '1.5.10';
25
26 /**
27 * Main Instance.
28 */
29 public static function instance() {
30 if ( is_null( self::$_instance ) ) {
31 self::$_instance = new self();
32 }
33 return self::$_instance;
34 }
35
36 /**
37 * Throw error on object clone.
38 *
39 * @since 1.0.0
40 * @access protected
41 * @return void
42 */
43 public function __clone() {
44 _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '1.0.0' );
45 }
46
47 /**
48 * Disable unserializing of the class.
49 * @since 1.0.0
50 */
51 public function __wakeup() {
52 _doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '1.0.0' );
53 }
54
55 /**
56 *
57 * @since 1.0.0
58 */
59 public function __construct() {
60 $this->define_constants();
61 $this->hooks();
62 $this->includes();
63
64 do_action( 'ariaat_loaded' );
65 }
66
67 /**
68 * Define Constants.
69 * @since 1.0.0
70 */
71 private function define_constants() {
72 $this->define( 'ARIAATDIR',plugin_dir_path( __FILE__ ) );
73 $this->define( 'ARIAATURL',plugin_dir_url( __FILE__ ) );
74 $this->define( 'ARIAATBASENAME', plugin_basename( __FILE__ ) );
75 $this->define( 'ARIAATVERSION', $this->version );
76 }
77
78 /**
79 * Define hooks.
80 * @since 1.0.0
81 */
82 private function hooks() {
83 $plugin_file = ARIAATBASENAME;
84 add_filter( "plugin_action_links_{$plugin_file}", array( $this, 'plugin_action_links' ), 10, 4 );
85 }
86
87 /**
88 * Define constant if not already set.
89 * @since 1.0.0
90 */
91 private function define( $name, $value ) {
92 if ( ! defined( $name ) ) {
93 define( $name, $value );
94 }
95 }
96
97 /**
98 * Include required files.
99 * @since 1.0.0
100 */
101 public function includes() {
102 include_once ( ARIAATDIR . 'includes/class-admin.php' );
103 include_once ( ARIAATDIR . 'includes/class-menu-aria-labels.php' );
104 include_once ( ARIAATDIR . 'frontend/class-frontend.php' );
105 include_once ( ARIAATDIR . 'frontend/class-frontend-checker.php' );
106 include_once ( ARIAATDIR . 'includes/class-review-notice.php' );
107 }
108
109 /**
110 * Adds items to the plugin's action links on the Plugins listing screen.
111 *
112 * @param array<string,string> $actions Array of action links.
113 * @param string $plugin_file Path to the plugin file relative to the plugins directory.
114 * @param mixed[] $plugin_data An array of plugin data.
115 * @param string $context The plugin context.
116 * @return array<string,string> Array of action links.
117 */
118 function plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
119 $new = array(
120 'settings' => sprintf(
121 '<a href="%s">%s</a>',
122 esc_url( admin_url( 'admin.php?page=ariaat&tab=general' ) ),
123 esc_html__( 'Settings', 'aria-accessibility-toolkit' )
124 ),
125 );
126
127 return array_merge( $new, $actions );
128 }
129
130
131 }
132
133 new ARIAAT_Main();
134