Search & Replace - Version 3.0.0

Version Description

Download this release

Release Info

Developer Bueltge
Plugin Icon 128x128 Search & Replace
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.7.1 to 3.0.0

assets/css/inpsyde-search-replace.css ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ input[name="search"], input[name="replace"], #select_tables {
2
+ width: 100%;
3
+ max-width: 400px;
4
+ }
5
+
6
+ .search-replace-search-value {
7
+ color: #fff;
8
+ background-color: red;
9
+ }
10
+
11
+ .search-replace-replace-value {
12
+ color: #fff;
13
+ background-color: green;
14
+
15
+ }
16
+
17
+ .disabled, .form-table .disabled th {
18
+ color: grey;
19
+
20
+ }
21
+
22
+
23
+ /*width of file upload input on import page */
24
+ #file_to_upload {
25
+ width: 100%;
26
+ }
27
+
28
+ /*styles for "detailed view" modal */
29
+ .search-replace-modal-background {
30
+ position: fixed;
31
+ top: 0;
32
+ left: 0;
33
+ right: 0;
34
+ bottom: 0;
35
+ min-height: 360px;
36
+ background: #000;
37
+ opacity: .7;
38
+ z-index: 159900;
39
+ }
40
+
41
+ .search-replace-modal {
42
+ position: fixed;
43
+ top: 30px;
44
+ left: 30px;
45
+ right: 30px;
46
+ bottom: 30px;
47
+ z-index: 160000;
48
+ background-color: #fff;
49
+ overflow: hidden;
50
+ }
51
+
52
+ .search-replace-modal-header .notice-dismiss {
53
+ padding: 5px 1px;
54
+ }
55
+
56
+ .search-replace-changes-modal-content {
57
+ position: absolute;
58
+ overflow: auto;
59
+ height: 100%;
60
+ top: 50px;
61
+ }
62
+
63
+ .search-replace-modal-table {
64
+ width: 100%;
65
+ table-layout: fixed;
66
+ margin-bottom: 30px;
67
+
68
+ }
69
+
70
+ .search-replace-modal-table * {
71
+ word-wrap: break-word;
72
+ vertical-align: baseline;
73
+ }
74
+
75
+ .search-replace-modal-table col:nth-child(1) {
76
+ width: 50px;
77
+ }
78
+
79
+ .search-replace-modal-table col:nth-child(2) {
80
+ width: 35px;
81
+ }
82
+
83
+ .search-replace-modal-table col:nth-child(3) {
84
+ width: 100px;
85
+ }
86
+
87
+ .search-replace-modal-table col:nth-child(4) {
88
+ width: 150px;
89
+ }
90
+
91
+ .search-replace-modal-table col:nth-child(5) {
92
+ width: 100px;
93
+ }
94
+
95
+ .search-replace-modal-table col:nth-child(7) {
96
+ width: 100px;
97
+ }
98
+
99
+ .search-replace-modal-table tr:nth-child(odd) {
100
+ background-color: #eee;
101
+ }
102
+
103
+ .search-replace-modal-table-headline {
104
+ margin-left: 10px;
105
+ font-weight: 300;
106
+ }
107
+
108
+ .search-replace-modal-close-button {
109
+ float: right;
110
+ background: #fff;
111
+ border: none;
112
+ padding: 15px;
113
+ }
114
+
115
+ .search-replace-modal-close-button:before {
116
+ content: "\f158";
117
+ font: 400 20px/1 dashicons;
118
+ vertical-align: middle;
119
+ -webkit-font-smoothing: antialiased;
120
+ -moz-osx-font-smoothing: grayscale;
121
+ color: #666;
122
+
123
+ }
124
+
125
+ #insr_submit{
126
+ margin-bottom: 10px;
127
+ }
assets/css/inpsyde-search-replace.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #select_tables,input[name=search],input[name=replace]{width:100%;max-width:400px}.search-replace-search-value{color:#fff;background-color:red}.search-replace-replace-value{color:#fff;background-color:green}.disabled,.form-table .disabled th{color:grey}#file_to_upload{width:100%}.search-replace-modal-background{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:159900}.search-replace-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000;background-color:#fff;overflow:hidden}.search-replace-modal-header .notice-dismiss{padding:5px 1px}.search-replace-changes-modal-content{position:absolute;overflow:auto;height:100%;top:50px}.search-replace-modal-table{width:100%;table-layout:fixed;margin-bottom:30px}.search-replace-modal-table *{word-wrap:break-word;vertical-align:baseline}.search-replace-modal-table col:nth-child(1){width:50px}.search-replace-modal-table col:nth-child(2){width:35px}.search-replace-modal-table col:nth-child(3){width:100px}.search-replace-modal-table col:nth-child(4){width:150px}.search-replace-modal-table col:nth-child(5),.search-replace-modal-table col:nth-child(7){width:100px}.search-replace-modal-table tr:nth-child(odd){background-color:#eee}.search-replace-modal-table-headline{margin-left:10px;font-weight:300}.search-replace-modal-close-button{float:right;background:#fff;border:none;padding:15px}.search-replace-modal-close-button:before{content:"\f158";font:400 20px/1 dashicons;vertical-align:middle;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#666}#insr_submit{margin-bottom:10px}
assets/js/inpsyde-search-replace.js ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * javascript for inpsyde search and replace plugin
3
+ */
4
+ "use strict";
5
+
6
+ jQuery( document ).ready( function() {
7
+
8
+ (
9
+ function( $ ) {
10
+ //search-replace-tab: greys out export/save to db option when dry run is selected
11
+ $( '#dry_run' ).click( toggle_disabled_attribute );
12
+
13
+ //replace-domain-tab: greys out replace db_prefix option
14
+ $ ('#change_db_prefix' ).click (toggle_disabled_attribute);
15
+
16
+ function toggle_disabled_attribute() {
17
+
18
+ var grayed_out_areas = $( '.maybe_disabled' );
19
+ grayed_out_areas.toggleClass( 'disabled' );
20
+ var inputs = (
21
+ $( '.maybe_disabled input' )
22
+ );
23
+
24
+ if ( inputs.attr( 'disabled' ) ) {
25
+ inputs.removeAttr( 'disabled' );
26
+ }
27
+
28
+ else {
29
+ inputs.attr( 'disabled', true );
30
+ }
31
+
32
+ }
33
+
34
+ //click on checkbox selects all tables in table select on search and replace tab
35
+ var table_select_checkbox = $( '#select_all_tables' );
36
+ table_select_checkbox.change( toggle_select_all_tables );
37
+
38
+ function toggle_select_all_tables( e ) {
39
+ console.log( e );
40
+ if ( table_select_checkbox.is( ':checked' ) ) {
41
+ $( '#select_tables option' ).attr( 'selected', true );
42
+ }
43
+ else {
44
+ $( '#select_tables option' ).attr( 'selected', false );
45
+ }
46
+
47
+ }
48
+
49
+ //event listener for changes modal
50
+ $( '#changes-modal-button' ).click( show_changes_modal );
51
+ $( '#changes-modal-close' ).click( hide_changes_modal );
52
+
53
+ function show_changes_modal() {
54
+ $( '#changes-modal, #changes-modal-background' ).show();
55
+ //add listener for close with "esc" - key
56
+ $( document ).bind( 'keydown', keydown_event_handler );
57
+ }
58
+
59
+ function hide_changes_modal() {
60
+ $( '#changes-modal, #changes-modal-background' ).hide();
61
+ }
62
+
63
+ function keydown_event_handler( e ) {
64
+ if ( e.keyCode === 27 ) {
65
+ hide_changes_modal();
66
+ $( document ).unbind( 'keydown', keydown_event_handler )
67
+ }
68
+ }
69
+ }
70
+ )( jQuery );
71
+
72
+ } );
assets/js/inpsyde-search-replace.min.js ADDED
@@ -0,0 +1 @@
 
