Go Live Update URLS - Version 5.3.0

Version Description

  • Display error message when no tables are selected during update.
  • Fix bug when updating columns which are name the same as MySQL commands.
  • Remove confusing '- Serialized' label from checkboxes list.
  • Improve stability to modernize code some code.
  • Introduce go-live-update-urls/views/admin-tools-page/disable-description filter.
  • Cleanup some long deprecated code.
Download this release

Release Info

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

Code changes from version 5.2.12 to 5.3.0

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: 5.2.12
9
  * Text Domain: go-live-update-urls
10
  *
11
  * @package go-live-update-urls
12
  */
13
 
14
- define( 'GO_LIVE_UPDATE_URLS_VERSION', '5.2.12' );
15
 
16
  /**
17
  * Load the plugin
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: 5.3.0
9
  * Text Domain: go-live-update-urls
10
  *
11
  * @package go-live-update-urls
12
  */
13
 
14
+ define( 'GO_LIVE_UPDATE_URLS_VERSION', '5.3.0' );
15
 
16
  /**
17
  * Load the plugin
languages/go-live-update-urls-de_DE.mo CHANGED
Binary file
languages/go-live-update-urls-de_DE.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Go Live Update URLS\n"
4
- "POT-Creation-Date: 2019-10-22 11:06-0400\n"
5
- "PO-Revision-Date: 2019-10-22 11:06-0400\n"
6
  "Last-Translator: Mat Lipe <support@onpointplugins.com>\n"
7
  "Language-Team: \n"
8
  "Language: de_DE\n"
@@ -24,15 +24,15 @@ msgstr ""
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr "Autsch! Das tut weh! Du solltest nicht hier sein!"
26
 
27
- #: src/Admin_Page.php:62
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr "Die URLs in den überprüften Tabellen wurden aktualisiert."
30
 
31
- #: src/Admin_Page.php:79
32
- msgid "You must fill out both URLS to make the update!."
33
- msgstr "Sie müssen beide URLs ausfüllen, um das Update durchzuführen!."
34
 
35
- #: src/Admin_Page.php:141
36
  msgid "Serialized"
37
  msgstr "Seriell"
38
 
@@ -41,7 +41,7 @@ msgstr "Seriell"
41
  msgid "Go Live Update Urls"
42
  msgstr "Go Live Update Urls"
43
 
44
- #: views/admin-tools-page.php:27
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
@@ -51,7 +51,7 @@ msgstr ""
51
  "Dadurch werden alle Vorkommen%1$sin der gesamten Datenbank%2$s der alten URL "
52
  "durch die neue URL ersetzt."
53
 
54
- #: views/admin-tools-page.php:33
55
  msgid ""
56
  "Like any other database updating tool, you should always perform a backup "
57
  "before running."
@@ -59,21 +59,21 @@ msgstr ""
59
  "Wie jedes andere Datenbankaktualisierungstool sollten Sie vor dem Ausführen "
60
  "immer eine Sicherung durchführen."
61
 
62
- #: views/admin-tools-page.php:48
63
  msgid "WordPress Core Tables"
64
  msgstr "Kerntabellen"
65
 
66
- #: views/admin-tools-page.php:52
67
  msgid "These tables are safe to update with the basic version of this plugin."
68
  msgstr ""
69
  "Diese Tabellen können mit der Basisversion dieses Plugins sicher "
70
  "aktualisiert werden."
71
 
72
- #: views/admin-tools-page.php:74
73
  msgid "Tables Created By Plugins"
74
  msgstr "Tabellen erstellt von Plugins"
75
 
76
- #: views/admin-tools-page.php:80
77
  #, php-format
78
  msgctxt "{<br />}{<a>}{</a>}"
79
  msgid ""
@@ -84,19 +84,19 @@ msgstr ""
84
  "dieses Plugins zu aktualisieren. %1$sUm Tabellen zu unterstützen, die von "
85
  "Plugins erstellt wurden, verwenden Sie%2$sPro Version%3$s."
86
 
87
- #: views/admin-tools-page.php:105 views/admin-tools-page.php:115
88
  msgid "Old URL"
89
  msgstr "Alte URL"
90
 
91
- #: views/admin-tools-page.php:121 views/admin-tools-page.php:131
92
  msgid "New URL"
93
  msgstr "Neue URL"
94
 
95
- #: views/admin-tools-page.php:138
96
  msgid "Only the checked tables will be updated."
97
  msgstr "Nur die überprüften Tabellen werden aktualisiert."
98
 
99
- #: views/admin-tools-page.php:149
100
  #, php-format
101
  msgctxt "{<a>}{</a>}"
102
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
@@ -104,7 +104,7 @@ msgstr ""
104
  "Um diese Änderung vor dem Ausführen zu testen, verwenden Sie%1$sPro Version "
105
  "2.0.0 +%2$s."
106
 
107
- #: views/admin-tools-page.php:156
108
  msgid "Update URLs"
109
  msgstr "URLs aktualisieren"
110
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Go Live Update URLS\n"
4
+ "POT-Creation-Date: 2019-12-11 13:13-0500\n"
5
+ "PO-Revision-Date: 2019-12-11 13:13-0500\n"
6
  "Last-Translator: Mat Lipe <support@onpointplugins.com>\n"
7
  "Language-Team: \n"
8
  "Language: de_DE\n"
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr "Autsch! Das tut weh! Du solltest nicht hier sein!"
26
 
27
+ #: src/Admin_Page.php:63
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr "Die URLs in den überprüften Tabellen wurden aktualisiert."
30
 
31
+ #: src/Admin_Page.php:85
32
+ msgid "You must fill out both URLs and select tables to update URLs!"
33
+ msgstr "Sie müssen beide URLs ausfüllen, um das Update durchzuführen!"
34
 
35
+ #: src/Admin_Page.php:147
36
  msgid "Serialized"
37
  msgstr "Seriell"
38
 
41
  msgid "Go Live Update Urls"
42
  msgstr "Go Live Update Urls"
43
 
44
+ #: views/admin-tools-page.php:31
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
51
  "Dadurch werden alle Vorkommen%1$sin der gesamten Datenbank%2$s der alten URL "
52
  "durch die neue URL ersetzt."
53
 
54
+ #: views/admin-tools-page.php:37
55
  msgid ""
56
  "Like any other database updating tool, you should always perform a backup "
57
  "before running."
59
  "Wie jedes andere Datenbankaktualisierungstool sollten Sie vor dem Ausführen "
60
  "immer eine Sicherung durchführen."
61
 
62
+ #: views/admin-tools-page.php:56
63
  msgid "WordPress Core Tables"
64
  msgstr "Kerntabellen"
65
 
66
+ #: views/admin-tools-page.php:60
67
  msgid "These tables are safe to update with the basic version of this plugin."
68
  msgstr ""
69
  "Diese Tabellen können mit der Basisversion dieses Plugins sicher "
70
  "aktualisiert werden."
71
 
72
+ #: views/admin-tools-page.php:82
73
  msgid "Tables Created By Plugins"
74
  msgstr "Tabellen erstellt von Plugins"
75
 
76
+ #: views/admin-tools-page.php:88
77
  #, php-format
78
  msgctxt "{<br />}{<a>}{</a>}"
79
  msgid ""
84
  "dieses Plugins zu aktualisieren. %1$sUm Tabellen zu unterstützen, die von "
85
  "Plugins erstellt wurden, verwenden Sie%2$sPro Version%3$s."
86
 
87
+ #: views/admin-tools-page.php:113 views/admin-tools-page.php:123
88
  msgid "Old URL"
89
  msgstr "Alte URL"
90
 
91
+ #: views/admin-tools-page.php:129 views/admin-tools-page.php:139
92
  msgid "New URL"
93
  msgstr "Neue URL"
94
 
95
+ #: views/admin-tools-page.php:146
96
  msgid "Only the checked tables will be updated."
97
  msgstr "Nur die überprüften Tabellen werden aktualisiert."
98
 
99
+ #: views/admin-tools-page.php:157
100
  #, php-format
101
  msgctxt "{<a>}{</a>}"
102
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
104
  "Um diese Änderung vor dem Ausführen zu testen, verwenden Sie%1$sPro Version "
105
  "2.0.0 +%2$s."
106
 
107
+ #: views/admin-tools-page.php:164
108
  msgid "Update URLs"
109
  msgstr "URLs aktualisieren"
110
 
languages/go-live-update-urls-es_ES.mo CHANGED
Binary file
languages/go-live-update-urls-es_ES.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Go Live Update Urls\n"
4
- "POT-Creation-Date: 2019-10-22 11:05-0400\n"
5
- "PO-Revision-Date: 2019-10-22 11:06-0400\n"
6
  "Last-Translator: Mat Lipe <support@onpointplugins.com>\n"
7
  "Language-Team: \n"
8
  "Language: es_ES\n"
@@ -24,15 +24,15 @@ msgstr ""
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr "¡Ay! ¡Eso duele! ¡No deberías estar aquí!"
26
 
27
- #: src/Admin_Page.php:62
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr "Las URL en las tablas comprobadas se han actualizado."
30
 
31
- #: src/Admin_Page.php:79
32
- msgid "You must fill out both URLS to make the update!."
33
- msgstr "¡Debe completar ambas URL para hacer la actualización !."
34
 
35
- #: src/Admin_Page.php:141
36
  msgid "Serialized"
37
  msgstr "Serializado"
38
 
@@ -41,7 +41,7 @@ msgstr "Serializado"
41
  msgid "Go Live Update Urls"
42
  msgstr "Go Live Update Urls"
43
 
44
- #: views/admin-tools-page.php:27
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
@@ -51,7 +51,7 @@ msgstr ""
51
  "Esto reemplazará todas las ocurrencias%1$ sin toda la base de datos%2$ s de "
52
  "la URL anterior con la Nueva URL."
53
 
54
- #: views/admin-tools-page.php:33
55
  msgid ""
56
  "Like any other database updating tool, you should always perform a backup "
57
  "before running."
@@ -59,21 +59,21 @@ msgstr ""
59
  "Al igual que cualquier otra herramienta de actualización de base de datos, "
60
  "siempre debe realizar una copia de seguridad antes de ejecutar."
61
 
62
- #: views/admin-tools-page.php:48
63
  msgid "WordPress Core Tables"
64
  msgstr "Tablas centrales"
65
 
66
- #: views/admin-tools-page.php:52
67
  msgid "These tables are safe to update with the basic version of this plugin."
68
  msgstr ""
69
  "Estas tablas son seguras para actualizarse con la versión básica de este "
70
  "complemento."
71
 
72
- #: views/admin-tools-page.php:74
73
  msgid "Tables Created By Plugins"
74
  msgstr "Tablas creadas por complementos"
75
 
76
- #: views/admin-tools-page.php:80
77
  #, php-format
78
  msgctxt "{<br />}{<a>}{</a>}"
79
  msgid ""
@@ -84,26 +84,26 @@ msgstr ""
84
  "básica de este complemento. %1$sPara soportar tablas creadas por plugins use"
85
  "%2$sPro Version%3$s."
86
 
87
- #: views/admin-tools-page.php:105 views/admin-tools-page.php:115
88
  msgid "Old URL"
89
  msgstr "URL antigua"
90
 
91
- #: views/admin-tools-page.php:121 views/admin-tools-page.php:131
92
  msgid "New URL"
93
  msgstr "Nueva URL"
94
 
95
- #: views/admin-tools-page.php:138
96
  msgid "Only the checked tables will be updated."
97
  msgstr "Solo las tablas comprobadas serán actualizadas."
98
 
99
- #: views/admin-tools-page.php:149
100
  #, php-format
101
  msgctxt "{<a>}{</a>}"
102
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
103
  msgstr ""
104
  "Para probar este cambio antes de ejecutarlo, use%1$sPro Versión 2.0.0+%2$s."
105
 
106
- #: views/admin-tools-page.php:156
107
  msgid "Update URLs"
108
  msgstr "Actualizar URL"
109
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Go Live Update Urls\n"
4
+ "POT-Creation-Date: 2019-12-11 13:13-0500\n"
5
+ "PO-Revision-Date: 2019-12-11 13:13-0500\n"
6
  "Last-Translator: Mat Lipe <support@onpointplugins.com>\n"
7
  "Language-Team: \n"
8
  "Language: es_ES\n"
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr "¡Ay! ¡Eso duele! ¡No deberías estar aquí!"
26
 
27
+ #: src/Admin_Page.php:63
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr "Las URL en las tablas comprobadas se han actualizado."
30
 
31
+ #: src/Admin_Page.php:85
32
+ msgid "You must fill out both URLs and select tables to update URLs!"
33
+ msgstr "¡Debe completar ambas URL para hacer la actualización !"
34
 
35
+ #: src/Admin_Page.php:147
36
  msgid "Serialized"
37
  msgstr "Serializado"
38
 
41
  msgid "Go Live Update Urls"
42
  msgstr "Go Live Update Urls"
43
 
44
+ #: views/admin-tools-page.php:31
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
51
  "Esto reemplazará todas las ocurrencias%1$ sin toda la base de datos%2$ s de "
52
  "la URL anterior con la Nueva URL."
53
 
54
+ #: views/admin-tools-page.php:37
55
  msgid ""
56
  "Like any other database updating tool, you should always perform a backup "
57
  "before running."
59
  "Al igual que cualquier otra herramienta de actualización de base de datos, "
60
  "siempre debe realizar una copia de seguridad antes de ejecutar."
61
 
62
+ #: views/admin-tools-page.php:56
63
  msgid "WordPress Core Tables"
64
  msgstr "Tablas centrales"
65
 
66
+ #: views/admin-tools-page.php:60
67
  msgid "These tables are safe to update with the basic version of this plugin."
68
  msgstr ""
69
  "Estas tablas son seguras para actualizarse con la versión básica de este "
70
  "complemento."
71
 
72
+ #: views/admin-tools-page.php:82
73
  msgid "Tables Created By Plugins"
74
  msgstr "Tablas creadas por complementos"
75
 
76
+ #: views/admin-tools-page.php:88
77
  #, php-format
78
  msgctxt "{<br />}{<a>}{</a>}"
79
  msgid ""
84
  "básica de este complemento. %1$sPara soportar tablas creadas por plugins use"
85
  "%2$sPro Version%3$s."
86
 
87
+ #: views/admin-tools-page.php:113 views/admin-tools-page.php:123
88
  msgid "Old URL"
89
  msgstr "URL antigua"
90
 
91
+ #: views/admin-tools-page.php:129 views/admin-tools-page.php:139
92
  msgid "New URL"
93
  msgstr "Nueva URL"
94
 
95
+ #: views/admin-tools-page.php:146
96
  msgid "Only the checked tables will be updated."
97
  msgstr "Solo las tablas comprobadas serán actualizadas."
98
 
99
+ #: views/admin-tools-page.php:157
100
  #, php-format
101
  msgctxt "{<a>}{</a>}"
102
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
103
  msgstr ""
104
  "Para probar este cambio antes de ejecutarlo, use%1$sPro Versión 2.0.0+%2$s."
105
 
106
+ #: views/admin-tools-page.php:164
107
  msgid "Update URLs"
108
  msgstr "Actualizar URL"
109
 
languages/go-live-update-urls-fr_FR.mo CHANGED
Binary file
languages/go-live-update-urls-fr_FR.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Go Live Update Urls\n"
4
- "POT-Creation-Date: 2019-10-22 11:05-0400\n"
5
- "PO-Revision-Date: 2019-10-22 11:05-0400\n"
6
  "Last-Translator: Mat Lipe <support@onpointplugins.com>\n"
7
  "Language-Team: \n"
8
  "Language: fr_FR\n"
@@ -24,15 +24,15 @@ msgstr ""
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr "Aie! Ça fait mal! Tu ne devrais pas être ici!"
26
 
27
- #: src/Admin_Page.php:62
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr "Les URL dans les tables vérifiées ont été mises à jour."
30
 
31
- #: src/Admin_Page.php:79
32
- msgid "You must fill out both URLS to make the update!."
33
  msgstr "Vous devez remplir les deux URL pour effectuer la mise à jour!"
34
 
35
- #: src/Admin_Page.php:141
36
  msgid "Serialized"
37
  msgstr "Serial"
38
 
@@ -41,7 +41,7 @@ msgstr "Serial"
41
  msgid "Go Live Update Urls"
42
  msgstr "Go Live Update Urls"
43
 
44
- #: views/admin-tools-page.php:27
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
@@ -51,7 +51,7 @@ msgstr ""
51
  "Cela remplacera toutes les occurrences%1$sin de la base de données entière"
52
  "%2$s de l'ancienne URL avec la nouvelle URL."
53
 
54
- #: views/admin-tools-page.php:33
55
  msgid ""
56
  "Like any other database updating tool, you should always perform a backup "
57
  "before running."
@@ -59,21 +59,21 @@ msgstr ""
59
  "Comme tout autre outil de mise à jour de base de données, vous devez "
60
  "toujours effectuer une sauvegarde avant de l'exécuter."
61
 
62
- #: views/admin-tools-page.php:48
63
  msgid "WordPress Core Tables"
64
  msgstr "Tables de base"
65
 
66
- #: views/admin-tools-page.php:52
67
  msgid "These tables are safe to update with the basic version of this plugin."
68
  msgstr ""
69
  "Ces tables peuvent être mises à jour en toute sécurité avec la version de "
70
  "base de ce plugin."
71
 
72
- #: views/admin-tools-page.php:74
73
  msgid "Tables Created By Plugins"
74
  msgstr "Tables créées par des plugins"
75
 
76
- #: views/admin-tools-page.php:80
77
  #, php-format
78
  msgctxt "{<br />}{<a>}{</a>}"
79
  msgid ""
@@ -84,19 +84,19 @@ msgstr ""
84
  "de base de ce plugin. %1$sPour prendre en charge les tables créées par les "
85
  "plugins, utilisez la version%2$sPro%3$s."
86
 
87
- #: views/admin-tools-page.php:105 views/admin-tools-page.php:115
88
  msgid "Old URL"
89
  msgstr "Ancienne URL"
90
 
91
- #: views/admin-tools-page.php:121 views/admin-tools-page.php:131
92
  msgid "New URL"
93
  msgstr "Nouvelle URL"
94
 
95
- #: views/admin-tools-page.php:138
96
  msgid "Only the checked tables will be updated."
97
  msgstr "Seules les tables vérifiées seront mises à jour."
98
 
99
- #: views/admin-tools-page.php:149
100
  #, php-format
101
  msgctxt "{<a>}{</a>}"
102
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
@@ -104,7 +104,7 @@ msgstr ""
104
  "Pour tester cette modification avant de l'exécuter, utilisez%1$sPro Version "
105
  "2.0.0 +%2$s."
106
 
107
- #: views/admin-tools-page.php:156
108
  msgid "Update URLs"
109
  msgstr "Mettre à jour les URL"
110
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Go Live Update Urls\n"
4
+ "POT-Creation-Date: 2019-12-11 13:14-0500\n"
5
+ "PO-Revision-Date: 2019-12-11 13:14-0500\n"
6
  "Last-Translator: Mat Lipe <support@onpointplugins.com>\n"
7
  "Language-Team: \n"
8
  "Language: fr_FR\n"
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr "Aie! Ça fait mal! Tu ne devrais pas être ici!"
26
 
27
+ #: src/Admin_Page.php:63
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr "Les URL dans les tables vérifiées ont été mises à jour."
30
 
31
+ #: src/Admin_Page.php:85
32
+ msgid "You must fill out both URLs and select tables to update URLs!"
33
  msgstr "Vous devez remplir les deux URL pour effectuer la mise à jour!"
34
 
35
+ #: src/Admin_Page.php:147
36
  msgid "Serialized"
37
  msgstr "Serial"
38
 
41
  msgid "Go Live Update Urls"
42
  msgstr "Go Live Update Urls"
43
 
44
+ #: views/admin-tools-page.php:31
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
51
  "Cela remplacera toutes les occurrences%1$sin de la base de données entière"
52
  "%2$s de l'ancienne URL avec la nouvelle URL."
53
 
54
+ #: views/admin-tools-page.php:37
55
  msgid ""
56
  "Like any other database updating tool, you should always perform a backup "
57
  "before running."
59
  "Comme tout autre outil de mise à jour de base de données, vous devez "
60
  "toujours effectuer une sauvegarde avant de l'exécuter."
61
 
62
+ #: views/admin-tools-page.php:56
63
  msgid "WordPress Core Tables"
64
  msgstr "Tables de base"
65
 
66
+ #: views/admin-tools-page.php:60
67
  msgid "These tables are safe to update with the basic version of this plugin."
68
  msgstr ""
69
  "Ces tables peuvent être mises à jour en toute sécurité avec la version de "
70
  "base de ce plugin."
71
 
72
+ #: views/admin-tools-page.php:82
73
  msgid "Tables Created By Plugins"
74
  msgstr "Tables créées par des plugins"
75
 
76
+ #: views/admin-tools-page.php:88
77
  #, php-format
78
  msgctxt "{<br />}{<a>}{</a>}"
79
  msgid ""
84
  "de base de ce plugin. %1$sPour prendre en charge les tables créées par les "
85
  "plugins, utilisez la version%2$sPro%3$s."
86
 
87
+ #: views/admin-tools-page.php:113 views/admin-tools-page.php:123
88
  msgid "Old URL"
89
  msgstr "Ancienne URL"
90
 
91
+ #: views/admin-tools-page.php:129 views/admin-tools-page.php:139
92
  msgid "New URL"
93
  msgstr "Nouvelle URL"
94
 
95
+ #: views/admin-tools-page.php:146
96
  msgid "Only the checked tables will be updated."
97
  msgstr "Seules les tables vérifiées seront mises à jour."
98
 
99
+ #: views/admin-tools-page.php:157
100
  #, php-format
101
  msgctxt "{<a>}{</a>}"
102
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
104
  "Pour tester cette modification avant de l'exécuter, utilisez%1$sPro Version "
105
  "2.0.0 +%2$s."
106
 
107
+ #: views/admin-tools-page.php:164
108
  msgid "Update URLs"
109
  msgstr "Mettre à jour les URL"
110
 
languages/go-live-update-urls.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Go Live Update URLS\n"
6
- "POT-Creation-Date: 2019-10-22 11:02-0400\n"
7
  "PO-Revision-Date: 2016-05-15 10:47-0400\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
@@ -24,15 +24,15 @@ msgstr ""
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr ""
26
 
27
- #: src/Admin_Page.php:62
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr ""
30
 
31
- #: src/Admin_Page.php:79
32
- msgid "You must fill out both URLS to make the update!."
33
  msgstr ""
34
 
35
- #: src/Admin_Page.php:141
36
  msgid "Serialized"
37
  msgstr ""
38
 
@@ -41,7 +41,7 @@ msgstr ""
41
  msgid "Go Live Update Urls"
42
  msgstr ""
43
 
44
- #: views/admin-tools-page.php:27
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
@@ -49,25 +49,25 @@ msgid ""
49
  "URL with the New URL."
50
  msgstr ""
51
 
52
- #: views/admin-tools-page.php:33
53
  msgid ""
54
  "Like any other database updating tool, you should always perform a backup "
55
  "before running."
56
  msgstr ""
57
 
58
- #: views/admin-tools-page.php:48
59
  msgid "WordPress Core Tables"
60
  msgstr ""
61
 
62
- #: views/admin-tools-page.php:52
63
  msgid "These tables are safe to update with the basic version of this plugin."
64
  msgstr ""
65
 
66
- #: views/admin-tools-page.php:74
67
  msgid "Tables Created By Plugins"
68
  msgstr ""
69
 
70
- #: views/admin-tools-page.php:80
71
  #, php-format
72
  msgctxt "{<br />}{<a>}{</a>}"
73
  msgid ""
@@ -76,25 +76,25 @@ msgid ""
76
  "%3$s."
77
  msgstr ""
78
 
79
- #: views/admin-tools-page.php:105 views/admin-tools-page.php:115
80
  msgid "Old URL"
81
  msgstr ""
82
 
83
- #: views/admin-tools-page.php:121 views/admin-tools-page.php:131
84
  msgid "New URL"
85
  msgstr ""
86
 
87
- #: views/admin-tools-page.php:138
88
  msgid "Only the checked tables will be updated."
89
  msgstr ""
90
 
91
- #: views/admin-tools-page.php:149
92
  #, php-format
93
  msgctxt "{<a>}{</a>}"
94
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
95
  msgstr ""
96
 
97
- #: views/admin-tools-page.php:156
98
  msgid "Update URLs"
99
  msgstr ""
100
 
3
  msgstr ""
4
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
  "Project-Id-Version: Go Live Update URLS\n"
6
+ "POT-Creation-Date: 2019-12-11 13:13-0500\n"
7
  "PO-Revision-Date: 2016-05-15 10:47-0400\n"
8
  "Last-Translator: \n"
9
  "Language-Team: \n"
24
  msgid "Ouch! That hurt! You should not be here!"
25
  msgstr ""
26
 
27
+ #: src/Admin_Page.php:63
28
  msgid "The URLS in the checked tables have been updated."
29
  msgstr ""
30
 
31
+ #: src/Admin_Page.php:85
32
+ msgid "You must fill out both URLs and select tables to update URLs!"
33
  msgstr ""
34
 
35
+ #: src/Admin_Page.php:147
36
  msgid "Serialized"
37
  msgstr ""
38
 
41
  msgid "Go Live Update Urls"
42
  msgstr ""
43
 
44
+ #: views/admin-tools-page.php:31
45
  #, php-format
46
  msgctxt "{<strong>} {</strong>}"
47
  msgid ""
49
  "URL with the New URL."
50
  msgstr ""
51
 
52
+ #: views/admin-tools-page.php:37
53
  msgid ""
54
  "Like any other database updating tool, you should always perform a backup "
55
  "before running."
56
  msgstr ""
57
 
58
+ #: views/admin-tools-page.php:56
59
  msgid "WordPress Core Tables"
60
  msgstr ""
61
 
62
+ #: views/admin-tools-page.php:60
63
  msgid "These tables are safe to update with the basic version of this plugin."
64
  msgstr ""
65
 
66
+ #: views/admin-tools-page.php:82
67
  msgid "Tables Created By Plugins"
68
  msgstr ""
69
 
70
+ #: views/admin-tools-page.php:88
71
  #, php-format
72
  msgctxt "{<br />}{<a>}{</a>}"
73
  msgid ""
76
  "%3$s."
77
  msgstr ""
78
 
79
+ #: views/admin-tools-page.php:113 views/admin-tools-page.php:123
80
  msgid "Old URL"
81
  msgstr ""
82
 
83
+ #: views/admin-tools-page.php:129 views/admin-tools-page.php:139
84
  msgid "New URL"
85
  msgstr ""
86
 
87
+ #: views/admin-tools-page.php:146
88
  msgid "Only the checked tables will be updated."
89
  msgstr ""
90
 
91
+ #: views/admin-tools-page.php:157
92
  #, php-format
93
  msgctxt "{<a>}{</a>}"
94
  msgid "To test this change before running it, use %1$sPro Version 2.0.0+%2$s."
95
  msgstr ""
96
 
97
+ #: views/admin-tools-page.php:164
98
  msgid "Update URLs"
99
  msgstr ""
100
 
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Plugin Name ===
2
  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: 4.8.0
6
- Tested up to: 5.3.0
7
  Requires PHP: 5.6.0
8
- Stable tag: 5.2.12
9
 
10
  == Description ==
11
 
@@ -71,6 +71,12 @@ Manual Installation
71
 
72
  == Frequently Asked Questions ==
73
 
 
 
 
 
 
 
74
  = Where do you use this plugin? =
75
 
76
  Under the Tools menu in the dashboard there will be a "Go Live" link.
@@ -89,6 +95,14 @@ If you wish to try to update tables mentioned as not safe anyway, you may make a
89
  1. Typical settings page. The verbiage will change slightly depending on your database structure
90
 
91
  == Changelog ==
 
 
 
 
 
 
 
 
92
  = 5.2.12 =
93
  * Support for WordPress version 5.3.0
94
  * Officially drop support for PHP 5.4 in favor of 5.6.0
1
+ === Go Live Update Urls ===
2
  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: 4.8.0
6
+ Tested up to: 5.4.1
7
  Requires PHP: 5.6.0
8
+ Stable tag: 5.3.0
9
 
10
  == Description ==
11
 
71
 
72
  == Frequently Asked Questions ==
73
 
74
+ = Not all URLs are updating? =
75
+
76
+ The most common issue when running this plugin is putting a `/` at the end of the domain. For example `http://domain.com/`. Some sites have the domain stored within the database without the trailing `/` and will not update everything in this way.
77
+
78
+ If you are seeing some but not all URLs updating when running the plugin, give it a try without the `/`. For example `http://domain.com`. 
79
+
80
  = Where do you use this plugin? =
81
 
82
  Under the Tools menu in the dashboard there will be a "Go Live" link.
95
  1. Typical settings page. The verbiage will change slightly depending on your database structure
96
 
97
  == Changelog ==
98
+ = 5.3.0 =
99
+ * Display error message when no tables are selected during update.
100
+ * Fix bug when updating columns which are name the same as MySQL commands.
101
+ * Remove confusing '- Serialized' label from checkboxes list.
102
+ * Improve stability to modernize code some code.
103
+ * Introduce `go-live-update-urls/views/admin-tools-page/disable-description` filter.
104
+ * Cleanup some long deprecated code.
105
+
106
  = 5.2.12 =
107
  * Support for WordPress version 5.3.0
108
  * Officially drop support for PHP 5.4 in favor of 5.6.0
src/Admin_Page.php CHANGED
@@ -40,7 +40,7 @@ class Go_Live_Update_Urls_Admin_Page {
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 ) ) {
44
  add_action( 'admin_notices', array( $this, 'epic_fail' ) );
45
  return;
46
  }
@@ -54,6 +54,7 @@ class Go_Live_Update_Urls_Admin_Page {
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
  }
58
  }
59
 
@@ -72,11 +73,16 @@ class Go_Live_Update_Urls_Admin_Page {
72
  }
73
 
74
 
 
 
 
 
 
75
  public function epic_fail() {
76
  ?>
77
  <div id="message" class="error fade">
78
  <p>
79
- <strong><?php esc_html_e( 'You must fill out both URLS to make the update!.', 'go-live-update-urls' ); ?></strong>
80
  </p>
81
  </div>
82
  <?php
@@ -123,10 +129,10 @@ class Go_Live_Update_Urls_Admin_Page {
123
  *
124
  */
