Search & Replace - Version 3.0.1

Version Description

Download this release

Release Info

Developer derpixler
Plugin Icon 128x128 Search & Replace
Version 3.0.1
Comparing to
See all releases

Code changes from version 3.0.0 to 3.0.1

inc/Init.php CHANGED
@@ -87,7 +87,7 @@ class Init {
87
  $cap = apply_filters( 'insr-capability', 'install_plugins' );
88
 
89
  add_submenu_page( 'tools.php', __( 'Backup Database', 'insr' ),
90
- __( 'Backup Database', 'insr' ), $cap, 'db_backup',
91
  array( $this, 'show_db_backup_page' ) );
92
 
93
  add_submenu_page( 'tools.php', __( 'Replace Domain URL', 'insr' ),
@@ -95,7 +95,7 @@ class Init {
95
  array( $this, 'show_replace_domain_page' ) );
96
 
97
  add_submenu_page( 'tools.php', __( 'Search & Replace', 'insr' ),
98
- __( 'Search & Replace', 'insr' ), $cap, 'inpsyde_search_replace',
99
  array( $this, 'show_search_replace_page' ) );
100
 
101
  add_submenu_page( 'tools.php', __( 'SQL Import', 'insr' ),
@@ -113,7 +113,7 @@ class Init {
113
  */
114
  public function remove_submenu_pages() {
115
 
116
- remove_submenu_page( 'tools.php', 'db_backup' );
117
  remove_submenu_page( 'tools.php', 'sql_import' );
118
  remove_submenu_page( 'tools.php', 'replace_domain' );
119
  remove_submenu_page( 'tools.php', 'credits' );
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' ),
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' ),
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' );
inc/SearchReplaceAdmin.php CHANGED
@@ -81,22 +81,25 @@ class SearchReplaceAdmin extends Admin {
81
 
82
  $dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
83
 
84
- //if dry run is checked we run the replace function with dry run and return
85
- if ( TRUE === $dry_run ) {
86
- $this->run_replace( $_POST[ 'search' ], $_POST[ 'replace' ], $tables, $dry_run );
87
 
 
 
 
88
  return;
89
  }
90
 
91
  //'export'-button was checked
92
  if ( isset ( $_POST[ 'export_or_save' ] ) && 'export' === $_POST [ 'export_or_save' ] ) {
93
 
94
- $this->create_backup_file( $_POST[ 'search' ], $_POST[ 'replace' ], $tables );
95
  } else {
96
 
97
  //"Save changes to database" was checked
98
 
99
- $this->run_replace( $_POST[ 'search' ], $_POST[ 'replace' ], $tables, $dry_run );
100
 
101
  }
102
  }
@@ -198,7 +201,10 @@ class SearchReplaceAdmin extends Admin {
198
 
199
  $search = isset( $_POST[ 'search' ] ) ? $_POST[ 'search' ] : '';
200
  $dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
 
201
  if ( $dry_run ) {
 
 
202
  echo $search;
203
  }
204
 
@@ -212,6 +218,8 @@ class SearchReplaceAdmin extends Admin {
212
  $replace = isset( $_POST[ 'replace' ] ) ? $_POST[ 'replace' ] : '';
213
  $dry_run = isset( $_POST[ 'dry_run' ] ) ? TRUE : FALSE;
214
  if ( $dry_run ) {
 
 
215
  echo $replace;
216
  }
217
 
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
  }
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
 
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
 
inspyde-search-replace.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: Inpsyde GmbH
7
  * Author URI: http://inpsyde.com
8
  * Contributors: s-hinse, derpixler
9
- * Version: 3.0.0
10
  * Text Domain: insr
11
  * Domain Path: /languages
12
  * License: GPLv3+
@@ -78,4 +78,4 @@ function init() {
78
  // Start the plugin.
79
  $plugin = new inc\Init();
80
  $plugin->run( __FILE__ );
81
- }
6
  * Author: Inpsyde GmbH
7
  * Author URI: http://inpsyde.com
8
  * Contributors: s-hinse, derpixler
9
+ * Version: 3.0.1
10
  * Text Domain: insr
11
  * Domain Path: /languages
12
  * License: GPLv3+
78
  // Start the plugin.
79
  $plugin = new inc\Init();
80
  $plugin->run( __FILE__ );
81
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: inpsyde, Bueltge, s-hinse, derpixler, Giede
3
  Tags: search, replace, backup, import, sql, migrate, multisite
4
  Requires at least: 4.0
5
  Tested up to: 4.4
6
- Stable tag: 3.0.0
7
 
8
  Search & Replace data in your database with WordPress admin, replace domains/URLs of your WordPress installation.
9
 
@@ -40,6 +40,11 @@ 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.0 (2016-01-29) =
44
  * Refactor the plugin, new requirements, goal and result.
45
  * *Thanks to [Sven Hinse](https://github.com/s-hinse/) for help to maintain the plugin*
@@ -93,4 +98,4 @@ The team at [Inpsyde](http://inpsyde.com) is engineering the web and WordPress s
93
 
94
  = v2.5.1 (07/07/2010) =
95
  * small changes for use in WP 3.0
96
- Status API Training Shop Blog About Pricing
3
  Tags: search, replace, backup, import, sql, migrate, multisite
4
  Requires at least: 4.0
5
  Tested up to: 4.4
6
+ Stable tag: 3.0.1
7
 
8
  Search & Replace data in your database with WordPress admin, replace domains/URLs of your WordPress installation.
9
 
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)
46
+ * Fix Unittest [#37](https://github.com/inpsyde/search-and-replace/issues/37)
47
+
48
  = v3.0.0 (2016-01-29) =
49
  * Refactor the plugin, new requirements, goal and result.
50
  * *Thanks to [Sven Hinse](https://github.com/s-hinse/) for help to maintain the plugin*
98
 
99
  = v2.5.1 (07/07/2010) =
100
  * small changes for use in WP 3.0
101
+ Status API Training Shop Blog About Pricing