Changeset 3201930
- Timestamp:
- 12/03/2024 08:08:21 PM (15 months ago)
- Location:
- online-accessibility
- Files:
-
- 10 edited
- 1 copied
-
tags/4.16 (copied) (copied from online-accessibility/trunk)
-
tags/4.16/CHANGELOG.md (modified) (1 diff)
-
tags/4.16/README.txt (modified) (1 diff)
-
tags/4.16/includes/classes/Helper.php (modified) (12 diffs)
-
tags/4.16/includes/enqueue.php (modified) (1 diff)
-
tags/4.16/index.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.txt (modified) (1 diff)
-
trunk/includes/classes/Helper.php (modified) (12 diffs)
-
trunk/includes/enqueue.php (modified) (1 diff)
-
trunk/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
online-accessibility/tags/4.16/CHANGELOG.md
r3201121 r3201930 1 1 # Changelog 2 2 All notable changes to this project will be documented in this file. 3 4.16 4 - Tested up to WordPress 6.6.2 5 - Tested up to PHP 8.2 6 - Fixed issue preventing creation of necessary tables 7 - Fixed issue with creating/deleting false positives 8 3 9 4.15 4 - Tested up to Word press 6.610 - Tested up to WordPress 6.6 5 11 - Fixed bug causing license page to not show up 6 12 - Updated login route for retrieving api key -
online-accessibility/tags/4.16/README.txt
r3201121 r3201930 7 7 Author URI: https://adaplugin.com 8 8 Author: Ability, Inc 9 Tested up to: 6.6 10 Stable tag: "4.1 5"11 Version 4.1 59 Tested up to: 6.6.2 10 Stable tag: "4.16" 11 Version 4.16 12 12 License: GPLv2 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
online-accessibility/tags/4.16/includes/classes/Helper.php
r3101342 r3201930 53 53 { 54 54 global $wpdb; 55 56 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = %s LIMIT 1;", [$wpdb->prefix.'oada_scans']))){ // phpcs:ignore 55 $table_name = $wpdb->prefix.'oada_scans'; 56 57 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = $table_name LIMIT 1;"))){ // phpcs:ignore 57 58 $charset_collate = $wpdb->get_charset_collate(); 58 59 59 60 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 60 dbDelta($wpdb->prepare("CREATE TABLE %i(61 dbDelta($wpdb->prepare("CREATE TABLE $table_name ( 61 62 ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, 62 63 scanID bigint(20) unsigned NOT NULL, … … 64 65 page_results mediumtext NOT NULL, 65 66 PRIMARY KEY (ID) 66 ) %s;", [$wpdb->prefix.'oada_scans', $charset_collate])); // phpcs:ignore67 ) $charset_collate;")); // phpcs:ignore 67 68 } 68 69 } … … 74 75 75 76 //Table does not exist already 76 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = %s LIMIT 1", [$table_name]))){ // phpcs:ignore77 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = $table_name LIMIT 1"))){ // phpcs:ignore 77 78 $charset_collate = $wpdb->get_charset_collate(); 78 79 79 80 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 80 dbDelta($wpdb->prepare("CREATE TABLE %i(81 dbDelta($wpdb->prepare("CREATE TABLE $table_name ( 81 82 ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, 82 83 scan_id bigint(20) unsigned NOT NULL, 83 84 list longtext NOT NULL, 84 85 PRIMARY KEY (ID) 85 ) %s;", [$table_name, $charset_collate]));86 ) $charset_collate;")); 86 87 87 88 $scans = $wpdb->get_results("SELECT DISTINCT scanID FROM {$wpdb->prefix}oada_scans"); // phpcs:ignore … … 89 90 foreach($scans AS $scan){ 90 91 $arr = $wpdb->_real_escape(json_encode([])); 91 $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}oada_false_positives (scan_id, list) VALUES (%d, %s)", [$scan->scanID, $arr]));// phpcs:ignore92 $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->scanID, '$arr')"));// phpcs:ignore 92 93 } 93 94 } … … 96 97 static function save_false_positive($scan_id, $issue_id){ 97 98 global $wpdb; 99 $table_name = $wpdb->prefix.'oada_false_positives'; 98 100 99 101 try{ 100 102 //Get list 101 103 $list = json_decode( 102 $wpdb->get_results($wpdb->prepare("SELECT list FROM %i WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives', $scan_id]))[0]->list // phpcs:ignore104 $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore 103 105 ); 104 106 … … 108 110 109 111 //Save new list 110 $wpdb->query($wpdb->prepare("UPDATE %i SET list = %s WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives', $list, $scan_id])); // phpcs:ignore112 $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id =$scan_id")); // phpcs:ignore 111 113 return ["status" => "success"]; 112 114 }catch(\Exception $e){ … … 117 119 static function delete_false_positive($scan_id, $issue_id){ 118 120 global $wpdb; 121 $table_name = $wpdb->prefix.'oada_false_positives'; 119 122 120 123 try{ 121 124 //Get list 122 125 $list = json_decode( 123 $wpdb->get_results($wpdb->prepare("SELECT list FROM %i WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives', $scan_id]))[0]->list // phpcs:ignore126 $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore 124 127 ); 125 128 … … 130 133 131 134 //Save new list 132 $wpdb->query($wpdb->prepare("UPDATE %s SET list = %s WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives',$list, $scan_id])); // phpcs:ignore135 $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id = $scan_id")); // phpcs:ignore 133 136 return ["status" => "success"]; 134 137 }catch(\Exception $e){ … … 139 142 static function get_false_positives($scan_id){ 140 143 global $wpdb; 141 $result = $wpdb->get_results($wpdb->prepare("SELECT list FROM %i WHERE scan_id = %d", [$wpdb->prefix .'oada_false_positives', $scan_id])); // phpcs:ignore 144 $table_name = $wpdb->prefix .'oada_false_positives'; 145 $result = $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id")); // phpcs:ignore 142 146 if($result) { 143 147 144 148 return json_decode($result[0]->list); 145 149 } 146 return '';150 return null; 147 151 } 148 152 … … 155 159 $table_name = $wpdb->prefix . "oada_scans"; 156 160 157 $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore161 $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore 158 162 $rows = (array)$rows[0]; 159 163 … … 173 177 174 178 while($offset <= $total_rows){ 175 $query_results = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM %i WHERE scanID = %d LIMIT %d, %d", [$table_name, $scan_id, $offset, $limit])); // phpcs:ignore179 $query_results = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore 176 180 $results = array_merge($results, $query_results); 177 181 … … 209 213 210 214 if($limit === 0){ 211 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore215 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore 212 216 } else { 213 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM %i WHERE scanID = %d LIMIT %d, %d", [$table_name, $scan_id, $offset, $limit])); // phpcs:ignore217 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore 214 218 } 215 219 -
online-accessibility/tags/4.16/includes/enqueue.php
r3201121 r3201930 77 77 $false_positives = Helper::get_false_positives($scan->ID); 78 78 79 if( is_null($false_positives)){79 if( !isset($false_positives) ){ 80 80 global $wpdb; 81 $table_name = $wpdb->prefix.'oada_false_positives'; 81 82 $arr = $wpdb->_real_escape(json_encode([])); 82 $wpdb->query($wpdb->prepare("INSERT INTO %s (scan_id, list) VALUES (%d, %s)", [$wpdb->prefix.'oada_false_positives', $scan->ID, $arr]));// phpcs:ignore83 $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->ID, '$arr')")); // phpcs:ignore 83 84 $false_positives = []; 84 85 } -
online-accessibility/tags/4.16/index.php
r3201121 r3201930 6 6 * Plugin URI: https://adaplugin.com 7 7 * Description: The most powerful and comprehensive Accessibility Suite. Achieve and maintain ADA/WCAG compliance faster than ever before. Audit, identify, get instruction, and fix. 8 * Version: 4.1 58 * Version: 4.16 9 9 * Author: Ability, Inc 10 10 * Author URI: https://adaplugin.com … … 28 28 "name" => "online-accessibility", 29 29 "name_pretty" => "Accessibility Suite", 30 "version" => "4.1 4",30 "version" => "4.16", 31 31 "file" => __FILE__, 32 32 "path" => plugin_dir_path(__FILE__), -
online-accessibility/trunk/CHANGELOG.md
r3201121 r3201930 1 1 # Changelog 2 2 All notable changes to this project will be documented in this file. 3 4.16 4 - Tested up to WordPress 6.6.2 5 - Tested up to PHP 8.2 6 - Fixed issue preventing creation of necessary tables 7 - Fixed issue with creating/deleting false positives 8 3 9 4.15 4 - Tested up to Word press 6.610 - Tested up to WordPress 6.6 5 11 - Fixed bug causing license page to not show up 6 12 - Updated login route for retrieving api key -
online-accessibility/trunk/README.txt
r3201121 r3201930 7 7 Author URI: https://adaplugin.com 8 8 Author: Ability, Inc 9 Tested up to: 6.6 10 Stable tag: "4.1 5"11 Version 4.1 59 Tested up to: 6.6.2 10 Stable tag: "4.16" 11 Version 4.16 12 12 License: GPLv2 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
online-accessibility/trunk/includes/classes/Helper.php
r3101342 r3201930 53 53 { 54 54 global $wpdb; 55 56 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = %s LIMIT 1;", [$wpdb->prefix.'oada_scans']))){ // phpcs:ignore 55 $table_name = $wpdb->prefix.'oada_scans'; 56 57 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = $table_name LIMIT 1;"))){ // phpcs:ignore 57 58 $charset_collate = $wpdb->get_charset_collate(); 58 59 59 60 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 60 dbDelta($wpdb->prepare("CREATE TABLE %i(61 dbDelta($wpdb->prepare("CREATE TABLE $table_name ( 61 62 ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, 62 63 scanID bigint(20) unsigned NOT NULL, … … 64 65 page_results mediumtext NOT NULL, 65 66 PRIMARY KEY (ID) 66 ) %s;", [$wpdb->prefix.'oada_scans', $charset_collate])); // phpcs:ignore67 ) $charset_collate;")); // phpcs:ignore 67 68 } 68 69 } … … 74 75 75 76 //Table does not exist already 76 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = %s LIMIT 1", [$table_name]))){ // phpcs:ignore77 if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = $table_name LIMIT 1"))){ // phpcs:ignore 77 78 $charset_collate = $wpdb->get_charset_collate(); 78 79 79 80 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 80 dbDelta($wpdb->prepare("CREATE TABLE %i(81 dbDelta($wpdb->prepare("CREATE TABLE $table_name ( 81 82 ID bigint(20) unsigned NOT NULL AUTO_INCREMENT, 82 83 scan_id bigint(20) unsigned NOT NULL, 83 84 list longtext NOT NULL, 84 85 PRIMARY KEY (ID) 85 ) %s;", [$table_name, $charset_collate]));86 ) $charset_collate;")); 86 87 87 88 $scans = $wpdb->get_results("SELECT DISTINCT scanID FROM {$wpdb->prefix}oada_scans"); // phpcs:ignore … … 89 90 foreach($scans AS $scan){ 90 91 $arr = $wpdb->_real_escape(json_encode([])); 91 $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}oada_false_positives (scan_id, list) VALUES (%d, %s)", [$scan->scanID, $arr]));// phpcs:ignore92 $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->scanID, '$arr')"));// phpcs:ignore 92 93 } 93 94 } … … 96 97 static function save_false_positive($scan_id, $issue_id){ 97 98 global $wpdb; 99 $table_name = $wpdb->prefix.'oada_false_positives'; 98 100 99 101 try{ 100 102 //Get list 101 103 $list = json_decode( 102 $wpdb->get_results($wpdb->prepare("SELECT list FROM %i WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives', $scan_id]))[0]->list // phpcs:ignore104 $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore 103 105 ); 104 106 … … 108 110 109 111 //Save new list 110 $wpdb->query($wpdb->prepare("UPDATE %i SET list = %s WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives', $list, $scan_id])); // phpcs:ignore112 $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id =$scan_id")); // phpcs:ignore 111 113 return ["status" => "success"]; 112 114 }catch(\Exception $e){ … … 117 119 static function delete_false_positive($scan_id, $issue_id){ 118 120 global $wpdb; 121 $table_name = $wpdb->prefix.'oada_false_positives'; 119 122 120 123 try{ 121 124 //Get list 122 125 $list = json_decode( 123 $wpdb->get_results($wpdb->prepare("SELECT list FROM %i WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives', $scan_id]))[0]->list // phpcs:ignore126 $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore 124 127 ); 125 128 … … 130 133 131 134 //Save new list 132 $wpdb->query($wpdb->prepare("UPDATE %s SET list = %s WHERE scan_id = %d", [$wpdb->prefix.'oada_false_positives',$list, $scan_id])); // phpcs:ignore135 $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id = $scan_id")); // phpcs:ignore 133 136 return ["status" => "success"]; 134 137 }catch(\Exception $e){ … … 139 142 static function get_false_positives($scan_id){ 140 143 global $wpdb; 141 $result = $wpdb->get_results($wpdb->prepare("SELECT list FROM %i WHERE scan_id = %d", [$wpdb->prefix .'oada_false_positives', $scan_id])); // phpcs:ignore 144 $table_name = $wpdb->prefix .'oada_false_positives'; 145 $result = $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id")); // phpcs:ignore 142 146 if($result) { 143 147 144 148 return json_decode($result[0]->list); 145 149 } 146 return '';150 return null; 147 151 } 148 152 … … 155 159 $table_name = $wpdb->prefix . "oada_scans"; 156 160 157 $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore161 $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore 158 162 $rows = (array)$rows[0]; 159 163 … … 173 177 174 178 while($offset <= $total_rows){ 175 $query_results = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM %i WHERE scanID = %d LIMIT %d, %d", [$table_name, $scan_id, $offset, $limit])); // phpcs:ignore179 $query_results = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore 176 180 $results = array_merge($results, $query_results); 177 181 … … 209 213 210 214 if($limit === 0){ 211 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore215 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore 212 216 } else { 213 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM %i WHERE scanID = %d LIMIT %d, %d", [$table_name, $scan_id, $offset, $limit])); // phpcs:ignore217 $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore 214 218 } 215 219 -
online-accessibility/trunk/includes/enqueue.php
r3201121 r3201930 77 77 $false_positives = Helper::get_false_positives($scan->ID); 78 78 79 if( is_null($false_positives)){79 if( !isset($false_positives) ){ 80 80 global $wpdb; 81 $table_name = $wpdb->prefix.'oada_false_positives'; 81 82 $arr = $wpdb->_real_escape(json_encode([])); 82 $wpdb->query($wpdb->prepare("INSERT INTO %s (scan_id, list) VALUES (%d, %s)", [$wpdb->prefix.'oada_false_positives', $scan->ID, $arr]));// phpcs:ignore83 $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->ID, '$arr')")); // phpcs:ignore 83 84 $false_positives = []; 84 85 } -
online-accessibility/trunk/index.php
r3201121 r3201930 6 6 * Plugin URI: https://adaplugin.com 7 7 * Description: The most powerful and comprehensive Accessibility Suite. Achieve and maintain ADA/WCAG compliance faster than ever before. Audit, identify, get instruction, and fix. 8 * Version: 4.1 58 * Version: 4.16 9 9 * Author: Ability, Inc 10 10 * Author URI: https://adaplugin.com … … 28 28 "name" => "online-accessibility", 29 29 "name_pretty" => "Accessibility Suite", 30 "version" => "4.1 4",30 "version" => "4.16", 31 31 "file" => __FILE__, 32 32 "path" => plugin_dir_path(__FILE__),
Note: See TracChangeset
for help on using the changeset viewer.