Plugin Directory

Changeset 3201930


Ignore:
Timestamp:
12/03/2024 08:08:21 PM (15 months ago)
Author:
onlineada
Message:

4.16

Location:
online-accessibility
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • online-accessibility/tags/4.16/CHANGELOG.md

    r3201121 r3201930  
    11# Changelog
    22All notable changes to this project will be documented in this file.
     34.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
    394.15
    4 - Tested up to Wordpress 6.6
     10- Tested up to WordPress 6.6
    511- Fixed bug causing license page to not show up
    612- Updated login route for retrieving api key
  • online-accessibility/tags/4.16/README.txt

    r3201121 r3201930  
    77Author URI: https://adaplugin.com
    88Author: Ability, Inc
    9 Tested up to: 6.6
    10 Stable tag: "4.15"
    11 Version 4.15
     9Tested up to: 6.6.2
     10Stable tag: "4.16"
     11Version 4.16
    1212License: GPLv2 or later
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • online-accessibility/tags/4.16/includes/classes/Helper.php

    r3101342 r3201930  
    5353    {
    5454        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
    5758            $charset_collate = $wpdb->get_charset_collate();
    5859
    5960            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    60             dbDelta($wpdb->prepare("CREATE TABLE %i (
     61            dbDelta($wpdb->prepare("CREATE TABLE $table_name (
    6162                ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    6263                scanID bigint(20) unsigned NOT NULL,
     
    6465                page_results mediumtext NOT NULL,
    6566                PRIMARY KEY  (ID)
    66             ) %s;", [$wpdb->prefix.'oada_scans', $charset_collate])); // phpcs:ignore
     67            ) $charset_collate;")); // phpcs:ignore
    6768        }
    6869    }
     
    7475
    7576        //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:ignore
     77        if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = $table_name LIMIT 1"))){ // phpcs:ignore
    7778            $charset_collate = $wpdb->get_charset_collate();
    7879
    7980            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    80             dbDelta($wpdb->prepare("CREATE TABLE %i (
     81            dbDelta($wpdb->prepare("CREATE TABLE $table_name (
    8182                ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    8283                scan_id bigint(20) unsigned NOT NULL,
    8384                list longtext NOT NULL,
    8485                PRIMARY KEY  (ID)
    85             ) %s;", [$table_name, $charset_collate]));
     86            ) $charset_collate;"));
    8687
    8788            $scans = $wpdb->get_results("SELECT DISTINCT scanID FROM {$wpdb->prefix}oada_scans"); // phpcs:ignore
     
    8990            foreach($scans AS $scan){
    9091                $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:ignore
     92                $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->scanID, '$arr')"));// phpcs:ignore
    9293            }
    9394        }
     
    9697    static function save_false_positive($scan_id, $issue_id){
    9798        global $wpdb;
     99        $table_name = $wpdb->prefix.'oada_false_positives';
    98100
    99101        try{
    100102            //Get list
    101103            $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:ignore
     104                $wpdb->get_results($wpdb->prepare("SELECT list FROM  $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore
    103105            );
    104106
     
    108110
    109111            //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:ignore
     112            $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id =$scan_id")); // phpcs:ignore
    111113            return ["status" => "success"];
    112114        }catch(\Exception $e){
     
    117119    static function delete_false_positive($scan_id, $issue_id){
    118120        global $wpdb;
     121        $table_name = $wpdb->prefix.'oada_false_positives';
    119122
    120123        try{
    121124            //Get list
    122125            $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:ignore
     126                $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore
    124127            );
    125128
     
    130133
    131134            //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:ignore
     135            $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id = $scan_id")); // phpcs:ignore
    133136            return ["status" => "success"];
    134137        }catch(\Exception $e){
     
    139142    static function get_false_positives($scan_id){
    140143        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
    142146        if($result) {
    143147
    144148            return json_decode($result[0]->list);
    145149        }
    146         return '';
     150        return null;
    147151    }
    148152   
     
    155159        $table_name = $wpdb->prefix . "oada_scans";
    156160
    157         $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore
     161        $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore
    158162        $rows = (array)$rows[0];
    159163       
     
    173177
    174178        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:ignore
     179            $query_results = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore
    176180            $results = array_merge($results, $query_results);
    177181
     
    209213
    210214        if($limit === 0){
    211             $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore
     215            $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore
    212216        } 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:ignore
     217            $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore
    214218        }
    215219       
  • online-accessibility/tags/4.16/includes/enqueue.php

    r3201121 r3201930  
    7777            $false_positives = Helper::get_false_positives($scan->ID);
    7878           
    79             if(is_null($false_positives)){
     79            if( !isset($false_positives) ){
    8080                global $wpdb;
     81                $table_name = $wpdb->prefix.'oada_false_positives';
    8182                $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:ignore
     83                $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->ID, '$arr')")); // phpcs:ignore
    8384                $false_positives = [];
    8485            }
  • online-accessibility/tags/4.16/index.php

    r3201121 r3201930  
    66 * Plugin URI:        https://adaplugin.com
    77 * 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.15
     8 * Version:           4.16
    99 * Author:            Ability, Inc
    1010 * Author URI:        https://adaplugin.com
     
    2828    "name" => "online-accessibility",
    2929    "name_pretty" => "Accessibility Suite",
    30     "version" => "4.14",
     30    "version" => "4.16",
    3131    "file" => __FILE__,
    3232    "path" => plugin_dir_path(__FILE__),
  • online-accessibility/trunk/CHANGELOG.md

    r3201121 r3201930  
    11# Changelog
    22All notable changes to this project will be documented in this file.
     34.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
    394.15
    4 - Tested up to Wordpress 6.6
     10- Tested up to WordPress 6.6
    511- Fixed bug causing license page to not show up
    612- Updated login route for retrieving api key
  • online-accessibility/trunk/README.txt

    r3201121 r3201930  
    77Author URI: https://adaplugin.com
    88Author: Ability, Inc
    9 Tested up to: 6.6
    10 Stable tag: "4.15"
    11 Version 4.15
     9Tested up to: 6.6.2
     10Stable tag: "4.16"
     11Version 4.16
    1212License: GPLv2 or later
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • online-accessibility/trunk/includes/classes/Helper.php

    r3101342 r3201930  
    5353    {
    5454        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
    5758            $charset_collate = $wpdb->get_charset_collate();
    5859
    5960            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    60             dbDelta($wpdb->prepare("CREATE TABLE %i (
     61            dbDelta($wpdb->prepare("CREATE TABLE $table_name (
    6162                ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    6263                scanID bigint(20) unsigned NOT NULL,
     
    6465                page_results mediumtext NOT NULL,
    6566                PRIMARY KEY  (ID)
    66             ) %s;", [$wpdb->prefix.'oada_scans', $charset_collate])); // phpcs:ignore
     67            ) $charset_collate;")); // phpcs:ignore
    6768        }
    6869    }
     
    7475
    7576        //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:ignore
     77        if(!$wpdb->query($wpdb->prepare("SELECT * FROM information_schema.tables WHERE table_name = $table_name LIMIT 1"))){ // phpcs:ignore
    7778            $charset_collate = $wpdb->get_charset_collate();
    7879
    7980            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    80             dbDelta($wpdb->prepare("CREATE TABLE %i (
     81            dbDelta($wpdb->prepare("CREATE TABLE $table_name (
    8182                ID bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    8283                scan_id bigint(20) unsigned NOT NULL,
    8384                list longtext NOT NULL,
    8485                PRIMARY KEY  (ID)
    85             ) %s;", [$table_name, $charset_collate]));
     86            ) $charset_collate;"));
    8687
    8788            $scans = $wpdb->get_results("SELECT DISTINCT scanID FROM {$wpdb->prefix}oada_scans"); // phpcs:ignore
     
    8990            foreach($scans AS $scan){
    9091                $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:ignore
     92                $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->scanID, '$arr')"));// phpcs:ignore
    9293            }
    9394        }
     
    9697    static function save_false_positive($scan_id, $issue_id){
    9798        global $wpdb;
     99        $table_name = $wpdb->prefix.'oada_false_positives';
    98100
    99101        try{
    100102            //Get list
    101103            $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:ignore
     104                $wpdb->get_results($wpdb->prepare("SELECT list FROM  $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore
    103105            );
    104106
     
    108110
    109111            //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:ignore
     112            $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id =$scan_id")); // phpcs:ignore
    111113            return ["status" => "success"];
    112114        }catch(\Exception $e){
     
    117119    static function delete_false_positive($scan_id, $issue_id){
    118120        global $wpdb;
     121        $table_name = $wpdb->prefix.'oada_false_positives';
    119122
    120123        try{
    121124            //Get list
    122125            $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:ignore
     126                $wpdb->get_results($wpdb->prepare("SELECT list FROM $table_name WHERE scan_id = $scan_id"))[0]->list // phpcs:ignore
    124127            );
    125128
     
    130133
    131134            //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:ignore
     135            $wpdb->query($wpdb->prepare("UPDATE $table_name SET list = '$list' WHERE scan_id = $scan_id")); // phpcs:ignore
    133136            return ["status" => "success"];
    134137        }catch(\Exception $e){
     
    139142    static function get_false_positives($scan_id){
    140143        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
    142146        if($result) {
    143147
    144148            return json_decode($result[0]->list);
    145149        }
    146         return '';
     150        return null;
    147151    }
    148152   
     
    155159        $table_name = $wpdb->prefix . "oada_scans";
    156160
    157         $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore
     161        $rows = (array)$wpdb->get_results($wpdb->prepare("SELECT COUNT(*) as 'rows' FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore
    158162        $rows = (array)$rows[0];
    159163       
     
    173177
    174178        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:ignore
     179            $query_results = (array)$wpdb->get_results($wpdb->prepare("SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore
    176180            $results = array_merge($results, $query_results);
    177181
     
    209213
    210214        if($limit === 0){
    211             $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM %i WHERE scanID = %d", [$table_name, $scan_id])); // phpcs:ignore
     215            $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id")); // phpcs:ignore
    212216        } 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:ignore
     217            $results = (array)$wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name WHERE scanID = $scan_id LIMIT $offset, $limit")); // phpcs:ignore
    214218        }
    215219       
  • online-accessibility/trunk/includes/enqueue.php

    r3201121 r3201930  
    7777            $false_positives = Helper::get_false_positives($scan->ID);
    7878           
    79             if(is_null($false_positives)){
     79            if( !isset($false_positives) ){
    8080                global $wpdb;
     81                $table_name = $wpdb->prefix.'oada_false_positives';
    8182                $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:ignore
     83                $wpdb->query($wpdb->prepare("INSERT INTO $table_name (scan_id, list) VALUES ($scan->ID, '$arr')")); // phpcs:ignore
    8384                $false_positives = [];
    8485            }
  • online-accessibility/trunk/index.php

    r3201121 r3201930  
    66 * Plugin URI:        https://adaplugin.com
    77 * 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.15
     8 * Version:           4.16
    99 * Author:            Ability, Inc
    1010 * Author URI:        https://adaplugin.com
     
    2828    "name" => "online-accessibility",
    2929    "name_pretty" => "Accessibility Suite",
    30     "version" => "4.14",
     30    "version" => "4.16",
    3131    "file" => __FILE__,
    3232    "path" => plugin_dir_path(__FILE__),
Note: See TracChangeset for help on using the changeset viewer.