# patchstack/2.1.15/includes/migrations/v300.php

Patchstack – WordPress &amp; Plugins Security, version 2.1.15. 16 lines.

- Page: https://pluginprobe.com/plugins/patchstack/2.1.15/code/includes/migrations/v300.php
- Raw: https://pluginprobe.com/plugins/patchstack/2.1.15/raw/includes/migrations/v300.php
- Modified: 2022-01-19T10:29:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/patchstack/2.1.15/code/includes/migrations/v300.php#L10-L20`.

```php
<?php

// Do not allow the file to be called directly.
if (!defined('ABSPATH')) {
	exit;
}

update_option('patchstack_db_version', '3.0.0');

// Migrate all current options to the new prefix.
$exists = $wpdb->get_var( "SELECT COUNT(*) FROM " . $wpdb->prefix . "options WHERE option_name = 'webarx_api_token'" );
if ( !is_null( $exists ) && $exists >= 1 ) {
	$wpdb->query( 'INSERT IGNORE INTO ' . $wpdb->prefix . "options (option_name, option_value, autoload) SELECT REPLACE(option_name, 'webarx_', 'patchstack_') as option_name, option_value, autoload FROM " . $wpdb->prefix . "options WHERE option_name like 'webarx_%'" );
	$wpdb->query( 'UPDATE ' . $wpdb->prefix . 'options AS a SET option_value = (SELECT option_value FROM ' . $wpdb->prefix . "options WHERE option_name = REPLACE(a.option_name, 'patchstack_', 'webarx_')) WHERE option_name LIKE 'patchstack_%'" );
}

```
