Version Description
Download this release
Release Info
Developer | Mat Lipe |
Plugin | Go Live Update URLS |
Version | 2.1 |
Comparing to | |
See all releases |
Code changes from version 2.0 to 2.1
- go-live-update-urls.php +1 -1
- lib/GoLiveUpdateUrls.php +12 -5
- readme.txt +2 -1
go-live-update-urls.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://lipeimagination.info/
|
|
5 |
Description: This Plugin Updates all the URLs in the database to point to the new URL when making your site live or changing domains.
|
6 |
Author: Mat Lipe
|
7 |
Author URI: http://lipeimagination/
|
8 |
-
Version: 2.
|
9 |
*/
|
10 |
|
11 |
define( 'GLUU_VIEWS_DIR', plugin_dir_path(__FILE__) . 'views/' );
|
5 |
Description: This Plugin Updates all the URLs in the database to point to the new URL when making your site live or changing domains.
|
6 |
Author: Mat Lipe
|
7 |
Author URI: http://lipeimagination/
|
8 |
+
Version: 2.1
|
9 |
*/
|
10 |
|
11 |
define( 'GLUU_VIEWS_DIR', plugin_dir_path(__FILE__) . 'views/' );
|
lib/GoLiveUpdateUrls.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Methods for the Go Live Update Urls Plugin
|
4 |
* @author Mat Lipe
|
5 |
-
* @since 2.
|
6 |
*
|
7 |
* @TODO Cleanup the Names and formatting
|
8 |
*/
|
@@ -185,7 +185,7 @@ function gluu_make_the_updates(){
|
|
185 |
* Goes through a table line by line and updates it
|
186 |
*
|
187 |
* @uses for tables which may contain seralized arrays
|
188 |
-
* @since 2.
|
189 |
*
|
190 |
* @param string $table the table to go through
|
191 |
* @param string $column to column in the table to go through
|
@@ -197,7 +197,7 @@ function gluu_make_the_updates(){
|
|
197 |
$primary_key_column = $pk[0]->Column_name;
|
198 |
|
199 |
//Get all the Seralized Rows and Replace them properly
|
200 |
-
$rows = $wpdb->get_results("SELECT $primary_key_column, $column FROM $table WHERE $column LIKE 'a:%' OR $column LIKE '
|
201 |
|
202 |
foreach( $rows as $row ){
|
203 |
if( is_bool($data = @unserialize($row->{$column})) ) continue;
|
@@ -220,7 +220,7 @@ function gluu_make_the_updates(){
|
|
220 |
* Replaces all the occurances of a string in a multi dementional array or Object
|
221 |
*
|
222 |
* @uses itself to call each level of the array
|
223 |
-
* @since 2.
|
224 |
*
|
225 |
* @param array|object|string $data to change
|
226 |
* @param string $old the old string
|
@@ -229,11 +229,18 @@ function gluu_make_the_updates(){
|
|
229 |
*
|
230 |
*/
|
231 |
function replaceTree( $data, $old, $new, $changeKeys = false ){
|
232 |
-
|
|
|
233 |
return str_replace( $old, $new, $data );
|
234 |
}
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
foreach( $data as $key => $item ){
|
|
|
237 |
if( $changeKeys ){
|
238 |
$key = str_replace( $old, $new, $key );
|
239 |
}
|
2 |
/**
|
3 |
* Methods for the Go Live Update Urls Plugin
|
4 |
* @author Mat Lipe
|
5 |
+
* @since 2.1
|
6 |
*
|
7 |
* @TODO Cleanup the Names and formatting
|
8 |
*/
|
185 |
* Goes through a table line by line and updates it
|
186 |
*
|
187 |
* @uses for tables which may contain seralized arrays
|
188 |
+
* @since 2.1
|
189 |
*
|
190 |
* @param string $table the table to go through
|
191 |
* @param string $column to column in the table to go through
|
197 |
$primary_key_column = $pk[0]->Column_name;
|
198 |
|
199 |
//Get all the Seralized Rows and Replace them properly
|
200 |
+
$rows = $wpdb->get_results("SELECT $primary_key_column, $column FROM $table WHERE $column LIKE 'a:%' OR $column LIKE 'O:%'");
|
201 |
|
202 |
foreach( $rows as $row ){
|
203 |
if( is_bool($data = @unserialize($row->{$column})) ) continue;
|
220 |
* Replaces all the occurances of a string in a multi dementional array or Object
|
221 |
*
|
222 |
* @uses itself to call each level of the array
|
223 |
+
* @since 2.1
|
224 |
*
|
225 |
* @param array|object|string $data to change
|
226 |
* @param string $old the old string
|
229 |
*
|
230 |
*/
|
231 |
function replaceTree( $data, $old, $new, $changeKeys = false ){
|
232 |
+
|
233 |
+
if( is_string($data) ){
|
234 |
return str_replace( $old, $new, $data );
|
235 |
}
|
236 |
+
|
237 |
+
if( !($is_array = is_array( $data )) && !is_object($data) ){
|
238 |
+
return $data;
|
239 |
+
}
|
240 |
+
|
241 |
|
242 |
foreach( $data as $key => $item ){
|
243 |
+
|
244 |
if( $changeKeys ){
|
245 |
$key = str_replace( $old, $new, $key );
|
246 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypa
|
|
4 |
Tags: Go Live, Urls, Domain Changes
|
5 |
Requires at least: 3.1
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
== Description ==
|
10 |
|
@@ -67,6 +67,7 @@ Most tables will be just fine to update. You may make a backup of your database,
|
|
67 |
1. Screenshot of a tyical settings page. The verbage will change slightly depending on your database structure
|
68 |
|
69 |
== Changelog ==
|
|
|
70 |
= 2.0 =
|
71 |
* Made updating the options table seralized safe *
|
72 |
* Add extending ability of views and css *
|
4 |
Tags: Go Live, Urls, Domain Changes
|
5 |
Requires at least: 3.1
|
6 |
Tested up to: 3.5.1
|
7 |
+
Stable tag: 2.1
|
8 |
|
9 |
== Description ==
|
10 |
|
67 |
1. Screenshot of a tyical settings page. The verbage will change slightly depending on your database structure
|
68 |
|
69 |
== Changelog ==
|
70 |
+
|
71 |
= 2.0 =
|
72 |
* Made updating the options table seralized safe *
|
73 |
* Add extending ability of views and css *
|