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

Version Description

  • New: Orange colored admin bar on staging site for better visualization and comparision between production live site and staging site
  • Tweak: Remove contact link on multisite notification
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.0.1

assets/css/wpstg-admin-bar.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #wpadminbar{
2
+ background-color: #ff8d00 !important;
3
+ }
assets/css/wpstg-admin-bar.min.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #wpadminbar{
2
+ background-color: #ff8d00 !important;
3
+ }
includes/admin/admin-notices.php CHANGED
@@ -24,24 +24,24 @@ function wpstg_admin_messages() {
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 '.wpstg_get_upload_dir().' exists! File permissions should be chmod 755 or 777.</p>';
28
  echo '</div>';
29
  }
30
  if ( wpstg_is_admin_page() && !wp_is_writable( WPSTG_PLUGIN_DIR . 'logs' ) ){
31
  echo '<div class="error">';
32
- echo '<p><strong>WP Staging File Permission error: </strong>' . WPSTG_PLUGIN_DIR . 'logs' . ' is not write and/or readable. <br> Check if the folder '.WPSTG_PLUGIN_DIR . 'logs'.' exists! File permissions should be chmod 755 or 777.</p>';
33
  echo '</div>';
34
  }
35
  $path = wpstg_get_upload_dir() . '/clone_details.json';
36
  if ( wpstg_is_admin_page() && !wpstg_clonedetailsjson_exists() || !is_readable( $path ) ){
37
  echo '<div class="error">';
38
- echo '<p><strong>WP Staging File Permission error: </strong>' . $path . ' is not write and/or readable. <br> Check if the file '.$path.' exists! File permissions should be chmod 644 or 777.</p>';
39
  echo '</div>';
40
  }
41
  $path = wpstg_get_upload_dir() . '/remaining_files.json';
42
  if ( wpstg_is_admin_page() && !wpstg_remainingjson_exists() || !is_readable( $path ) ){
43
  echo '<div class="error">';
44
- echo '<p><strong>WP Staging File Permission error: </strong>' . $path . ' is not write and/or readable . <br> Check if the file '.$path.' exists! File permissions should be chmod 644 or 777.</p>';
45
  echo '</div>';
46
  }
47
  if ( wpstg_is_admin_page() && version_compare( WPSTG_WP_COMPATIBLE, get_bloginfo('version'), '<' )){
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>';
29
  }
30
  if ( wpstg_is_admin_page() && !wp_is_writable( WPSTG_PLUGIN_DIR . 'logs' ) ){
31
  echo '<div class="error">';
32
+ echo '<p><strong>WP Staging File Permission error: </strong>' . WPSTG_PLUGIN_DIR . 'logs' . ' is not write and/or readable. <br> Check if the folder <strong>'.WPSTG_PLUGIN_DIR . 'logs'.'</strong> exists! File permissions should be chmod 755 or 777.</p>';
33
  echo '</div>';
34
  }
35
  $path = wpstg_get_upload_dir() . '/clone_details.json';
36
  if ( wpstg_is_admin_page() && !wpstg_clonedetailsjson_exists() || !is_readable( $path ) ){
37
  echo '<div class="error">';
38
+ echo '<p><strong>WP Staging File Permission error: </strong>' . $path . ' is not write and/or readable. <br> Check if the file <strong>'.$path.'</strong> exists! File permissions should be chmod 644 or 777.</p>';
39
  echo '</div>';
40
  }
41
  $path = wpstg_get_upload_dir() . '/remaining_files.json';
42
  if ( wpstg_is_admin_page() && !wpstg_remainingjson_exists() || !is_readable( $path ) ){
43
  echo '<div class="error">';
44
+ echo '<p><strong>WP Staging File Permission error: </strong>' . $path . ' is not write and/or readable . <br> Check if the file <strong>'.$path.'</strong> exists! File permissions should be chmod 644 or 777.</p>';
45
  echo '</div>';
46
  }