1
+ "use strict";jQuery(document).ready(function(){!function(a){function b(){var b=a(".maybe_disabled");b.toggleClass("disabled");var c=a(".maybe_disabled input");c.attr("disabled")?c.removeAttr("disabled"):c.attr("disabled",!0)}function c(b){console.log(b),g.is(":checked")?a("#select_tables option").attr("selected",!0):a("#select_tables option").attr("selected",!1)}function d(){a("#changes-modal, #changes-modal-background").show(),a(document).bind("keydown",f)}function e(){a("#changes-modal, #changes-modal-background").hide()}function f(b){27===b.keyCode&&(e(),a(document).unbind("keydown",f))}a("#dry_run").click(b),a("#change_db_prefix").click(b);var g=a("#select_all_tables");g.change(c),a("#changes-modal-button").click(d),a("#changes-modal-close").click(e)}(jQuery)});
inc/Admin.php ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Inpsyde\SearchReplace\inc;
4
+
5
+ class Admin {
6
+
7
+ /**
8
+ * @var DatabaseManager
9
+ * stores instance of DatabaseManager
10
+ */
11
+ protected $dbm;
12
+
13
+ /**
14
+ * @var DatabaseExporter
15
+ */
16
+ protected $dbe;
17
+
18
+ /**
19
+ * @var DatabaseImporter
20
+ */
21
+ protected $dbi;
22
+
23
+ /**
24
+ * @var Replace
25
+ */
26
+ protected $replace;
27
+
28
+ /**
29
+ * @var \WP_Error
30
+ */
31
+ protected $errors;
32
+
33
+ /**
34
+ * Admin constructor.
35
+ */
36
+ public function __construct() {
37
+
38
+ $this->dbm = new DatabaseManager();
39
+ $this->replace = new Replace( $this->dbm );
40
+ $this->dbe = new DatabaseExporter( $this->replace, $this->dbm );
41
+ $this->dbi = new DatabaseImporter();
42
+ $this->errors = new \WP_Error();
43
+
44
+ //if "download" was selected we have to check that early to prevent "headers already sent" error
45
+ $this->add_file_download_action();
46
+
47
+ }
48
+
49
+ /**
50
+ * Checks input, creates a sql backup file, shows changes and download button.
51
+ *
52
+ * @param $search
53
+ * @param $replace
54
+ * @param $tables
55
+ * @param bool $domain_replace
56
+ * @param string $new_table_prefix
57
+ */
58
+ protected function create_backup_file( $search, $replace, $tables, $domain_replace = FALSE, $new_table_prefix = '' ) {
59
+
60
+ $report = $this->dbe->db_backup( $search, $replace, $tables, $domain_replace, $new_table_prefix );
61
+ if ( $search !== '' && $search !== $replace ) {
62
+ echo '<div class="updated notice is-dismissible">';
63
+ //show changes if there are any
64
+ if ( count( $report[ 'changes' ] ) > 0 ) {
65
+ $this->show_changes( $report );
66
+ }
67
+
68
+ //if no changes found report that
69
+ if ( 0 === count( $report [ 'changes' ] ) ) {
70
+ echo '<p>' . esc_html__( 'Search pattern not found.', 'insr' ) . '</p>';
71
+ }
72
+
73
+ echo '</div>';
74
+ }
75
+
76
+ $compress = (bool) ( isset( $_POST[ 'compress' ] ) && 'on' === $_POST[ 'compress' ] );
77
+
78
+ $this->show_download_button( $report[ 'filename' ], $compress );
79
+
80
+ }
81
+
82
+ /**
83
+ * displays the changes made to the db
84
+ * echoes the changes in formatted html
85
+ *
86
+ * @param $report array 'errors' : WP-Error Object if Errors
87
+ * 'tables' : Number of tables processed
88
+ * 'changes_count' : Number of changes made
89
+ * 'changes'
90
+ * Array with at least these elements:
91
+ * 'table_name'=>$[name of current table],
92
+ * 'changes' => array('row' => [row that has been changed ],
93
+ * 'column' => [column that has been changed],
94
+ * 'from' => ( old value ),
95
+ * 'to' => ( $new value ),
96
+ *
97
+ * @return string
98
+ */
99
+
100
+ protected function show_changes( $report ) {
101
+
102
+ //get search & replace values in order to highlight them in the results
103
+ $search = esc_html( $_POST [ 'search' ] );
104
+ $search_highlight = '<span class="search-replace-search-value">' . $search . '</span>';
105
+ $replace = esc_html( $_POST [ 'replace' ] );
106
+ $replace_highlight = '<span class ="search-replace-replace-value">' . $replace . '</span>';
107
+ $delimiter = array( ' ...', '...<br>' );
108
+
109
+ $msg = sprintf(
110
+ _n(
111
+ '%s table was processed.',
112
+ '%s tables were processed.',
113
+ $report[ 'tables' ],
114
+ 'insr'
115
+ ),
116
+ $report[ 'tables' ]
117
+ );
118
+
119
+ $msg .= sprintf(
120
+ _n(
121
+ '%s cell needs to be updated.',
122
+ '%s cells need to be updated.',
123
+ $report[ 'changes_count' ],
124
+ 'insr'
125
+ ),
126
+ $report[ 'changes_count' ]
127
+ );
128
+ echo esc_html( $msg );
129
+
130
+ //create modal window for detailed view of changes
131
+ ?>
132
+ <p><a href="#" id="changes-modal-button"><?php esc_html_e( 'View details', 'insr' ); ?></a></p>
133
+ <div id="changes-modal-background" class="search-replace-modal-background" style="display: none;"></div>
134
+ <div id="changes-modal" class="search-replace-modal " style="display: none;">
135
+ <div class="search-replace-modal-header">
136
+ <button type="button" id="changes-modal-close" class="search-replace-modal-close-button"></button>
137
+ </div>
138
+ <div class="search-replace-changes-modal-content">
139
+ <?php
140
+ foreach ( $report[ 'changes' ] as $table_report ) {
141
+ $changes = $table_report[ 'changes' ];
142
+ $changes_made = count( $changes );
143
+
144
+ if ( $changes_made > 0 ) {
145
+ $table = $table_report[ 'table_name' ];
146
+ $html = '<h2 class = "search-replace-modal-table-headline">';
147
+ $html .= '<strong>' . esc_attr__( 'Table:', 'insr' ) . '</strong> ' . $table;
148
+ $html .= '<strong>' . esc_attr__( 'Changes:', 'insr' ) . '</strong> ' . $changes_made;
149
+ $html .= '</h2>';
150
+
151
+ $html .= '<table class="search-replace-modal-table"><colgroup><col><col><col><col><col><col><col><col></colgroup>';
152
+
153
+ foreach ( $changes as $change ) {
154
+
155
+ $html .= '<tr>';
156
+ $html .= '<th class="search-replace-narrow">' . __( 'row', 'insr' ) . '</th>
157
+ <td class="search-replace-narrow">' . $change [ 'row' ] . '</td>
158
+ <th> ' . __( 'column', 'insr' ) . '</th>
159
+ <td>' . $change [ 'column' ] . '</td> ';
160
+
161
+ //trim results and wrap with highlight class
162
+ $old_value = esc_html( $change [ 'from' ] );
163
+ $old_value = $this->trim_search_results( $search, $old_value, $delimiter );
164
+ $old_value = str_replace( $search, $search_highlight, $old_value );
165
+
166
+ $new_value = esc_html( $change[ 'to' ] );
167
+ $new_value = $this->trim_search_results( $replace, $new_value, $delimiter );
168
+ $new_value = str_replace( $replace, $replace_highlight, $new_value );
169
+
170
+ $html .= '<th>' . __( 'Old value:', 'insr' ) . '</th>
171
+ <td>' . $old_value . '</td>
172
+ <th> ' . __( 'New value:', 'insr' ) . '</th><td>' . $new_value . '</td>';
173
+ $html .= '</tr>';
174
+ }
175
+ $html .= '</table>';
176
+
177
+ echo $html;
178
+ }
179
+ }
180
+
181
+ echo '</div></div>';
182
+ }
183
+
184
+ /**
185
+ * @param void
186
+ *
187
+ * @return null
188
+ * calls the file delivery in Class DatabaseExporter
189
+ */
190
+ public function deliver_backup_file() {
191
+
192
+ if ( isset( $_POST[ 'action' ] ) && 'download_file' === $_POST[ 'action' ] ) {
193
+
194
+ $sql_file = '';
195
+ if ( isset( $_POST[ 'sql_file' ] ) ) {
196
+ $sql_file = $_POST[ 'sql_file' ];
197
+ }
198
+
199
+ $compress = FALSE;
200
+ if ( isset( $_POST[ 'compress' ] ) ) {
201
+ $compress = $_POST[ 'compress' ];
202
+ }
203
+
204
+ // If file name contains path or does not end with '.sql' exit.
205
+ $ext = strrchr( $sql_file, '.' );
206
+ if ( FALSE !== strpos( $sql_file, '/' ) || '.sql' !== $ext ) {
207
+ die;
208
+ }
209
+ $this->dbe->deliver_backup( $sql_file, $compress );
210
+ }
211
+
212
+ }
213
+
214
+ /**
215
+ * creates an input element to start the download of the sql file
216
+ *
217
+ * @param $file String The name of the file to be downloaded
218
+ * @param $compress Boolean Set true if gz compression should be used
219
+ */
220
+ protected function show_download_button( $file, $compress ) {
221
+
222
+ echo '<div class="updated notice is-dismissible insr_sql_button_wrap"><p>';
223
+ esc_attr_e( 'Your SQL file was created!', 'insr' );
224
+ echo '</p><form action method="post">';
225
+ wp_nonce_field( 'download_sql', 'insr_nonce' );
226
+ $value = translate( 'Download SQL File', 'insr' );
227
+
228
+ $html = '<input type="hidden" name="action" value="download_file" />';
229
+ $html .= '<input type ="hidden" name="sql_file" value="' . esc_attr( $file ) . '">';
230
+ $html .= '<input type ="hidden" name="compress" value="' . esc_attr( $compress ) . '">';
231
+ $html .= '<input id ="insr_submit" type="submit" value="' . esc_attr( $value ) . '" class="button" />';
232
+ $html .= '</form></div>';
233
+ echo $html;
234
+ }
235
+
236
+ /**
237
+ * Echoes the content of the $errors array as formatted HTML if it contains error messages.
238
+ */
239
+ protected function display_errors() {
240
+
241
+ $messages = $this->errors->get_error_messages();
242
+ if ( count( $messages ) > 0 ) {
243
+
244
+ echo '<div class="error notice is-dismissible"><strong>' . esc_html__( 'Errors:',
245
+ 'insr' ) . '</strong><ul>';
246
+
247
+ foreach ( $messages as $error ) {
248
+ echo '<li>' . esc_html( $error ) . '</li>';
249
+ }
250
+ echo '</ul></div>';
251
+ }
252
+ }
253
+
254
+ /**
255
+ * Adds the action to "deliver backup file" on "init" to prevent "header already sent" error.
256
+ */
257
+ private function add_file_download_action() {
258
+
259
+ add_action( 'init', array( $this, 'deliver_backup_file' ) );
260
+ }
261
+
262
+ /**
263
+ * Returns the site url, strips http:// or https://
264
+ */
265
+ protected function get_stripped_site_url() {
266
+
267
+ $url = get_site_url();
268
+
269
+ return substr( $url, strpos( $url, '/' ) + 2 );
270
+ }
271
+
272
+ /**
273
+ * Trims a given string to 50 chars before and after the search string, if the string is longer than 199 chars.
274
+ *
275
+ * @param $needle string
276
+ * @param $haystack string
277
+ * @param $delimiter array $delimiter[0]=start delimiter, $delimiter[1] = end delimiter
278
+ *
279
+ * @return string The trimmed $haystack
280
+ */
281
+ protected function trim_search_results( $needle, $haystack, $delimiter ) {
282
+
283
+ //if result has <200 characters we return the whole string
284
+ if ( strlen( $haystack ) < 100 ) {
285
+ return $haystack;
286
+ }
287
+
288
+ $trimmed_results = NULL;
289
+ // Get all occurrences of $needle with up to 50 chars front & back.
290
+ preg_match_all( '@.{0,50}' . $needle . '.{0,50}@', $haystack, $trimmed_results );
291
+ $return_value = '';
292
+ /** @var array $trimmed_results */
293
+ $imax = count( $trimmed_results );
294
+ for ( $i = 0; $i < $imax; $i ++ ) {
295
+ //reset delimiter, might have been changed
296
+ $local_delimiter = $delimiter;
297
+ //check if the first trimmmed result is the beginning of $haystack. if so remove leading delimiter
298
+ if ( $i === 0 ) {
299
+ $pos = strpos( $haystack, $trimmed_results[ 0 ][ $i ] );
300
+ if ( $pos === 0 ) {
301
+ $local_delimiter[ 0 ] = '';
302
+ }
303
+ }
304
+
305
+ //check if the last trimmed result is the end of $haystack. if so, remove trailing delimiter
306
+ $last_index = count( $trimmed_results ) - 1;
307
+ if ( $i === $last_index ) {
308
+ $trimmed_result_length = strlen( $trimmed_results[ 0 ][ $i ] );
309
+ $substring = substr( $haystack, - $trimmed_result_length );
310
+ if ( $substring === $trimmed_results[ 0 ][ $i ] ) {
311
+ $local_delimiter[ 1 ] = '';
312
+ }
313
+
314
+ }
315
+ $return_value .= $local_delimiter[ 0 ] . $trimmed_results[ 0 ][ $i ] . $local_delimiter[ 1 ];
316
+ }
317
+
318
+ return $return_value;
319
+ }
320
+
321
+ }
inc/Autoloader.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Inpsyde\searchReplace\inc;
4
+
5
+ /**
6
+ * PSR-4 Autoloader Implementation
7
+ * Usage:
8
+ * $autoloader = new \Inpsyde\[Core | inc | YourClassDirectory ]\Autoloader( __NAMESPACE__, __DIR__ );
9
+ * $autoloader->register();
10
+ * To function Classes and Files need to share the exact same name,
11
+ * e.g. The file for the class "FooBar" must be named "FooBar.php"
12
+ *
13
+ * @author Andre Peiffer, Sven Hinse
14
+ * @version 2016-01-28
15
+ * @package inc
16
+ */
17
+
18
+ class Autoloader {
19
+
20
+ /**
21
+ * Base namespace
22
+ *
23
+ * @access private
24
+ * @var string
25
+ */
26
+ private $_namespace;
27
+
28
+ /**
29
+ * location to load classes from
30
+ *
31
+ * @access private
32
+ * @var string
33
+ */
34
+ private $_basepath;
35
+
36
+ /**
37
+ * the file extension to load
38
+ *
39
+ * @access private
40
+ * @var string
41
+ */
42
+ private $_extension;
43
+
44
+ /**
45
+ * Creates a new Autoloader Instance.
46
+ *
47
+ * @param string $namespace basenamespace
48
+ * @param string $path basepath
49
+ * @param string $extension file extension to load
50
+ */
51
+ public function __construct( $namespace, $path, $extension = '.php' ) {
52
+
53
+ //Normalize basenamespace and basepath
54
+ $this->_namespace = trim( $namespace, '\\' ) . '\\';
55
+ $this->_basepath = rtrim( $path, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR;
56
+ $this->_extension = $extension;
57
+ }
58
+
59
+ /**
60
+ * Registers the autoloader.
61
+ *
62
+ * @return $this
63
+ */
64
+ public function register() {
65
+
66
+ spl_autoload_register( array( $this, 'autoload' ) );
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * Unregisters the autoloader.
72
+ *
73
+ * @return $this instance
74
+ */
75
+ public function unregister() {
76
+
77
+ spl_autoload_unregister( array( $this, 'autoload' ) );
78
+ return $this;
79
+ }
80
+
81
+ /**
82
+ * @param $class
83
+ *
84
+ * @return bool|string Path to class on success, false on failure
85
+ * @throws \Exception if Class does not exist in Namespace
86
+ */
87
+ public function autoload( $class ) {
88
+
89
+ //only include plugin classes at this point
90
+ if ( strpos( $class, $this->_namespace ) === FALSE ) {
91
+ return FALSE;
92
+ } else {
93
+
94
+ //cut off the Base Namespace including the backslash
95
+ $pos = strpos( $this->_namespace, '\\' );
96
+ $class = substr( $class, $pos + 1 );
97
+
98
+ //cut off the second part of namespace before the backslash, plugin directory may have another name
99
+ $pos = strpos( $class, '\\' );
100
+ $class = substr( $class, $pos );
101
+
102
+ //build path
103
+ $filename = $this->_basepath . str_replace( '\\', DIRECTORY_SEPARATOR, $class ) . $this->_extension;
104
+ if ( file_exists( $filename ) ) {
105
+ require_once( $filename );
106
+
107
+ return $filename;
108
+ } else {
109
+ throw new \Exception( 'Class ' . $class . ' not found in ' . $filename );
110
+
111
+ }
112
+
113
+ }
114
+ }
115
+
116
+ }
inc/CreditsAdmin.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Load credits template.
4
+ */
5
+
6
+ namespace Inpsyde\SearchReplace\inc;
7
+
8
+ class CreditsAdmin extends Admin {
9
+
10
+ /**
11
+ * Callback function for credits content.
12
+ */
13
+ public function show_page() {
14
+
15
+ require_once( 'templates/credits.php' );
16
+ }
17
+
18
+ }
inc/DatabaseExporter.php ADDED
@@ -0,0 +1,549 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Handles export of DB.
4
+ * adapted from https://github.com/matzko/wp-db-backup
5
+ */
6
+
7
+ namespace Inpsyde\SearchReplace\inc;
8
+
9
+ class DatabaseExporter {
10
+
11
+ /**
12
+ * @Stores all error messages in a WP_Error Object
13
+ */
14
+ protected $errors;
15
+ /**
16
+ * @string The Path to the Backup Directory
17
+ */
18
+ protected $backup_dir;
19
+
20
+ /**
21
+ * @var Replace
22
+ */
23
+ protected $replace;
24
+
25
+ /**
26
+ * @var DatabaseManager
27
+ */
28
+ protected $dbm;
29
+
30
+ /**
31
+ * Count of rows to be replaced at a time
32
+ *
33
+ * @var int
34
+ */
35
+
36
+ protected $page_size = 100;
37
+
38
+ /**
39
+ * @String stores the filename of the backup file
40
+ */
41
+ protected $backup_filename;
42
+
43
+ /**
44
+ * Store file path.
45
+ *
46
+ * @var $fp
47
+ */
48
+ protected $fp;
49
+
50
+ public function __construct( Replace $replace, DatabaseManager $dbm ) {
51
+
52
+ $this->errors = new \WP_Error();
53
+
54
+ $this->backup_dir = get_temp_dir();
55
+ $this->replace = $replace;
56
+ $this->dbm = $dbm;
57
+
58
+ }
59
+
60
+ /**
61
+ * Write to the backup file
62
+ *
63
+ * @param string $search
64
+ * @param string $replace
65
+ * @param array $tables The array of table names that should be exported.
66
+ * @param bool $domain_replace If set, exporter will change the domain name without leading http:// in table
67
+ * wp_blogs if we are on a multisite
68
+ * @param $new_table_prefix
69
+ *
70
+ * @return array $report $report [ 'filename'] : Name of Backup file,
71
+ * $report[ 'errors'] : WP_Error_object,
72
+ * $report ['changes'] : Array with replacements in tables
73
+ */
74
+ public function db_backup( $search, $replace, $tables, $domain_replace = FALSE, $new_table_prefix ) {
75
+
76
+ $report = array(
77
+ 'errors' => NULL,
78
+ 'changes' => array(),
79
+ 'tables' => '0',
80
+ 'changes_count' => '0',
81
+ 'filename' => '',
82
+ );
83
+
84
+ $table_prefix = $this->dbm->get_base_prefix();
85
+
86
+ // wp_blogs needs special treatment in multisite domain replace, we need to check later if we are working on it.
87
+ $wp_blogs_table = $table_prefix . 'blogs';
88
+
89
+ $this->backup_filename = $new_table_prefix === '' ? DB_NAME . "_$table_prefix.sql"
90
+ : DB_NAME . "_$new_table_prefix.sql";
91
+
92
+ if ( is_writable( $this->backup_dir ) ) {
93
+ $this->fp = $this->open( $this->backup_dir . $this->backup_filename );
94
+ if ( ! $this->fp ) {
95
+ $this->errors->add( 8, esc_attr__( 'Could not open the backup file for writing!', 'insr' ) );
96
+
97
+ return $report;
98
+ }
99
+ } else {
100
+ $this->errors->add( 9, esc_attr__( 'The backup directory is not writable!', 'insr' ) );
101
+
102
+ return $report;
103
+ }
104
+
105
+ //Begin new backup of MySql
106
+ //get charset. if not set assume utf8
107
+ $charset = ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'utf8' );
108
+ $this->stow( '# ' . esc_attr__( 'WordPress MySQL database backup', 'insr' ) . "\n" );
109
+ $this->stow( "#\n" );
110
+ $this->stow( '# ' . sprintf( __( 'Generated: %s', 'insr' ), date( 'l j. F Y H:i T' ) ) . "\n" );
111
+ $this->stow( '# ' . sprintf( __( 'Hostname: %s', 'insr' ), DB_HOST ) . "\n" );
112
+ $this->stow( '# ' . sprintf( __( 'Database: %s', 'insr' ), $this->backquote( DB_NAME ) ) . "\n" );
113
+ if ( '' !== $new_table_prefix ) {
114
+ $this->stow( '# ' . sprintf(
115
+ __( 'Changed table prefix: From %s to %s ', 'insr' ),
116
+ $table_prefix,
117
+ $new_table_prefix
118
+ )
119
+ . "\n" );
120
+ }
121
+ $this->stow( "# --------------------------------------------------------\n" );
122
+
123
+ $this->stow( "/*!40101 SET NAMES $charset */;\n" );
124
+ $this->stow( "# --------------------------------------------------------\n" );
125
+ foreach ( $tables as $table ) {
126
+
127
+ //count tables
128
+ $report [ 'tables' ] ++;
129
+
130
+ /*check if we are replacing the domain in a multisite. if so, we replace in wp_blogs the stripped url without http(s), because the domains
131
+ are stored without http:// */
132
+
133
+ if ( $domain_replace && is_multisite() && $table === $wp_blogs_table ) {
134
+
135
+ $stripped_url_search = substr( $search, strpos( $search, '/' ) + 2 );
136
+ $stripped_url_replace = substr( $replace, strpos( $replace, '/' ) + 2 );
137
+ $table_report = $this->backup_table(
138
+ $stripped_url_search,
139
+ $stripped_url_replace,
140
+ $table,
141
+ $new_table_prefix
142
+ );
143
+
144
+ } else {
145
+ $table_report = $this->backup_table( $search, $replace, $table, $new_table_prefix );
146
+ }
147
+ //log changes if any
148
+
149
+ if ( 0 !== $table_report[ 'change' ] ) {
150
+ $report[ 'changes' ][ $table ] = $table_report;
151
+
152
+ $report [ 'changes_count' ] += $table_report[ 'change' ];
153
+ }
154
+ }
155
+
156
+ $this->close( $this->fp );
157
+ //return errors if any
158
+ if ( count( $this->errors->get_error_codes() ) ) {
159
+ $report[ 'errors' ] = $this->errors;
160
+ }
161
+ $report [ 'filename' ] = $this->backup_filename;
162
+
163
+ return $report;
164
+
165
+ }
166
+
167
+ /**
168
+ * Taken partially from phpMyAdmin and partially from
169
+ * Alain Wolf, Zurich - Switzerland
170
+ * Website: http://restkultur.ch/personal/wolf/scripts/db_backup/
171
+ * Modified by Scott Merrill (http://www.skippy.net/)
172
+ * to use the WordPress $wpdb object
173
+ *
174
+ * @param string $search
175
+ * @param string $replace
176
+ * @param string $table
177
+ * @param string $new_table_prefix
178
+ *
179
+ * @return array $table_report Reports the changes made to the db.
180
+ */
181
+
182
+ public function backup_table( $search = '', $replace = '', $table, $new_table_prefix = '' ) {
183
+
184
+ $table_report = array(
185
+ 'table_name' => $table,
186
+ 'rows' => 0,
187
+ 'change' => 0,
188
+ 'changes' => array(),
189
+
190
+ );
191
+ //do we need to replace the prefix?
192
+ $table_prefix = $this->dbm->get_base_prefix();
193
+ $new_table = $table;
194
+ if ( '' !== $new_table_prefix ) {
195
+ $new_table = $this->get_new_table_name( $table, $new_table_prefix );
196
+
197
+ }
198
+
199
+ // Create the SQL statements
200
+ $this->stow( '# --------------------------------------------------------' . "\n" );
201
+ $this->stow( '# ' . sprintf( __( 'Table: %s', 'insr' ), $this->backquote( $new_table ) ) . "\n" );
202
+
203
+ $table_structure = $this->dbm->get_table_structure( $table );
204
+ if ( ! $table_structure ) {
205
+ $this->errors->add( 1, __( 'Error getting table details', 'insr' ) . ": $table" );
206
+
207
+ return $table_report;
208
+ }
209
+
210
+ $this->stow( "\n\n" );
211
+ $this->stow( "#\n" );
212
+ $this->stow( '# ' . sprintf( __( 'Delete any existing table %s', 'insr' ),
213
+ $this->backquote( $new_table ) ) . "\n" );
214
+ $this->stow( "#\n" );
215
+ $this->stow( "\n" );
216
+ $this->stow( 'DROP TABLE IF EXISTS ' . $this->backquote( $new_table ) . ';' . "\n" );
217
+
218
+ // Table structure
219
+ // Comment in SQL-file
220
+ $this->stow( "\n\n" );
221
+ $this->stow( "#\n" );
222
+ $this->stow( '# ' . sprintf( __( 'Table structure of table %s', 'insr' ),
223
+ $this->backquote( $new_table ) ) . "\n" );
224
+ $this->stow( "#\n" );
225
+ $this->stow( "\n" );
226
+
227
+ /** @var array $create_table */
228
+ $create_table = $this->dbm->get_create_table_statement( $table );
229
+ if ( $create_table === FALSE ) {
230
+ $err_msg = sprintf( __( 'Error with SHOW CREATE TABLE for %s.', 'insr' ), $table );
231
+ $this->errors->add( 2, $err_msg );
232
+ $this->stow( "#\n# $err_msg\n#\n" );
233
+ }
234
+ //replace prefix if necessary
235
+ if ( '' !== $new_table_prefix ) {
236
+
237
+ $create_table[ 0 ][ 1 ] = str_replace( $table, $new_table, $create_table[ 0 ][ 1 ] );
238
+
239
+ }
240
+ $this->stow( $create_table[ 0 ][ 1 ] . ' ;' );
241
+
242
+ if ( $table_structure === FALSE ) {
243
+ $err_msg = sprintf( __( 'Error getting table structure of %s', 'insr' ), $table );
244
+ $this->errors->add( 3, $err_msg );
245
+ $this->stow( "#\n# $err_msg\n#\n" );
246
+ }
247
+
248
+ // Comment in SQL-file
249
+ $this->stow( "\n\n" );
250
+ $this->stow( "#\n" );
251
+ $this->stow( '# ' . sprintf( __( 'Data contents of table %s', 'insr' ),
252
+ $this->backquote( $new_table ) ) . "\n" );
253
+ $this->stow( "#\n" );
254
+
255
+ $defs = array();
256
+ $ints = array();
257
+ foreach ( $table_structure as $struct ) {
258
+ if ( ( 0 === strpos( $struct->Type, 'tinyint' ) )
259
+ || ( 0 === strpos( strtolower( $struct->Type ), 'smallint' ) )
260
+ || ( 0 === strpos( strtolower( $struct->Type ), 'mediumint' ) )
261
+ || ( 0 === strpos( strtolower( $struct->Type ), 'int' ) )
262
+ || ( 0 === strpos( strtolower( $struct->Type ), 'bigint' ) )
263
+ ) {
264
+ $defs[ strtolower( $struct->Field ) ] = ( NULL === $struct->Default ) ? 'NULL' : $struct->Default;
265
+ $ints[ strtolower( $struct->Field ) ] = '1';
266
+ }
267
+ }
268
+
269
+ //split columns array in primary key string and columns array
270
+ $columns = $this->dbm->get_columns( $table );
271
+ $primary_key = $columns[ 0 ];
272
+
273
+ $row_count = $this->dbm->get_rows( $table );
274
+
275
+ $page_size = $this->page_size;
276
+ $pages = ceil( $row_count / $page_size );
277
+
278
+ for ( $page = 0; $page < $pages; $page ++ ) {
279
+ $start = $page * $page_size;
280
+
281
+ $table_data = $this->dbm->get_table_content( $table, $start, $page_size );
282
+
283
+ $entries = 'INSERT INTO ' . $this->backquote( $new_table ) . ' VALUES (';
284
+ // \x08\\x09, not required
285
+ $hex_search = array( "\x00", "\x0a", "\x0d", "\x1a" );
286
+ $hex_replace = array( '\0', '\n', '\r', '\Z' );
287
+ if ( $table_data ) {
288
+ foreach ( $table_data as $row ) {
289
+ $values = array();
290
+ $table_report[ 'rows' ] ++;
291
+
292
+ foreach ( $row as $column => $value ) {
293
+ //if "change database prefix" is set we have to look for occurrences of the old prefix in the db entries and change them
294
+ if ( $new_table !== $table ) {
295
+ $value = $this->replace->recursive_unserialize_replace( $table_prefix, $new_table_prefix,
296
+ $value );
297
+ }
298
+ //skip replace if no search pattern
299
+ //check if we need to replace something
300
+ //skip primary_key
301
+ if ( $search !== '' && $column !== $primary_key ) {
302
+
303
+ $edited_data = $this->replace->recursive_unserialize_replace( $search, $replace,
304
+ $value );
305
+
306
+ // Something was changed
307
+ if ( $edited_data !== $value ) {
308
+
309
+ $table_report[ 'change' ] ++;
310
+
311
+ // log changes
312
+
313
+ $table_report[ 'changes' ][] = array(
314
+ 'row' => $table_report[ 'rows' ],
315
+ 'column' => $column,
316
+ 'from' => $value,
317
+ 'to' => $edited_data,
318
+ );
319
+ $value = $edited_data;
320
+
321
+ }
322
+
323
+ }
324
+ if ( isset( $ints[ strtolower( $column ) ] ) ) {
325
+ // make sure there are no blank spots in the insert syntax,
326
+ // yet try to avoid quotation marks around integers
327
+ $value = ( NULL === $value || '' === $value ) ? $defs[ strtolower( $column ) ] : $value;
328
+ $values[] = ( '' === $value ) ? "''" : $value;
329
+ } else {
330
+ $values[] = "'" . str_replace( $hex_search, $hex_replace,
331
+ $this->sql_addslashes( $value ) ) . "'";
332
+ }
333
+ }
334
+ $this->stow( " \n" . $entries . implode( ', ', $values ) . ');' );
335
+ }
336
+
337
+ }
338
+ }
339
+
340
+ // Create footer/closing comment in SQL-file
341
+ $this->stow( "\n" );
342
+ $this->stow( "#\n" );
343
+ $this->stow( '# ' . sprintf( __( 'End of data contents of table %s', 'insr' ),
344
+ $this->backquote( $new_table ) ) . "\n" );
345
+ $this->stow( "# --------------------------------------------------------\n" );
346
+ $this->stow( "\n" );
347
+
348
+ return $table_report;
349
+
350
+ }
351
+
352
+ /**
353
+ * Better addslashes for SQL queries.
354
+ * Taken from phpMyAdmin.
355
+ *
356
+ * @param string $a_string
357
+ * @param bool $is_like
358
+ *
359
+ * @return mixed
360
+ */
361
+ protected function sql_addslashes( $a_string = '', $is_like = FALSE ) {
362
+
363
+ if ( $is_like ) {
364
+ $a_string = str_replace( '\\', '\\\\\\\\', $a_string );
365
+ } else {
366
+ $a_string = str_replace( '\\', '\\\\', $a_string );
367
+ }
368
+
369
+ return str_replace( '\'', '\\\'', $a_string );
370
+ }
371
+
372
+ /**
373
+ * Add backquotes to tables and db-names in
374
+ * SQL queries. Taken from phpMyAdmin.
375
+ *
376
+ * @param $a_name
377
+ *
378
+ * @return array|string
379
+ */
380
+ protected function backquote( $a_name ) {
381
+
382
+ if ( ! empty( $a_name ) && $a_name !== '*' ) {
383
+ if ( is_array( $a_name ) ) {
384
+ $result = array();
385
+ reset( $a_name );
386
+ while ( list( $key, $val ) = each( $a_name ) ) {
387
+ $result[ $key ] = '`' . $val . '`';
388
+ }
389
+
390
+ return $result;
391
+ } else {
392
+ return '`' . $a_name . '`';
393
+ }
394
+ } else {
395
+ return $a_name;
396
+ }
397
+ }
398
+
399
+ protected function open( $filename = '', $mode = 'w' ) {
400
+
401
+ if ( '' === $filename ) {
402
+ return FALSE;
403
+ }
404
+
405
+ return @fopen( $filename, $mode );
406
+ }
407
+
408
+ protected function close( $fp ) {
409
+
410
+ fclose( $fp );
411
+ }
412
+
413
+ /**
414
+ * writes a line to the backup file
415
+ *
416
+ * @param $query_line
417
+ */
418
+ protected function stow( $query_line ) {
419
+
420
+ if ( @fwrite( $this->fp, $query_line ) === FALSE ) {
421
+ $this->errors->add(
422
+ 4,
423
+ esc_attr__( 'There was an error writing a line to the backup script:', 'insr' )
424
+ . ' ' . $query_line . ' ' . $php_errormsg
425
+ );
426
+ }
427
+ }
428
+
429
+ /**
430
+ * @param string $filename The name of the file to be downloaded
431
+ * @param bool $compress If TRUE, gz compression is used
432
+ *
433
+ * @return bool FALSE if error , has to DIE when file is delivered
434
+ */
435
+ public function deliver_backup( $filename = '', $compress = FALSE ) {
436
+
437
+ if ( '' === $filename ) {
438
+ return FALSE;
439
+ }
440
+
441
+ $diskfile = $this->backup_dir . $filename;
442
+ //compress file if set
443
+ if ( $compress ) {
444
+ $gz_diskfile = "{$diskfile}.gz";
445
+
446
+ /**
447
+ * Try upping the memory limit before gzipping
448
+ */
449
+ if ( function_exists( 'memory_get_usage' ) && ( (int) @ini_get( 'memory_limit' ) < 64 ) ) {
450
+ @ini_set( 'memory_limit', '64M' );
451
+ }
452
+
453
+ if ( file_exists( $diskfile ) ) {
454
+ /**
455
+ * Try gzipping with an external application
456
+ */
457
+ if ( ! file_exists( $gz_diskfile ) ) {
458
+ @exec( "gzip $diskfile" );
459
+ }
460
+
461
+ if ( file_exists( $gz_diskfile ) ) {
462
+
463
+ unlink( $diskfile );
464
+
465
+ $diskfile = $gz_diskfile;
466
+ $filename = "{$filename}.gz";
467
+
468
+ /**
469
+ * Try to compress to gzip, if available
470
+ */
471
+ } else {
472
+ if ( function_exists( 'gzencode' ) ) {
473
+ if ( function_exists( 'file_get_contents' ) ) {
474
+ $text = file_get_contents( $diskfile );
475
+ } else {
476
+ $text = implode( '', file( $diskfile ) );
477
+ }
478
+ $gz_text = gzencode( $text, 9 );
479
+ $fp = fopen( $gz_diskfile, 'w' );
480
+ fwrite( $fp, $gz_text );
481
+ if ( fclose( $fp ) ) {
482
+ unlink( $diskfile );
483
+ $diskfile = $gz_diskfile;
484
+ $filename = "{$filename}.gz";
485
+ }
486
+ }
487
+ }
488
+ /*
489
+ *
490
+ */
491
+ } elseif ( file_exists( $gz_diskfile ) ) {
492
+ $diskfile = $gz_diskfile;
493
+ $filename = "{$filename}.gz";
494
+ }
495
+ }
496
+
497
+ //provide file for download
498
+ if ( file_exists( $diskfile ) ) {
499
+ header( 'Content-Type: application/force-download' );
500
+ header( 'Content-Type: application/octet-stream' );
501
+ header( 'Content-Length: ' . filesize( $diskfile ) );
502
+ header( 'Content-Disposition: attachment; filename=' . $filename );
503
+ $success = readfile( $diskfile );
504
+ if ( $success ) {
505
+ unlink( $diskfile );
506
+ die();
507
+ }
508
+ }
509
+
510
+ }
511
+
512
+ /**
513
+ * @return string
514
+ */
515
+ public function get_backup_dir() {
516
+
517
+ return $this->backup_dir;
518
+ }
519
+
520
+ /**
521
+ * @string $backup_dir
522
+ * @param $backup_dir
523
+ */
524
+ public function set_backup_dir( $backup_dir ) {
525
+
526
+ $this->backup_dir = $backup_dir;
527
+ }
528
+
529
+ /**
530
+ * strips the current table prefix and adds a new one provided in $new_table_prefix
531
+ *
532
+ * @param $table
533
+ * @param $new_table_prefix
534
+ *
535
+ * @return string The table name with new prefix
536
+ */
537
+ protected function get_new_table_name( $table, $new_table_prefix ) {
538
+
539
+ //get length of base_prefix
540
+ $prefix = $this->dbm->get_base_prefix();
541
+ $prefix_length = strlen( $prefix );
542
+ //strip old prefix
543
+ $part_after_prefix = substr( $table, $prefix_length );
544
+
545
+ #//build new table name
546
+ return $new_table_prefix . $part_after_prefix;
547
+ }
548
+
549
+ }
inc/DatabaseImporter.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Database Importer for inpsyde search and replace plugin.
4
+ */
5
+
6
+ namespace Inpsyde\SearchReplace\inc;
7
+
8
+ class DatabaseImporter {
9
+
10
+ public function __construct() {}
11
+
12
+ /**
13
+ * imports a sql file via mysqli
14
+ *
15
+ * @param string $sql
16
+ * @param \WP_Error $error
17
+ *
18
+ * @return int Number of Sql queries made, -1 if error
19
+ */
20
+ public function import_sql( $sql, $error ) {
21
+
22
+ //connect via mysqli for easier db import
23
+ $mysqli = new \mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
24
+
25
+ // Run the SQL
26
+ $i = 1;
27
+ if ( $mysqli->multi_query( $sql ) ) {
28
+ do {
29
+ if ( $mysqli->more_results() ) {
30
+ $mysqli->next_result();
31
+
32
+ $i ++;
33
+ }
34
+ } while ( $mysqli->more_results() );
35
+ }
36
+
37
+ if ( $mysqli->errno ) {
38
+ $error->add( 'sql_import_error', __( '<b>Mysqli Error:</b> ' . $mysqli->error, 'insr' ) );
39
+
40
+ return - 1;
41
+
42
+ }
43
+
44
+ mysqli_close( $mysqli );
45
+
46
+ return $i;
47
+
48
+ }
49
+
50
+ }
inc/DatabaseManager.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Inpsyde\searchReplace\inc;
4
+
5
+ class DatabaseManager {
6
+
7
+ /**
8
+ * @var \wpdb
9
+ * Wordpress Database Class
10
+ * some functions adapted from : https://github.com/ExpandedFronts/Better-Search-Replace/blob/master/includes/class-bsr-db.php
11
+ */
12
+ private $wpdb;
13
+
14
+ public function __construct() {
15
+
16
+ global $wpdb;
17
+ $this->wpdb = $wpdb;
18
+
19
+ }
20
+
21
+ /**
22
+ * Returns an array of tables in the database.
23
+ *
24
+ * if multisite && mainsite: all tables of the site
25
+ * if multisite && subsite: all tables of current blog
26
+ * if single site : all tabkes of the site
27
+ *
28
+ * @access public
29
+ * @return array
30
+ */
31
+ public function get_tables() {
32
+
33
+ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
34
+
35
+ if ( is_main_site() ) {
36
+ $tables = $this->wpdb->get_col( "SHOW TABLES LIKE'" . $this->wpdb->base_prefix . "%'" );
37
+ } else {
38
+ $blog_id = get_current_blog_id();
39
+ $tables = $this->wpdb->get_col( "SHOW TABLES LIKE '" . $this->wpdb->base_prefix . absint( $blog_id ) . "\_%'" );
40
+ }
41
+
42
+ } else {
43
+ $tables = $this->wpdb->get_col( "SHOW TABLES LIKE'" . $this->wpdb->base_prefix . "%'" );
44
+ }
45
+
46
+ return $tables;
47
+ }
48
+
49
+ /**
50
+ * Returns an array containing the size of each database table.
51
+ *
52
+ * @access public
53
+ * @return array Table => Table Size in KB
54
+ */
55
+ public function get_sizes() {
56
+
57
+ $sizes = array();
58
+ $tables = $this->wpdb->get_results( 'SHOW TABLE STATUS', ARRAY_A );
59
+
60
+ if ( is_array( $tables ) && ! empty( $tables ) ) {
61
+
62
+ foreach ( $tables as $table ) {
63
+ $size = round( $table[ 'Data_length' ] / 1024, 2 );
64
+ $sizes[ $table[ 'Name' ] ] = sprintf( __( '(%s KB)', 'insr' ), $size );
65
+ }
66
+
67
+ }
68
+
69
+ return $sizes;
70
+ }
71
+
72
+ /**
73
+ * Returns the number of rows in a table.
74
+ *
75
+ * @access public
76
+ *
77
+ * @param $table
78
+ *
79
+ * @return int
80
+ */
81
+ public function get_rows( $table ) {
82
+
83
+ $table = esc_sql( $table );
84
+ return $this->wpdb->get_var( "SELECT COUNT(*) FROM $table" );
85
+ }
86
+
87
+ /**
88
+ * Gets the columns in a table.
89
+ *
90
+ * @access public
91
+ *
92
+ * @param string $table The table to check.
93
+ *
94
+ * @return array 1st Element: Primary Key, 2nd Element All Columns
95
+ */
96
+ public function get_columns( $table ) {
97
+
98
+ $primary_key = NULL;
99
+ $columns = array();
100
+ $fields = $this->wpdb->get_results( 'DESCRIBE ' . $table );
101
+
102
+ if ( is_array( $fields ) ) {
103
+ foreach ( $fields as $column ) {
104
+ $columns[] = $column->Field;
105
+ if ( 'PRI' === $column->Key ) {
106
+ $primary_key = $column->Field;
107
+ }
108
+ }
109
+ }
110
+
111
+ return array( $primary_key, $columns );
112
+ }
113
+
114
+ /**
115
+ * @param $table String The Table Name
116
+ * @param $start Int The start row
117
+ * @param $end Int Number of Rows to be fetched
118
+ *
119
+ * @return array|null|object
120
+ */
121
+ public function get_table_content( $table, $start, $end ) {
122
+
123
+ $data = $this->wpdb->get_results( "SELECT * FROM $table LIMIT $start, $end", ARRAY_A );
124
+
125
+ return $data;
126
+ }
127
+
128
+ /**
129
+ * Update table.
130
+ *
131
+ * @param $table
132
+ * @param $update_sql
133
+ * @param $where_sql
134
+ *
135
+ * @return false|int
136
+ */
137
+ public function update( $table, $update_sql, $where_sql ) {
138
+
139
+ $sql = 'UPDATE ' . $table . ' SET ' . implode( ', ', $update_sql ) .
140
+ ' WHERE ' . implode( ' AND ', array_filter( $where_sql ) );
141
+ return $this->wpdb->query( $sql );
142
+ }
143
+
144
+ /**
145
+ * Get table structure.
146
+ *
147
+ * @param $table
148
+ *
149
+ * @return array|null|object
150
+ */
151
+ public function get_table_structure( $table ) {
152
+
153
+ return $this->wpdb->get_results( "DESCRIBE $table" );
154
+ }
155
+
156
+ /**
157
+ * returns a SQL CREATE TABLE Statement for the table provided in $table
158
+ *
159
+ * @param $table String The Name of the table we want to create the statement for.
160
+ *
161
+ * @return string
162
+ */
163
+ public function get_create_table_statement( $table ) {
164
+
165
+ return $this->wpdb->get_results( "SHOW CREATE TABLE $table", ARRAY_N );
166
+ }
167
+
168
+ /**
169
+ * Flush table.
170
+ */
171
+ public function flush() {
172
+
173
+ $this->wpdb->flush();
174
+ }
175
+
176
+ /**
177
+ * Get base prefix.
178
+ *
179
+ * @return string
180
+ */
181
+ public function get_base_prefix() {
182
+
183
+ return $this->wpdb->base_prefix;
184
+ }
185
+
186
+ }
inc/DbBackupAdmin.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Inpsyde\SearchReplace\inc;
4
+
5
+ class DbBackupAdmin extends Admin {
6
+
7
+ public function construct() {
8
+ }
9
+
10
+ /**
11
+ *shows the page template
12
+ */
13
+ public function show_page() {
14
+
15
+ if ( array_key_exists( 'action', $_POST )
16
+ && 'sql_export' === $_POST[ 'action' ]
17
+ && check_admin_referer( 'sql_export', 'insr_nonce' )
18
+ ) {
19
+ $this->handle_sql_export_event();
20
+ }
21
+
22
+ require_once( 'templates/db_backup.php' );
23
+ }
24
+
25
+ /**
26
+ * displays the html for the submit button
27
+ */
28
+ protected function show_submit_button() {
29
+
30
+ wp_nonce_field( 'sql_export', 'insr_nonce' );
31
+
32
+ $html = ' <input type="hidden" name="action" value="sql_export" />';
33
+ echo $html;
34
+ submit_button( esc_html__( 'Create SQL File', 'insr' ) );
35
+
36
+ }
37
+
38
+ /**
39
+ *event handler for click on export sql button
40
+ */
41
+ private function handle_sql_export_event() {
42
+
43
+ $tables = $this->dbm->get_tables();
44
+
45
+ $search = '';
46
+ $replace = '';
47
+
48
+ $this->create_backup_file( $search, $replace, $tables );
49
+ }
50
+
51
+ }
inc/Init.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Inpsyde\SearchReplace\inc;
3
+
4
+ class Init {
5
+
6
+ private static $plugin_pages = array(
7
+ 'tools_page_inpsyde_search_replace',
8
+ 'tools_page_db_backup',
9
+ 'tools_page_sql_import',
10
+ 'tools_page_replace_domain',
11
+ 'tools_page_credits',
12
+ );
13
+
14
+ /**
15
+ * @var String contains 'min'-suffix for css and js files in live mode
16
+ */
17
+ private $suffix;
18
+
19
+ /**
20
+ * @param string $file : The path to the Plugin main file
21
+ */
22
+ public function run( $file ) {
23
+
24
+ //Defines the path to the main plugin directory.
25
+ $plugin_dir_url = plugin_dir_url( $file );
26
+ define( 'INSR_DIR', $plugin_dir_url );
27
+
28
+ new Admin();
29
+
30
+ //add plugin menu & plugin css
31
+ //check for debug mode
32
+ $this->suffix = $this->get_script_debug();
33
+ add_action( 'admin_menu', array( $this, 'register_plugin_pages' ) );
34
+ //hide subpages in admin tools menu
35
+ add_action( 'admin_head', array( $this, 'remove_submenu_pages' ), 110 );
36
+
37
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_css' ) );
38
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_js' ) );
39
+
40
+ }
41
+
42
+ /**
43
+ * Registers the Plugin stylesheet.
44
+ *
45
+ * @param $hook
46
+ */
47
+
48
+ public function register_admin_css( $hook ) {
49
+
50
+ //register on plugin pages only
51
+ if ( in_array( $hook, self::$plugin_pages, FALSE ) ) {
52
+
53
+ $url = ( INSR_DIR . '/assets/css/inpsyde-search-replace' . $this->suffix . '.css' );
54
+ $handle = 'insr-styles';
55
+ wp_register_script( $handle, $url );
56
+ wp_enqueue_style( $handle, $url, array(), FALSE, FALSE );
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Registers the Plugin javascript.
62
+ *
63
+ * @param $hook
64
+ */
65
+
66
+ public function register_admin_js( $hook ) {
67
+
68
+ //register on plugin pages only
69
+ {
70
+ if ( in_array( $hook, self::$plugin_pages, FALSE ) ) {
71
+
72
+ $url = ( INSR_DIR . '/assets/js/inpsyde-search-replace' . $this->suffix . '.js' );
73
+ $handle = 'insr-js';
74
+ wp_register_script( $handle, $url );
75
+ wp_enqueue_script( $handle, $url, array(), FALSE, FALSE );
76
+ }
77
+ }
78
+ }
79
+
80
+ /**
81
+ *registers admin pages
82
+ */
83
+ public function register_plugin_pages() {
84
+
85
+ //this sets the capability needed to access the menu
86
+ //can be overridden by filter 'insr-capability'
87
+ $cap = apply_filters( 'insr-capability', 'install_plugins' );
88
+
89
+ add_submenu_page( 'tools.php', __( 'Backup Database', 'insr' ),
90
+ __( 'Backup Database', 'insr' ), $cap, 'db_backup',
91
+ array( $this, 'show_db_backup_page' ) );
92
+
93
+ add_submenu_page( 'tools.php', __( 'Replace Domain URL', 'insr' ),
94
+ __( 'Replace Domain URL', 'insr' ), $cap, 'replace_domain',
95
+ array( $this, 'show_replace_domain_page' ) );
96
+
97
+ add_submenu_page( 'tools.php', __( 'Search & Replace', 'insr' ),
98
+ __( 'Search & Replace', 'insr' ), $cap, 'inpsyde_search_replace',
99
+ array( $this, 'show_search_replace_page' ) );
100
+
101
+ add_submenu_page( 'tools.php', __( 'SQL Import', 'insr' ),
102
+ __( 'SQL Import', 'insr' ), $cap, 'sql_import',
103
+ array( $this, 'show_import_page' ) );
104
+
105
+ add_submenu_page( 'tools.php', __( 'Credits', 'insr' ),
106
+ __( 'Credits', 'insr' ), $cap, 'credits',
107
+ array( $this, 'show_credits_page' ) );
108
+
109
+ }
110
+
111
+ /**
112
+ * Removes the plugins submenu pages from admin menu.
113
+ */
114
+ public function remove_submenu_pages() {
115
+
116
+ remove_submenu_page( 'tools.php', 'db_backup' );
117
+ remove_submenu_page( 'tools.php', 'sql_import' );
118
+ remove_submenu_page( 'tools.php', 'replace_domain' );
119
+ remove_submenu_page( 'tools.php', 'credits' );
120
+ }
121
+
122
+ /**
123
+ * Callback function for search and replace page
124
+ */
125
+ public function show_search_replace_page() {
126
+
127
+ $search_replace_admin = new SearchReplaceAdmin();
128
+ $search_replace_admin->show_page();
129
+ }
130
+
131
+ /**
132
+ * Callback function for db backup page
133
+ */
134
+ public function show_db_backup_page() {
135
+
136
+ $export_admin = new DbBackupAdmin();
137
+ $export_admin->show_page();
138
+ }
139
+
140
+ /**
141
+ * Callback function for replace domain page
142
+ */
143
+ public function show_replace_domain_page() {
144
+
145
+ $export_admin = new ReplaceDomainAdmin();
146
+ $export_admin->show_page();
147
+ }
148
+
149
+ /**
150
+ * Callback function for import page
151
+ */
152
+ public function show_import_page() {
153
+
154
+ $import_admin = new SqlImportAdmin();
155
+ $import_admin->show_page();
156
+ }
157
+
158
+ /**
159
+ * Callback function for import page.
160
+ */
161
+ public function show_credits_page() {
162
+
163
+ $import_admin = new CreditsAdmin();
164
+ $import_admin->show_page();
165
+ }
166
+
167
+ /**
168
+ * Checks for script debug mode.
169
+ *
170
+ * @return string suffix for css and js files
171
+ */
172
+ public function get_script_debug() {
173
+
174
+ $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
175
+ return $script_debug ? '' : '.min';
176
+ }
177
+
178
+ }
inc/Replace.php ADDED
@@ -0,0 +1,353 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Inpsyde\SearchReplace\inc;
3
+
4
+ use InvalidArgumentException;
5
+
6
+ /**
7
+ * Class Replace
8
+ * runs search & replace on a database
9
+ * adapted from: https://github.com/interconnectit/Search-Replace-DB/blob/master/srdb.class.php
10
+ */
11
+ //TODO: Use WP_Error for error reporting
12
+ class Replace {
13
+
14
+ /**
15
+ * the search string
16
+ *
17
+ * @var
18
+ */
19
+ protected $search;
20
+ /**
21
+ * the replacement string
22
+ *
23
+ * @var
24
+ */
25
+ protected $replace;
26
+
27
+ /**
28
+ * The Database Interface Object
29
+ *
30
+ * @type DatabaseManager
31
+ * @var
32
+ */
33
+ protected $dbm;
34
+
35
+ /**
36
+ * Count of rows to be replaced at a time
37
+ *
38
+ * @var int
39
+ */
40
+ protected $page_size = 100;
41
+
42
+ /**
43
+ * @var bool - set if dry run
44
+ */
45
+ protected $dry_run = TRUE;
46
+
47
+ public function __construct( $dbm ) {
48
+
49
+ if ( ! $dbm instanceof DatabaseManager ) {
50
+ throw new \InvalidArgumentException ( 'Class Replace needs Object of Type DatabaseManager as Parameter' );
51
+ }
52
+
53
+ $this->dbm = $dbm;
54
+ }
55
+
56
+ /**
57
+ * The main loop triggered in step 5. Up here to keep it out of the way of the
58
+ * HTML. This walks every table in the db that was selected in step 3 and then
59
+ * walks every row and column replacing all occurrences of a string with another.
60
+ * We split large tables into blocks (size is set via $page_size)when dealing with them to save
61
+ * on memory consumption.
62
+ *
63
+ * @param string $search What we want to replace
64
+ * @param string $replace What we want to replace it with.
65
+ * @param string $tables The name of the table we want to look at.
66
+ *
67
+ * @return array Collection of information gathered during the run.
68
+ */
69
+
70
+ public function run_search_replace( $search, $replace, $tables ) {
71
+
72
+ $report = array(
73
+ 'errors' => NULL,
74
+ 'changes' => array(),
75
+ 'tables' => '0',
76
+ 'changes_count' => '0',
77
+ );
78
+
79
+ foreach ( (array) $tables as $table ) {
80
+ //count tables
81
+ $report [ 'tables' ] ++;
82
+ $table_report = $this->replace_values( $search, $replace, $table );
83
+ //log changes if any
84
+
85
+ if ( 0 !== $table_report[ 'change' ] ) {
86
+ $report[ 'changes' ][ $table ] = $table_report;
87
+
88
+ $report [ 'changes_count' ] += $table_report[ 'change' ];
89
+ }
90
+
91
+ }
92
+
93
+ return $report;
94
+ }
95
+
96
+ public function replace_values( $search = '', $replace = '', $table ) {
97
+
98
+ $table_report = array(
99
+ 'table_name' => $table,
100
+ 'rows' => 0,
101
+ 'change' => 0,
102
+ 'changes' => array(),
103
+ 'updates' => 0,
104
+ 'start' => microtime(),
105
+ 'end' => microtime(),
106
+ 'errors' => array(),
107
+ );
108
+
109
+ // check we have a search string, bail if not
110
+ if ( empty( $search ) ) {
111
+ $table_report[ 'errors' ][] = 'Search string is empty';
112
+
113
+ return $table_report;
114
+ }
115
+ //split columns array in primary key string and columns array
116
+ $columns = $this->dbm->get_columns( $table );
117
+ $primary_key = $columns[ 0 ];
118
+ $columns = $columns[ 1 ];
119
+
120
+ if ( NULL === $primary_key ) {
121
+ array_push( $table_report[ 'errors' ],
122
+ "The table \"{$table}\" has no primary key. Changes will have to be made manually.",
123
+ 'results' );
124
+
125
+ return $table_report;
126
+ }
127
+
128
+ $table_report[ 'start' ] = microtime();
129
+
130
+ // Count the number of rows we have in the table if large we'll split into blocks, This is a mod from Simon Wheatley
131
+ $row_count = $this->dbm->get_rows( $table );
132
+
133
+ $page_size = $this->page_size;
134
+ $pages = ceil( $row_count / $page_size );
135
+
136
+ for ( $page = 0; $page < $pages; $page ++ ) {
137
+
138
+ $start = $page * $page_size;
139
+
140
+ // Grab the content of the table
141
+ $data = $this->dbm->get_table_content( $table, $start, $page_size );
142
+
143
+ if ( ! $data ) {
144
+ $table_report[ 'errors' ][] = 'no data in table ' . $table;
145
+ }
146
+
147
+ foreach ( $data as $row ) {
148
+
149
+ $table_report[ 'rows' ] ++;
150
+
151
+ $update_sql = array();
152
+ $where_sql = array();
153
+ $update = FALSE;
154
+
155
+ foreach ( $columns as $column ) {
156
+
157
+ $data_to_fix = $row[ $column ];
158
+
159
+ if ( $column === $primary_key ) {
160
+ $where_sql[] = $column . ' = "' . $this->mysql_escape_mimic( $data_to_fix ) . '"';
161
+ continue;
162
+ }
163
+ /* // exclude cols
164
+ if ( in_array( $column, $this->exclude_cols ) )
165
+ continue;
166
+
167
+ // include cols
168
+ if ( ! empty( $this->include_cols ) && ! in_array( $column, $this->include_cols ) )
169
+ continue;*/
170
+
171
+ // Run a search replace on the data that'll respect the serialisation.
172
+ $edited_data = $this->recursive_unserialize_replace( $search, $replace, $data_to_fix );
173
+
174
+ // Something was changed
175
+ if ( $edited_data !== $data_to_fix ) {
176
+
177
+ $table_report[ 'change' ] ++;
178
+
179
+ // log changes
180
+ //TODO : does it work with non UTF-8 encodings?
181
+ $table_report[ 'changes' ][] = array(
182
+ 'row' => $table_report[ 'rows' ],
183
+ 'column' => $column,
184
+ 'from' => $data_to_fix,
185
+ 'to' => $edited_data,
186
+ );
187
+
188
+ $update_sql[] = $column . ' = "' . $this->mysql_escape_mimic( $edited_data ) . '"';
189
+ $update = TRUE;
190
+
191
+ }
192
+
193
+ }
194
+
195
+ // Determine what to do with updates.
196
+ if ( TRUE === $this->dry_run ) {
197
+ // Don't do anything if a dry run
198
+ } elseif ( $update && ! empty( $where_sql ) ) {
199
+ // If there are changes to make, run the query.
200
+
201
+ $result = $this->dbm->update( $table, $update_sql, $where_sql );
202
+
203
+ if ( ! $result ) {
204
+ $table_report[ 'errors' ][] = sprintf(
205
+ __( 'Error updating row: %d.', 'insr' ),
206
+ $row );
207
+ } else {
208
+ $table_report[ 'updates' ] ++;
209
+ }
210
+
211
+ }
212
+ }
213
+ }
214
+
215
+ $table_report[ 'end' ] = microtime( TRUE );
216
+ $this->dbm->flush();
217
+
218
+ return $table_report;
219
+
220
+ }
221
+
222
+ /**
223
+ * Take a serialised array and unserialize it replacing elements as needed and
224
+ * unserializing any subordinate arrays and performing the replace on those too.
225
+ *
226
+ * @param string $from String we're looking to replace.
227
+ * @param string $to What we want it to be replaced with
228
+ * @param array|string|object $data Used to pass any subordinate arrays back to in.
229
+ * @param bool $serialised Does the array passed via $data need serialising.
230
+ *
231
+ * @return array The original array with all elements replaced as needed.
232
+ */
233
+ public function recursive_unserialize_replace( $from = '', $to = '', $data = '', $serialised = FALSE ) {
234
+
235
+ // some unserialized data cannot be re-serialised eg. SimpleXMLElements
236
+ try {
237
+
238
+ if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== FALSE ) {
239
+ $data = $this->recursive_unserialize_replace( $from, $to, $unserialized, TRUE );
240
+ } elseif ( is_array( $data ) ) {
241
+ $_tmp = array();
242
+ foreach ( $data as $key => $value ) {
243
+ $_tmp[ $key ] = $this->recursive_unserialize_replace( $from, $to, $value, FALSE );
244
+ }
245
+
246
+ $data = $_tmp;
247
+ unset( $_tmp );
248
+ } // Submitted by Tina Matter
249
+ elseif ( is_object( $data ) ) {
250
+ // $data_class = get_class( $data );
251
+ $_tmp = $data; // new $data_class( );
252
+ $props = get_object_vars( $data );
253
+ foreach ( $props as $key => $value ) {
254
+ $_tmp->$key = $this->recursive_unserialize_replace( $from, $to, $value, FALSE );
255
+ }
256
+
257
+ $data = $_tmp;
258
+ unset( $_tmp );
259
+ } else {
260
+ if ( is_string( $data ) ) {
261
+ $data = str_replace( $from, $to, $data );
262
+
263
+ }
264
+ }
265
+
266
+ if ( $serialised ) {
267
+ return serialize( $data );
268
+ }
269
+
270
+ }
271
+ catch ( Exception $error ) {
272
+
273
+ $this->add_error( $error->getMessage(), 'results' );
274
+
275
+ }
276
+
277
+ return $data;
278
+ }
279
+
280
+ /**
281
+ * Checks if the submitted string is a JSON object
282
+ *
283
+ * @param $string
284
+ * @param bool|FALSE $strict
285
+ *
286
+ * @return bool
287
+ */
288
+
289
+ protected function is_json( $string, $strict = FALSE ) {
290
+
291
+ $json = @json_decode( $string, TRUE );
292
+ if ( $strict === TRUE && ! is_array( $json ) ) {
293
+ return FALSE;
294
+ }
295
+
296
+ return ! ( $json === NULL || $json === FALSE );
297
+ }
298
+
299
+ /**
300
+ * Mimics the mysql_real_escape_string function. Adapted from a post by 'feedr' on php.net.
301
+ *
302
+ * @link http://php.net/manual/en/function.mysql-real-escape-string.php#101248
303
+ * @access public
304
+ *
305
+ * @param array|string $input The string to escape.
306
+ *
307
+ * @return string
308
+ */
309
+
310
+ public function mysql_escape_mimic( $input ) {
311
+
312
+ if ( is_array( $input ) ) {
313
+ return array_map( __METHOD__, $input );
314
+ }
315
+ if ( ! empty( $input ) && is_string( $input ) ) {
316
+ return str_replace(
317
+ array( '\\', "\0", "\n", "\r", "'", '"', "\x1a" ),
318
+ array( '\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z' ),
319
+ $input
320
+ );
321
+ }
322
+
323
+ return $input;
324
+ }
325
+
326
+ /**
327
+ * Sets the dry run option.
328
+ *
329
+ * @param bool $state : TRUE for dry run, FALSE for writing changes to DB
330
+ *
331
+ * @return bool
332
+ */
333
+ public function set_dry_run( $state ) {
334
+
335
+ if ( is_bool( $state ) ) {
336
+
337
+ $this->dry_run = $state;
338
+ }
339
+
340
+ return $state;
341
+ }
342
+
343
+ /**
344
+ * Returns true, if dry run, false if not
345
+ *
346
+ * @return bool
347
+ */
348
+ public function get_dry_run() {
349
+
350
+ return $this->dry_run;
351
+ }
352
+
353
+ }
inc/ReplaceDomainAdmin.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin class for the "replace domain" tab in inpsyde search-and-replace plugin.
4
+ */
5
+
6
+ namespace Inpsyde\SearchReplace\inc;
7
+
8
+ class ReplaceDomainAdmin extends Admin {
9
+
10
+ public function construct() {
11
+ }
12
+
13
+ /**
14
+ *shows the page template
15
+ */
16
+ public function show_page() {
17
+
18
+ if ( array_key_exists( 'action', $_POST )
19
+ && 'replace_domain' === $_POST[ 'action' ]
20
+ && check_admin_referer( 'replace_domain', 'insr_nonce' )
21
+ ) {
22
+ $this->handle_replace_domain_event();
23
+
24
+ }
25
+
26
+ require_once( 'templates/replace_domain.php' );
27
+ }
28
+
29
+ /**
30
+ *displays the html for the submit button
31
+ */
32
+ protected function show_submit_button() {
33
+
34
+ wp_nonce_field( 'replace_domain', 'insr_nonce' );
35
+
36
+ $html = '<input type="hidden" name="action" value="replace_domain" />';
37
+ echo $html;
38
+ submit_button( esc_attr__( 'Do Search & Replace', 'insr' ) );
39
+
40
+ }
41
+
42
+ /**
43
+ *event handler for click on export sql button
44
+ */
45
+ private function handle_replace_domain_event() {
46
+
47
+ $tables = $this->dbm->get_tables();
48
+
49
+ $search = esc_url_raw( $_POST[ 'search' ] );
50
+ $replace = esc_url_raw( $_POST[ 'replace' ] );
51
+ $new_db_prefix = array_key_exists( 'new_db_prefix', $_POST ) ? esc_attr( $_POST[ 'new_db_prefix' ] ) : '';
52
+
53
+ //search field should not be empty
54
+ if ( '' === $replace ) {
55
+ $this->errors->add( 'empty_replace', esc_attr__( 'Replace Field should not be empty.', 'insr' ) );
56
+ $this->display_errors();
57
+ return;
58
+ }
59
+
60
+ $this->create_backup_file( $search, $replace, $tables, TRUE, $new_db_prefix );
61
+ }
62
+
63
+ }
inc/SearchReplaceAdmin.php ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Inpsyde\SearchReplace\inc;
4
+
5
+ class SearchReplaceAdmin extends Admin {
6
+
7
+ /**
8
+ *shows the page contents
9
+ */
10
+ public function show_page() {
11
+
12
+ //check if "search replace"-button was clicked
13
+
14
+ if ( isset ( $_POST[ 'action' ] ) && 'search_replace' === $_POST[ 'action' ]
15
+ && check_admin_referer( 'do_search_replace', 'insr_nonce' )
16
+ ) {
17
+ $this->handle_search_replace_event();
18
+
19
+ }
20
+ require_once( 'templates/search_replace.php' );
21
+ }
22
+
23
+ /**
24
+ *prints a select with all the tables and their sizes
25
+ *
26
+ * @return void *
27
+ */
28
+ protected function show_table_list() {
29
+
30
+ $tables = $this->dbm->get_tables();
31
+ $sizes = $this->dbm->get_sizes();
32
+ $table_count = count( $tables );
33
+
34
+ //adjust height of select according to table count, but max 20 rows
35
+ $select_rows = $table_count < 20 ? $table_count : 20;
36
+
37
+ //if we come from a dry run, we select the tables to the dry run again
38
+ /** @var bool | string $selected_tables */
39
+ $selected_tables = FALSE;
40
+ if ( isset( $_POST[ 'select_tables' ] ) ) {
41
+ $selected_tables = $_POST[ 'select_tables' ];
42
+ }
43
+
44
+ echo '<select id="select_tables" name="select_tables[]" multiple="multiple" size = "' . $select_rows . '">';
45
+ foreach ( $tables as $table ) {
46
+ $table_size = isset ( $sizes[ $table ] ) ? $sizes[ $table ] : '';
47
+ //check if dry run. if dry run && current table is in "selected" array add selected attribute
48
+ if ( isset( $_POST[ 'dry_run' ] )
49
+ && $selected_tables
50
+ && in_array( $table, $selected_tables, FALSE )
51
+ ) {
52
+ echo "<option value='$table' selected='selected'>$table $table_size </option>";
53
+
54
+ //if current table had not been selected echo option without "selected" attribute
55
+ } else {
56
+ echo '<option value="' . $table . '">' . $table . $table_size . '</option>';
57
+ }
58
+
59
+ }
60
+ echo( '</select>' );
61
+ }
62
+
63
+ /**
64
+ *handles click on search replace, check input form and runs either create_backup() or run_replace() functions in this class
65
+ */
66
+ protected function handle_search_replace_event() {
67
+
68
+ $tables = '';
69
+
70
+ //check for errors in form
71
+
72
+ $this->check_input_form();
73
+ if ( '' !== $this->errors->get_error_code() ) {
74
+ $this->display_errors();
75
+
76
+ return;
77
+ }
78
+ if ( isset ( $_POST[ 'select_tables' ] ) ) {
79
+ $tables = $_POST[ 'select_tables' ];
80
+ }
81
+
82
+ $dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
83
+
84
+ //if dry run is checked we run the replace function with dry run and return
85
+ if ( TRUE === $dry_run ) {
86
+ $this->run_replace( $_POST[ 'search' ], $_POST[ 'replace' ], $tables, $dry_run );
87
+
88
+ return;
89
+ }
90
+
91
+ //'export'-button was checked
92
+ if ( isset ( $_POST[ 'export_or_save' ] ) && 'export' === $_POST [ 'export_or_save' ] ) {
93
+
94
+ $this->create_backup_file( $_POST[ 'search' ], $_POST[ 'replace' ], $tables );
95
+ } else {
96
+
97
+ //"Save changes to database" was checked
98
+
99
+ $this->run_replace( $_POST[ 'search' ], $_POST[ 'replace' ], $tables, $dry_run );
100
+
101
+ }
102
+ }
103
+
104
+ /**
105
+ *displays the html for the submit button
106
+ */
107
+ protected function show_submit_button() {
108
+
109
+ wp_nonce_field( 'do_search_replace', 'insr_nonce' );
110
+
111
+ $html = '<input type="hidden" name="action" value="search_replace" />';
112
+ echo $html;
113
+ submit_button( esc_attr__( 'Do Search & Replace', 'insr' ) );
114
+
115
+ }
116
+
117
+ /**
118
+ * calls run_replace_table() on each table provided in array $tables
119
+ *
120
+ * @param $search
121
+ * @param $replace
122
+ * @param $tables array of tables we want to search
123
+ * @param $dry_run True if dry run (no changes are written to db)
124
+ *
125
+ * @return null
126
+ */
127
+ protected function run_replace( $search, $replace, $tables, $dry_run ) {
128
+
129
+ echo '<div class="updated notice is-dismissible">';
130
+ if ( $dry_run ) {
131
+ echo '<p><strong>'
132
+ . esc_html__(
133
+ 'Dry run is selected. No changes were made to the database and no SQL file was written .',
134
+ 'insr' )
135
+ . '</strong></p>';
136
+
137
+ } else {
138
+ echo '<p><strong>'
139
+ . esc_html__(
140
+ 'The following changes were made to the database: ',
141
+ 'insr' )
142
+ . '</strong></p>';
143
+ }
144
+ $this->replace->set_dry_run( $dry_run );
145
+
146
+ $report = $this->replace->run_search_replace( $search, $replace, $tables );
147
+
148
+ if ( count( $report[ 'changes' ] ) > 0 ) {
149
+ $this->show_changes( $report );
150
+ }
151
+
152
+ //if no changes found report that
153
+ if ( 0 === count( $report [ 'changes' ] ) ) {
154
+ echo '<p>' . esc_html__( 'Search pattern not found.', 'insr' ) . '</p>';
155
+ }
156
+ echo '</div>';
157
+
158
+ }
159
+
160
+ /**
161
+ *checks the input form and writes possible errors to a WP_Error object
162
+ */
163
+ protected function check_input_form() {
164
+
165
+ if ( ! isset( $_POST[ 'select_tables' ] ) ) {
166
+
167
+ $this->errors->add( 'no_table_selected', esc_attr__( 'No Tables were selected.', 'insr' ) );
168
+
169
+ }
170
+
171
+ //if search field is empty and replace field is not empty quit. If both fields are empty, go on (useful for backup of single tables without changing)
172
+ if ( isset( $_POST[ 'replace' ] ) && '' !== $_POST[ 'replace' ]
173
+ && ( ! isset ( $_POST[ 'search' ] ) || '' === $_POST[ 'search' ] )
174
+ ) {
175
+ $this->errors->add( 'empty_search', esc_attr__( 'Search field is empty.', 'insr' ) );
176
+
177
+ return;
178
+ }
179
+ //check if the user tries to replace domain name into the database
180
+ if ( isset( $_POST[ 'export_or_save' ] ) && 'save_to_db' === $_POST [ 'export_or_save' ] ) {
181
+ $search = $_POST[ 'search' ];
182
+ $contains_site_url = strpos( $search, $this->get_stripped_site_url() );
183
+ if ( $contains_site_url !== FALSE ) {
184
+ $this->errors->add(
185
+ 'URL_in-search_expression',
186
+ esc_attr__( 'Your search contains your current site url. Replacing your site url will most likely cause your site to break. If you want to change the URL (and you know what you doing), please use the export function and make sure you backup your database before reimporting the changed SQL.',
187
+ 'insr' ) );
188
+ }
189
+
190
+ }
191
+
192
+ }
193
+
194
+ /**
195
+ * shows the search value in template.
196
+ */
197
+ private function get_search_value() {
198
+
199
+ $search = isset( $_POST[ 'search' ] ) ? $_POST[ 'search' ] : '';
200
+ $dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
201
+ if ( $dry_run ) {
202
+ echo $search;
203
+ }
204
+
205
+ }
206
+
207
+ /**
208
+ * shows the replace value in template
209
+ */
210
+ private function get_replace_value() {
211
+
212
+ $replace = isset( $_POST[ 'replace' ] ) ? $_POST[ 'replace' ] : '';
213
+ $dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
214
+ if ( $dry_run ) {
215
+ echo $replace;
216
+ }
217
+
218
+ }
219
+
220
+ }
inc/SqlImportAdmin.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Inpsyde\SearchReplace\inc;
4
+
5
+ class SqlImportAdmin extends Admin {
6
+
7
+ /**
8
+ * SqlImportAdmin constructor.
9
+ */
10
+ public function __construct() {
11
+
12
+ $this->dbi = new DatabaseImporter();
13
+ $this->errors = new \WP_Error();
14
+ parent::__construct();
15
+ }
16
+
17
+ /**
18
+ *callback function for menu item
19
+ */
20
+ public function show_page() {
21
+
22
+ if ( isset( $_POST[ 'action' ] ) && 'sql_import' === $_POST[ 'action' ]
23
+ && check_admin_referer( 'sql_import', 'insr_nonce' )
24
+ ) {
25
+ $this->handle_sql_import_event();
26
+
27
+ }
28
+ $this->display_errors();
29
+ require_once( 'templates/sql_import.php' );
30
+ }
31
+
32
+ /**
33
+ *displays the html for the submit button
34
+ */
35
+ protected function show_submit_button() {
36
+
37
+ wp_nonce_field( 'sql_import', 'insr_nonce' );
38
+
39
+ $html = ' <input type="hidden" name="action" value="sql_import" />';
40
+ echo $html;
41
+ submit_button( esc_html__( 'Import SQL file', 'insr' ) );
42
+ }
43
+
44
+ /**
45
+ *starts the sql import
46
+ *
47
+ * @return void
48
+ */
49
+ private function handle_sql_import_event() {
50
+
51
+ // TODO: Better handling of large files
52
+ // maybe like here: http://stackoverflow.com/questions/147821/loading-sql-files-from-within-php , answer by user 'gromo'
53
+ $php_upload_error_code = $_FILES[ 'file_to_upload' ][ 'error' ];
54
+ if ( 0 === $php_upload_error_code ) {
55
+
56
+ //get file extension
57
+ $ext = strrchr( $_FILES [ 'file_to_upload' ][ 'name' ], '.' );
58
+ //parse file
59
+ $tempfile = $_FILES [ 'file_to_upload' ][ 'tmp_name' ];
60
+ switch ( $ext ) {
61
+ case '.sql':
62
+ $sql_source = file_get_contents( $tempfile );
63
+ break;
64
+ case '.gz':
65
+ $sql_source = $this->read_gzfile_into_string( $tempfile );
66
+ break;
67
+ default:
68
+ $this->errors->add(
69
+ 'sql_import_error',
70
+ esc_html__(
71
+ 'The file has neither \'.gz\' nor \'.sql\' Extension. Import not possible.',
72
+ 'insr'
73
+ )
74
+ );
75
+
76
+ return;
77
+ }
78
+
79
+ //call import function
80
+ $success = $this->dbi->import_sql( $sql_source, $this->errors );
81
+ if ( - 1 === $success ) {
82
+ $this->errors->add(
83
+ 'sql_import_error',
84
+ esc_html__(
85
+ 'The file does not seem to be a valid SQL file. Import not possible.',
86
+ 'insr'
87
+ )
88
+ );
89
+ } else {
90
+ echo '<div class="updated notice is-dismissible">';
91
+ echo '<p>';
92
+ $msg = printf(
93
+ __( 'The SQL file was successfully imported. %s SQL queries were performed.', 'insr' ),
94
+ $success );
95
+ echo esc_html( $msg );
96
+ echo '</p></div>';
97
+ }
98
+ } else {
99
+ //show error
100
+ $php_upload_errors = array(
101
+ 0 => 'There is no error, the file uploaded with success',
102
+ 1 => esc_html__( 'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'insr' ),
103
+ 2 => esc_html__( 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
104
+ 'insr' ),
105
+ 3 => esc_html__( 'The uploaded file was only partially uploaded', 'insr' ),
106
+ 4 => esc_html__( 'No file was uploaded.', 'insr' ),
107
+ 6 => esc_html__( 'Missing a temporary folder.', 'insr' ),
108
+ 7 => esc_html__( 'Failed to write file to disk.', 'insr' ),
109
+ 8 => esc_html__( 'A PHP extension stopped the file upload.', 'insr' ),
110
+ );
111
+
112
+ $this->errors->add(
113
+ 'upload_error',
114
+ __( 'Upload Error: ' . $php_upload_errors[ $php_upload_error_code ], 'insr' )
115
+ );
116
+ }
117
+
118
+ }
119
+
120
+ /**
121
+ * reads a gz file into a string
122
+ *
123
+ * @param $filename String path ot file
124
+ *
125
+ * @return string The file contents
126
+ */
127
+ private function read_gzfile_into_string( $filename ) {
128
+
129
+ $zd = gzopen( $filename, 'r' );
130
+ $contents = gzread( $zd, 10000 );
131
+ gzclose( $zd );
132
+
133
+ return $contents;
134
+ }
135
+
136
+ // Returns a file size limit in kilobytes based on the PHP upload_max_filesize
137
+ // and post_max_size
138
+ //http://stackoverflow.com/questions/13076480/php-get-actual-maximum-upload-size
139
+ public function file_upload_max_size() {
140
+
141
+ $max_size = - 1;
142
+
143
+ if ( $max_size < 0 ) {
144
+ // Start with post_max_size.
145
+ $max_size = $this->parse_size( ini_get( 'post_max_size' ) );
146
+
147
+ // If upload_max_size is less, then reduce. Except if upload_max_size is
148
+ // zero, which indicates no limit.
149
+ $upload_max = $this->parse_size( ini_get( 'upload_max_filesize' ) );
150
+ if ( $upload_max > 0 && $upload_max < $max_size ) {
151
+ $max_size = $upload_max;
152
+ }
153
+ }
154
+
155
+ return $max_size / 1024;
156
+ }
157
+
158
+ private function parse_size( $size ) {
159
+
160
+ $unit = preg_replace( '/[^bkmgtpezy]/i', '', $size ); // Remove the non-unit characters from the size.
161
+ $size = preg_replace( '/[^0-9\.]/', '', $size ); // Remove the non-numeric characters from the size.
162
+ if ( $unit ) {
163
+ // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
164
+ return round( $size * pow( 1024, stripos( 'bkmgtpezy', $unit[ 0 ] ) ) );
165
+ } else {
166
+ return round( $size );
167
+ }
168
+ }
169
+
170
+ }
inc/templates/credits.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying sql export page
4
+ */
5
+ // Prevent direct access.
6
+ if ( ! defined( 'INSR_DIR' ) ) {
7
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
8
+ exit;
9
+ }
10
+ ?>
11
+ <div class="wrap">
12
+
13
+ <h1 id="title"><?php esc_html_e( 'Search & Replace', 'insr' ); ?></h1>
14
+
15
+ <h2 class="nav-tab-wrapper">
16
+ <a class="nav-tab" href="<?php
17
+ echo admin_url() ?>tools.php?page=db_backup"><?php esc_html_e( 'Backup Database', 'insr' ); ?></a>
18
+ <a class="nav-tab" href="<?php
19
+ echo admin_url() ?>tools.php?page=replace_domain"><?php esc_html_e( 'Replace Domain/URL', 'insr' ); ?></a>
20
+ <a class="nav-tab" href="<?php
21
+ echo admin_url() ?>tools.php?page=inpsyde_search_replace"><?php esc_html_e( 'Search and Replace', 'insr' ); ?></a>
22
+ <a class="nav-tab" href="<?php
23
+ echo admin_url() ?>tools.php?page=sql_import"><?php esc_html_e( 'Import SQL file', 'insr' ); ?></a>
24
+ <a class="nav-tab nav-tab-active" href="<?php
25
+ echo admin_url() ?>tools.php?page=credits"><?php esc_html_e( 'Credits', 'insr' ); ?></a>
26
+ </h2>
27
+
28
+ <h2><?php esc_html_e( 'Hey nice to have you here!', 'insr' ); ?></h2>
29
+ <p><?php printf(
30
+ __( 'Search and Replace is refactored in 2015 by <a href="%1$s">Inpsyde GmbH</a>, maintained since 2006 and based on the original from <a href="%2$s">Mark Cunningham</a>.', 'insr' ),
31
+ 'http://inpsyde.com/',
32
+ 'http://thedeadone.net'
33
+ ); ?></p>
34
+
35
+ <h2><?php esc_html_e( 'You rock! contribute the plugin.', 'insr' ); ?></h2>
36
+ <p><?php printf(
37
+ __( 'You can contribute the Plugin go to the repository on <a href="%s">github</a> making changes, create issues or submitting changes.', 'insr' ),
38
+ 'https://github.com/inpsyde/search-and-replace/'
39
+ ); ?></p>
40
+
41
+ <h2><?php esc_html_e( 'We are Inpsyde', 'insr' ); ?></h2>
42
+ <p><?php esc_html_e( 'Inpsyde has developed enterprise solutions with the world’s most popular open-source CMS since it was a kitten. Still do, inconvincible convinced.', 'insr' ); ?></p>
43
+ <p><?php printf(
44
+ __( 'Inpsyde is a WordPress <a href="%1$s">VIP Service Partner</a> and <a href="%2$s">WooCommerce Expert</a>.', 'insr' ),
45
+ 'https://vip.wordpress.com/partner/inpsyde/',
46
+ 'https://www.woothemes.com/experts/inpsyde-gmbh/'
47
+ ); ?></p>
48
+ <p><?php printf(
49
+ __( 'Look at our other <a href="%s">free WordPress plugins</a>.', 'insr' ),
50
+ 'https://profiles.wordpress.org/inpsyde/#content-plugins'
51
+ ); ?></p>
52
+
53
+
54
+ <h2><?php esc_html_e( 'Working at Inpsyde', 'insr' ); ?></h2>
55
+ <p><?php esc_html_e( 'The biggest WordPress enterprise in Europe we’re dynamically growing and constantly looking for new employees. So do you want to shape WordPress in an interesting and exciting working environment? Here we are!', 'insr' ); ?> </p>
56
+ <p><?php esc_html_e( 'At the moment we’re looking for developers for WordPress based products and services. If you’re not a developer and want to be part of us, we’d be happy to recieve your unsolicited application. At Inpsyde you can expect an open, modern and lively company culture:', 'insr' ); ?> </p>
57
+ <ol>
58
+ <li><?php esc_html_e( 'challenging and exciting projects', 'insr' ); ?></li>
59
+ <li><?php esc_html_e( 'flexible working hours in remote office', 'insr' ); ?></li>
60
+ <li><?php esc_html_e( 'deliberately flat hierarchies and short decision paths', 'insr' ); ?></li>
61
+ <li><?php esc_html_e( 'a wide variety of tasks', 'insr' ); ?></li>
62
+ <li><?php esc_html_e( 'freedom for personal development and responsible, self-reliant action', 'insr' ); ?></li>
63
+
64
+ </ol>
65
+ <p><?php printf(
66
+ __( 'If you love open source and especially WordPress, if you love to organize your working days by yourself and want to use your pragmatic problem-solving skills and result-oriented work methods: <a href="%s">join our team</a>!', 'insr' ),
67
+ 'http://inpsyde.com/#jobs'
68
+ ); ?></p>
69
+
inc/templates/db_backup.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying sql export page
4
+ */
5
+ // Prevent direct access.
6
+ if ( ! defined( 'INSR_DIR' ) ) {
7
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
8
+ exit;
9
+ }
10
+ ?>
11
+ <div class="wrap">
12
+
13
+ <h1 id="title"><?php esc_html_e( 'Search & Replace', 'insr' ); ?></h1>
14
+
15
+ <h2 class="nav-tab-wrapper">
16
+ <a class="nav-tab nav-tab-active" href="<?php
17
+ echo admin_url() ?>tools.php?page=db_export"><?php
18
+ esc_html_e( 'Backup Database',
19
+ 'insr' ); ?></a>
20
+ <a class="nav-tab " href="<?php
21
+ echo admin_url() ?>tools.php?page=replace_domain"><?php
22
+ esc_html_e( 'Replace Domain/URL',
23
+ 'insr' ); ?></a>
24
+ <a class="nav-tab " href="<?php
25
+ echo admin_url() ?>tools.php?page=inpsyde_search_replace"><?php
26
+ esc_html_e( 'Search and Replace',
27
+ 'insr' ); ?></a>
28
+ <a class="nav-tab" href="<?php
29
+ echo admin_url() ?>tools.php?page=sql_import"><?php
30
+ esc_html_e( 'Import SQL file',
31
+ 'insr' ); ?></a>
32
+ <a class="nav-tab" href="<?php
33
+ echo admin_url() ?>tools.php?page=credits"><?php
34
+ esc_html_e( 'Credits',
35
+ 'insr' ); ?></a>
36
+ </h2>
37
+
38
+ <p><?php esc_html_e(
39
+ 'Create a backup of your database by clicking "Create SQL File".',
40
+ 'insr' ); ?>
41
+ </p>
42
+
43
+ <form action="" method="post">
44
+ <?php $this->show_submit_button(); ?>
45
+ </form>
inc/templates/replace_domain.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying replace domain page
4
+ */
5
+ // Prevent direct access.
6
+ if ( ! defined( 'INSR_DIR' ) ) {
7
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
8
+ exit;
9
+ }
10
+ ?>
11
+ <div class="wrap">
12
+
13
+ <h1 id="title"><?php esc_html_e( 'Search & Replace', 'insr' ); ?></h1>
14
+
15
+ <h2 class="nav-tab-wrapper">
16
+ <a class="nav-tab " href="<?php echo admin_url() ?>tools.php?page=db_backup"><?php esc_html_e( 'Backup Database', 'insr' ); ?></a>
17
+ <a class="nav-tab nav-tab-active" href="<?php echo admin_url() ?>tools.php?page=replace_domain"><?php esc_html_e( 'Replace Domain/URL', 'insr' ); ?></a>
18
+ <a class="nav-tab " href="<?php echo admin_url() ?>tools.php?page=inpsyde_search_replace"><?php esc_html_e( 'Search and Replace', 'insr' ); ?></a>
19
+ <a class="nav-tab" href="<?php echo admin_url() ?>tools.php?page=sql_import"><?php esc_html_e( 'Import SQL file', 'insr' ); ?></a>
20
+ <a class="nav-tab" href="<?php echo admin_url() ?>tools.php?page=credits"><?php esc_html_e( 'Credits', 'insr' ); ?></a>
21
+ </h2>
22
+
23
+ <p><?php esc_html_e( 'If you want to migrate your site to another domain, enter the new URL in the field "Replace with" and create a backup of your database by clicking "Create SQL File".',
24
+ 'insr' ); ?> </p>
25
+
26
+ <form action="" method="post">
27
+
28
+ <table class="form-table">
29
+ <tbody>
30
+
31
+ <tr>
32
+ <th><label for="search"><strong><?php esc_html_e( 'Search for: ', 'insr' ); ?></strong></label></th>
33
+ <td><input id="search" type="text" name="search" value="<?php echo get_site_url(); ?>" /></td>
34
+ </tr>
35
+ <tr>
36
+ <th><label for="replace"><strong><?php esc_html_e( 'Replace with: ', 'insr' ); ?></strong></label></th>
37
+ <td><input id="replace" type="url" name="replace" placeholder="<?php esc_attr_e( 'New URL' ) ?>" /></td>
38
+ </tr>
39
+ <tr>
40
+ <th><label for="change_db_prefix"><strong><?php esc_html_e( 'Change database prefix', 'insr' ); ?></strong></label></th>
41
+ <td><input id ="change_db_prefix" type="checkbox" name="change_db_prefix" /></td>
42
+ </tr>
43
+ <tr class="disabled">
44
+ <th><label for="current_db_prefix"><strong><?php esc_html_e( 'Current prefix: ', 'insr' ); ?></strong></label></th>
45
+ <td><?php echo $this->dbm->get_base_prefix(); ?></td>
46
+ </tr>
47
+ <tr class="maybe_disabled disabled">
48
+ <th><label for="new_db_prefix"><strong><?php esc_html_e( 'New prefix: ', 'insr' ); ?></strong></label></th>
49
+ <td><input id="new_db_prefix" type="text" name="new_db_prefix" disabled placeholder="<?php esc_attr_e( 'New database prefix', 'insr' ) ?>" /></td>
50
+ </tr>
51
+ </tbody>
52
+ </table>
53
+ <?php $this->show_submit_button(); ?>
54
+ </form>
inc/templates/search_replace.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying search & replace page
4
+ */
5
+ // Prevent direct access.
6
+ if ( ! defined( 'INSR_DIR' ) ) {
7
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
8
+ exit;
9
+ }
10
+ ?>
11
+ <div class="wrap">
12
+
13
+ <h1 id="title"><?php esc_html_e( 'Search & Replace', 'insr' ); ?></h1>
14
+
15
+ <h2 class="nav-tab-wrapper">
16
+ <a class="nav-tab " href="<?php echo admin_url() ?>tools.php?page=db_backup"><?php esc_html_e( 'Backup Database', 'insr' ); ?></a>
17
+ <a class="nav-tab " href="<?php echo admin_url() ?>tools.php?page=replace_domain"><?php esc_html_e( 'Replace Domain/URL', 'insr' ); ?></a>
18
+ <a class="nav-tab nav-tab-active" href="<?php echo admin_url() ?>tools.php?page=inpsyde_search_replace">
19
+ <?php esc_html_e( 'Search and Replace', 'insr' ); ?></a>
20
+ <a class="nav-tab" href="<?php echo admin_url() ?>tools.php?page=sql_import"><?php esc_html_e( 'Import SQL file', 'insr' ); ?></a>
21
+ <a class="nav-tab" href="<?php echo admin_url() ?>tools.php?page=credits"><?php esc_html_e( 'Credits', 'insr' ); ?></a>
22
+ </h2>
23
+
24
+ <form action="" method="post">
25
+ <table class="form-table">
26
+ <tbody>
27
+ <tr>
28
+ <th><label for="search"><strong><?php esc_html_e( 'Search for: ', 'insr' ); ?></strong></label></th>
29
+ <td><input id="search" type="text" name="search" value="<?php $this->get_search_value() ?>" /></td>
30
+ </tr>
31
+ <tr>
32
+ <th><label for="replace"><strong><?php esc_html_e( 'Replace with: ', 'insr' ); ?></strong></label></th>
33
+ <td><input id="replace" type="text" name="replace" value="<?php $this->get_replace_value() ?>" /></td>
34
+ </tr>
35
+ <tr>
36
+ <th><strong><?php esc_html_e( 'Select tables', 'insr' ); ?></strong></th>
37
+ <td><?php $this->show_table_list(); ?><br>
38
+ <br><input id="select_all_tables" type="checkbox" name="select_all" />
39
+ <label for="select_all_tables">
40
+ <?php esc_html_e( 'Select all tables', 'insr' ) ?>
41
+ </label>
42
+ </td>
43
+ </tr>
44
+
45
+ <tr>
46
+ <th><label for="dry_run"><strong><?php esc_html_e( 'Dry Run', 'insr' ); ?></strong></label></th>
47
+ <td><input type="checkbox" id="dry_run" name="dry_run" checked /></td>
48
+ </tr>
49
+ <tr class="maybe_disabled disabled">
50
+ <th><?php esc_html_e( 'Export SQL file or write changes to DB?', 'insr' ) ?></th>
51
+ <td><input id="radio1" type="radio" name="export_or_save" value="export" checked disabled />
52
+ <label for="radio1"><?php esc_html_e( 'Export SQL file with changes', 'insr' ) ?></label>
53
+ <br><input id="radio2" type="radio" name="export_or_save" value="save_to_db" disabled />
54
+ <label for="radio2"><?php esc_html_e( 'Save changes to Database', 'insr' ) ?></label>
55
+ </td>
56
+ </tr>
57
+ <tr class="maybe_disabled disabled">
58
+ <th><label for="compress"><strong><?php esc_html_e( 'Use GZ compression', 'insr' ); ?></strong></label></th>
59
+ <td><input id="compress" type="checkbox" name="compress" disabled /></td>
60
+ </tr>
61
+
62
+ </tbody>
63
+ </table>
64
+ <?php $this->show_submit_button(); ?>
65
+ </form>
66
+
67
+ </div>
inc/templates/sql_import.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template for displaying sql import page
4
+ */
5
+ // Prevent direct access.
6
+ if ( ! defined( 'INSR_DIR' ) ) {
7
+ echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
8
+ exit;
9
+ }
10
+ ?>
11
+ <div class="wrap">
12
+
13
+ <h1 id="title"><?php esc_html_e( 'Search & Replace', 'insr' ); ?></h1>
14
+
15
+ <h2 class="nav-tab-wrapper">
16
+ <a class="nav-tab " href="<?php echo admin_url() ?>tools.php?page=db_backup"><?php esc_html_e( 'Backup Database', 'insr' ); ?></a>
17
+ <a class="nav-tab " href="<?php echo admin_url() ?>tools.php?page=replace_domain"><?php esc_html_e( 'Replace Domain/URL', 'insr' ); ?></a><a class="nav-tab " href="<?php echo admin_url() ?>/tools.php?page=inpsyde_search_replace"><?php esc_html_e( 'Search and Replace', 'insr' ); ?></a>
18
+ <a class="nav-tab nav-tab-active" href="<?php echo admin_url() ?>tools.php?page=sql_import"><?php esc_html_e( 'Import SQL file', 'insr' ); ?></a>
19
+ <a class="nav-tab" href="<?php echo admin_url() ?>tools.php?page=credits"><?php esc_html_e( 'Credits', 'insr' ); ?></a>
20
+ </h2>
21
+
22
+ <form action="" method="post" enctype="multipart/form-data">
23
+ <table class="form-table">
24
+ <tbody>
25
+ <tr>
26
+ <th><strong><?php esc_html_e( 'Select SQL file to upload. ', 'insr' ); ?></strong></th>
27
+
28
+ <td><input type="file" name="file_to_upload" id="file_to_upload"></td>
29
+ </tr>
30
+ <tr><th></th><td><?php esc_html_e( 'Maximum file size: ', 'insr' );echo $this->file_upload_max_size().'KB'; ?></td></tr>
31
+ </tbody>
32
+ </table>
33
+ <?php $this->show_submit_button(); ?>
34
+ </form>
inspyde-search-replace.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php # -*- coding: utf-8 -*-
2
+ /**
3
+ * Plugin Name: Search & Replace
4
+ * Plugin URI: https://wordpress.org/plugins/search-and-replace/
5
+ * Description: Search & Replace data in your whole WordPress setup, backup and import your database, change table prefix or migrate your domain to another domain.
6
+ * Author: Inpsyde GmbH
7
+ * Author URI: http://inpsyde.com
8
+ * Contributors: s-hinse, derpixler
9
+ * Version: 3.0.0
10
+ * Text Domain: insr
11
+ * Domain Path: /languages
12
+ * License: GPLv3+
13
+ * License URI: license.txt
14
+ */
15
+
16
+ namespace Inpsyde\SearchReplace;
17
+
18
+ register_activation_hook( __FILE__, __NAMESPACE__ . '\activate' );
19
+
20
+ add_action( 'plugins_loaded', __NAMESPACE__ . '\init' );
21
+
22
+ /**
23
+ * Register textdomain.
24
+ */
25
+ function load_textdomain() {
26
+
27
+ $lang_dir = plugin_basename( __DIR__ ) . '/languages/';
28
+
29
+ load_plugin_textdomain( 'insr', FALSE, $lang_dir );
30
+ }
31
+
32
+ /**
33
+ * Run on plugin activation, checks requirements.
34
+ */
35
+ function activate() {
36
+
37
+ load_textdomain();
38
+
39
+ $required_php_version = '5.4.0';
40
+ $correct_php_version = version_compare( phpversion(), $required_php_version, '>=' );
41
+
42
+ if ( ! $correct_php_version ) {
43
+ deactivate_plugins( basename( __FILE__ ) );
44
+
45
+ wp_die(
46
+ '<p>' .
47
+ sprintf(
48
+ esc_attr__( 'This plugin can not be activated because it requires at least PHP version %1$s. ', 'insr' ),
49
+ $required_php_version
50
+ )
51
+ . '</p> <a href="' . admin_url( 'plugins.php' ) . '">' . esc_attr__( 'back', 'insr' ) . '</a>'
52
+ );
53
+
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Load and init in WP Environment.
59
+ */
60
+ function init() {
61
+
62
+ if ( ! is_admin() ) {
63
+ return;
64
+ }
65
+ // This sets the capability needed to run the plugin.
66
+ if ( ! current_user_can( 'manage_options' ) ) {
67
+ return;
68
+ }
69
+
70
+ load_textdomain();
71
+
72
+ // Set up the autoloader.
73
+ require_once( 'inc/Autoloader.php' );
74
+
75
+ $autoloader = new inc\Autoloader( __NAMESPACE__, __DIR__ );
76
+ $autoloader->register();
77
+
78
+ // Start the plugin.
79
+ $plugin = new inc\Init();
80
+ $plugin->run( __FILE__ );
81
+ }
languages/insr-de_DE.mo ADDED
Binary file
languages/insr-de_DE.po ADDED
@@ -0,0 +1,531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WordPress Blank Pot
2
+ # Copyright (C) 2014 ...
3
+ # This file is distributed under the GNU General Public License v2 or later.
4
+ msgid ""
5
+ msgstr ""
6
+ "Project-Id-Version: Inpsyde Search & Replace\n"
7
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/inspyde-search-"
8
+ "replace\n"
9
+ "POT-Creation-Date: 2016-01-29 19:56+0100\n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: Frank Bültge <frank@bueltge.de>\n"
12
+ "Language-Team: Inpsyde GmbH <hello@inpsyde.com>\n"
13
+ "Language: de_DE\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"
19
+ "X-Poedit-SourceCharset: UTF-8\n"
20
+ "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
21
+ "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
22
+ "_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
23
+ "X-Poedit-Basepath: ..\n"
24
+ "X-Generator: Poedit 1.8.4\n"
25
+ "X-Poedit-SearchPath-0: inc\n"
26
+ "X-Poedit-SearchPath-1: inspyde-search-replace.php\n"
27
+
28
+ #: src/inc/Admin.php:70 src/inc/SearchReplaceAdmin.php:153
29
+ msgid "Search pattern not found."
30
+ msgstr "Suchmuster nicht gefunden."
31
+
32
+ #: src/inc/Admin.php:110
33
+ msgid "%s table was processed."
34
+ msgid_plural "%s tables were processed."
35
+ msgstr[0] "%s Tabelle wurde verarbeitet."
36
+ msgstr[1] "%s Tabellen wurden verarbeitet."
37
+
38
+ #: src/inc/Admin.php:120
39
+ msgid "%s cell needs to be updated."
40
+ msgid_plural "%s cells need to be updated."
41
+ msgstr[0] "%s Eintrag muss geändert werden."
42
+ msgstr[1] "%s Einträge müssen geändert werden."
43
+
44
+ #: src/inc/Admin.php:132
45
+ msgid "View details"
46
+ msgstr "Details"
47
+
48
+ #: src/inc/Admin.php:147
49
+ msgid "Table:"
50
+ msgstr "Tabelle"
51
+
52
+ #: src/inc/Admin.php:148
53
+ msgid "Changes:"
54
+ msgstr "Änderungen"
55
+
56
+ #: src/inc/Admin.php:156
57
+ msgid "row"
58
+ msgstr "Zeile"
59
+
60
+ #: src/inc/Admin.php:158
61
+ msgid "column"
62
+ msgstr "Spalte"
63
+
64
+ #: src/inc/Admin.php:170
65
+ msgid "Old value:"
66
+ msgstr "Vorher:"
67
+
68
+ #: src/inc/Admin.php:172
69
+ msgid "New value:"
70
+ msgstr "Nachher:"
71
+
72
+ #: src/inc/Admin.php:223
73
+ msgid "Your SQL file was created!"
74
+ msgstr "Die SQL-Datei wurde erzeugt."
75
+
76
+ #: src/inc/Admin.php:244
77
+ msgid "Errors:"
78
+ msgstr "Fehler:"
79
+
80
+ #: src/inc/DatabaseExporter.php:93
81
+ msgid "Could not open the backup file for writing!"
82
+ msgstr "Konnte die Backup Datei für Import nicht öffnen!"
83
+
84
+ #: src/inc/DatabaseExporter.php:98
85
+ msgid "The backup directory is not writable!"
86
+ msgstr "Das Sicherungsverzeichnis ist nicht beschreibbar!"
87
+
88
+ #: src/inc/DatabaseExporter.php:106
89
+ msgid "WordPress MySQL database backup"
90
+ msgstr "Wordpress MySQL Datenbank-Backup"
91
+
92
+ #: src/inc/DatabaseExporter.php:108
93
+ msgid "Generated: %s"
94
+ msgstr "Generiert: %s"
95
+
96
+ #: src/inc/DatabaseExporter.php:109
97
+ msgid "Hostname: %s"
98
+ msgstr "Hostname: %s"
99
+
100
+ #: src/inc/DatabaseExporter.php:110
101
+ msgid "Database: %s"
102
+ msgstr "Datenbank: %s"
103
+
104
+ #: src/inc/DatabaseExporter.php:113
105
+ msgid "Changed table prefix: From %s to %s "
106
+ msgstr "Ändere Tabellen-Präfix: von %s zu %s"
107
+
108
+ #: src/inc/DatabaseExporter.php:199
109
+ msgid "Table: %s"
110
+ msgstr "Tabelle: %s"
111
+
112
+ #: src/inc/DatabaseExporter.php:203
113
+ msgid "Error getting table details"
114
+ msgstr "Fehler: Keine Tabellendetails gefunden"
115
+
116
+ #: src/inc/DatabaseExporter.php:210
117
+ msgid "Delete any existing table %s"
118
+ msgstr "Lösche existierende Tabelle %s"
119
+
120
+ #: src/inc/DatabaseExporter.php:220
121
+ msgid "Table structure of table %s"
122
+ msgstr "Tabellenstruktur von Tabelle %s"
123
+
124
+ #: src/inc/DatabaseExporter.php:228
125
+ msgid "Error with SHOW CREATE TABLE for %s."
126
+ msgstr "Fehler bei SHOW CREATE TABLE für %s."
127
+
128
+ #: src/inc/DatabaseExporter.php:241
129
+ msgid "Error getting table structure of %s"
130
+ msgstr "Fehler beim Auslesen der Tabellenstruktur von %s"
131
+
132
+ #: src/inc/DatabaseExporter.php:249
133
+ msgid "Data contents of table %s"
134
+ msgstr "Daten von Tabelle %s"
135
+
136
+ #: src/inc/DatabaseExporter.php:341
137
+ msgid "End of data contents of table %s"
138
+ msgstr "Ende der Daten von Tabelle %s"
139
+
140
+ #: src/inc/DatabaseExporter.php:421
141
+ msgid "There was an error writing a line to the backup script:"
142
+ msgstr ""
143
+ "Es ist ein Fehler in einer Zeile beim Erstellen des Backups aufgetreten:"
144
+
145
+ #: src/inc/DatabaseManager.php:64
146
+ msgid "(%s KB)"
147
+ msgstr "(%s KB)"
148
+
149
+ #: src/inc/DbBackupAdmin.php:34
150
+ msgid "Create SQL File"
151
+ msgstr "SQL-Datei erzeugen"
152
+
153
+ #: src/inc/Init.php:89 src/inc/Init.php:90 src/inc/templates/credits.php:17
154
+ #: src/inc/templates/db_backup.php:18 src/inc/templates/replace_domain.php:16
155
+ #: src/inc/templates/search_replace.php:16 src/inc/templates/sql_import.php:16
156
+ msgid "Backup Database"
157
+ msgstr "Datenbank-Backup"
158
+
159
+ #: src/inc/Init.php:93 src/inc/Init.php:94
160
+ msgid "Replace Domain URL"
161
+ msgstr "Domain URL ersetzen"
162
+
163
+ #. Plugin Name of the plugin/theme
164
+ msgid "Search & Replace"
165
+ msgstr "Suchen und Ersetzen"
166
+
167
+ #: src/inc/Init.php:101 src/inc/Init.php:102
168
+ msgid "SQL Import"
169
+ msgstr "SQL Import"
170
+
171
+ #: src/inc/Init.php:105 src/inc/Init.php:106 src/inc/templates/credits.php:25
172
+ #: src/inc/templates/db_backup.php:34 src/inc/templates/replace_domain.php:20
173
+ #: src/inc/templates/search_replace.php:21 src/inc/templates/sql_import.php:19
174
+ msgid "Credits"
175
+ msgstr "Herausgeber"
176
+
177
+ #: src/inc/Replace.php:205
178
+ msgid "Error updating row: %d."
179
+ msgstr "Importieren für Zeile fehlgeschlagen: %d."
180
+
181
+ #: src/inc/ReplaceDomainAdmin.php:38 src/inc/SearchReplaceAdmin.php:112
182
+ msgid "Do Search & Replace"
183
+ msgstr "Suche und Ersetze"
184
+
185
+ #: src/inc/ReplaceDomainAdmin.php:55
186
+ msgid "Replace Field should not be empty."
187
+ msgstr "Das Feld \"Ersetze mit\" sollte nicht leer sein."
188
+
189
+ #: src/inc/SearchReplaceAdmin.php:131
190
+ msgid ""
191
+ "Dry run is selected. No changes were made to the database and no SQL file "
192
+ "was written ."
193
+ msgstr ""
194
+ "Testlauf ist ausgewählt. Es wurden keine Änderungen an der Datenbank "
195
+ "vorgenommen und keine SQL-Datei geschrieben."
196
+
197
+ #: src/inc/SearchReplaceAdmin.php:138
198
+ msgid "The following changes were made to the database: "
199
+ msgstr "Folgende Änderungen wurden in die Datenbank geschrieben: "
200
+
201
+ #: src/inc/SearchReplaceAdmin.php:166
202
+ msgid "No Tables were selected."
203
+ msgstr "Es wurden keine Tabellen ausgewählt."
204
+
205
+ #: src/inc/SearchReplaceAdmin.php:174
206
+ msgid "Search field is empty."
207
+ msgstr "\"Suche nach\"-Feld ist leer."
208
+
209
+ #: src/inc/SearchReplaceAdmin.php:185
210
+ msgid ""
211
+ "Your search contains your current site url. Replacing your site url will "
212
+ "most likely cause your site to break. If you want to change the URL (and you "
213
+ "know what you doing), please use the export function and make sure you "
214
+ "backup your database before reimporting the changed SQL."
215
+ msgstr ""
216
+ "Dein Suchbegriff enthält die aktuelle URL deiner Seite. Wenn du deine Seiten-"
217
+ "URL ersetzt, funktioniert deine Seite wahrscheinlich nicht mehr. Wenn du die "
218
+ "URL trotzdem ersetzen willst (und du weißt, was du tust), benutze bitte die "
219
+ "Exportfunktion. Mache unbedingt ein Backup deiner Datenbank, bevor du das "
220
+ "geänderte SQL importierst."
221
+
222
+ #: src/inc/SqlImportAdmin.php:41 src/inc/templates/credits.php:23
223
+ #: src/inc/templates/db_backup.php:30 src/inc/templates/replace_domain.php:19
224
+ #: src/inc/templates/search_replace.php:20 src/inc/templates/sql_import.php:18
225
+ msgid "Import SQL file"
226
+ msgstr "SQL-Datei importieren"
227
+
228
+ #: src/inc/SqlImportAdmin.php:70
229
+ msgid "The file has neither '.gz' nor '.sql' Extension. Import not possible."
230
+ msgstr ""
231
+ "Die Datei hat weder die Erweiterung '.gz' noch '.sql'. Import nicht möglich."
232
+
233
+ #: src/inc/SqlImportAdmin.php:84
234
+ msgid "The file does not seem to be a valid SQL file. Import not possible."
235
+ msgstr ""
236
+ "Diese Datei ist anscheinend keine gültige SQL-Datei. Import nicht möglich."
237
+
238
+ #: src/inc/SqlImportAdmin.php:93
239
+ msgid "The SQL file was successfully imported. %s SQL queries were performed."
240
+ msgstr ""
241
+ "Die SQL-Datei wurde erfolgreich importiert %s SQL-Abfragen wurden ausgeführt."
242
+
243
+ #: src/inc/SqlImportAdmin.php:102
244
+ msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
245
+ msgstr ""
246
+ "Die Datei überschreitet die maximale Dateigröße (upload_max_filesize) in der "
247
+ "php.ini."
248
+
249
+ #: src/inc/SqlImportAdmin.php:103
250
+ msgid ""
251
+ "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
252
+ "the HTML form"
253
+ msgstr ""
254
+ "Die hochgeladene Datei übersteigt die MAX_FILE_SIZE Vorgabe, welches im "
255
+ "Formular angegeben wurde."
256
+
257
+ #: src/inc/SqlImportAdmin.php:105
258
+ msgid "The uploaded file was only partially uploaded"
259
+ msgstr "Die Datei wurde leider nur teilweise hochgeladen."
260
+
261
+ #: src/inc/SqlImportAdmin.php:106
262
+ msgid "No file was uploaded."
263
+ msgstr "Es wurde keine Datei hochgeladen."
264
+
265
+ #: src/inc/SqlImportAdmin.php:107
266
+ msgid "Missing a temporary folder."
267
+ msgstr "Temporärer Ordner fehlt."
268
+
269
+ #: src/inc/SqlImportAdmin.php:108
270
+ msgid "Failed to write file to disk."
271
+ msgstr "Fehler beim Schreiben der Datei."
272
+
273
+ #: src/inc/SqlImportAdmin.php:109
274
+ msgid "A PHP extension stopped the file upload."
275
+ msgstr "Eine PHP Erweiterung hat den Dateiupload blockiert."
276
+
277
+ #: src/inc/templates/credits.php:19 src/inc/templates/db_backup.php:22
278
+ #: src/inc/templates/replace_domain.php:17
279
+ #: src/inc/templates/search_replace.php:17 src/inc/templates/sql_import.php:17
280
+ msgid "Replace Domain/URL"
281
+ msgstr "Domain URL ersetzen"
282
+
283
+ #: src/inc/templates/credits.php:21 src/inc/templates/db_backup.php:26
284
+ #: src/inc/templates/replace_domain.php:18
285
+ #: src/inc/templates/search_replace.php:19 src/inc/templates/sql_import.php:17
286
+ msgid "Search and Replace"
287
+ msgstr "Suchen und Ersetzen"
288
+
289
+ #: src/inc/templates/credits.php:28
290
+ msgid "Hey nice to have you here!"
291
+ msgstr "Schön das du hier bist!"
292
+
293
+ #: src/inc/templates/credits.php:30
294
+ msgid ""
295
+ "Search and Replace is refactored in 2015 by <a href=\"%1$s\">Inpsyde GmbH</"
296
+ "a>, maintained since 2006 and based on the original from <a href=\"%2$s"
297
+ "\">Mark Cunningham</a>."
298
+ msgstr ""
299
+ "Das Plugin Search & Replace wurde 2015 von <a href=\"%1$s\">Inpsyde GmbH</a> "
300
+ "überarbeitet, gewartet seit 2006 und basiert auf dem Original von <a href="
301
+ "\"%2$s\">Mark Cunningham</a> ."
302
+
303
+ #: src/inc/templates/credits.php:35
304
+ msgid "You rock! contribute the plugin."
305
+ msgstr "Du bist super! Unterstütze dieses Plugin."
306
+
307
+ #: src/inc/templates/credits.php:37
308
+ msgid ""
309
+ "You can contribute the Plugin go to the repository on <a href=\"%s\">github</"
310
+ "a> making changes, create issues or submitting changes."
311
+ msgstr ""
312
+ "Du kannst an diesem Plugin mitarbeiten. Du findest unser Repository auf <a "
313
+ "href=\"%s\">github</a>. Schlage Änderungen vor, melde Fehler oder löse "
314
+ "offene Issues."
315
+
316
+ #: src/inc/templates/credits.php:41
317
+ msgid "We are Inpsyde"
318
+ msgstr "Wir sind Inpsyde"
319
+
320
+ #: src/inc/templates/credits.php:42
321
+ msgid ""
322
+ "Inpsyde has developed enterprise solutions with the world’s most popular "
323
+ "open-source CMS since it was a kitten. Still do, inconvincible convinced."
324
+ msgstr ""
325
+ "Inpsyde entwickelt Enterprise Lösungen mit dem weltweit populärstem open-"
326
+ "source CMS seit es in den Kinderschuhen steckt. Unbelehrbar überzeugt."
327
+
328
+ #: src/inc/templates/credits.php:44
329
+ msgid ""
330
+ "Inpsyde is a WordPress <a href=\"%1$s\">VIP Service Partner</a> and <a href="
331
+ "\"%2$s\">WooCommerce Expert</a>."
332
+ msgstr ""
333
+ "Inpsyde ist ein WordPress <a href=\"%1$s\">VIP Service Partner</a> und <a "
334
+ "href=\"%2$s\">WooCommerce Expert</a>."
335
+
336
+ #: src/inc/templates/credits.php:49
337
+ msgid "Look at our other <a href=\"%s\">free WordPress plugins</a>."
338
+ msgstr ""
339
+ "Schau dir auch unsere anderen <a href=\"%s\">free WordPress plugins</a> an."
340
+
341
+ #: src/inc/templates/credits.php:54
342
+ msgid "Working at Inpsyde"
343
+ msgstr "Arbeiten bei Inpsyde"
344
+
345
+ #: src/inc/templates/credits.php:55
346
+ msgid ""
347
+ "The biggest WordPress enterprise in Europe we’re dynamically growing and "
348
+ "constantly looking for new employees. So do you want to shape WordPress in "
349
+ "an interesting and exciting working environment? Here we are!"
350
+ msgstr ""
351
+ "Als größte WordPress-Agentur Europas wachsen wir dynamisch und suchen "
352
+ "regelmäßig Verstärkung. Willst du Open Source mitgestalten, in einem "
353
+ "spannenden Arbeitsumfeld?"
354
+
355
+ #: src/inc/templates/credits.php:56
356
+ msgid ""
357
+ "At the moment we’re looking for developers for WordPress based products and "
358
+ "services. If you’re not a developer and want to be part of us, we’d be happy "
359
+ "to recieve your unsolicited application. At Inpsyde you can expect an open, "
360
+ "modern and lively company culture:"
361
+ msgstr ""
362
+ "Aktuell suchen wir Entwickler_innen für WordPress-basierte Produkte und "
363
+ "Services. Aber auch andere Initiativbewerbungen sind gerne gesehen. Bei "
364
+ "Inpsyde erwartet Dich eine offene, moderne und lebendige Unternehmenskultur:"
365
+
366
+ #: src/inc/templates/credits.php:58
367
+ msgid "challenging and exciting projects"
368
+ msgstr "Herausfordernde und spannende Projekte"
369
+
370
+ #: src/inc/templates/credits.php:59
371
+ msgid "flexible working hours in remote office"
372
+ msgstr "Flexible Arbeitszeiten im Remote-Office"
373
+
374
+ #: src/inc/templates/credits.php:60
375
+ msgid "deliberately flat hierarchies and short decision paths"
376
+ msgstr "Flache Hierarchien mit kurzen Entscheidungswegen"
377
+
378
+ #: src/inc/templates/credits.php:61
379
+ msgid "a wide variety of tasks"
380
+ msgstr "Abwechslungsreiche Aufgaben"
381
+
382
+ #: src/inc/templates/credits.php:62
383
+ msgid "freedom for personal development and responsible, self-reliant action"
384
+ msgstr ""
385
+ "Freiräume für die persönliche Gestaltung und eigenverantwortliches Handeln"
386
+
387
+ #: src/inc/templates/credits.php:66
388
+ msgid ""
389
+ "If you love open source and especially WordPress, if you love to organize "
390
+ "your working days by yourself and want to use your pragmatic problem-solving "
391
+ "skills and result-oriented work methods: <a href=\"%s\">join our team</a>!"
392
+ msgstr ""
393
+ "Wenn du WordPress und Open Source lebst, Deinen Arbeitstag gerne frei und "
394
+ "selbständig organisierst, lösungs- sowie ergebnisorientiert arbeitest und "
395
+ "zuverlässig bist, dann komm zu uns! Schau dir unsere aktuellen Job-Angebote "
396
+ "an und sende Deine Bewerbung über <a href=\"%s\">unsere Site</a>."
397
+
398
+ #: src/inc/templates/db_backup.php:38
399
+ msgid "Create a backup of your database by clicking \"Create SQL File\"."
400
+ msgstr ""
401
+ "Erstelle ein Backup deiner Datenbank, indem du auf \"SQL-Datei erzeugen\" "
402
+ "klickst."
403
+
404
+ #: src/inc/templates/replace_domain.php:23
405
+ msgid ""
406
+ "If you want to migrate your site to another domain, enter the new URL in the "
407
+ "field \"Replace with\" and create a backup of your database by clicking "
408
+ "\"Create SQL File\"."
409
+ msgstr ""
410
+ "Wenn du deine Website zu einer anderen Domain umziehen willst, gib die neue "
411
+ "URL in das Feld \"Ersetzen durch\" ein und erstelle ein Backup deiner "
412
+ "Datenbank durch Klick auf \"SQL-Datei erzeugen\"."
413
+
414
+ #: src/inc/templates/replace_domain.php:32
415
+ #: src/inc/templates/search_replace.php:28
416
+ msgid "Search for: "
417
+ msgstr "Suchen nach: "
418
+
419
+ #: src/inc/templates/replace_domain.php:36
420
+ #: src/inc/templates/search_replace.php:32
421
+ msgid "Replace with: "
422
+ msgstr "Ersetzen durch: "
423
+
424
+ #: src/inc/templates/replace_domain.php:37
425
+ msgid "New URL"
426
+ msgstr "Neue URL"
427
+
428
+ #: src/inc/templates/replace_domain.php:40
429
+ msgid "Change database prefix"
430
+ msgstr "Datenbank-Präfix ändern"
431
+
432
+ #: src/inc/templates/replace_domain.php:44
433
+ msgid "Current prefix: "
434
+ msgstr "Aktuelles Prefix:"
435
+
436
+ #: src/inc/templates/replace_domain.php:48
437
+ msgid "New prefix: "
438
+ msgstr "Neues Prefix:"
439
+
440
+ #: src/inc/templates/replace_domain.php:49
441
+ msgid "New database prefix"
442
+ msgstr "Neues Datenbank-Präfix"
443
+
444
+ #: src/inc/templates/search_replace.php:36
445
+ msgid "Select tables"
446
+ msgstr "Tabellen auswählen"
447
+
448
+ #: src/inc/templates/search_replace.php:40
449
+ msgid "Select all tables"
450
+ msgstr "Alle Tabellen auswählen"
451
+
452
+ #: src/inc/templates/search_replace.php:46
453
+ msgid "Dry Run"
454
+ msgstr "Testlauf"
455
+
456
+ #: src/inc/templates/search_replace.php:50
457
+ msgid "Export SQL file or write changes to DB?"
458
+ msgstr ""
459
+ "Eine SQL-Datei exportieren oder die Änderungen in die Datenbank schreiben?"
460
+
461
+ #: src/inc/templates/search_replace.php:52
462
+ msgid "Export SQL file with changes"
463
+ msgstr "SQL-Datei mit Änderungen exportieren"
464
+
465
+ #: src/inc/templates/search_replace.php:54
466
+ msgid "Save changes to Database"
467
+ msgstr "Änderungen in die Datenbank schreiben"
468
+
469
+ #: src/inc/templates/search_replace.php:58
470
+ msgid "Use GZ compression"
471
+ msgstr "GZ-Kompression benutzen"
472
+
473
+ #: src/inc/templates/sql_import.php:26
474
+ msgid "Select SQL file to upload. "
475
+ msgstr "SQL-Datei für den Upload auswählen. "
476
+
477
+ #: src/inc/templates/sql_import.php:30
478
+ msgid "Maximum file size: "
479
+ msgstr "Maximale Dateigröße: "
480
+
481
+ #: src/inspyde-search-replace.php:48
482
+ msgid ""
483
+ "This plugin can not be activated because it requires at least PHP version "
484
+ "%1$s. "
485
+ msgstr ""
486
+ "Das Plugin kann nicht aktiviert werden, da es mindestens PHP-Version %1$s "
487
+ "erfordert. "
488
+
489
+ #: src/inspyde-search-replace.php:51
490
+ msgid "back"
491
+ msgstr "zurück"
492
+
493
+ #. Plugin URI of the plugin/theme
494
+ msgid "https://wordpress.org/plugins/search-and-replace/"
495
+ msgstr "https://wordpress.org/plugins/search-and-replace/"
496
+
497
+ #. Description of the plugin/theme
498
+ msgid ""
499
+ "Search & Replace data in your whole WordPress setup, backup and import your "
500
+ "database, change table prefix or migrate your domain to another domain."
501
+ msgstr ""
502
+ "Suche & Ersetze Daten in deinem kompletten WordPress Umfeld, Backup und "
503
+ "Import deiner Datenbank, ändere den Tabellen-Prefix oder Migriere deine "
504
+ "Domain in eine andere Domain."
505
+
506
+ #. Author of the plugin/theme
507
+ msgid "Inpsyde GmbH"
508
+ msgstr "Inpsyde GmbH"
509
+
510
+ #. Author URI of the plugin/theme
511
+ msgid "http://inpsyde.com"
512
+ msgstr "http://inpsyde.com"
513
+
514
+ #~ msgid "<b>Mysqli Error:</b> "
515
+ #~ msgstr "<b>Mysqli Fehler:</b> "
516
+
517
+ #~ msgid "Upload Error: "
518
+ #~ msgstr "Fehler beim Upload: "
519
+
520
+ #~ msgid "Inpsyde Search & Replace"
521
+ #~ msgstr "Suchen & Ersetzen"
522
+
523
+ #~ msgid "Inpsyde Search Replace"
524
+ #~ msgstr "Inpsyde Suchen und Ersetzen"
525
+
526
+ #~ msgid ""
527
+ #~ "<p><strong>%d</strong> tables were processed, <strong>%d</strong> cells "
528
+ #~ "were found that need to be updated.</p>"
529
+ #~ msgstr ""
530
+ #~ "<p><strong>%d</strong> Tabellen wurden verarbeitet, es wurden <strong>%d</"
531
+ #~ "strong> Zellen gefunden, die aktualisiert werden müssen.</p>"
languages/insr.pot ADDED
@@ -0,0 +1,458 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 Inpsyde GmbH
2
+ # This file is distributed under the GPLv3+.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Search & Replace 3.0.0\n"
6
+ "Report-Msgid-Bugs-To: "
7
+ "https://wordpress.org/support/plugin/inspyde-search-replace\n"
8
+ "POT-Creation-Date: 2016-01-29 19:10:42+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=utf-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "X-Generator: grunt-wp-i18n 0.5.3\n"
16
+ "X-Poedit-KeywordsList: "
17
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
18
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
19
+ "Poedit: \n"
20
+
21
+ #: src/inc/Admin.php:70 src/inc/SearchReplaceAdmin.php:154
22
+ msgid "Search pattern not found."
23
+ msgstr ""
24
+
25
+ #: src/inc/Admin.php:110
26
+ msgid "%s table was processed."
27
+ msgid_plural "%s tables were processed."
28
+ msgstr[0] ""
29
+ msgstr[1] ""
30
+
31
+ #: src/inc/Admin.php:120
32
+ msgid "%s cell needs to be updated."
33
+ msgid_plural "%s cells need to be updated."
34
+ msgstr[0] ""
35
+ msgstr[1] ""
36
+
37
+ #: src/inc/Admin.php:132
38
+ msgid "View details"
39
+ msgstr ""
40
+
41
+ #: src/inc/Admin.php:147
42
+ msgid "Table:"
43
+ msgstr ""
44
+
45
+ #: src/inc/Admin.php:148
46
+ msgid "Changes:"
47
+ msgstr ""
48
+
49
+ #: src/inc/Admin.php:156
50
+ msgid "row"
51
+ msgstr ""
52
+
53
+ #: src/inc/Admin.php:158
54
+ msgid "column"
55
+ msgstr ""
56
+
57
+ #: src/inc/Admin.php:170
58
+ msgid "Old value:"
59
+ msgstr ""
60
+
61
+ #: src/inc/Admin.php:172
62
+ msgid "New value:"
63
+ msgstr ""
64
+
65
+ #: src/inc/Admin.php:223
66
+ msgid "Your SQL file was created!"
67
+ msgstr ""
68
+
69
+ #: src/inc/Admin.php:244
70
+ msgid "Errors:"
71
+ msgstr ""
72
+
73
+ #: src/inc/DatabaseExporter.php:95
74
+ msgid "Could not open the backup file for writing!"
75
+ msgstr ""
76
+
77
+ #: src/inc/DatabaseExporter.php:100
78
+ msgid "The backup directory is not writable!"
79
+ msgstr ""
80
+
81
+ #: src/inc/DatabaseExporter.php:108
82
+ msgid "WordPress MySQL database backup"
83
+ msgstr ""
84
+
85
+ #: src/inc/DatabaseExporter.php:110
86
+ msgid "Generated: %s"
87
+ msgstr ""
88
+
89
+ #: src/inc/DatabaseExporter.php:111
90
+ msgid "Hostname: %s"
91
+ msgstr ""
92
+
93
+ #: src/inc/DatabaseExporter.php:112
94
+ msgid "Database: %s"
95
+ msgstr ""
96
+
97
+ #: src/inc/DatabaseExporter.php:115
98
+ msgid "Changed table prefix: From %s to %s "
99
+ msgstr ""
100
+
101
+ #: src/inc/DatabaseExporter.php:201
102
+ msgid "Table: %s"
103
+ msgstr ""
104
+
105
+ #: src/inc/DatabaseExporter.php:205
106
+ msgid "Error getting table details"
107
+ msgstr ""
108
+
109
+ #: src/inc/DatabaseExporter.php:212
110
+ msgid "Delete any existing table %s"
111
+ msgstr ""
112
+
113
+ #: src/inc/DatabaseExporter.php:222
114
+ msgid "Table structure of table %s"
115
+ msgstr ""
116
+
117
+ #: src/inc/DatabaseExporter.php:230
118
+ msgid "Error with SHOW CREATE TABLE for %s."
119
+ msgstr ""
120
+
121
+ #: src/inc/DatabaseExporter.php:243
122
+ msgid "Error getting table structure of %s"
123
+ msgstr ""
124
+
125
+ #: src/inc/DatabaseExporter.php:251
126
+ msgid "Data contents of table %s"
127
+ msgstr ""
128
+
129
+ #: src/inc/DatabaseExporter.php:343
130
+ msgid "End of data contents of table %s"
131
+ msgstr ""
132
+
133
+ #: src/inc/DatabaseExporter.php:423
134
+ msgid "There was an error writing a line to the backup script:"
135
+ msgstr ""
136
+
137
+ #: src/inc/DatabaseManager.php:64
138
+ msgid "(%s KB)"
139
+ msgstr ""
140
+
141
+ #: src/inc/DbBackupAdmin.php:34
142
+ msgid "Create SQL File"
143
+ msgstr ""
144
+
145
+ #: src/inc/Init.php:89 src/inc/Init.php:90 src/inc/templates/credits.php:17
146
+ #: src/inc/templates/db_backup.php:18 src/inc/templates/replace_domain.php:16
147
+ #: src/inc/templates/search_replace.php:16 src/inc/templates/sql_import.php:16
148
+ msgid "Backup Database"
149
+ msgstr ""
150
+
151
+ #: src/inc/Init.php:93 src/inc/Init.php:94
152
+ msgid "Replace Domain URL"
153
+ msgstr ""
154
+
155
+ #. Plugin Name of the plugin/theme
156
+ msgid "Search & Replace"
157
+ msgstr ""
158
+
159
+ #: src/inc/Init.php:101 src/inc/Init.php:102
160
+ msgid "SQL Import"
161
+ msgstr ""
162
+
163
+ #: src/inc/Init.php:105 src/inc/Init.php:106 src/inc/templates/credits.php:25
164
+ #: src/inc/templates/db_backup.php:34 src/inc/templates/replace_domain.php:20
165
+ #: src/inc/templates/search_replace.php:21 src/inc/templates/sql_import.php:19
166
+ msgid "Credits"
167
+ msgstr ""
168
+
169
+ #: src/inc/Replace.php:205
170
+ msgid "Error updating row: %d."
171
+ msgstr ""
172
+
173
+ #: src/inc/ReplaceDomainAdmin.php:38 src/inc/SearchReplaceAdmin.php:113
174
+ msgid "Do Search & Replace"
175
+ msgstr ""
176
+
177
+ #: src/inc/ReplaceDomainAdmin.php:55
178
+ msgid "Replace Field should not be empty."
179
+ msgstr ""
180
+
181
+ #: src/inc/SearchReplaceAdmin.php:132
182
+ msgid ""
183
+ "Dry run is selected. No changes were made to the database and no SQL file "
184
+ "was written ."
185
+ msgstr ""
186
+
187
+ #: src/inc/SearchReplaceAdmin.php:139
188
+ msgid "The following changes were made to the database: "
189
+ msgstr ""
190
+
191
+ #: src/inc/SearchReplaceAdmin.php:167
192
+ msgid "No Tables were selected."
193
+ msgstr ""
194
+
195
+ #: src/inc/SearchReplaceAdmin.php:175
196
+ msgid "Search field is empty."
197
+ msgstr ""
198
+
199
+ #: src/inc/SearchReplaceAdmin.php:186
200
+ msgid ""
201
+ "Your search contains your current site url. Replacing your site url will "
202
+ "most likely cause your site to break. If you want to change the URL (and "
203
+ "you know what you doing), please use the export function and make sure you "
204
+ "backup your database before reimporting the changed SQL."
205
+ msgstr ""
206
+
207
+ #: src/inc/SqlImportAdmin.php:41 src/inc/templates/credits.php:23
208
+ #: src/inc/templates/db_backup.php:30 src/inc/templates/replace_domain.php:19
209
+ #: src/inc/templates/search_replace.php:20 src/inc/templates/sql_import.php:18
210
+ msgid "Import SQL file"
211
+ msgstr ""
212
+
213
+ #: src/inc/SqlImportAdmin.php:70
214
+ msgid "The file has neither '.gz' nor '.sql' Extension. Import not possible."
215
+ msgstr ""
216
+
217
+ #: src/inc/SqlImportAdmin.php:84
218
+ msgid "The file does not seem to be a valid SQL file. Import not possible."
219
+ msgstr ""
220
+
221
+ #: src/inc/SqlImportAdmin.php:93
222
+ msgid "The SQL file was successfully imported. %s SQL queries were performed."
223
+ msgstr ""
224
+
225
+ #: src/inc/SqlImportAdmin.php:102
226
+ msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
227
+ msgstr ""
228
+
229
+ #: src/inc/SqlImportAdmin.php:103
230
+ msgid ""
231
+ "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
232
+ "the HTML form"
233
+ msgstr ""
234
+
235
+ #: src/inc/SqlImportAdmin.php:105
236
+ msgid "The uploaded file was only partially uploaded"
237
+ msgstr ""
238
+
239
+ #: src/inc/SqlImportAdmin.php:106
240
+ msgid "No file was uploaded."
241
+ msgstr ""
242
+
243
+ #: src/inc/SqlImportAdmin.php:107
244
+ msgid "Missing a temporary folder."
245
+ msgstr ""
246
+
247
+ #: src/inc/SqlImportAdmin.php:108
248
+ msgid "Failed to write file to disk."
249
+ msgstr ""
250
+
251
+ #: src/inc/SqlImportAdmin.php:109
252
+ msgid "A PHP extension stopped the file upload."
253
+ msgstr ""
254
+
255
+ #: src/inc/templates/credits.php:19 src/inc/templates/db_backup.php:22
256
+ #: src/inc/templates/replace_domain.php:17
257
+ #: src/inc/templates/search_replace.php:17 src/inc/templates/sql_import.php:17
258
+ msgid "Replace Domain/URL"
259
+ msgstr ""
260
+
261
+ #: src/inc/templates/credits.php:21 src/inc/templates/db_backup.php:26
262
+ #: src/inc/templates/replace_domain.php:18
263
+ #: src/inc/templates/search_replace.php:19 src/inc/templates/sql_import.php:17
264
+ msgid "Search and Replace"
265
+ msgstr ""
266
+
267
+ #: src/inc/templates/credits.php:28
268
+ msgid "Hey nice to have you here!"
269
+ msgstr ""
270
+
271
+ #: src/inc/templates/credits.php:30
272
+ msgid ""
273
+ "Search and Replace is refactored in 2015 by <a href=\"%1$s\">Inpsyde "
274
+ "GmbH</a>, maintained since 2006 and based on the original from <a "
275
+ "href=\"%2$s\">Mark Cunningham</a>."
276
+ msgstr ""
277
+
278
+ #: src/inc/templates/credits.php:35
279
+ msgid "You rock! contribute the plugin."
280
+ msgstr ""
281
+
282
+ #: src/inc/templates/credits.php:37
283
+ msgid ""
284
+ "You can contribute the Plugin go to the repository on <a "
285
+ "href=\"%s\">github</a> making changes, create issues or submitting changes."
286
+ msgstr ""
287
+
288
+ #: src/inc/templates/credits.php:41
289
+ msgid "We are Inpsyde"
290
+ msgstr ""
291
+
292
+ #: src/inc/templates/credits.php:42
293
+ msgid ""
294
+ "Inpsyde has developed enterprise solutions with the world’s most popular "
295
+ "open-source CMS since it was a kitten. Still do, inconvincible convinced."
296
+ msgstr ""
297
+
298
+ #: src/inc/templates/credits.php:44
299
+ msgid ""
300
+ "Inpsyde is a WordPress <a href=\"%1$s\">VIP Service Partner</a> and <a "
301
+ "href=\"%2$s\">WooCommerce Expert</a>."
302
+ msgstr ""
303
+
304
+ #: src/inc/templates/credits.php:49
305
+ msgid "Look at our other <a href=\"%s\">free WordPress plugins</a>."
306
+ msgstr ""
307
+
308
+ #: src/inc/templates/credits.php:54
309
+ msgid "Working at Inpsyde"
310
+ msgstr ""
311
+
312
+ #: src/inc/templates/credits.php:55
313
+ msgid ""
314
+ "The biggest WordPress enterprise in Europe we’re dynamically growing and "
315
+ "constantly looking for new employees. So do you want to shape WordPress in "
316
+ "an interesting and exciting working environment? Here we are!"
317
+ msgstr ""
318
+
319
+ #: src/inc/templates/credits.php:56
320
+ msgid ""
321
+ "At the moment we’re looking for developers for WordPress based products and "
322
+ "services. If you’re not a developer and want to be part of us, we’d be "
323
+ "happy to recieve your unsolicited application. At Inpsyde you can expect an "
324
+ "open, modern and lively company culture:"
325
+ msgstr ""
326
+
327
+ #: src/inc/templates/credits.php:58
328
+ msgid "challenging and exciting projects"
329
+ msgstr ""
330
+
331
+ #: src/inc/templates/credits.php:59
332
+ msgid "flexible working hours in remote office"
333
+ msgstr ""
334
+
335
+ #: src/inc/templates/credits.php:60
336
+ msgid "deliberately flat hierarchies and short decision paths"
337
+ msgstr ""
338
+
339
+ #: src/inc/templates/credits.php:61
340
+ msgid "a wide variety of tasks"
341
+ msgstr ""
342
+
343
+ #: src/inc/templates/credits.php:62
344
+ msgid "freedom for personal development and responsible, self-reliant action"
345
+ msgstr ""
346
+
347
+ #: src/inc/templates/credits.php:66
348
+ msgid ""
349
+ "If you love open source and especially WordPress, if you love to organize "
350
+ "your working days by yourself and want to use your pragmatic "
351
+ "problem-solving skills and result-oriented work methods: <a "
352
+ "href=\"%s\">join our team</a>!"
353
+ msgstr ""
354
+
355
+ #: src/inc/templates/db_backup.php:38
356
+ msgid "Create a backup of your database by clicking \"Create SQL File\"."
357
+ msgstr ""
358
+
359
+ #: src/inc/templates/replace_domain.php:23
360
+ msgid ""
361
+ "If you want to migrate your site to another domain, enter the new URL in "
362
+ "the field \"Replace with\" and create a backup of your database by clicking "
363
+ "\"Create SQL File\"."
364
+ msgstr ""
365
+
366
+ #: src/inc/templates/replace_domain.php:32
367
+ #: src/inc/templates/search_replace.php:28
368
+ msgid "Search for: "
369
+ msgstr ""
370
+
371
+ #: src/inc/templates/replace_domain.php:36
372
+ #: src/inc/templates/search_replace.php:32
373
+ msgid "Replace with: "
374
+ msgstr ""
375
+
376
+ #: src/inc/templates/replace_domain.php:37
377
+ msgid "New URL"
378
+ msgstr ""
379
+
380
+ #: src/inc/templates/replace_domain.php:40
381
+ msgid "Change database prefix"
382
+ msgstr ""
383
+
384
+ #: src/inc/templates/replace_domain.php:44
385
+ msgid "Current prefix: "
386
+ msgstr ""
387
+
388
+ #: src/inc/templates/replace_domain.php:48
389
+ msgid "New prefix: "
390
+ msgstr ""
391
+
392
+ #: src/inc/templates/replace_domain.php:49
393
+ msgid "New database prefix"
394
+ msgstr ""
395
+
396
+ #: src/inc/templates/search_replace.php:36
397
+ msgid "Select tables"
398
+ msgstr ""
399
+
400
+ #: src/inc/templates/search_replace.php:40
401
+ msgid "Select all tables"
402
+ msgstr ""
403
+
404
+ #: src/inc/templates/search_replace.php:46
405
+ msgid "Dry Run"
406
+ msgstr ""
407
+
408
+ #: src/inc/templates/search_replace.php:50
409
+ msgid "Export SQL file or write changes to DB?"
410
+ msgstr ""
411
+
412
+ #: src/inc/templates/search_replace.php:52
413
+ msgid "Export SQL file with changes"
414
+ msgstr ""
415
+
416
+ #: src/inc/templates/search_replace.php:54
417
+ msgid "Save changes to Database"
418
+ msgstr ""
419
+
420
+ #: src/inc/templates/search_replace.php:58
421
+ msgid "Use GZ compression"
422
+ msgstr ""
423
+
424
+ #: src/inc/templates/sql_import.php:26
425
+ msgid "Select SQL file to upload. "
426
+ msgstr ""
427
+
428
+ #: src/inc/templates/sql_import.php:30
429
+ msgid "Maximum file size: "
430
+ msgstr ""
431
+
432
+ #: src/inspyde-search-replace.php:48
433
+ msgid ""
434
+ "This plugin can not be activated because it requires at least PHP version "
435
+ "%1$s. "
436
+ msgstr ""
437
+
438
+ #: src/inspyde-search-replace.php:51
439
+ msgid "back"
440
+ msgstr ""
441
+
442
+ #. Plugin URI of the plugin/theme
443
+ msgid "https://wordpress.org/plugins/search-and-replace/"
444
+ msgstr ""
445
+
446
+ #. Description of the plugin/theme
447
+ msgid ""
448
+ "Search & Replace data in your whole WordPress setup, backup and import your "
449
+ "database, change table prefix or migrate your domain to another domain."
450
+ msgstr ""
451
+
452
+ #. Author of the plugin/theme
453
+ msgid "Inpsyde GmbH"
454
+ msgstr ""
455
+
456
+ #. Author URI of the plugin/theme
457
+ msgid "http://inpsyde.com"
458
+ msgstr ""
languages/searchandreplace-de_DE.mo DELETED
Binary file
languages/searchandreplace-de_DE.po DELETED
@@ -1,478 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Search &amp; Replace v2.7.0\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2010-06-11 17:38+0100\n"
6
- "PO-Revision-Date: 2014-09-14 19:52:25+0000\n"
7
- "Last-Translator: Frank Bueltge <frank@bueltge.de>\n"
8
- "Language-Team: Team Blogos <WordPress@Blogos.dk>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Generator: CSL v1.x\n"
14
- "X-Poedit-Language: Danish\n"
15
- "X-Poedit-Country: DENMARK\n"
16
- "X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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"
18
- "X-Poedit-Basepath: d:/wordpress/plugins/search-and-replace\n"
19
- "X-Poedit-Bookmarks: \n"
20
- "X-Poedit-SearchPath-0: d:/wordpress/plugins/search-and-replace\n"
21
- "X-Textdomain-Support: yes"
22
-
23
- #: search-and-replace.php:85
24
- #@ default
25
- msgid "Settings"
26
- msgstr "Einstellungen"
27
-
28
- #. translators: plugin header field 'Name'
29
- #: search-and-replace.php:0
30
- #: search-and-replace.php:104
31
- #: search-and-replace.php:850
32
- #@ searchandreplace
33
- msgid "Search &amp; Replace"
34
- msgstr "Suchen &amp; Ersetzen"
35
-
36
- #: search-and-replace.php:510
37
- #@ searchandreplace
38
- msgid "entries found."
39
- msgstr "Eintr&auml;ge gefunden."
40
-
41
- #: search-and-replace.php:786
42
- #@ searchandreplace
43
- msgid "You must specify some text to replace!"
44
- msgstr "Du musst Text spezifizieren, um Text zu ersetzen!"
45
-
46
- #: search-and-replace.php:832
47
- #@ searchandreplace
48
- msgid "Completed successfully!"
49
- msgstr "Erfolgreich durchgef&uuml;hrt!"
50
-
51
- #: search-and-replace.php:921
52
- #@ searchandreplace
53
- msgid "Search in"
54
- msgstr "Suche in"
55
-
56
- #: search-and-replace.php:929
57
- #@ searchandreplace
58
- msgid "Content"
59
- msgstr "Beitr&auml;gen"
60
-
61
- #: search-and-replace.php:947
62
- #@ searchandreplace
63
- msgid "Titles"
64
- msgstr "Title"
65
-
66
- #: search-and-replace.php:956
67
- #@ searchandreplace
68
- msgid "Excerpts"
69
- msgstr "Auszüge"
70
-
71
- #: search-and-replace.php:975
72
- #@ searchandreplace
73
- msgid "Comments content"
74
- msgstr "Kommentarbeitr&auml;gen"
75
-
76
- #: search-and-replace.php:985
77
- #@ searchandreplace
78
- msgid "Comments author"
79
- msgstr "Kommentarautorens"
80
-
81
- #: search-and-replace.php:995
82
- #@ searchandreplace
83
- msgid "Comments author e-mail"
84
- msgstr "Kommentarautoren-E-Mail"
85
-
86
- #: search-and-replace.php:1006
87
- #@ searchandreplace
88
- msgid "Comments author URL"
89
- msgstr "Kommentarautoren-URL"
90
-
91
- #: search-and-replace.php:1027
92
- #@ searchandreplace
93
- msgid "Category description"
94
- msgstr "Kategoriebeschreibung"
95
-
96
- #: search-and-replace.php:1037
97
- #@ searchandreplace
98
- msgid "Tags &amp; Categories"
99
- msgstr "Tags &amp; Kategorien"
100
-
101
- #: search-and-replace.php:1042
102
- #: search-and-replace.php:1052
103
- #: search-and-replace.php:1055
104
- #: search-and-replace.php:1065
105
- #: search-and-replace.php:1076
106
- #: search-and-replace.php:1079
107
- #@ searchandreplace
108
- msgid "and"
109
- msgstr "und"
110
-
111
- #: search-and-replace.php:1071
112
- #@ searchandreplace
113
- msgid "ID"
114
- msgstr "ID"
115
-
116
- #: search-and-replace.php:1097
117
- #@ searchandreplace
118
- msgid "all"
119
- msgstr "alle"
120
-
121
- #: search-and-replace.php:1098
122
- #@ searchandreplace
123
- msgid "none"
124
- msgstr "keine"
125
-
126
- #: search-and-replace.php:911
127
- #: search-and-replace.php:1115
128
- #@ searchandreplace
129
- msgid "Go"
130
- msgstr "Start"
131
-
132
- #: search-and-replace.php:892
133
- #: search-and-replace.php:1106
134
- #@ searchandreplace
135
- msgid "Search for"
136
- msgstr "Suche nach"
137
-
138
- #: search-and-replace.php:492
139
- #@ searchandreplace
140
- msgid "... in table"
141
- msgstr "... in Tabelle"
142
-
143
- #: search-and-replace.php:1085
144
- #@ searchandreplace
145
- msgid "Signups"
146
- msgstr "Anmeldungen"
147
-
148
- #. translators: plugin header field 'PluginURI'
149
- #: search-and-replace.php:0
150
- #@ searchandreplace
151
- msgid "http://wordpress.org/plugins/search-and-replace/"
152
- msgstr ""
153
-
154
- #. translators: plugin header field 'Description'
155
- #: search-and-replace.php:0
156
- #@ searchandreplace
157
- msgid "A simple search to find strings in your database and replace those strings."
158
- msgstr "Eine einfache Suche zum Suchen und Ersetzen von Zeichen in der Datenbank."
159
-
160
- #. translators: plugin header field 'AuthorURI'
161
- #: search-and-replace.php:0
162
- #@ searchandreplace
163
- msgid "http://bueltge.de"
164
- msgstr ""
165
-
166
- #: search-and-replace.php:157
167
- #@ searchandreplace
168
- msgid "Nothing (checkbox) selected to modify!"
169
- msgstr "Keine Checkbox markiert! "
170
-
171
- #: search-and-replace.php:162
172
- #@ searchandreplace
173
- msgid "Searching all"
174
- msgstr "Durchsuche alles"
175
-
176
- #: search-and-replace.php:171
177
- #@ searchandreplace
178
- msgid "Searching & replacing all"
179
- msgstr "Durchsuche und Ersetze alles"
180
-
181
- #: search-and-replace.php:180
182
- #@ searchandreplace
183
- msgid "Searching post content"
184
- msgstr "Suche in Artikeln, Seiten - Content"
185
-
186
- #: search-and-replace.php:194
187
- #@ searchandreplace
188
- msgid "Searching ID"
189
- msgstr "Suche in ID"
190
-
191
- #: search-and-replace.php:246
192
- #@ searchandreplace
193
- msgid "Searching Title"
194
- msgstr "Suche im Title"
195
-
196
- #: search-and-replace.php:266
197
- #@ searchandreplace
198
- msgid "Searching post excerpts"
199
- msgstr "Suche in Artikel Auszügen"
200
-
201
- #: search-and-replace.php:280
202
- #@ searchandreplace
203
- msgid "Searching metadata"
204
- msgstr "Suche in Metadaten"
205
-
206
- #: search-and-replace.php:294
207
- #@ searchandreplace
208
- msgid "Searching comments text"
209
- msgstr "Suche in Kommentaren"
210
-
211
- #: search-and-replace.php:308
212
- #@ searchandreplace
213
- msgid "Searching comments authors"
214
- msgstr "Suche in Kommentar-Autoren"
215
-
216
- #: search-and-replace.php:322
217
- #@ searchandreplace
218
- msgid "Searching comments authors e-mails"
219
- msgstr "Suche in Kommentar-Autoren-E-Mails"
220
-
221
- #: search-and-replace.php:336
222
- #@ searchandreplace
223
- msgid "Searching comments authors URLs"
224
- msgstr "Suche in Kommentar-Autoren-URLs"
225
-
226
- #: search-and-replace.php:350
227
- #@ searchandreplace
228
- msgid "Searching comment counts"
229
- msgstr "Suche in Kommentar-Zählern"
230
-
231
- #: search-and-replace.php:364
232
- #@ searchandreplace
233
- msgid "Searching category descriptions"
234
- msgstr "Suche in Kategorie-Beschreibung"
235
-
236
- #: search-and-replace.php:378
237
- #@ searchandreplace
238
- msgid "Searching tags"
239
- msgstr "Suche in Tags"
240
-
241
- #: search-and-replace.php:398
242
- #@ searchandreplace
243
- msgid "Searching user IDs"
244
- msgstr "Suche in User-ID"
245
-
246
- #: search-and-replace.php:436
247
- #@ searchandreplace
248
- msgid "Searching user logins"
249
- msgstr "Suche in User-Login"
250
-
251
- #: search-and-replace.php:456
252
- #@ searchandreplace
253
- msgid "Searching signups"
254
- msgstr "Suche in Signups"
255
-
256
- #: search-and-replace.php:498
257
- #@ searchandreplace
258
- msgid "The query could not be executed:"
259
- msgstr "Die Query kann nicht ausgeführt werden."
260
-
261
- #: search-and-replace.php:566
262
- #@ searchandreplace
263
- msgid "Collapse All"
264
- msgstr "Alles schließen"
265
-
266
- #: search-and-replace.php:567
267
- #@ searchandreplace
268
- msgid "Expand All"
269
- msgstr "Alle Erweitern"
270
-
271
- #: search-and-replace.php:568
272
- #@ searchandreplace
273
- msgid "Results for"
274
- msgstr "Ergebnis für"
275
-
276
- #: search-and-replace.php:568
277
- #@ searchandreplace
278
- msgid "Please note search text may appear (and be replaced) more than one time in each row."
279
- msgstr "Bitte beachte den Suchtext (ggf. auch der Ersetztext) kann mehr als einmal in jeder Zeile sein."
280
-
281
- #: search-and-replace.php:652
282
- #: search-and-replace.php:887
283
- #: search-and-replace.php:901
284
- #: search-and-replace.php:933
285
- #: search-and-replace.php:943
286
- #: search-and-replace.php:952
287
- #: search-and-replace.php:961
288
- #: search-and-replace.php:970
289
- #: search-and-replace.php:980
290
- #: search-and-replace.php:990
291
- #: search-and-replace.php:1001
292
- #: search-and-replace.php:1012
293
- #: search-and-replace.php:1022
294
- #: search-and-replace.php:1032
295
- #: search-and-replace.php:1043
296
- #: search-and-replace.php:1053
297
- #: search-and-replace.php:1066
298
- #: search-and-replace.php:1077
299
- #: search-and-replace.php:1090
300
- #@ searchandreplace
301
- msgid "Table:"
302
- msgstr "Tabelle:"
303
-
304
- #: search-and-replace.php:653
305
- #@ searchandreplace
306
- msgid "Total rows for"
307
- msgstr "Gesamtzeilen für"
308
-
309
- #: search-and-replace.php:680
310
- #@ default
311
- msgid "Sorry,"
312
- msgstr ""
313
-
314
- #: search-and-replace.php:682
315
- #@ searchandreplace
316
- msgid "is not found in this database"
317
- msgstr "kann in dieser Datenbank nicht gefunden werden."
318
-
319
- #: search-and-replace.php:789
320
- #@ searchandreplace
321
- msgid "Performing search"
322
- msgstr "Suche ausführen"
323
-
324
- #: search-and-replace.php:794
325
- #@ searchandreplace
326
- msgid "and replacement"
327
- msgstr "und ersetze"
328
-
329
- #: search-and-replace.php:797
330
- #@ searchandreplace
331
- msgid "Searching for"
332
- msgstr "Suche nach"
333
-
334
- #: search-and-replace.php:799
335
- #@ searchandreplace
336
- msgid "and replacing with"
337
- msgstr "und ersetzen mit"
338
-
339
- #: search-and-replace.php:862
340
- #@ searchandreplace
341
- msgid "You do not have sufficient permissions to edit plugins for this installation of WordPress."
342
- msgstr "Du hast keine ausreichenden Rechte zum Editieren von Plugins für diese WordPress Installation."
343
-
344
- #: search-and-replace.php:868
345
- #@ searchandreplace
346
- msgid "Global Search &amp; Replace"
347
- msgstr "Globales Suchen &amp; Ersetzen"
348
-
349
- #: search-and-replace.php:871
350
- #@ searchandreplace
351
- msgid "This plugin modifies your database directly!<br /><strong>WARNING: </strong>You <strong>cannot</strong> undo any changes made by this plugin. <strong>It is therefore recommended you backup your database before running this plugin.</strong> <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">There is no warranty for this plugin!</a> <strong>Activate</strong> the plugin <strong>only</strong> if you want to use it!"
352
- msgstr "Dieses Plugin ändert direkt in der Datenbank!<br /><strong>WARNUNG: Du kannst dies nicht rückgängig machen. Erstelle im Vorfeld ein Backup deiner Datenbank!</strong> <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">Es gibt keine Garantie für dieses Plugin!</a> Aktiviere das Plugin nur, wenn du es nutzen willst."
353
-
354
- #: search-and-replace.php:873
355
- #@ searchandreplace
356
- msgid "Text search is case sensitive and has no pattern matching capabilities. This replace function matches raw text so it can be used to replace HTML tags too."
357
- msgstr "Die Text-Suche erkennt Groß-Kleinschreibung (case sensitive) und hat keine Pattern-Matching-Funktionen. Die Funktion zum Ersetzen von Text kann ebenso HTML Tags ersetzen. Beachte, dass die Funktionen keine serialisierten Daten betrachten, unterscheiden kann."
358
-
359
- #: search-and-replace.php:876
360
- #@ searchandreplace
361
- msgid "<strong>Step One:</strong> Use the folllowing search (only) first, for a better understanding of what will happen when you do the replace. The SQL query and tables will be returned with the results. The search uses all fields in all tables! After verifying your results you can use the replace function."
362
- msgstr "<strong>Schritt 1:</strong> Nutze die folgende Suche zuerst für ein besseres Verständnis, wo die Daten in der Datenbank stehen. Die SQL query und die Tabellen zeigen dir die Suche und dessen Ergebnis. Die Suche durchsucht alle Tabellen der Installation! Nach Verifizierung der Suche kannst du deine Daten ggf. ersetzen."
363
-
364
- #: search-and-replace.php:883
365
- #@ searchandreplace
366
- msgid "All - search only!"
367
- msgstr "Alle - Nur Suchen!"
368
-
369
- #: search-and-replace.php:886
370
- #: search-and-replace.php:900
371
- #: search-and-replace.php:932
372
- #: search-and-replace.php:942
373
- #: search-and-replace.php:950
374
- #: search-and-replace.php:960
375
- #: search-and-replace.php:969
376
- #: search-and-replace.php:979
377
- #: search-and-replace.php:989
378
- #: search-and-replace.php:1000
379
- #: search-and-replace.php:1011
380
- #: search-and-replace.php:1021
381
- #: search-and-replace.php:1031
382
- #: search-and-replace.php:1041
383
- #: search-and-replace.php:1050
384
- #: search-and-replace.php:1064
385
- #: search-and-replace.php:1074
386
- #: search-and-replace.php:1089
387
- #@ searchandreplace
388
- msgid "Field:"
389
- msgstr "Feld:"
390
-
391
- #: search-and-replace.php:897
392
- #@ searchandreplace
393
- msgid "All - search and replace!"
394
- msgstr "Alle - Suchen und Ersetzen!"
395
-
396
- #: search-and-replace.php:906
397
- #: search-and-replace.php:1110
398
- #@ searchandreplace
399
- msgid "Replace with"
400
- msgstr "Ersetze mit"
401
-
402
- #: search-and-replace.php:938
403
- #@ searchandreplace
404
- msgid "<abbr title=\"Global Unique Identifier\">GUID</abbr>"
405
- msgstr "<abbr title=\"Global Unique Identifier\">GUID</abbr>"
406
-
407
- #: search-and-replace.php:965
408
- #@ searchandreplace
409
- msgid "Metadata"
410
- msgstr "Metadaten"
411
-
412
- #: search-and-replace.php:1017
413
- #@ searchandreplace
414
- msgid "Comments counter"
415
- msgstr "Kommentarzähler"
416
-
417
- #: search-and-replace.php:1047
418
- #@ searchandreplace
419
- msgid "User ID"
420
- msgstr "User ID"
421
-
422
- #: search-and-replace.php:1060
423
- #@ searchandreplace
424
- msgid "User login"
425
- msgstr "User Login"
426
-
427
- #: search-and-replace.php:1097
428
- #@ searchandreplace
429
- msgid "Check all"
430
- msgstr "Alle"
431
-
432
- #: search-and-replace.php:1098
433
- #@ searchandreplace
434
- msgid "Uncheck all"
435
- msgstr "Keine"
436
-
437
- #: search-and-replace.php:1126
438
- #@ searchandreplace
439
- msgid "Information about this plugin"
440
- msgstr "Informationen zum Plugin"
441
-
442
- #: search-and-replace.php:1129
443
- #@ searchandreplace
444
- msgid "&quot;Search and Replace&quot; original plugin (en) created by <a href='http://thedeadone.net/'>Mark Cunningham</a> and provided (comments) by <a href='http://www.gonahkar.com'>Gonahkar</a>.<br />&quot;Search &amp; Replace&quot;, enhanced by <a href='http://bueltge.de'>Frank Bueltge</a> and current version is also maintained by Ron Guerin."
445
- msgstr "&quot;Search and Replace&quot; - das Original-Plugin wurde durch <a href='http://thedeadone.net/'>Mark Cunningham</a> erstellt und ergänzt durch <a href='http://www.gonahkar.com'>Gonahkar</a>.<br />&quot;Search &amp; Replace&quot;, wurde erweitert und gewartet durch <a href='http://bueltge.de'>Frank Bueltge</a> und die aktuelle Version ist außerdem gewartet durch Ron Guerin."
446
-
447
- #: search-and-replace.php:1131
448
- #@ searchandreplace
449
- msgid "For more information: Visit the <a href='http://wordpress.org/plugins/search-and-replace/'>plugin homepage</a> for further information or to grab the latest version of this plugin."
450
- msgstr "Für mehr Information: Besuche die <a href='http://wordpress.org/plugins/search-and-replace/'>plugin site</a>."
451
-
452
- #. translators: plugin header field 'Author'
453
- #: search-and-replace.php:0
454
- #@ searchandreplace
455
- msgid "Frank Bültge"
456
- msgstr ""
457
-
458
- #. translators: plugin header field 'Version'
459
- #: search-and-replace.php:0
460
- #@ searchandreplace
461
- msgid "2.7.0"
462
- msgstr ""
463
-
464
- #: search-and-replace.php:232
465
- #@ searchandreplace
466
- msgid "Searching <abbr title=\\\"Global Unique Identifier\\\">GUID</abbr>"
467
- msgstr "Suche <abbr title=\\\"Global Unique Identifier\\\">GUID</abbr>"
468
-
469
- #: search-and-replace.php:714
470
- #@ searchandreplace
471
- msgid "Serialized, no changes possible."
472
- msgstr "Serialisiert, kein Ersetzen möglich."
473
-
474
- #: search-and-replace.php:874
475
- #@ searchandreplace
476
- msgid "But it will not replaced strings inside serialized data fields, like option values in the table options."
477
- msgstr "Aber es wird keine Strings ersetzen, die als serialisiertes Datenfeld vorliegt, wie beispielsweise Werte von Optionen in der Tabelle options."
478
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/searchandreplace-xx_XX.pot DELETED
@@ -1,468 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Search &amp; Replace v2.6.6\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2010-06-11 17:38+0100\n"
6
- "PO-Revision-Date: 2014-09-05 20:58:42+0000\n"
7
- "Last-Translator: Frank Bueltge <frank@bueltge.de>\n"
8
- "Language-Team: Team Blogos <WordPress@Blogos.dk>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Generator: CSL v1.x\n"
14
- "X-Poedit-Language: Danish\n"
15
- "X-Poedit-Country: DENMARK\n"
16
- "X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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"
18
- "X-Poedit-Basepath: d:/wordpress/plugins/search-and-replace\n"
19
- "X-Poedit-Bookmarks: \n"
20
- "X-Poedit-SearchPath-0: d:/wordpress/plugins/search-and-replace\n"
21
- "X-Textdomain-Support: yes"
22
-
23
- #: search-and-replace.php:85
24
- #@ default
25
- msgid "Settings"
26
- msgstr "Einstellungen"
27
-
28
- #. translators: plugin header field 'Name'
29
- #: search-and-replace.php:0
30
- #: search-and-replace.php:104
31
- #: search-and-replace.php:798
32
- #@ searchandreplace
33
- msgid "Search &amp; Replace"
34
- msgstr "Suchen &amp; Ersetzen"
35
-
36
- #: search-and-replace.php:509
37
- #@ searchandreplace
38
- msgid "entries found."
39
- msgstr "Eintr&auml;ge gefunden."
40
-
41
- #: search-and-replace.php:735
42
- #@ searchandreplace
43
- msgid "You must specify some text to replace!"
44
- msgstr "Du musst Text spezifizieren, um Text zu ersetzen!"
45
-
46
- #: search-and-replace.php:781
47
- #@ searchandreplace
48
- msgid "Completed successfully!"
49
- msgstr "Erfolgreich durchgef&uuml;hrt!"
50
-
51
- #: search-and-replace.php:868
52
- #@ searchandreplace
53
- msgid "Search in"
54
- msgstr "Suche in"
55
-
56
- #: search-and-replace.php:876
57
- #@ searchandreplace
58
- msgid "Content"
59
- msgstr "Beitr&auml;gen"
60
-
61
- #: search-and-replace.php:894
62
- #@ searchandreplace
63
- msgid "Titles"
64
- msgstr "Title"
65
-
66
- #: search-and-replace.php:903
67
- #@ searchandreplace
68
- msgid "Excerpts"
69
- msgstr "Auszüge"
70
-
71
- #: search-and-replace.php:922
72
- #@ searchandreplace
73
- msgid "Comments content"
74
- msgstr "Kommentarbeitr&auml;gen"
75
-
76
- #: search-and-replace.php:932
77
- #@ searchandreplace
78
- msgid "Comments author"
79
- msgstr "Kommentarautorens"
80
-
81
- #: search-and-replace.php:942
82
- #@ searchandreplace
83
- msgid "Comments author e-mail"
84
- msgstr "Kommentarautoren-E-Mail"
85
-
86
- #: search-and-replace.php:953
87
- #@ searchandreplace
88
- msgid "Comments author URL"
89
- msgstr "Kommentarautoren-URL"
90
-
91
- #: search-and-replace.php:974
92
- #@ searchandreplace
93
- msgid "Category description"
94
- msgstr "Kategoriebeschreibung"
95
-
96
- #: search-and-replace.php:984
97
- #@ searchandreplace
98
- msgid "Tags &amp; Categories"
99
- msgstr "Tags &amp; Kategorien"
100
-
101
- #: search-and-replace.php:989
102
- #: search-and-replace.php:999
103
- #: search-and-replace.php:1002
104
- #: search-and-replace.php:1012
105
- #: search-and-replace.php:1023
106
- #: search-and-replace.php:1026
107
- #@ searchandreplace
108
- msgid "and"
109
- msgstr "und"
110
-
111
- #: search-and-replace.php:1018
112
- #@ searchandreplace
113
- msgid "ID"
114
- msgstr "ID"
115
-
116
- #: search-and-replace.php:1044
117
- #@ searchandreplace
118
- msgid "all"
119
- msgstr "alle"
120
-
121
- #: search-and-replace.php:1045
122
- #@ searchandreplace
123
- msgid "none"
124
- msgstr "keine"
125
-
126
- #: search-and-replace.php:858
127
- #: search-and-replace.php:1062
128
- #@ searchandreplace
129
- msgid "Go"
130
- msgstr "Start"
131
-
132
- #: search-and-replace.php:839
133
- #: search-and-replace.php:1053
134
- #@ searchandreplace
135
- msgid "Search for"
136
- msgstr "Suche nach"
137
-
138
- #: search-and-replace.php:491
139
- #@ searchandreplace
140
- msgid "... in table"
141
- msgstr "... in Tabelle"
142
-
143
- #: search-and-replace.php:1032
144
- #@ searchandreplace
145
- msgid "Signups"
146
- msgstr "Anmeldungen"
147
-
148
- #. translators: plugin header field 'PluginURI'
149
- #: search-and-replace.php:0
150
- #@ searchandreplace
151
- msgid "http://wordpress.org/plugins/search-and-replace/"
152
- msgstr ""
153
-
154
- #. translators: plugin header field 'Description'
155
- #: search-and-replace.php:0
156
- #@ searchandreplace
157
- msgid "A simple search to find strings in your database and replace those strings."
158
- msgstr "Eine einfache Suche zum Suchen und Ersetzen von Zeichen in der Datenbank."
159
-
160
- #. translators: plugin header field 'Author'
161
- #: search-and-replace.php:0
162
- #@ searchandreplace
163
- msgid "Frank Bültge, Ron Guerin"
164
- msgstr ""
165
-
166
- #. translators: plugin header field 'AuthorURI'
167
- #: search-and-replace.php:0
168
- #@ searchandreplace
169
- msgid "http://bueltge.de"
170
- msgstr ""
171
-
172
- #. translators: plugin header field 'Version'
173
- #: search-and-replace.php:0
174
- #@ searchandreplace
175
- msgid "2.6.6"
176
- msgstr ""
177
-
178
- #: search-and-replace.php:156
179
- #@ searchandreplace
180
- msgid "Nothing (checkbox) selected to modify!"
181
- msgstr "Keine Checkbox markiert! "
182
-
183
- #: search-and-replace.php:161
184
- #@ searchandreplace
185
- msgid "Searching all"
186
- msgstr "Durchsuche alles"
187
-
188
- #: search-and-replace.php:170
189
- #@ searchandreplace
190
- msgid "Searching & replacing all"
191
- msgstr "Durchsuche und Ersetze alles"
192
-
193
- #: search-and-replace.php:179
194
- #@ searchandreplace
195
- msgid "Searching post content"
196
- msgstr "Suche in Artikeln, Seiten - Content"
197
-
198
- #: search-and-replace.php:193
199
- #@ searchandreplace
200
- msgid "Searching ID"
201
- msgstr "Suche in ID"
202
-
203
- #: search-and-replace.php:231
204
- #@ searchandreplace
205
- msgid "Searching <acronym title=\\\"Global Unique Identifier\\\">GUID</acronym>"
206
- msgstr "Suche in <acronym title=\\\"Global Unique Identifier\\\">GUID</acronym>"
207
-
208
- #: search-and-replace.php:245
209
- #@ searchandreplace
210
- msgid "Searching Title"
211
- msgstr "Suche im Title"
212
-
213
- #: search-and-replace.php:265
214
- #@ searchandreplace
215
- msgid "Searching post excerpts"
216
- msgstr "Suche in Artikel Auszügen"
217
-
218
- #: search-and-replace.php:279
219
- #@ searchandreplace
220
- msgid "Searching metadata"
221
- msgstr "Suche in Metadaten"
222
-
223
- #: search-and-replace.php:293
224
- #@ searchandreplace
225
- msgid "Searching comments text"
226
- msgstr "Suche in Kommentaren"
227
-
228
- #: search-and-replace.php:307
229
- #@ searchandreplace
230
- msgid "Searching comments authors"
231
- msgstr "Suche in Kommentar-Autoren"
232
-
233
- #: search-and-replace.php:321
234
- #@ searchandreplace
235
- msgid "Searching comments authors e-mails"
236
- msgstr "Suche in Kommentar-Autoren-E-Mails"
237
-
238
- #: search-and-replace.php:335
239
- #@ searchandreplace
240
- msgid "Searching comments authors URLs"
241
- msgstr "Suche in Kommentar-Autoren-URLs"
242
-
243
- #: search-and-replace.php:349
244
- #@ searchandreplace
245
- msgid "Searching comment counts"
246
- msgstr "Suche in Kommentar-Zählern"
247
-
248
- #: search-and-replace.php:363
249
- #@ searchandreplace
250
- msgid "Searching category descriptions"
251
- msgstr "Suche in Kategorie-Beschreibung"
252
-
253
- #: search-and-replace.php:377
254
- #@ searchandreplace
255
- msgid "Searching tags"
256
- msgstr "Suche in Tags"
257
-
258
- #: search-and-replace.php:397
259
- #@ searchandreplace
260
- msgid "Searching user IDs"
261
- msgstr "Suche in User-ID"
262
-
263
- #: search-and-replace.php:435
264
- #@ searchandreplace
265
- msgid "Searching user logins"
266
- msgstr "Suche in User-Login"
267
-
268
- #: search-and-replace.php:455
269
- #@ searchandreplace
270
- msgid "Searching signups"
271
- msgstr "Suche in Signups"
272
-
273
- #: search-and-replace.php:497
274
- #@ searchandreplace
275
- msgid "The query could not be executed:"
276
- msgstr "Die Query kann nicht ausgeführt werden."
277
-
278
- #: search-and-replace.php:564
279
- #@ searchandreplace
280
- msgid "Collapse All"
281
- msgstr "Alles schließen"
282
-
283
- #: search-and-replace.php:565
284
- #@ searchandreplace
285
- msgid "Expand All"
286
- msgstr "Alle Erweitern"
287
-
288
- #: search-and-replace.php:566
289
- #@ searchandreplace
290
- msgid "Results for"
291
- msgstr "Ergebnis für"
292
-
293
- #: search-and-replace.php:566
294
- #@ searchandreplace
295
- msgid "Please note search text may appear (and be replaced) more than one time in each row."
296
- msgstr "Bitte beachte den Suchtext (ggf. auch der Ersetztext) kann mehr als einmal in jeder Zeile sein."
297
-
298
- #: search-and-replace.php:609
299
- #: search-and-replace.php:834
300
- #: search-and-replace.php:848
301
- #: search-and-replace.php:880
302
- #: search-and-replace.php:890
303
- #: search-and-replace.php:899
304
- #: search-and-replace.php:908
305
- #: search-and-replace.php:917
306
- #: search-and-replace.php:927
307
- #: search-and-replace.php:937
308
- #: search-and-replace.php:948
309
- #: search-and-replace.php:959
310
- #: search-and-replace.php:969
311
- #: search-and-replace.php:979
312
- #: search-and-replace.php:990
313
- #: search-and-replace.php:1000
314
- #: search-and-replace.php:1013
315
- #: search-and-replace.php:1024
316
- #: search-and-replace.php:1037
317
- #@ searchandreplace
318
- msgid "Table:"
319
- msgstr "Tabelle:"
320
-
321
- #: search-and-replace.php:610
322
- #@ searchandreplace
323
- msgid "Total rows for"
324
- msgstr "Gesamtzeilen für"
325
-
326
- #: search-and-replace.php:635
327
- #@ default
328
- msgid "Sorry,"
329
- msgstr ""
330
-
331
- #: search-and-replace.php:637
332
- #@ searchandreplace
333
- msgid "is not found in this database"
334
- msgstr "kann in dieser Datenbank nicht gefunden werden."
335
-
336
- #: search-and-replace.php:738
337
- #@ searchandreplace
338
- msgid "Performing search"
339
- msgstr "Suche ausführen"
340
-
341
- #: search-and-replace.php:743
342
- #@ searchandreplace
343
- msgid "and replacement"
344
- msgstr "und ersetze"
345
-
346
- #: search-and-replace.php:746
347
- #@ searchandreplace
348
- msgid "Searching for"
349
- msgstr "Suche nach"
350
-
351
- #: search-and-replace.php:748
352
- #@ searchandreplace
353
- msgid "and replacing with"
354
- msgstr "und ersetzen mit"
355
-
356
- #: search-and-replace.php:810
357
- #@ searchandreplace
358
- msgid "You do not have sufficient permissions to edit plugins for this installation of WordPress."
359
- msgstr "Du hast keine ausreichenden Rechte zum Editieren von Plugins für diese WordPress Installation."
360
-
361
- #: search-and-replace.php:816
362
- #@ searchandreplace
363
- msgid "Global Search &amp; Replace"
364
- msgstr "Globales Suchen &amp; Ersetzen"
365
-
366
- #: search-and-replace.php:819
367
- #@ searchandreplace
368
- msgid "This plugin modifies your database directly!<br /><strong>WARNING: </strong>You <strong>cannot</strong> undo any changes made by this plugin. <strong>It is therefore recommended you backup your database before running this plugin.</strong> <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">There is no warranty for this plugin!</a> <strong>Activate</strong> the plugin <strong>only</strong> if you want to use it!"
369
- msgstr "Dieses Plugin ändert direkt in der Datenbank!<br /><strong>WARNUNG: Du kannst dies nicht rückgängig machen. Erstelle im Vorfeld ein Backup deiner Datenbank!</strong> <a href=\"http://www.gnu.org/licenses/gpl-2.0.txt\">Es gibt keine Garantie für dieses Plugin!</a> Aktiviere das Plugin nur, wenn du es nutzen willst."
370
-
371
- #: search-and-replace.php:821
372
- #@ searchandreplace
373
- msgid "Text search is case sensitive and has no pattern matching capabilities. This replace function matches raw text so it can be used to replace HTML tags too."
374
- msgstr "Die Text-Suche erkennt Groß-Kleinschreibung (case sensitive) und hat keine Pattern-Matching-Funktionen. Die Funktion zum Ersetzen von Text kann ebenso HTML Tags ersetzen. Beachte, dass die Funktionen keine serialisierten Daten betrachten, unterscheiden kann."
375
-
376
- #: search-and-replace.php:823
377
- #@ searchandreplace
378
- msgid "<strong>Step One:</strong> Use the folllowing search (only) first, for a better understanding of what will happen when you do the replace. The SQL query and tables will be returned with the results. The search uses all fields in all tables! After verifying your results you can use the replace function."
379
- msgstr "<strong>Schritt 1:</strong> Nutze die folgende Suche zuerst für ein besseres Verständnis, wo die Daten in der Datenbank stehen. Die SQL query und die Tabellen zeigen dir die Suche und dessen Ergebnis. Die Suche durchsucht alle Tabellen der Installation! Nach Verifizierung der Suche kannst du deine Daten ggf. ersetzen."
380
-
381
- #: search-and-replace.php:830
382
- #@ searchandreplace
383
- msgid "All - search only!"
384
- msgstr "Alle - Nur Suchen!"
385
-
386
- #: search-and-replace.php:833
387
- #: search-and-replace.php:847
388
- #: search-and-replace.php:879
389
- #: search-and-replace.php:889
390
- #: search-and-replace.php:897
391
- #: search-and-replace.php:907
392
- #: search-and-replace.php:916
393
- #: search-and-replace.php:926
394
- #: search-and-replace.php:936
395
- #: search-and-replace.php:947
396
- #: search-and-replace.php:958
397
- #: search-and-replace.php:968
398
- #: search-and-replace.php:978
399
- #: search-and-replace.php:988
400
- #: search-and-replace.php:997
401
- #: search-and-replace.php:1011
402
- #: search-and-replace.php:1021
403
- #: search-and-replace.php:1036
404
- #@ searchandreplace
405
- msgid "Field:"
406
- msgstr "Feld:"
407
-
408
- #: search-and-replace.php:844
409
- #@ searchandreplace
410
- msgid "All - search and replace!"
411
- msgstr "Alle - Suchen und Ersetzen!"
412
-
413
- #: search-and-replace.php:853
414
- #: search-and-replace.php:1057
415
- #@ searchandreplace
416
- msgid "Replace with"
417
- msgstr "Ersetze mit"
418
-
419
- #: search-and-replace.php:885
420
- #@ searchandreplace
421
- msgid "<abbr title=\"Global Unique Identifier\">GUID</abbr>"
422
- msgstr "<abbr title=\"Global Unique Identifier\">GUID</abbr>"
423
-
424
- #: search-and-replace.php:912
425
- #@ searchandreplace
426
- msgid "Metadata"
427
- msgstr "Metadaten"
428
-
429
- #: search-and-replace.php:964
430
- #@ searchandreplace
431
- msgid "Comments counter"
432
- msgstr "Kommentarzähler"
433
-
434
- #: search-and-replace.php:994
435
- #@ searchandreplace
436
- msgid "User ID"
437
- msgstr "User ID"
438
-
439
- #: search-and-replace.php:1007
440
- #@ searchandreplace
441
- msgid "User login"
442
- msgstr "User Login"
443
-
444
- #: search-and-replace.php:1044
445
- #@ searchandreplace
446
- msgid "Check all"
447
- msgstr "Alle"
448
-
449
- #: search-and-replace.php:1045
450
- #@ searchandreplace
451
- msgid "Uncheck all"
452
- msgstr "Keine"
453
-
454
- #: search-and-replace.php:1073
455
- #@ searchandreplace
456
- msgid "Information about this plugin"
457
- msgstr "Informationen zum Plugin"
458
-
459
- #: search-and-replace.php:1076
460
- #@ searchandreplace
461
- msgid "&quot;Search and Replace&quot; original plugin (en) created by <a href='http://thedeadone.net/'>Mark Cunningham</a> and provided (comments) by <a href='http://www.gonahkar.com'>Gonahkar</a>.<br />&quot;Search &amp; Replace&quot;, enhanced by <a href='http://bueltge.de'>Frank Bueltge</a> and current version is also maintained by Ron Guerin."
462
- msgstr "&quot;Search and Replace&quot; - das Original-Plugin wurde durch <a href='http://thedeadone.net/'>Mark Cunningham</a> erstellt und ergänzt durch <a href='http://www.gonahkar.com'>Gonahkar</a>.<br />&quot;Search &amp; Replace&quot;, wurde erweitert und gewartet durch <a href='http://bueltge.de'>Frank Bueltge</a> und die aktuelle Version ist außerdem gewartet durch Ron Guerin."
463
-
464
- #: search-and-replace.php:1078
465
- #@ searchandreplace
466
- msgid "For more information: Visit the <a href='http://wordpress.org/plugins/search-and-replace/'>plugin homepage</a> for further information or to grab the latest version of this plugin."
467
- msgstr "Für mehr Information: Besuche die <a href='http://wordpress.org/plugins/search-and-replace/'>plugin site</a>."
468
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
license.txt CHANGED
@@ -1,281 +1,674 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
-
7
- Everyone is permitted to copy and distribute verbatim copies
8
- of this license document, but changing it is not allowed.
9
-
10
- Preamble
11
-
12
- The licenses for most software are designed to take away your
13
- freedom to share and change it. By contrast, the GNU General Public
14
- License is intended to guarantee your freedom to share and change free
15
- software--to make sure the software is free for all its users. This
16
- General Public License applies to most of the Free Software
17
- Foundation's software and to any other program whose authors commit to
18
- using it. (Some other Free Software Foundation software is covered by
19
- the GNU Library General Public License instead.) You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- this service if you wish), that you receive source code or can get it
26
- if you want it, that you can change the software or use pieces of it
27
- in new free programs; and that you know you can do these things.
28
-
29
- To protect your rights, we need to make restrictions that forbid
30
- anyone to deny you these rights or to ask you to surrender the rights.
31
- These restrictions translate to certain responsibilities for you if you
32
- distribute copies of the software, or if you modify it.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must give the recipients all the rights that
36
- you have. You must make sure that they, too, receive or can get the
37
- source code. And you must show them these terms so they know their
38
- rights.
39
-
40
- We protect your rights with two steps: (1) copyright the software, and
41
- (2) offer you this license which gives you legal permission to copy,
42
- distribute and/or modify the software.
43
-
44
- Also, for each author's protection and ours, we want to make certain
45
- that everyone understands that there is no warranty for this free
46
- software. If the software is modified by someone else and passed on, we
47
- want its recipients to know that what they have is not the original, so
48
- that any problems introduced by others will not reflect on the original
49
- authors' reputations.
50
-
51
- Finally, any free program is threatened constantly by software
52
- patents. We wish to avoid the danger that redistributors of a free
53
- program will individually obtain patent licenses, in effect making the
54
- program proprietary. To prevent this, we have made it clear that any
55
- patent must be licensed for everyone's free use or not licensed at all.
56
-
57
- The precise terms and conditions for copying, distribution and
58
- modification follow.
59
-
60
- GNU GENERAL PUBLIC LICENSE
61
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
-
63
- 0. This License applies to any program or other work which contains
64
- a notice placed by the copyright holder saying it may be distributed
65
- under the terms of this General Public License. The "Program", below,
66
- refers to any such program or work, and a "work based on the Program"
67
- means either the Program or any derivative work under copyright law:
68
- that is to say, a work containing the Program or a portion of it,
69
- either verbatim or with modifications and/or translated into another
70
- language. (Hereinafter, translation is included without limitation in
71
- the term "modification".) Each licensee is addressed as "you".
72
-
73
- Activities other than copying, distribution and modification are not
74
- covered by this License; they are outside its scope. The act of
75
- running the Program is not restricted, and the output from the Program
76
- is covered only if its contents constitute a work based on the
77
- Program (independent of having been made by running the Program).
78
- Whether that is true depends on what the Program does.
79
-
80
- 1. You may copy and distribute verbatim copies of the Program's
81
- source code as you receive it, in any medium, provided that you
82
- conspicuously and appropriately publish on each copy an appropriate
83
- copyright notice and disclaimer of warranty; keep intact all the
84
- notices that refer to this License and to the absence of any warranty;
85
- and give any other recipients of the Program a copy of this License
86
- along with the Program.
87
-
88
- You may charge a fee for the physical act of transferring a copy, and
89
- you may at your option offer warranty protection in exchange for a fee.
90
-
91
- 2. You may modify your copy or copies of the Program or any portion
92
- of it, thus forming a work based on the Program, and copy and
93
- distribute such modifications or work under the terms of Section 1
94
- above, provided that you also meet all of these conditions:
95
-
96
- a) You must cause the modified files to carry prominent notices
97
- stating that you changed the files and the date of any change.
98
-
99
- b) You must cause any work that you distribute or publish, that in
100
- whole or in part contains or is derived from the Program or any
101
- part thereof, to be licensed as a whole at no charge to all third
102
- parties under the terms of this License.
103
-
104
- c) If the modified program normally reads commands interactively
105
- when run, you must cause it, when started running for such
106
- interactive use in the most ordinary way, to print or display an
107
- announcement including an appropriate copyright notice and a
108
- notice that there is no warranty (or else, saying that you provide
109
- a warranty) and that users may redistribute the program under
110
- these conditions, and telling the user how to view a copy of this
111
- License. (Exception: if the Program itself is interactive but
112
- does not normally print such an announcement, your work based on
113
- the Program is not required to print an announcement.)
114
-
115
- These requirements apply to the modified work as a whole. If
116
- identifiable sections of that work are not derived from the Program,
117
- and can be reasonably considered independent and separate works in
118
- themselves, then this License, and its terms, do not apply to those
119
- sections when you distribute them as separate works. But when you
120
- distribute the same sections as part of a whole which is a work based
121
- on the Program, the distribution of the whole must be on the terms of
122
- this License, whose permissions for other licensees extend to the
123
- entire whole, and thus to each and every part regardless of who wrote it.
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
readme.txt CHANGED
@@ -1,83 +1,96 @@
1
- === Search and Replace ===
2
- Contributors: Bueltge, inpsyde
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RHWH8VG798CSC
4
- Tags: database, mysql, search, replace, admin, security
5
- Requires at least: 3.0
6
- Tested up to: 4.2.2
7
- Stable tag: 2.7.1
8
- License: GPLv2+
9
-
10
- A simple search for find strings in your database and replace the string.
11
-
12
- == Description ==
13
- A simple search for find strings in your database and replace the string. You can search in ID, post-content, GUID, titel, excerpt, meta-data, comments, comment-author, comment-e-mail, comment-url, tags/categories and categories-description. It is possible to replace the user-ID in all tables and the user-login.
14
-
15
- "Search and Replace" Originalplugin ist von [Mark Cunningham](http://thedeadone.net/ "Mark Cunningham") and was advanced (comments and comment-author) by [Gonahkar](http://www.gonahkar.com/ "Gonahkar"). Much more enhanced and maintained by [Frank Bültge](http://bueltge.de) and current version is also maintained by Ron Guerin <ron@vnetworx.net>.
16
-
17
- == Installation ==
18
- = Requirements =
19
- * WordPress version 3.0 and later (tested at 3.5-Beta2 and 3.3.2)
20
-
21
- = Installation =
22
- 1. Unpack the download-package
23
- 1. Upload search-and-replace folder to the `/wp-content/plugins/` directory
24
- 1. Activate the plugin through the 'Plugins' menu in WordPress
25
- 1. Got to Tools -> Search/Replace
26
-
27
- == Screenshots ==
28
- 1. Functions in WordPress 2.7 beta
29
- 1. The search for an string in WordPress 3.1-RC2
30
-
31
- == Other Notes ==
32
- = Acknowledgements =
33
- All existing translation files need to be updated for Search and Replace 2.6.6, please feel free to send me your translation file.
34
-
35
- = License =
36
- Good news, this plugin is free for everyone! Since it's released under the GPL, you can use it free of charge on your personal or commercial blog. But if you enjoy this plugin, you can thank me and leave a [small donation](http://bueltge.de/wunschliste/ "Wishliste and Donate") for the time I've spent writing and supporting this plugin. And I really don't want to know how many hours of my life this plugin has already eaten ;)
37
-
38
- = Translations =
39
- The plugin comes with various translations, please refer to the [WordPress Codex](http://codex.wordpress.org/Installing_WordPress_in_Your_Language "Installing WordPress in Your Language") for more information about activating the translation. If you want to help to translate the plugin to your language, please have a look at the .pot file which contains all definitions and may be used with a [gettext](http://www.gnu.org/software/gettext/) editor like [Poedit](http://www.poedit.net/) (Windows) or plugin for WordPress [Localization](http://wordpress.org/extend/plugins/codestyling-localization/).
40
-
41
-
42
- == Changelog ==
43
- = v2.7.1 (2015-05-28) =
44
- * Fix for changes on database collate since WordPress version 4.2
45
- * Fix to reduce backslashes in search and replace string
46
-
47
- = v2.7.0 (2014-09-14) =
48
- * Exclude serialized data from replace function (maybe we reduce the support)
49
- * Add hint, if is serialized data on the result table
50
- * Fix to see also the result case sensitive
51
-
52
- = v2.6.6 (09/05/2014) =
53
- * *Thanks to [Ron Guerin](http://wordpress.org/support/profile/rong) for help to maintain the plugin*
54
- * Fix to use $wpdb object for all database access
55
- * Fix inability to search and replace quoted strings
56
- * Output changes to clarify when searching vs. searching and replacing
57
- * Some changes to English strings and string identifiers
58
-
59
- = v2.6.5 =
60
- * Fix for change User-ID, add table `comments`
61
-
62
- = v2.6.4 =
63
- * Fix capability check, if the constant `DISALLOW_FILE_EDIT` ist defined
64
-
65
- = v2.6.3 (10/10/2011) =
66
- * filter for return values, html-filter
67
- * add belarussian language
68
- * add romanian language files
69
-
70
- = v2.6.2 (09/11/2011) =
71
- * change right object for use the plugin also on WP smaller 3.0, include 2.9
72
- * add function search and replace in all tables of the database - special care!
73
-
74
- = v2.6.1 (01/25/2011) =
75
- * Feature: Add Signups-Table for WP MU
76
- * Maintenance: check for tables, PHP Warning fix
77
-
78
- = v2.6.0 (01/03/2011) =
79
- * Feature: add an new search for find strings (maybe a new way for search strings)
80
- * Maintenance: small changes on source
81
-
82
- = v2.5.1 (07/07/2010) =
83
- * small changes for use in WP 3.0
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Search & Replace ===
2
+ Contributors: inpsyde, Bueltge, s-hinse, derpixler, Giede
3
+ Tags: search, replace, backup, import, sql, migrate, multisite
4
+ Requires at least: 4.0
5
+ Tested up to: 4.4
6
+ Stable tag: 3.0.0
7
+
8
+ Search & Replace data in your database with WordPress admin, replace domains/URLs of your WordPress installation.
9
+
10
+ == Description ==
11
+ - Backs up your database.
12
+ - Searches for strings in your WordPress database and replaces them, also in serialized objects.
13
+ - Generates a backup of database with changed site URL for site migration.
14
+ - Imports a SQL file into your database.
15
+
16
+ = Features =
17
+ - Search & replace data in your WordPress database
18
+ - Change domain/URL of WordPress installation
19
+ - Handle serialized data
20
+ - Choose dry run or download SQL file
21
+ - Change table prefix
22
+ - Backup & restore your database
23
+ - WordPress Multisite support
24
+ - localized and ready for your own language
25
+
26
+ = Crafted by Inpsyde =
27
+ The team at [Inpsyde](http://inpsyde.com) is engineering the web and WordPress since 2006. And yes, we also run that
28
+ [marketplace for premium WordPress plugins and themes](https://marketpress.com).
29
+
30
+ == Installation ==
31
+ = Requirements =
32
+ - WordPress 4.0 (Single and Multisite)
33
+ - PHP 5.4, newer PHP versions will work faster.
34
+
35
+ == Screenshots ==
36
+ 1. Search and Replace
37
+ 2. Replace Domain/URL
38
+ 3. Restore Database
39
+ 4. Backup Database
40
+ 5. Result screen after search or search and replace
41
+
42
+ == Changelog ==
43
+ = v3.0.0 (2016-01-29) =
44
+ * Refactor the plugin, new requirements, goal and result.
45
+ * *Thanks to [Sven Hinse](https://github.com/s-hinse/) for help to maintain the plugin*
46
+ * Changeable table prefix on replace site URL tab enhancement
47
+ * Implement database backup & import tab
48
+ * Implement dry Run: Keep for search and replace
49
+ * Prevent self destroy
50
+ * Multisite basic support - show only tables of current site
51
+ * Add special tab for replace the URL
52
+ * Supports serialized data
53
+ * Refactor the whole codebase
54
+
55
+ = v2.7.1 (2015-05-28) =
56
+ * Fix for changes on database collate since WordPress version 4.2
57
+ * Fix to reduce backslashes in search and replace string
58
+
59
+ = v2.7.0 (2014-09-14) =
60
+ * Exclude serialized data from replace function (maybe we reduce the support)
61
+ * Add hint, if is serialized data on the result table
62
+ * Fix to see also the result case sensitive
63
+
64
+ = v2.6.6 (09/05/2014) =
65
+ * *Thanks to [Ron Guerin](http://wordpress.org/support/profile/rong) for help to maintain the plugin*
66
+ * Fix to use $wpdb object for all database access
67
+ * Fix inability to search and replace quoted strings
68
+ * Output changes to clarify when searching vs. searching and replacing
69
+ * Some changes to English strings and string identifiers
70
+
71
+ = v2.6.5 =
72
+ * Fix for change User-ID, add table `comments`
73
+
74
+ = v2.6.4 =
75
+ * Fix capability check, if the constant `DISALLOW_FILE_EDIT` ist defined
76
+
77
+ = v2.6.3 (10/10/2011) =
78
+ * filter for return values, html-filter
79
+ * add belarussian language
80
+ * add romanian language files
81
+
82
+ = v2.6.2 (09/11/2011) =
83
+ * change right object for use the plugin also on WP smaller 3.0, include 2.9
84
+ * add function search and replace in all tables of the database - special care!
85
+
86
+ = v2.6.1 (01/25/2011) =
87
+ * Feature: Add Signups-Table for WP MU
88
+ * Maintenance: check for tables, PHP Warning fix
89
+
90
+ = v2.6.0 (01/03/2011) =
91
+ * Feature: add an new search for find strings (maybe a new way for search strings)
92
+ * Maintenance: small changes on source
93
+
94
+ = v2.5.1 (07/07/2010) =
95
+ * small changes for use in WP 3.0
96
+ Status API Training Shop Blog About Pricing
search-and-replace.php DELETED
@@ -1,1253 +0,0 @@
1
- <?php
2
- /**
3
- * Plugin Name: Search &amp; Replace
4
- * Text Domain: searchandreplace
5
- * Domain Path: /languages
6
- * Plugin URI: http://wordpress.org/plugins/search-and-replace/
7
- * Description: A simple search to find strings in your database and replace those strings.
8
- * Author: Frank Bültge
9
- * Author URI: http://bueltge.de
10
- * Version: 2.7.1
11
- * License: GPLv2+
12
- * Donate URI:
13
- *
14
- *
15
- * License:
16
- * ==============================================================================
17
- * Copyright 2009 - 2014 Frank Bueltge (email : frank@bueltge.de)
18
- * Hints, maintain updates in 2014 from Ron Guerin <ron@vnetworx.net>
19
- *
20
- * This program is free software; you can redistribute it and/or modify
21
- * it under the terms of the GNU General Public License as published by
22
- * the Free Software Foundation; either version 3 of the License, or
23
- * (at your option) any later version.
24
- *
25
- * This program is distributed in the hope that it will be useful,
26
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
- * GNU General Public License for more details.
29
- *
30
- * You should have received a copy of the GNU General Public License
31
- * along with this program; if not, write to the Free Software
32
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
- *
34
- */
35
-
36
- //avoid direct calls to this file, because now WP core and framework has been used
37
- if ( ! function_exists( 'add_action' ) ) {
38
- header( 'Status: 403 Forbidden' );
39
- header( 'HTTP/1.1 403 Forbidden' );
40
- exit();
41
- }
42
-
43
- // Pre-2.6 compatibility
44
- if ( ! defined( 'WP_CONTENT_URL' ) ) {
45
- define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
46
- }
47
- if ( ! defined( 'WP_CONTENT_DIR' ) ) {
48
- define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
49
- }
50
- if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
51
- define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
52
- }
53
-
54
- // plugin definitions
55
- define( 'FB_SAR_BASENAME', plugin_basename( __FILE__ ) );
56
- define( 'FB_SAR_BASEDIR', dirname( plugin_basename( __FILE__ ) ) );
57
- define( 'FB_SAR_TEXTDOMAIN', 'searchandreplace' );
58
-
59
- function searchandreplace_textdomain() {
60
-
61
- load_plugin_textdomain( FB_SAR_TEXTDOMAIN, FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
62
- }
63
-
64
- /**
65
- * Add action link(s) to plugins page
66
- *
67
- * @return void
68
- */
69
- function searchandreplace_on_load() {
70
-
71
- add_filter( 'plugin_action_links_' . FB_SAR_BASENAME, 'searchandreplace_filter_plugin_meta', 10, 2 );
72
- }
73
-
74
- function searchandreplace_filter_plugin_meta( $links, $file ) {
75
-
76
- if ( empty( $links ) ) {
77
- return NULL;
78
- }
79
-
80
- /* create link */
81
- if ( $file == FB_SAR_BASENAME ) {
82
- array_unshift(
83
- $links,
84
- sprintf( '<a href="tools.php?page=%s">%s</a>', FB_SAR_BASENAME, __( 'Settings' ) )
85
- );
86
- }
87
-
88
- return $links;
89
- }
90
-
91
- /**
92
- * Settings in plugin-admin-page
93
- *
94
- * @return void
95
- */
96
- function searchandreplace_add_settings_page() {
97
-
98
- if ( ! current_user_can( 'manage_options' ) ) {
99
- return;
100
- }
101
-
102
- add_management_page(
103
- __( 'Search &amp; Replace', FB_SAR_TEXTDOMAIN ), __( 'Search &amp; Replace', FB_SAR_TEXTDOMAIN ),
104
- 'manage_options', FB_SAR_BASENAME, 'searchandreplace_page', ''
105
- );
106
- add_action( 'load-plugins.php', 'searchandreplace_on_load' );
107
- }
108
-
109
- add_action( 'plugins_loaded', 'searchandreplace_init' );
110
- /**
111
- * Init to WP
112
- *
113
- * @return void
114
- */
115
- function searchandreplace_init() {
116
-
117
- add_action( 'admin_init', 'searchandreplace_textdomain' );
118
- add_action( 'admin_menu', 'searchandreplace_add_settings_page' );
119
- add_action( 'admin_print_scripts', 'searchandreplace_add_js_head' );
120
- }
121
-
122
- /* this does the important stuff! */
123
- function searchandreplace_doit(
124
- $search_text,
125
- $replace_text,
126
- $sall = TRUE,
127
- $content = TRUE,
128
- $guid = TRUE,
129
- $id = TRUE,
130
- $title = TRUE,
131
- $excerpt = TRUE,
132
- $meta_value = TRUE,
133
- $comment_content = TRUE,
134
- $comment_author = TRUE,
135
- $comment_author_email = TRUE,
136
- $comment_author_url = TRUE,
137
- $comment_count = TRUE,
138
- $cat_description = TRUE,
139
- $tag = TRUE,
140
- $user_id = TRUE,
141
- $user_login = TRUE,
142
- $signups = TRUE
143
- ) {
144
-
145
- global $wpdb;
146
-
147
- $myecho = '';
148
- // slug string
149
- $search_slug = strtolower( $search_text );
150
- $replace_slug = strtolower( $replace_text );
151
-
152
- if ( ! $sall && ! $content && ! $id && ! $guid && ! $title && ! $excerpt && ! $meta_value
153
- &&
154
- ! $comment_content
155
- && ! $comment_author
156
- && ! $comment_author_email
157
- && ! $comment_author_url
158
- && ! $comment_count
159
- &&
160
- ! $cat_description
161
- && ! $tag
162
- && ! $user_id
163
- && ! $user_login
164
- &&
165
- ! $signups
166
- ) {
167
- return '<div class="error"><p><strong>' . __(
168
- 'Nothing (checkbox) selected to modify!', FB_SAR_TEXTDOMAIN
169
- ) . '</strong></p></div><br class="clear" />';
170
- }
171
-
172
- // search at all
173
- if ( 'sall' === $sall ) {
174
- $myecho .= "\n" . '<li>' . __( 'Searching all', FB_SAR_TEXTDOMAIN ) . ' ...';
175
-
176
- $myecho .= "\n" . '<ul>' . "\n";
177
- $myecho .= searchandreplace_sall( $search_text );
178
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
179
- }
180
-
181
- // search/replace at all
182
- if ( 'srall' === $sall ) {
183
- $myecho .= "\n" . '<li>' . __( 'Searching & replacing all', FB_SAR_TEXTDOMAIN ) . ' ...';
184
-
185
- $myecho .= "\n" . '<ul>' . "\n";
186
- $myecho .= searchandreplace_sall( $search_text, $replace_text );
187
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
188
- }
189
-
190
- // post content
191
- if ( $content ) {
192
- $myecho .= "\n" . '<li>' . __( 'Searching post content', FB_SAR_TEXTDOMAIN ) . ' ...';
193
-
194
- $myecho .= "\n" . '<ul>' . "\n";
195
- $myecho .= searchandreplace_results( 'post_content', 'posts', $search_text );
196
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
197
-
198
- $query = "UPDATE $wpdb->posts ";
199
- $query .= "SET post_content = ";
200
- $query .= "REPLACE(post_content, \"$search_text\", \"$replace_text\") ";
201
- $wpdb->get_results( $query );
202
- }
203
-
204
- // post id
205
- if ( $id ) {
206
- $myecho .= "\n" . __( 'Searching ID', FB_SAR_TEXTDOMAIN ) . ' ...';
207
-
208
- $myecho .= "\n" . '<ul>' . "\n";
209
- $myecho .= searchandreplace_results( 'ID', 'posts', $search_text );
210
- $myecho .= searchandreplace_results( 'post_parent', 'posts', $search_text );
211
- $myecho .= searchandreplace_results( 'post_id', 'postmeta', $search_text );
212
- $myecho .= searchandreplace_results( 'object_id', 'term_relationships', $search_text );
213
- $myecho .= searchandreplace_results( 'comment_post_ID', 'comments', $search_text );
214
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
215
-
216
- $query = "UPDATE $wpdb->posts ";
217
- $query .= "SET ID = ";
218
- $query .= "REPLACE(ID, \"$search_text\", \"$replace_text\") ";
219
- $wpdb->get_results( $query );
220
-
221
- $query = "UPDATE $wpdb->posts ";
222
- $query .= "SET post_parent = ";
223
- $query .= "REPLACE(post_parent, \"$search_text\", \"$replace_text\") ";
224
- $wpdb->get_results( $query );
225
-
226
- $query = "UPDATE $wpdb->postmeta ";
227
- $query .= "SET post_id = ";
228
- $query .= "REPLACE(post_id, \"$search_text\", \"$replace_text\") ";
229
- $wpdb->get_results( $query );
230
-
231
- $query = "UPDATE $wpdb->term_relationships ";
232
- $query .= "SET object_id = ";
233
- $query .= "REPLACE(object_id, \"$search_text\", \"$replace_text\") ";
234
- $wpdb->get_results( $query );
235
-
236
- $query = "UPDATE $wpdb->comments ";
237
- $query .= "SET comment_post_ID = ";
238
- $query .= "REPLACE(comment_post_ID, \"$search_text\", \"$replace_text\") ";
239
- $wpdb->get_results( $query );
240
- }
241
-
242
- // post guid
243
- if ( $guid ) {
244
- $myecho .= "\n" . '<li>' . __(
245
- 'Searching <abbr title=\"Global Unique Identifier\">GUID</abbr>', FB_SAR_TEXTDOMAIN
246
- ) . ' ...';
247
-
248
- $myecho .= "\n" . '<ul>' . "\n";
249
- $myecho .= searchandreplace_results( 'guid', 'posts', $search_text );
250
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
251
-
252
- $query = "UPDATE $wpdb->posts ";
253
- $query .= "SET guid = ";
254
- $query .= "REPLACE(guid, \"$search_text\", \"$replace_text\") ";
255
- $wpdb->get_results( $query );
256
- }
257
-
258
- // post title
259
- if ( $title ) {
260
- $myecho .= "\n" . '<li>' . __( 'Searching Title', FB_SAR_TEXTDOMAIN ) . ' ...';
261
-
262
- $myecho .= "\n" . '<ul>' . "\n";
263
- $myecho .= searchandreplace_results( 'post_title', 'posts', $search_text );
264
- $myecho .= searchandreplace_results( 'post_name', 'posts', $search_text );
265
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
266
-
267
- $query = "UPDATE $wpdb->posts ";
268
- $query .= "SET post_title = ";
269
- $query .= "REPLACE(post_title, \"$search_text\", \"$replace_text\") ";
270
- $wpdb->get_results( $query );
271
-
272
- $query = "UPDATE $wpdb->posts ";
273
- $query .= "SET post_name = ";
274
- $query .= "REPLACE(post_name, \"$search_text\", \"$replace_text\") ";
275
- $wpdb->get_results( $query );
276
- }
277
-
278
- // post excerpt
279
- if ( $excerpt ) {
280
- $myecho .= "\n" . '<li>' . __( 'Searching post excerpts', FB_SAR_TEXTDOMAIN ) . ' ...';
281
-
282
- $myecho .= "\n" . '<ul>' . "\n";
283
- $myecho .= searchandreplace_results( 'post_excerpt', 'posts', $search_text );
284
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
285
-
286
- $query = "UPDATE $wpdb->posts ";
287
- $query .= "SET post_excerpt = ";
288
- $query .= "REPLACE(post_excerpt, \"$search_text\", \"$replace_text\") ";
289
- $wpdb->get_results( $query );
290
- }
291
-
292
- // meta_value
293
- if ( $meta_value ) {
294
- $myecho .= "\n" . '<li>' . __( 'Searching metadata', FB_SAR_TEXTDOMAIN ) . ' ...';
295
-
296
- $myecho .= "\n" . '<ul>' . "\n";
297
- $myecho .= searchandreplace_results( 'meta_value', 'postmeta', $search_text );
298
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
299
-
300
- $query = "UPDATE $wpdb->postmeta ";
301
- $query .= "SET meta_value = ";
302
- $query .= "REPLACE(meta_value, \"$search_text\", \"$replace_text\") ";
303
- $wpdb->get_results( $query );
304
- }
305
-
306
- // comment content
307
- if ( $comment_content ) {
308
- $myecho .= "\n" . '<li>' . __( 'Searching comments text', FB_SAR_TEXTDOMAIN ) . ' ...';
309
-
310
- $myecho .= "\n" . '<ul>' . "\n";
311
- $myecho .= searchandreplace_results( 'comment_content', 'comments', $search_text );
312
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
313
-
314
- $query = "UPDATE $wpdb->comments ";
315
- $query .= "SET comment_content = ";
316
- $query .= "REPLACE(comment_content, \"$search_text\", \"$replace_text\") ";
317
- $wpdb->get_results( $query );
318
- }
319
-
320
- // comment_author
321
- if ( $comment_author ) {
322
- $myecho .= "\n" . '<li>' . __( 'Searching comments authors', FB_SAR_TEXTDOMAIN ) . ' ...';
323
-
324
- $myecho .= "\n" . '<ul>' . "\n";
325
- $myecho .= searchandreplace_results( 'comment_author', 'comments', $search_text );
326
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
327
-
328
- $query = "UPDATE $wpdb->comments ";
329
- $query .= "SET comment_author = ";
330
- $query .= "REPLACE(comment_author, \"$search_text\", \"$replace_text\") ";
331
- $wpdb->get_results( $query );
332
- }
333
-
334
- // comment_author_email
335
- if ( $comment_author_email ) {
336
- $myecho .= "\n" . '<li>' . __( 'Searching comments authors e-mails', FB_SAR_TEXTDOMAIN ) . ' ...';
337
-
338
- $myecho .= "\n" . '<ul>' . "\n";
339
- $myecho .= searchandreplace_results( 'comment_author_email', 'comments', $search_text );
340
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
341
-
342
- $query = "UPDATE $wpdb->comments ";
343
- $query .= "SET comment_author_email = ";
344
- $query .= "REPLACE(comment_author_email, \"$search_text\", \"$replace_text\") ";
345
- $wpdb->get_results( $query );
346
- }
347
-
348
- // comment_author_url
349
- if ( $comment_author_url ) {
350
- $myecho .= "\n" . '<li>' . __( 'Searching comments authors URLs', FB_SAR_TEXTDOMAIN ) . ' ...';
351
-
352
- $myecho .= "\n" . '<ul>' . "\n";
353
- $myecho .= searchandreplace_results( 'comment_author_url', 'comments', $search_text );
354
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
355
-
356
- $query = "UPDATE $wpdb->comments ";
357
- $query .= "SET comment_author_url = ";
358
- $query .= "REPLACE(comment_author_url, \"$search_text\", \"$replace_text\") ";
359
- $wpdb->get_results( $query );
360
- }
361
-
362
- // comment_count
363
- if ( $comment_count ) {
364
- $myecho .= "\n" . '<li>' . __( 'Searching comment counts', FB_SAR_TEXTDOMAIN ) . ' ...';
365
-
366
- $myecho .= "\n" . '<ul>' . "\n";
367
- $myecho .= searchandreplace_results( 'comment_count', 'posts', $search_text );
368
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
369
-
370
- $query = "UPDATE $wpdb->posts ";
371
- $query .= "SET comment_count = ";
372
- $query .= "REPLACE(comment_count, \"$search_text\", \"$replace_text\") ";
373
- $wpdb->get_results( $query );
374
- }
375
-
376
- // category description
377
- if ( $cat_description ) {
378
- $myecho .= "\n" . '<li>' . __( 'Searching category descriptions', FB_SAR_TEXTDOMAIN ) . ' ...';
379
-
380
- $myecho .= "\n" . '<ul>' . "\n";
381
- $myecho .= searchandreplace_results( 'description', 'term_taxonomy', $search_text );
382
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
383
-
384
- $query = "UPDATE $wpdb->term_taxonomy ";
385
- $query .= "SET description = ";
386
- $query .= "REPLACE(description, \"$search_text\", \"$replace_text\") ";
387
- $wpdb->get_results( $query );
388
- }
389
-
390
- // tags and category
391
- if ( $tag ) {
392
- $myecho .= "\n" . '<li>' . __( 'Searching tags', FB_SAR_TEXTDOMAIN ) . ' ...';
393
-
394
- $myecho .= "\n" . '<ul>' . "\n";
395
- $myecho .= searchandreplace_results( 'name', 'terms', $search_text );
396
- $myecho .= searchandreplace_results( 'slug', 'terms', $search_slug );
397
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
398
-
399
- $query = "UPDATE $wpdb->terms ";
400
- $query .= "SET name = ";
401
- $query .= "REPLACE(name, \"$search_text\", \"$replace_text\") ";
402
- $wpdb->get_results( $query );
403
-
404
- $query = "UPDATE $wpdb->terms ";
405
- $query .= "SET slug = ";
406
- $query .= "REPLACE(slug, \"$search_slug\", \"$replace_slug\") ";
407
- $wpdb->get_results( $query );
408
- }
409
-
410
- // user_id
411
- if ( $user_id ) {
412
- $myecho .= "\n" . '<li>' . __( 'Searching user IDs', FB_SAR_TEXTDOMAIN ) . ' ...';
413
-
414
- $myecho .= "\n" . '<ul>' . "\n";
415
- $myecho .= searchandreplace_results( 'ID', 'users', $search_text );
416
- $myecho .= searchandreplace_results( 'user_id', 'usermeta', $search_slug );
417
- $myecho .= searchandreplace_results( 'post_author', 'posts', $search_slug );
418
- $myecho .= searchandreplace_results( 'user_id', 'comments', $search_slug );
419
- $myecho .= searchandreplace_results( 'link_owner', 'links', $search_slug );
420
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
421
-
422
- $query = "UPDATE $wpdb->users ";
423
- $query .= "SET ID = ";
424
- $query .= "REPLACE(ID, \"$search_text\", \"$replace_text\") ";
425
- $wpdb->get_results( $query );
426
-
427
- $query = "UPDATE $wpdb->usermeta ";
428
- $query .= "SET user_id = ";
429
- $query .= "REPLACE(user_id, \"$search_slug\", \"$replace_slug\") ";
430
- $wpdb->get_results( $query );
431
-
432
- $query = "UPDATE $wpdb->posts ";
433
- $query .= "SET post_author = ";
434
- $query .= "REPLACE(post_author, \"$search_slug\", \"$replace_slug\") ";
435
- $wpdb->get_results( $query );
436
-
437
- $query = "UPDATE $wpdb->comments ";
438
- $query .= "SET user_id = ";
439
- $query .= "REPLACE(user_id, \"$search_slug\", \"$replace_slug\") ";
440
- $wpdb->get_results( $query );
441
-
442
- $query = "UPDATE $wpdb->links ";
443
- $query .= "SET link_owner = ";
444
- $query .= "REPLACE(link_owner, \"$search_slug\", \"$replace_slug\") ";
445
- $wpdb->get_results( $query );
446
- }
447
-
448
- // user_login
449
- if ( $user_login ) {
450
- $myecho .= "\n" . '<li>' . __( 'Searching user logins', FB_SAR_TEXTDOMAIN ) . ' ...';
451
-
452
- $myecho .= "\n" . '<ul>' . "\n";
453
- $myecho .= searchandreplace_results( 'user_login', 'users', $search_text );
454
- $myecho .= searchandreplace_results( 'user_nicename', 'users', $search_slug );
455
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
456
-
457
- $query = "UPDATE $wpdb->users ";
458
- $query .= "SET user_login = ";
459
- $query .= "REPLACE(user_login, \"$search_text\", \"$replace_text\") ";
460
- $wpdb->get_results( $query );
461
-
462
- $query = "UPDATE $wpdb->users ";
463
- $query .= "SET user_nicename = ";
464
- $query .= "REPLACE(user_nicename, \"$search_slug\", \"$replace_slug\") ";
465
- $wpdb->get_results( $query );
466
- }
467
-
468
- // signups on WP multisite
469
- if ( $signups ) {
470
- $myecho .= "\n" . '<li>' . __( 'Searching signups', FB_SAR_TEXTDOMAIN ) . ' ...';
471
-
472
- $myecho .= "\n" . '<ul>' . "\n";
473
- $myecho .= searchandreplace_results( 'user_login', 'signups', $search_text );
474
- $myecho .= "\n" . '</ul>' . "\n" . '</li>' . "\n";
475
-
476
- $query = "UPDATE $wpdb->signups ";
477
- $query .= "SET user_login = ";
478
- $query .= "REPLACE(user_login, \"$search_text\", \"$replace_text\") ";
479
- $wpdb->get_results( $query );
480
- }
481
-
482
- $echo = '<div class="updated fade">' . "\n" . '<ul>';
483
- $echo .= $myecho;
484
- $echo .= "\n" . '</ul>' . "\n" . '</div><br class="clear"/>' . "\n";
485
-
486
- return $echo;
487
- }
488
-
489
- /**
490
- * Get results
491
- *
492
- * @param $field
493
- * @param $table
494
- * @param $search_text
495
- *
496
- * @return string
497
- */
498
- function searchandreplace_results( $field, $table, $search_text ) {
499
-
500
- global $wpdb;
501
-
502
- $myecho = '';
503
-
504
- $myecho .= "\n" . '<li>';
505
- $results = "SELECT $field FROM " . $wpdb->$table . " WHERE $field LIKE \"%$search_text%\"";
506
- $myecho .= __( '... in table', FB_SAR_TEXTDOMAIN ) . ' ';
507
- $myecho .= '<code>' . $table . '</code>,' . ' Field: <code>' . $field . '</code>: ';
508
- $results = $wpdb->get_results( $results, ARRAY_A );
509
- $total_results = $wpdb->num_rows;
510
-
511
- if ( $results === FALSE ) {
512
- $myecho .= __( 'The query could not be executed:', FB_SAR_TEXTDOMAIN ) . ' ' . $wpdb->print_error();
513
- } else {
514
-
515
- if ( $total_results == 0 ) {
516
- $myecho .= ' - <strong>' . $total_results . '</strong> ';
517
- } else {
518
- foreach ( $results as $result ) {
519
- //echo $row[$field] . "\n";
520
- $myecho .= '|';
521
- }
522
- $myecho .= ' - <strong>' . $total_results . '</strong> ';
523
- }
524
- $myecho .= __( 'entries found.', FB_SAR_TEXTDOMAIN );
525
- $myecho .= '</li>' . "\n";
526
- }
527
-
528
- return $myecho;
529
- }
530
-
531
- function searchandreplace_sall( $search_text, $replace_text = FALSE ) {
532
-
533
- global $wpdb;
534
-
535
- if ( ! defined( 'DB_COLLATE' ) || '' === DB_COLLATE ) {
536
- $db_collate = 'utf8mb4_unicode_ci';
537
- } elseif ( 'utf8' === DB_CHARSET ) {
538
- $db_collate = 'utf8mb4_unicode_ci';
539
- } else {
540
- $db_collate = DB_COLLATE;
541
- }
542
-
543
- if ( empty( $wpdb->dbname ) ) {
544
- $wpdb->dbname = DB_NAME;
545
- }
546
-
547
- $search_text = esc_sql( $search_text ); # this appears to be escaped already
548
- $search_text = stripslashes_deep( $search_text );
549
-
550
- if ( $replace_text ) {
551
- $replace_text = esc_sql( $replace_text );
552
- } # this appears to be escaped already
553
- $replace_text = stripslashes_deep( $replace_text );
554
-
555
- $result_in_tables = 0;
556
-
557
- $myecho = '
558
- <script language="JavaScript">
559
- var table_id = new Array();
560
-
561
- function hide_all() {
562
- for(i=0;i<table_id.length;i++){
563
- document.getElementById(table_id[i]).style.display = \'none\';
564
- }
565
- }
566
-
567
- function show_all() {
568
- for(i=0;i<table_id.length;i++){
569
- document.getElementById(table_id[i]).style.display = \'block\';
570
- }
571
- }
572
-
573
- function toggle(id) {
574
- if (get_style(id,\'display\') == \'block\') {
575
- document.getElementById(id).style.display = \'none\';
576
- } else {
577
- document.getElementById(id).style.display = \'block\';
578
- }
579
- }
580
-
581
- function get_style(el,styleProp) {
582
- var x = document.getElementById(el);
583
- if (x.currentStyle)
584
- var y = x.currentStyle[styleProp];
585
- else if (window.getComputedStyle)
586
- var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
587
- return y;
588
- }
589
- </script>';
590
-
591
- $myecho .= '<p><a href="javascript:hide_all()">' . __( 'Collapse All', FB_SAR_TEXTDOMAIN ) . '</a>
592
- <a href="javascript:show_all()">' . __( 'Expand All', FB_SAR_TEXTDOMAIN ) . '</a></p>';
593
- $myecho .= '<p>' . __( 'Results for', FB_SAR_TEXTDOMAIN ) . ': <code>' . stripslashes(
594
- $search_text
595
- ) . '</code></p><p>' . __(
596
- 'Please note search text may appear (and be replaced) more than one time in each row.', FB_SAR_TEXTDOMAIN
597
- ) . '</p>';
598
-
599
- $sql = 'SHOW TABLES';
600
- $tables = $wpdb->get_results( $sql, ARRAY_A );
601
-
602
- $replace_sql = '';
603
-
604
- for ( $i = 0; $i < count( $tables ); $i ++ ) {
605
- //@abstract query building of each table
606
- if ( $wpdb->get_var( "SELECT COUNT(*) FROM " . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] ) > 0 ) {
607
- //@abstract get the table data type information
608
- $sql = 'desc ' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ];
609
- $column = $wpdb->get_results( $sql, ARRAY_A );
610
-
611
- $search_sql = 'SELECT * FROM ' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . ' WHERE ';
612
- // replace string
613
- if ( $replace_text ) {
614
- $replace_sql = 'UPDATE ' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . ' SET ';
615
- }
616
- $no_varchar_field = 0;
617
-
618
- for ( $j = 0; $j < count( $column ); $j ++ ) {
619
-
620
- if ( $no_varchar_field != 0 ) {
621
- $search_sql .= 'or ';
622
-
623
- //if ( $replace_text ) {
624
- // $replace_sql .= ', ';
625
- //}
626
-
627
- }
628
-
629
- // COLLATE utf8_bin for search case sensitive
630
- $search_sql .= '`' . $column[ $j ][ 'Field' ] . '` like \'%' . $search_text . '%\' COLLATE ' . $db_collate . ' ';
631
-
632
- if ( $replace_text ) {
633
-
634
- $search_result = $wpdb->get_results( $search_sql, ARRAY_A );
635
-
636
- // Loop about the result and check for serialized data
637
- // Unset serialized data, no changes
638
- foreach ( $search_result as $key => $values ) {
639
-
640
- foreach ( $values as $field => $value ) {
641
- if ( is_serialized( $value ) ) {
642
- /*
643
- $value = @unserialize( $value );
644
- $value = json_decode(
645
- str_replace( $search_text, $replace_text, json_encode( $value ) )
646
- );
647
- $value = serialize( $value );
648
- */
649
-
650
- if ( isset( $column[ $j ][ 'Field' ] ) && $field === $column[ $j ][ 'Field' ] ) {
651
- unset( $column[ $j ][ 'Field' ] );
652
- }
653
- }
654
- }
655
-
656
- }
657
-
658
- if ( ! empty( $column[ $j ][ 'Field' ] ) ) {
659
- $replace_sql .= $column[ $j ][ 'Field' ] . ' = ';
660
- // Note that when searching for text to replace, MySQL uses case-sensitive match to perform search for string to be replaced.
661
- $replace_sql .= 'REPLACE(' . $column[ $j ][ 'Field' ] . ', "' . $search_text . '", "' . $replace_text . '"), ';
662
- }
663
- }
664
-
665
- $no_varchar_field ++;
666
- }
667
-
668
- if ( $no_varchar_field > 0 ) {
669
-
670
- $search_result = $wpdb->get_results( $search_sql, ARRAY_A );
671
- if ( $replace_text ) {
672
- $replace_sql = rtrim( $replace_sql, ", " );
673
- $wpdb->get_results( $replace_sql, ARRAY_A );
674
- }
675
-
676
- if ( count( $search_result ) ) {
677
- $result_in_tables ++;
678
-
679
- $myecho .= '<p><strong>' . __(
680
- 'Table:', FB_SAR_TEXTDOMAIN
681
- ) . ' </strong><code>' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '</code> ... ';
682
- $myecho .= __( 'Total rows for', FB_SAR_TEXTDOMAIN ) . ' <code>"' . stripslashes(
683
- $search_text
684
- ) . '"</code>: <strong>' . $wpdb->num_rows . '</strong></p>';
685
- $myecho .= '<p><a href="javascript:toggle(\'' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '_sql' . '\')">SQL</a></p>';
686
- $myecho .= '<script language="JavaScript">
687
- table_id.push("' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '_sql");
688
- </script>';
689
- // Display sql statement
690
- $sql = $search_sql;
691
- if ( $replace_text ) {
692
- $sql = $replace_sql;
693
- }
694
- $myecho .= '<div id="' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '_sql" style="display:none;"><code>' . $sql . '</code></div>';
695
- $myecho .= '<p><a href="javascript:toggle(\'' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '_wrapper' . '\')">Result</a></p>';
696
- $myecho .= '<script language="JavaScript">
697
- table_id.push("' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '_wrapper");
698
- </script>';
699
- $myecho .= '<div id="' . $tables[ $i ][ 'Tables_in_' . $wpdb->dbname ] . '_wrapper" style="display:none;">';
700
-
701
- $myecho .= searchandreplace_table_arrange( $search_result );
702
- $myecho .= '</div>';
703
- }// @endof showing found search
704
-
705
- }
706
-
707
- }
708
- }
709
-
710
- if ( ! $result_in_tables ) {
711
- $myecho = '<p><code>' . esc_attr( $search_sql ) . '</code></p>';
712
- $myecho .= '<p style="color:red;">' . __( 'Sorry,' ) . ' <code>' .
713
- stripslashes_deep( stripslashes_deep( htmlentities2( $search_text ) ) ) . '</code> ' .
714
- __( 'is not found in this database', FB_SAR_TEXTDOMAIN ) .
715
- '(<code>' . $wpdb->dbname . '</code>)!</p>';
716
- }
717
-
718
- return $myecho;
719
- }
720
-
721
- /**
722
- * Taking the mySQL the result array and return html Table in a string.
723
- * Showing the search content with different css class.
724
- *
725
- * @param $array
726
- *
727
- * @return string
728
- */
729
- function searchandreplace_table_arrange( $array ) {
730
-
731
- $table_data = ''; // @abstract returning table
732
- $max = 0; // @abstract max length of a row
733
- $max_i = 0; // @abstract number of the row which is maximum max length of a row
734
-
735
- $search_text = $_POST[ "search_text" ];
736
-
737
- for ( $i = 0; $i < count( $array ); $i ++ ) {
738
- //@abstract table row
739
- $table_data .= '<tr class=' . ( ( $i & 1 ) ? '"alternate"' : '""' ) . ' >';
740
- $j = 0;
741
-
742
- foreach ( $array[ $i ] as $key => $data ) {
743
-
744
- $hint = '';
745
- if ( is_serialized( $data ) ) {
746
- $hint = '<div class="error below-h2 form-invalid">' . __(
747
- 'Serialized, no changes possible.', FB_SAR_TEXTDOMAIN
748
- ) . '</div>';
749
- }
750
-
751
- $data = preg_replace(
752
- "|($search_text)|U", "<code style=\"background:#ffc516;padding:0 4px;\"><b>$1</b></code>",
753
- htmlspecialchars( $data )
754
- );
755
- $table_data .= '<td>' . $hint . $data . ' &nbsp;</td>';
756
- $j ++;
757
- }
758
-
759
- if ( $max < $j ) {
760
- $max = $j;
761
- $max_i = $i;
762
- }
763
-
764
- $table_data .= '</tr>' . "\n";
765
- }
766
-
767
- unset( $data );
768
- // @endof html table
769
-
770
- //@abstract populating the table head
771
-
772
- // @varname $data_a
773
- //@abstract taking the highest sized array and printing the key name.
774
- $data_a = $array[ $max_i ];
775
-
776
- $table_head = '<tr>';
777
- foreach ( $data_a as $key => $value ) {
778
- $table_head .= '<th>' . $key . '</th>';
779
- }
780
-
781
- $table_head .= '</tr>' . "\n";
782
-
783
- // @abstract printing the table data
784
- return '<div class="table_bor">
785
- <table class="widefat">'
786
- . '<thead>' . $table_head . '</thead>'
787
- . '<tbody>' . $table_data . '</tbody>'
788
- . '</table>
789
- </div>';
790
- }
791
-
792
- /**
793
- * add js to the head that fires the 'new node' function
794
- */
795
- function searchandreplace_add_js_head() {
796
-
797
- ?>
798
- <script type="text/javascript">
799
- /* <![CDATA[ */
800
- function selectcb( thisobj, var1 ) {
801
- var i = 0;
802
- var o = document.forms[ thisobj ].elements;
803
- if ( o ) {
804
- for ( i = 0; i < o.length; i++ ) {
805
- if ( o[ i ].type == 'checkbox' ) {
806
- o[ i ].checked = var1;
807
- }
808
- }
809
- }
810
- }
811
- /* ]]> */
812
- </script>
813
- <?php
814
- }
815
-
816
- function searchandreplace_action() {
817
-
818
- if ( isset( $_POST[ 'submitted' ] ) ) {
819
- check_admin_referer( 'searchandreplace_nonce' );
820
- $myecho = '';
821
- if ( empty( $_POST[ 'search_text' ] ) ) {
822
- $myecho .= '<div class="error"><p><strong>&raquo; ' . __(
823
- 'You must specify some text to replace!', FB_SAR_TEXTDOMAIN
824
- ) . '</strong></p></div><br class="clear">';
825
- } else {
826
- $myecho .= '<div class="updated fade">';
827
- $myecho .= '<p><strong>&raquo; ' . __( 'Performing search', FB_SAR_TEXTDOMAIN );
828
- if ( ! isset( $_POST[ 'sall' ] ) ) {
829
- $_POST[ 'sall' ] = NULL;
830
- }
831
- if ( $_POST[ 'sall' ] == 'srall' ) {
832
- $myecho .= ' ' . __( 'and replacement', FB_SAR_TEXTDOMAIN );
833
- }
834
- $myecho .= ' ...</strong></p>';
835
- $myecho .= '<p>&raquo; ' . __( 'Searching for', FB_SAR_TEXTDOMAIN ) . ' <code>' . stripslashes(
836
- htmlentities2( $_POST[ 'search_text' ] )
837
- ) . '</code>';
838
- if ( isset( $_POST[ 'replace_text' ] ) && $_POST[ 'sall' ] == 'srall' ) {
839
- $myecho .= __( 'and replacing with', FB_SAR_TEXTDOMAIN ) . ' <code>' . stripslashes(
840
- htmlentities2( $_POST[ 'replace_text' ] )
841
- ) . '</code></p>';
842
- }
843
- $myecho .= '</div><br class="clear" />';
844
-
845
- if ( ! isset( $_POST[ 'replace_text' ] ) ) {
846
- $_POST[ 'replace_text' ] = NULL;
847
- }
848
-
849
- $error = searchandreplace_doit(
850
- $_POST[ 'search_text' ],
851
- $_POST[ 'replace_text' ],
852
- $_POST[ 'sall' ],
853
- isset( $_POST[ 'content' ] ),
854
- isset( $_POST[ 'guid' ] ),
855
- isset( $_POST[ 'id' ] ),
856
- isset( $_POST[ 'title' ] ),
857
- isset( $_POST[ 'excerpt' ] ),
858
- isset( $_POST[ 'meta_value' ] ),
859
- isset( $_POST[ 'comment_content' ] ),
860
- isset( $_POST[ 'comment_author' ] ),
861
- isset( $_POST[ 'comment_author_email' ] ),
862
- isset( $_POST[ 'comment_author_url' ] ),
863
- isset( $_POST[ 'comment_count' ] ),
864
- isset( $_POST[ 'cat_description' ] ),
865
- isset( $_POST[ 'tag' ] ),
866
- isset( $_POST[ 'user_id' ] ),
867
- isset( $_POST[ 'user_login' ] ),
868
- isset( $_POST[ 'singups' ] )
869
- );
870
-
871
- if ( $error != '' ) {
872
- $myecho .= $error;
873
- } else {
874
- $myecho .= '<p>' . __( 'Completed successfully!', FB_SAR_TEXTDOMAIN ) . '</p></div>';
875
- }
876
- }
877
-
878
- echo $myecho;
879
- }
880
- }
881
-
882
- function searchandreplace_page() {
883
-
884
- global $wpdb;
885
-
886
- if ( ! isset( $wpdb ) ) {
887
- $wpdb = NULL;
888
- }
889
- ?>
890
- <div class="wrap" id="top">
891
- <h2><?php _e( 'Search &amp; Replace', FB_SAR_TEXTDOMAIN ); ?></h2>
892
-
893
- <?php
894
- if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) {
895
- $capability = 'manage_options';
896
- } else {
897
- $capability = 'edit_plugins';
898
- }
899
-
900
- if ( current_user_can( $capability ) ) {
901
- searchandreplace_action();
902
- } else {
903
- wp_die(
904
- '<div class="error"><p>' . __(
905
- 'You do not have sufficient permissions to edit plugins for this installation of WordPress.',
906
- FB_SAR_TEXTDOMAIN
907
- ) . '</p></div>'
908
- );
909
- }
910
- ?>
911
-
912
- <div id="poststuff" class="dlm">
913
- <div class="postbox">
914
- <h3><?php _e( 'Global Search &amp; Replace', FB_SAR_TEXTDOMAIN ) ?></h3>
915
-
916
- <div class="inside">
917
- <p><?php _e(
918
- 'This plugin modifies your database directly!<br /><strong>WARNING: </strong>You <strong>cannot</strong> undo any changes made by this plugin. <strong>It is therefore recommended you backup your database before running this plugin.</strong> <a href="http://www.gnu.org/licenses/gpl-2.0.txt">There is no warranty for this plugin!</a> <strong>Activate</strong> the plugin <strong>only</strong> if you want to use it!',
919
- FB_SAR_TEXTDOMAIN
920
- ); ?></p>
921
-
922
- <p><?php _e(
923
- 'Text search is case sensitive and has no pattern matching capabilities. This replace function matches raw text so it can be used to replace HTML tags too.',
924
- FB_SAR_TEXTDOMAIN
925
- ); ?></p>
926
-
927
- <p><?php _e(
928
- 'But it will not replaced strings inside serialized data fields, like option values in the table options.',
929
- FB_SAR_TEXTDOMAIN
930
- ); ?></p>
931
-
932
- <p><?php _e(
933
- '<strong>Step One:</strong> Use the folllowing search (only) first, for a better understanding of what will happen when you do the replace. The SQL query and tables will be returned with the results. The search uses all fields in all tables! After verifying your results you can use the replace function.',
934
- FB_SAR_TEXTDOMAIN
935
- ); ?></p>
936
-
937
- <form name="search" action="" method="post">
938
- <?php wp_nonce_field( 'searchandreplace_nonce' ) ?>
939
- <table summary="config" class="widefat">
940
- <tr>
941
- <th>
942
- <label for="sall_label"><?php _e(
943
- 'All - search only!', FB_SAR_TEXTDOMAIN
944
- ); ?></label>
945
- </th>
946
- <td><input type='radio' name='sall' value='sall' id='sall_label' checked="checked" />
947
- <label for="sall_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
948
- <code>*</code> <?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
949
- <code>*</code></label>
950
- </td>
951
- </tr>
952
- <tr>
953
- <th><label for="search_text"><?php _e( 'Search for', FB_SAR_TEXTDOMAIN ); ?></label>
954
- </th>
955
- <td>
956
- <input class="code" type="text" id="search_text" name="search_text" value="" size="80" />
957
- </td>
958
- </tr>
959
- <tr class="alternate">
960
- <th>
961
- <label for="srall_label"><?php _e(
962
- 'All - search and replace!', FB_SAR_TEXTDOMAIN
963
- ); ?></label>
964
- </th>
965
- <td><input type='radio' name='sall' value='srall' id='srall_label' />
966
- <label for="srall_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
967
- <code>*</code> <?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
968
- <code>*</code></label>
969
- </td>
970
- </tr>
971
- <tr class="alternate">
972
- <th><label for="replace_text"><?php _e( 'Replace with', FB_SAR_TEXTDOMAIN ); ?></label>
973
- </th>
974
- <td>
975
- <input class="code" type="text" id="replace_text" name="replace_text" value="" size="80" />
976
- </td>
977
- </tr>
978
- </table>
979
- <p class="submit">
980
- <input class="button" type="submit" value="<?php _e(
981
- 'Go', FB_SAR_TEXTDOMAIN
982
- ); ?> &raquo;" />
983
- <input type="hidden" name="submitted" />
984
- </p>
985
- </form>
986
- </div>
987
- </div>
988
- </div>
989
-
990
- <div id="poststuff" class="dlm">
991
- <div class="postbox">
992
- <h3><?php _e( 'Search in', FB_SAR_TEXTDOMAIN ) ?></h3>
993
-
994
- <div class="inside">
995
-
996
- <form name="replace" action="" method="post">
997
- <?php wp_nonce_field( 'searchandreplace_nonce' ) ?>
998
- <table summary="config" class="widefat">
999
- <tr class="alternate">
1000
- <th><label for="content_label"><?php _e( 'Content', FB_SAR_TEXTDOMAIN ); ?></label></th>
1001
- <td colspan="2" style="text-align: center;">
1002
- <input type='checkbox' name='content' id='content_label' /></td>
1003
- <td><label for="content_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1004
- <code>post_content</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1005
- <code>_posts</code></label></td>
1006
- </tr>
1007
- <tr>
1008
- <th>
1009
- <label for="guid_label"><?php _e(
1010
- '<abbr title="Global Unique Identifier">GUID</abbr>', FB_SAR_TEXTDOMAIN
1011
- ); ?></label>
1012
- </th>
1013
- <td colspan="2" style="text-align: center;">
1014
- <input type='checkbox' name='guid' id='guid_label' /></td>
1015
- <td><label for="guid_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1016
- <code>guid</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1017
- <code>_posts</code></label></td>
1018
- </tr>
1019
- <tr class="alternate">
1020
- <th><label for="title_label"><?php _e( 'Titles', FB_SAR_TEXTDOMAIN ); ?></label></th>
1021
- <td colspan="2" style="text-align: center;">
1022
- <input type='checkbox' name='title' id='title_label' /></td>
1023
- <td><label for="title_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1024
- <code>post_title</code>,
1025
- <code>post_name</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1026
- <code>_posts</code></label></td>
1027
- </tr>
1028
- <tr>
1029
- <th><label for="excerpt_label"><?php _e( 'Excerpts', FB_SAR_TEXTDOMAIN ); ?></label>
1030
- </th>
1031
- <td colspan="2" style="text-align: center;">
1032
- <input type='checkbox' name='excerpt' id='excerpt_label' /></td>
1033
- <td><label for="excerpt_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1034
- <code>post_excerpt</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1035
- <code>_posts</code></label></td>
1036
- </tr>
1037
- <tr class="alternate">
1038
- <th><label for="meta_value_label"><?php _e( 'Metadata', FB_SAR_TEXTDOMAIN ); ?></label>
1039
- </th>
1040
- <td colspan="2" style="text-align: center;">
1041
- <input type='checkbox' name='meta_value' id='meta_value_label' /></td>
1042
- <td><label for="meta_value_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1043
- <code>meta_value</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1044
- <code>_postmeta</code></label></td>
1045
- </tr>
1046
- <tr>
1047
- <th>
1048
- <label for="comment_content_label"><?php _e(
1049
- 'Comments content', FB_SAR_TEXTDOMAIN
1050
- ); ?></label>
1051
- </th>
1052
- <td colspan="2" style="text-align: center;">
1053
- <input type='checkbox' name='comment_content' id='comment_content_label' /></td>
1054
- <td><label for="comment_content_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1055
- <code>comment_content</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1056
- <code>_comments</code></label></td>
1057
- </tr>
1058
- <tr class="alternate">
1059
- <th>
1060
- <label for="comment_author_label"><?php _e(
1061
- 'Comments author', FB_SAR_TEXTDOMAIN
1062
- ); ?></label>
1063
- </th>
1064
- <td colspan="2" style="text-align: center;">
1065
- <input type='checkbox' name='comment_author' id='comment_author_label' /></td>
1066
- <td><label for="comment_author_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1067
- <code>comment_author</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1068
- <code>_comments</code></label></td>
1069
- </tr>
1070
- <tr>
1071
- <th>
1072
- <label for="comment_author_email_label"><?php _e(
1073
- 'Comments author e-mail', FB_SAR_TEXTDOMAIN
1074
- ); ?></label>
1075
- </th>
1076
- <td colspan="2" style="text-align: center;">
1077
- <input type='checkbox' name='comment_author_email' id='comment_author_email_label' />
1078
- </td>
1079
- <td><label for="comment_author_email_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1080
- <code>comment_author_email</code><br /><?php _e(
1081
- 'Table:', FB_SAR_TEXTDOMAIN
1082
- ); ?>
1083
- <code>_comments</code></label></td>
1084
- </tr>
1085
- <tr class="alternate">
1086
- <th>
1087
- <label for="comment_author_url_label"><?php _e(
1088
- 'Comments author URL', FB_SAR_TEXTDOMAIN
1089
- ); ?></label>
1090
- </th>
1091
- <td colspan="2" style="text-align: center;">
1092
- <input type='checkbox' name='comment_author_url' id='comment_author_url_label' />
1093
- </td>
1094
- <td><label for="comment_author_url_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1095
- <code>comment_author_url</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1096
- <code>_comments</code></label></td>
1097
- </tr>
1098
- <tr>
1099
- <th>
1100
- <label for="comment_count_label"><?php _e(
1101
- 'Comments counter', FB_SAR_TEXTDOMAIN
1102
- ); ?></label>
1103
- </th>
1104
- <td colspan="2" style="text-align: center;">
1105
- <input type='checkbox' name='comment_count' id='comment_count_label' /></td>
1106
- <td><label for="comment_count_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1107
- <code>comment_count</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1108
- <code>_posts</code></label></td>
1109
- </tr>
1110
- <tr class="alternate">
1111
- <th>
1112
- <label for="cat_description_label"><?php _e(
1113
- 'Category description', FB_SAR_TEXTDOMAIN
1114
- ); ?></label>
1115
- </th>
1116
- <td colspan="2" style="text-align: center;">
1117
- <input type='checkbox' name='cat_description' id='cat_description_label' /></td>
1118
- <td><label for="cat_description_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1119
- <code>description</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1120
- <code>_term_taxonomy</code></label></td>
1121
- </tr>
1122
- <tr>
1123
- <th>
1124
- <label for="tag_label"><?php _e(
1125
- 'Tags &amp; Categories', FB_SAR_TEXTDOMAIN
1126
- ); ?></label>
1127
- </th>
1128
- <td colspan="2" style="text-align: center;">
1129
- <input type='checkbox' name='tag' id='tag_label' /></td>
1130
- <td><label for="tag_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1131
- <code>name</code> <?php _e( 'and', FB_SAR_TEXTDOMAIN ); ?>
1132
- <code>slug</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1133
- <code>_terms</code></label></td>
1134
- </tr>
1135
- <tr class="alternate">
1136
- <th><label for="user_id_label"><?php _e( 'User ID', FB_SAR_TEXTDOMAIN ); ?></label></th>
1137
- <td colspan="2" style="text-align: center;">
1138
- <input type='checkbox' name='user_id' id='user_id_label' /></td>
1139
- <td><label for="user_id_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1140
- <code>ID</code>, <code>user_id</code>, <code>post_author</code>,
1141
- <code>user_id</code> <?php _e( 'and', FB_SAR_TEXTDOMAIN ); ?>
1142
- <code>link_owner</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1143
- <code>_users</code>, <code>_usermeta</code>, <code>_posts</code>,
1144
- <code>_comments</code> <?php _e( 'and', FB_SAR_TEXTDOMAIN ); ?>
1145
- <code>_links</code></label></td>
1146
- </tr>
1147
- <tr>
1148
- <th>
1149
- <label for="user_login_label"><?php _e(
1150
- 'User login', FB_SAR_TEXTDOMAIN
1151
- ); ?></label>
1152
- </th>
1153
- <td colspan="2" style="text-align: center;">
1154
- <input type='checkbox' name='user_login' id='user_login_label' /></td>
1155
- <td><label for="user_login_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1156
- <code>user_login</code> <?php _e( 'and', FB_SAR_TEXTDOMAIN ); ?>
1157
- <code>user_nicename</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1158
- <code>_users</code></label></td>
1159
- </tr>
1160
- <?php if ( $wpdb
1161
- && $wpdb->query(
1162
- "SHOW TABLES LIKE '" . $wpdb->prefix . 'terms' . "'"
1163
- ) == 1
1164
- ) { ?>
1165
- <tr class="alternate">
1166
- <th><label for="id_label"><?php _e( 'ID', FB_SAR_TEXTDOMAIN ); ?></label></th>
1167
- <td colspan="2" style="text-align: center;">
1168
- <input type='checkbox' name='id' id='id_label' /></td>
1169
- <td><label for="id_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1170
- <code>ID</code>, <code>post_parent</code>, <code>post_id</code>,
1171
- <code>object_id</code> <?php _e( 'and', FB_SAR_TEXTDOMAIN ); ?>
1172
- <code>comments</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1173
- <code>_posts</code>, <code>_postmeta</code>,
1174
- <code>_term_relationships</code> <?php _e( 'and', FB_SAR_TEXTDOMAIN ); ?>
1175
- <code>_comment_post_ID</code></label></td>
1176
- </tr>
1177
- <?php } ?>
1178
- <?php if ( $wpdb
1179
- && $wpdb->query(
1180
- "SHOW TABLES LIKE '" . $wpdb->prefix . 'signups' . "'"
1181
- ) == 1
1182
- ) { ?>
1183
- <tr class="alternate">
1184
- <th><label for="signups_label"><?php _e( 'Signups', FB_SAR_TEXTDOMAIN ); ?></label>
1185
- </th>
1186
- <td colspan="2" style="text-align: center;">
1187
- <input type='checkbox' name='signups' id='signups_label' /></td>
1188
- <td><label for="signups_label"><?php _e( 'Field:', FB_SAR_TEXTDOMAIN ); ?>
1189
- <code>user_login</code><br /><?php _e( 'Table:', FB_SAR_TEXTDOMAIN ); ?>
1190
- <code>_signups</code></label></td>
1191
- </tr>
1192
- <?php } ?>
1193
- <tr>
1194
- <th>&nbsp;</th>
1195
- <td colspan="2" style="text-align: center;">&nbsp;&nbsp;
1196
- <a href="javascript:selectcb('replace', true);" title="<?php _e(
1197
- 'Check all', FB_SAR_TEXTDOMAIN
1198
- ); ?>"><?php _e( 'all', FB_SAR_TEXTDOMAIN ); ?></a> |
1199
- <a href="javascript:selectcb('replace', false);" title="<?php _e(
1200
- 'Uncheck all', FB_SAR_TEXTDOMAIN
1201
- ); ?>"><?php _e( 'none', FB_SAR_TEXTDOMAIN ); ?></a>
1202
- </td>
1203
- <td>&nbsp;</td>
1204
- </tr>
1205
- </table>
1206
-
1207
- <table summary="submit" class="form-table">
1208
- <tr>
1209
- <th><label for="search_text"><?php _e( 'Search for', FB_SAR_TEXTDOMAIN ); ?></label>
1210
- </th>
1211
- <td>
1212
- <input class="code" type="text" id="search_text" name="search_text" value="" size="80" />
1213
- </td>
1214
- </tr>
1215
- <tr>
1216
- <th><label for="replace_text"><?php _e( 'Replace with', FB_SAR_TEXTDOMAIN ); ?></label>
1217
- </th>
1218
- <td>
1219
- <input class="code" type="text" id="replace_text" name="replace_text" value="" size="80" />
1220
- </td>
1221
- </tr>
1222
- </table>
1223
- <p class="submit">
1224
- <input class="button" type="submit" value="<?php _e(
1225
- 'Go', FB_SAR_TEXTDOMAIN
1226
- ); ?> &raquo;" />
1227
- <input type="hidden" name="submitted" />
1228
- </p>
1229
- </form>
1230
-
1231
- </div>
1232
- </div>
1233
- </div>
1234
-
1235
- <div id="poststuff" class="dlm">
1236
- <div class="postbox">
1237
- <h3><?php _e( 'Information about this plugin', FB_SAR_TEXTDOMAIN ); ?></h3>
1238
-
1239
- <div class="inside">
1240
- <p><?php _e(
1241
- "&quot;Search and Replace&quot; original plugin (en) created by <a href='http://thedeadone.net/'>Mark Cunningham</a> and provided (comments) by <a href='http://www.gonahkar.com'>Gonahkar</a>.<br />&quot;Search &amp; Replace&quot;, enhanced by <a href='http://bueltge.de'>Frank Bueltge</a> and current version is also maintained by Ron Guerin.",
1242
- FB_SAR_TEXTDOMAIN
1243
- ); ?></p>
1244
-
1245
- <p><?php _e(
1246
- "For more information: Visit the <a href='http://wordpress.org/plugins/search-and-replace/'>plugin homepage</a> for further information or to grab the latest version of this plugin.",
1247
- FB_SAR_TEXTDOMAIN
1248
- ); ?></p>
1249
- </div>
1250
- </div>
1251
- </div>
1252
- </div>
1253
- <?php } ?>