WP Staging – DB & File Duplicator & Migration - Version 1.0.2

Version Description

  • Tweak: Change setting description of uninstall option
  • Tweak: Lower tags in readme.txt
Download this release

Release Info

Developer ReneHermi
Plugin Icon 128x128 WP Staging – DB & File Duplicator & Migration
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.2

includes/admin/admin-notices.php CHANGED
@@ -21,9 +21,8 @@ if ( ! defined( 'ABSPATH' ) ) exit;
21
  */
22
  function wpstg_admin_messages() {
23
  global $wpstg_options;
24
-
25
 
26
- if ( wpstg_is_admin_page() && !wp_is_writable( wpstg_get_upload_dir() ) ){
27
  echo '<div class="error">';
28
  echo '<p><strong>WP Staging File Permission error: </strong>' . wpstg_get_upload_dir() . ' is not write and/or readable. <br> Check if the folder <strong>'.wpstg_get_upload_dir().'</strong> exists! File permissions should be chmod 755 or 777.</p>';
29
  echo '</div>';
@@ -58,7 +57,6 @@ function wpstg_admin_messages() {
58
  }
59
 
60
  echo wpstg_show_beta_message();
61
- wpstg_plugin_deactivated_notice();
62
 
63
  $install_date = get_option('wpstg_installDate');
64
  $display_date = date('Y-m-d h:i:s');
@@ -116,27 +114,6 @@ function wpstg_admin_messages() {
116
  }
117
  add_action( 'admin_notices', 'wpstg_admin_messages' );
118
 
119
-
120
- /**
121
- * Show a message when pro or free plugin become disabled
122
- *
123
- * @return void
124
- */
125
- function wpstg_plugin_deactivated_notice() {
126
- if (false !== ( $deactivated_notice_id = get_transient('wp_staging_deactivated_notice_id') )) {
127
- if ('1' === $deactivated_notice_id) {
128
- $message = __("WP Staging and WP Staging Pro cannot both be active. We've automatically deactivated WP Staging.", 'wpstg');
129
- } else {
130
- $message = __("WP Staging and WP Staging Pro cannot both be active. We've automatically deactivated WP Staging Pro.", 'wpstg');
131
- }
132
- ?>
133
- <div class="updated notice is-dismissible" style="border-left: 4px solid #ffba00;">
134
- <p><?php echo esc_html($message); ?></p>
135
- </div> <?php
136
- delete_transient('wp_staging_deactivated_notice_id');
137
- }
138
- }
139
-
140
  /* Hide the rating div
141
  *
142
  * @subpackage Admin/Notices
21
  */
22
  function wpstg_admin_messages() {
23
  global $wpstg_options;
 
24
 
25
+ if ( wpstg_is_admin_page() && !wp_is_writable( wpstg_get_upload_dir() ) ){
26
  echo '<div class="error">';
27
  echo '<p><strong>WP Staging File Permission error: </strong>' . wpstg_get_upload_dir() . ' is not write and/or readable. <br> Check if the folder <strong>'.wpstg_get_upload_dir().'</strong> exists! File permissions should be chmod 755 or 777.</p>';
28
  echo '</div>';
57
  }
58
 
59
  echo wpstg_show_beta_message();
 
60
 
61
  $install_date = get_option('wpstg_installDate');
62
  $display_date = date('Y-m-d h:i:s');
114
  }
115
  add_action( 'admin_notices', 'wpstg_admin_messages' );
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  /* Hide the rating div
118
  *
119
  * @subpackage Admin/Notices
includes/scripts.php CHANGED
@@ -74,7 +74,7 @@ function wpstg_load_staging_styles() {
74
  $url = $css_dir . 'wpstg-admin-bar' . $suffix . '.css';
75
 
76
  if(wpstg_is_staging_site()) { // Load it on all pages
77
- wp_register_style( 'wpstg-admin-bar', $url, array(), WPSTG_VERSION, 'all' );
78
  wp_enqueue_style( 'wpstg-admin-bar' );
79
  }
80
  }
74
  $url = $css_dir . 'wpstg-admin-bar' . $suffix . '.css';
75
 
76
  if(wpstg_is_staging_site()) { // Load it on all pages
77
+ wp_register_style( 'wpstg-admin-bar', $url, array(), MASHFS_VERSION, 'all' );
78
  wp_enqueue_style( 'wpstg-admin-bar' );
79
  }
80
  }
includes/template-functions.php CHANGED
@@ -707,9 +707,10 @@ function wpstg_clone_db_internal() {
707
  wpstg_return_json('wpstg_clone_db_internal', 'success', wpstg_get_log_data($progress) . $log_data, $wpstg_clone_details['db_progress'], wpstg_get_runtime());
708
  }
709
  } else {
710
- WPSTG()->logger->info('Table ' . $new_table . ' has been created, but inserting rows failed! Rows will be skipped. Offset: ' . $offset . '');
711
  wpstg_save_options();
712
- //wpstg_return_json('wpstg_clone_db_internal', 'fail', 'Table ' . $new_table . ' has been created, BUT inserting rows failed. This happens sometimes when a table had been updated during staging process. Exclude this table from copying and try again. Offset: ' . $offset, $wpstg_clone_details['db_progress'] . ' ', wpstg_get_runtime());
 
713
  }
714
  } else {
715
  WPSTG()->logger->info('Creating table ' . $table . ' has been failed.');
707
  wpstg_return_json('wpstg_clone_db_internal', 'success', wpstg_get_log_data($progress) . $log_data, $wpstg_clone_details['db_progress'], wpstg_get_runtime());
708
  }
709
  } else {
710
+ WPSTG()->logger->info('Table ' . $new_table . ' has been created, BUT inserting rows failed. This happens sometimes when a table had been updated during staging process. Exclude this table from copying and try again. Offset: ' . $offset . '');
711
  wpstg_save_options();
712
+ wpstg_return_json('wpstg_clone_db_internal', 'fail', 'Table ' . $new_table . ' has been created, BUT inserting rows failed. This happens sometimes when a table had been updated during staging process. Exclude this table from copying and try again. Offset: ' . $offset, $wpstg_clone_details['db_progress'] . ' ', wpstg_get_runtime());
713
+
714
  }
715
  } else {
716
  WPSTG()->logger->info('Creating table ' . $table . ' has been failed.');
includes/wpstg-utils.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- class WPSTG_Utils {
4
-
5
-
6
- /**
7
- * Checks if another version of WPSTG (Pro) is active and deactivates it.
8
- * To be hooked on `activated_plugin` so other plugin is deactivated when current plugin is activated.
9
- *
10
- * @param string $plugin
11
- *
12
- */
13
- public static function deactivate_other_instances( $plugin ) {
14
- if ( ! in_array( basename( $plugin ), array( 'wp-staging-pro.php', 'wp-staging.php' ) ) ) {
15
- return;
16
- }
17
-
18
- $plugin_to_deactivate = 'wp-staging.php';
19
- $deactivated_notice_id = '1';
20
- if ( basename( $plugin ) == $plugin_to_deactivate ) {
21
- $plugin_to_deactivate = 'wp-staging-pro.php';
22
- $deactivated_notice_id = '2';
23
- }
24
-
25
- if ( is_multisite() ) {
26
- $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
27
- $active_plugins = array_keys( $active_plugins );
28
- } else {
29
- $active_plugins = (array) get_option( 'active_plugins', array() );
30
- }
31
-
32
- foreach ( $active_plugins as $basename ) {
33
- if ( false !== strpos( $basename, $plugin_to_deactivate ) ) {
34
- set_transient( 'wp_staging_deactivated_notice_id', $deactivated_notice_id, 1 * HOUR_IN_SECONDS );
35
- deactivate_plugins( $basename );
36
-
37
- return;
38
- }
39
- }
40
- }
41
-
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -8,8 +8,8 @@ License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: staging, duplication, cloning, clone, migration, sandbox, test site, testing, backup, post, admin, administration, duplicate posts
10
  Requires at least: 3.6+
11
- Tested up to: 4.4.2
12
- Stable tag: 1.0.3
13
 
14
  A duplicator plugin! Clone, duplicate and migrate live sites to independent staging and development sites that are available only to administrators.
15
 
@@ -141,12 +141,6 @@ After installation goto the settings page 'Staging' and do your adjustments ther
141
 
142
  == Changelog ==
143
 
144
- = 1.0.3 =
145
- * Fix: Missing const MASHFS_VERSION
146
- * Fix: Remove error "table XY has been created, BUT inserting rows failed."
147
- * Fix: Not tested up to 4.4.2 message shown although it's tested up to WP 4.4.2
148
- * New: Disable either free or pro version and does not allow to have both version enabled at the same time
149
-
150
  = 1.0.2 =
151
  * Tweak: Change setting description of uninstall option
152
  * Tweak: Lower tags in readme.txt
@@ -213,5 +207,5 @@ After installation goto the settings page 'Staging' and do your adjustments ther
213
 
214
  == Upgrade Notice ==
215
 
216
- = 1.0.3 =
217
- 1.0.3 <strong>Compatible up to WP 4.4.2</strong>
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: staging, duplication, cloning, clone, migration, sandbox, test site, testing, backup, post, admin, administration, duplicate posts
10
  Requires at least: 3.6+
11
+ Tested up to: 4.4.1
12
+ Stable tag: 1.0.2
13
 
14
  A duplicator plugin! Clone, duplicate and migrate live sites to independent staging and development sites that are available only to administrators.
15
 
141
 
142
  == Changelog ==
143
 
 
 
 
 
 
 
144
  = 1.0.2 =
145
  * Tweak: Change setting description of uninstall option
146
  * Tweak: Lower tags in readme.txt
207
 
208
  == Upgrade Notice ==
209
 
210
+ = 0.9.7 =
211
+ 0.9.7 <strong> * New: Tested up to wp 4.3.1</strong>
wp-staging.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: WP-Staging - Create a staging clone site for testing & developing
6
  * Author: WP-Staging, René Hermenau
7
  * Author URI: https://wordpress.org/plugins/wp-staging
8
- * Version: 1.0.3
9
  * Text Domain: wpstg
10
  * Domain Path: languages
11
 
@@ -26,6 +26,7 @@
26
  * @package WPSTG
27
  * @category Core
28
  * @author René Hermenau
 
29
  */
30
  // Exit if accessed directly
31
  if (!defined('ABSPATH'))
@@ -33,11 +34,11 @@ if (!defined('ABSPATH'))
33
 
34
  // Plugin version
35
  if (!defined('WPSTG_VERSION')) {
36
- define('WPSTG_VERSION', '1.0.3');
37
  }
38
  // Plugin version
39
  if (!defined('WPSTG_WP_COMPATIBLE')) {
40
- define('WPSTG_WP_COMPATIBLE', '4.4.2');
41
  }
42
 
43
  if (!class_exists('wpstaging')) :
@@ -244,11 +245,4 @@ function WPSTG() {
244
  }
245
 
246
  // Get WPSTG Running
247
- WPSTG();
248
-
249
- if ( ! class_exists( 'WPSTG_Utils' ) ) {
250
- require dirname( __FILE__ ) . '/includes/wpstg-utils.php';
251
- }
252
-
253
- // Deactivate WPSTG (Pro)
254
- add_action( 'activated_plugin', array( 'WPSTG_Utils', 'deactivate_other_instances' ) );
5
  * Description: WP-Staging - Create a staging clone site for testing & developing
6
  * Author: WP-Staging, René Hermenau
7
  * Author URI: https://wordpress.org/plugins/wp-staging
8
+ * Version: 1.0.2
9
  * Text Domain: wpstg
10
  * Domain Path: languages
11
 
26
  * @package WPSTG
27
  * @category Core
28
  * @author René Hermenau
29
+ * @version 0.9.1
30
  */
31
  // Exit if accessed directly
32
  if (!defined('ABSPATH'))
34
 
35
  // Plugin version
36
  if (!defined('WPSTG_VERSION')) {
37
+ define('WPSTG_VERSION', '1.0.2');
38
  }
39
  // Plugin version
40
  if (!defined('WPSTG_WP_COMPATIBLE')) {
41
+ define('WPSTG_WP_COMPATIBLE', '4.4.1');
42
  }
43
 
44
  if (!class_exists('wpstaging')) :
245
  }
246
 
247
  // Get WPSTG Running
248
+ WPSTG();