125
  public function render_check_boxes( $tables, $list, $checked = true ) {
126
- $serialized_tables = Go_Live_Update_Urls_Database::instance()->get_serialized_tables();
127
  ?>
128
- <ul class="go-live-update-urls/checkboxes go-live-update-urls/checkboxes/<?php echo esc_attr( $list ); ?>"
129
- data-list="<?php echo esc_attr( $list ); ?>">
 
130
  <?php
131
 
132
  foreach ( $tables as $_table ) {
@@ -134,15 +140,6 @@ class Go_Live_Update_Urls_Admin_Page {
134
  <li>
135
  <?php
136
  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 ) );
137
- if ( isset( $serialized_tables[ $_table ] ) ) {
138
- ?>
139
- - <strong>
140
- <em>
141
- <?php esc_html_e( 'Serialized', 'go-live-update-urls' ); ?>
142
- </em>
143
- </strong>
144
- <?php
145
- }
146
  ?>
147
  </li>
148
  <?php
@@ -155,8 +152,7 @@ class Go_Live_Update_Urls_Admin_Page {
155
 
156
  }
157
 
158
- //********** SINGLETON **********/
159
-
160
 
161
  /**
162
  * Instance of this class for use as singleton
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
  }
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
 
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
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 ) {
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
152
 
153
  }
154
 
155
+ /********** SINGLETON **********/
 
156
 
157
  /**
158
  * Instance of this class for use as singleton
src/Database.php CHANGED
@@ -1,19 +1,10 @@
1
  <?php
2
-
3
  /**
4
  * Go_Live_Update_Urls_Database
5
  *
6
  * @author OnPoint Plugins
7
- * @since 2/1/2018
8
  */
9
  class Go_Live_Update_Urls_Database {
10
- protected $old_url = false;
11
-
12
- protected $new_url = false;
13
-
14
- public $double_subdomain = false; // keep track if going to a subdomain
15
-
16
-
17
  /**
18
  * Get list of tables we treat as serialized when updating
19
  *
@@ -24,13 +15,13 @@ class Go_Live_Update_Urls_Database {
24
  public function get_serialized_tables() {
25
  global $wpdb;
26
  // Default tables with serialized data.
27
- $serialized_tables = array(
28
  $wpdb->options => 'option_value',
29
  $wpdb->postmeta => 'meta_value',
30
  $wpdb->commentmeta => 'meta_value',
31
  $wpdb->termmeta => 'meta_value',
32
  $wpdb->usermeta => 'meta_value',
33
- );
34
 
35
  // We are not going to update site meta if we are not on main blog.
36
  if ( is_multisite() ) {
@@ -41,9 +32,7 @@ class Go_Live_Update_Urls_Database {
41
  }
42
  }
43
 
44
- $tables = apply_filters( 'go-live-update-urls-serialized-tables', $serialized_tables );
45
-
46
- return $tables;
47
  }
48
 
49
 
@@ -54,8 +43,8 @@ class Go_Live_Update_Urls_Database {
54
  */
55
  public function get_custom_plugin_tables() {
56
  $core_tables = $this->get_core_tables();
57
- $all_tables = $this->get_all_table_names();
58
- $all_tables = array_flip( $all_tables );
59
  foreach ( $core_tables as $_table ) {
60
  unset( $all_tables[ $_table ] );
61
  }
@@ -74,7 +63,7 @@ class Go_Live_Update_Urls_Database {
74
  public function get_core_tables() {
75
  global $wpdb;
76
 
77
- $tables = array(
78
  $wpdb->posts,
79
  $wpdb->comments,
80
  $wpdb->links,
@@ -87,7 +76,7 @@ class Go_Live_Update_Urls_Database {
87
  $wpdb->commentmeta,
88
  $wpdb->users,
89
  $wpdb->usermeta,
90
- );
91
 
92
  if ( is_multisite() ) {
93
  $tables[] = $wpdb->blogs;
@@ -96,10 +85,9 @@ class Go_Live_Update_Urls_Database {
96
  $tables[] = $wpdb->sitemeta;
97
  $tables[] = $wpdb->sitecategories;
98
  $tables[] = $wpdb->registration_log;
99
- $tables[] = $wpdb->blog_versions;
100
- // WP 5.0.0+
101
  if ( isset( $wpdb->blogmeta ) ) {
102
- $tables[ $wpdb->blogmeta ];
103
  }
104
  }
105
 
@@ -120,122 +108,75 @@ class Go_Live_Update_Urls_Database {
120
  $query = "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='" . $wpdb->dbname . "' AND TABLE_NAME LIKE '" . $wpdb->prefix . "%'";
121
 
122
  // Site 1's 'LIKE wp_%' will return all tables in the database
123
- // so we exclude all possible sub sites e.g. wp_2, wp_3 up to 9
124
  $not_like = null;
125
  if ( 1 === (int) $wpdb->blogid && is_multisite() ) {
126
  for ( $i = 1; $i <= 9; $i ++ ) {
127
  $not_like .= "'" . $wpdb->prefix . $i . "',";
128
  }
129
  $not_like = substr( $not_like, 0, - 1 );
130
- $query .= ' AND SUBSTRING(TABLE_NAME,1,4) NOT IN (' . $not_like . ')';
131
  }
132
  return $wpdb->get_col( $query );
133
  }
134
 
135
 
136
- /**
137
- * @deprecated 5.0.1
138
- * @see Go_Live_Update_Urls_Database::get_all_table_names()
139
- */
140
- public function get_all_tables() {
141
- $names = $this->get_all_table_names();
142
- $tables = array();
143
-
144
- foreach ( $names as $_name ) {
145
- $tables[] = array(
146
- 'TABLE_NAME' => $_name,
147
- );
148
- }
149
-
150
- return $tables;
151
- }
152
-
153
-
154
  /**
155
  * Make the actual changes to the database
156
  *
157
- * @since 5.0.0
158
- *
159
  * @param string $old_url - the old URL.
160
  * @param string $new_url - the new URL.
161
- * @param array $tables - the tables we are going to update.
162
  *
163
  * @todo split this functionality into its own OOP class
164
  *
 
 
165
  * @return bool
166
  */
167
  public function update_the_database( $old_url, $new_url, array $tables ) {
168
  global $wpdb;
169
- $this->old_url = $old_url;
170
- $this->new_url = $new_url;
171
-
172
  do_action( 'go-live-update-urls/database/before-update', $old_url, $new_url, $tables, $this );
173
-
174
  $updaters = (array) Go_Live_Update_Urls__Updaters__Repo::instance()->get_updaters();
175
 
176
  // If the new domain is the old one with a new sub-domain like www.
177
- if ( strpos( $this->new_url, $this->old_url ) !== false ) {
178
- list( $subdomain ) = explode( '.', $this->new_url );
179
- $this->double_subdomain = $subdomain . '.' . $this->new_url;
180
  }
181
 
182
- $tables = apply_filters( 'go-live-update-urls/database/update-tables', $tables, $this );
183
-
184
- // Backward compatibility.
185
- if ( array_values( $tables ) !== $tables ) {
186
- $tables = (array) array_flip( $tables );
187
- }
188
-
189
- $serialized = new Go_Live_Update_Urls_Serialized( $this->old_url, $this->new_url );
190
  $serialized->update_all_serialized_tables( $tables );
191
- if ( $this->double_subdomain ) {
192
- $serialized = new Go_Live_Update_Urls_Serialized( $this->double_subdomain, $this->new_url );
193
  $serialized->update_all_serialized_tables( $tables );
194
  }
195
 
196
- // Go through each table sent to be updated.
197
- foreach ( (array) $tables as $table ) {
198
- $column_query = "SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='{$wpdb->dbname}' AND TABLE_NAME=%s";
199
- $columns = $wpdb->get_col( $wpdb->prepare( $column_query, $table ) );
200
 
 
 
201
  foreach ( $columns as $_column ) {
202
- $update_query = 'UPDATE ' . $table . ' SET `' . $_column . '` = replace(`' . $_column . '`, %s, %s)';
203
- $wpdb->query( $wpdb->prepare( $update_query, array( $this->old_url, $this->new_url ) ) );
204
 
205
- // Run each updater.
206
  foreach ( $updaters as $_updater_class ) {
207
  if ( class_exists( $_updater_class ) ) {
208
- /** @var Go_Live_Update_Urls__Updaters__Abstract $_updater */
209
- $_updater = new $_updater_class( $table, $_column, $this->old_url, $this->new_url );
210
  $_updater->update_data();
211
- if ( ! empty( $this->double_subdomain ) ) {
212
- $_updater = new $_updater_class( $table, $_column, $this->double_subdomain, $this->new_url );
213
  $_updater->update_data();
214
  }
215
  }
216
  }
217
 
218
- // Fix the dub dubs if this was the old domain with a new sub
219
- if ( $this->double_subdomain ) {
220
- $wpdb->query(
221
- $wpdb->prepare(
222
- $update_query,
223
- array(
224
- $this->double_subdomain,
225
- $this->new_url,
226
- )
227
- )
228
- );
229
- // Fix the emails breaking by being appended the new subdomain
230
- $wpdb->query(
231
- $wpdb->prepare(
232
- $update_query,
233
- array(
234
- '@' . $this->new_url,
235
- '@' . $this->old_url,
236
- )
237
- )
238
- );
239
  }
240
  }
241
  }
@@ -248,13 +189,27 @@ class Go_Live_Update_Urls_Database {
248
  }
249
 
250
 
251
- protected function hook() {
 
 
 
 
 
 
 
 
 
 
 
 
 
252
 
 
 
253
  }
254
 
255
  // ********** SINGLETON **********/
256
 
257
-
258
  /**
259
  * Instance of this class for use as singleton
260
  *
@@ -262,18 +217,6 @@ class Go_Live_Update_Urls_Database {
262
  */
263
  protected static $instance;
264
 
265
-
266
- /**
267
- * Create the instance of the class
268
- *
269
- * @static
270
- * @return void
271
- */
272
- public static function init() {
273
- self::instance()->hook();
274
- }
275
-
276
-
277
  /**
278
  * Get (and instantiate, if necessary) the instance of the
279
  * class
1
  <?php
 
2
  /**
3
  * Go_Live_Update_Urls_Database
4
  *
5
  * @author OnPoint Plugins
 
6
  */
7
  class Go_Live_Update_Urls_Database {
 
 
 
 
 
 
 
8
  /**
9
  * Get list of tables we treat as serialized when updating
10
  *
15
  public function get_serialized_tables() {
16
  global $wpdb;
17
  // Default tables with serialized data.
18
+ $serialized_tables = [
19
  $wpdb->options => 'option_value',
20
  $wpdb->postmeta => 'meta_value',
21
  $wpdb->commentmeta => 'meta_value',
22
  $wpdb->termmeta => 'meta_value',
23
  $wpdb->usermeta => 'meta_value',
24
+ ];
25
 
26
  // We are not going to update site meta if we are not on main blog.
27
  if ( is_multisite() ) {
32
  }
33
  }
34
 
35
+ return apply_filters( 'go-live-update-urls-serialized-tables', $serialized_tables );
 
 
36
  }
37
 
38
 
43
  */
44
  public function get_custom_plugin_tables() {
45
  $core_tables = $this->get_core_tables();
46
+ $all_tables = $this->get_all_table_names();
47
+ $all_tables = array_flip( $all_tables );
48
  foreach ( $core_tables as $_table ) {
49
  unset( $all_tables[ $_table ] );
50
  }
63
  public function get_core_tables() {
64
  global $wpdb;
65
 
66
+ $tables = [
67
  $wpdb->posts,
68
  $wpdb->comments,
69
  $wpdb->links,
76
  $wpdb->commentmeta,
77
  $wpdb->users,
78
  $wpdb->usermeta,
79
+ ];
80
 
81
  if ( is_multisite() ) {
82
  $tables[] = $wpdb->blogs;
85
  $tables[] = $wpdb->sitemeta;
86
  $tables[] = $wpdb->sitecategories;
87
  $tables[] = $wpdb->registration_log;
88
+ // WP 5.0.0+.
 
89
  if ( isset( $wpdb->blogmeta ) ) {
90
+ $tables[] = $wpdb->blogmeta;
91
  }
92
  }
93
 
108
  $query = "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA='" . $wpdb->dbname . "' AND TABLE_NAME LIKE '" . $wpdb->prefix . "%'";
109
 
110
  // Site 1's 'LIKE wp_%' will return all tables in the database
111
+ // so we exclude all possible sub sites e.g. wp_2, wp_3 up to 9.
112
  $not_like = null;
113
  if ( 1 === (int) $wpdb->blogid && is_multisite() ) {
114
  for ( $i = 1; $i <= 9; $i ++ ) {
115
  $not_like .= "'" . $wpdb->prefix . $i . "',";
116
  }
117
  $not_like = substr( $not_like, 0, - 1 );
118
+ $query .= ' AND SUBSTRING(TABLE_NAME,1,4) NOT IN (' . $not_like . ')';
119
  }
120
  return $wpdb->get_col( $query );
121
  }
122
 
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  /**
125
  * Make the actual changes to the database
126
  *
 
 
127
  * @param string $old_url - the old URL.
128
  * @param string $new_url - the new URL.
129
+ * @param array $tables - the tables we are going to update.
130
  *
131
  * @todo split this functionality into its own OOP class
132
  *
133
+ * @since 5.0.0
134
+ *
135
  * @return bool
136
  */
137
  public function update_the_database( $old_url, $new_url, array $tables ) {
138
  global $wpdb;
 
 
 
139
  do_action( 'go-live-update-urls/database/before-update', $old_url, $new_url, $tables, $this );
140
+ $tables = apply_filters( 'go-live-update-urls/database/update-tables', $tables, $this );
141
  $updaters = (array) Go_Live_Update_Urls__Updaters__Repo::instance()->get_updaters();
142
 
143
  // If the new domain is the old one with a new sub-domain like www.
144
+ if ( strpos( $new_url, $old_url ) !== false ) {
145
+ list( $subdomain ) = explode( '.', $new_url );
146
+ $double_subdomain = $subdomain . '.' . $new_url;
147
  }
148
 
149
+ $serialized = new Go_Live_Update_Urls_Serialized( $old_url, $new_url );
 
 
 
 
 
 
 
150
  $serialized->update_all_serialized_tables( $tables );
151
+ if ( ! empty( $double_subdomain ) ) {
152
+ $serialized = new Go_Live_Update_Urls_Serialized( $double_subdomain, $new_url );
153
  $serialized->update_all_serialized_tables( $tables );
154
  }
155
 
156
+ $get_columns_query = "SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='{$wpdb->dbname}' AND TABLE_NAME=%s";
 
 
 
157
 
158
+ foreach ( (array) $tables as $table ) {
159
+ $columns = $wpdb->get_col( $wpdb->prepare( $get_columns_query, $table ) );
160
  foreach ( $columns as $_column ) {
161
+ $this->update_column( $table, $_column, $old_url, $new_url);
 
162
 
 
163
  foreach ( $updaters as $_updater_class ) {
164
  if ( class_exists( $_updater_class ) ) {
165
+ /* @var Go_Live_Update_Urls__Updaters__Abstract $_updater - Individual updater class */
166
+ $_updater = $_updater_class::factory( $table, $_column, $old_url, $new_url );
167
  $_updater->update_data();
168
+ if ( ! empty( $double_subdomain ) ) {
169
+ $_updater = new $_updater_class( $table, $_column, $double_subdomain, $new_url );
170
  $_updater->update_data();
171
  }
172
  }
173
  }
174
 
175
+ // Fix the dub dubs if this was the old domain with a new sub.
176
+ if ( ! empty( $double_subdomain ) ) {
177
+ $this->update_column( $table, $_column, $double_subdomain, $new_url);
178
+ // Fix the emails breaking by being appended the new subdomain.
179
+ $this->update_column( $table, $_column, '@' . $new_url, '@' . $old_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
  }
182
  }
189
  }
190
 
191
 
192
+ /**
193
+ * Update an individual table's column.
194
+ *
195
+ * @param string $table Table to update.
196
+ * @param string $column Column to update.
197
+ * @param string $old_url Old URL.
198
+ * @param string $new_url New URL.
199
+ *
200
+ * @since 5.3.0
201
+ *
202
+ * @return void
203
+ */
204
+ public function update_column( $table, $column, $old_url, $new_url ) {
205
+ global $wpdb;
206
 
207
+ $update_query = 'UPDATE ' . $table . ' SET `' . $column . '` = replace(`' . $column . '`, %s, %s)';
208
+ $wpdb->query( $wpdb->prepare( $update_query, [ $old_url, $new_url ] ) );
209
  }
210
 
211
  // ********** SINGLETON **********/
212
 
 
213
  /**
214
  * Instance of this class for use as singleton
215
  *
217
  */
218
  protected static $instance;
219
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  /**
221
  * Get (and instantiate, if necessary) the instance of the
222
  * class
src/Updaters/Abstract.php CHANGED
@@ -1,39 +1,102 @@
1
  <?php
2
 
3
  /**
4
- * _Updater
5
  *
6
  * @author OnPoint Plugins
7
  * @since 5.0.0
8
- *
9
  */
10
  abstract class Go_Live_Update_Urls__Updaters__Abstract {
 
 
 
 
 
11
  protected $table;
12
 
 
 
 
 
 
13
  protected $column;
14
 
 
 
 
 
 
15
  protected $old;
16
 
 
 
 
 
 
17
  protected $new;
18
 
19
 
20
- public function __construct( $table, $column, $old, $new ) {
21
- $this->table = $table;
 
 
 
 
 
 
 
 
22
  $this->column = $column;
23
- $this->old = $old;
24
- $this->new = $new;
25
  }
26
 
27
 
28
- protected function update_column( $old, $new ) {
29
- global $wpdb;
30
-
31
- $update_query = 'UPDATE ' . $this->table . ' SET ' . $this->column . ' = replace(' . $this->column . ', %s, %s)';
32
- $wpdb->query( $wpdb->prepare( $update_query, array( $old, $new ) ) );
 
 
 
 
 
33
  }
34
 
35
 
 
 
 
 
 
 
 
36
  abstract public function apply_rule_to_url( $url );
37
 
 
 
 
 
 
 
 
38
  abstract public function update_data();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
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/Repo.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  /**
4
- * Register
5
  *
6
  * @author OnPoint Plugins
7
  * @since 5.0.0
@@ -15,14 +15,14 @@ class Go_Live_Update_Urls__Updaters__Repo {
15
  *
16
  * @filter go_live_update_urls_updaters
17
  *
18
- * @return array
19
  */
20
  public function get_updaters() {
21
  $updaters['json'] = 'Go_Live_Update_Urls__Updaters__JSON';
22
  $updaters['url-encoded'] = 'Go_Live_Update_Urls__Updaters__Url_Encoded';
23
  $updaters = apply_filters( 'go_live_update_urls_updaters', $updaters );
24
  if ( ! is_array( $updaters ) ) {
25
- return array();
26
  }
27
 
28
  return $updaters;
@@ -30,8 +30,7 @@ class Go_Live_Update_Urls__Updaters__Repo {
30
 
31
 
32
 
33
- //********** SINGLETON **********/
34
-
35
 
36
  /**
37
  * Instance of this class for use as singleton
1
  <?php
2
 
3
  /**
4
+ * Repository for the Updater classes.
5
  *
6
  * @author OnPoint Plugins
7
  * @since 5.0.0
15
  *
16
  * @filter go_live_update_urls_updaters
17
  *
18
+ * @return Go_Live_Update_Urls__Updaters__Abstract[]
19
  */
20
  public function get_updaters() {
21
  $updaters['json'] = 'Go_Live_Update_Urls__Updaters__JSON';
22
  $updaters['url-encoded'] = 'Go_Live_Update_Urls__Updaters__Url_Encoded';
23
  $updaters = apply_filters( 'go_live_update_urls_updaters', $updaters );
24
  if ( ! is_array( $updaters ) ) {
25
+ return [];
26
  }
27
 
28
  return $updaters;
30
 
31
 
32
 
33
+ /********** SINGLETON **********/
 
34
 
35
  /**
36
  * Instance of this class for use as singleton
views/admin-tools-page.php CHANGED
@@ -13,7 +13,6 @@
13
  */
14
 
15
  $db = Go_Live_Update_Urls_Database::instance();
16
- $admin = Go_Live_Update_Urls_Admin_Page::instance();
17
 
18
  ?>
19
  <div id="go-live-update-urls/admin-page" class="wrap">
@@ -21,20 +20,28 @@ $admin = Go_Live_Update_Urls_Admin_Page::instance();
21
  <?php esc_html_e( 'Go Live Update Urls', 'go-live-update-urls' ); ?>
22
  </h2>
23
 
24
- <p class="description">
25
- <?php
26
- /* translators: <strong></strong> */
27
- 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>' );
28
  ?>
29
- </p>
30
 
31
- <strong>
32
- <em style="color:red">
33
- <?php esc_html_e( 'Like any other database updating tool, you should always perform a backup before running.', 'go-live-update-urls' ); ?>
34
- </em>
35
- </strong>
36
- <br/><br/>
37
- <hr/>
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  <form method="post" id="go-live-update-urls/checkbox-form">
40
  <?php
@@ -63,7 +70,7 @@ $admin = Go_Live_Update_Urls_Admin_Page::instance();
63
  <hr/>
64
  </p>
65
  <?php
66
- $admin->render_check_boxes( $db->get_core_tables(), 'wp-core' );
67
 
68
  $custom_tables = $db->get_custom_plugin_tables();
69
  if ( ! empty( $custom_tables ) ) {
@@ -90,7 +97,7 @@ $admin = Go_Live_Update_Urls_Admin_Page::instance();
90
  <hr/>
91
  </p>
92
  <?php
93
- $admin->render_check_boxes( $custom_tables, 'custom-plugins', false );
94
  }
95
  }
96
 
13
  */
14
 
15
  $db = Go_Live_Update_Urls_Database::instance();
 
16
 
17
  ?>
18
  <div id="go-live-update-urls/admin-page" class="wrap">
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
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 ) ) {
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