Velvet Blues Update URLs - Version 3.0

Version Description

  • Confirmed compatibility with latest WordPress releases and added support for future versions.
  • Redesigned interface.
  • Added the ability to update links in custom fields.
  • Improved security against potential cross-site attacks by adding nonces and a referrer check and added exit to script if accessed directly.
  • New error messages and field validation.
  • Made changing ALL GUIDs optional, and turned off by default.
  • Internationalized plugin.
  • Updated License to GPLv2 or later.
  • Fixed Typos
Download this release

Release Info

Developer VelvetBlues.com
Plugin Icon wp plugin Velvet Blues Update URLs
Version 3.0
Comparing to
See all releases

Code changes from version 2.1 to 3.0

languages/velvet-blues-update-urls-en_US.mo ADDED
Binary file
languages/velvet-blues-update-urls-en_US.po ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2011 Velvet Blues Update URLs
2
+ # This file is distributed under the same license as the Velvet Blues Update URLs package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Velvet Blues Update URLs 3.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/velvet-blues-update-urls\n"
7
+ "POT-Creation-Date: 2011-09-25 15:05:25+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2011-09-25 10:16-0600\n"
12
+ "Last-Translator: Velvet Blues <info@velvetblues.com>\n"
13
+ "Language-Team: Velvet Blues <info@velvetblues.com>\n"
14
+ "X-Poedit-Language: English\n"
15
+ "X-Poedit-Country: UNITED STATES\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+
18
+ #: velvet-blues-update-urls.php:50
19
+ msgid "Content Items (Posts, Pages, Custom Post Types, Revisions)"
20
+ msgstr "Content Items (Posts, Pages, Custom Post Types, Revisions)"
21
+
22
+ #: velvet-blues-update-urls.php:51
23
+ msgid "Excerpts"
24
+ msgstr "Excerpts"
25
+
26
+ #: velvet-blues-update-urls.php:52
27
+ msgid "Attachments"
28
+ msgstr "Attachments"
29
+
30
+ #: velvet-blues-update-urls.php:53
31
+ msgid "Custom Fields"
32
+ msgstr "Custom Fields"
33
+
34
+ #: velvet-blues-update-urls.php:54
35
+ msgid "GUIDs"
36
+ msgstr "GUIDs"
37
+
38
+ #: velvet-blues-update-urls.php:72
39
+ #: velvet-blues-update-urls.php:84
40
+ #: velvet-blues-update-urls.php:115
41
+ msgid "ERROR"
42
+ msgstr "ERROR"
43
+
44
+ #: velvet-blues-update-urls.php:72
45
+ msgid "Please try again."
46
+ msgstr "Please try again."
47
+
48
+ #: velvet-blues-update-urls.php:84
49
+ #: velvet-blues-update-urls.php:115
50
+ msgid "Your URLs have not been updated."
51
+ msgstr "Your URLs have not been updated."
52
+
53
+ #: velvet-blues-update-urls.php:84
54
+ msgid "Please select at least one checkbox."
55
+ msgstr "Please select at least one checkbox."
56
+
57
+ #: velvet-blues-update-urls.php:100
58
+ msgid "Why do the results show 0 URLs updated?"
59
+ msgstr "Why do the results show 0 URLs updated?"
60
+
61
+ #: velvet-blues-update-urls.php:100
62
+ msgid "This happens if a URL is incorrect or if it is not found in the content."
63
+ msgstr "This happens if a URL is incorrect or if it is not found in the content."
64
+
65
+ #: velvet-blues-update-urls.php:107
66
+ msgid "Success! Your URLs have been updated."
67
+ msgstr "Success! Your URLs have been updated."
68
+
69
+ #: velvet-blues-update-urls.php:108
70
+ msgid "Results"
71
+ msgstr "Results"
72
+
73
+ #: velvet-blues-update-urls.php:111
74
+ msgid "If you found our plugin useful, %s please consider donating"
75
+ msgstr "If you found our plugin useful, %s please consider donating"
76
+
77
+ #: velvet-blues-update-urls.php:111
78
+ msgid "The safer, easier way to pay online!"
79
+ msgstr "The safer, easier way to pay online!"
80
+
81
+ #: velvet-blues-update-urls.php:115
82
+ msgid "Please enter values for both the old url and the new url."
83
+ msgstr "Please enter values for both the old url and the new url."
84
+
85
+ #: velvet-blues-update-urls.php:123
86
+ msgid "After moving a website, %s lets you fix old URLs in content, excerpts, and custom fields."
87
+ msgstr "After moving a website, %s lets you fix old URLs in content, excerpts, and custom fields."
88
+
89
+ #: velvet-blues-update-urls.php:124
90
+ #: velvet-blues-update-urls.php:134
91
+ msgid "Step"
92
+ msgstr "Step"
93
+
94
+ #: velvet-blues-update-urls.php:124
95
+ msgid "Enter your URLs in the fields below"
96
+ msgstr "Enter your URLs in the fields below"
97
+
98
+ #: velvet-blues-update-urls.php:126
99
+ msgid "Old URL"
100
+ msgstr "Old URL"
101
+
102
+ #: velvet-blues-update-urls.php:126
103
+ msgid "Old Site Address"
104
+ msgstr "Old Site Address"
105
+
106
+ #: velvet-blues-update-urls.php:130
107
+ msgid "New URL"
108
+ msgstr "New URL"
109
+
110
+ #: velvet-blues-update-urls.php:130
111
+ msgid "New Site Address"
112
+ msgstr "New Site Address"
113
+
114
+ #: velvet-blues-update-urls.php:134
115
+ msgid "Choose which URLs should be updated"
116
+ msgstr "Choose which URLs should be updated"
117
+
118
+ #: velvet-blues-update-urls.php:136
119
+ msgid "URLs in page content"
120
+ msgstr "URLs in page content"
121
+
122
+ #: velvet-blues-update-urls.php:136
123
+ msgid "posts, pages, custom post types, revisions"
124
+ msgstr "posts, pages, custom post types, revisions"
125
+
126
+ #: velvet-blues-update-urls.php:137
127
+ msgid "URLs in excerpts"
128
+ msgstr "URLs in excerpts"
129
+
130
+ #: velvet-blues-update-urls.php:138
131
+ msgid "URLs for attachments"
132
+ msgstr "URLs for attachments"
133
+
134
+ #: velvet-blues-update-urls.php:138
135
+ msgid "images, documents, general media"
136
+ msgstr "images, documents, general media"
137
+
138
+ #: velvet-blues-update-urls.php:139
139
+ msgid "URLs in custom fields and meta boxes"
140
+ msgstr "URLs in custom fields and meta boxes"
141
+
142
+ #: velvet-blues-update-urls.php:140
143
+ msgid "Update ALL GUIDs"
144
+ msgstr "Update ALL GUIDs"
145
+
146
+ #: velvet-blues-update-urls.php:140
147
+ msgid "GUIDs for posts should only be changed on development sites."
148
+ msgstr "GUIDs for posts should only be changed on development sites."
149
+
150
+ #: velvet-blues-update-urls.php:140
151
+ msgid "Learn More."
152
+ msgstr "Learn More."
153
+
154
+ #: velvet-blues-update-urls.php:142
155
+ msgid "Update URLs NOW"
156
+ msgstr "Update URLs NOW"
157
+
158
+ #: velvet-blues-update-urls.php:144
159
+ msgid "Need help? Get support at the %s plugin page%s."
160
+ msgstr "Need help? Get support at the %s plugin page%s."
161
+
162
+ #: velvet-blues-update-urls.php:144
163
+ msgid "Want to donate?"
164
+ msgstr "Want to donate?"
165
+
166
+ #: velvet-blues-update-urls.php:144
167
+ msgid "Click here."
168
+ msgstr "Click here."
169
+
170
+ #. Plugin Name of the plugin/theme
171
+ msgid "Velvet Blues Update URLs"
172
+ msgstr "Velvet Blues Update URLs"
173
+
174
+ #. Plugin URI of the plugin/theme
175
+ msgid "http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/"
176
+ msgstr "http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/"
177
+
178
+ #. Description of the plugin/theme
179
+ msgid "This plugin <strong>updates all urls in your website</strong> by replacing old urls with new urls. To get started: 1) Click the \"Activate\" link to the left of this description, and 2) Go to your <a href=\"options-general.php?page=velvet-blues-update-urls.php\">Update URLs</a> page to use it."
180
+ msgstr "This plugin <strong>updates all urls in your website</strong> by replacing old urls with new urls. To get started: 1) Click the \"Activate\" link to the left of this description, and 2) Go to your <a href=\"options-general.php?page=velvet-blues-update-urls.php\">Update URLs</a> page to use it."
181
+
182
+ #. Author of the plugin/theme
183
+ msgid "VelvetBlues.com"
184
+ msgstr "VelvetBlues.com"
185
+
186
+ #. Author URI of the plugin/theme
187
+ msgid "http://www.velvetblues.com/"
188
+ msgstr "http://www.velvetblues.com/"
189
+
languages/velvet-blues-update-urls.pot ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2011 Velvet Blues Update URLs
2
+ # This file is distributed under the same license as the Velvet Blues Update URLs package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Velvet Blues Update URLs 3.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/velvet-blues-update-urls\n"
7
+ "POT-Creation-Date: 2011-09-25 15:05:25+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2011-09-25 10:15-0600\n"
12
+ "Last-Translator: Velvet Blues <info@velvetblues.com>\n"
13
+ "Language-Team: Velvet Blues <info@velvetblues.com>\n"
14
+ "X-Poedit-Language: English\n"
15
+ "X-Poedit-Country: UNITED STATES\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+
18
+ #: velvet-blues-update-urls.php:50
19
+ msgid "Content Items (Posts, Pages, Custom Post Types, Revisions)"
20
+ msgstr ""
21
+
22
+ #: velvet-blues-update-urls.php:51
23
+ msgid "Excerpts"
24
+ msgstr ""
25
+
26
+ #: velvet-blues-update-urls.php:52
27
+ msgid "Attachments"
28
+ msgstr ""
29
+
30
+ #: velvet-blues-update-urls.php:53
31
+ msgid "Custom Fields"
32
+ msgstr ""
33
+
34
+ #: velvet-blues-update-urls.php:54
35
+ msgid "GUIDs"
36
+ msgstr ""
37
+
38
+ #: velvet-blues-update-urls.php:72
39
+ #: velvet-blues-update-urls.php:84
40
+ #: velvet-blues-update-urls.php:115
41
+ msgid "ERROR"
42
+ msgstr ""
43
+
44
+ #: velvet-blues-update-urls.php:72
45
+ msgid "Please try again."
46
+ msgstr ""
47
+
48
+ #: velvet-blues-update-urls.php:84
49
+ #: velvet-blues-update-urls.php:115
50
+ msgid "Your URLs have not been updated."
51
+ msgstr ""
52
+
53
+ #: velvet-blues-update-urls.php:84
54
+ msgid "Please select at least one checkbox."
55
+ msgstr ""
56
+
57
+ #: velvet-blues-update-urls.php:100
58
+ msgid "Why do the results show 0 URLs updated?"
59
+ msgstr ""
60
+
61
+ #: velvet-blues-update-urls.php:100
62
+ msgid "This happens if a URL is incorrect or if it is not found in the content."
63
+ msgstr ""
64
+
65
+ #: velvet-blues-update-urls.php:107
66
+ msgid "Success! Your URLs have been updated."
67
+ msgstr ""
68
+
69
+ #: velvet-blues-update-urls.php:108
70
+ msgid "Results"
71
+ msgstr ""
72
+
73
+ #: velvet-blues-update-urls.php:111
74
+ msgid "If you found our plugin useful, %s please consider donating"
75
+ msgstr ""
76
+
77
+ #: velvet-blues-update-urls.php:111
78
+ msgid "The safer, easier way to pay online!"
79
+ msgstr ""
80
+
81
+ #: velvet-blues-update-urls.php:115
82
+ msgid "Please enter values for both the old url and the new url."
83
+ msgstr ""
84
+
85
+ #: velvet-blues-update-urls.php:123
86
+ msgid "After moving a website, %s lets you fix old URLs in content, excerpts, and custom fields."
87
+ msgstr ""
88
+
89
+ #: velvet-blues-update-urls.php:124
90
+ #: velvet-blues-update-urls.php:134
91
+ msgid "Step"
92
+ msgstr ""
93
+
94
+ #: velvet-blues-update-urls.php:124
95
+ msgid "Enter your URLs in the fields below"
96
+ msgstr ""
97
+
98
+ #: velvet-blues-update-urls.php:126
99
+ msgid "Old URL"
100
+ msgstr ""
101
+
102
+ #: velvet-blues-update-urls.php:126
103
+ msgid "Old Site Address"
104
+ msgstr ""
105
+
106
+ #: velvet-blues-update-urls.php:130
107
+ msgid "New URL"
108
+ msgstr ""
109
+
110
+ #: velvet-blues-update-urls.php:130
111
+ msgid "New Site Address"
112
+ msgstr ""
113
+
114
+ #: velvet-blues-update-urls.php:134
115
+ msgid "Choose which URLs should be updated"
116
+ msgstr ""
117
+
118
+ #: velvet-blues-update-urls.php:136
119
+ msgid "URLs in page content"
120
+ msgstr ""
121
+
122
+ #: velvet-blues-update-urls.php:136
123
+ msgid "posts, pages, custom post types, revisions"
124
+ msgstr ""
125
+
126
+ #: velvet-blues-update-urls.php:137
127
+ msgid "URLs in excerpts"
128
+ msgstr ""
129
+
130
+ #: velvet-blues-update-urls.php:138
131
+ msgid "URLs for attachments"
132
+ msgstr ""
133
+
134
+ #: velvet-blues-update-urls.php:138
135
+ msgid "images, documents, general media"
136
+ msgstr ""
137
+
138
+ #: velvet-blues-update-urls.php:139
139
+ msgid "URLs in custom fields and meta boxes"
140
+ msgstr ""
141
+
142
+ #: velvet-blues-update-urls.php:140
143
+ msgid "Update ALL GUIDs"
144
+ msgstr ""
145
+
146
+ #: velvet-blues-update-urls.php:140
147
+ msgid "GUIDs for posts should only be changed on development sites."
148
+ msgstr ""
149
+
150
+ #: velvet-blues-update-urls.php:140
151
+ msgid "Learn More."
152
+ msgstr ""
153
+
154
+ #: velvet-blues-update-urls.php:142
155
+ msgid "Update URLs NOW"
156
+ msgstr ""
157
+
158
+ #: velvet-blues-update-urls.php:144
159
+ msgid "Need help? Get support at the %s plugin page%s."
160
+ msgstr ""
161
+
162
+ #: velvet-blues-update-urls.php:144
163
+ msgid "Want to donate?"
164
+ msgstr ""
165
+
166
+ #: velvet-blues-update-urls.php:144
167
+ msgid "Click here."
168
+ msgstr ""
169
+
170
+ #. Plugin Name of the plugin/theme
171
+ msgid "Velvet Blues Update URLs"
172
+ msgstr ""
173
+
174
+ #. Plugin URI of the plugin/theme
175
+ msgid "http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/"
176
+ msgstr ""
177
+
178
+ #. Description of the plugin/theme
179
+ msgid "This plugin <strong>updates all urls in your website</strong> by replacing old urls with new urls. To get started: 1) Click the \"Activate\" link to the left of this description, and 2) Go to your <a href=\"options-general.php?page=velvet-blues-update-urls.php\">Update URLs</a> page to use it."
180
+ msgstr ""
181
+
182
+ #. Author of the plugin/theme
183
+ msgid "VelvetBlues.com"
184
+ msgstr ""
185
+
186
+ #. Author URI of the plugin/theme
187
+ msgid "http://www.velvetblues.com/"
188
+ msgstr ""
189
+
readme.txt CHANGED
@@ -1,67 +1,99 @@
1
  === Velvet Blues Update URLs ===
