Version Description
Major version update. Not backward compatible with version 5 filters or code. Please remove any custom filters or extensions before updating.
Download this release
Release Info
Developer | Mat Lipe |
Plugin | Go Live Update URLS |
Version | 6.0.1 |
Comparing to | |
See all releases |
Code changes from version 6.0.0 to 6.0.1
- go-live-update-urls.php +3 -3
- readme.txt +23 -10
- src/Admin_Page.php +0 -190
- src/Updaters/Abstract.php +0 -102
- src/Updaters/JSON.php +0 -38
- views/admin-tools-page.php +0 -165
go-live-update-urls.php
CHANGED
@@ -5,13 +5,13 @@
|
|
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.0.
|
9 |
* Text Domain: go-live-update-urls
|
10 |
*
|
11 |
* @package go-live-update-urls
|
12 |
*/
|
13 |
|
14 |
-
define( 'GO_LIVE_UPDATE_URLS_VERSION', '6.0.
|
15 |
define( 'GO_LIVE_UPDATE_URLS_REQUIRED_PRO_VERSION', '6.0.0' );
|
16 |
define( 'GO_LIVE_UPDATE_URLS_URL', plugin_dir_url( __FILE__ ) );
|
17 |
|
@@ -42,7 +42,7 @@ function go_live_update_urls_load() {
|
|
42 |
}
|
43 |
}
|
44 |
|
45 |
-
add_action( 'plugins_loaded', 'go_live_update_urls_load' );
|
46 |
|
47 |
/**
|
48 |
* Autoload classes from PSR4 src directory
|
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.0.1
|
9 |
* Text Domain: go-live-update-urls
|
10 |
*
|
11 |
* @package go-live-update-urls
|
12 |
*/
|
13 |
|
14 |
+
define( 'GO_LIVE_UPDATE_URLS_VERSION', '6.0.1' );
|
15 |
define( 'GO_LIVE_UPDATE_URLS_REQUIRED_PRO_VERSION', '6.0.0' );
|
16 |
define( 'GO_LIVE_UPDATE_URLS_URL', plugin_dir_url( __FILE__ ) );
|
17 |
|
42 |
}
|
43 |
}
|
44 |
|
45 |
+
add_action( 'plugins_loaded', 'go_live_update_urls_load', 8 );
|
46 |
|
47 |
/**
|
48 |
* Autoload classes from PSR4 src directory
|
readme.txt
CHANGED
@@ -3,26 +3,26 @@ 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¤cy_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: 4.8.0
|
6 |
-
Tested up to: 5.4.
|
7 |
Requires PHP: 5.6.0
|
8 |
-
Stable tag: 6.0.
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
Goes through entire site and replaces all instances of an old url with a new one. Used to change the domain of a site. Works on both multi-site and single site installs.
|
13 |
|
14 |
-
<strong>Check out <a href="https://onpointplugins.com/product/go-live-update-urls-pro/" target="_blank">Go Live Update Urls PRO</a> for more features including priority support, the ability to test a URL before
|
15 |
|
16 |
-
<blockquote><a href="https://onpointplugins.com/product/go-live-update-urls-pro/" target="_blank">Pro version
|
17 |
|
18 |
|
19 |
-
<
|
20 |
* Database table by table selection.
|
21 |
* Updates serialized data in core tables.
|
22 |
* Very easy to use admin page - which may be found under Tools.
|
23 |
|
24 |
|
25 |
-
<
|
26 |
* Posts
|
27 |
* Pages
|
28 |
* Image urls
|
@@ -33,7 +33,7 @@ Goes through entire site and replaces all instances of an old url with a new one
|
|
33 |
* Options and settings
|
34 |
* And much more
|
35 |
|
36 |
-
<
|
37 |
* Updates database tables created by plugins without fear of breaking.
|
38 |
* Database tables are organized into simple intuitive sections.
|
39 |
* Updates serialized data across any table.
|
@@ -48,14 +48,22 @@ Goes through entire site and replaces all instances of an old url with a new one
|
|
48 |
* WP-CLI support for updating URLs from the command line.
|
49 |
* Priority Support with access to members only support area.
|
50 |
|
51 |
-
<
|
52 |
* English (US)
|
53 |
* French (fr_FR)
|
54 |
* German (de_DE)
|
55 |
* Spanish (es_ES)
|
56 |
|
|
|
|
|
57 |
|
58 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
Send pull requests via the <a href="https://github.com/lipemat/go-live-update-urls/">Github Repo</a>
|
60 |
|
61 |
== Installation ==
|
@@ -90,6 +98,11 @@ If you wish to try to update tables mentioned as not safe anyway, you may make a
|
|
90 |
1. Typical settings page. The verbiage will change slightly depending on your database structure
|
91 |
|
92 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
93 |
= 6.0.0 =
|
94 |
* Entirely new code structure.
|
95 |
* Removed all deprecated code and filters.
|
@@ -151,7 +164,7 @@ If you wish to try to update tables mentioned as not safe anyway, you may make a
|
|
151 |
|
152 |
|
153 |
== Upgrade Notice ==
|
154 |
-
= 6.0.
|
155 |
Major version update. Not backward compatible with version 5 filters or code. Please remove any custom filters or extensions before updating.
|
156 |
|
157 |
= 5.0.6 =
|
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¤cy_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: 4.8.0
|
6 |
+
Tested up to: 5.4.2
|
7 |
Requires PHP: 5.6.0
|
8 |
+
Stable tag: 6.0.1
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
Goes through entire site and replaces all instances of an old url with a new one. Used to change the domain of a site. Works on both multi-site and single site installs.
|
13 |
|
14 |
+
<strong>Check out <a href="https://onpointplugins.com/product/go-live-update-urls-pro/" target="_blank">Go Live Update Urls PRO</a> for more features including priority support, the ability to test a URL before updating, support for tables created by plugins, update history, and so much more!</strong>
|
15 |
|
16 |
+
<blockquote><a href="https://onpointplugins.com/product/go-live-update-urls-pro/" target="_blank">Pro version 6.0.0</a> is now available with a greatly improved testing and updating experience!</blockquote>
|
17 |
|
18 |
|
19 |
+
<h3>Features</h3>
|
20 |
* Database table by table selection.
|
21 |
* Updates serialized data in core tables.
|
22 |
* Very easy to use admin page - which may be found under Tools.
|
23 |
|
24 |
|
25 |
+
<h3>Updates Entire Site including</h3>
|
26 |
* Posts
|
27 |
* Pages
|
28 |
* Image urls
|
33 |
* Options and settings
|
34 |
* And much more
|
35 |
|
36 |
+
<h3>Pro Features</h3>
|
37 |
* Updates database tables created by plugins without fear of breaking.
|
38 |
* Database tables are organized into simple intuitive sections.
|
39 |
* Updates serialized data across any table.
|
48 |
* WP-CLI support for updating URLs from the command line.
|
49 |
* Priority Support with access to members only support area.
|
50 |
|
51 |
+
<h3>Currently ships with the following languages</h3>
|
52 |
* English (US)
|
53 |
* French (fr_FR)
|
54 |
* German (de_DE)
|
55 |
* Spanish (es_ES)
|
56 |
|
57 |
+
<h3>Developers</h3>
|
58 |
+
Developer docs may be found <a target="_blank" href="https://onpointplugins.com/go-live-update-urls/developer-docs-go-live-update-urls/">here</a>.
|
59 |
|
60 |
+
<h3>Troubleshooting</h3>
|
61 |
+
Troubleshooting information may be found <a target="_blank" href="https://onpointplugins.com/go-live-update-urls/go-live-update-urls-troubleshooting/">here</a>.
|
62 |
+
|
63 |
+
<h3>Contribute</h3>
|
64 |
+
Send pull requests via the <a href="https://github.com/lipemat/go-live-update-urls/">Github Repo</a>
|
65 |
+
|
66 |
+
<h3>Contribute</h3>
|
67 |
Send pull requests via the <a href="https://github.com/lipemat/go-live-update-urls/">Github Repo</a>
|
68 |
|
69 |
== Installation ==
|
98 |
1. Typical settings page. The verbiage will change slightly depending on your database structure
|
99 |
|
100 |
== Changelog ==
|
101 |
+
= 6.0.1 -
|
102 |
+
* Improve compatibility with very old versions of PRO.
|
103 |
+
* Improve readme.
|
104 |
+
* Add links for documenation and troubleshooting.
|
105 |
+
|
106 |
= 6.0.0 =
|
107 |
* Entirely new code structure.
|
108 |
* Removed all deprecated code and filters.
|
164 |
|
165 |
|
166 |
== Upgrade Notice ==
|
167 |
+
= 6.0.1 =
|
168 |
Major version update. Not backward compatible with version 5 filters or code. Please remove any custom filters or extensions before updating.
|
169 |
|
170 |
= 5.0.6 =
|
src/Admin_Page.php
DELETED
@@ -1,190 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Go_Live_Update_Urls_Admin_Page
|
5 |
-
*
|
6 |
-
* @author OnPoint Plugins
|
7 |
-
* @since 5.0.0
|
8 |
-
*
|
9 |
-
*/
|
10 |
-
class Go_Live_Update_Urls_Admin_Page {
|
11 |
-
const NONCE = 'go-live-update-urls/nonce/update-tables';
|
12 |
-
const TABLE_INPUT_NAME = 'go-live-update-urls/input/database-table';
|
13 |
-
const SUBMIT = 'go-live-update-urls/input/submit';
|
14 |
-
|
15 |
-
//@todo change these to snake-case after 6/1/18
|
16 |
-
const OLD_URL = 'oldurl';
|
17 |
-
const NEW_URL = 'newurl';
|
18 |
-
|
19 |
-
|
20 |
-
protected function hook() {
|
21 |
-
if ( ! empty( $_POST[ self::SUBMIT ] ) ) {
|
22 |
-
add_action( 'init', array( $this, 'validate_update_submission' ) );
|
23 |
-
}
|
24 |
-
|
25 |
-
add_action( 'admin_menu', array( $this, 'register_admin_page' ) );
|
26 |
-
}
|
27 |
-
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Validate and trigger an update submission
|
31 |
-
*
|
32 |
-
* @since 5.0.0
|
33 |
-
*
|
34 |
-
* @return void
|
35 |
-
*/
|
36 |
-
public function validate_update_submission() {
|
37 |
-
if ( ! wp_verify_nonce( sanitize_text_field( $_POST[ self::NONCE ] ), self::NONCE ) ) {
|
38 |
-
wp_die( esc_html__( 'Ouch! That hurt! You should not be here!', 'go-live-update-urls' ) );
|
39 |
-
}
|
40 |
-
|
41 |
-
$old_url = trim( sanitize_text_field( $_POST[ self::OLD_URL ] ) );
|
42 |
-
$new_url = trim( sanitize_text_field( $_POST[ self::NEW_URL ] ) );
|
43 |
-
if ( empty( $old_url ) || empty( $new_url ) || empty( $_POST[ self::TABLE_INPUT_NAME ] ) ) {
|
44 |
-
add_action( 'admin_notices', array( $this, 'epic_fail' ) );
|
45 |
-
return;
|
46 |
-
}
|
47 |
-
|
48 |
-
$tables = array_map( 'sanitize_text_field', $_POST[ self::TABLE_INPUT_NAME ] );
|
49 |
-
|
50 |
-
$this->tables = $tables; // For backward compatibility. Kill when this deprecated call is removed.
|
51 |
-
do_action_deprecated( 'gluu-before-make-update', array( $this ), '5.0.0', 'go-live-update-urls/admin-page/before-update' );
|
52 |
-
|
53 |
-
do_action( 'go-live-update-urls/admin-page/before-update', $old_url, $new_url, $tables );
|
54 |
-
|
55 |
-
if ( Go_Live_Update_Urls_Database::instance()->update_the_database( $old_url, $new_url, $tables ) ) {
|
56 |
-
add_action( 'admin_notices', array( $this, 'success' ) );
|
57 |
-
add_filter( 'go-live-update-urls/views/admin-tools-page/disable-description', '__return_true' );
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
public function success() {
|
63 |
-
$message = apply_filters( 'go-live-update-urls-success-message', __( 'The URLS in the checked tables have been updated.', 'go-live-update-urls' ) );
|
64 |
-
?>
|
65 |
-
<div id="message" class="updated fade">
|
66 |
-
<p>
|
67 |
-
<strong>
|
68 |
-
<?php echo esc_html( $message ); ?>
|
69 |
-
</strong>
|
70 |
-
</p>
|
71 |
-
</div>
|
72 |
-
<?php
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Display a message if any fields were not filed out.
|
78 |
-
*
|
79 |
-
* @return void
|
80 |
-
*/
|
81 |
-
public function epic_fail() {
|
82 |
-
?>
|
83 |
-
<div id="message" class="error fade">
|
84 |
-
<p>
|
85 |
-
<strong><?php esc_html_e( 'You must fill out both URLs and select tables to update URLs!', 'go-live-update-urls' ); ?></strong>
|
86 |
-
</p>
|
87 |
-
</div>
|
88 |
-
<?php
|
89 |
-
|
90 |
-
}
|
91 |
-
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Menu Under Tools Menu
|
95 |
-
*
|
96 |
-
* @since 5.0.0
|
97 |
-
*/
|
98 |
-
public function register_admin_page() {
|
99 |
-
add_management_page( 'go-live-update-urls-setting', 'Go Live', 'manage_options', 'go-live-update-urls-settings', array(
|
100 |
-
$this,
|
101 |
-
'admin_page',
|
102 |
-
) );
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Output the Admin Page for using this plugin
|
108 |
-
*
|
109 |
-
* @since 5.0.0
|
110 |
-
*
|
111 |
-
*/
|
112 |
-
public function admin_page() {
|
113 |
-
wp_enqueue_script( 'go-live-update-urls-admin-page', Go_Live_Update_Urls_Core::plugin_url( 'resources/js/admin-page.js' ), array( 'jquery' ), GO_LIVE_UPDATE_URLS_VERSION );
|
114 |
-
|
115 |
-
require Go_Live_Update_Urls_Core::instance()->get_view_file( 'admin-tools-page.php' );
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Creates a list of checkboxes for each table
|
121 |
-
*
|
122 |
-
* @since 5.0.0
|
123 |
-
*
|
124 |
-
* @param array $tables
|
125 |
-
* @param string $list - uses by js to separate lists
|
126 |
-
* @param bool $checked
|
127 |
-
*
|
128 |
-
* @return void
|
129 |
-
*
|
130 |
-
*/
|
131 |
-
public function render_check_boxes( $tables, $list, $checked = true ) {
|
132 |
-
?>
|
133 |
-
<ul
|
134 |
-
class="go-live-update-urls/checkboxes go-live-update-urls/checkboxes/<?php echo esc_attr( $list ); ?>"
|
135 |
-
data-list="<?php echo esc_attr( $list ); ?>">
|
136 |
-
<?php
|
137 |
-
|
138 |
-
foreach ( $tables as $_table ) {
|
139 |
-
?>
|
140 |
-
<li>
|
141 |
-
<?php
|
142 |
-
printf( '<input name="%s[]" type="checkbox" value="%s" %s /> %s', esc_attr( self::TABLE_INPUT_NAME ), esc_attr( $_table ), checked( $checked, true, false ), esc_html( $_table ) );
|
143 |
-
?>
|
144 |
-
</li>
|
145 |
-
<?php
|
146 |
-
}
|
147 |
-
|
148 |
-
?>
|
149 |
-
</ul>
|
150 |
-
<?php
|
151 |
-
|
152 |
-
|
153 |
-
}
|
154 |
-
|
155 |
-
/********** SINGLETON **********/
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Instance of this class for use as singleton
|
159 |
-
*
|
160 |
-
* @var self
|
161 |
-
*/
|
162 |
-
protected static $instance;
|
163 |
-
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Create the instance of the class
|
167 |
-
*
|
168 |
-
* @static
|
169 |
-
* @return void
|
170 |
-
*/
|
171 |
-
public static function init() {
|
172 |
-
self::instance()->hook();
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Get (and instantiate, if necessary) the instance of the
|
178 |
-
* class
|
179 |
-
*
|
180 |
-
* @static
|
181 |
-
* @return self
|
182 |
-
*/
|
183 |
-
public static function instance() {
|
184 |
-
if ( ! is_a( self::$instance, __CLASS__ ) ) {
|
185 |
-
self::$instance = new self();
|
186 |
-
}
|
187 |
-
|
188 |
-
return self::$instance;
|
189 |
-
}
|
190 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Updaters/Abstract.php
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Base Abstract for any URL updating classes.
|
5 |
-
*
|
6 |
-
* @author OnPoint Plugins
|
7 |
-
* @since 5.0.0
|
8 |
-
*/
|
9 |
-
abstract class Go_Live_Update_Urls__Updaters__Abstract {
|
10 |
-
/**
|
11 |
-
* The database table.
|
12 |
-
*
|
13 |
-
* @var string
|
14 |
-
*/
|
15 |
-
protected $table;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* The database column.
|
19 |
-
*
|
20 |
-
* @var string
|
21 |
-
*/
|
22 |
-
protected $column;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* The old URL.
|
26 |
-
*
|
27 |
-
* @var string
|
28 |
-
*/
|
29 |
-
protected $old;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* The new URL.
|
33 |
-
*
|
34 |
-
* @var string
|
35 |
-
*/
|
36 |
-
protected $new;
|
37 |
-
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Go_Live_Update_Urls__Updaters__Abstract constructor.
|
41 |
-
*
|
42 |
-
* @param string $table Table to update.
|
43 |
-
* @param string $column Column to update.
|
44 |
-
* @param string $old_url Old URL.
|
45 |
-
* @param string $new_url New URL.
|
46 |
-
*/
|
47 |
-
public function __construct( $table, $column, $old_url, $new_url ) {
|
48 |
-
$this->table = $table;
|
49 |
-
$this->column = $column;
|
50 |
-
$this->old = $old_url;
|
51 |
-
$this->new = $new_url;
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Update this table and column.
|
57 |
-
*
|
58 |
-
* @param string $old_url Old URL.
|
59 |
-
* @param string $new_url New URL.
|
60 |
-
*
|
61 |
-
* @return void
|
62 |
-
*/
|
63 |
-
protected function update_column( $old_url, $new_url ) {
|
64 |
-
Go_Live_Update_Urls_Database::instance()->update_column( $this->table, $this->column, $old_url, $new_url );
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Filter the new or old url based on this particular updater's logic.
|
70 |
-
*
|
71 |
-
* @param string $url - Either the old or new URL.
|
72 |
-
*
|
73 |
-
* @return string
|
74 |
-
*/
|
75 |
-
abstract public function apply_rule_to_url( $url );
|
76 |
-
|
77 |
-
|
78 |
-
/**
|
79 |
-
* The method which is called to actually run the update
|
80 |
-
* using this updater.
|
81 |
-
*
|
82 |
-
* @return bool
|
83 |
-
*/
|
84 |
-
abstract public function update_data();
|
85 |
-
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Factory to get constructed class .
|
89 |
-
*
|
90 |
-
* @param string $table Table to update.
|
91 |
-
* @param string $column Column to update.
|
92 |
-
* @param string $old_url Old URL.
|
93 |
-
* @param string $new_url New URL.
|
94 |
-
*
|
95 |
-
* @since 5.3.0
|
96 |
-
*
|
97 |
-
* @return static
|
98 |
-
*/
|
99 |
-
public static function factory( $table, $column, $old_url, $new_url ) {
|
100 |
-
return new static( $table, $column, $old_url, $new_url );
|
101 |
-
}
|
102 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/Updaters/JSON.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* JSON
|
5 |
-
*
|
6 |
-
* When a url is entered into the db using json_encode it
|
7 |
-
* get's extra \/ at each slash
|
8 |
-
*
|
9 |
-
* This updater simulates the same slashes and replaces matches
|
10 |
-
*
|
11 |
-
* If the url either new or old has a slash we run this
|
12 |
-
*
|
13 |
-
* Because there is no real good way to detect this which is any lighter
|
14 |
-
* than just doing the update we run it on each column
|
15 |
-
*
|
16 |
-
*
|
17 |
-
* @author OnPoint Plugins
|
18 |
-
* @since 5.0.0
|
19 |
-
*
|
20 |
-
* @package Gluu\Updates
|
21 |
-
*/
|
22 |
-
class Go_Live_Update_Urls__Updaters__JSON extends Go_Live_Update_Urls__Updaters__Abstract {
|
23 |
-
public function apply_rule_to_url( $url ) {
|
24 |
-
return substr( wp_json_encode( $url ), 1, - 1 );
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
public function update_data() {
|
29 |
-
if ( ! strpos( $this->new, '/' ) && ! strpos( $this->old, '/' ) ) {
|
30 |
-
return false;
|
31 |
-
}
|
32 |
-
|
33 |
-
$this->update_column( $this->apply_rule_to_url( $this->old ), $this->apply_rule_to_url( $this->new ) );
|
34 |
-
|
35 |
-
return true;
|
36 |
-
}
|
37 |
-
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/admin-tools-page.php
DELETED
@@ -1,165 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Main Admin screen view
|
4 |
-
*
|
5 |
-
* Do not edit this file directly!
|
6 |
-
*
|
7 |
-
* Create a directory named `go-live-update-urls` in your theme and copy this file
|
8 |
-
* into that directory. Then you may edit at will.
|
9 |
-
*
|
10 |
-
* @since 5.2.5
|
11 |
-
*
|
12 |
-
* @package go-live-update-urls
|
13 |
-
*/
|
14 |
-
|
15 |
-
$db = Go_Live_Update_Urls_Database::instance();
|
16 |
-
|
17 |
-
?>
|
18 |
-
<div id="go-live-update-urls/admin-page" class="wrap">
|
19 |
-
<h2>
|
20 |
-
<?php esc_html_e( 'Go Live Update Urls', 'go-live-update-urls' ); ?>
|
21 |
-
</h2>
|
22 |
-
|
23 |
-
<?php
|
24 |
-
if ( ! apply_filters( 'go-live-update-urls/views/admin-tools-page/disable-description', false ) ) {
|
25 |
-
?>
|
26 |
-
|
27 |
-
<p class="description">
|
28 |
-
<?php
|
29 |
-
/* translators: <strong></strong> */
|
30 |
-
printf( esc_html_x( 'This will replace all occurrences %1$sin the entire database%2$s of the Old URL with the New URL.', '{<strong>} {</strong>}', 'go-live-update-urls' ), '<strong>', '</strong>' );
|
31 |
-
?>
|
32 |
-
</p>
|
33 |
-
|
34 |
-
<strong>
|
35 |
-
<em style="color:red">
|
36 |
-
<?php esc_html_e( 'Like any other database updating tool, you should always perform a backup before running.', 'go-live-update-urls' ); ?>
|
37 |
-
</em>
|
38 |
-
</strong>
|
39 |
-
<br/><br/>
|
40 |
-
<hr/>
|
41 |
-
|
42 |
-
<?php
|
43 |
-
}
|
44 |
-
?>
|
45 |
-
|
46 |
-
<form method="post" id="go-live-update-urls/checkbox-form">
|
47 |
-
<?php
|
48 |
-
wp_nonce_field( Go_Live_Update_Urls_Admin_Page::NONCE, Go_Live_Update_Urls_Admin_Page::NONCE );
|
49 |
-
|
50 |
-
do_action( 'gluu_before_checkboxes', $db );
|
51 |
-
|
52 |
-
if ( apply_filters( 'gluu-use-default_checkboxes', true ) ) {
|
53 |
-
?>
|
54 |
-
<h2>
|
55 |
-
<?php esc_html_e( 'WordPress Core Tables', 'go-live-update-urls' ); ?>
|
56 |
-
</h2>
|
57 |
-
<p class="description" style="color:green">
|
58 |
-
<strong>
|
59 |
-
<?php esc_attr_e( 'These tables are safe to update with the basic version of this plugin.', 'go-live-update-urls' ); ?>
|
60 |
-
</strong>
|
61 |
-
</p>
|
62 |
-
<p>
|
63 |
-
<input
|
64 |
-
type="checkbox"
|
65 |
-
class="go-live-update-urls/checkboxes/check-all"
|
66 |
-
data-list="wp-core"
|
67 |
-
data-js="go-live-update-urls/checkboxes/check-all"
|
68 |
-
checked
|
69 |
-
/>
|
70 |
-
<hr/>
|
71 |
-
</p>
|
72 |
-
<?php
|
73 |
-
Go_Live_Update_Urls_Admin_Page::instance()->render_check_boxes( $db->get_core_tables(), 'wp-core' );
|
74 |
-
|
75 |
-
$custom_tables = $db->get_custom_plugin_tables();
|
76 |
-
if ( ! empty( $custom_tables ) ) {
|
77 |
-
?>
|
78 |
-
<hr/>
|
79 |
-
|
80 |
-
<h2>
|
81 |
-
<?php esc_html_e( 'Tables Created By Plugins', 'go-live-update-urls' ); ?>
|
82 |
-
</h2>
|
83 |
-
<p class="description" style="color:red">
|
84 |
-
<strong>
|
85 |
-
<?php
|
86 |
-
/* translators: <br /> <a> </a> */
|
87 |
-
printf( esc_html_x( 'These tables are probably NOT SAFE to update with the basic version of this plugin. %1$sTo support tables created by plugins use the %2$sPro Version%3$s.', '{<br />}{<a>}{</a>}', 'go-live-update-urls' ), '<br />', '<a href="https://onpointplugins.com/product/go-live-update-urls-pro/" target="_blank">', '</a>' );
|
88 |
-
?>
|
89 |
-
</strong>
|
90 |
-
</p>
|
91 |
-
<p>
|
92 |
-
<input
|
93 |
-
type="checkbox"
|
94 |
-
class="go-live-update-urls/checkboxes/check-all"
|
95 |
-
data-list="custom-plugins"
|
96 |
-
data-js="go-live-update-urls/checkboxes/check-all"/>
|
97 |
-
<hr/>
|
98 |
-
</p>
|
99 |
-
<?php
|
100 |
-
Go_Live_Update_Urls_Admin_Page::instance()->render_check_boxes( $custom_tables, 'custom-plugins', false );
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
do_action( 'gluu_after_checkboxes', $db );
|
105 |
-
|
106 |
-
?>
|
107 |
-
<hr/>
|
108 |
-
<table class="form-table" id="go-live-update-urls/url-fields">
|
109 |
-
<tr>
|
110 |
-
<th scope="row" style="width:150px;">
|
111 |
-
<label for="old_url">
|
112 |
-
<?php esc_html_e( 'Old URL', 'go-live-update-urls' ); ?>
|
113 |
-
</label>
|
114 |
-
</th>
|
115 |
-
<td>
|
116 |
-
<input
|
117 |
-
name="<?php echo esc_attr( Go_Live_Update_Urls_Admin_Page::OLD_URL ); ?>"
|
118 |
-
type="text"
|
119 |
-
id="old_url"
|
120 |
-
value=""
|
121 |
-
style="width:300px;"
|
122 |
-
title="<?php esc_attr_e( 'Old URL', 'go-live-update-urls' ); ?>"/>
|
123 |
-
</td>
|
124 |
-
</tr>
|
125 |
-
<tr>
|
126 |
-
<th scope="row" style="width:150px;">
|
127 |
-
<label for="new_url">
|
128 |
-
<?php esc_attr_e( 'New URL', 'go-live-update-urls' ); ?>
|
129 |
-
</label>
|
130 |
-
</th>
|
131 |
-
<td>
|
132 |
-
<input
|
133 |
-
name="<?php echo esc_attr( Go_Live_Update_Urls_Admin_Page::NEW_URL ); ?>"
|
134 |
-
type="text"
|
135 |
-
id="new_url"
|
136 |
-
value=""
|
137 |
-
style="width:300px;"
|
138 |
-
title="<?php esc_attr_e( 'New URL', 'go-live-update-urls' ); ?>"/>
|
139 |
-
</td>
|
140 |
-
</tr>
|
141 |
-
</table>
|
142 |
-
<p class="description" id="go-live-update-urls/views/only-checked">
|
143 |
-
<strong>
|
144 |
-
<?php
|
145 |
-
echo esc_html( apply_filters( 'gluu-uncheck-message', __( 'Only the checked tables will be updated.', 'go-live-update-urls' ) ) );
|
146 |
-
?>
|
147 |
-
</strong>
|
148 |
-
</p>
|
149 |
-
<?php
|
150 |
-
if ( ! defined( 'GO_LIVE_UPDATE_URLS_PRO_VERSION' ) ) {
|
151 |
-
?>
|
152 |
-
<p class="description" style="color:#23282d">
|
153 |
-
<strong>
|
154 |
-
<?php
|
155 |
-
/* translators: <a></a> */
|
156 |
-
printf( esc_html_x( 'To test this change before running it, use %1$sPro Version 2.0.0+%2$s.', '{<a>}{</a>}', 'go-live-update-urls' ), '<a href="https://onpointplugins.com/product/go-live-update-urls-pro/" target="_blank">', '</a>' );
|
157 |
-
?>
|
158 |
-
</strong>
|
159 |
-
</p>
|
160 |
-
<?php
|
161 |
-
}
|
162 |
-
?>
|
163 |
-
<?php submit_button( __( 'Update URLs', 'go-live-update-urls' ), 'primary', Go_Live_Update_Urls_Admin_Page::SUBMIT ); ?>
|
164 |
-
</form>
|
165 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|