diff --git a/siteimprove-accessibility/assets/scan-panel.entry.js b/siteimprove-accessibility/assets/scan-panel.entry.js index b4d3520..eb7689b 100644 --- a/siteimprove-accessibility/assets/scan-panel.entry.js +++ b/siteimprove-accessibility/assets/scan-panel.entry.js @@ -45,17 +45,19 @@ import { Rules as AlfaRuleFilter } from '@siteimprove/alfa-test-utils'; path: '/siteimprove-accessibility/save-scan', method: 'POST', data: auditScan, - }).then(() => { - SiteimproveAccessibilityCmsComponents.renderSinglePageReporting( - { failedItems: auditScan.scan_results }, - 'siteimprove-scan-results' - ); - - $label.html( - __('Check page', 'siteimprove-accessibility') - ); - $this.removeAttr('disabled'); - }); + }) + .then(() => { + SiteimproveAccessibilityCmsComponents.renderSinglePageReporting( + { failedItems: auditScan.scan_results }, + 'siteimprove-scan-results' + ); + }) + .finally(() => { + $label.html( + __('Check page', 'siteimprove-accessibility') + ); + $this.removeAttr('disabled'); + }); }) ); }); diff --git a/siteimprove-accessibility/assets/siteimprove-accessibility.css b/siteimprove-accessibility/assets/siteimprove-accessibility.css index c3e3a64..b4f8005 100644 --- a/siteimprove-accessibility/assets/siteimprove-accessibility.css +++ b/siteimprove-accessibility/assets/siteimprove-accessibility.css @@ -61,8 +61,9 @@ flex-shrink: 0; } -#siteimprove-scan-panel .scan-panel-header a { +#siteimprove-scan-panel .scan-panel-header a, #siteimprove-scan-panel .scan-panel-header a:visited { text-decoration: none; + color: white !important; } #siteimprove-scan-panel .scan-panel-body { diff --git a/siteimprove-accessibility/readme.txt b/siteimprove-accessibility/readme.txt index 7e3939b..3533268 100644 --- a/siteimprove-accessibility/readme.txt +++ b/siteimprove-accessibility/readme.txt @@ -4,7 +4,7 @@ Tags: accessibility, analytics, insights, spelling, seo Requires at least: 6.7 Requires PHP: 8.0 Tested up to: 6.8 -Stable tag: 1.0.0 +Stable tag: 1.0.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -66,7 +66,7 @@ This plugin uses the following third-party/external services: It provides reusable React-based UI components for displaying issue details, issue lists, reports and more. These components are designed to be integrated across different CMS platforms, including WordPress, to ensure consistency and reduce the need for custom UI development. - The plugin also uses Siteimprove's open source accessibility conformance testing engine called [Alfa](https://alfa.siteimprove.com/). Some of its features that requires to connect to [Siteimprove API](https://api.siteimprove.com/) are currently not used in this plugin. + The plugin also uses Siteimprove's open source accessibility conformance testing engine called [Alfa](https://alfa.siteimprove.com/). Some of its features that requires to connect to [Siteimprove API](https://api.siteimprove.com/v2/documentation) are currently not used in this plugin. 3. **Pendo** Pendo is used to collect anonymous usage data, such as which features of the plugin users are interacting with. Usage data collection is active only with the explicit consent of the administrator (e.g. when usage tracking is enabled in the plugin settings page). @@ -79,5 +79,10 @@ The development happens on GitHub, and the repository is available at: [https:// == Changelog == += 1.0.1 = +* Fixed database compatibility issue that caused the plugin to incorrectly being installed on some environments. +* Fixed terms and conditions link in the settings page. +* Fixed broken Siteimprove API link in the plugin documentation. + = 1.0.0 = * First public version diff --git a/siteimprove-accessibility/siteimprove-accessibility.php b/siteimprove-accessibility/siteimprove-accessibility.php index 75ab4f0..6ba86d1 100644 --- a/siteimprove-accessibility/siteimprove-accessibility.php +++ b/siteimprove-accessibility/siteimprove-accessibility.php @@ -5,7 +5,7 @@ * @wordpress-plugin * Plugin Name: Siteimprove Accessibility * Description: The Siteimprove Accessibility plugin bridges the gap between WordPress and the Siteimprove Intelligence Platform via open source Alfa Engine. - * Version: 1.0.0 + * Version: 1.0.1 * Requires at least: 6.7 * Requires PHP: 8.0 * Author: Siteimprove @@ -45,7 +45,7 @@ require_once __DIR__ . '/vendor/autoload.php'; } -define( 'SITEIMPROVE_ACCESSIBILITY_VERSION', '1.0.0' ); +define( 'SITEIMPROVE_ACCESSIBILITY_VERSION', '1.0.1' ); define( 'SITEIMPROVE_ACCESSIBILITY_PLUGIN_NAME', 'siteimprove-accessibility' ); define( 'SITEIMPROVE_ACCESSIBILITY_PLUGIN_ROOT_PATH', trailingslashit( __DIR__ ) ); define( 'SITEIMPROVE_ACCESSIBILITY_PLUGIN_ROOT_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) ); diff --git a/siteimprove-accessibility/src/Core/Database.php b/siteimprove-accessibility/src/Core/Database.php index 1c8f79a..69b016a 100644 --- a/siteimprove-accessibility/src/Core/Database.php +++ b/siteimprove-accessibility/src/Core/Database.php @@ -13,11 +13,12 @@ public function install(): void { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; $scans_table = $wpdb->prefix . 'siteimprove_accessibility_scans'; - dbDelta( + $this->db_delta( + $scans_table, "CREATE TABLE $scans_table ( id bigint(20) NOT NULL AUTO_INCREMENT, post_id bigint(20) DEFAULT NULL, - url varchar(2048) DEFAULT NULL, + url varchar(750) DEFAULT NULL, title varchar(512) DEFAULT NULL, scan_results longtext NOT NULL, created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, @@ -28,7 +29,8 @@ public function install(): void { ); $rules_table = $wpdb->prefix . 'siteimprove_accessibility_rules'; - dbDelta( + $this->db_delta( + $rules_table, "CREATE TABLE $rules_table ( id int NOT NULL AUTO_INCREMENT, rule varchar(32) NOT NULL, @@ -40,7 +42,8 @@ public function install(): void { ); $occurrences_table = $wpdb->prefix . 'siteimprove_accessibility_occurrences'; - dbDelta( + $this->db_delta( + $occurrences_table, "CREATE TABLE $occurrences_table ( scan_id bigint(20) NOT NULL, rule_id int NOT NULL, @@ -50,10 +53,11 @@ public function install(): void { ); $stats_table = $wpdb->prefix . 'siteimprove_accessibility_daily_stats'; - dbDelta( + $this->db_delta( + $stats_table, "CREATE TABLE $stats_table ( - `date` DATE DEFAULT (CURDATE()) NOT NULL, - aggregated_stats mediumtext NOT NULL, + `date` DATE NOT NULL, + aggregated_stats TEXT NOT NULL, PRIMARY KEY (`date`) ) $charset_collate;" ); @@ -70,4 +74,20 @@ public function uninstall(): void { $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i;', $wpdb->prefix . 'siteimprove_accessibility_scans' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %i;', $wpdb->prefix . 'siteimprove_accessibility_daily_stats' ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery } + + /** + * @param string $table_name + * @param string $sql + * + * @return void + */ + private function db_delta( string $table_name, string $sql ): void { + global $wpdb; + + dbDelta( $sql ); + + if ( ! empty( $wpdb->last_error ) ) { + throw new \RuntimeException( esc_html( sprintf( 'Error executing dbDelta on "%s" table: %s', $table_name, $wpdb->last_error ) ) ); + } + } } diff --git a/siteimprove-accessibility/src/Service/Repository/Scan_Repository.php b/siteimprove-accessibility/src/Service/Repository/Scan_Repository.php index fc8c77e..9a310ce 100644 --- a/siteimprove-accessibility/src/Service/Repository/Scan_Repository.php +++ b/siteimprove-accessibility/src/Service/Repository/Scan_Repository.php @@ -142,7 +142,7 @@ public function count_pages_with_issues( array $params ): int { public function delete_scans_above_threshold(): void { global $wpdb; - $scan_threshold = 25; + $scan_threshold = 100; $scans_table = $wpdb->prefix . 'siteimprove_accessibility_scans'; $occurrences_table = $wpdb->prefix . 'siteimprove_accessibility_occurrences'; diff --git a/siteimprove-accessibility/views/settings.php b/siteimprove-accessibility/views/settings.php index d28528b..c5e2218 100644 --- a/siteimprove-accessibility/views/settings.php +++ b/siteimprove-accessibility/views/settings.php @@ -32,7 +32,7 @@ ?>
\ No newline at end of file