2
  Contributors: VelvetBlues.com
3
- Donate link: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/
4
- Tags: permalinks, urls, links, update links, move wordpress, location, update urls, update permalinks, move, link, url, permalink, excerpt, content links
5
  Requires at least: 2.5
6
- Tested up to: 3.1.1
7
- Stable tag: 2.0.1
 
8
 
9
  Updates all urls and content links in your website.
10
 
11
  == Description ==
12
 
13
- If you move your WordPress website to a new domain name, you will find that internal links to pages and references to images are not updated. Instead, these links and references will point to your old domain name. This plugin fixes that problem. This Update URLs plugin updates all urls and content links in your website.
14
 
15
- Features:
 
 
 
 
 
16
 
17
- * Choose to update permalinks
18
- * Choose whether links embedded in content and excerpts should be updated
19
 
20
  == Installation ==
21
 
22
- The installation is extremely simple and straightforward. It only takes a second.
23
 
24
- Installing:
25
 
26
  1. Download the package.
27
-
28
  2. Extract it to the "plugins" folder of your WordPress directory.
 
 
29
 
30
- 3. In the Admin Panes, go to "Plugins" and activate it.
31
 
32
- 4. Go to Settings -> Update URLs to use it.
 
33
 
 
34
 
35
- Uninstalling:
36
 
