Go Live Update URLS - Version 6.3.5

Version Description

  • Tested to WordPress 5.8.3.
  • Fix issue with tables showing from other sites on multisite.
Download this release

Release Info

Developer Mat Lipe
Plugin Icon 128x128 Go Live Update URLS
Version 6.3.5
Comparing to
See all releases

Code changes from version 6.3.4 to 6.3.5

Files changed (3) hide show
  1. go-live-update-urls.php +3 -3
  2. readme.txt +6 -2
  3. src/Database.php +6 -7
go-live-update-urls.php CHANGED
@@ -4,8 +4,8 @@
4
  * Plugin URI: https://onpointplugins.com/go-live-update-urls/
5
  * Description: Updates all the Urls in the database to point to a new URL when making your site live or changing domains.
6
  * Author: OnPoint Plugins
7
- * Author URI: https://onpointplugins.com/
8
- * Version: 6.3.4
9
  * Text Domain: go-live-update-urls
10
  * Domain Path: /languages/
11
  * Network: false
@@ -15,7 +15,7 @@
15
  * @package go-live-update-urls
16
  */
17
 
18
- define( 'GO_LIVE_UPDATE_URLS_VERSION', '6.3.4' );
19
  define( 'GO_LIVE_UPDATE_URLS_REQUIRED_PRO_VERSION', '6.4.0' );
20
  define( 'GO_LIVE_UPDATE_URLS_URL', plugin_dir_url( __FILE__ ) );
21
 
4
  * Plugin URI: https://onpointplugins.com/go-live-update-urls/
5
  * Description: Updates all the Urls in the database to point to a new URL when making your site live or changing domains.
6
  * Author: OnPoint Plugins
7
+ * Author URI: https://onpointplugins.com
8
+ * Version: 6.3.5
9
  * Text Domain: go-live-update-urls
10
  * Domain Path: /languages/
11
  * Network: false
15
  * @package go-live-update-urls
16
  */
17
 
18
+ define( 'GO_LIVE_UPDATE_URLS_VERSION', '6.3.5' );
19
  define( 'GO_LIVE_UPDATE_URLS_REQUIRED_PRO_VERSION', '6.4.0' );
20
  define( 'GO_LIVE_UPDATE_URLS_URL', plugin_dir_url( __FILE__ ) );
21
 
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: Mat Lipe, onpointplugins
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40onpointplugins%2ecom&lc=US&item_name=Go%20Live%20Update%20Urls&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: urls, launching, site changes, tools, domain, domains, domain changes, url changes
5
  Requires at least: 5.2.0
6
- Tested up to: 5.8.2
7
  Requires PHP: 5.6.0
8
- Stable tag: 6.3.4
9
 
10
  == Description ==
11
 
@@ -102,6 +102,10 @@ If you wish to try to update tables mentioned as "not safe" anyway, you may make
102
  3. Update prevented due to incomplete data entered.
103
 
104
  == Changelog ==
 
 
 
 
105
  = 6.3.4 =
106
  * Support updating URL with URL encoded characters.
107
  * Tested to WordPress 5.8.2.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40onpointplugins%2ecom&lc=US&item_name=Go%20Live%20Update%20Urls&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: urls, launching, site changes, tools, domain, domains, domain changes, url changes
5
  Requires at least: 5.2.0
6
+ Tested up to: 5.9.0
7
  Requires PHP: 5.6.0
8
+ Stable tag: 6.3.5
9
 
10
  == Description ==
11
 
102
  3. Update prevented due to incomplete data entered.
103
 
104
  == Changelog ==
105
+ = 6.3.5 =
106
+ * Tested to WordPress 5.8.3.
107
+ * Fix issue with tables showing from other sites on multisite.
108
+
109
  = 6.3.4 =
110
  * Support updating URL with URL encoded characters.
111
  * Tested to WordPress 5.8.2.
src/Database.php CHANGED
@@ -129,7 +129,7 @@ class Database {
129
 
130
  /**
131
  * Get the names of every table in this blog
132
- * If we are multisite, we also get the global tables
133
  *
134
  * @since 5.0.1
135
  *
@@ -137,17 +137,16 @@ class Database {
137
  */
138
  public function get_all_table_names() {
139
  global $wpdb;
140
- $query = "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='" . $wpdb->dbname . "' AND TABLE_NAME LIKE '" . $wpdb->prefix . "%'";
141
 
142
- // Site 1's 'LIKE wp_%' will return all tables in the database
143
- // so we exclude all possible sub sites e.g. wp_2, wp_3 up to 9.
144
  $not_like = null;
145
  if ( 1 === (int) $wpdb->blogid && is_multisite() ) {
146
  for ( $i = 1; $i <= 9; $i ++ ) {
147
- $not_like .= "'" . $wpdb->prefix . $i . "',";
148
  }
149
- $not_like = substr( $not_like, 0, - 1 );
150
- $query .= ' AND SUBSTRING(TABLE_NAME,1,4) NOT IN (' . $not_like . ')';
151
  }
152
  return $wpdb->get_col( $query );
153
  }
129
 
130
  /**
131
  * Get the names of every table in this blog
132
+ * If we are multisite, we also get the global tables.
133
  *
134
  * @since 5.0.1
135
  *
137
  */
138
  public function get_all_table_names() {
139
  global $wpdb;
140
+ $query = "SELECT TABLE_NAME as TableName FROM information_schema.TABLES WHERE TABLE_SCHEMA='" . $wpdb->dbname . "' AND TABLE_NAME LIKE '" . $wpdb->esc_like( $wpdb->prefix ) . "%'";
141
 
142
+ // Site 1's 'LIKE wp_%' will return all tables in the database,
143
+ // so we exclude all possible sub sites (e.g., wp_2, wp_3 up to 9).
144
  $not_like = null;
145
  if ( 1 === (int) $wpdb->blogid && is_multisite() ) {
146
  for ( $i = 1; $i <= 9; $i ++ ) {
147
+ $not_like .= $wpdb->prepare( '%s,', $wpdb->prefix . $i );
148
  }
149
+ $query .= ' AND SUBSTRING(TABLE_NAME,1,4) NOT IN (' . substr( $not_like, 0, - 1 ) . ')';
 
150
  }
151
  return $wpdb->get_col( $query );
152
  }