| @@ -1,19 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * This file is used to update the database version of the plugin. | |
| 4 | - * | |
| 5 | - * @link https://wpsmartpost.com/ | |
| 6 | - * @since 2.2.0 | |
| 7 | - * | |
| 8 | - * @package Smart_Post_Show | |
| 9 | - * @subpackage Smart_Post_Show/includes | |
| 10 | - */ | |
| 11 | - | |
| 12 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 13 | - exit; // Exit if accessed directly. | |
| 14 | -} | |
| 15 | - | |
| 16 | 2 | update_option( 'smart_post_show_version', '2.2.0' ); |
| 17 | 3 | update_option( 'smart_post_show_db_version', '2.2.0' ); |
| 18 | 4 | |
| 19 | 5 | /** |
| @@ -286,11 +272,11 @@ | ||
| 286 | 272 | */ |
| 287 | 273 | global $wpdb; |
| 288 | 274 | $old_post_types = array( 'sp_pc_shortcodes' => 'sp_post_carousel' ); |
| 289 | 275 | foreach ( $old_post_types as $old_type => $type ) { |
| 290 | - $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 276 | + $wpdb->query( | |
| 291 | 277 | $wpdb->prepare( |
| 292 | - "UPDATE {$wpdb->posts} SET post_type = REPLACE(post_type, %s, %s) | |
| 278 | + "UPDATE {$wpdb->posts} SET post_type = REPLACE(post_type, %s, %s) | |
| 293 | 279 | WHERE post_type LIKE %s", |
| 294 | 280 | $old_type, |
| 295 | 281 | $type, |
| 296 | 282 | $old_type |
| @@ -295,11 +281,11 @@ | ||
| 295 | 281 | $type, |
| 296 | 282 | $old_type |
| 297 | 283 | ) |
| 298 | 284 | ); |
| 299 | - $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 285 | + $wpdb->query( | |
| 300 | 286 | $wpdb->prepare( |
| 301 | - "UPDATE {$wpdb->posts} SET guid = REPLACE(guid, %s, %s) | |
| 287 | + "UPDATE {$wpdb->posts} SET guid = REPLACE(guid, %s, %s) | |
| 302 | 288 | WHERE guid LIKE %s", |
| 303 | 289 | "post_type={$old_type}", |
| 304 | 290 | "post_type={$type}", |
| 305 | 291 | "%post_type={$type}%" |
| @@ -304,11 +290,11 @@ | ||
| 304 | 290 | "post_type={$type}", |
| 305 | 291 | "%post_type={$type}%" |
| 306 | 292 | ) |
| 307 | 293 | ); |
| 308 | - $wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 294 | + $wpdb->query( | |
| 309 | 295 | $wpdb->prepare( |
| 310 | - "UPDATE {$wpdb->posts} SET guid = REPLACE(guid, %s, %s) | |
| 296 | + "UPDATE {$wpdb->posts} SET guid = REPLACE(guid, %s, %s) | |
| 311 | 297 | WHERE guid LIKE %s", |
| 312 | 298 | "/{$old_type}/", |
| 313 | 299 | "/{$type}/", |
| 314 | 300 | "%/{$old_type}/%" |