37
- 1. In the Admin Panes, go to "Plugins" and deactivate the plugin.
38
 
39
- 2. Go to the "plugins" folder of your WordPress directory and delete the files/folder for this plugin.
40
 
41
 
42
  == Frequently Asked Questions ==
43
 
44
  = Where can I get support for the plugin? =
45
 
46
- Get support for this plugin by going to [Velvet Blues Web Development Blog](http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/). Post all questions as comments.
47
 
48
  = Why are my urls not updated? =
49
 
50
  URLs are only replaced when an exact match is found. Be sure that you have entered the correct url and hit submit. (Note: Matching is case-sensitive.)
51
 
52
- == Usage ==
 
 
53
 
54
- Using this plugin is very simple. Once it has been activated, navigate to Settings -> Update and follow the instructions. You will need to enter your old and new urls. Upon submitting, all permalinks and links will be updated.
 
 
55
 
56
 
57
  == Screenshots ==
58
 
59
  1. The Admin screen for the plugin. screenshot-1.png
60
 
61
- == Update Log ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
- * 1.0.1 - Fixed possible interactions with other plugins.
64
- * 1.0.2 - Fixed PHP short tag problem, so as to be compatible with all configurations.
65
- * 1.0.3 - Confirmed compatibility with recent WordPress releases.
66
- * 2.0 - Added the ability to update links in excerpt fields. Updated code for full compatibility with WordPress 3.0 releases.
67
- * 2.0.1 - Confirmed compatibility with WordPress 3.1.x releases. Updated FAQs and Contributors.
1
  === Velvet Blues Update URLs ===
