Skip to content
Merged
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
24 changes: 13 additions & 11 deletions siteimprove-accessibility/assets/scan-panel.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
})
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 7 additions & 2 deletions siteimprove-accessibility/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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).
Expand All @@ -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
4 changes: 2 additions & 2 deletions siteimprove-accessibility/siteimprove-accessibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__ ) ) );
Expand Down
34 changes: 27 additions & 7 deletions siteimprove-accessibility/src/Core/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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;"
);
Expand All @@ -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 ) ) );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion siteimprove-accessibility/views/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
?>
<p class="submit">
<?php submit_button( __( 'Update settings', 'siteimprove-accessibility' ), 'primary', 'submit', false ); ?>
<span style="display: block; margin-top: 10px;"><a href="https://frontier.siteimprove.com/page/terms-and-conditions" target="_blank"><?php esc_html_e( 'Terms and Conditions', 'siteimprove-accessibility' ); ?></a></span>
<span style="display: block; margin-top: 10px;"><a href="https://www.siteimprove.com/legal/accessibility-plugin-terms-of-use/" target="_blank"><?php esc_html_e( 'Terms and Conditions', 'siteimprove-accessibility' ); ?></a></span>
</p>
</form>
</div>