47
  if ( wpstg_is_admin_page() && version_compare( WPSTG_WP_COMPATIBLE, get_bloginfo('version'), '<' )){
includes/scripts.php CHANGED
@@ -13,27 +13,6 @@
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
 
16
- function wpstg_get_cpu_load_sett(){
17
- global $wpstg_options;
18
-
19
- $get_cpu_load = isset($wpstg_options['wpstg_cpu_load']) ? $wpstg_options['wpstg_cpu_load'] : 'default';
20
-
21
- if ($get_cpu_load === 'default')
22
- $cpu_load = 1000;
23
-
24
- if ($get_cpu_load === 'high')
25
- $cpu_load = 0;
26
-
27
- if ($get_cpu_load === 'medium')
28
- $cpu_load = 1000;
29
-
30
- if ($get_cpu_load === 'low')
31
- $cpu_load = 3000;
32
-
33
- return $cpu_load;
34
-
35
- }
36
-
37
  /**
38
  * Load Admin Scripts
39
  *
@@ -46,7 +25,7 @@ function wpstg_get_cpu_load_sett(){
46
  */
47
 
48
  function wpstg_load_admin_scripts( $hook ) {
49
- if ( ! apply_filters( 'wpstg_load_admin_scripts', wpstg_is_admin_page(), $hook ) ) {
50
  return;
51
  }
52
  global $wp_version, $wpstg_options;
@@ -55,15 +34,14 @@ function wpstg_load_admin_scripts( $hook ) {
55
  $js_dir = WPSTG_PLUGIN_URL . 'assets/js/';
56
  $css_dir = WPSTG_PLUGIN_URL . 'assets/css/';
57
 
58
- // Use minified libraries if SCRIPT_DEBUG is turned off
59
- //$suffix = '';//( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
60
  $suffix = isset($wpstg_options['debug_mode']) ? '.min' : '';
61
-
62
-
63
 
64
  // These have to be global
65
  wp_enqueue_script( 'wpstg-admin-script', $js_dir . 'wpstg-admin' . $suffix . '.js', array( 'jquery' ), WPSTG_VERSION, false );
66
  wp_enqueue_style( 'wpstg-admin', $css_dir . 'wpstg-admin' . $suffix . '.css', WPSTG_VERSION );
 
67
  wp_localize_script( 'wpstg-admin-script', 'wpstg', array(
68
  'nonce' => wp_create_nonce( 'wpstg_ajax_nonce' ),
69
  'mu_plugin_confirmation' => __( "If confirmed we will install an additional WordPress 'Must Use' plugin. This plugin will allow us to control which plugins are loaded during WP Staging specific operations. Do you wish to continue?", 'wpstg' ),
@@ -76,4 +54,58 @@ function wpstg_load_admin_scripts( $hook ) {
76
 
77
  ));
78
  }
79
- add_action( 'admin_enqueue_scripts', 'wpstg_load_admin_scripts', 100 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  /**
17
  * Load Admin Scripts
18
  *
25
  */
26
 
27
  function wpstg_load_admin_scripts( $hook ) {
28
+ if ( ! apply_filters( 'wpstg_load_admin_scripts', wpstg_is_admin_page(), $hook ) ) {
29
  return;
30
  }
31
  global $wp_version, $wpstg_options;
34
  $js_dir = WPSTG_PLUGIN_URL . 'assets/js/';
35
  $css_dir = WPSTG_PLUGIN_URL . 'assets/css/';
36
 
37
+ // Use minified libraries if DEBUG is turned off
 
38
  $suffix = isset($wpstg_options['debug_mode']) ? '.min' : '';
39
+
 
40
 
41
  // These have to be global
42
  wp_enqueue_script( 'wpstg-admin-script', $js_dir . 'wpstg-admin' . $suffix . '.js', array( 'jquery' ), WPSTG_VERSION, false );
43
  wp_enqueue_style( 'wpstg-admin', $css_dir . 'wpstg-admin' . $suffix . '.css', WPSTG_VERSION );
44
+
45
  wp_localize_script( 'wpstg-admin-script', 'wpstg', array(
46
  'nonce' => wp_create_nonce( 'wpstg_ajax_nonce' ),
47
  'mu_plugin_confirmation' => __( "If confirmed we will install an additional WordPress 'Must Use' plugin. This plugin will allow us to control which plugins are loaded during WP Staging specific operations. Do you wish to continue?", 'wpstg' ),
54
 
55
  ));
56
  }
57
+ add_action( 'admin_enqueue_scripts', 'wpstg_load_admin_scripts', 100 );
58
+
59
+ /**
60
+ * Load Scripts on staging site
61
+ *
62
+ * Enqueues the required staging scripts on all staging sites including administration dashboard
63
+ *
64
+ * @since 1.0.3
65
+ * @global $post
66
+ * @return void
67
+ */
68
+
69
+ function wpstg_load_staging_styles() {
70
+ global $wpstg_options;
71
+
72
+ $css_dir = WPSTG_PLUGIN_URL . 'assets/css/';
73
+ $suffix = isset($wpstg_options['debug_mode']) ? '.min' : '';
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
+ }
81
+ add_action( 'admin_enqueue_scripts', 'wpstg_load_staging_styles', 90 );
82
+ add_action( 'wp_enqueue_scripts', 'wpstg_load_staging_styles', 10);
83
+
84
+
85
+
86
+ /**
87
+ * Get cpu load setting
88
+ *
89
+ * @global array $wpstg_options
90
+ * @return int
91
+ */
92
+ function wpstg_get_cpu_load_sett(){
93
+ global $wpstg_options;
94
+
95
+ $get_cpu_load = isset($wpstg_options['wpstg_cpu_load']) ? $wpstg_options['wpstg_cpu_load'] : 'default';
96
+
97
+ if ($get_cpu_load === 'default')
98
+ $cpu_load = 1000;
99
+
100
+ if ($get_cpu_load === 'high')
101
+ $cpu_load = 0;
102
+
103
+ if ($get_cpu_load === 'medium')
104
+ $cpu_load = 1000;
105
+
106
+ if ($get_cpu_load === 'low')
107
+ $cpu_load = 3000;
108
+
109
+ return $cpu_load;
110
+
111
+ }
includes/staging-functions.php CHANGED
@@ -34,25 +34,6 @@ function wpstg_staging_permissions(){
34
  }
35
  add_action( 'init', 'wpstg_staging_permissions' );
36
 
37
- /**
38
- * Inject custom header for staging website
39
- *
40
- * @deprecated since version 0.2
41
- */
42
- /*function wpstg_inject_header(){
43
- if ( !wpstg_is_staging_site() ) {
44
- ?>
45
- <script type="text/javascript">
46
- jQuery(document).ready( function($) {
47
- var struct='<div id="wpstg_staging_header" style="display:block;position:fixed;background-color:#c12161;color:#fff;height:32px;top:0;left:0;width:100%;">Staging website!</div>';
48
- function
49
- jQuery('body').append(struct);
50
- })
51
- </script>
52
- <?php
53
- }
54
- }*/
55
- //add_action('wp_head','wpstg_inject_header');
56
 
57
  /**
58
  * Change admin_bar site_name
34
  }
35
  add_action( 'init', 'wpstg_staging_permissions' );
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  /**
39
  * Change admin_bar site_name
includes/template-functions.php CHANGED
@@ -47,7 +47,7 @@ function wpstg_clone_page() {
47
  </div>
48
  <?php do_action('wpstg_notifications');?>
49
  <?php if (is_multisite()) {
50
- echo '<span class="wpstg-notice-alert" style="margin-top:20px;">' . __('WordPress Multisite is currently not supported! <a href="https://wp-staging.com/contact">Get in contact with us</a> and ask for it.', 'wpstg') . '</span>';
51
  exit;
52
  }?>
53
  <ul id="wpstg-steps">
47
  </div>
48
  <?php do_action('wpstg_notifications');?>
49
  <?php if (is_multisite()) {
50
+ echo '<span class="wpstg-notice-alert" style="margin-top:20px;">' . __('WordPress Multisite is currently not supported!', 'wpstg') . '</span>';
51
  exit;
52
  }?>
53
  <ul id="wpstg-steps">
readme.txt CHANGED
@@ -9,7 +9,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: staging, migration, wordpress migration, wordpress staging, development, migrate, cloning, clone, database export, database find replace, database serialization, duplication, duplicator, duplicate, site duplicate, duplicate posts, db backup, file backup, backup, db migration, db restore, website backup, website staging, website deploy, staging, admin, page, content, plugin, media, backup, test, test site, testing, sandbox, widget, post, plugin, admin, posts, sidebar, shortcode, google, administration, ajax, api, authentication, blog, code, comments, contact, dashboard, multisite, theme
10
  Requires at least: 3.6+
11
  Tested up to: 4.4.1
12
- Stable tag: 1.0.0
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,6 +141,10 @@ After installation goto the settings page 'Staging' and do your adjustments ther
141
 
142
  == Changelog ==
143
 
 
 
 
 
144
  = 1.0.0 =
145
  * Fix: Do not follow symlinks during file copy process
146
  * Fix: css error
9
  Tags: staging, migration, wordpress migration, wordpress staging, development, migrate, cloning, clone, database export, database find replace, database serialization, duplication, duplicator, duplicate, site duplicate, duplicate posts, db backup, file backup, backup, db migration, db restore, website backup, website staging, website deploy, staging, admin, page, content, plugin, media, backup, test, test site, testing, sandbox, widget, post, plugin, admin, posts, sidebar, shortcode, google, administration, ajax, api, authentication, blog, code, comments, contact, dashboard, multisite, theme
10
  Requires at least: 3.6+
11
  Tested up to: 4.4.1
12
+ Stable tag: 1.0.1
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.1 =
145
+ * New: Orange colored admin bar on staging site for better visualization and comparision between production live site and staging site
146
+ * Tweak: Remove contact link on multisite notification
147
+
148
  = 1.0.0 =
149
  * Fix: Do not follow symlinks during file copy process
150
  * Fix: css error
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: 0.9.9
9
  * Text Domain: wpstg
10
  * Domain Path: languages
11
 
@@ -34,7 +34,7 @@ if (!defined('ABSPATH'))
34
 
35
  // Plugin version
36
  if (!defined('WPSTG_VERSION')) {
37
- define('WPSTG_VERSION', '0.9.9');
38
  }
39
  // Plugin version
40
  if (!defined('WPSTG_WP_COMPATIBLE')) {
@@ -169,6 +169,7 @@ if (!class_exists('wpstaging')) :
169
  global $wpstg_options;
170
  require_once WPSTG_PLUGIN_DIR . 'includes/logger.php';
171
  require_once WPSTG_PLUGIN_DIR . 'includes/staging-functions.php';
 
172
  if (is_admin() || ( defined('WP_CLI') && WP_CLI )) {
173
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
174
  $wpstg_options = wpstg_get_settings(); // Load it on top of all
@@ -183,7 +184,6 @@ if (!class_exists('wpstaging')) :
183
  require_once WPSTG_PLUGIN_DIR . 'includes/install.php';
184
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/tools.php';
185
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/upload-functions.php';
186
- require_once WPSTG_PLUGIN_DIR . 'includes/scripts.php';
187
  require_once WPSTG_PLUGIN_DIR . 'includes/class-wpstg-license-handler.php';
188
  require_once WPSTG_PLUGIN_DIR . 'includes/debug/classes/wpstgDebug.interface.php';
189
  require_once WPSTG_PLUGIN_DIR . 'includes/debug/classes/wpstgDebug.class.php';
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.1
9
  * Text Domain: wpstg
10
  * Domain Path: languages
11
 
34
 
35
  // Plugin version
36
  if (!defined('WPSTG_VERSION')) {
37
+ define('WPSTG_VERSION', '1.0.1');
38
  }
39
  // Plugin version
40
  if (!defined('WPSTG_WP_COMPATIBLE')) {
169
  global $wpstg_options;
170
  require_once WPSTG_PLUGIN_DIR . 'includes/logger.php';
171
  require_once WPSTG_PLUGIN_DIR . 'includes/staging-functions.php';
172
+ require_once WPSTG_PLUGIN_DIR . 'includes/scripts.php';
173
  if (is_admin() || ( defined('WP_CLI') && WP_CLI )) {
174
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
175
  $wpstg_options = wpstg_get_settings(); // Load it on top of all
184
  require_once WPSTG_PLUGIN_DIR . 'includes/install.php';
185
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/tools.php';
186
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/upload-functions.php';
 
187
  require_once WPSTG_PLUGIN_DIR . 'includes/class-wpstg-license-handler.php';
188
  require_once WPSTG_PLUGIN_DIR . 'includes/debug/classes/wpstgDebug.interface.php';
189
  require_once WPSTG_PLUGIN_DIR . 'includes/debug/classes/wpstgDebug.class.php';