2
  Contributors: VelvetBlues.com
3
+ Donate link: http://www.velvetblues.com/go/updateurlsdonate/
4
+ Tags: permalinks, urls, links, update links, move wordpress, location, update urls, update permalinks, move, link, url, permalink, excerpt, content links, excerpt links, custom field links
5
  Requires at least: 2.5
6
+ Tested up to: 3.4
7
+ Stable tag: 3.0
8
+ License: GPLv2 or later
9
 
10
  Updates all urls and content links in your website.
11
 
12
  == Description ==
13
 
14
+ If you move your WordPress website to a new domain name, you will find that internal links to pages and references to images are not updated. Instead, these links and references will point to your old domain name. This plugin fixes that problem by helping you change old urls and links in your website.
15
 
16
+ = Features: =
17
+ * Users can choose to update links embedded in content, excerpts, or custom fields
18
+ * Users can choose whether to update links for attachments
19
+ * View how many items were updated
20
+
21
+ Get support for this plugin by going to the [Velvet Blues Update URLs plugin page](http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/). Post all questions as comments.
22
 
 
 
23
 
24
  == Installation ==
25
 
26
+ Installation and uninstallation are extremely simple. You can use WordPress' automatic install or follow the manual instructions below.
27
 
28
+ = Installing: =
29
 
30
  1. Download the package.
 
31
  2. Extract it to the "plugins" folder of your WordPress directory.
32
+ 3. In the Admin Panel, go to "Plugins" and activate it.
33
+ 4. Go to Settings -> Update URLs to use it.
34
 
35
+ = Uninstalling: =
36
 
37
+ 1. In the Admin Panel, go to "Plugins" and deactivate the plugin.
38
+ 2. Go to the "plugins" folder of your WordPress directory and delete the files/folder for this plugin.
39
 
40
+ = Usage: =
41
 
