diff --git a/README.txt b/README.txt index 0d3b2401..28538d75 100644 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ Contributors: equalizedigital, alh0319, stevejonesdev Tags: accessibility, accessible, wcag, ada, WP accessibility, section 508, aoda, a11y, audit, readability, content analysis Requires at least: 5.0.0 Tested up to: 6.3.1 -Stable tag: 1.6.1 +Stable tag: 1.6.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -171,6 +171,9 @@ No, Accessibility Checker runs completely on your server and does not require yo == Changelog == += 1.6.2 = +Added: check for WordPress Playground + = 1.6.1 = Updated: passed percentage calculation Updated: frontend highlighting disable styles to be compatible with optimization plugins diff --git a/accessibility-checker.php b/accessibility-checker.php index bc11cf90..7cccd8da 100644 --- a/accessibility-checker.php +++ b/accessibility-checker.php @@ -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.6.1 + * Version: 1.6.2 * Author: Equalize Digital * Author URI: https://equalizedigital.com * License: GPL-2.0+ @@ -24,6 +24,13 @@ die; } +// Check for WordPress Playground. +require_once plugin_dir_path( __FILE__ ) . 'includes/classes/class-playground-check.php'; +$plugin_check = new EDAC\Playground_Check(); +if ( ! $plugin_check->should_load ) { + return; +} + // Include plugin dependency. require_once ABSPATH . 'wp-admin/includes/plugin.php'; @@ -38,7 +45,7 @@ // Current plugin version. if ( ! defined( 'EDAC_VERSION' ) ) { - define( 'EDAC_VERSION', '1.6.1' ); + define( 'EDAC_VERSION', '1.6.2' ); } // Current database version. diff --git a/includes/classes/class-playground-check.php b/includes/classes/class-playground-check.php new file mode 100644 index 00000000..b80ee66f --- /dev/null +++ b/includes/classes/class-playground-check.php @@ -0,0 +1,46 @@ +check_site_url_and_maybe_exit(); + } + + /** + * Check the site's URL and set the should_load property accordingly. + */ + private function check_site_url_and_maybe_exit() { + $site_url = get_site_url(); + + if ( strpos( $site_url, 'playground.wordpress.net' ) !== false ) { + // This is the playground site, show an admin notice. + add_action( 'admin_notices', array( $this, 'show_playground_notice' ) ); + + // Set should_load to false. + $this->should_load = false; + } + } + + /** + * Display an admin notice for the playground site. + */ + public function show_playground_notice() { + ?> +
+

+
+