PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.1
Patchstack – WordPress & Plugins Security v2.2.1
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
patchstack / includes / migrations / v300.php

v300.php in Patchstack – WordPress & Plugins Security 2.2.1, at includes/migrations/v300.php

16 lines 854 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Do not allow the file to be called directly.
4 if (!defined('ABSPATH')) {
5 exit;
6 }
7
8 update_option('patchstack_db_version', '3.0.0');
9
10 // Migrate all current options to the new prefix.
11 $exists = $wpdb->get_var( "SELECT COUNT(*) FROM " . $prefix . "options WHERE option_name = 'webarx_api_token'" );
12 if ( !is_null( $exists ) && $exists >= 1 ) {
13 $wpdb->query( 'INSERT IGNORE INTO ' . $prefix . "options (option_name, option_value, autoload) SELECT REPLACE(option_name, 'webarx_', 'patchstack_') as option_name, option_value, autoload FROM " . $prefix . "options WHERE option_name like 'webarx_%'" );
14 $wpdb->query( 'UPDATE ' . $prefix . 'options AS a SET option_value = (SELECT option_value FROM ' . $prefix . "options WHERE option_name = REPLACE(a.option_name, 'patchstack_', 'webarx_')) WHERE option_name LIKE 'patchstack_%'" );
15 }
16