| @@ -52,9 +52,9 @@ | ||
| 52 | 52 | * Check if cache table exist |
| 53 | 53 | */ |
| 54 | 54 | private function is_cache_table_not_exist() { |
| 55 | 55 | global $wpdb; |
| 56 | - return ( $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $this->cache_table_name ) ) ) != $this->cache_table_name ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 56 | + return ( $wpdb->get_var( "SHOW TABLES LIKE '{$this->cache_table_name}'" ) != $this->cache_table_name ); //DB Call OK, No Caching OK | |
| 57 | 57 | } |
| 58 | 58 | /* |
| 59 | 59 | * Create cache table |
| 60 | 60 | */ |
| @@ -78,9 +78,9 @@ | ||
| 78 | 78 | $query = $wpdb->prepare("INSERT IGNORE INTO {$this->cache_table_name} |
| 79 | 79 | (`name`, `value`) |
| 80 | 80 | VALUES (%s, %s)", $cache_option_name, json_encode( $result_array )); |
| 81 | 81 | |
| 82 | - $wpdb->query( $query ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 82 | + $wpdb->query( $query ); //DB Call OK, No Caching OK | |
| 83 | 83 | |
| 84 | 84 | if ( $wpdb->last_error ) { |
| 85 | 85 | if ( $this->is_cache_table_not_exist() ) { |
| 86 | 86 | $this->create_cache_table(); |
| @@ -98,9 +98,9 @@ | ||
| 98 | 98 | $result = ''; |
| 99 | 99 | |
| 100 | 100 | $safe_sql = $wpdb->prepare("SELECT * FROM {$this->cache_table_name} WHERE `name` LIKE %s", $cache_option_name); |
| 101 | 101 | |
| 102 | - $cache_content = $wpdb->get_results( $safe_sql, ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 102 | + $cache_content = $wpdb->get_results( $safe_sql, ARRAY_A ); //DB Call OK, No Caching OK | |
| 103 | 103 | |
| 104 | 104 | if ( ! $wpdb->last_error ) { |
| 105 | 105 | if (!empty($cache_content) && !is_wp_error($cache_content) && is_array($cache_content)) { |
| 106 | 106 | $result = $cache_content[0]['value']; |