42
+ Using this plugin is very simple. Once it has been activated, navigate to Settings -> Update URLs and follow the instructions.
43
 
 
44
 
45
+ Get support for this plugin by going to the [Velvet Blues Update URLs plugin page](http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/). Post all questions as comments.
46
 
47
 
48
  == Frequently Asked Questions ==
49
 
50
  = Where can I get support for the plugin? =
51
 
52
+ Get support for this plugin by going to the [Velvet Blues Update URLs plugin page](http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/). Post all questions as comments.
53
 
54
  = Why are my urls not updated? =
55
 
56
  URLs are only replaced when an exact match is found. Be sure that you have entered the correct url and hit submit. (Note: Matching is case-sensitive.)
57
 
58
+ = Why do I see the message "You do not have sufficient permissions to access this page"? =
59
+
60
+ Make sure that the plugin is activated and that you are an administrator level user.
61
 
62
+ = This plugin saved me a lot of work. Where can I donate? =
63
+
64
+ Thanks, donations help us to continue improving our plugins. [Donate Here via PayPal.](http://www.velvetblues.com/go/updateurlsdonate/)
65
 
66
 
67
  == Screenshots ==
68
 
69
  1. The Admin screen for the plugin. screenshot-1.png
70
 
71
+ == Change Log ==
72
+
73
+ = 3.0 =
74
+ * Confirmed compatibility with latest WordPress releases and added support for future versions.
75
+ * Redesigned interface.
76
+ * Added the ability to update links in custom fields.
77
+ * Improved security against potential cross-site attacks by adding nonces and a referrer check and added exit to script if accessed directly.
78
+ * New error messages and field validation.
79
+ * Made changing ALL GUIDs optional, and turned off by default.
80
+ * Internationalized plugin.
81
+ * Updated License to GPLv2 or later.
82
+ * Fixed Typos
83
+
84
+ = 2.0.1 =
85
+ * Confirmed compatibility with WordPress 3.1.x releases.
86
+ * Updated FAQs and Contributors.
87
+
88
+ = 2.0 =
89
+ * Added the ability to update links in excerpt fields.
90
+ * Updated code for full compatibility with WordPress 3.0 releases.
91
+
92
+ = 1.0.3 =
93
+ * Confirmed compatibility with recent WordPress releases.
94
+
95
+ = 1.0.2 =
96
+ * Fixed PHP short tag problem, so as to be compatible with all configurations.
97
 
98
+ = 1.0.1 =
99
+ * Fixed possible interactions with other plugins.
 
 
 
screenshot-1.png CHANGED
Binary file
velvet-blues-update-urls.php CHANGED
@@ -2,86 +2,144 @@
2
  /*
3
  Plugin Name: Velvet Blues Update URLs
4
  Plugin URI: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/
5
- Description: This plugin updates all urls in your website by replacing old urls with new urls.
6
  Author: VelvetBlues.com
7
  Author URI: http://www.velvetblues.com/
8
- Version: 2.0.1
 
 
 
9
  */
10
  /* Copyright 2011 Velvet Blues Web Design (email : info@velvetblues.com)
11
 
12
- This program is free software; you can redistribute it and/or modify
13
- it under the terms of the GNU General Public License as published by
14
- the Free Software Foundation; either version 2 of the License, or
15
- (at your option) any later version.
16
 
17
- This program is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
21
 
22
- You should have received a copy of the GNU General Public License
23
- along with this program; if not, write to the Free Software
24
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
-
27
- /* Functions for the options page */
28
- function VelvetBluesUU_add_options_page(){
29
- add_options_page("Update URLs Setings", "Update Urls", "manage_options", basename(__FILE__), "VelvetBluesUU_options_page");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  }
31
- function VelvetBluesUU_options_page(){
32
- /* Function which updates urls */
33
- function VB_update_urls($links,$oldurl,$newurl){
34
- global $wpdb;
35
- //permalinks query
36
- $permquery = "UPDATE $wpdb->posts SET guid = replace(guid, '".$oldurl."','".$newurl."')";
37
- $result = $wpdb->query( $permquery );
38
- if($links == 1){
39
- //content query
40
- $contquery = "UPDATE $wpdb->posts SET post_content = replace(post_content, '".$oldurl."','".$newurl."')";
41
- $result = $wpdb->query( $contquery );
42
- $excquery = "UPDATE $wpdb->posts SET post_excerpt = replace(post_excerpt, '".$oldurl."','".$newurl."')";
43
- $result = $wpdb->query( $excquery );
 
 
 
 
 
 
44
  }
 
 
 
 
 
 
 
45
  }
46
- if( isset( $_POST['VBUU_settings_submit'] ) ){
47
- $vbuu_update_links = attribute_escape($_POST['VBUU_update_links']);
48
- $vbuu_oldurl = attribute_escape($_POST['VBUU_oldurl']);
49
- $vbuu_newurl = attribute_escape($_POST['VBUU_newurl']);
50
- VB_update_urls($vbuu_update_links,$vbuu_oldurl,$vbuu_newurl);
51
- echo '<div id="message" class="updated fade"><p><strong>URLs have been updated.</p></strong><p>You can now uninstall this plugin.</p></div>';
52
  }
 
53
  ?>
54
  <div class="wrap">
55
- <h2>Update URLs Settings</h2>
56
  <form method="post" action="options-general.php?page=<?php echo basename(__FILE__); ?>">
57
- <input type="hidden" id="_wpnonce" name="_wpnonce" value="abcab64052" />
58
- <p>These settings let you update your permalinks AND any old urls embedded in content or excerpts.<br/>It will replace all occurences of the old url with the new url.</p>
59
- <table class="form-table">
60
- <tr>
61
- <th scope="row" style="width:150px;"><b>Update permalinks<br/>AS WELL AS<br/>links in site content?</b></th><td>
62
- <p style="margin:0;padding:0;"><input name="VBUU_update_links" type="radio" id="VBUU_update_true" value="1" checked="checked" /> <label for="VBUU_update_true">Yes</label><br/>
63
- <input name="VBUU_update_links" type="radio" id="VBUU_update_false" value="0" /> <label for="VBUU_update_false">No, I only want to update page and image urls,<br/>and not any links to pages or images that may be<br/>embedded in content.</label></p>&nbsp;<br/>&nbsp;
64
- </td>
65
- </tr>
66
- <tr>
67
- <th scope="row" style="width:150px;"><b>Old URL</b></th>
68
- <td>
69
- <input name="VBUU_oldurl" type="text" id="VBUU_oldurl" value="" style="width:300px;" />
70
- </td>
71
- </tr>
72
- <tr>
73
- <th scope="row" style="width:150px;"><b>New URL</b></th>
74
- <td>
75
- <input name="VBUU_newurl" type="text" id="VBUU_newurl" value="" style="width:300px;" />
76
- </td>
77
  </tr>
78
- </table>
79
- <p class="submit">
80
- <input name="VBUU_settings_submit" value="Update URLs" type="submit" />
81
- </p>
 
 
 
 
 
 
 
 
 
 
82
  </form>
83
- <p>&nbsp;<br/>Need help? Get support at the <a href="http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/" target="_blank">Velvet Blues Update URLs plugin page</a>.</p>
84
  <?php
85
- }
86
- add_action('admin_menu', 'VelvetBluesUU_add_options_page');
 
87
  ?>
2
  /*
3
  Plugin Name: Velvet Blues Update URLs
4
  Plugin URI: http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/
5
+ Description: This plugin <strong>updates all urls in your website</strong> by replacing old urls with new urls. To get started: 1) Click the "Activate" link to the left of this description, and 2) Go to your <a href="options-general.php?page=velvet-blues-update-urls.php">Update URLs</a> page to use it.
6
  Author: VelvetBlues.com
7
  Author URI: http://www.velvetblues.com/
8
+ Author Email: info@velvetblues.com
9
+ Version: 3.0
10
+ License: GPLv2 or later
11
+ Text Domain: velvet-blues-update-urls
12
  */
13
  /* Copyright 2011 Velvet Blues Web Design (email : info@velvetblues.com)
14
 
15
+ This program is free software; you can redistribute it and/or
16
+ modify it under the terms of the GNU General Public License
17
+ as published by the Free Software Foundation; either version 2
18
+ of the License, or (at your option) any later version.
19
 
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
 
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
  */
29
+ if ( !function_exists( 'add_action' ) ) {
30
+ ?><h3>Oops! This page cannot be accessed directly.</h3>
31
+ <p>For support using the Velvet Blues Update URLs plugin, <a href="http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/" title="Velvet Blues Update URLs WordPress plugin">click here</a>.</p>
32
+ <p>If you are looking for general WordPress assistance, <a href="http://www.velvetblues.com/" title="WordPress Web Development and Services">Velvet Blues can help with that too</a>.</p><?php
33
+ exit;
34
+ }
35
+ function VelvetBluesUU_add_options_page(){
36
+ add_options_page("Velvet Blues Update URLs", "Update URLs", "manage_options", basename(__FILE__), "VelvetBluesUU_options_page");
37
+ }
38
+ function VelvetBluesUU_load_textdomain(){
39
+ load_plugin_textdomain( 'velvet-blues-update-urls', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
40
+ }
41
+ function VelvetBluesUU_options_page(){
42
+ function VB_update_urls($options,$oldurl,$newurl){
43
+ global $wpdb;
44
+ $results = array();
45
+ $queries = array(
46
+ 'content' => array("UPDATE $wpdb->posts SET post_content = replace(post_content, '".$oldurl."','".$newurl."')", __('Content Items (Posts, Pages, Custom Post Types, Revisions)','velvet-blues-update-urls') ),
47
+ 'excerpts' => array("UPDATE $wpdb->posts SET post_excerpt = replace(post_excerpt, '".$oldurl."','".$newurl."')", __('Excerpts','velvet-blues-update-urls') ),
48
+ 'attachments' => array("UPDATE $wpdb->posts SET guid = replace(guid, '".$oldurl."','".$newurl."') WHERE post_type = 'attachment'", __('Attachments','velvet-blues-update-urls') ),
49
+ 'custom' => array("UPDATE $wpdb->postmeta SET meta_value = replace(meta_value, '".$oldurl."','".$newurl."')", __('Custom Fields','velvet-blues-update-urls') ),
50
+ 'guids' => array("UPDATE $wpdb->posts SET guid = replace(guid, '".$oldurl."','".$newurl."')", __('GUIDs','velvet-blues-update-urls') )
51
+ );
52
+ foreach($options as $option){
53
+ $result = $wpdb->query( $wpdb->prepare( $queries[$option][0] ) );
54
+ $results[$option] = array($result, $queries[$option][1]);
55
+ }
56
+ return $results;
57
+ }
58
+ if ( isset( $_POST['VBUU_settings_submit'] ) && !check_admin_referer('VBUU_submit','VBUU_nonce')){
59
+ if(isset($_POST['VBUU_oldurl']) && isset($_POST['VBUU_newurl'])){
60
+ if(function_exists('esc_attr')){
61
+ $vbuu_oldurl = esc_attr(trim($_POST['VBUU_oldurl']));
62
+ $vbuu_newurl = esc_attr(trim($_POST['VBUU_newurl']));
63
+ }else{
64
+ $vbuu_oldurl = attribute_escape(trim($_POST['VBUU_oldurl']));
65
+ $vbuu_newurl = attribute_escape(trim($_POST['VBUU_newurl']));
66
+ }
67
+ }
68
+ echo '<div id="message" class="error fade"><p><strong>'.__('ERROR','velvet-blues-update-urls').' - '.__('Please try again.','velvet-blues-update-urls').'</strong></p></div>';
69
+ }
70
+ elseif( isset( $_POST['VBUU_settings_submit'] ) && !isset( $_POST['VBUU_update_links'] ) ){
71
+ if(isset($_POST['VBUU_oldurl']) && isset($_POST['VBUU_newurl'])){
72
+ if(function_exists('esc_attr')){
73
+ $vbuu_oldurl = esc_attr(trim($_POST['VBUU_oldurl']));
74
+ $vbuu_newurl = esc_attr(trim($_POST['VBUU_newurl']));
75
+ }else{
76
+ $vbuu_oldurl = attribute_escape(trim($_POST['VBUU_oldurl']));
77
+ $vbuu_newurl = attribute_escape(trim($_POST['VBUU_newurl']));
78
+ }
79
+ }
80
+ echo '<div id="message" class="error fade"><p><strong>'.__('ERROR','velvet-blues-update-urls').' - '.__('Your URLs have not been updated.','velvet-blues-update-urls').'</p></strong><p>'.__('Please select at least one checkbox.','velvet-blues-update-urls').'</p></div>';
81
  }
82
+ elseif( isset( $_POST['VBUU_settings_submit'] ) ){
83
+ $vbuu_update_links = $_POST['VBUU_update_links'];
84
+ if(isset($_POST['VBUU_oldurl']) && isset($_POST['VBUU_newurl'])){
85
+ if(function_exists('esc_attr')){
86
+ $vbuu_oldurl = esc_attr(trim($_POST['VBUU_oldurl']));
87
+ $vbuu_newurl = esc_attr(trim($_POST['VBUU_newurl']));
88
+ }else{
89
+ $vbuu_oldurl = attribute_escape(trim($_POST['VBUU_oldurl']));
90
+ $vbuu_newurl = attribute_escape(trim($_POST['VBUU_newurl']));
91
+ }
92
+ }
93
+ if(($vbuu_oldurl && $vbuu_oldurl != 'http://www.oldurl.com' && trim($vbuu_oldurl) != '') && ($vbuu_newurl && $vbuu_newurl != 'http://www.newurl.com' && trim($vbuu_newurl) != '')){
94
+ $results = VB_update_urls($vbuu_update_links,$vbuu_oldurl,$vbuu_newurl);
95
+ $empty = false;
96
+ $emptystring = '<strong>'.__('Why do the results show 0 URLs updated?','velvet-blues-update-urls').'</strong><br/>'.__('This happens if a URL is incorrect or if it is not found in the content.','velvet-blues-update-urls');
97
+ $resultstring = '';
98
+ foreach($results as $result){
99
+ $empty = ($result[0] == 0 || $empty == true)? true : false;
100
+ $resultstring .= '<br/><strong>'.$result[0].'</strong> '.$result[1];
101
  }
102
+ ?>
103
+ <div id="message" class="updated fade"><table><tr><td><p><strong><?php _e('Success! Your URLs have been updated.','velvet-blues-update-urls'); ?></strong></p>
104
+ <p><u><?php _e('Results','velvet-blues-update-urls'); ?></u><?php echo $resultstring; ?></p>
105
+ <?php echo ($empty)? '<p>'.$emptystring.'</p>' : ''; ?>
106
+ </td><td width="60"></td>
107
+ <td align="center"><p><?php //You can now uninstall this plugin.<br/> ?><?php printf(__('If you found our plugin useful, %s please consider donating','velvet-blues-update-urls'),'<br/>'); ?>.</p><p><a style="outline:none;" href="http://www.velvetblues.com/go/updateurlsdonate/" target="_blank"><img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" alt="PayPal -<?php _e('The safer, easier way to pay online!','velvet-blues-update-urls'); ?>"></a></p></td></tr></table></div>
108
+ <?php
109
  }
110
+ else{
111
+ echo '<div id="message" class="error fade"><p><strong>'.__('ERROR','velvet-blues-update-urls').' - '.__('Your URLs have not been updated.','velvet-blues-update-urls').'</p></strong><p>'.__('Please enter values for both the old url and the new url.','velvet-blues-update-urls').'</p></div>';
 
 
 
 
112
  }
113
+ }
114
  ?>
115
  <div class="wrap">
116
+ <h2>Velvet Blues Update URLs</h2>
117
  <form method="post" action="options-general.php?page=<?php echo basename(__FILE__); ?>">
118
+ <?php wp_nonce_field('VBUU_submit','VBUU_nonce'); ?>
119
+ <p><?php printf(__("After moving a website, %s lets you fix old URLs in content, excerpts, and custom fields.",'velvet-blues-update-urls'),'<strong>Update URLs</strong>'); ?></p>
120
+ <h3 style="margin-bottom:5px;"><?php _e('Step'); ?> 1: <?php _e('Enter your URLs in the fields below','velvet-blues-update-urls'); ?></h3>
121
+ <table class="form-table"><tr valign="middle">
122
+ <th scope="row" width="140" style="width:140px"><strong><?php _e('Old URL','velvet-blues-update-urls'); ?></strong><br/><span class="description"><?php _e('Old Site Address','velvet-blues-update-urls'); ?></span></th>
123
+ <td><input name="VBUU_oldurl" type="text" id="VBUU_oldurl" value="<?php echo (isset($vbuu_oldurl) && trim($vbuu_oldurl) != '')? $vbuu_oldurl : 'http://www.oldurl.com'; ?>" style="width:300px;font-size:20px;" onfocus="if(this.value=='http://www.oldurl.com') this.value='';" onblur="if(this.value=='') this.value='http://www.oldurl.com';" /></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  </tr>
125
+ <tr valign="middle">
126
+ <th scope="row" width="140" style="width:140px"><strong><?php _e('New URL','velvet-blues-update-urls'); ?></strong><br/><span class="description"><?php _e('New Site Address','velvet-blues-update-urls'); ?></span></th>
127
+ <td><input name="VBUU_newurl" type="text" id="VBUU_newurl" value="<?php echo (isset($vbuu_newurl) && trim($vbuu_newurl) != '')? $vbuu_newurl : 'http://www.newurl.com'; ?>" style="width:300px;font-size:20px;" onfocus="if(this.value=='http://www.newurl.com') this.value='';" onblur="if(this.value=='') this.value='http://www.newurl.com';" /></td>
128
+ </tr></table>
129
+ <br/>
130
+ <h3 style="margin-bottom:5px;"><?php _e('Step'); ?> 2: <?php _e('Choose which URLs should be updated','velvet-blues-update-urls'); ?></h3>
131
+ <table class="form-table"><tr><td><p style="line-height:20px;">
132
+ <input name="VBUU_update_links[]" type="checkbox" id="VBUU_update_true" value="content" checked="checked" /> <label for="VBUU_update_true"><strong><?php _e('URLs in page content','velvet-blues-update-urls'); ?></strong> (<?php _e('posts, pages, custom post types, revisions','velvet-blues-update-urls'); ?>)</label><br/>
133
+ <input name="VBUU_update_links[]" type="checkbox" id="VBUU_update_true" value="excerpts" /> <label for="VBUU_update_true"><strong><?php _e('URLs in excerpts','velvet-blues-update-urls'); ?></strong></label><br/>
134
+ <input name="VBUU_update_links[]" type="checkbox" id="VBUU_update_true" value="attachments" /> <label for="VBUU_update_true"><strong><?php _e('URLs for attachments','velvet-blues-update-urls'); ?></strong> (<?php _e('images, documents, general media','velvet-blues-update-urls'); ?>)</label><br/>
135
+ <input name="VBUU_update_links[]" type="checkbox" id="VBUU_update_true" value="custom" /> <label for="VBUU_update_true"><strong><?php _e('URLs in custom fields and meta boxes','velvet-blues-update-urls'); ?></strong></label><br/>
136
+ <input name="VBUU_update_links[]" type="checkbox" id="VBUU_update_true" value="guids" /> <label for="VBUU_update_true"><strong><?php _e('Update ALL GUIDs','velvet-blues-update-urls'); ?></strong> <span class="description" style="color:#f00;"><?php _e('GUIDs for posts should only be changed on development sites.','velvet-blues-update-urls'); ?></span> <a href="http://www.velvetblues.com/go/guids/" target="_blank"><?php _e('Learn More.','velvet-blues-update-urls'); ?></a></label>
137
+ </p></td></tr></table>
138
+ <p><input class="button-primary" name="VBUU_settings_submit" value="<?php _e('Update URLs NOW','velvet-blues-update-urls'); ?>" type="submit" /></p>
139
  </form>
140
+ <p>&nbsp;<br/><?php printf(__("Need help? Get support at the %s plugin page%s.",'velvet-blues-update-urls'),'<a href="http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/" target="_blank">Velvet Blues Update URLs','</a>'); ?><br/><?php _e('Want to donate?','velvet-blues-update-urls'); ?> <a href="http://www.velvetblues.com/go/updateurlsdonate/" target="_blank"><?php _e('Click here.','velvet-blues-update-urls'); ?></a></p>
141
  <?php
142
+ }
143
+ add_action('admin_menu', 'VelvetBluesUU_add_options_page');
144
+ add_action('admin_init','VelvetBluesUU_load_textdomain');
145
  ?>