WP Migrate DB - Version 0.5

Version Description

  • 2013-07-26 =
  • Language support! Thanks to an awesome pull request from Rafael Funchal.
  • New Language: Brazilian Portugese
  • Added filter for the filename of the exported file
  • Bug fix: Spam commentmeta included when "Do not export spam comments" checked
  • Bug fix: Fatal error method error does not exist
  • Bug fix: Table names with dashes not exporting
  • Bug fix: Find & replace is case-sensitive but shouldn't
Download this release

Release Info

Developer bradt
Plugin Icon 128x128 WP Migrate DB
Version 0.5
Comparing to
See all releases

Code changes from version 0.4.4 to 0.5

asset/css/styles.css CHANGED
@@ -81,6 +81,47 @@ p.submit img {
81
  #wpmdb-sidebar .author p {
82
  margin: 0;
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  #wpmdb-sidebar .subscribe h2 {
85
  padding: 0;
86
  margin: 0;
81
  #wpmdb-sidebar .author p {
82
  margin: 0;
83
  }
84
+ #wpmdb-sidebar .video {
85
+ position: relative;
86
+ display: block;
87
+ }
88
+ #wpmdb-sidebar .video:before, #wpmdb-sidebar .video:after {
89
+ position: absolute;
90
+ content: " ";
91
+ margin: auto;
92
+ left: 0;
93
+ right: 0;
94
+ top: 0;
95
+ bottom: 0;
96
+ }
97
+ #wpmdb-sidebar .video:before {
98
+ width: 60px;
99
+ height: 60px;
100
+ -webkit-border-radius: 60px;
101
+ -moz-border-radius: 60px;
102
+ -ms-border-radius: 60px;
103
+ -o-border-radius: 60px;
104
+ border-radius: 60px;
105
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
106
+ opacity: 0.8;
107
+ border: 1px solid #ddd;
108
+ background-color: #fff;
109
+ z-index: 2;
110
+ }
111
+ #wpmdb-sidebar .video:after {
112
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
113
+ opacity: 0.8;
114
+ border: 20px solid transparent;
115
+ border-top-width: 12px;
116
+ border-bottom-width: 12px;
117
+ border-left-color: #333;
118
+ background: transparent;
119
+ display: block;
120
+ left: 23.4375px;
121
+ width: 0px;
122
+ height: 0px;
123
+ z-index: 3;
124
+ }
125
  #wpmdb-sidebar .subscribe h2 {
126
  padding: 0;
127
  margin: 0;
