Version Description
Download this release
Release Info
Developer | Bueltge |
Plugin | Search & Replace |
Version | 3.1.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.1 to 3.1.0
- inc/Admin.php +0 -321
- inc/Autoloader.php +0 -116
- inc/CreditsAdmin.php +0 -18
- inc/{DatabaseExporter.php → Database/Exporter.php} +92 -54
- inc/{DatabaseImporter.php → Database/Importer.php} +8 -14
- inc/{DatabaseManager.php → Database/Manager.php} +20 -11
- inc/{Replace.php → Database/Replace.php} +29 -14
- inc/DbBackupAdmin.php +0 -51
- inc/FileDownloader.php +276 -0
- inc/Init.php +0 -178
- inc/Page/AbstractPage.php +88 -0
- inc/Page/BackupDatabase.php +81 -0
- inc/Page/Credits.php +44 -0
- inc/Page/Manager.php +179 -0
- inc/Page/PageInterface.php +54 -0
- inc/Page/ReplaceDomain.php +99 -0
- inc/Page/SearchReplace.php +300 -0
- inc/{SqlImportAdmin.php → Page/SqlImport.php} +80 -53
- inc/Plugin.php +52 -0
- inc/ReplaceDomainAdmin.php +0 -63
- inc/SearchReplaceAdmin.php +0 -228
- inc/Service/MaxExecutionTime.php +49 -0
- inc/requisite/src/Requisite/AutoLoaderInterface.php +17 -0
- inc/requisite/src/Requisite/Loader/DefaultConditionalFileLoader.php +27 -0
- inc/requisite/src/Requisite/Loader/DirectoryCacheFileLoader.php +82 -0
- inc/requisite/src/Requisite/Loader/FileLoaderInterface.php +19 -0
- inc/requisite/src/Requisite/Requisite.php +72 -0
- inc/requisite/src/Requisite/Rule/AutoLoadRuleInterface.php +22 -0
- inc/requisite/src/Requisite/Rule/NamespaceDirectoryMapper.php +13 -0
- inc/requisite/src/Requisite/Rule/Psr4.php +82 -0
- inc/requisite/src/Requisite/SPLAutoLoader.php +57 -0
- inc/templates/credits.php +17 -33
- inc/templates/db_backup.php +1 -27
- inc/templates/replace_domain.php +8 -20
- inc/templates/search_replace.php +40 -55
- inc/templates/sql_import.php +2 -12
- inspyde-search-replace.php +28 -12
- l10n/search-and-replace-de_DE.mo +0 -0
- languages/insr-de_DE.po → l10n/search-and-replace-de_DE.po +177 -170
- l10n/search-and-replace-zh_CN.mo +0 -0
- l10n/search-and-replace-zh_CN.po +489 -0
- languages/insr.pot → l10n/search-and-replace.pot +154 -157
- languages/insr-de_DE.mo +0 -0
- readme.txt +28 -10
inc/Admin.php
DELETED
@@ -1,321 +0,0 @@
|
|
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
DELETED
@@ -1,116 +0,0 @@
|
|
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
DELETED
@@ -1,18 +0,0 @@
|
|
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 → Database/Exporter.php}
RENAMED
@@ -1,17 +1,19 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Handles export of DB.
|
4 |
-
* adapted from https://github.com/matzko/wp-db-backup
|
5 |
-
*/
|
6 |
|
7 |
-
namespace Inpsyde\SearchReplace\
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
*/
|
@@ -23,7 +25,7 @@ class DatabaseExporter {
|
|
23 |
protected $replace;
|
24 |
|
25 |
/**
|
26 |
-
* @var
|
27 |
*/
|
28 |
protected $dbm;
|
29 |
|
@@ -47,14 +49,18 @@ class DatabaseExporter {
|
|
47 |
*/
|
48 |
protected $fp;
|
49 |
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
53 |
|
|
|
54 |
$this->backup_dir = get_temp_dir();
|
55 |
$this->replace = $replace;
|
56 |
$this->dbm = $dbm;
|
57 |
-
|
58 |
}
|
59 |
|
60 |
/**
|
@@ -71,7 +77,11 @@ class DatabaseExporter {
|
|
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,
|
@@ -92,12 +102,14 @@ class DatabaseExporter {
|
|
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(
|
|
|
|
|
96 |
|
97 |
return $report;
|
98 |
}
|
99 |
} else {
|
100 |
-
$this->errors->add( 9, esc_attr__( 'The backup directory is not writable!', '
|
101 |
|
102 |
return $report;
|
103 |
}
|
@@ -105,18 +117,20 @@ class DatabaseExporter {
|
|
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', '
|
109 |
$this->stow( "#\n" );
|
110 |
-
$this->stow( '# ' . sprintf( __( 'Generated: %s', '
|
111 |
-
$this->stow( '# ' . sprintf( __( 'Hostname: %s', '
|
112 |
-
$this->stow( '# ' . sprintf( __( 'Database: %s', '
|
113 |
if ( '' !== $new_table_prefix ) {
|
114 |
-
$this->stow(
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
120 |
}
|
121 |
$this->stow( "# --------------------------------------------------------\n" );
|
122 |
|
@@ -127,9 +141,11 @@ class DatabaseExporter {
|
|
127 |
//count tables
|
128 |
$report [ 'tables' ] ++;
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
133 |
if ( $domain_replace && is_multisite() && $table === $wp_blogs_table ) {
|
134 |
|
135 |
$stripped_url_search = substr( $search, strpos( $search, '/' ) + 2 );
|
@@ -185,8 +201,7 @@ class DatabaseExporter {
|
|
185 |
'table_name' => $table,
|
186 |
'rows' => 0,
|
187 |
'change' => 0,
|
188 |
-
'changes' =>
|
189 |
-
|
190 |
);
|
191 |
//do we need to replace the prefix?
|
192 |
$table_prefix = $this->dbm->get_base_prefix();
|
@@ -198,19 +213,23 @@ class DatabaseExporter {
|
|
198 |
|
199 |
// Create the SQL statements
|
200 |
$this->stow( '# --------------------------------------------------------' . "\n" );
|
201 |
-
$this->stow( '# ' . sprintf( __( 'Table: %s', '
|
202 |
|
203 |
$table_structure = $this->dbm->get_table_structure( $table );
|
204 |
if ( ! $table_structure ) {
|
205 |
-
$this->errors->add( 1, __( 'Error getting table details', '
|
206 |
|
207 |
return $table_report;
|
208 |
}
|
209 |
|
210 |
$this->stow( "\n\n" );
|
211 |
$this->stow( "#\n" );
|
212 |
-
$this->stow(
|
213 |
-
|
|
|
|
|
|
|
|
|
214 |
$this->stow( "#\n" );
|
215 |
$this->stow( "\n" );
|
216 |
$this->stow( 'DROP TABLE IF EXISTS ' . $this->backquote( $new_table ) . ';' . "\n" );
|
@@ -219,15 +238,19 @@ class DatabaseExporter {
|
|
219 |
// Comment in SQL-file
|
220 |
$this->stow( "\n\n" );
|
221 |
$this->stow( "#\n" );
|
222 |
-
$this->stow(
|
223 |
-
|
|
|
|
|
|
|
|
|
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 (
|
230 |
-
$err_msg = sprintf( __( 'Error with SHOW CREATE TABLE for %s.', '
|
231 |
$this->errors->add( 2, $err_msg );
|
232 |
$this->stow( "#\n# $err_msg\n#\n" );
|
233 |
}
|
@@ -239,8 +262,8 @@ class DatabaseExporter {
|
|
239 |
}
|
240 |
$this->stow( $create_table[ 0 ][ 1 ] . ' ;' );
|
241 |
|
242 |
-
if (
|
243 |
-
$err_msg = sprintf( __( 'Error getting table structure of %s', '
|
244 |
$this->errors->add( 3, $err_msg );
|
245 |
$this->stow( "#\n# $err_msg\n#\n" );
|
246 |
}
|
@@ -248,18 +271,22 @@ class DatabaseExporter {
|
|
248 |
// Comment in SQL-file
|
249 |
$this->stow( "\n\n" );
|
250 |
$this->stow( "#\n" );
|
251 |
-
$this->stow(
|
252 |
-
|
|
|
|
|
|
|
|
|
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 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
) {
|
264 |
$defs[ strtolower( $struct->Field ) ] = ( NULL === $struct->Default ) ? 'NULL' : $struct->Default;
|
265 |
$ints[ strtolower( $struct->Field ) ] = '1';
|
@@ -292,16 +319,20 @@ class DatabaseExporter {
|
|
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(
|
296 |
-
|
|
|
|
|
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(
|
304 |
-
|
|
|
|
|
305 |
|
306 |
// Something was changed
|
307 |
if ( $edited_data !== $value ) {
|
@@ -327,8 +358,10 @@ class DatabaseExporter {
|
|
327 |
$value = ( NULL === $value || '' === $value ) ? $defs[ strtolower( $column ) ] : $value;
|
328 |
$values[] = ( '' === $value ) ? "''" : $value;
|
329 |
} else {
|
330 |
-
$values[] = "'" . str_replace(
|
331 |
-
|
|
|
|
|
332 |
}
|
333 |
}
|
334 |
$this->stow( " \n" . $entries . implode( ', ', $values ) . ');' );
|
@@ -340,8 +373,12 @@ class DatabaseExporter {
|
|
340 |
// Create footer/closing comment in SQL-file
|
341 |
$this->stow( "\n" );
|
342 |
$this->stow( "#\n" );
|
343 |
-
$this->stow(
|
344 |
-
|
|
|
|
|
|
|
|
|
345 |
$this->stow( "# --------------------------------------------------------\n" );
|
346 |
$this->stow( "\n" );
|
347 |
|
@@ -420,7 +457,7 @@ class DatabaseExporter {
|
|
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:', '
|
424 |
. ' ' . $query_line . ' ' . $php_errormsg
|
425 |
);
|
426 |
}
|
@@ -546,4 +583,5 @@ class DatabaseExporter {
|
|
546 |
return $new_table_prefix . $part_after_prefix;
|
547 |
}
|
548 |
|
|
|
549 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
namespace Inpsyde\SearchReplace\Database;
|
4 |
|
5 |
+
/**
|
6 |
+
* Class Exporter
|
7 |
+
*
|
8 |
+
* @package Inpsyde\SearchReplace\Database
|
9 |
+
*/
|
10 |
+
class Exporter {
|
11 |
|
12 |
/**
|
13 |
* @Stores all error messages in a WP_Error Object
|
14 |
*/
|
15 |
protected $errors;
|
16 |
+
|
17 |
/**
|
18 |
* @string The Path to the Backup Directory
|
19 |
*/
|
25 |
protected $replace;
|
26 |
|
27 |
/**
|
28 |
+
* @var Manager
|
29 |
*/
|
30 |
protected $dbm;
|
31 |
|
49 |
*/
|
50 |
protected $fp;
|
51 |
|
52 |
+
/**
|
53 |
+
* Exporter constructor.
|
54 |
+
*
|
55 |
+
* @param Replace $replace
|
56 |
+
* @param Manager $dbm
|
57 |
+
*/
|
58 |
+
public function __construct( Replace $replace, Manager $dbm ) {
|
59 |
|
60 |
+
$this->errors = new \WP_Error();
|
61 |
$this->backup_dir = get_temp_dir();
|
62 |
$this->replace = $replace;
|
63 |
$this->dbm = $dbm;
|
|
|
64 |
}
|
65 |
|
66 |
/**
|
77 |
* $report[ 'errors'] : WP_Error_object,
|
78 |
* $report ['changes'] : Array with replacements in tables
|
79 |
*/
|
80 |
+
public function db_backup( $search = '', $replace = '', $tables = array(), $domain_replace = FALSE, $new_table_prefix = '' ) {
|
81 |
+
|
82 |
+
if ( count( $tables ) < 1 ) {
|
83 |
+
$tables = $this->dbm->get_tables();
|
84 |
+
}
|
85 |
|
86 |
$report = array(
|
87 |
'errors' => NULL,
|
102 |
if ( is_writable( $this->backup_dir ) ) {
|
103 |
$this->fp = $this->open( $this->backup_dir . $this->backup_filename );
|
104 |
if ( ! $this->fp ) {
|
105 |
+
$this->errors->add(
|
106 |
+
8, esc_attr__( 'Could not open the backup file for writing!', 'search-and-replace' )
|
107 |
+
);
|
108 |
|
109 |
return $report;
|
110 |
}
|
111 |
} else {
|
112 |
+
$this->errors->add( 9, esc_attr__( 'The backup directory is not writable!', 'search-and-replace' ) );
|
113 |
|
114 |
return $report;
|
115 |
}
|
117 |
//Begin new backup of MySql
|
118 |
//get charset. if not set assume utf8
|
119 |
$charset = ( defined( 'DB_CHARSET' ) ? DB_CHARSET : 'utf8' );
|
120 |
+
$this->stow( '# ' . esc_attr__( 'WordPress MySQL database backup', 'search-and-replace' ) . "\n" );
|
121 |
$this->stow( "#\n" );
|
122 |
+
$this->stow( '# ' . sprintf( __( 'Generated: %s', 'search-and-replace' ), date( 'l j. F Y H:i T' ) ) . "\n" );
|
123 |
+
$this->stow( '# ' . sprintf( __( 'Hostname: %s', 'search-and-replace' ), DB_HOST ) . "\n" );
|
124 |
+
$this->stow( '# ' . sprintf( __( 'Database: %s', 'search-and-replace' ), $this->backquote( DB_NAME ) ) . "\n" );
|
125 |
if ( '' !== $new_table_prefix ) {
|
126 |
+
$this->stow(
|
127 |
+
'# ' . sprintf(
|
128 |
+
__( 'Changed table prefix: From %s to %s ', 'search-and-replace' ),
|
129 |
+
$table_prefix,
|
130 |
+
$new_table_prefix
|
131 |
+
)
|
132 |
+
. "\n"
|
133 |
+
);
|
134 |
}
|
135 |
$this->stow( "# --------------------------------------------------------\n" );
|
136 |
|
141 |
//count tables
|
142 |
$report [ 'tables' ] ++;
|
143 |
|
144 |
+
/**
|
145 |
+
* Check if we are replacing the domain in a multisite.
|
146 |
+
* If so, we replace in wp_blogs the stripped url without http(s), because the domains
|
147 |
+
* are stored without http://
|
148 |
+
*/
|
149 |
if ( $domain_replace && is_multisite() && $table === $wp_blogs_table ) {
|
150 |
|
151 |
$stripped_url_search = substr( $search, strpos( $search, '/' ) + 2 );
|
201 |
'table_name' => $table,
|
202 |
'rows' => 0,
|
203 |
'change' => 0,
|
204 |
+
'changes' => [ ],
|
|
|
205 |
);
|
206 |
//do we need to replace the prefix?
|
207 |
$table_prefix = $this->dbm->get_base_prefix();
|
213 |
|
214 |
// Create the SQL statements
|
215 |
$this->stow( '# --------------------------------------------------------' . "\n" );
|
216 |
+
$this->stow( '# ' . sprintf( __( 'Table: %s', 'search-and-replace' ), $this->backquote( $new_table ) ) . "\n" );
|
217 |
|
218 |
$table_structure = $this->dbm->get_table_structure( $table );
|
219 |
if ( ! $table_structure ) {
|
220 |
+
$this->errors->add( 1, __( 'Error getting table details', 'search-and-replace' ) . ": $table" );
|
221 |
|
222 |
return $table_report;
|
223 |
}
|
224 |
|
225 |
$this->stow( "\n\n" );
|
226 |
$this->stow( "#\n" );
|
227 |
+
$this->stow(
|
228 |
+
'# ' . sprintf(
|
229 |
+
__( 'Delete any existing table %s', 'search-and-replace' ),
|
230 |
+
$this->backquote( $new_table )
|
231 |
+
) . "\n"
|
232 |
+
);
|
233 |
$this->stow( "#\n" );
|
234 |
$this->stow( "\n" );
|
235 |
$this->stow( 'DROP TABLE IF EXISTS ' . $this->backquote( $new_table ) . ';' . "\n" );
|
238 |
// Comment in SQL-file
|
239 |
$this->stow( "\n\n" );
|
240 |
$this->stow( "#\n" );
|
241 |
+
$this->stow(
|
242 |
+
'# ' . sprintf(
|
243 |
+
__( 'Table structure of table %s', 'search-and-replace' ),
|
244 |
+
$this->backquote( $new_table )
|
245 |
+
) . "\n"
|
246 |
+
);
|
247 |
$this->stow( "#\n" );
|
248 |
$this->stow( "\n" );
|
249 |
|
250 |
/** @var array $create_table */
|
251 |
$create_table = $this->dbm->get_create_table_statement( $table );
|
252 |
+
if ( FALSE === $create_table ) {
|
253 |
+
$err_msg = sprintf( __( 'Error with SHOW CREATE TABLE for %s.', 'search-and-replace' ), $table );
|
254 |
$this->errors->add( 2, $err_msg );
|
255 |
$this->stow( "#\n# $err_msg\n#\n" );
|
256 |
}
|
262 |
}
|
263 |
$this->stow( $create_table[ 0 ][ 1 ] . ' ;' );
|
264 |
|
265 |
+
if ( FALSE === $table_structure ) {
|
266 |
+
$err_msg = sprintf( __( 'Error getting table structure of %s', 'search-and-replace' ), $table );
|
267 |
$this->errors->add( 3, $err_msg );
|
268 |
$this->stow( "#\n# $err_msg\n#\n" );
|
269 |
}
|
271 |
// Comment in SQL-file
|
272 |
$this->stow( "\n\n" );
|
273 |
$this->stow( "#\n" );
|
274 |
+
$this->stow(
|
275 |
+
'# ' . sprintf(
|
276 |
+
__( 'Data contents of table %s', 'search-and-replace' ),
|
277 |
+
$this->backquote( $new_table )
|
278 |
+
) . "\n"
|
279 |
+
);
|
280 |
$this->stow( "#\n" );
|
281 |
|
282 |
$defs = array();
|
283 |
$ints = array();
|
284 |
foreach ( $table_structure as $struct ) {
|
285 |
if ( ( 0 === strpos( $struct->Type, 'tinyint' ) )
|
286 |
+
|| ( 0 === strpos( strtolower( $struct->Type ), 'smallint' ) )
|
287 |
+
|| ( 0 === strpos( strtolower( $struct->Type ), 'mediumint' ) )
|
288 |
+
|| ( 0 === strpos( strtolower( $struct->Type ), 'int' ) )
|
289 |
+
|| ( 0 === strpos( strtolower( $struct->Type ), 'bigint' ) )
|
290 |
) {
|
291 |
$defs[ strtolower( $struct->Field ) ] = ( NULL === $struct->Default ) ? 'NULL' : $struct->Default;
|
292 |
$ints[ strtolower( $struct->Field ) ] = '1';
|
319 |
foreach ( $row as $column => $value ) {
|
320 |
//if "change database prefix" is set we have to look for occurrences of the old prefix in the db entries and change them
|
321 |
if ( $new_table !== $table ) {
|
322 |
+
$value = $this->replace->recursive_unserialize_replace(
|
323 |
+
$table_prefix, $new_table_prefix,
|
324 |
+
$value
|
325 |
+
);
|
326 |
}
|
327 |
//skip replace if no search pattern
|
328 |
//check if we need to replace something
|
329 |
//skip primary_key
|
330 |
if ( $search !== '' && $column !== $primary_key ) {
|
331 |
|
332 |
+
$edited_data = $this->replace->recursive_unserialize_replace(
|
333 |
+
$search, $replace,
|
334 |
+
$value
|
335 |
+
);
|
336 |
|
337 |
// Something was changed
|
338 |
if ( $edited_data !== $value ) {
|
358 |
$value = ( NULL === $value || '' === $value ) ? $defs[ strtolower( $column ) ] : $value;
|
359 |
$values[] = ( '' === $value ) ? "''" : $value;
|
360 |
} else {
|
361 |
+
$values[] = "'" . str_replace(
|
362 |
+
$hex_search, $hex_replace,
|
363 |
+
$this->sql_addslashes( $value )
|
364 |
+
) . "'";
|
365 |
}
|
366 |
}
|
367 |
$this->stow( " \n" . $entries . implode( ', ', $values ) . ');' );
|
373 |
// Create footer/closing comment in SQL-file
|
374 |
$this->stow( "\n" );
|
375 |
$this->stow( "#\n" );
|
376 |
+
$this->stow(
|
377 |
+
'# ' . sprintf(
|
378 |
+
__( 'End of data contents of table %s', 'search-and-replace' ),
|
379 |
+
$this->backquote( $new_table )
|
380 |
+
) . "\n"
|
381 |
+
);
|
382 |
$this->stow( "# --------------------------------------------------------\n" );
|
383 |
$this->stow( "\n" );
|
384 |
|
457 |
if ( @fwrite( $this->fp, $query_line ) === FALSE ) {
|
458 |
$this->errors->add(
|
459 |
4,
|
460 |
+
esc_attr__( 'There was an error writing a line to the backup script:', 'search-and-replace' )
|
461 |
. ' ' . $query_line . ' ' . $php_errormsg
|
462 |
);
|
463 |
}
|
583 |
return $new_table_prefix . $part_after_prefix;
|
584 |
}
|
585 |
|
586 |
+
|
587 |
}
|
inc/{DatabaseImporter.php → Database/Importer.php}
RENAMED
@@ -1,23 +1,21 @@
|
|
1 |
<?php
|
|
|
|
|
2 |
/**
|
3 |
-
*
|
|
|
|
|
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
|
16 |
-
* @param \WP_Error $error
|
17 |
*
|
18 |
* @return int Number of Sql queries made, -1 if error
|
19 |
*/
|
20 |
-
public function import_sql( $sql
|
21 |
|
22 |
//connect via mysqli for easier db import
|
23 |
$mysqli = new \mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
|
@@ -35,16 +33,12 @@ class DatabaseImporter {
|
|
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 |
}
|
1 |
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Database;
|
3 |
+
|
4 |
/**
|
5 |
+
* Class Importer
|
6 |
+
*
|
7 |
+
* @package Inpsyde\SearchReplace\Database
|
8 |
*/
|
9 |
+
class Importer {
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
/**
|
12 |
* imports a sql file via mysqli
|
13 |
*
|
14 |
+
* @param string $sql
|
|
|
15 |
*
|
16 |
* @return int Number of Sql queries made, -1 if error
|
17 |
*/
|
18 |
+
public function import_sql( $sql ) {
|
19 |
|
20 |
//connect via mysqli for easier db import
|
21 |
$mysqli = new \mysqli( DB_HOST, DB_USER, DB_PASSWORD, DB_NAME );
|
33 |
}
|
34 |
|
35 |
if ( $mysqli->errno ) {
|
|
|
|
|
36 |
return - 1;
|
|
|
37 |
}
|
38 |
|
39 |
mysqli_close( $mysqli );
|
40 |
|
41 |
return $i;
|
|
|
42 |
}
|
43 |
|
44 |
}
|
inc/{DatabaseManager.php → Database/Manager.php}
RENAMED
@@ -1,26 +1,33 @@
|
|
1 |
<?php
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
/**
|
8 |
* @var \wpdb
|
9 |
* Wordpress Database Class
|
10 |
-
* some functions adapted from :
|
|
|
11 |
*/
|
12 |
private $wpdb;
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
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
|
@@ -61,7 +68,7 @@ class DatabaseManager {
|
|
61 |
|
62 |
foreach ( $tables as $table ) {
|
63 |
$size = round( $table[ 'Data_length' ] / 1024, 2 );
|
64 |
-
$sizes[ $table[ 'Name' ] ] = sprintf( __( '(%s KB)', '
|
65 |
}
|
66 |
|
67 |
}
|
@@ -81,6 +88,7 @@ class DatabaseManager {
|
|
81 |
public function get_rows( $table ) {
|
82 |
|
83 |
$table = esc_sql( $table );
|
|
|
84 |
return $this->wpdb->get_var( "SELECT COUNT(*) FROM $table" );
|
85 |
}
|
86 |
|
@@ -136,8 +144,9 @@ class DatabaseManager {
|
|
136 |
*/
|
137 |
public function update( $table, $update_sql, $where_sql ) {
|
138 |
|
139 |
-
$sql
|
140 |
-
|
|
|
141 |
return $this->wpdb->query( $sql );
|
142 |
}
|
143 |
|
1 |
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Database;
|
3 |
|
4 |
+
/**
|
5 |
+
* Class Manager
|
6 |
+
*
|
7 |
+
* @package Inpsyde\SearchReplace\Database
|
8 |
+
*/
|
9 |
+
class Manager {
|
10 |
|
11 |
/**
|
12 |
* @var \wpdb
|
13 |
* Wordpress Database Class
|
14 |
+
* some functions adapted from :
|
15 |
+
* https://github.com/ExpandedFronts/Better-Search-Replace/blob/master/includes/class-bsr-db.php
|
16 |
*/
|
17 |
private $wpdb;
|
18 |
|
19 |
+
/**
|
20 |
+
* DatabaseManager constructor.
|
21 |
+
*
|
22 |
+
* @param \wpdb $wpdb
|
23 |
+
*/
|
24 |
+
public function __construct( \wpdb $wpdb ) {
|
25 |
|
|
|
26 |
$this->wpdb = $wpdb;
|
|
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
* Returns an array of tables in the database.
|
|
|
31 |
* if multisite && mainsite: all tables of the site
|
32 |
* if multisite && subsite: all tables of current blog
|
33 |
* if single site : all tabkes of the site
|
68 |
|
69 |
foreach ( $tables as $table ) {
|
70 |
$size = round( $table[ 'Data_length' ] / 1024, 2 );
|
71 |
+
$sizes[ $table[ 'Name' ] ] = sprintf( __( '(%s KB)', 'search-and-replace' ), $size );
|
72 |
}
|
73 |
|
74 |
}
|
88 |
public function get_rows( $table ) {
|
89 |
|
90 |
$table = esc_sql( $table );
|
91 |
+
|
92 |
return $this->wpdb->get_var( "SELECT COUNT(*) FROM $table" );
|
93 |
}
|
94 |
|
144 |
*/
|
145 |
public function update( $table, $update_sql, $where_sql ) {
|
146 |
|
147 |
+
$sql = 'UPDATE ' . $table . ' SET ' . implode( ', ', $update_sql ) .
|
148 |
+
' WHERE ' . implode( ' AND ', array_filter( $where_sql ) );
|
149 |
+
|
150 |
return $this->wpdb->query( $sql );
|
151 |
}
|
152 |
|
inc/{Replace.php → Database/Replace.php}
RENAMED
@@ -1,14 +1,15 @@
|
|
1 |
<?php
|
2 |
-
namespace Inpsyde\SearchReplace\
|
3 |
|
4 |
-
use
|
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 |
/**
|
@@ -17,6 +18,7 @@ class Replace {
|
|
17 |
* @var
|
18 |
*/
|
19 |
protected $search;
|
|
|
20 |
/**
|
21 |
* the replacement string
|
22 |
*
|
@@ -27,7 +29,7 @@ class Replace {
|
|
27 |
/**
|
28 |
* The Database Interface Object
|
29 |
*
|
30 |
-
* @type
|
31 |
* @var
|
32 |
*/
|
33 |
protected $dbm;
|
@@ -44,11 +46,12 @@ class Replace {
|
|
44 |
*/
|
45 |
protected $dry_run = TRUE;
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
|
53 |
$this->dbm = $dbm;
|
54 |
}
|
@@ -69,6 +72,13 @@ class Replace {
|
|
69 |
|
70 |
public function run_search_replace( $search, $replace, $tables ) {
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
$report = array(
|
73 |
'errors' => NULL,
|
74 |
'changes' => array(),
|
@@ -90,6 +100,8 @@ class Replace {
|
|
90 |
|
91 |
}
|
92 |
|
|
|
|
|
93 |
return $report;
|
94 |
}
|
95 |
|
@@ -118,9 +130,11 @@ class Replace {
|
|
118 |
$columns = $columns[ 1 ];
|
119 |
|
120 |
if ( NULL === $primary_key ) {
|
121 |
-
array_push(
|
122 |
-
|
123 |
-
|
|
|
|
|
124 |
|
125 |
return $table_report;
|
126 |
}
|
@@ -202,8 +216,9 @@ class Replace {
|
|
202 |
|
203 |
if ( ! $result ) {
|
204 |
$table_report[ 'errors' ][] = sprintf(
|
205 |
-
__( 'Error updating row: %d.', '
|
206 |
-
$row
|
|
|
207 |
} else {
|
208 |
$table_report[ 'updates' ] ++;
|
209 |
}
|
1 |
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Database;
|
3 |
|
4 |
+
use Inpsyde\SearchReplace\Service;
|
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 |
+
* @package Inpsyde\SearchReplace\Database
|
12 |
*/
|
|
|
13 |
class Replace {
|
14 |
|
15 |
/**
|
18 |
* @var
|
19 |
*/
|
20 |
protected $search;
|
21 |
+
|
22 |
/**
|
23 |
* the replacement string
|
24 |
*
|
29 |
/**
|
30 |
* The Database Interface Object
|
31 |
*
|
32 |
+
* @type Manager
|
33 |
* @var
|
34 |
*/
|
35 |
protected $dbm;
|
46 |
*/
|
47 |
protected $dry_run = TRUE;
|
48 |
|
49 |
+
/**
|
50 |
+
* Replace constructor.
|
51 |
+
*
|
52 |
+
* @param Manager $dbm
|
53 |
+
*/
|
54 |
+
public function __construct( Manager $dbm ) {
|
55 |
|
56 |
$this->dbm = $dbm;
|
57 |
}
|
72 |
|
73 |
public function run_search_replace( $search, $replace, $tables ) {
|
74 |
|
75 |
+
if ( $search === $replace ){
|
76 |
+
return new \WP_Error( 'error', __( "Search and replace pattern can't be the same!" ) );
|
77 |
+
}
|
78 |
+
|
79 |
+
$execution_time = new Service\MaxExecutionTime();
|
80 |
+
$execution_time->set();
|
81 |
+
|
82 |
$report = array(
|
83 |
'errors' => NULL,
|
84 |
'changes' => array(),
|
100 |
|
101 |
}
|
102 |
|
103 |
+
$execution_time->restore();
|
104 |
+
|
105 |
return $report;
|
106 |
}
|
107 |
|
130 |
$columns = $columns[ 1 ];
|
131 |
|
132 |
if ( NULL === $primary_key ) {
|
133 |
+
array_push(
|
134 |
+
$table_report[ 'errors' ],
|
135 |
+
"The table \"{$table}\" has no primary key. Changes will have to be made manually.",
|
136 |
+
'results'
|
137 |
+
);
|
138 |
|
139 |
return $table_report;
|
140 |
}
|
216 |
|
217 |
if ( ! $result ) {
|
218 |
$table_report[ 'errors' ][] = sprintf(
|
219 |
+
__( 'Error updating row: %d.', 'search-and-replace' ),
|
220 |
+
$row
|
221 |
+
);
|
222 |
} else {
|
223 |
$table_report[ 'updates' ] ++;
|
224 |
}
|
inc/DbBackupAdmin.php
DELETED
@@ -1,51 +0,0 @@
|
|
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/FileDownloader.php
ADDED
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Inpsyde\SearchReplace;
|
3 |
+
|
4 |
+
use Inpsyde\SearchReplace\Database\Exporter;
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Class FileDownloader
|
8 |
+
*
|
9 |
+
* @package Inpsyde\SearchReplace
|
10 |
+
*/
|
11 |
+
class FileDownloader {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
private $nonce_action = 'download_sql';
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
private $nonce_name = 'insr_nonce';
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @var Exporter
|
25 |
+
*/
|
26 |
+
protected $dbe;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Admin constructor.
|
30 |
+
*
|
31 |
+
* @param Exporter $dbe
|
32 |
+
*/
|
33 |
+
public function __construct( Exporter $dbe ) {
|
34 |
+
|
35 |
+
$this->dbe = $dbe;
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Renders to download modal.
|
40 |
+
*
|
41 |
+
* @param array $report
|
42 |
+
*/
|
43 |
+
public function show_modal( $report ) {
|
44 |
+
|
45 |
+
if ( ! isset( $report[ 'changes' ] ) ) {
|
46 |
+
echo '<p>' . esc_html__( 'Search pattern not found.', 'search-and-replace' ) . '</p>';
|
47 |
+
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
$compress = (bool) ( isset( $_POST[ 'compress' ] ) && 'on' === $_POST[ 'compress' ] );
|
51 |
+
|
52 |
+
?>
|
53 |
+
|
54 |
+
<div class="updated notice is-dismissible">
|
55 |
+
<?php
|
56 |
+
//show changes if there are any
|
57 |
+
if ( count( $report[ 'changes' ] ) > 0 ) {
|
58 |
+
$this->show_changes( $report );
|
59 |
+
}
|
60 |
+
|
61 |
+
//if no changes found report that
|
62 |
+
if ( 0 === count( $report [ 'changes' ] ) ) {
|
63 |
+
echo '<p>' . esc_html__( 'Search pattern not found.', 'search-and-replace' ) . '</p>';
|
64 |
+
}
|
65 |
+
?>
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<div class="updated notice is-dismissible insr_sql_button_wrap">
|
69 |
+
<p><?php esc_html_e( 'Your SQL file was created!', 'search-and-replace' ); ?> </p>
|
70 |
+
<form action method="post">
|
71 |
+
<?php wp_nonce_field( $this->nonce_action, $this->nonce_name ); ?>
|
72 |
+
<input type="hidden" name="action" value="download_file" />
|
73 |
+
<input type="hidden" name="sql_file" value="<?php echo esc_attr( $report[ 'filename' ] ); ?>">
|
74 |
+
<input type="hidden" name="compress" value="<?php echo esc_attr( $compress ); ?>">
|
75 |
+
<input id="insr_submit" type="submit" value="<?php esc_attr_e(
|
76 |
+
'Download SQL File', 'search-and-replace'
|
77 |
+
) ?>" class="button" />
|
78 |
+
</form>
|
79 |
+
</div>
|
80 |
+
<?php
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* displays the changes made to the db
|
85 |
+
* echoes the changes in formatted html
|
86 |
+
*
|
87 |
+
* @param $report array 'errors' : WP-Error Object if Errors
|
88 |
+
* 'tables' : Number of tables processed
|
89 |
+
* 'changes_count' : Number of changes made
|
90 |
+
* 'changes'
|
91 |
+
* Array with at least these elements:
|
92 |
+
* 'table_name'=>$[name of current table],
|
93 |
+
* 'changes' => array('row' => [row that has been changed ],
|
94 |
+
* 'column' => [column that has been changed],
|
95 |
+
* 'from' => ( old value ),
|
96 |
+
* 'to' => ( $new value ),
|
97 |
+
*
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
public 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 |
+
'search-and-replace'
|
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 |
+
'search-and-replace'
|
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', 'search-and-replace' ); ?></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 < 1 ) :
|
145 |
+
continue;
|
146 |
+
endif;
|
147 |
+
|
148 |
+
$table = $table_report[ 'table_name' ];
|
149 |
+
?>
|
150 |
+
<h2 class="search-replace-modal-table-headline">
|
151 |
+
<strong><?php esc_html_e( 'Table:', 'search-and-replace' ); ?></strong>
|
152 |
+
<?php echo $table; ?>
|
153 |
+
<strong><?php esc_html_e( 'Changes:', 'search-and-replace' ); ?></strong>
|
154 |
+
<?php echo $changes_made; ?>
|
155 |
+
</h2>
|
156 |
+
|
157 |
+
<table class="search-replace-modal-table">
|
158 |
+
|
159 |
+
<?php foreach ( $changes as $change ) : ?>
|
160 |
+
|
161 |
+
<tr>
|
162 |
+
<th class="search-replace-narrow">
|
163 |
+
<?php esc_html_e( 'row', 'search-and-replace' ); ?>
|
164 |
+
</th>
|
165 |
+
<td class="search-replace-narrow"><?php echo esc_html( $change [ 'row' ] ); ?></td>
|
166 |
+
<th><?php esc_html_e( 'column', 'search-and-replace' ); ?></th>
|
167 |
+
<td><?php echo esc_html( $change [ 'column' ] ); ?></td>
|
168 |
+
<?php
|
169 |
+
//trim results and wrap with highlight class
|
170 |
+
$old_value = esc_html( $change [ 'from' ] );
|
171 |
+
$old_value = $this->trim_search_results( $search, $old_value, $delimiter );
|
172 |
+
$old_value = str_replace( $search, $search_highlight, $old_value );
|
173 |
+
|
174 |
+
$new_value = esc_html( $change[ 'to' ] );
|
175 |
+
$new_value = $this->trim_search_results( $replace, $new_value, $delimiter );
|
176 |
+
$new_value = str_replace( $replace, $replace_highlight, $new_value );
|
177 |
+
?>
|
178 |
+
<th><?php esc_html_e( 'Old value:', 'search-and-replace' ); ?></th>
|
179 |
+
<td><?php echo wp_kses( $old_value, [ 'span' => [ 'class' => [] ] ] ); ?></td>
|
180 |
+
<th><?php esc_html_e( 'New value:', 'search-and-replace' ); ?></th>
|
181 |
+
<td><?php echo wp_kses( $new_value, [ 'span' => [ 'class' => [] ] ] ); ?></td>
|
182 |
+
</tr>
|
183 |
+
|
184 |
+
<?php endforeach ?>
|
185 |
+
|
186 |
+
</table>
|
187 |
+
|
188 |
+
<?php endforeach; ?>
|
189 |
+
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
<?php
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
* Trims a given string to 50 chars before and after the search string, if the string is longer than 199 chars.
|
197 |
+
*
|
198 |
+
* @param $needle string
|
199 |
+
* @param $haystack string
|
200 |
+
* @param $delimiter array $delimiter[0]=start delimiter, $delimiter[1] = end delimiter
|
201 |
+
*
|
202 |
+
* @return string The trimmed $haystack
|
203 |
+
*/
|
204 |
+
public function trim_search_results( $needle, $haystack, $delimiter ) {
|
205 |
+
|
206 |
+
//if result has <200 characters we return the whole string
|
207 |
+
if ( strlen( $haystack ) < 100 ) {
|
208 |
+
return $haystack;
|
209 |
+
}
|
210 |
+
$trimmed_results = NULL;
|
211 |
+
// Get all occurrences of $needle with up to 50 chars front & back.
|
212 |
+
preg_match_all( '@.{0,50}' . $needle . '.{0,50}@', $haystack, $trimmed_results );
|
213 |
+
$return_value = '';
|
214 |
+
/** @var array $trimmed_results */
|
215 |
+
$imax = count( $trimmed_results );
|
216 |
+
for ( $i = 0; $i < $imax; $i ++ ) {
|
217 |
+
//reset delimiter, might have been changed
|
218 |
+
$local_delimiter = $delimiter;
|
219 |
+
//check if the first trimmmed result is the beginning of $haystack. if so remove leading delimiter
|
220 |
+
if ( $i === 0 ) {
|
221 |
+
$pos = strpos( $haystack, $trimmed_results[ 0 ][ $i ] );
|
222 |
+
if ( $pos === 0 ) {
|
223 |
+
$local_delimiter[ 0 ] = '';
|
224 |
+
}
|
225 |
+
}
|
226 |
+
//check if the last trimmed result is the end of $haystack. if so, remove trailing delimiter
|
227 |
+
$last_index = count( $trimmed_results ) - 1;
|
228 |
+
if ( $i === $last_index ) {
|
229 |
+
$trimmed_result_length = strlen( $trimmed_results[ 0 ][ $i ] );
|
230 |
+
$substring = substr( $haystack, - $trimmed_result_length );
|
231 |
+
if ( $substring === $trimmed_results[ 0 ][ $i ] ) {
|
232 |
+
$local_delimiter[ 1 ] = '';
|
233 |
+
}
|
234 |
+
}
|
235 |
+
$return_value .= $local_delimiter[ 0 ] . $trimmed_results[ 0 ][ $i ] . $local_delimiter[ 1 ];
|
236 |
+
}
|
237 |
+
|
238 |
+
return $return_value;
|
239 |
+
}
|
240 |
+
/**
|
241 |
+
* calls the file delivery in Class DatabaseExporter
|
242 |
+
*
|
243 |
+
* @wp-hook init
|
244 |
+
*/
|
245 |
+
public function deliver_backup_file() {
|
246 |
+
|
247 |
+
if ( ! $_SERVER[ 'REQUEST_METHOD' ] === 'POST' ) {
|
248 |
+
return;
|
249 |
+
}
|
250 |
+
|
251 |
+
if ( ! isset( $_POST[ 'insr_nonce' ] ) || ! wp_verify_nonce( $_POST[ 'insr_nonce' ], 'download_sql' ) ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
+
|
255 |
+
if ( isset( $_POST[ 'action' ] ) && 'download_file' === $_POST[ 'action' ] ) {
|
256 |
+
|
257 |
+
$sql_file = '';
|
258 |
+
if ( isset( $_POST[ 'sql_file' ] ) ) {
|
259 |
+
$sql_file = $_POST[ 'sql_file' ];
|
260 |
+
}
|
261 |
+
|
262 |
+
$compress = FALSE;
|
263 |
+
if ( isset( $_POST[ 'compress' ] ) ) {
|
264 |
+
$compress = $_POST[ 'compress' ];
|
265 |
+
}
|
266 |
+
|
267 |
+
// If file name contains path or does not end with '.sql' exit.
|
268 |
+
$ext = strrchr( $sql_file, '.' );
|
269 |
+
if ( FALSE !== strpos( $sql_file, '/' ) || '.sql' !== $ext ) {
|
270 |
+
die;
|
271 |
+
}
|
272 |
+
$this->dbe->deliver_backup( $sql_file, $compress );
|
273 |
+
}
|
274 |
+
|
275 |
+
}
|
276 |
+
}
|
inc/Init.php
DELETED
@@ -1,178 +0,0 @@
|
|
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 |
-
__( 'Search & Replace', '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 Page', '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', 'inpsyde_search_replace' );
|
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/Page/AbstractPage.php
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Inpsyde\SearchReplace\Page;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class AbstractPage
|
7 |
+
*
|
8 |
+
* @package Inpsyde\SearchReplace\Page
|
9 |
+
*/
|
10 |
+
abstract class AbstractPage {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Returns the translated title for the page.
|
14 |
+
*
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
abstract public function get_page_title();
|
18 |
+
|
19 |
+
/**
|
20 |
+
* By default "Search & Replace". Can be overwritten in child-classes.
|
21 |
+
*
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public function get_menu_title() {
|
25 |
+
|
26 |
+
return esc_html__( 'Search & Replace', 'search-and-replace' );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
protected $errors = array();
|
33 |
+
|
34 |
+
/**
|
35 |
+
* @param string $msg
|
36 |
+
*/
|
37 |
+
public function add_error( $msg ) {
|
38 |
+
|
39 |
+
$this->errors[] = (string) $msg;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Echoes the content of the $errors array as formatted HTML if it contains error messages.
|
44 |
+
*/
|
45 |
+
public function display_errors() {
|
46 |
+
|
47 |
+
if ( count( $this->errors ) < 1 ) {
|
48 |
+
return;
|
49 |
+
}
|
50 |
+
|
51 |
+
$html = '<div class="error notice is-dismissible">';
|
52 |
+
$html .= sprintf( '<strong>%s</strong>', esc_html__( 'Errors:', 'search-and-replace' ) );
|
53 |
+
$html .= '<ul>';
|
54 |
+
foreach ( $this->errors as $error ) :
|
55 |
+
$html .= '<li>' . esc_html( $error ) . '</li>';
|
56 |
+
endforeach;
|
57 |
+
$html .= '</ul>';
|
58 |
+
$html .= '</div>';
|
59 |
+
|
60 |
+
echo $html;
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
*displays the html for the submit button
|
65 |
+
*/
|
66 |
+
public function show_submit_button() {
|
67 |
+
|
68 |
+
echo '<input type="hidden" name="action" value="' . $this->get_slug() . '" />';
|
69 |
+
submit_button( $this->get_submit_button_title() );
|
70 |
+
wp_nonce_field( 'replace_domain', 'insr_nonce' );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* @return string
|
75 |
+
*/
|
76 |
+
protected function get_submit_button_title() {
|
77 |
+
|
78 |
+
return esc_html__( 'Submit', 'search-replace' );
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* @return string
|
83 |
+
*/
|
84 |
+
public function get_slug() {
|
85 |
+
|
86 |
+
return sanitize_title_with_dashes( $this->get_page_title() );
|
87 |
+
}
|
88 |
+
}
|
inc/Page/BackupDatabase.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Page;
|
3 |
+
|
4 |
+
use Inpsyde\SearchReplace\Database;
|
5 |
+
use Inpsyde\SearchReplace\FileDownloader;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class BackupDatabase
|
9 |
+
*
|
10 |
+
* @package Inpsyde\SearchReplace\Page
|
11 |
+
*/
|
12 |
+
class BackupDatabase extends AbstractPage implements PageInterface {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var Database\Exporter
|
16 |
+
*/
|
17 |
+
private $dbe;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var FileDownloader
|
21 |
+
*/
|
22 |
+
private $downloader;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* BackupDatabase constructor.
|
26 |
+
*
|
27 |
+
* @param Database\Exporter $dbe
|
28 |
+
* @param FileDownloader $downloader
|
29 |
+
*/
|
30 |
+
public function __construct( Database\Exporter $dbe, FileDownloader $downloader ) {
|
31 |
+
|
32 |
+
$this->dbe = $dbe;
|
33 |
+
$this->downloader = $downloader;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
+
public function get_page_title() {
|
40 |
+
|
41 |
+
return esc_html__( 'Backup Database', 'search-and-replace' );
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Return the static slug string.
|
46 |
+
*
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function get_slug() {
|
50 |
+
|
51 |
+
return 'backup-database';
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
*shows the page template
|
56 |
+
*/
|
57 |
+
public function render() {
|
58 |
+
|
59 |
+
require_once( __DIR__ . '/../templates/db_backup.php' );
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @return string
|
64 |
+
*/
|
65 |
+
protected function get_submit_button_title() {
|
66 |
+
|
67 |
+
return esc_html__( 'Create SQL File', 'search-and-replace' );
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* event handler for click on export sql button
|
72 |
+
*/
|
73 |
+
public function save() {
|
74 |
+
|
75 |
+
$report = $this->dbe->db_backup();
|
76 |
+
$this->downloader->show_modal( $report );
|
77 |
+
|
78 |
+
return TRUE;
|
79 |
+
}
|
80 |
+
|
81 |
+
}
|
inc/Page/Credits.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Page;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class Credits
|
6 |
+
*
|
7 |
+
* @package Inpsyde\SearchReplace\Page
|
8 |
+
*/
|
9 |
+
class Credits extends AbstractPage implements PageInterface {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Callback function for credits content.
|
13 |
+
*/
|
14 |
+
public function render() {
|
15 |
+
|
16 |
+
require_once( __DIR__ . '/../templates/credits.php' );
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function get_page_title() {
|
23 |
+
|
24 |
+
return esc_html__( 'Credits', 'search-and-replace' );
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Return the static slug string.
|
29 |
+
*
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public function get_slug() {
|
33 |
+
|
34 |
+
return 'credits';
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* @return boolean
|
39 |
+
*/
|
40 |
+
public function save() {
|
41 |
+
|
42 |
+
return TRUE;
|
43 |
+
}
|
44 |
+
}
|
inc/Page/Manager.php
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Inpsyde\SearchReplace\Page;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class Manager
|
7 |
+
*
|
8 |
+
* @package Inpsyde\SearchReplace\Page
|
9 |
+
*/
|
10 |
+
class Manager {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @var PageInterface[]
|
14 |
+
*/
|
15 |
+
private $pages = array();
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Add page.
|
19 |
+
*
|
20 |
+
* @param PageInterface $page
|
21 |
+
*/
|
22 |
+
public function add_page( PageInterface $page ) {
|
23 |
+
|
24 |
+
$this->pages[ $page->get_slug() ] = $page;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Handling the POST-Request and save the data.
|
29 |
+
*/
|
30 |
+
public function save() {
|
31 |
+
|
32 |
+
if ( $_SERVER[ 'REQUEST_METHOD' ] !== 'POST' ) {
|
33 |
+
return;
|
34 |
+
}
|
35 |
+
|
36 |
+
$page = filter_input( INPUT_POST, 'action' );
|
37 |
+
if ( '' === $page ) {
|
38 |
+
return;
|
39 |
+
}
|
40 |
+
|
41 |
+
if ( ! isset( $this->pages[ $page ] ) ) {
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
|
45 |
+
if ( ! check_admin_referer( 'replace_domain', 'insr_nonce' ) ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
|
49 |
+
/** @var PageInterface */
|
50 |
+
$this->pages[ $page ]->save();
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Register all Pages.
|
55 |
+
*
|
56 |
+
* @wp-hook admin_menu
|
57 |
+
*/
|
58 |
+
public function register_pages() {
|
59 |
+
|
60 |
+
foreach ( $this->pages as $slug => $page ) {
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @param string $cap
|
64 |
+
* @param PageInterface $page
|
65 |
+
*/
|
66 |
+
$cap = apply_filters( 'insr-capability', 'install_plugins', $page );
|
67 |
+
|
68 |
+
add_submenu_page(
|
69 |
+
'tools.php',
|
70 |
+
$page->get_page_title(),
|
71 |
+
$page->get_menu_title(),
|
72 |
+
$cap,
|
73 |
+
$slug,
|
74 |
+
array( $this, 'render' )
|
75 |
+
);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Removes the plugins sub-menu pages from admin menu.
|
81 |
+
*
|
82 |
+
* @wp-hook admin_head
|
83 |
+
*/
|
84 |
+
public function remove_submenu_pages() {
|
85 |
+
|
86 |
+
$i = 0;
|
87 |
+
foreach ( $this->pages as $slug => $page ) {
|
88 |
+
if ( $i > 0 ) {
|
89 |
+
remove_submenu_page( 'tools.php', $slug );
|
90 |
+
}
|
91 |
+
$i ++;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Render all pages and handling save.
|
97 |
+
*/
|
98 |
+
public function render() {
|
99 |
+
|
100 |
+
$url = admin_url( 'tools.php' );
|
101 |
+
$current_page = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : key( $this->pages );
|
102 |
+
|
103 |
+
$output = '<div class="wrap">';
|
104 |
+
$output .= '<h1 id="title">' . esc_html__( 'Search & Replace', 'search-and-replace' ) . '</h1>';
|
105 |
+
$output .= '<h2 class="nav-tab-wrapper">';
|
106 |
+
$page = '';
|
107 |
+
foreach ( $this->pages as $slug => $page ) :
|
108 |
+
$class = $current_page === $slug ? 'nav-tab-active' : '';
|
109 |
+
$output .= sprintf(
|
110 |
+
'<a class="nav-tab %1$s" href="%2$s">%3$s</a>',
|
111 |
+
esc_attr( $class ),
|
112 |
+
add_query_arg( 'page', $slug, $url ),
|
113 |
+
$page->get_page_title()
|
114 |
+
);
|
115 |
+
endforeach;
|
116 |
+
$output .= '</h2>';
|
117 |
+
|
118 |
+
echo $output;
|
119 |
+
echo '<div class="tab__content">';
|
120 |
+
$this->save();
|
121 |
+
$page->display_errors();
|
122 |
+
$page = $this->pages[ $current_page ];
|
123 |
+
$page->render();
|
124 |
+
echo '</div>';
|
125 |
+
|
126 |
+
echo '</div>'; // wrap
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Registers the Plugin stylesheet.
|
131 |
+
*
|
132 |
+
* @wp-hook admin_enqueue_scripts
|
133 |
+
*/
|
134 |
+
public function register_css() {
|
135 |
+
|
136 |
+
if ( ! isset( $_GET[ 'page' ] ) || ! array_key_exists( $_GET[ 'page' ], $this->pages ) ) {
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
|
140 |
+
$suffix = $this->get_script_suffix();
|
141 |
+
|
142 |
+
$url = ( INSR_DIR . '/assets/css/inpsyde-search-replace' . $suffix . '.css' );
|
143 |
+
$handle = 'insr-styles';
|
144 |
+
wp_register_script( $handle, $url );
|
145 |
+
wp_enqueue_style( $handle, $url, array(), FALSE, FALSE );
|
146 |
+
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Registers the Plugin javascript.
|
151 |
+
*
|
152 |
+
* @wp-hook admin_enqueue_scripts
|
153 |
+
*/
|
154 |
+
public function register_js() {
|
155 |
+
|
156 |
+
if ( ! isset( $_GET[ 'page' ] ) || ! array_key_exists( $_GET[ 'page' ], $this->pages ) ) {
|
157 |
+
return;
|
158 |
+
}
|
159 |
+
|
160 |
+
$suffix = $this->get_script_suffix();
|
161 |
+
|
162 |
+
$url = ( INSR_DIR . '/assets/js/inpsyde-search-replace' . $suffix . '.js' );
|
163 |
+
$handle = 'insr-js';
|
164 |
+
wp_register_script( $handle, $url );
|
165 |
+
wp_enqueue_script( $handle, $url, array(), FALSE, FALSE );
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Get script suffix to difference between live and debug files.
|
171 |
+
*
|
172 |
+
* @return string
|
173 |
+
*/
|
174 |
+
private function get_script_suffix() {
|
175 |
+
|
176 |
+
return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
177 |
+
}
|
178 |
+
|
179 |
+
}
|
inc/Page/PageInterface.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Inpsyde\SearchReplace\Page;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Interface PageInterface
|
7 |
+
*
|
8 |
+
* @package Inpsyde\SearchReplace\Page
|
9 |
+
*/
|
10 |
+
interface PageInterface {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param string $msg
|
14 |
+
*/
|
15 |
+
public function add_error( $msg );
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Echoes the content of the $errors array as formatted HTML if it contains error messages.
|
19 |
+
*/
|
20 |
+
public function display_errors();
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Returns the translated Menu title for add_submenu_page().
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public function get_menu_title();
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Returns the translated title for the page.
|
31 |
+
*
|
32 |
+
* @return string
|
33 |
+
*/
|
34 |
+
public function get_page_title();
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Returns the page_slug for add_submenu_page().
|
38 |
+
*
|
39 |
+
* @return string
|
40 |
+
*/
|
41 |
+
public function get_slug();
|
42 |
+
|
43 |
+
/**
|
44 |
+
* rendering the page content.
|
45 |
+
*/
|
46 |
+
public function render();
|
47 |
+
|
48 |
+
/**
|
49 |
+
* saving the data.
|
50 |
+
*
|
51 |
+
* @return boolean
|
52 |
+
*/
|
53 |
+
public function save();
|
54 |
+
}
|
inc/Page/ReplaceDomain.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Inpsyde\SearchReplace\Page;
|
4 |
+
|
5 |
+
use Inpsyde\SearchReplace\Database;
|
6 |
+
use Inpsyde\SearchReplace\FileDownloader;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class ReplaceDomain
|
10 |
+
*
|
11 |
+
* @package Inpsyde\SearchReplace\inc\Page
|
12 |
+
*/
|
13 |
+
class ReplaceDomain extends AbstractPage implements PageInterface {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var \Inpsyde\SearchReplace\Database\Exporter
|
17 |
+
*/
|
18 |
+
private $dbe;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var Manager
|
22 |
+
*/
|
23 |
+
private $dbm;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var FileDownloader
|
27 |
+
*/
|
28 |
+
private $downloader;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* ReplaceDomain constructor.
|
32 |
+
*
|
33 |
+
* @param Database\Manager $dbm
|
34 |
+
* @param Database\Exporter $dbe
|
35 |
+
* @param FileDownloader $downloader
|
36 |
+
*/
|
37 |
+
public function __construct( Database\Manager $dbm, Database\Exporter $dbe, FileDownloader $downloader ) {
|
38 |
+
|
39 |
+
$this->dbm = $dbm;
|
40 |
+
$this->dbe = $dbe;
|
41 |
+
$this->downloader = $downloader;
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* @return bool
|
46 |
+
*/
|
47 |
+
public function save() {
|
48 |
+
|
49 |
+
$search = esc_url_raw( filter_input( INPUT_POST, 'search' ) );
|
50 |
+
$replace = esc_url_raw( filter_input( INPUT_POST, 'replace' ) );
|
51 |
+
$new_db_prefix = esc_attr( filter_input( INPUT_POST, 'new_db_prefix' ) );
|
52 |
+
|
53 |
+
//search field should not be empty
|
54 |
+
if ( '' === $replace ) {
|
55 |
+
$this->add_error( esc_html__( 'Replace Field should not be empty.', 'search-and-replace' ) );
|
56 |
+
|
57 |
+
return FALSE;
|
58 |
+
}
|
59 |
+
|
60 |
+
$report = $this->dbe->db_backup( $search, $replace, array(), TRUE, $new_db_prefix );
|
61 |
+
$this->downloader->show_modal( $report );
|
62 |
+
|
63 |
+
return TRUE;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* shows the page template
|
68 |
+
*/
|
69 |
+
public function render() {
|
70 |
+
|
71 |
+
require_once( __DIR__ . '/../templates/replace_domain.php' );
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @return string
|
76 |
+
*/
|
77 |
+
protected function get_submit_button_title() {
|
78 |
+
|
79 |
+
return esc_html__( 'Do Replace Domain/Url', 'search-and-replace' );
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* @return string
|
84 |
+
*/
|
85 |
+
public function get_page_title() {
|
86 |
+
|
87 |
+
return esc_html__( 'Replace Domain URL', 'search-and-replace' );
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Return the static slug string.
|
92 |
+
*
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
public function get_slug() {
|
96 |
+
|
97 |
+
return 'replace-domain-url';
|
98 |
+
}
|
99 |
+
}
|
inc/Page/SearchReplace.php
ADDED
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Page;
|
3 |
+
|
4 |
+
use Inpsyde\SearchReplace\Database,
|
5 |
+
Inpsyde\SearchReplace\Service;
|
6 |
+
use Inpsyde\SearchReplace\FileDownloader;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class SearchReplace
|
10 |
+
*
|
11 |
+
* @package Inpsyde\SearchReplace\Page
|
12 |
+
*/
|
13 |
+
class SearchReplace extends AbstractPage implements PageInterface {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @var Manager
|
17 |
+
*/
|
18 |
+
private $dbm;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @var $replace
|
22 |
+
*/
|
23 |
+
private $replace;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var $dbe
|
27 |
+
*/
|
28 |
+
private $dbe;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @var FileDownloader
|
32 |
+
*/
|
33 |
+
private $downloader;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* BackupDatabase constructor.
|
37 |
+
*
|
38 |
+
* @param Database\Manager $dbm
|
39 |
+
* @param Database\Replace $replace
|
40 |
+
* @param Database\Exporter $dbe
|
41 |
+
* @param FileDownloader $downloader
|
42 |
+
*/
|
43 |
+
public function __construct( Database\Manager $dbm, Database\Replace $replace, Database\Exporter $dbe, FileDownloader $downloader ) {
|
44 |
+
|
45 |
+
$this->dbm = $dbm;
|
46 |
+
$this->replace = $replace;
|
47 |
+
$this->dbe = $dbe;
|
48 |
+
$this->downloader = $downloader;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* shows the page contents
|
53 |
+
*/
|
54 |
+
public function render() {
|
55 |
+
|
56 |
+
require_once( __DIR__ . '/../templates/search_replace.php' );
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* @return string
|
61 |
+
*/
|
62 |
+
public function get_page_title() {
|
63 |
+
|
64 |
+
return esc_html__( 'Search & Replace', 'search-and-replace' );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Return the static slug string.
|
69 |
+
*
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
public function get_slug() {
|
73 |
+
|
74 |
+
return 'search-replace';
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
*prints a select with all the tables and their sizes
|
79 |
+
*
|
80 |
+
* @return void
|
81 |
+
*/
|
82 |
+
protected function show_table_list() {
|
83 |
+
|
84 |
+
$tables = $this->dbm->get_tables();
|
85 |
+
$sizes = $this->dbm->get_sizes();
|
86 |
+
$table_count = count( $tables );
|
87 |
+
|
88 |
+
//adjust height of select according to table count, but max 20 rows
|
89 |
+
$select_rows = $table_count < 20 ? $table_count : 20;
|
90 |
+
|
91 |
+
//if we come from a dry run, we select the tables to the dry run again
|
92 |
+
/** @var bool | string $selected_tables */
|
93 |
+
$selected_tables = FALSE;
|
94 |
+
if ( isset( $_POST[ 'select_tables' ] ) ) {
|
95 |
+
$selected_tables = $_POST[ 'select_tables' ];
|
96 |
+
}
|
97 |
+
|
98 |
+
echo '<select id="select_tables" name="select_tables[]" multiple="multiple" size = "' . $select_rows . '">';
|
99 |
+
foreach ( $tables as $table ) {
|
100 |
+
$table_size = isset ( $sizes[ $table ] ) ? $sizes[ $table ] : '';
|
101 |
+
//check if dry run. if dry run && current table is in "selected" array add selected attribute
|
102 |
+
if ( isset( $_POST[ 'dry_run' ] )
|
103 |
+
&& $selected_tables
|
104 |
+
&& in_array( $table, $selected_tables, FALSE )
|
105 |
+
) {
|
106 |
+
echo "<option value='$table' selected='selected'>$table . $table_size </option>";
|
107 |
+
|
108 |
+
//if current table had not been selected echo option without "selected" attribute
|
109 |
+
} else {
|
110 |
+
echo '<option value="' . $table . '">' . $table . $table_size . '</option>';
|
111 |
+
}
|
112 |
+
|
113 |
+
}
|
114 |
+
echo( '</select>' );
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* @return bool
|
119 |
+
*/
|
120 |
+
public function save() {
|
121 |
+
|
122 |
+
//check for errors in form
|
123 |
+
if ( ! $this->is_request_valid() ) {
|
124 |
+
return FALSE;
|
125 |
+
}
|
126 |
+
|
127 |
+
$tables = isset( $_POST[ 'select_tables' ] ) ? $_POST[ 'select_tables' ] : '';
|
128 |
+
$dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
|
129 |
+
|
130 |
+
//remove wp_magic_quotes
|
131 |
+
$search = stripslashes( filter_input( INPUT_POST, 'search' ) );
|
132 |
+
$replace = stripslashes( filter_input( INPUT_POST, 'replace' ) );
|
133 |
+
|
134 |
+
//if dry run is checked we run the replace function with dry run and return
|
135 |
+
if ( TRUE === $dry_run ) {
|
136 |
+
$this->run_replace( $search, $replace, $tables, $dry_run );
|
137 |
+
|
138 |
+
return FALSE;
|
139 |
+
}
|
140 |
+
|
141 |
+
$export_or_save = filter_input( INPUT_POST, 'export_or_save' );
|
142 |
+
|
143 |
+
if ( 'export' === $export_or_save ) {
|
144 |
+
//'export'-button was checked
|
145 |
+
$report = $this->dbe->db_backup( $search, $replace, $tables );
|
146 |
+
$this->downloader->show_modal( $report );
|
147 |
+
} else {
|
148 |
+
//"Save changes to database" was checked
|
149 |
+
$this->run_replace( $search, $replace, $tables, $dry_run );
|
150 |
+
}
|
151 |
+
|
152 |
+
return TRUE;
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* @return string
|
157 |
+
*/
|
158 |
+
protected function get_submit_button_title() {
|
159 |
+
|
160 |
+
return esc_html__( 'Do Search & Replace', 'search-and-replace' );
|
161 |
+
}
|
162 |
+
|
163 |
+
/**
|
164 |
+
* calls run_replace_table() on each table provided in array $tables
|
165 |
+
*
|
166 |
+
* @param $search
|
167 |
+
* @param $replace
|
168 |
+
* @param $tables array of tables we want to search
|
169 |
+
* @param $dry_run True if dry run (no changes are written to db)
|
170 |
+
*
|
171 |
+
* @return null
|
172 |
+
*/
|
173 |
+
protected function run_replace( $search, $replace, $tables, $dry_run ) {
|
174 |
+
|
175 |
+
echo '<div class="updated notice is-dismissible">';
|
176 |
+
if ( $dry_run ) {
|
177 |
+
echo '<p><strong>'
|
178 |
+
. esc_html__(
|
179 |
+
'Dry run is selected. No changes were made to the database and no SQL file was written .',
|
180 |
+
'search-and-replace'
|
181 |
+
)
|
182 |
+
. '</strong></p>';
|
183 |
+
|
184 |
+
} else {
|
185 |
+
echo '<p><strong>'
|
186 |
+
. esc_html__(
|
187 |
+
'The following changes were made to the database: ',
|
188 |
+
'search-and-replace'
|
189 |
+
)
|
190 |
+
. '</strong></p>';
|
191 |
+
}
|
192 |
+
$this->replace->set_dry_run( $dry_run );
|
193 |
+
|
194 |
+
$report = $this->replace->run_search_replace( $search, $replace, $tables );
|
195 |
+
|
196 |
+
if ( is_wp_error( $report ) ) {
|
197 |
+
$this->add_error( __( $report->get_error_message(), 'search-and-replace' ) );
|
198 |
+
$this->display_errors();
|
199 |
+
} else {
|
200 |
+
|
201 |
+
if ( count( $report[ 'changes' ] ) > 0 ) {
|
202 |
+
$this->downloader->show_changes( $report );
|
203 |
+
}
|
204 |
+
|
205 |
+
//if no changes found report that
|
206 |
+
if ( 0 === count( $report [ 'changes' ] ) ) {
|
207 |
+
echo '<p>' . esc_html__( 'Search pattern not found.', 'search-and-replace' ) . '</p>';
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
echo '</div>';
|
212 |
+
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* checks the input form and writes possible errors to a WP_Error object
|
217 |
+
*
|
218 |
+
* @return bool true|false
|
219 |
+
*/
|
220 |
+
protected function is_request_valid() {
|
221 |
+
|
222 |
+
$select_tables = filter_input( INPUT_POST, 'select_tables' );
|
223 |
+
if ( '' === $select_tables ) {
|
224 |
+
$this->add_error( __( 'No Tables were selected.', 'search-and-replace' ) );
|
225 |
+
|
226 |
+
return FALSE;
|
227 |
+
}
|
228 |
+
|
229 |
+
$search = filter_input( INPUT_POST, 'search' );
|
230 |
+
$replace = filter_input( INPUT_POST, 'replace' );
|
231 |
+
|
232 |
+
//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)
|
233 |
+
if ( '' === $search && '' === $replace ) {
|
234 |
+
$this->add_error( esc_attr__( 'Search field is empty.', 'search-and-replace' ) );
|
235 |
+
|
236 |
+
return FALSE;
|
237 |
+
}
|
238 |
+
|
239 |
+
$export_or_save = filter_input( INPUT_POST, 'export_or_save' );
|
240 |
+
//check if the user tries to replace domain name into the database
|
241 |
+
if ( '' === $export_or_save || 'save_to_db' === $export_or_save ) {
|
242 |
+
$contains_site_url = strpos( $search, $this->get_stripped_site_url() );
|
243 |
+
if ( FALSE !== $contains_site_url ) {
|
244 |
+
$this->add_error(
|
245 |
+
esc_html__(
|
246 |
+
'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.',
|
247 |
+
'search-and-replace'
|
248 |
+
)
|
249 |
+
);
|
250 |
+
|
251 |
+
return FALSE;
|
252 |
+
}
|
253 |
+
|
254 |
+
}
|
255 |
+
|
256 |
+
return TRUE;
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Returns the site url, strips http:// or https://
|
261 |
+
*/
|
262 |
+
private function get_stripped_site_url() {
|
263 |
+
|
264 |
+
$url = get_site_url();
|
265 |
+
|
266 |
+
return substr( $url, strpos( $url, '/' ) + 2 );
|
267 |
+
}
|
268 |
+
|
269 |
+
/**
|
270 |
+
* shows the search value in template.
|
271 |
+
*/
|
272 |
+
private function get_search_value() {
|
273 |
+
|
274 |
+
$search = isset( $_POST[ 'search' ] ) ? $_POST[ 'search' ] : '';
|
275 |
+
$dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
|
276 |
+
|
277 |
+
if ( $dry_run ) {
|
278 |
+
$search = stripslashes( $search );
|
279 |
+
$search = htmlentities( $search );
|
280 |
+
echo $search;
|
281 |
+
}
|
282 |
+
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* shows the replace value in template
|
287 |
+
*/
|
288 |
+
private function get_replace_value() {
|
289 |
+
|
290 |
+
$replace = isset( $_POST[ 'replace' ] ) ? $_POST[ 'replace' ] : '';
|
291 |
+
$dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
|
292 |
+
if ( $dry_run ) {
|
293 |
+
$replace = stripslashes( $replace );
|
294 |
+
$replace = htmlentities( $replace );
|
295 |
+
echo $replace;
|
296 |
+
}
|
297 |
+
|
298 |
+
}
|
299 |
+
|
300 |
+
}
|
inc/{SqlImportAdmin.php → Page/SqlImport.php}
RENAMED
@@ -1,52 +1,66 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
namespace Inpsyde\SearchReplace\
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
/**
|
8 |
-
*
|
|
|
|
|
9 |
*/
|
10 |
-
public function __construct() {
|
11 |
|
12 |
-
$this->dbi
|
13 |
-
$this->errors = new \WP_Error();
|
14 |
-
parent::__construct();
|
15 |
}
|
16 |
|
17 |
/**
|
18 |
-
*
|
19 |
*/
|
20 |
-
public function
|
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 |
-
*
|
|
|
|
|
34 |
*/
|
35 |
-
|
|
|
|
|
|
|
36 |
|
37 |
-
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
-
echo $html;
|
41 |
-
submit_button( esc_html__( 'Import SQL file', 'insr' ) );
|
42 |
}
|
43 |
|
44 |
/**
|
45 |
-
*
|
46 |
-
*
|
47 |
-
* @return void
|
48 |
*/
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
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'
|
@@ -65,11 +79,10 @@ class SqlImportAdmin extends Admin {
|
|
65 |
$sql_source = $this->read_gzfile_into_string( $tempfile );
|
66 |
break;
|
67 |
default:
|
68 |
-
$this->
|
69 |
-
|
70 |
-
esc_html__(
|
71 |
'The file has neither \'.gz\' nor \'.sql\' Extension. Import not possible.',
|
72 |
-
'
|
73 |
)
|
74 |
);
|
75 |
|
@@ -77,21 +90,23 @@ class SqlImportAdmin extends Admin {
|
|
77 |
}
|
78 |
|
79 |
//call import function
|
80 |
-
$success = $this->dbi->import_sql( $sql_source
|
81 |
if ( - 1 === $success ) {
|
82 |
-
$this->
|
83 |
-
|
84 |
-
esc_html__(
|
85 |
'The file does not seem to be a valid SQL file. Import not possible.',
|
86 |
-
'
|
87 |
)
|
88 |
);
|
89 |
} else {
|
90 |
echo '<div class="updated notice is-dismissible">';
|
91 |
echo '<p>';
|
92 |
$msg = printf(
|
93 |
-
__(
|
94 |
-
|
|
|
|
|
|
|
95 |
echo esc_html( $msg );
|
96 |
echo '</p></div>';
|
97 |
}
|
@@ -99,19 +114,22 @@ class SqlImportAdmin extends Admin {
|
|
99 |
//show error
|
100 |
$php_upload_errors = array(
|
101 |
0 => 'There is no error, the file uploaded with success',
|
102 |
-
1 => esc_html__(
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
110 |
);
|
111 |
|
112 |
-
|
113 |
-
'
|
114 |
-
__( 'Upload Error: ' . $php_upload_errors[ $php_upload_error_code ], 'insr' )
|
115 |
);
|
116 |
}
|
117 |
|
@@ -126,16 +144,20 @@ class SqlImportAdmin extends Admin {
|
|
126 |
*/
|
127 |
private function read_gzfile_into_string( $filename ) {
|
128 |
|
129 |
-
$zd
|
130 |
$contents = gzread( $zd, 10000 );
|
131 |
gzclose( $zd );
|
132 |
|
133 |
return $contents;
|
134 |
}
|
135 |
|
136 |
-
|
137 |
-
|
138 |
-
|
|
|
|
|
|
|
|
|
139 |
public function file_upload_max_size() {
|
140 |
|
141 |
$max_size = - 1;
|
@@ -155,6 +177,11 @@ class SqlImportAdmin extends Admin {
|
|
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.
|
1 |
<?php
|
2 |
|
3 |
+
namespace Inpsyde\SearchReplace\Page;
|
4 |
|
5 |
+
use Inpsyde\SearchReplace\Database;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Class SqlImport
|
9 |
+
*
|
10 |
+
* @package Inpsyde\SearchReplace\inc\Page
|
11 |
+
*/
|
12 |
+
class SqlImport extends AbstractPage implements PageInterface {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var Database\Importer
|
16 |
+
*/
|
17 |
+
private $dbi;
|
18 |
|
19 |
/**
|
20 |
+
* SqlImport constructor.
|
21 |
+
*
|
22 |
+
* @param Database\Importer $dbi
|
23 |
*/
|
24 |
+
public function __construct( Database\Importer $dbi ) {
|
25 |
|
26 |
+
$this->dbi = $dbi;
|
|
|
|
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
+
* @return string
|
31 |
*/
|
32 |
+
public function get_page_title() {
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
return esc_html__( 'SQL Import', 'search-and-replace' );
|
|
|
|
|
35 |
}
|
36 |
|
37 |
/**
|
38 |
+
* Return the static slug string.
|
39 |
+
*
|
40 |
+
* @return string
|
41 |
*/
|
42 |
+
public function get_slug() {
|
43 |
+
|
44 |
+
return 'sql-import';
|
45 |
+
}
|
46 |
|
47 |
+
/**
|
48 |
+
* callback function for menu item
|
49 |
+
*/
|
50 |
+
public function render() {
|
51 |
|
52 |
+
require_once( __DIR__ . '/../templates/sql_import.php' );
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
+
* @return string
|
|
|
|
|
57 |
*/
|
58 |
+
protected function get_submit_button_title() {
|
59 |
+
|
60 |
+
return __( 'Import SQL file', 'search-and-replace' );
|
61 |
+
}
|
62 |
+
|
63 |
+
public function save() {
|
64 |
|
65 |
// TODO: Better handling of large files
|
66 |
// maybe like here: http://stackoverflow.com/questions/147821/loading-sql-files-from-within-php , answer by user 'gromo'
|
79 |
$sql_source = $this->read_gzfile_into_string( $tempfile );
|
80 |
break;
|
81 |
default:
|
82 |
+
$this->add_error(
|
83 |
+
__(
|
|
|
84 |
'The file has neither \'.gz\' nor \'.sql\' Extension. Import not possible.',
|
85 |
+
'search-and-replace'
|
86 |
)
|
87 |
);
|
88 |
|
90 |
}
|
91 |
|
92 |
//call import function
|
93 |
+
$success = $this->dbi->import_sql( $sql_source );
|
94 |
if ( - 1 === $success ) {
|
95 |
+
$this->add_error(
|
96 |
+
__(
|
|
|
97 |
'The file does not seem to be a valid SQL file. Import not possible.',
|
98 |
+
'search-and-replace'
|
99 |
)
|
100 |
);
|
101 |
} else {
|
102 |
echo '<div class="updated notice is-dismissible">';
|
103 |
echo '<p>';
|
104 |
$msg = printf(
|
105 |
+
__(
|
106 |
+
'The SQL file was successfully imported. %s SQL queries were performed.', 'search-and-replace'
|
107 |
+
),
|
108 |
+
$success
|
109 |
+
);
|
110 |
echo esc_html( $msg );
|
111 |
echo '</p></div>';
|
112 |
}
|
114 |
//show error
|
115 |
$php_upload_errors = array(
|
116 |
0 => 'There is no error, the file uploaded with success',
|
117 |
+
1 => esc_html__(
|
118 |
+
'The uploaded file exceeds the upload_max_filesize directive in php.ini', 'search-and-replace'
|
119 |
+
),
|
120 |
+
2 => esc_html__(
|
121 |
+
'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
|
122 |
+
'search-and-replace'
|
123 |
+
),
|
124 |
+
3 => esc_html__( 'The uploaded file was only partially uploaded', 'search-and-replace' ),
|
125 |
+
4 => esc_html__( 'No file was uploaded.', 'search-and-replace' ),
|
126 |
+
6 => esc_html__( 'Missing a temporary folder.', 'search-and-replace' ),
|
127 |
+
7 => esc_html__( 'Failed to write file to disk.', 'search-and-replace' ),
|
128 |
+
8 => esc_html__( 'A PHP extension stopped the file upload.', 'search-and-replace' ),
|
129 |
);
|
130 |
|
131 |
+
$$this->add_error(
|
132 |
+
__( 'Upload Error: ' . $php_upload_errors[ $php_upload_error_code ], 'search-and-replace' )
|
|
|
133 |
);
|
134 |
}
|
135 |
|
144 |
*/
|
145 |
private function read_gzfile_into_string( $filename ) {
|
146 |
|
147 |
+
$zd = gzopen( $filename, 'r' );
|
148 |
$contents = gzread( $zd, 10000 );
|
149 |
gzclose( $zd );
|
150 |
|
151 |
return $contents;
|
152 |
}
|
153 |
|
154 |
+
/**
|
155 |
+
* Returns a file size limit in kilobytes based on the PHP upload_max_filesize and post_max_size.
|
156 |
+
*
|
157 |
+
* @link http://stackoverflow.com/questions/13076480/php-get-actual-maximum-upload-size
|
158 |
+
*
|
159 |
+
* @return float
|
160 |
+
*/
|
161 |
public function file_upload_max_size() {
|
162 |
|
163 |
$max_size = - 1;
|
177 |
return $max_size / 1024;
|
178 |
}
|
179 |
|
180 |
+
/**
|
181 |
+
* @param $size
|
182 |
+
*
|
183 |
+
* @return float
|
184 |
+
*/
|
185 |
private function parse_size( $size ) {
|
186 |
|
187 |
$unit = preg_replace( '/[^bkmgtpezy]/i', '', $size ); // Remove the non-unit characters from the size.
|
inc/Plugin.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Inpsyde\SearchReplace;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class Plugin
|
6 |
+
*
|
7 |
+
* @package Inpsyde\SearchReplace\inc
|
8 |
+
*/
|
9 |
+
class Plugin {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @param string $file : The path to the Plugin main file
|
13 |
+
*/
|
14 |
+
public function run( $file ) {
|
15 |
+
|
16 |
+
global $wpdb;
|
17 |
+
|
18 |
+
//Defines the path to the main plugin directory.
|
19 |
+
$plugin_dir_url = plugin_dir_url( $file );
|
20 |
+
define( 'INSR_DIR', $plugin_dir_url );
|
21 |
+
|
22 |
+
if ( is_admin() ) {
|
23 |
+
|
24 |
+
// set max_execution_time to 0
|
25 |
+
$RunTime = new Service\MaxExecutionTime();
|
26 |
+
$RunTime->set();
|
27 |
+
|
28 |
+
$dbm = new Database\Manager( $wpdb );
|
29 |
+
$replace = new Database\Replace( $dbm );
|
30 |
+
$dbe = new Database\Exporter( $replace, $dbm );
|
31 |
+
$dbi = new Database\Importer();
|
32 |
+
|
33 |
+
$downloader = new FileDownloader( $dbe );
|
34 |
+
add_action( 'init', array( $downloader, 'deliver_backup_file' ) );
|
35 |
+
|
36 |
+
$page_manager = new Page\Manager();
|
37 |
+
$page_manager->add_page( new Page\BackupDatabase( $dbe, $downloader ) );
|
38 |
+
$page_manager->add_page( new Page\SearchReplace( $dbm, $replace, $dbe, $downloader ) );
|
39 |
+
$page_manager->add_page( new Page\ReplaceDomain( $dbm, $dbe, $downloader ) );
|
40 |
+
$page_manager->add_page( new Page\SqlImport( $dbi ) );
|
41 |
+
$page_manager->add_page( new Page\Credits() );
|
42 |
+
|
43 |
+
add_action( 'admin_menu', array( $page_manager, 'register_pages' ) );
|
44 |
+
add_action( 'admin_head', array( $page_manager, 'remove_submenu_pages' ) );
|
45 |
+
|
46 |
+
add_action( 'admin_enqueue_scripts', array( $page_manager, 'register_css' ) );
|
47 |
+
add_action( 'admin_enqueue_scripts', array( $page_manager, 'register_js' ) );
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
inc/ReplaceDomainAdmin.php
DELETED
@@ -1,63 +0,0 @@
|
|
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
DELETED
@@ -1,228 +0,0 @@
|
|
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 |
-
//remove wp_magic_quotes
|
85 |
-
$search = stripslashes($_POST[ 'search' ]);
|
86 |
-
$replace = stripslashes($_POST[ 'replace' ]);
|
87 |
-
|
88 |
-
//if dry run is checked we run the replace function with dry run and return
|
89 |
-
if ( $dry_run == TRUE ) {
|
90 |
-
$this->run_replace( $search, $replace, $tables, $dry_run );
|
91 |
-
return;
|
92 |
-
}
|
93 |
-
|
94 |
-
//'export'-button was checked
|
95 |
-
if ( isset ( $_POST[ 'export_or_save' ] ) && 'export' === $_POST [ 'export_or_save' ] ) {
|
96 |
-
|
97 |
-
$this->create_backup_file( $search, $replace, $tables );
|
98 |
-
} else {
|
99 |
-
|
100 |
-
//"Save changes to database" was checked
|
101 |
-
|
102 |
-
$this->run_replace( $search, $replace, $tables, $dry_run );
|
103 |
-
|
104 |
-
}
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
*displays the html for the submit button
|
109 |
-
*/
|
110 |
-
protected function show_submit_button() {
|
111 |
-
|
112 |
-
wp_nonce_field( 'do_search_replace', 'insr_nonce' );
|
113 |
-
|
114 |
-
$html = '<input type="hidden" name="action" value="search_replace" />';
|
115 |
-
echo $html;
|
116 |
-
submit_button( esc_attr__( 'Do Search & Replace', 'insr' ) );
|
117 |
-
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* calls run_replace_table() on each table provided in array $tables
|
122 |
-
*
|
123 |
-
* @param $search
|
124 |
-
* @param $replace
|
125 |
-
* @param $tables array of tables we want to search
|
126 |
-
* @param $dry_run True if dry run (no changes are written to db)
|
127 |
-
*
|
128 |
-
* @return null
|
129 |
-
*/
|
130 |
-
protected function run_replace( $search, $replace, $tables, $dry_run ) {
|
131 |
-
|
132 |
-
echo '<div class="updated notice is-dismissible">';
|
133 |
-
if ( $dry_run ) {
|
134 |
-
echo '<p><strong>'
|
135 |
-
. esc_html__(
|
136 |
-
'Dry run is selected. No changes were made to the database and no SQL file was written .',
|
137 |
-
'insr' )
|
138 |
-
. '</strong></p>';
|
139 |
-
|
140 |
-
} else {
|
141 |
-
echo '<p><strong>'
|
142 |
-
. esc_html__(
|
143 |
-
'The following changes were made to the database: ',
|
144 |
-
'insr' )
|
145 |
-
. '</strong></p>';
|
146 |
-
}
|
147 |
-
$this->replace->set_dry_run( $dry_run );
|
148 |
-
|
149 |
-
$report = $this->replace->run_search_replace( $search, $replace, $tables );
|
150 |
-
|
151 |
-
if ( count( $report[ 'changes' ] ) > 0 ) {
|
152 |
-
$this->show_changes( $report );
|
153 |
-
}
|
154 |
-
|
155 |
-
//if no changes found report that
|
156 |
-
if ( 0 === count( $report [ 'changes' ] ) ) {
|
157 |
-
echo '<p>' . esc_html__( 'Search pattern not found.', 'insr' ) . '</p>';
|
158 |
-
}
|
159 |
-
echo '</div>';
|
160 |
-
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
*checks the input form and writes possible errors to a WP_Error object
|
165 |
-
*/
|
166 |
-
protected function check_input_form() {
|
167 |
-
|
168 |
-
if ( ! isset( $_POST[ 'select_tables' ] ) ) {
|
169 |
-
|
170 |
-
$this->errors->add( 'no_table_selected', esc_attr__( 'No Tables were selected.', 'insr' ) );
|
171 |
-
|
172 |
-
}
|
173 |
-
|
174 |
-
//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)
|
175 |
-
if ( isset( $_POST[ 'replace' ] ) && '' !== $_POST[ 'replace' ]
|
176 |
-
&& ( ! isset ( $_POST[ 'search' ] ) || '' === $_POST[ 'search' ] )
|
177 |
-
) {
|
178 |
-
$this->errors->add( 'empty_search', esc_attr__( 'Search field is empty.', 'insr' ) );
|
179 |
-
|
180 |
-
return;
|
181 |
-
}
|
182 |
-
//check if the user tries to replace domain name into the database
|
183 |
-
if ( isset( $_POST[ 'export_or_save' ] ) && 'save_to_db' === $_POST [ 'export_or_save' ] ) {
|
184 |
-
$search = $_POST[ 'search' ];
|
185 |
-
$contains_site_url = strpos( $search, $this->get_stripped_site_url() );
|
186 |
-
if ( $contains_site_url !== FALSE ) {
|
187 |
-
$this->errors->add(
|
188 |
-
'URL_in-search_expression',
|
189 |
-
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.',
|
190 |
-
'insr' ) );
|
191 |
-
}
|
192 |
-
|
193 |
-
}
|
194 |
-
|
195 |
-
}
|
196 |
-
|
197 |
-
/**
|
198 |
-
* shows the search value in template.
|
199 |
-
*/
|
200 |
-
private function get_search_value() {
|
201 |
-
|
202 |
-
$search = isset( $_POST[ 'search' ] ) ? $_POST[ 'search' ] : '';
|
203 |
-
$dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
|
204 |
-
|
205 |
-
if ( $dry_run ) {
|
206 |
-
$search = stripslashes($search);
|
207 |
-
$search = htmlentities ($search);
|
208 |
-
echo $search;
|
209 |
-
}
|
210 |
-
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* shows the replace value in template
|
215 |
-
*/
|
216 |
-
private function get_replace_value() {
|
217 |
-
|
218 |
-
$replace = isset( $_POST[ 'replace' ] ) ? $_POST[ 'replace' ] : '';
|
219 |
-
$dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
|
220 |
-
if ( $dry_run ) {
|
221 |
-
$replace = stripslashes($replace);
|
222 |
-
$replace = htmlentities ($replace);
|
223 |
-
echo $replace;
|
224 |
-
}
|
225 |
-
|
226 |
-
}
|
227 |
-
|
228 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/Service/MaxExecutionTime.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace Inpsyde\SearchReplace\Service;
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Class RunTime - set the service time out up to 0
|
6 |
+
*
|
7 |
+
* @package Inpsyde\SearchReplace\Service
|
8 |
+
*/
|
9 |
+
class MaxExecutionTime {
|
10 |
+
|
11 |
+
/**
|
12 |
+
* @var max_execution_time
|
13 |
+
*/
|
14 |
+
private $met;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Store current timelimit and set a limit
|
18 |
+
*
|
19 |
+
* @param int $time
|
20 |
+
*/
|
21 |
+
public function set( $time = 0 ){
|
22 |
+
|
23 |
+
if( $time == 0 ){
|
24 |
+
$this->store();
|
25 |
+
}
|
26 |
+
|
27 |
+
set_time_limit( $time );
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Restor timelimit
|
33 |
+
*/
|
34 |
+
public function restore(){
|
35 |
+
|
36 |
+
$this->set( $this->met );
|
37 |
+
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
*
|
42 |
+
*/
|
43 |
+
public function store(){
|
44 |
+
|
45 |
+
$this->met = (int) ini_get('max_execution_time');
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
inc/requisite/src/Requisite/AutoLoaderInterface.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Interface AutoLoaderInterface
|
7 |
+
*
|
8 |
+
* @package Requisite
|
9 |
+
*/
|
10 |
+
interface AutoLoaderInterface {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @param Rule\AutoLoadRuleInterface $rule
|
14 |
+
* @return void
|
15 |
+
*/
|
16 |
+
public function addRule( Rule\AutoLoadRuleInterface $rule );
|
17 |
+
}
|
inc/requisite/src/Requisite/Loader/DefaultConditionalFileLoader.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite\Loader;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class DefaultConditionalFileLoader
|
7 |
+
*
|
8 |
+
* Loads a given file if it is_readable().
|
9 |
+
*
|
10 |
+
* @package Requisite\Loader
|
11 |
+
*/
|
12 |
+
class DefaultConditionalFileLoader implements FileLoaderInterface {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @param string $file
|
16 |
+
* @return bool
|
17 |
+
*/
|
18 |
+
public function loadFile( $file ) {
|
19 |
+
|
20 |
+
if ( ! is_readable( $file ) )
|
21 |
+
return FALSE;
|
22 |
+
|
23 |
+
require_once $file;
|
24 |
+
return TRUE;
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
inc/requisite/src/Requisite/Loader/DirectoryCacheFileLoader.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite\Loader;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class DirectoryCacheFileLoader
|
7 |
+
*
|
8 |
+
* reads in a whole directory at once to cache the existing files
|
9 |
+
* to avoid frequently usage of file_exists() checks
|
10 |
+
*
|
11 |
+
* @package Requisite\Loader
|
12 |
+
*/
|
13 |
+
class DirectoryCacheFileLoader implements FileLoaderInterface {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @type array
|
17 |
+
*/
|
18 |
+
private $files = array();
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @type string
|
22 |
+
*/
|
23 |
+
private $extension;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @tpye string
|
27 |
+
*/
|
28 |
+
private $base_dir;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @param string $base_dir
|
32 |
+
* @param string $extension
|
33 |
+
*/
|
34 |
+
function __construct( $base_dir, $extension = '.php' ) {
|
35 |
+
|
36 |
+
$this->base_dir = (string) $base_dir;
|
37 |
+
$this->extension = (string) $extension;
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @param string $file
|
42 |
+
* @return bool
|
43 |
+
*/
|
44 |
+
public function loadFile( $file ) {
|
45 |
+
|
46 |
+
if ( empty( $this->files ) )
|
47 |
+
$this->files = $this->readDirRecursive(
|
48 |
+
$this->base_dir,
|
49 |
+
'*' . $this->extension
|
50 |
+
);
|
51 |
+
|
52 |
+
if ( ! in_array( $file, $this->files ) )
|
53 |
+
return FALSE;
|
54 |
+
|
55 |
+
require_once $file;
|
56 |
+
return TRUE;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* read the subdirectory recursive and catch all files with the
|
61 |
+
* given pattern
|
62 |
+
*
|
63 |
+
* Will return an array with the pattern as element if no file exists
|
64 |
+
*
|
65 |
+
* @param $dir
|
66 |
+
* @param $pattern
|
67 |
+
* @return array
|
68 |
+
*/
|
69 |
+
public function readDirRecursive( $dir, $pattern ) {
|
70 |
+
|
71 |
+
$sub_dirs = glob( $dir . '/*', \GLOB_ONLYDIR );
|
72 |
+
$files = array();
|
73 |
+
if ( ! empty( $sub_dirs ) ) {
|
74 |
+
foreach ( $sub_dirs as $sub_dir ) {
|
75 |
+
$files = array_merge( $files, $this->readDirRecursive( $sub_dir, $pattern ) );
|
76 |
+
}
|
77 |
+
}
|
78 |
+
$files = array_merge( $files, glob( $dir . '/' . $pattern, \GLOB_NOCHECK ) );
|
79 |
+
|
80 |
+
return $files;
|
81 |
+
}
|
82 |
+
}
|
inc/requisite/src/Requisite/Loader/FileLoaderInterface.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite\Loader;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Interface FileLoaderInterface
|
7 |
+
*
|
8 |
+
* Loads a given file, if exists.
|
9 |
+
*
|
10 |
+
* @package Requisite\Loader
|
11 |
+
*/
|
12 |
+
interface FileLoaderInterface {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @param string $file
|
16 |
+
* @return bool
|
17 |
+
*/
|
18 |
+
public function loadFile( $file );
|
19 |
+
}
|
inc/requisite/src/Requisite/Requisite.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class Requisite
|
7 |
+
*
|
8 |
+
* This class is just a static wrapper to load Requisite
|
9 |
+
* if it is not used with an auto loader itself.
|
10 |
+
*
|
11 |
+
* @package Requisite
|
12 |
+
*/
|
13 |
+
class Requisite {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* @type bool
|
17 |
+
*/
|
18 |
+
private static $is_loaded = FALSE;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @param string $base_dir (Optional, default to __DIR__ which is normally src/Requisite)
|
22 |
+
*/
|
23 |
+
public static function init( $base_dir = '' ) {
|
24 |
+
|
25 |
+
if ( self::$is_loaded )
|
26 |
+
return;
|
27 |
+
|
28 |
+
if ( empty( $base_dir ) )
|
29 |
+
$base_dir = __DIR__;
|
30 |
+
$base_dir = rtrim( $base_dir, '/\\' );
|
31 |
+
$classes = self::get_classes();
|
32 |
+
|
33 |
+
foreach ( $classes as $class => $file ) {
|
34 |
+
if ( ! class_exists( $class ) )
|
35 |
+
require_once $base_dir . $file;
|
36 |
+
}
|
37 |
+
|
38 |
+
self::$is_loaded = TRUE;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @return array
|
43 |
+
*/
|
44 |
+
private static function get_classes() {
|
45 |
+
|
46 |
+
return array(
|
47 |
+
__NAMESPACE__ . '\Loader\FileLoaderInterface'
|
48 |
+
=> '/Loader/FileLoaderInterface.php',
|
49 |
+
|
50 |
+
__NAMESPACE__ . '\Loader\DefaultConditionalFileLoader'
|
51 |
+
=> '/Loader/DefaultConditionalFileLoader.php',
|
52 |
+
|
53 |
+
__NAMESPACE__ . '\Loader\DirectoryCacheFileLoader'
|
54 |
+
=> '/Loader/DirectoryCacheFileLoader.php',
|
55 |
+
|
56 |
+
__NAMESPACE__ . '\Rule\AutoLoadRuleInterface'
|
57 |
+
=> '/Rule/AutoLoadRuleInterface.php',
|
58 |
+
|
59 |
+
__NAMESPACE__ . '\Rule\Psr4'
|
60 |
+
=> '/Rule/Psr4.php',
|
61 |
+
|
62 |
+
__NAMESPACE__ . '\Rule\NamespaceDirectoryMapper'
|
63 |
+
=> '/Rule/NamespaceDirectoryMapper.php',
|
64 |
+
|
65 |
+
__NAMESPACE__ . '\AutoLoaderInterface'
|
66 |
+
=> '/AutoLoaderInterface.php',
|
67 |
+
|
68 |
+
__NAMESPACE__ . '\SPLAutoLoader'
|
69 |
+
=> '/SPLAutoLoader.php'
|
70 |
+
);
|
71 |
+
}
|
72 |
+
}
|
inc/requisite/src/Requisite/Rule/AutoLoadRuleInterface.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite\Rule;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Interface AutoLoadRuleInterface
|
7 |
+
*
|
8 |
+
* AutoLoad rules are responsible to locate concrete files by a given,
|
9 |
+
* fully qualified class names and load this class, if exists.
|
10 |
+
* In a typical Requisite implementation they use Instances of
|
11 |
+
* Requisite\Loader\FileLoaderInterface for that.
|
12 |
+
*
|
13 |
+
* @package Requisite\Rule
|
14 |
+
*/
|
15 |
+
interface AutoLoadRuleInterface {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @param string $class
|
19 |
+
* @return bool
|
20 |
+
*/
|
21 |
+
public function loadClass( $class );
|
22 |
+
}
|
inc/requisite/src/Requisite/Rule/NamespaceDirectoryMapper.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite\Rule;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class NamespaceDirectoryMapper
|
7 |
+
*
|
8 |
+
* Alias of Psr4, provided for backward compatibility
|
9 |
+
*
|
10 |
+
* @deprecated
|
11 |
+
* @package Requisite\Rule
|
12 |
+
*/
|
13 |
+
class NamespaceDirectoryMapper extends Psr4 implements AutoLoadRuleInterface {}
|
inc/requisite/src/Requisite/Rule/Psr4.php
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite\Rule;
|
4 |
+
|
5 |
+
use
|
6 |
+
Requisite\Loader;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class Psr4
|
10 |
+
*
|
11 |
+
* Mapping a namespace structure to a directory structure
|
12 |
+
* following the Psr4 standard
|
13 |
+
*
|
14 |
+
* @package Requisite\Rule
|
15 |
+
*/
|
16 |
+
class Psr4 implements AutoLoadRuleInterface {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* @type Loader\FileLoaderInterface
|
20 |
+
*/
|
21 |
+
private $file_loader;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @type string
|
25 |
+
*/
|
26 |
+
private $base_ns;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @type string
|
30 |
+
*/
|
31 |
+
private $base_dir;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @param string $base_dir
|
35 |
+
* @param string $base_ns
|
36 |
+
* @param Loader\FileLoaderInterface $file_loader $file_loader (Optional)
|
37 |
+
*/
|
38 |
+
function __construct( $base_dir, $base_ns = '', Loader\FileLoaderInterface $file_loader = NULL ) {
|
39 |
+
|
40 |
+
// trim potential trailing slashes
|
41 |
+
$this->base_dir = rtrim( (string) $base_dir, '\\/' );
|
42 |
+
|
43 |
+
// always absolute namespaces with trailing slash
|
44 |
+
// trim slashes AND spaces
|
45 |
+
$base_ns = trim( $base_ns, '\\ ' );
|
46 |
+
if ( ! empty( $base_ns ) )
|
47 |
+
$base_ns = '\\' . $base_ns . '\\';
|
48 |
+
else
|
49 |
+
$base_ns = '\\';
|
50 |
+
$this->base_ns = $base_ns;
|
51 |
+
|
52 |
+
if ( ! $file_loader )
|
53 |
+
$this->file_loader = new Loader\DirectoryCacheFileLoader( $this->base_dir );
|
54 |
+
else
|
55 |
+
$this->file_loader = $file_loader;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @param string $class
|
60 |
+
* @return bool
|
61 |
+
*/
|
62 |
+
public function loadClass( $class ) {
|
63 |
+
|
64 |
+
//make sure the class name is absolute
|
65 |
+
if ( 0 !== strpos( $class, '\\' ) )
|
66 |
+
$class = '\\' . $class;
|
67 |
+
|
68 |
+
// check if the namespace matches the class
|
69 |
+
if ( 0 !== strpos( $class, $this->base_ns ) )
|
70 |
+
return FALSE;
|
71 |
+
|
72 |
+
// strip the base namespace from the beginning of the class name
|
73 |
+
if ( $this->base_ns === substr( $class, 0, strlen( $this->base_ns ) ) )
|
74 |
+
$class = substr( $class, strlen( $this->base_ns ) );
|
75 |
+
|
76 |
+
$class = ltrim( $class, '\\' );
|
77 |
+
$class = str_replace( '\\', '/', $class );
|
78 |
+
$file = $this->base_dir . '/' . $class . '.php';
|
79 |
+
|
80 |
+
return $this->file_loader->loadFile( $file );
|
81 |
+
}
|
82 |
+
}
|
inc/requisite/src/Requisite/SPLAutoLoader.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php # -*- coding: utf-8 -*-
|
2 |
+
|
3 |
+
namespace Requisite;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class SPLAutoLoader
|
7 |
+
*
|
8 |
+
* @package Requisite
|
9 |
+
*/
|
10 |
+
class SPLAutoLoader implements AutoLoaderInterface {
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @type array
|
14 |
+
*/
|
15 |
+
private $rules = array();
|
16 |
+
|
17 |
+
/**
|
18 |
+
* add a new instance to the spl load stack
|
19 |
+
*
|
20 |
+
* @param bool $append (Optional, default TRUE)
|
21 |
+
* @param bool $throws (Optional, default FALSE)
|
22 |
+
*/
|
23 |
+
public function __construct( $append = TRUE, $throws = FALSE ) {
|
24 |
+
|
25 |
+
spl_autoload_register( array( $this, 'load' ), $throws, $append );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* @param string $class
|
30 |
+
* @return bool
|
31 |
+
*/
|
32 |
+
public function load( $class ) {
|
33 |
+
|
34 |
+
foreach ( $this->rules as $rule )
|
35 |
+
if ( $rule->loadClass( (string) $class ) )
|
36 |
+
return TRUE;
|
37 |
+
|
38 |
+
return FALSE;
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @param Rule\AutoLoadRuleInterface $rule
|
43 |
+
* @return void
|
44 |
+
*/
|
45 |
+
public function addRule( Rule\AutoLoadRuleInterface $rule ) {
|
46 |
+
|
47 |
+
$this->rules[] = $rule;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* remove this instance from the spl load stack
|
52 |
+
*/
|
53 |
+
public function unregister() {
|
54 |
+
|
55 |
+
spl_autoload_unregister( array( $this, 'load' ) );
|
56 |
+
}
|
57 |
+
}
|
inc/templates/credits.php
CHANGED
@@ -8,62 +8,46 @@ if ( ! defined( 'INSR_DIR' ) ) {
|
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
11 |
-
<div class="wrap">
|
12 |
|
13 |
-
<
|
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>.', '
|
31 |
'http://inpsyde.com/',
|
32 |
'http://thedeadone.net'
|
33 |
); ?></p>
|
34 |
|
35 |
-
<h2><?php esc_html_e( 'You rock! contribute the plugin.', '
|
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.', '
|
38 |
'https://github.com/inpsyde/search-and-replace/'
|
39 |
); ?></p>
|
40 |
|
41 |
-
<h2><?php esc_html_e( 'We are Inpsyde', '
|
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.', '
|
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>.', '
|
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>.', '
|
50 |
'https://profiles.wordpress.org/inpsyde/#content-plugins'
|
51 |
); ?></p>
|
52 |
|
53 |
|
54 |
-
<h2><?php esc_html_e( 'Working at Inpsyde', '
|
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!', '
|
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:', '
|
57 |
<ol>
|
58 |
-
<li><?php esc_html_e( 'challenging and exciting projects', '
|
59 |
-
<li><?php esc_html_e( 'flexible working hours in remote office', '
|
60 |
-
<li><?php esc_html_e( 'deliberately flat hierarchies and short decision paths', '
|
61 |
-
<li><?php esc_html_e( 'a wide variety of tasks', '
|
62 |
-
<li><?php esc_html_e( 'freedom for personal development and responsible, self-reliant action', '
|
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>!', '
|
67 |
'http://inpsyde.com/#jobs'
|
68 |
); ?></p>
|
69 |
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
|
|
11 |
|
12 |
+
<h2><?php esc_html_e( 'Hey nice to have you here!', 'search-and-replace' ); ?></h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
<p><?php printf(
|
14 |
+
__( '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>.', 'search-and-replace' ),
|
15 |
'http://inpsyde.com/',
|
16 |
'http://thedeadone.net'
|
17 |
); ?></p>
|
18 |
|
19 |
+
<h2><?php esc_html_e( 'You rock! contribute the plugin.', 'search-and-replace' ); ?></h2>
|
20 |
<p><?php printf(
|
21 |
+
__( 'You can contribute the Plugin go to the repository on <a href="%s">github</a> making changes, create issues or submitting changes.', 'search-and-replace' ),
|
22 |
'https://github.com/inpsyde/search-and-replace/'
|
23 |
); ?></p>
|
24 |
|
25 |
+
<h2><?php esc_html_e( 'We are Inpsyde', 'search-and-replace' ); ?></h2>
|
26 |
+
<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.', 'search-and-replace' ); ?></p>
|
27 |
<p><?php printf(
|
28 |
+
__( 'Inpsyde is a WordPress <a href="%1$s">VIP Service Partner</a> and <a href="%2$s">WooCommerce Expert</a>.', 'search-and-replace' ),
|
29 |
'https://vip.wordpress.com/partner/inpsyde/',
|
30 |
'https://www.woothemes.com/experts/inpsyde-gmbh/'
|
31 |
); ?></p>
|
32 |
<p><?php printf(
|
33 |
+
__( 'Look at our other <a href="%s">free WordPress plugins</a>.', 'search-and-replace' ),
|
34 |
'https://profiles.wordpress.org/inpsyde/#content-plugins'
|
35 |
); ?></p>
|
36 |
|
37 |
|
38 |
+
<h2><?php esc_html_e( 'Working at Inpsyde', 'search-and-replace' ); ?></h2>
|
39 |
+
<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!', 'search-and-replace' ); ?> </p>
|
40 |
+
<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:', 'search-and-replace' ); ?> </p>
|
41 |
<ol>
|
42 |
+
<li><?php esc_html_e( 'challenging and exciting projects', 'search-and-replace' ); ?></li>
|
43 |
+
<li><?php esc_html_e( 'flexible working hours in remote office', 'search-and-replace' ); ?></li>
|
44 |
+
<li><?php esc_html_e( 'deliberately flat hierarchies and short decision paths', 'search-and-replace' ); ?></li>
|
45 |
+
<li><?php esc_html_e( 'a wide variety of tasks', 'search-and-replace' ); ?></li>
|
46 |
+
<li><?php esc_html_e( 'freedom for personal development and responsible, self-reliant action', 'search-and-replace' ); ?></li>
|
47 |
|
48 |
</ol>
|
49 |
<p><?php printf(
|
50 |
+
__( '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>!', 'search-and-replace' ),
|
51 |
'http://inpsyde.com/#jobs'
|
52 |
); ?></p>
|
53 |
|
inc/templates/db_backup.php
CHANGED
@@ -8,36 +8,10 @@ if ( ! defined( 'INSR_DIR' ) ) {
|
|
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 |
-
'
|
41 |
</p>
|
42 |
|
43 |
<form action="" method="post">
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
<p><?php esc_html_e(
|
13 |
'Create a backup of your database by clicking "Create SQL File".',
|
14 |
+
'search-and-replace' ); ?>
|
15 |
</p>
|
16 |
|
17 |
<form action="" method="post">
|
inc/templates/replace_domain.php
CHANGED
@@ -8,20 +8,8 @@ if ( ! defined( 'INSR_DIR' ) ) {
|
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
11 |
-
<
|
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 |
|
@@ -29,24 +17,24 @@ if ( ! defined( 'INSR_DIR' ) ) {
|
|
29 |
<tbody>
|
30 |
|
31 |
<tr>
|
32 |
-
<th><label for="search"><strong><?php esc_html_e( 'Search for: ', '
|
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: ', '
|
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', '
|
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: ', '
|
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: ', '
|
49 |
-
<td><input id="new_db_prefix" type="text" name="new_db_prefix" disabled placeholder="<?php esc_attr_e( 'New database prefix', '
|
50 |
</tr>
|
51 |
</tbody>
|
52 |
</table>
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
11 |
+
<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 "Do Replace Domain/Url".',
|
12 |
+
'search-and-replace' ); ?> </p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
<form action="" method="post">
|
15 |
|
17 |
<tbody>
|
18 |
|
19 |
<tr>
|
20 |
+
<th><label for="search"><strong><?php esc_html_e( 'Search for: ', 'search-and-replace' ); ?></strong></label></th>
|
21 |
<td><input id="search" type="text" name="search" value="<?php echo get_site_url(); ?>" /></td>
|
22 |
</tr>
|
23 |
<tr>
|
24 |
+
<th><label for="replace"><strong><?php esc_html_e( 'Replace with: ', 'search-and-replace' ); ?></strong></label></th>
|
25 |
<td><input id="replace" type="url" name="replace" placeholder="<?php esc_attr_e( 'New URL' ) ?>" /></td>
|
26 |
</tr>
|
27 |
<tr>
|
28 |
+
<th><label for="change_db_prefix"><strong><?php esc_html_e( 'Change database prefix', 'search-and-replace' ); ?></strong></label></th>
|
29 |
<td><input id ="change_db_prefix" type="checkbox" name="change_db_prefix" /></td>
|
30 |
</tr>
|
31 |
<tr class="disabled">
|
32 |
+
<th><label for="current_db_prefix"><strong><?php esc_html_e( 'Current prefix: ', 'search-and-replace' ); ?></strong></label></th>
|
33 |
<td><?php echo $this->dbm->get_base_prefix(); ?></td>
|
34 |
</tr>
|
35 |
<tr class="maybe_disabled disabled">
|
36 |
+
<th><label for="new_db_prefix"><strong><?php esc_html_e( 'New prefix: ', 'search-and-replace' ); ?></strong></label></th>
|
37 |
+
<td><input id="new_db_prefix" type="text" name="new_db_prefix" disabled placeholder="<?php esc_attr_e( 'New database prefix', 'search-and-replace' ) ?>" /></td>
|
38 |
</tr>
|
39 |
</tbody>
|
40 |
</table>
|
inc/templates/search_replace.php
CHANGED
@@ -8,60 +8,45 @@ if ( ! defined( 'INSR_DIR' ) ) {
|
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
11 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
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>
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
11 |
+
<form action="" method="post">
|
12 |
+
<table class="form-table">
|
13 |
+
<tbody>
|
14 |
+
<tr>
|
15 |
+
<th><label for="search"><strong><?php esc_html_e( 'Search for: ', 'search-and-replace' ); ?></strong></label></th>
|
16 |
+
<td><input id="search" type="text" name="search" value="<?php $this->get_search_value() ?>" /></td>
|
17 |
+
</tr>
|
18 |
+
<tr>
|
19 |
+
<th><label for="replace"><strong><?php esc_html_e( 'Replace with: ', 'search-and-replace' ); ?></strong></label></th>
|
20 |
+
<td><input id="replace" type="text" name="replace" value="<?php $this->get_replace_value() ?>" /></td>
|
21 |
+
</tr>
|
22 |
+
<tr>
|
23 |
+
<th><strong><?php esc_html_e( 'Select tables', 'search-and-replace' ); ?></strong></th>
|
24 |
+
<td><?php $this->show_table_list(); ?><br>
|
25 |
+
<br><input id="select_all_tables" type="checkbox" name="select_all" />
|
26 |
+
<label for="select_all_tables">
|
27 |
+
<?php esc_html_e( 'Select all tables', 'search-and-replace' ) ?>
|
28 |
+
</label>
|
29 |
+
</td>
|
30 |
+
</tr>
|
31 |
|
32 |
+
<tr>
|
33 |
+
<th><label for="dry_run"><strong><?php esc_html_e( 'Dry Run', 'search-and-replace' ); ?></strong></label></th>
|
34 |
+
<td><input type="checkbox" id="dry_run" name="dry_run" checked /></td>
|
35 |
+
</tr>
|
36 |
+
<tr class="maybe_disabled disabled">
|
37 |
+
<th><?php esc_html_e( 'Export SQL file or write changes to DB?', 'search-and-replace' ) ?></th>
|
38 |
+
<td><input id="radio1" type="radio" name="export_or_save" value="export" checked disabled />
|
39 |
+
<label for="radio1"><?php esc_html_e( 'Export SQL file with changes', 'search-and-replace' ) ?></label>
|
40 |
+
<br><input id="radio2" type="radio" name="export_or_save" value="save_to_db" disabled />
|
41 |
+
<label for="radio2"><?php esc_html_e( 'Save changes to Database', 'search-and-replace' ) ?></label>
|
42 |
+
</td>
|
43 |
+
</tr>
|
44 |
+
<tr class="maybe_disabled disabled">
|
45 |
+
<th><label for="compress"><strong><?php esc_html_e( 'Use GZ compression', 'search-and-replace' ); ?></strong></label></th>
|
46 |
+
<td><input id="compress" type="checkbox" name="compress" disabled /></td>
|
47 |
+
</tr>
|
48 |
|
49 |
+
</tbody>
|
50 |
+
</table>
|
51 |
+
<?php $this->show_submit_button(); ?>
|
52 |
+
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/templates/sql_import.php
CHANGED
@@ -8,26 +8,16 @@ if ( ! defined( 'INSR_DIR' ) ) {
|
|
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. ', '
|
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: ', '
|
31 |
</tbody>
|
32 |
</table>
|
33 |
<?php $this->show_submit_button(); ?>
|
8 |
exit;
|
9 |
}
|
10 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
<form action="" method="post" enctype="multipart/form-data">
|
13 |
<table class="form-table">
|
14 |
<tbody>
|
15 |
<tr>
|
16 |
+
<th><strong><?php esc_html_e( 'Select SQL file to upload. ', 'search-and-replace' ); ?></strong></th>
|
17 |
|
18 |
<td><input type="file" name="file_to_upload" id="file_to_upload"></td>
|
19 |
</tr>
|
20 |
+
<tr><th></th><td><?php esc_html_e( 'Maximum file size: ', 'search-and-replace' );echo $this->file_upload_max_size().'KB'; ?></td></tr>
|
21 |
</tbody>
|
22 |
</table>
|
23 |
<?php $this->show_submit_button(); ?>
|
inspyde-search-replace.php
CHANGED
@@ -5,9 +5,9 @@
|
|
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
|
10 |
-
* Text Domain:
|
11 |
* Domain Path: /languages
|
12 |
* License: GPLv3+
|
13 |
* License URI: license.txt
|
@@ -15,6 +15,10 @@
|
|
15 |
|
16 |
namespace Inpsyde\SearchReplace;
|
17 |
|
|
|
|
|
|
|
|
|
18 |
register_activation_hook( __FILE__, __NAMESPACE__ . '\activate' );
|
19 |
|
20 |
add_action( 'plugins_loaded', __NAMESPACE__ . '\init' );
|
@@ -24,9 +28,9 @@ add_action( 'plugins_loaded', __NAMESPACE__ . '\init' );
|
|
24 |
*/
|
25 |
function load_textdomain() {
|
26 |
|
27 |
-
$lang_dir = plugin_basename( __DIR__ ) . '/
|
28 |
|
29 |
-
load_plugin_textdomain( '
|
30 |
}
|
31 |
|
32 |
/**
|
@@ -45,15 +49,17 @@ function activate() {
|
|
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. ', '
|
49 |
$required_php_version
|
50 |
)
|
51 |
-
. '</p> <a href="' . admin_url( 'plugins.php' ) . '">' . esc_attr__( 'back', '
|
52 |
);
|
53 |
|
54 |
}
|
55 |
}
|
56 |
|
|
|
|
|
57 |
/**
|
58 |
* Load and init in WP Environment.
|
59 |
*/
|
@@ -69,13 +75,23 @@ function init() {
|
|
69 |
|
70 |
load_textdomain();
|
71 |
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
-
$autoloader = new inc\Autoloader( __NAMESPACE__, __DIR__ );
|
76 |
-
$autoloader->register();
|
77 |
|
78 |
// Start the plugin.
|
79 |
-
$plugin = new
|
80 |
$plugin->run( __FILE__ );
|
81 |
}
|
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, ChriCo, Bueltge, inpsyde
|
9 |
+
* Version: 3.1.0
|
10 |
+
* Text Domain: search-and-replace
|
11 |
* Domain Path: /languages
|
12 |
* License: GPLv3+
|
13 |
* License URI: license.txt
|
15 |
|
16 |
namespace Inpsyde\SearchReplace;
|
17 |
|
18 |
+
use Requisite\Requisite;
|
19 |
+
use Requisite\Rule\Psr4;
|
20 |
+
use Requisite\SPLAutoLoader;
|
21 |
+
|
22 |
register_activation_hook( __FILE__, __NAMESPACE__ . '\activate' );
|
23 |
|
24 |
add_action( 'plugins_loaded', __NAMESPACE__ . '\init' );
|
28 |
*/
|
29 |
function load_textdomain() {
|
30 |
|
31 |
+
$lang_dir = plugin_basename( __DIR__ ) . '/l10n/';
|
32 |
|
33 |
+
load_plugin_textdomain( 'search-and-replace', FALSE, $lang_dir );
|
34 |
}
|
35 |
|
36 |
/**
|
49 |
wp_die(
|
50 |
'<p>' .
|
51 |
sprintf(
|
52 |
+
esc_attr__( 'This plugin can not be activated because it requires at least PHP version %1$s. ', 'search-and-replace' ),
|
53 |
$required_php_version
|
54 |
)
|
55 |
+
. '</p> <a href="' . admin_url( 'plugins.php' ) . '">' . esc_attr__( 'back', 'search-and-replace' ) . '</a>'
|
56 |
);
|
57 |
|
58 |
}
|
59 |
}
|
60 |
|
61 |
+
|
62 |
+
|
63 |
/**
|
64 |
* Load and init in WP Environment.
|
65 |
*/
|
75 |
|
76 |
load_textdomain();
|
77 |
|
78 |
+
/**
|
79 |
+
* Load the Requisite library. Alternatively you can use composer's
|
80 |
+
*/
|
81 |
+
require_once __DIR__ . '/inc/requisite/src/Requisite/Requisite.php';
|
82 |
+
Requisite::init();
|
83 |
+
|
84 |
+
$autoloader = new SPLAutoLoader;
|
85 |
+
|
86 |
+
$autoloader->addRule(
|
87 |
+
new Psr4(
|
88 |
+
__DIR__ . '/inc', // base directory
|
89 |
+
'Inpsyde\SearchReplace' // base namespace
|
90 |
+
)
|
91 |
+
);
|
92 |
|
|
|
|
|
93 |
|
94 |
// Start the plugin.
|
95 |
+
$plugin = new Plugin();
|
96 |
$plugin->run( __FILE__ );
|
97 |
}
|
l10n/search-and-replace-de_DE.mo
ADDED
Binary file
|
languages/insr-de_DE.po → l10n/search-and-replace-de_DE.po
RENAMED
@@ -6,7 +6,7 @@ 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-
|
10 |
"PO-Revision-Date: \n"
|
11 |
"Last-Translator: Frank Bültge <frank@bueltge.de>\n"
|
12 |
"Language-Team: Inpsyde GmbH <hello@inpsyde.com>\n"
|
@@ -25,168 +25,177 @@ msgstr ""
|
|
25 |
"X-Poedit-SearchPath-0: inc\n"
|
26 |
"X-Poedit-SearchPath-1: inspyde-search-replace.php\n"
|
27 |
|
28 |
-
#:
|
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 |
-
#:
|
85 |
msgid "The backup directory is not writable!"
|
86 |
msgstr "Das Sicherungsverzeichnis ist nicht beschreibbar!"
|
87 |
|
88 |
-
#:
|
89 |
msgid "WordPress MySQL database backup"
|
90 |
msgstr "Wordpress MySQL Datenbank-Backup"
|
91 |
|
92 |
-
#:
|
93 |
msgid "Generated: %s"
|
94 |
msgstr "Generiert: %s"
|
95 |
|
96 |
-
#:
|
97 |
msgid "Hostname: %s"
|
98 |
msgstr "Hostname: %s"
|
99 |
|
100 |
-
#:
|
101 |
msgid "Database: %s"
|
102 |
msgstr "Datenbank: %s"
|
103 |
|
104 |
-
#:
|
105 |
msgid "Changed table prefix: From %s to %s "
|
106 |
msgstr "Ändere Tabellen-Präfix: von %s zu %s"
|
107 |
|
108 |
-
#:
|
109 |
msgid "Table: %s"
|
110 |
msgstr "Tabelle: %s"
|
111 |
|
112 |
-
#:
|
113 |
msgid "Error getting table details"
|
114 |
msgstr "Fehler: Keine Tabellendetails gefunden"
|
115 |
|
116 |
-
#:
|
117 |
msgid "Delete any existing table %s"
|
118 |
msgstr "Lösche existierende Tabelle %s"
|
119 |
|
120 |
-
#:
|
121 |
msgid "Table structure of table %s"
|
122 |
msgstr "Tabellenstruktur von Tabelle %s"
|
123 |
|
124 |
-
#:
|
125 |
msgid "Error with SHOW CREATE TABLE for %s."
|
126 |
msgstr "Fehler bei SHOW CREATE TABLE für %s."
|
127 |
|
128 |
-
#:
|
129 |
msgid "Error getting table structure of %s"
|
130 |
msgstr "Fehler beim Auslesen der Tabellenstruktur von %s"
|
131 |
|
132 |
-
#:
|
133 |
msgid "Data contents of table %s"
|
134 |
msgstr "Daten von Tabelle %s"
|
135 |
|
136 |
-
#:
|
137 |
msgid "End of data contents of table %s"
|
138 |
msgstr "Ende der Daten von Tabelle %s"
|
139 |
|
140 |
-
#:
|
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 |
-
#:
|
146 |
msgid "(%s KB)"
|
147 |
msgstr "(%s KB)"
|
148 |
|
149 |
-
#:
|
150 |
-
msgid "
|
151 |
-
msgstr "
|
152 |
|
153 |
-
#:
|
154 |
-
|
155 |
-
|
156 |
-
msgid "Backup Database"
|
157 |
-
msgstr "Datenbank-Backup"
|
158 |
|
159 |
-
#:
|
160 |
-
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
#. Plugin Name of the plugin/theme
|
164 |
msgid "Search & Replace"
|
165 |
-
msgstr "Suchen
|
166 |
|
167 |
-
#:
|
168 |
-
msgid "
|
169 |
-
msgstr "
|
|
|
|
|
|
|
|
|
170 |
|
171 |
-
#:
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
msgid "Credits"
|
175 |
msgstr "Herausgeber"
|
176 |
|
177 |
-
#:
|
178 |
-
msgid "
|
179 |
-
msgstr "
|
180 |
|
181 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
msgid "Do Search & Replace"
|
183 |
msgstr "Suche und Ersetze"
|
184 |
|
185 |
-
#:
|
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 ."
|
@@ -194,19 +203,19 @@ msgstr ""
|
|
194 |
"Testlauf ist ausgewählt. Es wurden keine Änderungen an der Datenbank "
|
195 |
"vorgenommen und keine SQL-Datei geschrieben."
|
196 |
|
197 |
-
#:
|
198 |
msgid "The following changes were made to the database: "
|
199 |
msgstr "Folgende Änderungen wurden in die Datenbank geschrieben: "
|
200 |
|
201 |
-
#:
|
202 |
msgid "No Tables were selected."
|
203 |
msgstr "Es wurden keine Tabellen ausgewählt."
|
204 |
|
205 |
-
#:
|
206 |
msgid "Search field is empty."
|
207 |
msgstr "\"Suche nach\"-Feld ist leer."
|
208 |
|
209 |
-
#:
|
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 "
|
@@ -219,34 +228,36 @@ msgstr ""
|
|
219 |
"Exportfunktion. Mache unbedingt ein Backup deiner Datenbank, bevor du das "
|
220 |
"geänderte SQL importierst."
|
221 |
|
222 |
-
#:
|
223 |
-
|
224 |
-
|
|
|
|
|
225 |
msgid "Import SQL file"
|
226 |
msgstr "SQL-Datei importieren"
|
227 |
|
228 |
-
#:
|
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 |
-
#:
|
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 |
-
#:
|
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 |
-
#:
|
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 |
-
#:
|
250 |
msgid ""
|
251 |
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
|
252 |
"the HTML form"
|
@@ -254,43 +265,31 @@ msgstr ""
|
|
254 |
"Die hochgeladene Datei übersteigt die MAX_FILE_SIZE Vorgabe, welches im "
|
255 |
"Formular angegeben wurde."
|
256 |
|
257 |
-
#:
|
258 |
msgid "The uploaded file was only partially uploaded"
|
259 |
msgstr "Die Datei wurde leider nur teilweise hochgeladen."
|
260 |
|
261 |
-
#:
|
262 |
msgid "No file was uploaded."
|
263 |
msgstr "Es wurde keine Datei hochgeladen."
|
264 |
|
265 |
-
#:
|
266 |
msgid "Missing a temporary folder."
|
267 |
msgstr "Temporärer Ordner fehlt."
|
268 |
|
269 |
-
#:
|
270 |
msgid "Failed to write file to disk."
|
271 |
msgstr "Fehler beim Schreiben der Datei."
|
272 |
|
273 |
-
#:
|
274 |
msgid "A PHP extension stopped the file upload."
|
275 |
msgstr "Eine PHP Erweiterung hat den Dateiupload blockiert."
|
276 |
|
277 |
-
#:
|
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 |
-
#:
|
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"
|
@@ -300,11 +299,11 @@ msgstr ""
|
|
300 |
"überarbeitet, gewartet seit 2006 und basiert auf dem Original von <a href="
|
301 |
"\"%2$s\">Mark Cunningham</a> ."
|
302 |
|
303 |
-
#:
|
304 |
msgid "You rock! contribute the plugin."
|
305 |
msgstr "Du bist super! Unterstütze dieses Plugin."
|
306 |
|
307 |
-
#:
|
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."
|
@@ -313,11 +312,11 @@ msgstr ""
|
|
313 |
"href=\"%s\">github</a>. Schlage Änderungen vor, melde Fehler oder löse "
|
314 |
"offene Issues."
|
315 |
|
316 |
-
#:
|
317 |
msgid "We are Inpsyde"
|
318 |
msgstr "Wir sind Inpsyde"
|
319 |
|
320 |
-
#:
|
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."
|
@@ -325,7 +324,7 @@ 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 |
-
#:
|
329 |
msgid ""
|
330 |
"Inpsyde is a WordPress <a href=\"%1$s\">VIP Service Partner</a> and <a href="
|
331 |
"\"%2$s\">WooCommerce Expert</a>."
|
@@ -333,16 +332,16 @@ 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 |
-
#:
|
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 |
-
#:
|
342 |
msgid "Working at Inpsyde"
|
343 |
msgstr "Arbeiten bei Inpsyde"
|
344 |
|
345 |
-
#:
|
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 "
|
@@ -352,7 +351,7 @@ msgstr ""
|
|
352 |
"regelmäßig Verstärkung. Willst du Open Source mitgestalten, in einem "
|
353 |
"spannenden Arbeitsumfeld?"
|
354 |
|
355 |
-
#:
|
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 "
|
@@ -363,28 +362,28 @@ msgstr ""
|
|
363 |
"Services. Aber auch andere Initiativbewerbungen sind gerne gesehen. Bei "
|
364 |
"Inpsyde erwartet Dich eine offene, moderne und lebendige Unternehmenskultur:"
|
365 |
|
366 |
-
#:
|
367 |
msgid "challenging and exciting projects"
|
368 |
msgstr "Herausfordernde und spannende Projekte"
|
369 |
|
370 |
-
#:
|
371 |
msgid "flexible working hours in remote office"
|
372 |
msgstr "Flexible Arbeitszeiten im Remote-Office"
|
373 |
|
374 |
-
#:
|
375 |
msgid "deliberately flat hierarchies and short decision paths"
|
376 |
msgstr "Flache Hierarchien mit kurzen Entscheidungswegen"
|
377 |
|
378 |
-
#:
|
379 |
msgid "a wide variety of tasks"
|
380 |
msgstr "Abwechslungsreiche Aufgaben"
|
381 |
|
382 |
-
#:
|
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 |
-
#:
|
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 "
|
@@ -395,90 +394,88 @@ msgstr ""
|
|
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 |
-
#:
|
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 |
-
#:
|
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 |
-
"
|
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 \"
|
413 |
|
414 |
-
#:
|
415 |
-
#: src/inc/templates/search_replace.php:28
|
416 |
msgid "Search for: "
|
417 |
msgstr "Suchen nach: "
|
418 |
|
419 |
-
#:
|
420 |
-
#: src/inc/templates/search_replace.php:32
|
421 |
msgid "Replace with: "
|
422 |
msgstr "Ersetzen durch: "
|
423 |
|
424 |
-
#:
|
425 |
msgid "New URL"
|
426 |
msgstr "Neue URL"
|
427 |
|
428 |
-
#:
|
429 |
msgid "Change database prefix"
|
430 |
msgstr "Datenbank-Präfix ändern"
|
431 |
|
432 |
-
#:
|
433 |
msgid "Current prefix: "
|
434 |
msgstr "Aktuelles Prefix:"
|
435 |
|
436 |
-
#:
|
437 |
msgid "New prefix: "
|
438 |
msgstr "Neues Prefix:"
|
439 |
|
440 |
-
#:
|
441 |
msgid "New database prefix"
|
442 |
msgstr "Neues Datenbank-Präfix"
|
443 |
|
444 |
-
#:
|
445 |
msgid "Select tables"
|
446 |
msgstr "Tabellen auswählen"
|
447 |
|
448 |
-
#:
|
449 |
msgid "Select all tables"
|
450 |
msgstr "Alle Tabellen auswählen"
|
451 |
|
452 |
-
#:
|
453 |
msgid "Dry Run"
|
454 |
msgstr "Testlauf"
|
455 |
|
456 |
-
#:
|
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 |
-
#:
|
462 |
msgid "Export SQL file with changes"
|
463 |
msgstr "SQL-Datei mit Änderungen exportieren"
|
464 |
|
465 |
-
#:
|
466 |
msgid "Save changes to Database"
|
467 |
msgstr "Änderungen in die Datenbank schreiben"
|
468 |
|
469 |
-
#:
|
470 |
msgid "Use GZ compression"
|
471 |
msgstr "GZ-Kompression benutzen"
|
472 |
|
473 |
-
#:
|
474 |
msgid "Select SQL file to upload. "
|
475 |
msgstr "SQL-Datei für den Upload auswählen. "
|
476 |
|
477 |
-
#:
|
478 |
msgid "Maximum file size: "
|
479 |
msgstr "Maximale Dateigröße: "
|
480 |
|
481 |
-
#:
|
482 |
msgid ""
|
483 |
"This plugin can not be activated because it requires at least PHP version "
|
484 |
"%1$s. "
|
@@ -486,7 +483,7 @@ msgstr ""
|
|
486 |
"Das Plugin kann nicht aktiviert werden, da es mindestens PHP-Version %1$s "
|
487 |
"erfordert. "
|
488 |
|
489 |
-
#:
|
490 |
msgid "back"
|
491 |
msgstr "zurück"
|
492 |
|
@@ -511,11 +508,21 @@ msgstr "Inpsyde GmbH"
|
|
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 |
-
|
518 |
-
#~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
|
520 |
#~ msgid "Inpsyde Search & Replace"
|
521 |
#~ msgstr "Suchen & Ersetzen"
|
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-04-07 08:41+0200\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"
|
25 |
"X-Poedit-SearchPath-0: inc\n"
|
26 |
"X-Poedit-SearchPath-1: inspyde-search-replace.php\n"
|
27 |
|
28 |
+
#: inc/Database/Exporter.php:106
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
msgid "Could not open the backup file for writing!"
|
30 |
msgstr "Konnte die Backup Datei für Import nicht öffnen!"
|
31 |
|
32 |
+
#: inc/Database/Exporter.php:112
|
33 |
msgid "The backup directory is not writable!"
|
34 |
msgstr "Das Sicherungsverzeichnis ist nicht beschreibbar!"
|
35 |
|
36 |
+
#: inc/Database/Exporter.php:120
|
37 |
msgid "WordPress MySQL database backup"
|
38 |
msgstr "Wordpress MySQL Datenbank-Backup"
|
39 |
|
40 |
+
#: inc/Database/Exporter.php:122
|
41 |
msgid "Generated: %s"
|
42 |
msgstr "Generiert: %s"
|
43 |
|
44 |
+
#: inc/Database/Exporter.php:123
|
45 |
msgid "Hostname: %s"
|
46 |
msgstr "Hostname: %s"
|
47 |
|
48 |
+
#: inc/Database/Exporter.php:124
|
49 |
msgid "Database: %s"
|
50 |
msgstr "Datenbank: %s"
|
51 |
|
52 |
+
#: inc/Database/Exporter.php:128
|
53 |
msgid "Changed table prefix: From %s to %s "
|
54 |
msgstr "Ändere Tabellen-Präfix: von %s zu %s"
|
55 |
|
56 |
+
#: inc/Database/Exporter.php:216
|
57 |
msgid "Table: %s"
|
58 |
msgstr "Tabelle: %s"
|
59 |
|
60 |
+
#: inc/Database/Exporter.php:220
|
61 |
msgid "Error getting table details"
|
62 |
msgstr "Fehler: Keine Tabellendetails gefunden"
|
63 |
|
64 |
+
#: inc/Database/Exporter.php:229
|
65 |
msgid "Delete any existing table %s"
|
66 |
msgstr "Lösche existierende Tabelle %s"
|
67 |
|
68 |
+
#: inc/Database/Exporter.php:243
|
69 |
msgid "Table structure of table %s"
|
70 |
msgstr "Tabellenstruktur von Tabelle %s"
|
71 |
|
72 |
+
#: inc/Database/Exporter.php:253
|
73 |
msgid "Error with SHOW CREATE TABLE for %s."
|
74 |
msgstr "Fehler bei SHOW CREATE TABLE für %s."
|
75 |
|
76 |
+
#: inc/Database/Exporter.php:266
|
77 |
msgid "Error getting table structure of %s"
|
78 |
msgstr "Fehler beim Auslesen der Tabellenstruktur von %s"
|
79 |
|
80 |
+
#: inc/Database/Exporter.php:276
|
81 |
msgid "Data contents of table %s"
|
82 |
msgstr "Daten von Tabelle %s"
|
83 |
|
84 |
+
#: inc/Database/Exporter.php:378
|
85 |
msgid "End of data contents of table %s"
|
86 |
msgstr "Ende der Daten von Tabelle %s"
|
87 |
|
88 |
+
#: inc/Database/Exporter.php:460
|
89 |
msgid "There was an error writing a line to the backup script:"
|
90 |
msgstr ""
|
91 |
"Es ist ein Fehler in einer Zeile beim Erstellen des Backups aufgetreten:"
|
92 |
|
93 |
+
#: inc/Database/Manager.php:71
|
94 |
msgid "(%s KB)"
|
95 |
msgstr "(%s KB)"
|
96 |
|
97 |
+
#: inc/Database/Replace.php:76
|
98 |
+
msgid "Search and replace pattern can't be the same!"
|
99 |
+
msgstr "Das Such & Ersetzen Muster darf nicht gleich sein!"
|
100 |
|
101 |
+
#: inc/Database/Replace.php:218
|
102 |
+
msgid "Error updating row: %d."
|
103 |
+
msgstr "Importieren für Zeile fehlgeschlagen: %d."
|
|
|
|
|
104 |
|
105 |
+
#: inc/FileDownloader.php:40 inc/FileDownloader.php:56
|
106 |
+
#: inc/Page/SearchReplace.php:197
|
107 |
+
msgid "Search pattern not found."
|
108 |
+
msgstr "Suchmuster nicht gefunden."
|
109 |
+
|
110 |
+
#: inc/FileDownloader.php:62
|
111 |
+
msgid "Your SQL file was created!"
|
112 |
+
msgstr "Die SQL-Datei wurde erzeugt."
|
113 |
+
|
114 |
+
#: inc/FileDownloader.php:68
|
115 |
+
msgid "Download SQL File"
|
116 |
+
msgstr "SQL-Datei herunter laden"
|
117 |
+
|
118 |
+
#: inc/FileDownloader.php:102
|
119 |
+
msgid "%s table was processed."
|
120 |
+
msgid_plural "%s tables were processed."
|
121 |
+
msgstr[0] "%s Tabelle wurde verarbeitet."
|
122 |
+
msgstr[1] "%s Tabellen wurden verarbeitet."
|
123 |
+
|
124 |
+
#: inc/FileDownloader.php:112
|
125 |
+
msgid "%s cell needs to be updated."
|
126 |
+
msgid_plural "%s cells need to be updated."
|
127 |
+
msgstr[0] "%s Eintrag muss geändert werden."
|
128 |
+
msgstr[1] "%s Einträge müssen geändert werden."
|
129 |
+
|
130 |
+
#: inc/FileDownloader.php:124
|
131 |
+
msgid "View details"
|
132 |
+
msgstr "Details"
|
133 |
+
|
134 |
+
#: inc/FileDownloader.php:139
|
135 |
+
msgid "Table:"
|
136 |
+
msgstr "Tabelle"
|
137 |
+
|
138 |
+
#: inc/FileDownloader.php:140
|
139 |
+
msgid "Changes:"
|
140 |
+
msgstr "Änderungen"
|
141 |
+
|
142 |
+
#: inc/FileDownloader.php:148
|
143 |
+
msgid "row"
|
144 |
+
msgstr "Zeile"
|
145 |
+
|
146 |
+
#: inc/FileDownloader.php:150
|
147 |
+
msgid "column"
|
148 |
+
msgstr "Spalte"
|
149 |
+
|
150 |
+
#: inc/FileDownloader.php:162
|
151 |
+
msgid "Old value:"
|
152 |
+
msgstr "Vorher:"
|
153 |
+
|
154 |
+
#: inc/FileDownloader.php:164
|
155 |
+
msgid "New value:"
|
156 |
+
msgstr "Nachher:"
|
157 |
|
158 |
#. Plugin Name of the plugin/theme
|
159 |
msgid "Search & Replace"
|
160 |
+
msgstr "Suchen & Ersetzen"
|
161 |
|
162 |
+
#: inc/Page/AbstractPage.php:52
|
163 |
+
msgid "Errors:"
|
164 |
+
msgstr "Fehler:"
|
165 |
+
|
166 |
+
#: inc/Page/AbstractPage.php:78
|
167 |
+
msgid "Submit"
|
168 |
+
msgstr "Absenden"
|
169 |
|
170 |
+
#: inc/Page/BackupDatabase.php:41
|
171 |
+
msgid "Backup Database"
|
172 |
+
msgstr "Datenbank-Backup"
|
173 |
+
|
174 |
+
#: inc/Page/BackupDatabase.php:57
|
175 |
+
msgid "Create SQL File"
|
176 |
+
msgstr "SQL-Datei erzeugen"
|
177 |
+
|
178 |
+
#: inc/Page/Credits.php:24
|
179 |
msgid "Credits"
|
180 |
msgstr "Herausgeber"
|
181 |
|
182 |
+
#: inc/Page/ReplaceDomain.php:55
|
183 |
+
msgid "Replace Field should not be empty."
|
184 |
+
msgstr "Das Feld \"Ersetze mit\" sollte nicht leer sein."
|
185 |
|
186 |
+
#: inc/Page/ReplaceDomain.php:79
|
187 |
+
msgid "Do Replace Domain/Url"
|
188 |
+
msgstr "Jetzt Domain/URL ersetzen"
|
189 |
+
|
190 |
+
#: inc/Page/ReplaceDomain.php:87
|
191 |
+
msgid "Replace Domain URL"
|
192 |
+
msgstr "Domain URL ersetzen"
|
193 |
+
|
194 |
+
#: inc/Page/SearchReplace.php:150
|
195 |
msgid "Do Search & Replace"
|
196 |
msgstr "Suche und Ersetze"
|
197 |
|
198 |
+
#: inc/Page/SearchReplace.php:168
|
|
|
|
|
|
|
|
|
199 |
msgid ""
|
200 |
"Dry run is selected. No changes were made to the database and no SQL file "
|
201 |
"was written ."
|
203 |
"Testlauf ist ausgewählt. Es wurden keine Änderungen an der Datenbank "
|
204 |
"vorgenommen und keine SQL-Datei geschrieben."
|
205 |
|
206 |
+
#: inc/Page/SearchReplace.php:176
|
207 |
msgid "The following changes were made to the database: "
|
208 |
msgstr "Folgende Änderungen wurden in die Datenbank geschrieben: "
|
209 |
|
210 |
+
#: inc/Page/SearchReplace.php:214
|
211 |
msgid "No Tables were selected."
|
212 |
msgstr "Es wurden keine Tabellen ausgewählt."
|
213 |
|
214 |
+
#: inc/Page/SearchReplace.php:224
|
215 |
msgid "Search field is empty."
|
216 |
msgstr "\"Suche nach\"-Feld ist leer."
|
217 |
|
218 |
+
#: inc/Page/SearchReplace.php:235
|
219 |
msgid ""
|
220 |
"Your search contains your current site url. Replacing your site url will "
|
221 |
"most likely cause your site to break. If you want to change the URL (and you "
|
228 |
"Exportfunktion. Mache unbedingt ein Backup deiner Datenbank, bevor du das "
|
229 |
"geänderte SQL importierst."
|
230 |
|
231 |
+
#: inc/Page/SqlImport.php:34
|
232 |
+
msgid "SQL Import"
|
233 |
+
msgstr "SQL Import"
|
234 |
+
|
235 |
+
#: inc/Page/SqlImport.php:50
|
236 |
msgid "Import SQL file"
|
237 |
msgstr "SQL-Datei importieren"
|
238 |
|
239 |
+
#: inc/Page/SqlImport.php:73
|
240 |
msgid "The file has neither '.gz' nor '.sql' Extension. Import not possible."
|
241 |
msgstr ""
|
242 |
"Die Datei hat weder die Erweiterung '.gz' noch '.sql'. Import nicht möglich."
|
243 |
|
244 |
+
#: inc/Page/SqlImport.php:86
|
245 |
msgid "The file does not seem to be a valid SQL file. Import not possible."
|
246 |
msgstr ""
|
247 |
"Diese Datei ist anscheinend keine gültige SQL-Datei. Import nicht möglich."
|
248 |
|
249 |
+
#: inc/Page/SqlImport.php:95
|
250 |
msgid "The SQL file was successfully imported. %s SQL queries were performed."
|
251 |
msgstr ""
|
252 |
"Die SQL-Datei wurde erfolgreich importiert %s SQL-Abfragen wurden ausgeführt."
|
253 |
|
254 |
+
#: inc/Page/SqlImport.php:107
|
255 |
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
|
256 |
msgstr ""
|
257 |
"Die Datei überschreitet die maximale Dateigröße (upload_max_filesize) in der "
|
258 |
"php.ini."
|
259 |
|
260 |
+
#: inc/Page/SqlImport.php:110
|
261 |
msgid ""
|
262 |
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
|
263 |
"the HTML form"
|
265 |
"Die hochgeladene Datei übersteigt die MAX_FILE_SIZE Vorgabe, welches im "
|
266 |
"Formular angegeben wurde."
|
267 |
|
268 |
+
#: inc/Page/SqlImport.php:114
|
269 |
msgid "The uploaded file was only partially uploaded"
|
270 |
msgstr "Die Datei wurde leider nur teilweise hochgeladen."
|
271 |
|
272 |
+
#: inc/Page/SqlImport.php:115
|
273 |
msgid "No file was uploaded."
|
274 |
msgstr "Es wurde keine Datei hochgeladen."
|
275 |
|
276 |
+
#: inc/Page/SqlImport.php:116
|
277 |
msgid "Missing a temporary folder."
|
278 |
msgstr "Temporärer Ordner fehlt."
|
279 |
|
280 |
+
#: inc/Page/SqlImport.php:117
|
281 |
msgid "Failed to write file to disk."
|
282 |
msgstr "Fehler beim Schreiben der Datei."
|
283 |
|
284 |
+
#: inc/Page/SqlImport.php:118
|
285 |
msgid "A PHP extension stopped the file upload."
|
286 |
msgstr "Eine PHP Erweiterung hat den Dateiupload blockiert."
|
287 |
|
288 |
+
#: inc/templates/credits.php:12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
msgid "Hey nice to have you here!"
|
290 |
msgstr "Schön das du hier bist!"
|
291 |
|
292 |
+
#: inc/templates/credits.php:14
|
293 |
msgid ""
|
294 |
"Search and Replace is refactored in 2015 by <a href=\"%1$s\">Inpsyde GmbH</"
|
295 |
"a>, maintained since 2006 and based on the original from <a href=\"%2$s"
|
299 |
"überarbeitet, gewartet seit 2006 und basiert auf dem Original von <a href="
|
300 |
"\"%2$s\">Mark Cunningham</a> ."
|
301 |
|
302 |
+
#: inc/templates/credits.php:19
|
303 |
msgid "You rock! contribute the plugin."
|
304 |
msgstr "Du bist super! Unterstütze dieses Plugin."
|
305 |
|
306 |
+
#: inc/templates/credits.php:21
|
307 |
msgid ""
|
308 |
"You can contribute the Plugin go to the repository on <a href=\"%s\">github</"
|
309 |
"a> making changes, create issues or submitting changes."
|
312 |
"href=\"%s\">github</a>. Schlage Änderungen vor, melde Fehler oder löse "
|
313 |
"offene Issues."
|
314 |
|
315 |
+
#: inc/templates/credits.php:25
|
316 |
msgid "We are Inpsyde"
|
317 |
msgstr "Wir sind Inpsyde"
|
318 |
|
319 |
+
#: inc/templates/credits.php:26
|
320 |
msgid ""
|
321 |
"Inpsyde has developed enterprise solutions with the world’s most popular "
|
322 |
"open-source CMS since it was a kitten. Still do, inconvincible convinced."
|
324 |
"Inpsyde entwickelt Enterprise Lösungen mit dem weltweit populärstem open-"
|
325 |
"source CMS seit es in den Kinderschuhen steckt. Unbelehrbar überzeugt."
|
326 |
|
327 |
+
#: inc/templates/credits.php:28
|
328 |
msgid ""
|
329 |
"Inpsyde is a WordPress <a href=\"%1$s\">VIP Service Partner</a> and <a href="
|
330 |
"\"%2$s\">WooCommerce Expert</a>."
|
332 |
"Inpsyde ist ein WordPress <a href=\"%1$s\">VIP Service Partner</a> und <a "
|
333 |
"href=\"%2$s\">WooCommerce Expert</a>."
|
334 |
|
335 |
+
#: inc/templates/credits.php:33
|
336 |
msgid "Look at our other <a href=\"%s\">free WordPress plugins</a>."
|
337 |
msgstr ""
|
338 |
"Schau dir auch unsere anderen <a href=\"%s\">free WordPress plugins</a> an."
|
339 |
|
340 |
+
#: inc/templates/credits.php:38
|
341 |
msgid "Working at Inpsyde"
|
342 |
msgstr "Arbeiten bei Inpsyde"
|
343 |
|
344 |
+
#: inc/templates/credits.php:39
|
345 |
msgid ""
|
346 |
"The biggest WordPress enterprise in Europe we’re dynamically growing and "
|
347 |
"constantly looking for new employees. So do you want to shape WordPress in "
|
351 |
"regelmäßig Verstärkung. Willst du Open Source mitgestalten, in einem "
|
352 |
"spannenden Arbeitsumfeld?"
|
353 |
|
354 |
+
#: inc/templates/credits.php:40
|
355 |
msgid ""
|
356 |
"At the moment we’re looking for developers for WordPress based products and "
|
357 |
"services. If you’re not a developer and want to be part of us, we’d be happy "
|
362 |
"Services. Aber auch andere Initiativbewerbungen sind gerne gesehen. Bei "
|
363 |
"Inpsyde erwartet Dich eine offene, moderne und lebendige Unternehmenskultur:"
|
364 |
|
365 |
+
#: inc/templates/credits.php:42
|
366 |
msgid "challenging and exciting projects"
|
367 |
msgstr "Herausfordernde und spannende Projekte"
|
368 |
|
369 |
+
#: inc/templates/credits.php:43
|
370 |
msgid "flexible working hours in remote office"
|
371 |
msgstr "Flexible Arbeitszeiten im Remote-Office"
|
372 |
|
373 |
+
#: inc/templates/credits.php:44
|
374 |
msgid "deliberately flat hierarchies and short decision paths"
|
375 |
msgstr "Flache Hierarchien mit kurzen Entscheidungswegen"
|
376 |
|
377 |
+
#: inc/templates/credits.php:45
|
378 |
msgid "a wide variety of tasks"
|
379 |
msgstr "Abwechslungsreiche Aufgaben"
|
380 |
|
381 |
+
#: inc/templates/credits.php:46
|
382 |
msgid "freedom for personal development and responsible, self-reliant action"
|
383 |
msgstr ""
|
384 |
"Freiräume für die persönliche Gestaltung und eigenverantwortliches Handeln"
|
385 |
|
386 |
+
#: inc/templates/credits.php:50
|
387 |
msgid ""
|
388 |
"If you love open source and especially WordPress, if you love to organize "
|
389 |
"your working days by yourself and want to use your pragmatic problem-solving "
|
394 |
"zuverlässig bist, dann komm zu uns! Schau dir unsere aktuellen Job-Angebote "
|
395 |
"an und sende Deine Bewerbung über <a href=\"%s\">unsere Site</a>."
|
396 |
|
397 |
+
#: inc/templates/db_backup.php:12
|
398 |
msgid "Create a backup of your database by clicking \"Create SQL File\"."
|
399 |
msgstr ""
|
400 |
"Erstelle ein Backup deiner Datenbank, indem du auf \"SQL-Datei erzeugen\" "
|
401 |
"klickst."
|
402 |
|
403 |
+
#: inc/templates/replace_domain.php:11
|
404 |
msgid ""
|
405 |
"If you want to migrate your site to another domain, enter the new URL in the "
|
406 |
+
"field \"Replace with\" and create a backup of your database by clicking \"Do "
|
407 |
+
"Replace Domain/Url\"."
|
408 |
msgstr ""
|
409 |
"Wenn du deine Website zu einer anderen Domain umziehen willst, gib die neue "
|
410 |
"URL in das Feld \"Ersetzen durch\" ein und erstelle ein Backup deiner "
|
411 |
+
"Datenbank durch Klick auf \"Jetzt Domain/URL ersetzen\"."
|
412 |
|
413 |
+
#: inc/templates/replace_domain.php:20 inc/templates/search_replace.php:15
|
|
|
414 |
msgid "Search for: "
|
415 |
msgstr "Suchen nach: "
|
416 |
|
417 |
+
#: inc/templates/replace_domain.php:24 inc/templates/search_replace.php:19
|
|
|
418 |
msgid "Replace with: "
|
419 |
msgstr "Ersetzen durch: "
|
420 |
|
421 |
+
#: inc/templates/replace_domain.php:25
|
422 |
msgid "New URL"
|
423 |
msgstr "Neue URL"
|
424 |
|
425 |
+
#: inc/templates/replace_domain.php:28
|
426 |
msgid "Change database prefix"
|
427 |
msgstr "Datenbank-Präfix ändern"
|
428 |
|
429 |
+
#: inc/templates/replace_domain.php:32
|
430 |
msgid "Current prefix: "
|
431 |
msgstr "Aktuelles Prefix:"
|
432 |
|
433 |
+
#: inc/templates/replace_domain.php:36
|
434 |
msgid "New prefix: "
|
435 |
msgstr "Neues Prefix:"
|
436 |
|
437 |
+
#: inc/templates/replace_domain.php:37
|
438 |
msgid "New database prefix"
|
439 |
msgstr "Neues Datenbank-Präfix"
|
440 |
|
441 |
+
#: inc/templates/search_replace.php:23
|
442 |
msgid "Select tables"
|
443 |
msgstr "Tabellen auswählen"
|
444 |
|
445 |
+
#: inc/templates/search_replace.php:27
|
446 |
msgid "Select all tables"
|
447 |
msgstr "Alle Tabellen auswählen"
|
448 |
|
449 |
+
#: inc/templates/search_replace.php:33
|
450 |
msgid "Dry Run"
|
451 |
msgstr "Testlauf"
|
452 |
|
453 |
+
#: inc/templates/search_replace.php:37
|
454 |
msgid "Export SQL file or write changes to DB?"
|
455 |
msgstr ""
|
456 |
"Eine SQL-Datei exportieren oder die Änderungen in die Datenbank schreiben?"
|
457 |
|
458 |
+
#: inc/templates/search_replace.php:39
|
459 |
msgid "Export SQL file with changes"
|
460 |
msgstr "SQL-Datei mit Änderungen exportieren"
|
461 |
|
462 |
+
#: inc/templates/search_replace.php:41
|
463 |
msgid "Save changes to Database"
|
464 |
msgstr "Änderungen in die Datenbank schreiben"
|
465 |
|
466 |
+
#: inc/templates/search_replace.php:45
|
467 |
msgid "Use GZ compression"
|
468 |
msgstr "GZ-Kompression benutzen"
|
469 |
|
470 |
+
#: inc/templates/sql_import.php:16
|
471 |
msgid "Select SQL file to upload. "
|
472 |
msgstr "SQL-Datei für den Upload auswählen. "
|
473 |
|
474 |
+
#: inc/templates/sql_import.php:20
|
475 |
msgid "Maximum file size: "
|
476 |
msgstr "Maximale Dateigröße: "
|
477 |
|
478 |
+
#: inspyde-search-replace.php:52
|
479 |
msgid ""
|
480 |
"This plugin can not be activated because it requires at least PHP version "
|
481 |
"%1$s. "
|
483 |
"Das Plugin kann nicht aktiviert werden, da es mindestens PHP-Version %1$s "
|
484 |
"erfordert. "
|
485 |
|
486 |
+
#: inspyde-search-replace.php:55
|
487 |
msgid "back"
|
488 |
msgstr "zurück"
|
489 |
|
508 |
msgid "http://inpsyde.com"
|
509 |
msgstr "http://inpsyde.com"
|
510 |
|
511 |
+
#~ msgid "Upload Error: "
|
512 |
+
#~ msgstr "Fehler beim Upload: "
|
513 |
+
|
514 |
#~ msgid "<b>Mysqli Error:</b> "
|
515 |
#~ msgstr "<b>Mysqli Fehler:</b> "
|
516 |
|
517 |
+
#, fuzzy
|
518 |
+
#~ msgid "Search & Replace Page"
|
519 |
+
#~ msgstr "Suchen und Ersetzen"
|
520 |
+
|
521 |
+
#~ msgid "Replace Domain/URL"
|
522 |
+
#~ msgstr "Domain URL ersetzen"
|
523 |
+
|
524 |
+
#~ msgid "Search and Replace"
|
525 |
+
#~ msgstr "Suchen und Ersetzen"
|
526 |
|
527 |
#~ msgid "Inpsyde Search & Replace"
|
528 |
#~ msgstr "Suchen & Ersetzen"
|
l10n/search-and-replace-zh_CN.mo
ADDED
Binary file
|
l10n/search-and-replace-zh_CN.po
ADDED
@@ -0,0 +1,489 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.1\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/inspyde-search-"
|
7 |
+
"replace\n"
|
8 |
+
"POT-Creation-Date: 2016-04-07 08:45+0200\n"
|
9 |
+
"PO-Revision-Date: 2016-04-07 08:45+0200\n"
|
10 |
+
"Last-Translator: Frank Bültge <frank@bueltge.de>\n"
|
11 |
+
"Language-Team: Vincent Liou <ljxprime@foxmail.com>\n"
|
12 |
+
"Language: zh_CN\n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 1.8.4\n"
|
17 |
+
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
18 |
+
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
19 |
+
"esc_html_x:1,2c\n"
|
20 |
+
"Poedit: \n"
|
21 |
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
22 |
+
|
23 |
+
#: inc/Database/Exporter.php:106
|
24 |
+
msgid "Could not open the backup file for writing!"
|
25 |
+
msgstr "备份文件无法写入!"
|
26 |
+
|
27 |
+
#: inc/Database/Exporter.php:112
|
28 |
+
msgid "The backup directory is not writable!"
|
29 |
+
msgstr "备份目录不可写!"
|
30 |
+
|
31 |
+
#: inc/Database/Exporter.php:120
|
32 |
+
msgid "WordPress MySQL database backup"
|
33 |
+
msgstr "WordPress MySQL 数据库备份"
|
34 |
+
|
35 |
+
#: inc/Database/Exporter.php:122
|
36 |
+
msgid "Generated: %s"
|
37 |
+
msgstr "已生成:%s"
|
38 |
+
|
39 |
+
#: inc/Database/Exporter.php:123
|
40 |
+
msgid "Hostname: %s"
|
41 |
+
msgstr "主机名:%s"
|
42 |
+
|
43 |
+
#: inc/Database/Exporter.php:124
|
44 |
+
msgid "Database: %s"
|
45 |
+
msgstr "数据库:%s"
|
46 |
+
|
47 |
+
#: inc/Database/Exporter.php:128
|
48 |
+
msgid "Changed table prefix: From %s to %s "
|
49 |
+
msgstr "表前缀已修改:原为 %s,现为 %s "
|
50 |
+
|
51 |
+
#: inc/Database/Exporter.php:216
|
52 |
+
msgid "Table: %s"
|
53 |
+
msgstr "表:%s"
|
54 |
+
|
55 |
+
#: inc/Database/Exporter.php:220
|
56 |
+
msgid "Error getting table details"
|
57 |
+
msgstr "获取表详情时发生错误"
|
58 |
+
|
59 |
+
#: inc/Database/Exporter.php:229
|
60 |
+
msgid "Delete any existing table %s"
|
61 |
+
msgstr "删除所有存在的表 %s"
|
62 |
+
|
63 |
+
#: inc/Database/Exporter.php:243
|
64 |
+
msgid "Table structure of table %s"
|
65 |
+
msgstr "%s 表的结构"
|
66 |
+
|
67 |
+
#: inc/Database/Exporter.php:253
|
68 |
+
msgid "Error with SHOW CREATE TABLE for %s."
|
69 |
+
msgstr "对 %s 执行 SHOW CREATE TABLE 语句时发生错误。"
|
70 |
+
|
71 |
+
#: inc/Database/Exporter.php:266
|
72 |
+
msgid "Error getting table structure of %s"
|
73 |
+
msgstr "获取 %s 表的结构时发生错误"
|
74 |
+
|
75 |
+
#: inc/Database/Exporter.php:276
|
76 |
+
msgid "Data contents of table %s"
|
77 |
+
msgstr "%s 表的数据内容"
|
78 |
+
|
79 |
+
#: inc/Database/Exporter.php:378
|
80 |
+
msgid "End of data contents of table %s"
|
81 |
+
msgstr "%s 表的数据结尾"
|
82 |
+
|
83 |
+
#: inc/Database/Exporter.php:460
|
84 |
+
msgid "There was an error writing a line to the backup script:"
|
85 |
+
msgstr "向备份脚本中写入如下语句时发生错误:"
|
86 |
+
|
87 |
+
#: inc/Database/Manager.php:71
|
88 |
+
msgid "(%s KB)"
|
89 |
+
msgstr "(%s KB)"
|
90 |
+
|
91 |
+
#: inc/Database/Replace.php:76
|
92 |
+
msgid "Search and replace pattern can't be the same!"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: inc/Database/Replace.php:218
|
96 |
+
msgid "Error updating row: %d."
|
97 |
+
msgstr "更新此行时发生错误:%d。"
|
98 |
+
|
99 |
+
#: inc/FileDownloader.php:40 inc/FileDownloader.php:56
|
100 |
+
#: inc/Page/SearchReplace.php:197
|
101 |
+
msgid "Search pattern not found."
|
102 |
+
msgstr "您搜索的表达式无结果。"
|
103 |
+
|
104 |
+
#: inc/FileDownloader.php:62
|
105 |
+
msgid "Your SQL file was created!"
|
106 |
+
msgstr "您的 SQL 已生成!"
|
107 |
+
|
108 |
+
#: inc/FileDownloader.php:68
|
109 |
+
#, fuzzy
|
110 |
+
msgid "Download SQL File"
|
111 |
+
msgstr "创建 SQL 文件"
|
112 |
+
|
113 |
+
#: inc/FileDownloader.php:102
|
114 |
+
msgid "%s table was processed."
|
115 |
+
msgid_plural "%s tables were processed."
|
116 |
+
msgstr[0] "%s 个表处理完毕。"
|
117 |
+
|
118 |
+
#: inc/FileDownloader.php:112
|
119 |
+
msgid "%s cell needs to be updated."
|
120 |
+
msgid_plural "%s cells need to be updated."
|
121 |
+
msgstr[0] "有 %s 个单元格需要更新。"
|
122 |
+
|
123 |
+
#: inc/FileDownloader.php:124
|
124 |
+
msgid "View details"
|
125 |
+
msgstr "查看详细"
|
126 |
+
|
127 |
+
#: inc/FileDownloader.php:139
|
128 |
+
msgid "Table:"
|
129 |
+
msgstr "表:"
|
130 |
+
|
131 |
+
#: inc/FileDownloader.php:140
|
132 |
+
msgid "Changes:"
|
133 |
+
msgstr "更改:"
|
134 |
+
|
135 |
+
#: inc/FileDownloader.php:148
|
136 |
+
msgid "row"
|
137 |
+
msgstr "行"
|
138 |
+
|
139 |
+
#: inc/FileDownloader.php:150
|
140 |
+
msgid "column"
|
141 |
+
msgstr "列"
|
142 |
+
|
143 |
+
#: inc/FileDownloader.php:162
|
144 |
+
msgid "Old value:"
|
145 |
+
msgstr "原值:"
|
146 |
+
|
147 |
+
#: inc/FileDownloader.php:164
|
148 |
+
msgid "New value:"
|
149 |
+
msgstr "新值:"
|
150 |
+
|
151 |
+
#. Plugin Name of the plugin/theme
|
152 |
+
msgid "Search & Replace"
|
153 |
+
msgstr "查找与替换"
|
154 |
+
|
155 |
+
#: inc/Page/AbstractPage.php:52
|
156 |
+
msgid "Errors:"
|
157 |
+
msgstr "错误:"
|
158 |
+
|
159 |
+
#: inc/Page/AbstractPage.php:78
|
160 |
+
msgid "Submit"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: inc/Page/BackupDatabase.php:41
|
164 |
+
msgid "Backup Database"
|
165 |
+
msgstr "备份数据库"
|
166 |
+
|
167 |
+
#: inc/Page/BackupDatabase.php:57
|
168 |
+
msgid "Create SQL File"
|
169 |
+
msgstr "创建 SQL 文件"
|
170 |
+
|
171 |
+
#: inc/Page/Credits.php:24
|
172 |
+
msgid "Credits"
|
173 |
+
msgstr "插件信息"
|
174 |
+
|
175 |
+
#: inc/Page/ReplaceDomain.php:55
|
176 |
+
msgid "Replace Field should not be empty."
|
177 |
+
msgstr "替换一栏不应为空。"
|
178 |
+
|
179 |
+
#: inc/Page/ReplaceDomain.php:79
|
180 |
+
#, fuzzy
|
181 |
+
msgid "Do Replace Domain/Url"
|
182 |
+
msgstr "替换域名或 URL"
|
183 |
+
|
184 |
+
#: inc/Page/ReplaceDomain.php:87
|
185 |
+
msgid "Replace Domain URL"
|
186 |
+
msgstr "替换域名 URL"
|
187 |
+
|
188 |
+
#: inc/Page/SearchReplace.php:150
|
189 |
+
msgid "Do Search & Replace"
|
190 |
+
msgstr "执行替换操作"
|
191 |
+
|
192 |
+
#: inc/Page/SearchReplace.php:168
|
193 |
+
msgid ""
|
194 |
+
"Dry run is selected. No changes were made to the database and no SQL file "
|
195 |
+
"was written ."
|
196 |
+
msgstr "您选择了预演模式,故此操作不会修改您的数据库或写入 SQL 文件。"
|
197 |
+
|
198 |
+
#: inc/Page/SearchReplace.php:176
|
199 |
+
msgid "The following changes were made to the database: "
|
200 |
+
msgstr "程序执行的数据库更改如下: "
|
201 |
+
|
202 |
+
#: inc/Page/SearchReplace.php:214
|
203 |
+
msgid "No Tables were selected."
|
204 |
+
msgstr "未选中任何表。"
|
205 |
+
|
206 |
+
#: inc/Page/SearchReplace.php:224
|
207 |
+
msgid "Search field is empty."
|
208 |
+
msgstr "搜索一栏没有内容。"
|
209 |
+
|
210 |
+
#: inc/Page/SearchReplace.php:235
|
211 |
+
msgid ""
|
212 |
+
"Your search contains your current site url. Replacing your site url will "
|
213 |
+
"most likely cause your site to break. If you want to change the URL (and you "
|
214 |
+
"know what you doing), please use the export function and make sure you "
|
215 |
+
"backup your database before reimporting the changed SQL."
|
216 |
+
msgstr ""
|
217 |
+
"您的搜索中包含了当前的站点地址,替换站点地址很可能会导致您的站点出现故障。如"
|
218 |
+
"果确实想要修改站点的 URL(并且您很清楚自己这么做的后果),请使用导出功能,并"
|
219 |
+
"确保在重新导入修改后的 SQL 文件时,事先做好备份工作。"
|
220 |
+
|
221 |
+
#: inc/Page/SqlImport.php:34
|
222 |
+
msgid "SQL Import"
|
223 |
+
msgstr "SQL 导入"
|
224 |
+
|
225 |
+
#: inc/Page/SqlImport.php:50
|
226 |
+
msgid "Import SQL file"
|
227 |
+
msgstr "导入 SQL 文件"
|
228 |
+
|
229 |
+
#: inc/Page/SqlImport.php:73
|
230 |
+
msgid "The file has neither '.gz' nor '.sql' Extension. Import not possible."
|
231 |
+
msgstr "请确保文件的扩展名为 .gz 或 .sql,否则无法导入。"
|
232 |
+
|
233 |
+
#: inc/Page/SqlImport.php:86
|
234 |
+
msgid "The file does not seem to be a valid SQL file. Import not possible."
|
235 |
+
msgstr "此文件似乎不是有效的 SQL 文件,导入无法进行。"
|
236 |
+
|
237 |
+
#: inc/Page/SqlImport.php:95
|
238 |
+
msgid "The SQL file was successfully imported. %s SQL queries were performed."
|
239 |
+
msgstr "SQL 文件导入成功,共执行了 %s 次 SQL 查询。"
|
240 |
+
|
241 |
+
#: inc/Page/SqlImport.php:107
|
242 |
+
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
|
243 |
+
msgstr "您所上传的文件大小超出了 php.ini 中 upload_max_filesize 指令的值"
|
244 |
+
|
245 |
+
#: inc/Page/SqlImport.php:110
|
246 |
+
msgid ""
|
247 |
+
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
|
248 |
+
"the HTML form"
|
249 |
+
msgstr "您所上传的文件大小超出了 HTML 表单中 MAX_FILE_SIZE 指令的值"
|
250 |
+
|
251 |
+
#: inc/Page/SqlImport.php:114
|
252 |
+
msgid "The uploaded file was only partially uploaded"
|
253 |
+
msgstr "您所上传的文件只上传了一部分"
|
254 |
+
|
255 |
+
#: inc/Page/SqlImport.php:115
|
256 |
+
msgid "No file was uploaded."
|
257 |
+
msgstr "未上传任何文件。"
|
258 |
+
|
259 |
+
#: inc/Page/SqlImport.php:116
|
260 |
+
msgid "Missing a temporary folder."
|
261 |
+
msgstr "临时文件夹缺失。"
|
262 |
+
|
263 |
+
#: inc/Page/SqlImport.php:117
|
264 |
+
msgid "Failed to write file to disk."
|
265 |
+
msgstr "无法将文件写入磁盘。"
|
266 |
+
|
267 |
+
#: inc/Page/SqlImport.php:118
|
268 |
+
msgid "A PHP extension stopped the file upload."
|
269 |
+
msgstr "某 PHP 扩展终止了上传操作。"
|
270 |
+
|
271 |
+
#: inc/templates/credits.php:12
|
272 |
+
msgid "Hey nice to have you here!"
|
273 |
+
msgstr "嘿,很高兴在这里看到你!"
|
274 |
+
|
275 |
+
#: inc/templates/credits.php:14
|
276 |
+
msgid ""
|
277 |
+
"Search and Replace is refactored in 2015 by <a href=\"%1$s\">Inpsyde GmbH</"
|
278 |
+
"a>, maintained since 2006 and based on the original from <a href=\"%2$s"
|
279 |
+
"\">Mark Cunningham</a>."
|
280 |
+
msgstr ""
|
281 |
+
"您现在所使用的 Search and Replace 插件是由 <a href=\"%1$s\">Inpsyde GmbH</a> "
|
282 |
+
"于 2015 年重构的版本,它最初由 <a href=\"%2$s\">Mark Cunningham</a> 于 2006 "
|
283 |
+
"年编写并维护的。"
|
284 |
+
|
285 |
+
#: inc/templates/credits.php:19
|
286 |
+
msgid "You rock! contribute the plugin."
|
287 |
+
msgstr "帅呆啦!一起参与贡献吧"
|
288 |
+
|
289 |
+
#: inc/templates/credits.php:21
|
290 |
+
msgid ""
|
291 |
+
"You can contribute the Plugin go to the repository on <a href=\"%s\">github</"
|
292 |
+
"a> making changes, create issues or submitting changes."
|
293 |
+
msgstr ""
|
294 |
+
"你可以在 <a href=\"%s\">Github</a> 参与插件的改进,比如修改代码、创建问题或提"
|
295 |
+
"交变动。"
|
296 |
+
|
297 |
+
#: inc/templates/credits.php:25
|
298 |
+
msgid "We are Inpsyde"
|
299 |
+
msgstr "我们是 Inpsyde"
|
300 |
+
|
301 |
+
#: inc/templates/credits.php:26
|
302 |
+
msgid ""
|
303 |
+
"Inpsyde has developed enterprise solutions with the world’s most popular "
|
304 |
+
"open-source CMS since it was a kitten. Still do, inconvincible convinced."
|
305 |
+
msgstr ""
|
306 |
+
"Inpsyde 自诞生之日起就利用这个世界上最流行的开源 CMS 平台研发了许多企业级的解"
|
307 |
+
"决方案:挑战不可能!"
|
308 |
+
|
309 |
+
#: inc/templates/credits.php:28
|
310 |
+
msgid ""
|
311 |
+
"Inpsyde is a WordPress <a href=\"%1$s\">VIP Service Partner</a> and <a href="
|
312 |
+
"\"%2$s\">WooCommerce Expert</a>."
|
313 |
+
msgstr ""
|
314 |
+
"Inpsyde 为 WodPress 的 <a href=\"%1$s\">VIP 服务伙伴</a> 与 WooCommerce <a "
|
315 |
+
"href=\"%2$s\">专家</a>。"
|
316 |
+
|
317 |
+
#: inc/templates/credits.php:33
|
318 |
+
msgid "Look at our other <a href=\"%s\">free WordPress plugins</a>."
|
319 |
+
msgstr ""
|
320 |
+
"去看看还有哪些 <a href=\"%s\">免费的 WordPress 插件</a> 是由我们开发的。"
|
321 |
+
|
322 |
+
#: inc/templates/credits.php:38
|
323 |
+
msgid "Working at Inpsyde"
|
324 |
+
msgstr "在 Inpsyde 工作"
|
325 |
+
|
326 |
+
#: inc/templates/credits.php:39
|
327 |
+
msgid ""
|
328 |
+
"The biggest WordPress enterprise in Europe we’re dynamically growing and "
|
329 |
+
"constantly looking for new employees. So do you want to shape WordPress in "
|
330 |
+
"an interesting and exciting working environment? Here we are!"
|
331 |
+
msgstr ""
|
332 |
+
"作为欧洲最大的 WordPress 企业,我们依旧处在不断的发展之中,并且渴望吸纳更多的"
|
333 |
+
"有才之人。如果你想要在一个充满激情与乐趣的环境中改造 WordPress,我们在这里等"
|
334 |
+
"你!"
|
335 |
+
|
336 |
+
#: inc/templates/credits.php:40
|
337 |
+
msgid ""
|
338 |
+
"At the moment we’re looking for developers for WordPress based products and "
|
339 |
+
"services. If you’re not a developer and want to be part of us, we’d be happy "
|
340 |
+
"to recieve your unsolicited application. At Inpsyde you can expect an open, "
|
341 |
+
"modern and lively company culture:"
|
342 |
+
msgstr ""
|
343 |
+
"目前我们正在招募有关 WordPress 产品服务方面的开发者。如果你不是一名开发者,但"
|
344 |
+
"仍想成为我们的一员,我们也很乐意收到你主动投来的简历。在 Inpsyde 你将会获得开"
|
345 |
+
"放、现代与富有生气的企业文化:"
|
346 |
+
|
347 |
+
#: inc/templates/credits.php:42
|
348 |
+
msgid "challenging and exciting projects"
|
349 |
+
msgstr "富有激情与挑战性的项目"
|
350 |
+
|
351 |
+
#: inc/templates/credits.php:43
|
352 |
+
msgid "flexible working hours in remote office"
|
353 |
+
msgstr "灵活的远程办公时间"
|
354 |
+
|
355 |
+
#: inc/templates/credits.php:44
|
356 |
+
msgid "deliberately flat hierarchies and short decision paths"
|
357 |
+
msgstr "平等的地位与迅速的决策路径"
|
358 |
+
|
359 |
+
#: inc/templates/credits.php:45
|
360 |
+
msgid "a wide variety of tasks"
|
361 |
+
msgstr "各种各样的任务"
|
362 |
+
|
363 |
+
#: inc/templates/credits.php:46
|
364 |
+
msgid "freedom for personal development and responsible, self-reliant action"
|
365 |
+
msgstr "个人发展、责任与自我独立的自由"
|
366 |
+
|
367 |
+
#: inc/templates/credits.php:50
|
368 |
+
msgid ""
|
369 |
+
"If you love open source and especially WordPress, if you love to organize "
|
370 |
+
"your working days by yourself and want to use your pragmatic problem-solving "
|
371 |
+
"skills and result-oriented work methods: <a href=\"%s\">join our team</a>!"
|
372 |
+
msgstr ""
|
373 |
+
"如果你热爱开源事业,尤其是 WordPress,如果你想要自己自己安排自己的工作时间、"
|
374 |
+
"发挥自己编程解决问题的能力,以及成果导向的工作方式:<a href=\"%s\">加入我们吧"
|
375 |
+
"</a>!"
|
376 |
+
|
377 |
+
#: inc/templates/db_backup.php:12
|
378 |
+
msgid "Create a backup of your database by clicking \"Create SQL File\"."
|
379 |
+
msgstr "点击 创建 SQL 文件 以创建您的数据库备份。"
|
380 |
+
|
381 |
+
#: inc/templates/replace_domain.php:11
|
382 |
+
#, fuzzy
|
383 |
+
msgid ""
|
384 |
+
"If you want to migrate your site to another domain, enter the new URL in the "
|
385 |
+
"field \"Replace with\" and create a backup of your database by clicking \"Do "
|
386 |
+
"Replace Domain/Url\"."
|
387 |
+
msgstr ""
|
388 |
+
"如果您想要把自己的站点转移到其他的域名之下,请在 替换为 一栏输入新的 URL,并"
|
389 |
+
"且点击 创建 SQL 文件 以获取您的数据库备份。"
|
390 |
+
|
391 |
+
#: inc/templates/replace_domain.php:20 inc/templates/search_replace.php:15
|
392 |
+
msgid "Search for: "
|
393 |
+
msgstr "查找: "
|
394 |
+
|
395 |
+
#: inc/templates/replace_domain.php:24 inc/templates/search_replace.php:19
|
396 |
+
msgid "Replace with: "
|
397 |
+
msgstr "替换为: "
|
398 |
+
|
399 |
+
#: inc/templates/replace_domain.php:25
|
400 |
+
msgid "New URL"
|
401 |
+
msgstr "新 URL"
|
402 |
+
|
403 |
+
#: inc/templates/replace_domain.php:28
|
404 |
+
msgid "Change database prefix"
|
405 |
+
msgstr "更改数据库前缀"
|
406 |
+
|
407 |
+
#: inc/templates/replace_domain.php:32
|
408 |
+
msgid "Current prefix: "
|
409 |
+
msgstr "当前前缀: "
|
410 |
+
|
411 |
+
#: inc/templates/replace_domain.php:36
|
412 |
+
msgid "New prefix: "
|
413 |
+
msgstr "新前缀: "
|
414 |
+
|
415 |
+
#: inc/templates/replace_domain.php:37
|
416 |
+
msgid "New database prefix"
|
417 |
+
msgstr "新数据库前缀"
|
418 |
+
|
419 |
+
#: inc/templates/search_replace.php:23
|
420 |
+
msgid "Select tables"
|
421 |
+
msgstr "选择表"
|
422 |
+
|
423 |
+
#: inc/templates/search_replace.php:27
|
424 |
+
msgid "Select all tables"
|
425 |
+
msgstr "选择所有表"
|
426 |
+
|
427 |
+
#: inc/templates/search_replace.php:33
|
428 |
+
msgid "Dry Run"
|
429 |
+
msgstr "预演模式"
|
430 |
+
|
431 |
+
#: inc/templates/search_replace.php:37
|
432 |
+
msgid "Export SQL file or write changes to DB?"
|
433 |
+
msgstr "你想要导出 SQL 文件,还是将更改写入数据库?"
|
434 |
+
|
435 |
+
#: inc/templates/search_replace.php:39
|
436 |
+
msgid "Export SQL file with changes"
|
437 |
+
msgstr "将更改导出为 SQL 文件"
|
438 |
+
|
439 |
+
#: inc/templates/search_replace.php:41
|
440 |
+
msgid "Save changes to Database"
|
441 |
+
msgstr "将更改写入数据库"
|
442 |
+
|
443 |
+
#: inc/templates/search_replace.php:45
|
444 |
+
msgid "Use GZ compression"
|
445 |
+
msgstr "使用 GZ 压缩"
|
446 |
+
|
447 |
+
#: inc/templates/sql_import.php:16
|
448 |
+
msgid "Select SQL file to upload. "
|
449 |
+
msgstr "选择需要上传的 SQL 文件 "
|
450 |
+
|
451 |
+
#: inc/templates/sql_import.php:20
|
452 |
+
msgid "Maximum file size: "
|
453 |
+
msgstr "最大文件尺寸: "
|
454 |
+
|
455 |
+
#: inspyde-search-replace.php:52
|
456 |
+
msgid ""
|
457 |
+
"This plugin can not be activated because it requires at least PHP version "
|
458 |
+
"%1$s. "
|
459 |
+
msgstr "此插件无法被激活,因为您的 PHP 版本低于%1$s。 "
|
460 |
+
|
461 |
+
#: inspyde-search-replace.php:55
|
462 |
+
msgid "back"
|
463 |
+
msgstr "后退"
|
464 |
+
|
465 |
+
#. Plugin URI of the plugin/theme
|
466 |
+
msgid "https://wordpress.org/plugins/search-and-replace/"
|
467 |
+
msgstr "https://wordpress.org/plugins/search-and-replace/"
|
468 |
+
|
469 |
+
#. Description of the plugin/theme
|
470 |
+
msgid ""
|
471 |
+
"Search & Replace data in your whole WordPress setup, backup and import your "
|
472 |
+
"database, change table prefix or migrate your domain to another domain."
|
473 |
+
msgstr ""
|
474 |
+
"在您的 WordPress 安装中进行查找和替换操作,同时它还可以实现备份您的数据库、修"
|
475 |
+
"改表前缀以及域名搬家等诸多功能。"
|
476 |
+
|
477 |
+
#. Author of the plugin/theme
|
478 |
+
msgid "Inpsyde GmbH"
|
479 |
+
msgstr "Inpsyde GmbH"
|
480 |
+
|
481 |
+
#. Author URI of the plugin/theme
|
482 |
+
msgid "http://inpsyde.com"
|
483 |
+
msgstr "http://inpsyde.com"
|
484 |
+
|
485 |
+
#~ msgid "Search & Replace Page"
|
486 |
+
#~ msgstr "Search & Replace 选项"
|
487 |
+
|
488 |
+
#~ msgid "Search and Replace"
|
489 |
+
#~ msgstr "查找并替换"
|
languages/insr.pot → l10n/search-and-replace.pot
RENAMED
@@ -2,10 +2,10 @@
|
|
2 |
# This file is distributed under the GPLv3+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Search & Replace 3.
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/inspyde-search-replace\n"
|
8 |
-
"POT-Creation-Date: 2016-
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -18,185 +18,194 @@ msgstr ""
|
|
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 |
-
#:
|
22 |
-
msgid "
|
23 |
msgstr ""
|
24 |
|
25 |
-
#:
|
26 |
-
msgid "
|
27 |
-
|
28 |
-
msgstr[0] ""
|
29 |
-
msgstr[1] ""
|
30 |
|
31 |
-
#:
|
32 |
-
msgid "
|
33 |
-
|
34 |
-
msgstr[0] ""
|
35 |
-
msgstr[1] ""
|
36 |
|
37 |
-
#:
|
38 |
-
msgid "
|
39 |
msgstr ""
|
40 |
|
41 |
-
#:
|
42 |
-
msgid "
|
43 |
msgstr ""
|
44 |
|
45 |
-
#:
|
46 |
-
msgid "
|
47 |
msgstr ""
|
48 |
|
49 |
-
#:
|
50 |
-
msgid "
|
51 |
msgstr ""
|
52 |
|
53 |
-
#:
|
54 |
-
msgid "
|
55 |
msgstr ""
|
56 |
|
57 |
-
#:
|
58 |
-
msgid "
|
59 |
msgstr ""
|
60 |
|
61 |
-
#:
|
62 |
-
msgid "
|
63 |
msgstr ""
|
64 |
|
65 |
-
#:
|
66 |
-
msgid "
|
67 |
msgstr ""
|
68 |
|
69 |
-
#:
|
70 |
-
msgid "
|
71 |
msgstr ""
|
72 |
|
73 |
-
#:
|
74 |
-
msgid "
|
75 |
msgstr ""
|
76 |
|
77 |
-
#:
|
78 |
-
msgid "
|
79 |
msgstr ""
|
80 |
|
81 |
-
#:
|
82 |
-
msgid "
|
83 |
msgstr ""
|
84 |
|
85 |
-
#:
|
86 |
-
msgid "
|
87 |
msgstr ""
|
88 |
|
89 |
-
#:
|
90 |
-
msgid "
|
91 |
msgstr ""
|
92 |
|
93 |
-
#:
|
94 |
-
msgid "
|
95 |
msgstr ""
|
96 |
|
97 |
-
#:
|
98 |
-
msgid "
|
99 |
msgstr ""
|
100 |
|
101 |
-
#:
|
102 |
-
|
|
|
103 |
msgstr ""
|
104 |
|
105 |
-
#:
|
106 |
-
msgid "
|
107 |
msgstr ""
|
108 |
|
109 |
-
#:
|
110 |
-
msgid "
|
111 |
msgstr ""
|
112 |
|
113 |
-
#:
|
114 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
msgstr ""
|
116 |
|
117 |
-
#:
|
118 |
-
msgid "
|
119 |
msgstr ""
|
120 |
|
121 |
-
#:
|
122 |
-
msgid "
|
123 |
msgstr ""
|
124 |
|
125 |
-
#:
|
126 |
-
msgid "
|
127 |
msgstr ""
|
128 |
|
129 |
-
#:
|
130 |
-
msgid "
|
131 |
msgstr ""
|
132 |
|
133 |
-
#:
|
134 |
-
msgid "
|
135 |
msgstr ""
|
136 |
|
137 |
-
#:
|
138 |
-
msgid "
|
139 |
msgstr ""
|
140 |
|
141 |
-
|
142 |
-
msgid "
|
143 |
msgstr ""
|
144 |
|
145 |
-
#:
|
146 |
-
|
147 |
-
#: src/inc/templates/search_replace.php:16 src/inc/templates/sql_import.php:16
|
148 |
-
msgid "Backup Database"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#:
|
152 |
-
msgid "
|
153 |
msgstr ""
|
154 |
|
155 |
-
|
156 |
-
msgid "
|
157 |
msgstr ""
|
158 |
|
159 |
-
#:
|
160 |
-
msgid "SQL
|
161 |
msgstr ""
|
162 |
|
163 |
-
#:
|
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 |
-
#:
|
170 |
-
msgid "
|
171 |
msgstr ""
|
172 |
|
173 |
-
#:
|
174 |
-
msgid "Do
|
175 |
msgstr ""
|
176 |
|
177 |
-
#:
|
178 |
-
msgid "Replace
|
|
|
|
|
|
|
|
|
179 |
msgstr ""
|
180 |
|
181 |
-
#:
|
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 |
-
#:
|
188 |
msgid "The following changes were made to the database: "
|
189 |
msgstr ""
|
190 |
|
191 |
-
#:
|
192 |
msgid "No Tables were selected."
|
193 |
msgstr ""
|
194 |
|
195 |
-
#:
|
196 |
msgid "Search field is empty."
|
197 |
msgstr ""
|
198 |
|
199 |
-
#:
|
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 "
|
@@ -204,119 +213,109 @@ msgid ""
|
|
204 |
"backup your database before reimporting the changed SQL."
|
205 |
msgstr ""
|
206 |
|
207 |
-
#:
|
208 |
-
|
209 |
-
|
|
|
|
|
210 |
msgid "Import SQL file"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#:
|
214 |
msgid "The file has neither '.gz' nor '.sql' Extension. Import not possible."
|
215 |
msgstr ""
|
216 |
|
217 |
-
#:
|
218 |
msgid "The file does not seem to be a valid SQL file. Import not possible."
|
219 |
msgstr ""
|
220 |
|
221 |
-
#:
|
222 |
msgid "The SQL file was successfully imported. %s SQL queries were performed."
|
223 |
msgstr ""
|
224 |
|
225 |
-
#:
|
226 |
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#:
|
230 |
msgid ""
|
231 |
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
|
232 |
"the HTML form"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#:
|
236 |
msgid "The uploaded file was only partially uploaded"
|
237 |
msgstr ""
|
238 |
|
239 |
-
#:
|
240 |
msgid "No file was uploaded."
|
241 |
msgstr ""
|
242 |
|
243 |
-
#:
|
244 |
msgid "Missing a temporary folder."
|
245 |
msgstr ""
|
246 |
|
247 |
-
#:
|
248 |
msgid "Failed to write file to disk."
|
249 |
msgstr ""
|
250 |
|
251 |
-
#:
|
252 |
msgid "A PHP extension stopped the file upload."
|
253 |
msgstr ""
|
254 |
|
255 |
-
#:
|
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 |
-
#:
|
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 |
-
#:
|
279 |
msgid "You rock! contribute the plugin."
|
280 |
msgstr ""
|
281 |
|
282 |
-
#:
|
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 |
-
#:
|
289 |
msgid "We are Inpsyde"
|
290 |
msgstr ""
|
291 |
|
292 |
-
#:
|
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 |
-
#:
|
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 |
-
#:
|
305 |
msgid "Look at our other <a href=\"%s\">free WordPress plugins</a>."
|
306 |
msgstr ""
|
307 |
|
308 |
-
#:
|
309 |
msgid "Working at Inpsyde"
|
310 |
msgstr ""
|
311 |
|
312 |
-
#:
|
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 |
-
#:
|
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 "
|
@@ -324,27 +323,27 @@ msgid ""
|
|
324 |
"open, modern and lively company culture:"
|
325 |
msgstr ""
|
326 |
|
327 |
-
#:
|
328 |
msgid "challenging and exciting projects"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#:
|
332 |
msgid "flexible working hours in remote office"
|
333 |
msgstr ""
|
334 |
|
335 |
-
#:
|
336 |
msgid "deliberately flat hierarchies and short decision paths"
|
337 |
msgstr ""
|
338 |
|
339 |
-
#:
|
340 |
msgid "a wide variety of tasks"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#:
|
344 |
msgid "freedom for personal development and responsible, self-reliant action"
|
345 |
msgstr ""
|
346 |
|
347 |
-
#:
|
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 "
|
@@ -352,90 +351,88 @@ msgid ""
|
|
352 |
"href=\"%s\">join our team</a>!"
|
353 |
msgstr ""
|
354 |
|
355 |
-
#:
|
356 |
msgid "Create a backup of your database by clicking \"Create SQL File\"."
|
357 |
msgstr ""
|
358 |
|
359 |
-
#:
|
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 |
-
"\"
|
364 |
msgstr ""
|
365 |
|
366 |
-
#:
|
367 |
-
#: src/inc/templates/search_replace.php:28
|
368 |
msgid "Search for: "
|
369 |
msgstr ""
|
370 |
|
371 |
-
#:
|
372 |
-
#: src/inc/templates/search_replace.php:32
|
373 |
msgid "Replace with: "
|
374 |
msgstr ""
|
375 |
|
376 |
-
#:
|
377 |
msgid "New URL"
|
378 |
msgstr ""
|
379 |
|
380 |
-
#:
|
381 |
msgid "Change database prefix"
|
382 |
msgstr ""
|
383 |
|
384 |
-
#:
|
385 |
msgid "Current prefix: "
|
386 |
msgstr ""
|
387 |
|
388 |
-
#:
|
389 |
msgid "New prefix: "
|
390 |
msgstr ""
|
391 |
|
392 |
-
#:
|
393 |
msgid "New database prefix"
|
394 |
msgstr ""
|
395 |
|
396 |
-
#:
|
397 |
msgid "Select tables"
|
398 |
msgstr ""
|
399 |
|
400 |
-
#:
|
401 |
msgid "Select all tables"
|
402 |
msgstr ""
|
403 |
|
404 |
-
#:
|
405 |
msgid "Dry Run"
|
406 |
msgstr ""
|
407 |
|
408 |
-
#:
|
409 |
msgid "Export SQL file or write changes to DB?"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#:
|
413 |
msgid "Export SQL file with changes"
|
414 |
msgstr ""
|
415 |
|
416 |
-
#:
|
417 |
msgid "Save changes to Database"
|
418 |
msgstr ""
|
419 |
|
420 |
-
#:
|
421 |
msgid "Use GZ compression"
|
422 |
msgstr ""
|
423 |
|
424 |
-
#:
|
425 |
msgid "Select SQL file to upload. "
|
426 |
msgstr ""
|
427 |
|
428 |
-
#:
|
429 |
msgid "Maximum file size: "
|
430 |
msgstr ""
|
431 |
|
432 |
-
#:
|
433 |
msgid ""
|
434 |
"This plugin can not be activated because it requires at least PHP version "
|
435 |
"%1$s. "
|
436 |
msgstr ""
|
437 |
|
438 |
-
#:
|
439 |
msgid "back"
|
440 |
msgstr ""
|
441 |
|
2 |
# This file is distributed under the GPLv3+.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Search & Replace 3.1.0\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/inspyde-search-replace\n"
|
8 |
+
"POT-Creation-Date: 2016-04-07 11:20:16+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
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 |
+
#: inc/Database/Exporter.php:106
|
22 |
+
msgid "Could not open the backup file for writing!"
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: inc/Database/Exporter.php:112
|
26 |
+
msgid "The backup directory is not writable!"
|
27 |
+
msgstr ""
|
|
|
|
|
28 |
|
29 |
+
#: inc/Database/Exporter.php:120
|
30 |
+
msgid "WordPress MySQL database backup"
|
31 |
+
msgstr ""
|
|
|
|
|
32 |
|
33 |
+
#: inc/Database/Exporter.php:122
|
34 |
+
msgid "Generated: %s"
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: inc/Database/Exporter.php:123
|
38 |
+
msgid "Hostname: %s"
|
39 |
msgstr ""
|
40 |
|
41 |
+
#: inc/Database/Exporter.php:124
|
42 |
+
msgid "Database: %s"
|
43 |
msgstr ""
|
44 |
|
45 |
+
#: inc/Database/Exporter.php:128
|
46 |
+
msgid "Changed table prefix: From %s to %s "
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: inc/Database/Exporter.php:216
|
50 |
+
msgid "Table: %s"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: inc/Database/Exporter.php:220
|
54 |
+
msgid "Error getting table details"
|
55 |
msgstr ""
|
56 |
|
57 |
+
#: inc/Database/Exporter.php:229
|
58 |
+
msgid "Delete any existing table %s"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: inc/Database/Exporter.php:243
|
62 |
+
msgid "Table structure of table %s"
|
63 |
msgstr ""
|
64 |
|
65 |
+
#: inc/Database/Exporter.php:253
|
66 |
+
msgid "Error with SHOW CREATE TABLE for %s."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: inc/Database/Exporter.php:266
|
70 |
+
msgid "Error getting table structure of %s"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: inc/Database/Exporter.php:276
|
74 |
+
msgid "Data contents of table %s"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: inc/Database/Exporter.php:378
|
78 |
+
msgid "End of data contents of table %s"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: inc/Database/Exporter.php:460
|
82 |
+
msgid "There was an error writing a line to the backup script:"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: inc/Database/Manager.php:71
|
86 |
+
msgid "(%s KB)"
|
87 |
msgstr ""
|
88 |
|
89 |
+
#: inc/Database/Replace.php:76
|
90 |
+
msgid "Search and replace pattern can't be the same!"
|
91 |
msgstr ""
|
92 |
|
93 |
+
#: inc/Database/Replace.php:219
|
94 |
+
msgid "Error updating row: %d."
|
95 |
msgstr ""
|
96 |
|
97 |
+
#: inc/FileDownloader.php:46 inc/FileDownloader.php:63
|
98 |
+
#: inc/Page/SearchReplace.php:207
|
99 |
+
msgid "Search pattern not found."
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: inc/FileDownloader.php:69
|
103 |
+
msgid "Your SQL file was created!"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: inc/FileDownloader.php:75
|
107 |
+
msgid "Download SQL File"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: inc/FileDownloader.php:110
|
111 |
+
msgid "%s table was processed."
|
112 |
+
msgid_plural "%s tables were processed."
|
113 |
+
msgstr[0] ""
|
114 |
+
msgstr[1] ""
|
115 |
+
|
116 |
+
#: inc/FileDownloader.php:120
|
117 |
+
msgid "%s cell needs to be updated."
|
118 |
+
msgid_plural "%s cells need to be updated."
|
119 |
+
msgstr[0] ""
|
120 |
+
msgstr[1] ""
|
121 |
+
|
122 |
+
#: inc/FileDownloader.php:132
|
123 |
+
msgid "View details"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: inc/FileDownloader.php:151
|
127 |
+
msgid "Table:"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: inc/FileDownloader.php:153
|
131 |
+
msgid "Changes:"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: inc/FileDownloader.php:163
|
135 |
+
msgid "row"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: inc/FileDownloader.php:166
|
139 |
+
msgid "column"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: inc/FileDownloader.php:178
|
143 |
+
msgid "Old value:"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: inc/FileDownloader.php:180
|
147 |
+
msgid "New value:"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#. Plugin Name of the plugin/theme
|
151 |
+
msgid "Search & Replace"
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: inc/Page/AbstractPage.php:52
|
155 |
+
msgid "Errors:"
|
|
|
|
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: inc/Page/AbstractPage.php:78
|
159 |
+
msgid "Submit"
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: inc/Page/BackupDatabase.php:41
|
163 |
+
msgid "Backup Database"
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: inc/Page/BackupDatabase.php:67
|
167 |
+
msgid "Create SQL File"
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: inc/Page/Credits.php:24
|
|
|
|
|
171 |
msgid "Credits"
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: inc/Page/ReplaceDomain.php:55
|
175 |
+
msgid "Replace Field should not be empty."
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: inc/Page/ReplaceDomain.php:79
|
179 |
+
msgid "Do Replace Domain/Url"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: inc/Page/ReplaceDomain.php:87
|
183 |
+
msgid "Replace Domain URL"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: inc/Page/SearchReplace.php:160
|
187 |
+
msgid "Do Search & Replace"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: inc/Page/SearchReplace.php:178
|
191 |
msgid ""
|
192 |
"Dry run is selected. No changes were made to the database and no SQL file "
|
193 |
"was written ."
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: inc/Page/SearchReplace.php:186
|
197 |
msgid "The following changes were made to the database: "
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: inc/Page/SearchReplace.php:224
|
201 |
msgid "No Tables were selected."
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: inc/Page/SearchReplace.php:234
|
205 |
msgid "Search field is empty."
|
206 |
msgstr ""
|
207 |
|
208 |
+
#: inc/Page/SearchReplace.php:245
|
209 |
msgid ""
|
210 |
"Your search contains your current site url. Replacing your site url will "
|
211 |
"most likely cause your site to break. If you want to change the URL (and "
|
213 |
"backup your database before reimporting the changed SQL."
|
214 |
msgstr ""
|
215 |
|
216 |
+
#: inc/Page/SqlImport.php:34
|
217 |
+
msgid "SQL Import"
|
218 |
+
msgstr ""
|
219 |
+
|
220 |
+
#: inc/Page/SqlImport.php:60
|
221 |
msgid "Import SQL file"
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: inc/Page/SqlImport.php:83
|
225 |
msgid "The file has neither '.gz' nor '.sql' Extension. Import not possible."
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: inc/Page/SqlImport.php:96
|
229 |
msgid "The file does not seem to be a valid SQL file. Import not possible."
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: inc/Page/SqlImport.php:105
|
233 |
msgid "The SQL file was successfully imported. %s SQL queries were performed."
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: inc/Page/SqlImport.php:117
|
237 |
msgid "The uploaded file exceeds the upload_max_filesize directive in php.ini"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: inc/Page/SqlImport.php:120
|
241 |
msgid ""
|
242 |
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in "
|
243 |
"the HTML form"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: inc/Page/SqlImport.php:124
|
247 |
msgid "The uploaded file was only partially uploaded"
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: inc/Page/SqlImport.php:125
|
251 |
msgid "No file was uploaded."
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: inc/Page/SqlImport.php:126
|
255 |
msgid "Missing a temporary folder."
|
256 |
msgstr ""
|
257 |
|
258 |
+
#: inc/Page/SqlImport.php:127
|
259 |
msgid "Failed to write file to disk."
|
260 |
msgstr ""
|
261 |
|
262 |
+
#: inc/Page/SqlImport.php:128
|
263 |
msgid "A PHP extension stopped the file upload."
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: inc/templates/credits.php:12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
msgid "Hey nice to have you here!"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: inc/templates/credits.php:14
|
271 |
msgid ""
|
272 |
"Search and Replace is refactored in 2015 by <a href=\"%1$s\">Inpsyde "
|
273 |
"GmbH</a>, maintained since 2006 and based on the original from <a "
|
274 |
"href=\"%2$s\">Mark Cunningham</a>."
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: inc/templates/credits.php:19
|
278 |
msgid "You rock! contribute the plugin."
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: inc/templates/credits.php:21
|
282 |
msgid ""
|
283 |
"You can contribute the Plugin go to the repository on <a "
|
284 |
"href=\"%s\">github</a> making changes, create issues or submitting changes."
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: inc/templates/credits.php:25
|
288 |
msgid "We are Inpsyde"
|
289 |
msgstr ""
|
290 |
|
291 |
+
#: inc/templates/credits.php:26
|
292 |
msgid ""
|
293 |
"Inpsyde has developed enterprise solutions with the world’s most popular "
|
294 |
"open-source CMS since it was a kitten. Still do, inconvincible convinced."
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: inc/templates/credits.php:28
|
298 |
msgid ""
|
299 |
"Inpsyde is a WordPress <a href=\"%1$s\">VIP Service Partner</a> and <a "
|
300 |
"href=\"%2$s\">WooCommerce Expert</a>."
|
301 |
msgstr ""
|
302 |
|
303 |
+
#: inc/templates/credits.php:33
|
304 |
msgid "Look at our other <a href=\"%s\">free WordPress plugins</a>."
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: inc/templates/credits.php:38
|
308 |
msgid "Working at Inpsyde"
|
309 |
msgstr ""
|
310 |
|
311 |
+
#: inc/templates/credits.php:39
|
312 |
msgid ""
|
313 |
"The biggest WordPress enterprise in Europe we’re dynamically growing and "
|
314 |
"constantly looking for new employees. So do you want to shape WordPress in "
|
315 |
"an interesting and exciting working environment? Here we are!"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: inc/templates/credits.php:40
|
319 |
msgid ""
|
320 |
"At the moment we’re looking for developers for WordPress based products and "
|
321 |
"services. If you’re not a developer and want to be part of us, we’d be "
|
323 |
"open, modern and lively company culture:"
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: inc/templates/credits.php:42
|
327 |
msgid "challenging and exciting projects"
|
328 |
msgstr ""
|
329 |
|
330 |
+
#: inc/templates/credits.php:43
|
331 |
msgid "flexible working hours in remote office"
|
332 |
msgstr ""
|
333 |
|
334 |
+
#: inc/templates/credits.php:44
|
335 |
msgid "deliberately flat hierarchies and short decision paths"
|
336 |
msgstr ""
|
337 |
|
338 |
+
#: inc/templates/credits.php:45
|
339 |
msgid "a wide variety of tasks"
|
340 |
msgstr ""
|
341 |
|
342 |
+
#: inc/templates/credits.php:46
|
343 |
msgid "freedom for personal development and responsible, self-reliant action"
|
344 |
msgstr ""
|
345 |
|
346 |
+
#: inc/templates/credits.php:50
|
347 |
msgid ""
|
348 |
"If you love open source and especially WordPress, if you love to organize "
|
349 |
"your working days by yourself and want to use your pragmatic "
|
351 |
"href=\"%s\">join our team</a>!"
|
352 |
msgstr ""
|
353 |
|
354 |
+
#: inc/templates/db_backup.php:12
|
355 |
msgid "Create a backup of your database by clicking \"Create SQL File\"."
|
356 |
msgstr ""
|
357 |
|
358 |
+
#: inc/templates/replace_domain.php:11
|
359 |
msgid ""
|
360 |
"If you want to migrate your site to another domain, enter the new URL in "
|
361 |
"the field \"Replace with\" and create a backup of your database by clicking "
|
362 |
+
"\"Do Replace Domain/Url\"."
|
363 |
msgstr ""
|
364 |
|
365 |
+
#: inc/templates/replace_domain.php:20 inc/templates/search_replace.php:15
|
|
|
366 |
msgid "Search for: "
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: inc/templates/replace_domain.php:24 inc/templates/search_replace.php:19
|
|
|
370 |
msgid "Replace with: "
|
371 |
msgstr ""
|
372 |
|
373 |
+
#: inc/templates/replace_domain.php:25
|
374 |
msgid "New URL"
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: inc/templates/replace_domain.php:28
|
378 |
msgid "Change database prefix"
|
379 |
msgstr ""
|
380 |
|
381 |
+
#: inc/templates/replace_domain.php:32
|
382 |
msgid "Current prefix: "
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: inc/templates/replace_domain.php:36
|
386 |
msgid "New prefix: "
|
387 |
msgstr ""
|
388 |
|
389 |
+
#: inc/templates/replace_domain.php:37
|
390 |
msgid "New database prefix"
|
391 |
msgstr ""
|
392 |
|
393 |
+
#: inc/templates/search_replace.php:23
|
394 |
msgid "Select tables"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: inc/templates/search_replace.php:27
|
398 |
msgid "Select all tables"
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: inc/templates/search_replace.php:33
|
402 |
msgid "Dry Run"
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: inc/templates/search_replace.php:37
|
406 |
msgid "Export SQL file or write changes to DB?"
|
407 |
msgstr ""
|
408 |
|
409 |
+
#: inc/templates/search_replace.php:39
|
410 |
msgid "Export SQL file with changes"
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: inc/templates/search_replace.php:41
|
414 |
msgid "Save changes to Database"
|
415 |
msgstr ""
|
416 |
|
417 |
+
#: inc/templates/search_replace.php:45
|
418 |
msgid "Use GZ compression"
|
419 |
msgstr ""
|
420 |
|
421 |
+
#: inc/templates/sql_import.php:16
|
422 |
msgid "Select SQL file to upload. "
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: inc/templates/sql_import.php:20
|
426 |
msgid "Maximum file size: "
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: inspyde-search-replace.php:52
|
430 |
msgid ""
|
431 |
"This plugin can not be activated because it requires at least PHP version "
|
432 |
"%1$s. "
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: inspyde-search-replace.php:55
|
436 |
msgid "back"
|
437 |
msgstr ""
|
438 |
|
languages/insr-de_DE.mo
DELETED
Binary file
|
readme.txt
CHANGED
@@ -1,17 +1,24 @@
|
|
1 |
=== Search & Replace ===
|
2 |
-
Contributors: inpsyde, Bueltge, s-hinse,
|
3 |
Tags: search, replace, backup, import, sql, migrate, multisite
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 3.0
|
7 |
|
8 |
Search & Replace data in your database with WordPress admin, replace domains/URLs of your WordPress installation.
|
9 |
|
10 |
== Description ==
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
= Features =
|
17 |
- Search & replace data in your WordPress database
|
@@ -21,11 +28,13 @@ Search & Replace data in your database with WordPress admin, replace domains/URL
|
|
21 |
- Change table prefix
|
22 |
- Backup & restore your database
|
23 |
- WordPress Multisite support
|
24 |
-
-
|
25 |
|
26 |
= Crafted by Inpsyde =
|
27 |
-
The team at [Inpsyde](http://inpsyde.com) is engineering the web and WordPress since 2006.
|
28 |
-
|
|
|
|
|
29 |
|
30 |
== Installation ==
|
31 |
= Requirements =
|
@@ -40,6 +49,15 @@ The team at [Inpsyde](http://inpsyde.com) is engineering the web and WordPress s
|
|
40 |
5. Result screen after search or search and replace
|
41 |
|
42 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
= v3.0.1 (2016-02-09) =
|
44 |
* Add support for Searchpattern with quotes. [#40](https://github.com/inpsyde/search-and-replace/issues/40)
|
45 |
* Basic travis support for travis was added. [#38](https://github.com/inpsyde/search-and-replace/issues/38)
|
1 |
=== Search & Replace ===
|
2 |
+
Contributors: inpsyde, Bueltge, derpixler, ChriCo, s-hinse, Giede
|
3 |
Tags: search, replace, backup, import, sql, migrate, multisite
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 4.5.2
|
6 |
+
Stable tag: 3.1.0
|
7 |
|
8 |
Search & Replace data in your database with WordPress admin, replace domains/URLs of your WordPress installation.
|
9 |
|
10 |
== Description ==
|
11 |
+
With Search & Replace you can search for everything and replace this with everything **but before** you do this you can easily **create** a simple **database backup** and restore it.
|
12 |
+
|
13 |
+
**We have implements special features!**
|
14 |
+
The first one is "Replace a Domain / Url" that is useful for a quick and simple transfer or a migration of an WordPress.
|
15 |
+
The second is a full support for serialized data but there are a lot more features - find them!
|
16 |
+
|
17 |
+
Our goal with this plugin is to give you a good solution for both Developers and Users of WordPress.
|
18 |
+
|
19 |
+
> **Note:** This plugin requires PHP 5.4 or higher to be activated.
|
20 |
+
|
21 |
+
[**Checkout our GitHub Repository**](https://github.com/inpsyde/search-and-replace)
|
22 |
|
23 |
= Features =
|
24 |
- Search & replace data in your WordPress database
|
28 |
- Change table prefix
|
29 |
- Backup & restore your database
|
30 |
- WordPress Multisite support
|
31 |
+
- Localized and ready for your own language
|
32 |
|
33 |
= Crafted by Inpsyde =
|
34 |
+
The team at [Inpsyde](http://inpsyde.com) is engineering the web and WordPress since 2006.
|
35 |
+
|
36 |
+
= Donation? =
|
37 |
+
You want to donate - we prefer a [positive review](https://wordpress.org/support/view/plugin-reviews/search-and-replace?rate=5#postform), not more.
|
38 |
|
39 |
== Installation ==
|
40 |
= Requirements =
|
49 |
5. Result screen after search or search and replace
|
50 |
|
51 |
== Changelog ==
|
52 |
+
= v3.1.0 (2016-02-07) =
|
53 |
+
* Improve codquality
|
54 |
+
* Prepared for localization (GlotPress)
|
55 |
+
* Prevent doing idle prozesses if search & replace pattern the same
|
56 |
+
* Implement better BigData handling.
|
57 |
+
* Implement better tab and adminpage handling [#33](https://github.com/inpsyde/search-and-replace/issues/33)
|
58 |
+
* Prepare the Plugin for localization, change Text-Domain.[#47](https://github.com/inpsyde/search-and-replace/issues/47)
|
59 |
+
* Remove difference in wordings for buttons between descriptions.[#46](https://github.com/inpsyde/search-and-replace/issues/46)
|
60 |
+
|
61 |
= v3.0.1 (2016-02-09) =
|
62 |
* Add support for Searchpattern with quotes. [#40](https://github.com/inpsyde/search-and-replace/issues/40)
|
63 |
* Basic travis support for travis was added. [#38](https://github.com/inpsyde/search-and-replace/issues/38)
|