asset/img/video@2x.jpg CHANGED
Binary file
asset/js/script.js CHANGED
@@ -1,15 +1,19 @@
1
  (function($) {
2
  $(document).ready(function() {
 
 
 
 
3
  $('#replace-guids-info-link').click(function() {
4
  var $div = $('#replace-guids-info');
5
  if ( 'none' == $div.css('display') ) {
6
  $div.show();
7
- $(this).html('show less');
8
  return false;
9
  }
10
  else {
11
  $div.hide();
12
- $(this).html('show more');
13
  return false;
14
  }
15
  });
1
  (function($) {
2
  $(document).ready(function() {
3
+ // Localization strings
4
+ var show_less = wp_migrate_db_translate_script.show_less;
5
+ var show_more = wp_migrate_db_translate_script.show_more;
6
+
7
  $('#replace-guids-info-link').click(function() {
8
  var $div = $('#replace-guids-info');
9
  if ( 'none' == $div.css('display') ) {
10
  $div.show();
11
+ $(this).html( show_less );
12
  return false;
13
  }
14
  else {
15
  $div.hide();
16
+ $(this).html( show_more );
17
  return false;
18
  }
19
  });
asset/sass/styles.scss CHANGED
@@ -1,3 +1,5 @@
 
 
1
  #migrate-form {
2
  padding-top: 10px;
3
  }
@@ -94,6 +96,46 @@ p.submit {
94
  }
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  .subscribe {
98
  h2 {
99
  padding: 0;
1
+ @import "compass";
2
+
3
  #migrate-form {
4
  padding-top: 10px;
5
  }
96
  }
97
  }
98
 
99
+ .video {
100
+ position: relative;
101
+ display: block;
102
+ $size: 60px;
103
+
104
+ &:before, &:after {
105
+ position: absolute;
106
+ content: " ";
107
+ margin: auto;
108
+ left: 0;
109
+ right: 0;
110
+ top: 0;
111
+ bottom: 0;
112
+ }
113
+
114
+ &:before {
115
+ width: $size;
116
+ height: $size;
117
+ @include border-radius($size);
118
+ @include opacity(0.8);
119
+ border: 1px solid #ddd;
120
+ background-color: #fff;
121
+ z-index: 2;
122
+ }
123
+
124
+ &:after {
125
+ @include opacity(0.8);
126
+ border: $size/3 solid transparent;
127
+ border-top-width: $size/5;
128
+ border-bottom-width: $size/5;
129
+ border-left-color: #333;
130
+ background: transparent;
131
+ display: block;
132
+ left: $size/2.56;
133
+ width: 0px;
134
+ height: 0px;
135
+ z-index: 3;
136
+ }
137
+ }
138
+
139
  .subscribe {
140
  h2 {
141
  padding: 0;
languages/wp-migrate-db-pt_BR.mo ADDED
Binary file
languages/wp-migrate-db-pt_BR.po ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Migrate DB\n"
4
+ "POT-Creation-Date: 2013-06-12 19:58-0300\n"
5
+ "PO-Revision-Date: 2013-06-12 19:58-0300\n"
6
+ "Last-Translator: Rafael Funchal <rafaelfunchal@gmail.com>\n"
7
+ "Language-Team: Rafael Funchal <contato@rafaelfunchal.com.br>\n"
8
+ "Language: pt_BR\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
14
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../wp-migrate-db.php:102
21
+ msgid "show less"
22
+ msgstr "ocultar"
23
+
24
+ #: ../wp-migrate-db.php:103 ../wp-migrate-db.php:311
25
+ msgid "show more"
26
+ msgstr "expandir"
27
+
28
+ #: ../wp-migrate-db.php:124
29
+ msgid "Please enter the current URL."
30
+ msgstr "Por favor, informe a URL atual."
31
+
32
+ #: ../wp-migrate-db.php:128
33
+ msgid "Please enter a new URL."
34
+ msgstr "Por favor, informe a URL nova."
35
+
36
+ #: ../wp-migrate-db.php:132
37
+ msgid "Please enter the current file path."
38
+ msgstr "Por favor, informe o caminho atual dos arquivos."
39
+
40
+ #: ../wp-migrate-db.php:136
41
+ msgid "Please enter a new file path."
42
+ msgstr "Por favor, informe o novo caminho dos arquivos."
43
+
44
+ #: ../wp-migrate-db.php:150 ../wp-migrate-db.php:771
45
+ msgid "Migrate DB"
46
+ msgstr "Migrar Base de Dados"
47
+
48
+ #: ../wp-migrate-db.php:175
49
+ msgid ""
50
+ "Your database (SQL) file has been successfully generated. Your download "
51
+ "should begin any second."
52
+ msgstr ""
53
+ "Sua base de dados (SQL) foi gerada com sucesso. Seu download deve começar em "
54
+ "alguns segundos."
55
+
56
+ #: ../wp-migrate-db.php:183
57
+ msgid "Your database (SQL) file has been successfully generated and saved to"
58
+ msgstr "Sua base de dados (SQL) foi gerada com sucesso e salva em"
59
+
60
+ #: ../wp-migrate-db.php:188
61
+ msgid "Click here to download."
62
+ msgstr "Clique aqui para baixar."
63
+
64
+ #: ../wp-migrate-db.php:199
65
+ msgid "Non-Serialized Strings Replaced:"
66
+ msgstr "Strings não serializadas substituídas:"
67
+
68
+ #: ../wp-migrate-db.php:205
69
+ msgid "Serialized Strings Replaced:"
70
+ msgstr "Strings serializadas substituídas:"
71
+
72
+ #: ../wp-migrate-db.php:238
73
+ #, php-format
74
+ msgid "The directory %s needs to be writable."
75
+ msgstr "O diretório %s precisa ser gravável."
76
+
77
+ #: ../wp-migrate-db.php:250
78
+ msgid ""
79
+ "Sorry, there were errors with your form submission. Please correct them "
80
+ "below and try again."
81
+ msgstr ""
82
+ "Desculpe, mas há erros no formulário. Por favor, corrija-os abaixo e tente "
83
+ "novamente."
84
+
85
+ #: ../wp-migrate-db.php:259
86
+ msgid ""
87
+ "WP Migrate DB exports your database as a MySQL data dump (much like "
88
+ "phpMyAdmin), does a find and replace on URLs and file paths, then allows you "
89
+ "to save it to your computer. It even takes into account serialized data and "
90
+ "updates the string length values."
91
+ msgstr ""
92
+ "WP Migrate DB exporta sua base de dados como um MySQL dump (bem parecido com "
93
+ "o phpMyAdmin), faz um Localizar e Substituir nas URLs e Caminhos dos "
94
+ "Arquivos, então permite que você a salve sem seu computador. Ele ainda "
95
+ "considera os dados serializados e atualiza os valores de comprimento da "
96
+ "string."
97
+
98
+ #: ../wp-migrate-db.php:262
99
+ msgid ""
100
+ "Example: <code>s:5:\"hello\"</code> becomes <code>s:11:\"hello world\"</code>"
101
+ msgstr ""
102
+ "Exemplo: <code>s:5:\"olá\"</code> virará <code>s:11:\"olá mundo\"</code>"
103
+
104
+ #: ../wp-migrate-db.php:270
105
+ msgid "Current address (URL)"
106
+ msgstr "Endereço atual (URL)"
107
+
108
+ #: ../wp-migrate-db.php:279
109
+ msgid "New address (URL)"
110
+ msgstr "Novo endereço (URL)"
111
+
112
+ #: ../wp-migrate-db.php:288
113
+ msgid "Current file path"
114
+ msgstr "Caminho atual dos arquivos"
115
+
116
+ #: ../wp-migrate-db.php:297
117
+ msgid "New file path"
118
+ msgstr "Novo caminho dos arquivos"
119
+
120
+ #: ../wp-migrate-db.php:305
121
+ msgid "Data Options"
122
+ msgstr "Opções de Dados"
123
+
124
+ #: ../wp-migrate-db.php:309
125
+ msgid "Replace GUIDs"
126
+ msgstr "Substituir GUIDs"
127
+
128
+ #: ../wp-migrate-db.php:315
129
+ #, php-format
130
+ msgid ""
131
+ "Although the <a href=\"%s\" target=\"_blank\">WordPress Codex emphasizes</a> "
132
+ "that GUIDs should not be changed, this is limited to sites that are already "
133
+ "live. If the site has never been live, I recommend replacing the GUIDs. For "
134
+ "example, you may be developing a new site locally at dev.somedomain.com and "
135
+ "want to migrate the site live to somedomain.com."
136
+ msgstr ""
137
+ "Embora a <a href=\"%s\" target=\"_blank\">Documentação do WordPress</a> "
138
+ "enfatize que os GUIDs não devem ser substituídos, isso é limitado a sites "
139
+ "que já estejam no ar. Se o site ainda não estiver no ar, eu recomendo "
140
+ "substituir os GUIDs. Por exemplo, você deve estar desenvolvendo um site em "
141
+ "dev.algumdominio.com e quer migra-lo para produção em algumdominio.com."
142
+
143
+ #: ../wp-migrate-db.php:325
144
+ msgid "Do not export spam comments"
145
+ msgstr "Não exportar comentários spam"
146
+
147
+ #: ../wp-migrate-db.php:334
148
+ msgid "Do not export post revisions"
149
+ msgstr "Não exportar revisões de post"
150
+
151
+ #: ../wp-migrate-db.php:339
152
+ msgid "File Options"
153
+ msgstr "Opções de Arquivo"
154
+
155
+ #: ../wp-migrate-db.php:343
156
+ msgid "Save as file to your computer"
157
+ msgstr "Salvar como arquivo em seu computador"
158
+
159
+ #: ../wp-migrate-db.php:353
160
+ msgid "Compress file with gzip"
161
+ msgstr "Comprimir arquivo como gzip"
162
+
163
+ #: ../wp-migrate-db.php:362
164
+ msgid "Export Database"
165
+ msgstr "Exportar Base de Dados"
166
+
167
+ #: ../wp-migrate-db.php:376
168
+ msgid "Created &amp; maintained by"
169
+ msgstr "Criado e mantido por"
170
+
171
+ #: ../wp-migrate-db.php:379
172
+ msgid "Profile"
173
+ msgstr "Perfil"
174
+
175
+ #: ../wp-migrate-db.php:381
176
+ msgid "Donate"
177
+ msgstr "Doar"
178
+
179
+ #: ../wp-migrate-db.php:387
180
+ msgid "Pro Version Has Arrived!"
181
+ msgstr "A Versão Pró chegou!"
182
+
183
+ #: ../wp-migrate-db.php:392
184
+ msgid "View Features &rarr;"
185
+ msgstr "Ver Recursos &rarr;"
186
+
187
+ #: ../wp-migrate-db.php:393
188
+ msgid "View Pricing &rarr;"
189
+ msgstr "Ver Preço &rarr;"
190
+
191
+ #: ../wp-migrate-db.php:398
192
+ msgid "Get 20% Off!"
193
+ msgstr "Ganhe 20% de Desconto!"
194
+
195
+ #: ../wp-migrate-db.php:401
196
+ #, php-format
197
+ msgid ""
198
+ "Subscribe to receive news &amp; updates below and we'll instantly send you a "
199
+ "coupon code to get 20% off any WP Migrate DB Pro license."
200
+ msgstr ""
201
+ "Inscreva-se abaixo para receber novidades e atualizações e nós enviaremos "
202
+ "imediatamente um cupom com 20% de desconto para a compra de qualquer licença "
203
+ "do WP Migrate DB Pro."
204
+
205
+ #: ../wp-migrate-db.php:405
206
+ msgid "Your Name"
207
+ msgstr "Seu nome"
208
+
209
+ #: ../wp-migrate-db.php:410
210
+ msgid "Your Email"
211
+ msgstr "Seu email"
212
+
213
+ #: ../wp-migrate-db.php:415
214
+ msgid "Subscribe"
215
+ msgstr "Inscrever"
216
+
217
+ #: ../wp-migrate-db.php:419
218
+ msgid ""
219
+ "I promise I will not use your email for anything else and you can "
220
+ "unsubscribe with <span style=\"white-space: nowrap;\">1-click anytime</span>."
221
+ msgstr ""
222
+ "Eu prometo que não usarei o seu e-mail para nada além disso e você poderá se "
223
+ "descadastrar a qualquer momento <span style=\"white-space: nowrap;\">com "
224
+ "apenas um clique</span>."
225
+
226
+ #: ../wp-migrate-db.php:466
227
+ msgid "Error getting table details"
228
+ msgstr "Erro ao carregar detalhes da tabela"
229
+
230
+ #: ../wp-migrate-db.php:474
231
+ #, php-format
232
+ msgid "Delete any existing table %s"
233
+ msgstr "Apagar qualquer tabela existente %s"
234
+
235
+ #: ../wp-migrate-db.php:483
236
+ #, php-format
237
+ msgid "Table structure of table %s"
238
+ msgstr "Estrutura da tabela %s"
239
+
240
+ #: ../wp-migrate-db.php:489
241
+ #, php-format
242
+ msgid "Error with SHOW CREATE TABLE for %s."
243
+ msgstr "Erro com SHOW CREATE TABLE para %s."
244
+
245
+ #: ../wp-migrate-db.php:496
246
+ #, php-format
247
+ msgid "Error getting table structure of %s"
248
+ msgstr "Erro ao carregar a estrutura da tabela de %s"
249
+
250
+ #: ../wp-migrate-db.php:504
251
+ #, php-format
252
+ msgid "Data contents of table %s"
253
+ msgstr "Conteúdo da tabela %s "
254
+
255
+ #: ../wp-migrate-db.php:584
256
+ #, php-format
257
+ msgid "End of data contents of table %s"
258
+ msgstr "Final do conteúdo da tabela %s "
259
+
260
+ #: ../wp-migrate-db.php:668
261
+ #, php-format
262
+ msgid "Table: %s"
263
+ msgstr "Tabela: %s"
264
+
265
+ #: ../wp-migrate-db.php:685
266
+ msgid "WordPress MySQL database migration"
267
+ msgstr "Migração da Base de Dados MySQL do WordPress"
268
+
269
+ #: ../wp-migrate-db.php:686
270
+ #, php-format
271
+ msgid "From %s to %s"
272
+ msgstr "De %s para %s"
273
+
274
+ #: ../wp-migrate-db.php:688
275
+ #, php-format
276
+ msgid "Generated: %s"
277
+ msgstr "Gerado: %s"
278
+
279
+ #: ../wp-migrate-db.php:689
280
+ #, php-format
281
+ msgid "Hostname: %s"
282
+ msgstr "Nme do host: %s"
283
+
284
+ #: ../wp-migrate-db.php:690
285
+ #, php-format
286
+ msgid "Database: %s"
287
+ msgstr "Base de dados: %s"
288
+
289
+ #: ../wp-migrate-db.php:715 ../wp-migrate-db.php:718
290
+ msgid "There was an error writing a line to the backup script:"
291
+ msgstr "Houve um erro ao escrever a linha do script de backup."
languages/wp-migrate-db.pot ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Migrate DB\n"
4
+ "POT-Creation-Date: 2013-06-12 19:59-0300\n"
5
+ "PO-Revision-Date: 2013-06-12 19:59-0300\n"
6
+ "Last-Translator: Rafael Funchal <rafaelfunchal@gmail.com>\n"
7
+ "Language-Team: Rafael Funchal <contato@rafaelfunchal.com.br>\n"
8
+ "Language: en_US\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
14
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../wp-migrate-db.php:102
21
+ msgid "show less"
22
+ msgstr ""
23
+
24
+ #: ../wp-migrate-db.php:103 ../wp-migrate-db.php:311
25
+ msgid "show more"
26
+ msgstr ""
27
+
28
+ #: ../wp-migrate-db.php:124
29
+ msgid "Please enter the current URL."
30
+ msgstr ""
31
+
32
+ #: ../wp-migrate-db.php:128
33
+ msgid "Please enter a new URL."
34
+ msgstr ""
35
+
36
+ #: ../wp-migrate-db.php:132
37
+ msgid "Please enter the current file path."
38
+ msgstr ""
39
+
40
+ #: ../wp-migrate-db.php:136
41
+ msgid "Please enter a new file path."
42
+ msgstr ""
43
+
44
+ #: ../wp-migrate-db.php:150 ../wp-migrate-db.php:771
45
+ msgid "Migrate DB"
46
+ msgstr ""
47
+
48
+ #: ../wp-migrate-db.php:175
49
+ msgid ""
50
+ "Your database (SQL) file has been successfully generated. Your download "
51
+ "should begin any second."
52
+ msgstr ""
53
+
54
+ #: ../wp-migrate-db.php:183
55
+ msgid "Your database (SQL) file has been successfully generated and saved to"
56
+ msgstr ""
57
+
58
+ #: ../wp-migrate-db.php:188
59
+ msgid "Click here to download."
60
+ msgstr ""
61
+
62
+ #: ../wp-migrate-db.php:199
63
+ msgid "Non-Serialized Strings Replaced:"
64
+ msgstr ""
65
+
66
+ #: ../wp-migrate-db.php:205
67
+ msgid "Serialized Strings Replaced:"
68
+ msgstr ""
69
+
70
+ #: ../wp-migrate-db.php:238
71
+ #, php-format
72
+ msgid "The directory %s needs to be writable."
73
+ msgstr ""
74
+
75
+ #: ../wp-migrate-db.php:250
76
+ msgid ""
77
+ "Sorry, there were errors with your form submission. Please correct them "
78
+ "below and try again."
79
+ msgstr ""
80
+
81
+ #: ../wp-migrate-db.php:259
82
+ msgid ""
83
+ "WP Migrate DB exports your database as a MySQL data dump (much like "
84
+ "phpMyAdmin), does a find and replace on URLs and file paths, then allows you "
85
+ "to save it to your computer. It even takes into account serialized data and "
86
+ "updates the string length values."
87
+ msgstr ""
88
+
89
+ #: ../wp-migrate-db.php:262
90
+ msgid ""
91
+ "Example: <code>s:5:\"hello\"</code> becomes <code>s:11:\"hello world\"</code>"
92
+ msgstr ""
93
+
94
+ #: ../wp-migrate-db.php:270
95
+ msgid "Current address (URL)"
96
+ msgstr ""
97
+
98
+ #: ../wp-migrate-db.php:279
99
+ msgid "New address (URL)"
100
+ msgstr ""
101
+
102
+ #: ../wp-migrate-db.php:288
103
+ msgid "Current file path"
104
+ msgstr ""
105
+
106
+ #: ../wp-migrate-db.php:297
107
+ msgid "New file path"
108
+ msgstr ""
109
+
110
+ #: ../wp-migrate-db.php:305
111
+ msgid "Data Options"
112
+ msgstr ""
113
+
114
+ #: ../wp-migrate-db.php:309
115
+ msgid "Replace GUIDs"
116
+ msgstr ""
117
+
118
+ #: ../wp-migrate-db.php:315
119
+ #, php-format
120
+ msgid ""
121
+ "Although the <a href=\"%s\" target=\"_blank\">WordPress Codex emphasizes</a> "
122
+ "that GUIDs should not be changed, this is limited to sites that are already "
123
+ "live. If the site has never been live, I recommend replacing the GUIDs. For "
124
+ "example, you may be developing a new site locally at dev.somedomain.com and "
125
+ "want to migrate the site live to somedomain.com."
126
+ msgstr ""
127
+
128
+ #: ../wp-migrate-db.php:325
129
+ msgid "Do not export spam comments"
130
+ msgstr ""
131
+
132
+ #: ../wp-migrate-db.php:334
133
+ msgid "Do not export post revisions"
134
+ msgstr ""
135
+
136
+ #: ../wp-migrate-db.php:339
137
+ msgid "File Options"
138
+ msgstr ""
139
+
140
+ #: ../wp-migrate-db.php:343
141
+ msgid "Save as file to your computer"
142
+ msgstr ""
143
+
144
+ #: ../wp-migrate-db.php:353
145
+ msgid "Compress file with gzip"
146
+ msgstr ""
147
+
148
+ #: ../wp-migrate-db.php:362
149
+ msgid "Export Database"
150
+ msgstr ""
151
+
152
+ #: ../wp-migrate-db.php:376
153
+ msgid "Created &amp; maintained by"
154
+ msgstr ""
155
+
156
+ #: ../wp-migrate-db.php:379
157
+ msgid "Profile"
158
+ msgstr ""
159
+
160
+ #: ../wp-migrate-db.php:381
161
+ msgid "Donate"
162
+ msgstr ""
163
+
164
+ #: ../wp-migrate-db.php:387
165
+ msgid "Pro Version Has Arrived!"
166
+ msgstr ""
167
+
168
+ #: ../wp-migrate-db.php:392
169
+ msgid "View Features &rarr;"
170
+ msgstr ""
171
+
172
+ #: ../wp-migrate-db.php:393
173
+ msgid "View Pricing &rarr;"
174
+ msgstr ""
175
+
176
+ #: ../wp-migrate-db.php:398
177
+ msgid "Get 20% Off!"
178
+ msgstr ""
179
+
180
+ #: ../wp-migrate-db.php:401
181
+ #, php-format
182
+ msgid ""
183
+ "Subscribe to receive news &amp; updates below and we'll instantly send you a "
184
+ "coupon code to get 20% off any WP Migrate DB Pro license."
185
+ msgstr ""
186
+
187
+ #: ../wp-migrate-db.php:405
188
+ msgid "Your Name"
189
+ msgstr ""
190
+
191
+ #: ../wp-migrate-db.php:410
192
+ msgid "Your Email"
193
+ msgstr ""
194
+
195
+ #: ../wp-migrate-db.php:415
196
+ msgid "Subscribe"
197
+ msgstr ""
198
+
199
+ #: ../wp-migrate-db.php:419
200
+ msgid ""
201
+ "I promise I will not use your email for anything else and you can "
202
+ "unsubscribe with <span style=\"white-space: nowrap;\">1-click anytime</span>."
203
+ msgstr ""
204
+
205
+ #: ../wp-migrate-db.php:466
206
+ msgid "Error getting table details"
207
+ msgstr ""
208
+
209
+ #: ../wp-migrate-db.php:474
210
+ #, php-format
211
+ msgid "Delete any existing table %s"
212
+ msgstr ""
213
+
214
+ #: ../wp-migrate-db.php:483
215
+ #, php-format
216
+ msgid "Table structure of table %s"
217
+ msgstr ""
218
+
219
+ #: ../wp-migrate-db.php:489
220
+ #, php-format
221
+ msgid "Error with SHOW CREATE TABLE for %s."
222
+ msgstr ""
223
+
224
+ #: ../wp-migrate-db.php:496
225
+ #, php-format
226
+ msgid "Error getting table structure of %s"
227
+ msgstr ""
228
+
229
+ #: ../wp-migrate-db.php:504
230
+ #, php-format
231
+ msgid "Data contents of table %s"
232
+ msgstr ""
233
+
234
+ #: ../wp-migrate-db.php:584
235
+ #, php-format
236
+ msgid "End of data contents of table %s"
237
+ msgstr ""
238
+
239
+ #: ../wp-migrate-db.php:668
240
+ #, php-format
241
+ msgid "Table: %s"
242
+ msgstr ""
243
+
244
+ #: ../wp-migrate-db.php:685
245
+ msgid "WordPress MySQL database migration"
246
+ msgstr ""
247
+
248
+ #: ../wp-migrate-db.php:686
249
+ #, php-format
250
+ msgid "From %s to %s"
251
+ msgstr ""
252
+
253
+ #: ../wp-migrate-db.php:688
254
+ #, php-format
255
+ msgid "Generated: %s"
256
+ msgstr ""
257
+
258
+ #: ../wp-migrate-db.php:689
259
+ #, php-format
260
+ msgid "Hostname: %s"
261
+ msgstr ""
262
+
263
+ #: ../wp-migrate-db.php:690
264
+ #, php-format
265
+ msgid "Database: %s"
266
+ msgstr ""
267
+
268
+ #: ../wp-migrate-db.php:715 ../wp-migrate-db.php:718
269
+ msgid "There was an error writing a line to the backup script:"
270
+ msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: bradt
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
4
  Tags: database, migrate, backup, mysql
5
  Requires at least: 3.0
6
- Tested up to: 3.6
7
- Stable tag: 0.4.4
8
  License: GPLv2
9
 
10
  Exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer.
@@ -60,6 +60,15 @@ It is likely you have a download manager plugin or extension installed in your w
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
 
 
 
 
63
  = 0.4.4 - 2013-05-19 =
64
  * [Pro version has arrived!](http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=wordpressorg&utm_medium=web&utm_content=changelog&utm_campaign=freeplugin) Added some info to the sidebar.
65
  * Updated required version to WordPress 3.0+
@@ -114,4 +123,4 @@ It is likely you have a download manager plugin or extension installed in your w
114
  Runs export over 4x faster and adds some nice new features often requested. Upgrade recommended.
115
 
116
  = 0.2.2 =
117
- This version fixes a bug that breaks the WordPress core export feature. It is highly recommended that everyone upgrade.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5VPMGLLK94XJC
4
  Tags: database, migrate, backup, mysql
5
  Requires at least: 3.0
6
+ Tested up to: 3.9
7
+ Stable tag: 0.5
8
  License: GPLv2
9
 
10
  Exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer.
60
 
61
  == Changelog ==
62
 
63
+ = 0.5 - 2013-07-26 =
64
+ * Language support! Thanks to an awesome [pull request](https://github.com/bradt/wp-migrate-db/pull/19) from [Rafael Funchal](https://github.com/rafaelfunchal).
65
+ * New Language: Brazilian Portugese
66
+ * [Added filter for the filename of the exported file](https://github.com/bradt/wp-migrate-db/issues/16)
67
+ * Bug fix: [Spam commentmeta included when "Do not export spam comments" checked](https://github.com/bradt/wp-migrate-db/issues/18)
68
+ * Bug fix: [Fatal error method `error` does not exist](https://github.com/bradt/wp-migrate-db/issues/20)
69
+ * Bug fix: [Table names with dashes not exporting](https://github.com/bradt/wp-migrate-db/issues/15)
70
+ * Bug fix: [Find & replace is case-sensitive but shouldn't](https://github.com/bradt/wp-migrate-db/issues/13)
71
+
72
  = 0.4.4 - 2013-05-19 =
73
  * [Pro version has arrived!](http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=wordpressorg&utm_medium=web&utm_content=changelog&utm_campaign=freeplugin) Added some info to the sidebar.
74
  * Updated required version to WordPress 3.0+
123
  Runs export over 4x faster and adds some nice new features often requested. Upgrade recommended.
124
 
125
  = 0.2.2 =
126
+ This version fixes a bug that breaks the WordPress core export feature. It is highly recommended that everyone upgrade.
wp-migrate-db.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Migrate DB
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-migrate-db/
5
  Description: Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.
6
  Author: Brad Touesnard
7
- Version: 0.4.4
8
  Author URI: http://bradt.ca/
9
  */
10
 
@@ -23,6 +23,8 @@ Author URI: http://bradt.ca/
23
  // which in turn borrowed from the phpMyAdmin project.
24
  // Thanks to both for GPL.
25
 
 
 
26
 
27
  // Define the directory seperator if it isn't already
28
  if ( !defined( 'DS' ) ) {
@@ -95,19 +97,33 @@ class WP_Migrate_DB {
95
  wp_enqueue_style( 'wp-migrate-db-styles', $src );
96
  $src = plugins_url( 'asset/js/script.js', __FILE__ );
97
  wp_enqueue_script( 'wp-migrate-db-script', $src, array( 'jquery' ), false, true );
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
 
100
  function get_filename( $datetime, $gzip ) {
101
  $hash = substr( sha1( DB_PASSWORD . AUTH_SALT ), -5 );
102
- $filename = DB_NAME . '-migrate-' . $datetime . '-' . $hash . '.sql';
 
103
  if ( $gzip ) $filename .= '.gz';
104
- return $filename;
105
  }
106
 
107
  function get_nicename( $datetime, $gzip ) {
108
- $name = DB_NAME . '-migrate-' . $datetime . '.sql';
 
109
  if ( $gzip ) $name .= '.gz';
110
- return $name;
111
  }
112
 
113
  function options_validate() {
@@ -138,7 +154,7 @@ class WP_Migrate_DB {
138
  ?>
139
 
140
  <div class="wrap">
141
- <div id="icon-tools" class="icon32"><br /></div><h2>Migrate DB</h2>
142
 
143
  <div id="wpmdb-container">
144
 
@@ -163,18 +179,20 @@ class WP_Migrate_DB {
163
  add_action( 'admin_head-settings_page_wp-migrate-db', array( $this, 'admin_head' ) );
164
  ?>
165
  <p>
166
- Your database (SQL) file has been successfully generated.
167
- Your download should begin any second.
168
  </p>
169
  <?php
170
  }
171
  else {
172
  ?>
173
  <p>
174
- Your database (SQL) file has been successfully generated and
175
- saved to <br /><?php echo $this->upload_dir . DS . $this->get_filename( $this->datetime, isset( $_POST['gzipfile'] ) ); ?>.
176
- <a href="<?php echo $this->upload_url, '/', $this->get_filename( $this->datetime, isset( $_POST['gzipfile'] ) ); ?>">Click
177
- here to download.</a>
 
 
 
178
  </p>
179
  <?php
180
  }
@@ -183,8 +201,18 @@ class WP_Migrate_DB {
183
  </div>
184
 
185
  <p>
186
- <b>Non-Serialized Strings Replaced: <?php echo $this->replaced['nonserialized']['count']; ?></b><br />
187
- <b>Serialized Strings Replaced: <?php echo $this->replaced['serialized']['count']; ?></b><br />
 
 
 
 
 
 
 
 
 
 
188
  <textarea style="width: 100%; height: 200px;" wrap="off"><?php echo $this->replaced['serialized']['strings']; ?></textarea>
189
  </p>
190
  <?php
@@ -214,8 +242,7 @@ class WP_Migrate_DB {
214
 
215
  <div id="message" class="message error">
216
  <p>
217
- The directory <?php echo $this->upload_dir; ?> needs
218
- to be writable.
219
  </p>
220
  </div>
221
 
@@ -227,8 +254,7 @@ class WP_Migrate_DB {
227
 
228
  <div id="message" class="message error">
229
  <p>
230
- Sorry, there were errors with your form submission.
231
- Please correct them below and try again.
232
  </p>
233
  </div>
234
 
@@ -237,13 +263,10 @@ class WP_Migrate_DB {
237
  ?>
238
 
239
  <p>
240
- WP Migrate DB exports your database as a MySQL data dump (much like phpMyAdmin),
241
- does a find and replace on URLs and file paths, then allows you to save
242
- it to your computer. It even takes into account serialized data and updates the
243
- string length values.
244
  </p>
245
  <p>
246
- Example: <code>s:5:"hello"</code> becomes <code>s:11:"hello world"</code>
247
  </p>
248
 
249
  <form method="post" id="migrate-form">
@@ -251,7 +274,7 @@ class WP_Migrate_DB {
251
  <tbody>
252
  <tr valign="top" class="row-old-url">
253
  <th scope="row">
254
- <label for="old_url">Current address (URL)</label>
255
  </th>
256
  <td>
257
  <input type="text" size="40" name="old_url" class="code" id="old_url" value="<?php echo htmlentities( $form_values['old_url'] ); ?>" />
@@ -260,7 +283,7 @@ class WP_Migrate_DB {
260
  </tr>
261
  <tr valign="top" class="row-new-url">
262
  <th scope="row">
263
- <label for="new_url">New address (URL)</label>
264
  </th>
265
  <td>
266
  <input type="text" size="40" name="new_url" class="code" id="new_url" value="<?php echo htmlentities( $form_values['new_url'] ); ?>" />
@@ -269,7 +292,7 @@ class WP_Migrate_DB {
269
  </tr>
270
  <tr valign="top" class="row-old-path">
271
  <th scope="row">
272
- <label for="old_path">Current file path</label>
273
  </th>
274
  <td>
275
  <input type="text" size="40" name="old_path" class="code" id="old_path" value="<?php echo htmlentities( $form_values['old_path'] ); ?>" />
@@ -278,7 +301,7 @@ class WP_Migrate_DB {
278
  </tr>
279
  <tr valign="top" class="row-new-path">
280
  <th scope="row">
281
- <label for="new_path">New file path</label>
282
  </th>
283
  <td>
284
  <input type="text" size="40" name="new_path" class="code" id="new_path" value="<?php echo htmlentities( $form_values['new_path'] ); ?>" />
@@ -286,21 +309,17 @@ class WP_Migrate_DB {
286
  </td>
287
  </tr>
288
  <tr valign="top" class="row-guids">
289
- <th scope="row">Data Options</th>
290
  <td>
291
  <label for="replace-guids">
292
  <input id="replace-guids" type="checkbox" checked="checked" value="1" name="replaceguids"/>
293
- Replace GUIDs</label>
294
 
295
- <a href="" id="replace-guids-info-link">show more</a>
296
 
297
  <div id="replace-guids-info" style="display: none;">
298
  <p>
299
- Although the <a href="http://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note" target="_blank">WordPress Codex emphasizes</a>
300
- that GUIDs should not be changed, this is limited to sites that are already live.
301
- If the site has never been live, I recommend replacing the GUIDs. For example, you may be
302
- developing a new site locally at dev.somedomain.com and want to
303
- migrate the site live to somedomain.com.
304
  </p>
305
  </div>
306
  </td>
@@ -310,7 +329,7 @@ class WP_Migrate_DB {
310
  <td>
311
  <label for="exclude-spam">
312
  <input id="exclude-spam" type="checkbox" value="1" name="exclude-spam" />
313
- Do not export spam comments
314
  </label>
315
  </td>
316
  </tr>
@@ -319,16 +338,16 @@ class WP_Migrate_DB {
319
  <td>
320
  <label for="exclude-revisions">
321
  <input id="exclude-revisions" type="checkbox" value="1" name="exclude-revisions" />
322
- Do not export post revisions
323
  </label>
324
  </td>
325
  </tr>
326
  <tr valign="top" class="row-save-file">
327
- <th scope="row">File Options</th>
328
  <td>
329
  <label for="savefile">
330
  <input id="savefile" type="checkbox" checked="checked" value="1" name="savefile"/>
331
- Save as file to your computer
332
  </label>
333
  </td>
334
  </tr>
@@ -338,7 +357,7 @@ class WP_Migrate_DB {
338
  <td>
339
  <label for="gzipfile">
340
  <input id="gzipfile" type="checkbox" value="1" name="gzipfile" />
341
- Compress file with gzip
342
  </label>
343
  </td>
344
  </tr>
@@ -347,7 +366,7 @@ class WP_Migrate_DB {
347
  </table>
348
 
349
  <p class="submit">
350
- <input class="button" type="submit" value="Export Database" name="Submit"/>
351
  </p>
352
  </form>
353
 
@@ -361,52 +380,50 @@ class WP_Migrate_DB {
361
  <div class="author">
362
  <img src="http://www.gravatar.com/avatar/e538ca4cb34839d4e5e3ccf20c37c67b?s=128&amp;d" width="64" height="64" />
363
  <div class="desc">
364
- <h3>Created &amp; maintained by</h3>
365
  <h2>Brad Touesnard</h2>
366
  <p>
367
- <a href="http://profiles.wordpress.org/bradt/">Profile</a>
368
  &nbsp;&nbsp;
369
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=5VPMGLLK94XJC">Donate</a>
370
  </p>
371
  </div>
372
  </div>
373
 
374
  <form method="post" action="http://deliciousbrains.createsend.com/t/t/s/virn/" target="_blank" class="subscribe">
375
- <h2>Pro Version Has Arrived!</h2>
376
 
377
  <a class="video" target="_blank" href="http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_campaign=freeplugin#play-intro"><img src="<?php echo plugins_url( 'asset/img/video@2x.jpg', __FILE__ ); ?>" width="250" height="164" alt="" /></a>
378
 
379
  <p class="links">
380
- <a href="http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_campaign=freeplugin" target="_blank">View Features &rarr;</a>
381
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://deliciousbrains.com/wp-migrate-db-pro/pricing/?utm_source=insideplugin&utm_medium=web&utm_campaign=freeplugin" target="_blank">View Pricing &rarr;</a>
382
  </p>
383
 
384
  <?php $user = wp_get_current_user(); ?>
385
 
386
- <h3><em>Get 20% Off!</em></h3>
387
 
388
  <p class="interesting">
389
- Subscribe to receive news &amp; updates below and we'll
390
- instantly send you a coupon code to get 20% off any WP Migrate DB Pro license.
391
  </p>
392
 
393
  <div class="field notify-name">
394
- <p>Your Name</p>
395
  <input type="text" name="cm-name" value="<?php echo trim( esc_attr( $user->first_name ) . ' ' . esc_attr( $user->last_name ) ); ?>" />
396
  </div>
397
 
398
  <div class="field notify-email">
399
- <p>Your Email</p>
400
  <input type="email" name="cm-virn-virn" value="<?php echo esc_attr( $user->user_email ); ?>" />
401
  </div>
402
 
403
  <div class="field submit-button">
404
- <input type="submit" class="button" value="Subscribe" />
405
  </div>
406
 
407
  <p class="promise">
408
- I promise I will not use your email for anything else
409
- and you can unsubscribe with <span style="white-space: nowrap;">1-click anytime</span>.
410
  </p>
411
  </form>
412
 
@@ -420,7 +437,7 @@ class WP_Migrate_DB {
420
  function apply_replaces( $subject, $is_serialized = false ) {
421
  $search = array( $_POST['old_path'], $_POST['old_url'] );
422
  $replace = array( $_POST['new_path'], $_POST['new_url'] );
423
- $new = str_replace( $search, $replace, $subject, $count );
424
 
425
  if ( $count ) {
426
  if ( $is_serialized ) {
@@ -451,9 +468,9 @@ class WP_Migrate_DB {
451
  function backup_table( $table, $segment = 'none' ) {
452
  global $wpdb;
453
 
454
- $table_structure = $wpdb->get_results( "DESCRIBE $table" );
455
  if ( ! $table_structure ) {
456
- $this->error( __( 'Error getting table details', 'wp-migrate-db' ) . ": $table" );
457
  return false;
458
  }
459
 
@@ -474,17 +491,17 @@ class WP_Migrate_DB {
474
  $this->stow( "#\n" );
475
  $this->stow( "\n" );
476
 
477
- $create_table = $wpdb->get_results( "SHOW CREATE TABLE $table", ARRAY_N );
478
  if ( false === $create_table ) {
479
  $err_msg = sprintf( __( 'Error with SHOW CREATE TABLE for %s.', 'wp-migrate-db' ), $table );
480
- $this->error( $err_msg );
481
  $this->stow( "#\n# $err_msg\n#\n" );
482
  }
483
  $this->stow( $create_table[0][1] . ' ;' );
484
 
485
  if ( false === $table_structure ) {
486
  $err_msg = sprintf( __( 'Error getting table structure of %s', 'wp-migrate-db' ), $table );
487
- $this->error( $err_msg );
488
  $this->stow( "#\n# $err_msg\n#\n" );
489
  }
490
 
@@ -524,14 +541,25 @@ class WP_Migrate_DB {
524
  $where = '';
525
  // We need ORDER BY here because with LIMIT, sometimes it will return
526
  // the same results from the previous query and we'll have duplicate insert statements
527
- if ( isset( $_POST['exclude-spam'] ) && $wpdb->comments == $table ) {
528
- $where = ' WHERE comment_approved != "spam" ORDER BY comment_ID';
 
 
 
 
 
 
 
 
529
  } elseif ( isset( $_POST['exclude-revisions'] ) && $wpdb->posts == $table ) {
530
  $where = ' WHERE post_type != "revision" ORDER BY ID';
531
  }
532
 
533
  if ( !ini_get( 'safe_mode' ) ) @set_time_limit( 15*60 );
534
- $table_data = $wpdb->get_results( "SELECT * FROM $table $where LIMIT {$row_start}, {$row_inc}", ARRAY_A );
 
 
 
535
 
536
  $entries = 'INSERT INTO ' . $this->backquote( $table ) . ' VALUES (';
537
  // \x08\\x09, not required
@@ -758,7 +786,7 @@ class WP_Migrate_DB {
758
  }
759
 
760
  function admin_menu() {
761
- $this->hookname = add_management_page( 'Migrate DB', 'Migrate DB', 'export', 'wp-migrate-db', array( $this, 'options_page' ) );
762
 
763
  add_action( 'load-' . $this->hookname , array( $this, 'handle_request' ) );
764
  }
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-migrate-db/
5
  Description: Exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer.
6
  Author: Brad Touesnard
7
+ Version: 0.5
8
  Author URI: http://bradt.ca/
9
  */
10
 
23
  // which in turn borrowed from the phpMyAdmin project.
24
  // Thanks to both for GPL.
25
 
26
+ // Load textdomain
27
+ load_plugin_textdomain( 'wp-migrate-db', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
28
 
29
  // Define the directory seperator if it isn't already
30
  if ( !defined( 'DS' ) ) {
97
  wp_enqueue_style( 'wp-migrate-db-styles', $src );
98
  $src = plugins_url( 'asset/js/script.js', __FILE__ );
99
  wp_enqueue_script( 'wp-migrate-db-script', $src, array( 'jquery' ), false, true );
100
+
101
+ $wp_migrate_db_translate_script = array(
102
+ 'show_less' => __( 'show less', 'wp-migrate-db' ),
103
+ 'show_more' => __( 'show more', 'wp-migrate-db' )
104
+ );
105
+
106
+ wp_localize_script( 'wp-migrate-db-script', 'wp_migrate_db_translate_script', $wp_migrate_db_translate_script );
107
+ }
108
+
109
+ function get_base_filename( $datetime ) {
110
+ $filename = DB_NAME . '-migrate-' . $datetime;
111
+ return apply_filters( 'wpmdb_base_filename', $filename, $datetime );
112
  }
113
 
114
  function get_filename( $datetime, $gzip ) {
115
  $hash = substr( sha1( DB_PASSWORD . AUTH_SALT ), -5 );
116
+ $filename = $this->get_base_filename( $datetime );
117
+ $filename .= '-' . $hash . '.sql';
118
  if ( $gzip ) $filename .= '.gz';
119
+ return apply_filters( 'wpmdb_filesystem_filename', $filename, $datetime, $gzip );
120
  }
121
 
122
  function get_nicename( $datetime, $gzip ) {
123
+ $name = $this->get_base_filename( $datetime );
124
+ $name .= '.sql';
125
  if ( $gzip ) $name .= '.gz';
126
+ return apply_filters( 'wpmdb_save_as_filename', $name, $datetime, $gzip );
127
  }
128
 
129
  function options_validate() {
154
  ?>
155
 
156
  <div class="wrap">
157
+ <div id="icon-tools" class="icon32"><br /></div><h2><?php _e( 'Migrate DB', 'wp-migrate-db' ); ?></h2>
158
 
159
  <div id="wpmdb-container">
160
 
179
  add_action( 'admin_head-settings_page_wp-migrate-db', array( $this, 'admin_head' ) );
180
  ?>
181
  <p>
182
+ <?php _e( 'Your database (SQL) file has been successfully generated. Your download should begin any second.', 'wp-migrate-db' ); ?>
 
183
  </p>
184
  <?php
185
  }
186
  else {
187
  ?>
188
  <p>
189
+ <?php
190
+ _e( 'Your database (SQL) file has been successfully generated and saved to', 'wp-migrate-db' );
191
+ echo '<br />';
192
+ echo $this->upload_dir . DS . $this->get_filename( $this->datetime, isset( $_POST['gzipfile'] ) );
193
+ echo '.';
194
+ ?>
195
+ <a href="<?php echo $this->upload_url, '/', $this->get_filename( $this->datetime, isset( $_POST['gzipfile'] ) ); ?>"><?php _e( 'Click here to download.', 'wp-migrate-db' ); ?></a>
196
  </p>
197
  <?php
198
  }
201
  </div>
202
 
203
  <p>
204
+ <b>
205
+ <?php
206
+ _e( 'Non-Serialized Strings Replaced:', 'wp-migrate-db');
207
+ echo $this->replaced['nonserialized']['count'];
208
+ ?>
209
+ </b><br />
210
+ <b>
211
+ <?php
212
+ _e( 'Serialized Strings Replaced:', 'wp-migrate-db');
213
+ echo $this->replaced['serialized']['count'];
214
+ ?>
215
+ </b><br />
216
  <textarea style="width: 100%; height: 200px;" wrap="off"><?php echo $this->replaced['serialized']['strings']; ?></textarea>
217
  </p>
218
  <?php
242
 
243
  <div id="message" class="message error">
244
  <p>
245
+ <?php sprintf( __('The directory %s needs to be writable.', 'wp-migrate-db'), $this->upload_dir ); ?>
 
246
  </p>
247
  </div>
248
 
254
 
255
  <div id="message" class="message error">
256
  <p>
257
+ <?php _e( 'Sorry, there were errors with your form submission. Please correct them below and try again.', 'wp-migrate-db' ); ?>
 
258
  </p>
259
  </div>
260
 
263
  ?>
264
 
265
  <p>
266
+ <?php _e( 'WP Migrate DB exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, then allows you to save it to your computer. It even takes into account serialized data and updates the string length values.', 'wp-migrate-db' ); ?>
 
 
 
267
  </p>
268
  <p>
269
+ <?php _e( 'Example: <code>s:5:"hello"</code> becomes <code>s:11:"hello world"</code>', 'wp-migrate-db' ); ?>
270
  </p>
271
 
272
  <form method="post" id="migrate-form">
274
  <tbody>
275
  <tr valign="top" class="row-old-url">
276
  <th scope="row">
277
+ <label for="old_url"><?php _e( 'Current address (URL)', 'wp-migrate-db' ); ?></label>
278
  </th>
279
  <td>
280
  <input type="text" size="40" name="old_url" class="code" id="old_url" value="<?php echo htmlentities( $form_values['old_url'] ); ?>" />
283
  </tr>
284
  <tr valign="top" class="row-new-url">
285
  <th scope="row">
286
+ <label for="new_url"><?php _e( 'New address (URL)', 'wp-migrate-db' ); ?></label>
287
  </th>
288
  <td>
289
  <input type="text" size="40" name="new_url" class="code" id="new_url" value="<?php echo htmlentities( $form_values['new_url'] ); ?>" />
292
  </tr>
293
  <tr valign="top" class="row-old-path">
294
  <th scope="row">
295
+ <label for="old_path"><?php _e( 'Current file path', 'wp-migrate-db' ); ?></label>
296
  </th>
297
  <td>
298
  <input type="text" size="40" name="old_path" class="code" id="old_path" value="<?php echo htmlentities( $form_values['old_path'] ); ?>" />
301
  </tr>
302
  <tr valign="top" class="row-new-path">
303
  <th scope="row">
304
+ <label for="new_path"><?php _e( 'New file path', 'wp-migrate-db' ); ?></label>
305
  </th>
306
  <td>
307
  <input type="text" size="40" name="new_path" class="code" id="new_path" value="<?php echo htmlentities( $form_values['new_path'] ); ?>" />
309
  </td>
310
  </tr>
311
  <tr valign="top" class="row-guids">
312
+ <th scope="row"><?php _e( 'Data Options', 'wp-migrate-db' ); ?></th>
313
  <td>
314
  <label for="replace-guids">
315
  <input id="replace-guids" type="checkbox" checked="checked" value="1" name="replaceguids"/>
316
+ <?php _e( 'Replace GUIDs', 'wp-migrate-db' ); ?></label>
317
 
318
+ <a href="" id="replace-guids-info-link"><?php _e( 'show more', 'wp-migrate-db' ); ?></a>
319
 
320
  <div id="replace-guids-info" style="display: none;">
321
  <p>
322
+ <?php echo sprintf( __( 'Although the <a href="%s" target="_blank">WordPress Codex emphasizes</a> that GUIDs should not be changed, this is limited to sites that are already live. If the site has never been live, I recommend replacing the GUIDs. For example, you may be developing a new site locally at dev.somedomain.com and want to migrate the site live to somedomain.com.', 'wp-migrate-db' ), 'http://codex.wordpress.org/Changing_The_Site_URL#Important_GUID_Note' ); ?>
 
 
 
 
323
  </p>
324
  </div>
325
  </td>
329
  <td>
330
  <label for="exclude-spam">
331
  <input id="exclude-spam" type="checkbox" value="1" name="exclude-spam" />
332
+ <?php _e( 'Do not export spam comments', 'wp-migrate-db' ); ?>
333
  </label>
334
  </td>
335
  </tr>
338
  <td>
339
  <label for="exclude-revisions">
340
  <input id="exclude-revisions" type="checkbox" value="1" name="exclude-revisions" />
341
+ <?php _e( 'Do not export post revisions', 'wp-migrate-db' ); ?>
342
  </label>
343
  </td>
344
  </tr>
345
  <tr valign="top" class="row-save-file">
346
+ <th scope="row"><?php _e( 'File Options', 'wp-migrate-db' ); ?></th>
347
  <td>
348
  <label for="savefile">
349
  <input id="savefile" type="checkbox" checked="checked" value="1" name="savefile"/>
350
+ <?php _e( 'Save as file to your computer', 'wp-migrate-db' ); ?>
351
  </label>
352
  </td>
353
  </tr>
357
  <td>
358
  <label for="gzipfile">
359
  <input id="gzipfile" type="checkbox" value="1" name="gzipfile" />
360
+ <?php _e( 'Compress file with gzip', 'wp-migrate-db' ); ?>
361
  </label>
362
  </td>
363
  </tr>
366
  </table>
367
 
368
  <p class="submit">
369
+ <input class="button" type="submit" value="<?php _e( 'Export Database', 'wp-migrate-db' ); ?>" name="Submit"/>
370
  </p>
371
  </form>
372
 
380
  <div class="author">
381
  <img src="http://www.gravatar.com/avatar/e538ca4cb34839d4e5e3ccf20c37c67b?s=128&amp;d" width="64" height="64" />
382
  <div class="desc">
383
+ <h3><?php _e( 'Created &amp; maintained by', 'wp-migrate-db' ); ?></h3>
384
  <h2>Brad Touesnard</h2>
385
  <p>
386
+ <a href="http://profiles.wordpress.org/bradt/" target="_blank"><?php _e( 'Profile', 'wp-migrate-db' ); ?></a>
387
  &nbsp;&nbsp;
388
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=5VPMGLLK94XJC" target="_blank"><?php _e( 'Donate', 'wp-migrate-db' ); ?></a>
389
  </p>
390
  </div>
391
  </div>
392
 
393
  <form method="post" action="http://deliciousbrains.createsend.com/t/t/s/virn/" target="_blank" class="subscribe">
394
+ <h2><?php _e( 'Pro Version Has Arrived!', 'wp-migrate-db' ); ?></h2>
395
 
396
  <a class="video" target="_blank" href="http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_campaign=freeplugin#play-intro"><img src="<?php echo plugins_url( 'asset/img/video@2x.jpg', __FILE__ ); ?>" width="250" height="164" alt="" /></a>
397
 
398
  <p class="links">
399
+ <a href="http://deliciousbrains.com/wp-migrate-db-pro/?utm_source=insideplugin&utm_medium=web&utm_campaign=freeplugin" target="_blank"><?php _e( 'View Features &rarr;', 'wp-migrate-db' ); ?></a>
400
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://deliciousbrains.com/wp-migrate-db-pro/pricing/?utm_source=insideplugin&utm_medium=web&utm_campaign=freeplugin" target="_blank"><?php _e( 'View Pricing &rarr;', 'wp-migrate-db' ); ?></a>
401
  </p>
402
 
403
  <?php $user = wp_get_current_user(); ?>
404
 
405
+ <h3><em><?php _e( 'Get 20% Off!', 'wp-migrate-db' ); ?></em></h3>
406
 
407
  <p class="interesting">
408
+ <?php _e( 'Subscribe to receive news &amp; updates below and we\'ll instantly send you a coupon code to get 20% off any WP Migrate DB Pro license.', 'wp-migrate-db' ); ?>
 
409
  </p>
410
 
411
  <div class="field notify-name">
412
+ <p><?php _e( 'Your Name', 'wp-migrate-db' ); ?></p>
413
  <input type="text" name="cm-name" value="<?php echo trim( esc_attr( $user->first_name ) . ' ' . esc_attr( $user->last_name ) ); ?>" />
414
  </div>
415
 
416
  <div class="field notify-email">
417
+ <p><?php _e( 'Your Email', 'wp-migrate-db' ); ?></p>
418
  <input type="email" name="cm-virn-virn" value="<?php echo esc_attr( $user->user_email ); ?>" />
419
  </div>
420
 
421
  <div class="field submit-button">
422
+ <input type="submit" class="button" value="<?php _e( 'Subscribe', 'wp-migrate-db' ); ?>" />
423
  </div>
424
 
425
  <p class="promise">
426
+ <?php _e( 'I promise I will not use your email for anything else and you can unsubscribe with <span style="white-space: nowrap;">1-click anytime</span>.', 'wp-migrate-db' ); ?>
 
427
  </p>
428
  </form>
429
 
437
  function apply_replaces( $subject, $is_serialized = false ) {
438
  $search = array( $_POST['old_path'], $_POST['old_url'] );
439
  $replace = array( $_POST['new_path'], $_POST['new_url'] );
440
+ $new = str_ireplace( $search, $replace, $subject, $count );
441
 
442
  if ( $count ) {
443
  if ( $is_serialized ) {
468
  function backup_table( $table, $segment = 'none' ) {
469
  global $wpdb;
470
 
471
+ $table_structure = $wpdb->get_results( "DESCRIBE " . $this->backquote( $table ) );
472
  if ( ! $table_structure ) {
473
+ $this->errors['describe'] = __( 'Error getting table details', 'wp-migrate-db' ) . ": $table";
474
  return false;
475
  }
476
 
491
  $this->stow( "#\n" );
492
  $this->stow( "\n" );
493
 
494
+ $create_table = $wpdb->get_results( "SHOW CREATE TABLE " . $this->backquote( $table ), ARRAY_N );
495
  if ( false === $create_table ) {
496
  $err_msg = sprintf( __( 'Error with SHOW CREATE TABLE for %s.', 'wp-migrate-db' ), $table );
497
+ $this->errors['show_create'] = $err_msg;
498
  $this->stow( "#\n# $err_msg\n#\n" );
499
  }
500
  $this->stow( $create_table[0][1] . ' ;' );
501
 
502
  if ( false === $table_structure ) {
503
  $err_msg = sprintf( __( 'Error getting table structure of %s', 'wp-migrate-db' ), $table );
504
+ $this->errors['table_structure'] = $err_msg;
505
  $this->stow( "#\n# $err_msg\n#\n" );
506
  }
507
 
541
  $where = '';
542
  // We need ORDER BY here because with LIMIT, sometimes it will return
543
  // the same results from the previous query and we'll have duplicate insert statements
544
+ if ( isset( $_POST['exclude-spam'] ) ) {
545
+ if ( $wpdb->comments == $table ) {
546
+ $where = ' WHERE comment_approved != "spam" ORDER BY comment_ID';
547
+ }
548
+ elseif ( $wpdb->commentmeta == $table ) {
549
+ $where = sprintf( ' INNER JOIN %1$s
550
+ ON %1$s.comment_ID = %2$s.comment_id AND %1$s.comment_approved != \'spam\'
551
+ ORDER BY %2$s.meta_id',
552
+ $this->backquote( $wpdb->comments ), $this->backquote( $wpdb->commentmeta ) );
553
+ }
554
  } elseif ( isset( $_POST['exclude-revisions'] ) && $wpdb->posts == $table ) {
555
  $where = ' WHERE post_type != "revision" ORDER BY ID';
556
  }
557
 
558
  if ( !ini_get( 'safe_mode' ) ) @set_time_limit( 15*60 );
559
+
560
+ $sql = "SELECT " . $this->backquote( $table ) . ".* FROM " . $this->backquote( $table ) . " $where LIMIT {$row_start}, {$row_inc}";
561
+
562
+ $table_data = $wpdb->get_results( $sql, ARRAY_A );
563
 
564
  $entries = 'INSERT INTO ' . $this->backquote( $table ) . ' VALUES (';
565
  // \x08\\x09, not required
786
  }
787
 
788
  function admin_menu() {
789
+ $this->hookname = add_management_page( __( 'Migrate DB', 'wp-migrate-db'), __( 'Migrate DB', 'wp-migrate-db'), 'export', 'wp-migrate-db', array( $this, 'options_page' ) );
790
 
791
  add_action( 'load-' . $this->hookname , array( $this, 'handle_request' ) );
792
  }