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

Version Description

  • Fix: Change rating url
  • New: Tested up to WP 4.7
Download this release

Release Info

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

Code changes from version 1.1.0 to 1.1.1

includes/admin/admin-footer.php CHANGED
@@ -30,7 +30,7 @@ function wpstg_admin_rate_us( $footer_text ) {
30
  'http://wordpress.org/support/view/plugin-reviews/wp-staging?filter=5#postform'
31
  );*/
32
  $rate_text = sprintf( __( 'Please <a href="%1$s" target="_blank">rate WP Staging</a> and help to support this project.<br>Something not working as expected? Visit the WP Staging <a href="https://wordpress.org/support/plugin/wp-staging" target="blank">Support Forum</a>', 'wpstg' ),
33
- 'http://wordpress.org/support/view/plugin-reviews/wp-staging?filter=5#postform'
34
  );
35
 
36
  return str_replace( '</span>', '', '' ) . $rate_text . '</span>';
30
  'http://wordpress.org/support/view/plugin-reviews/wp-staging?filter=5#postform'
31
  );*/
32
  $rate_text = sprintf( __( 'Please <a href="%1$s" target="_blank">rate WP Staging</a> and help to support this project.<br>Something not working as expected? Visit the WP Staging <a href="https://wordpress.org/support/plugin/wp-staging" target="blank">Support Forum</a>', 'wpstg' ),
33
+ 'https://wordpress.org/support/plugin/wp-staging/reviews/?filter=5#new-post'
34
  );
35
 
36
  return str_replace( '</span>', '', '' ) . $rate_text . '</span>';
includes/admin/admin-notices.php CHANGED
@@ -78,7 +78,7 @@ function wpstg_admin_messages() {
78
  <p>Awesome, you\'ve been using <strong>WP Staging </strong> for more than 1 week. May i ask you to give it a <strong>5-star</strong> rating on Wordpress?
79
  <p><strong>Regards,<br>René Hermenau</strong>
80
  <ul>
81
- <li><a href="https://wordpress.org/support/view/plugin-reviews/wp-staging" class="thankyou" target="_new" title="Ok, you deserved it" style="font-weight:bold;">Ok, you deserved it</a></li>
82
  <li><a href="javascript:void(0);" class="wpstg_hide_rating" title="I already did" style="font-weight:bold;">I already did</a></li>
83
  <li><a href="javascript:void(0);" class="wpstg_hide_rating" title="No, not good enough" style="font-weight:bold;">No, not good enough</a></li>
84
  </ul>
78
  <p>Awesome, you\'ve been using <strong>WP Staging </strong> for more than 1 week. May i ask you to give it a <strong>5-star</strong> rating on Wordpress?
79
  <p><strong>Regards,<br>René Hermenau</strong>
80
  <ul>
81
+ <li><a href="https://wordpress.org/support/plugin/wp-staging/reviews/?filter=5#new-post" class="thankyou" target="_new" title="Ok, you deserved it" style="font-weight:bold;">Ok, you deserved it</a></li>
82
  <li><a href="javascript:void(0);" class="wpstg_hide_rating" title="I already did" style="font-weight:bold;">I already did</a></li>
83
  <li><a href="javascript:void(0);" class="wpstg_hide_rating" title="No, not good enough" style="font-weight:bold;">No, not good enough</a></li>
84
  </ul>
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.6
12
- Stable tag: 1.1.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
 
@@ -143,6 +143,10 @@ After installation goto the settings page 'Staging' and do your adjustments ther
143
 
144
  == Changelog ==
145
 
 
 
 
 
146
  = 1.1.0 =
147
  * New: Tested up to WP 4.6
148
  * New: Create a poll and ask what feature is most required
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.7
12
+ Stable tag: 1.1.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
 
143
 
144
  == Changelog ==
145
 
146
+ = 1.1.1 =
147
+ * Fix: Change rating url
148
+ * New: Tested up to WP 4.7
149
+
150
  = 1.1.0 =
151
  * New: Tested up to WP 4.6
152
  * New: Create a poll and ask what feature is most required
wp-staging.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Create a staging clone site for testing & developing
7
  * Author: WP-Staging, René Hermenau
8
  * Author URI: https://wordpress.org/plugins/wp-staging
9
- * Version: 1.1.0
10
  * Text Domain: wpstg
11
  * Domain Path: languages
12
 
@@ -29,60 +29,32 @@
29
  * @author René Hermenau
30
  */
31
  // Exit if accessed directly
32
- if( !defined( 'ABSPATH' ) )
33
  exit;
34
 
35
  // Plugin version
36
- if( !defined( 'WPSTG_VERSION' ) ) {
37
- define( 'WPSTG_VERSION', '1.1.0' );
38
  }
39
  // Is compatible up to WordPress version
40
- if( !defined( 'WPSTG_WP_COMPATIBLE' ) ) {
41
- define( 'WPSTG_WP_COMPATIBLE', '4.6' );
42
  }
43
 
44
  // Plugin Folder Path
45
- if( !defined( 'WPSTG_PLUGIN_DIR' ) ) {
46
- define( 'WPSTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
47
- }
48
-
49
- // Plugin Root File
50
- if( !defined( 'WPSTG_PLUGIN_FILE' ) ) {
51
- define( 'WPSTG_PLUGIN_FILE', __FILE__ );
52
  }
53
 
54
  // Files that needs to be loaded early
55
- if( !class_exists( 'WPSTG_Utils' ) ) {
56
- require dirname( __FILE__ ) . '/includes/wpstg-utils.php';
57
- }
58
-
59
- // Installation & activation
60
- register_activation_hook( __FILE__, 'wpstg_activation' );
61
- function wpstg_activation( $networkwide ) {
62
- require_once WPSTG_PLUGIN_DIR . '/includes/install.php';
63
-
64
- if( function_exists( 'is_multisite' ) && is_multisite() ) {
65
- // check if it is a network activation - if so, run the activation function for each blog id
66
- if( $networkwide ) {
67
- $old_blog = $wpdb->blogid;
68
- // Get all blog ids
69
- $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
70
- foreach ( $blogids as $blog_id ) {
71
- switch_to_blog( $blog_id );
72
- wpstg_install();
73
- }
74
- switch_to_blog( $old_blog );
75
- return;
76
- }
77
- }
78
-
79
- wpstg_install();
80
  }
81
 
82
  /*
83
  * Main class wpstaging
84
  */
85
- if( !class_exists( 'wpstaging' ) ) :
86
 
87
  /**
88
  * Main wpstg Class
@@ -103,6 +75,7 @@ if( !class_exists( 'wpstaging' ) ) :
103
  self::load_textdomain();
104
  }
105
 
 
106
  /**
107
  * Setup plugin constants
108
  *
@@ -112,22 +85,28 @@ if( !class_exists( 'wpstaging' ) ) :
112
  */
113
  private function setup_constants() {
114
  //global $wpdb;
 
115
  // Plugin Folder Path
116
- if( !defined( 'WPSTG_PLUGIN_DIR' ) ) {
117
- define( 'WPSTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
118
  }
119
 
120
  // Plugin Folder URL
121
- if( !defined( 'WPSTG_PLUGIN_URL' ) ) {
122
- define( 'WPSTG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
 
 
 
 
 
123
  }
124
 
125
- if( !defined( 'WPSTG_NAME' ) ) {
126
- define( 'WPSTG_NAME', 'WP Staging' );
127
  }
128
 
129
- if( !defined( 'WPSTG_SLUG' ) ) {
130
- define( 'WPSTG_SLUG', 'wp-staging' );
131
  }
132
  }
133
 
@@ -143,10 +122,9 @@ if( !class_exists( 'wpstaging' ) ) :
143
  require_once WPSTG_PLUGIN_DIR . 'includes/logger.php';
144
  require_once WPSTG_PLUGIN_DIR . 'includes/scripts.php';
145
  require_once WPSTG_PLUGIN_DIR . 'includes/staging-functions.php';
146
- if( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
147
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
148
  $wpstg_options = wpstg_get_settings(); // Load it on top of all
149
- require_once WPSTG_PLUGIN_DIR . 'includes/install.php';
150
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/admin-actions.php';
151
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/admin-notices.php';
152
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/admin-footer.php';
@@ -155,6 +133,7 @@ if( !class_exists( 'wpstaging' ) ) :
155
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/welcome.php';
156
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
157
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
 
158
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/tools.php';
159
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/upload-functions.php';
160
  require_once WPSTG_PLUGIN_DIR . 'includes/class-wpstg-license-handler.php';
@@ -166,26 +145,6 @@ if( !class_exists( 'wpstaging' ) ) :
166
  }
167
  }
168
 
169
- public static function wpstg_activation( $networkwide ) {
170
- global $wpdb;
171
-
172
- if( function_exists( 'is_multisite' ) && is_multisite() ) {
173
- // check if it is a network activation - if so, run the activation function for each blog id
174
- if( $networkwide ) {
175
- $old_blog = $wpdb->blogid;
176
- // Get all blog ids
177
- $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
178
- foreach ( $blogids as $blog_id ) {
179
- switch_to_blog( $blog_id );
180
- wpstg_install();
181
- }
182
- switch_to_blog( $old_blog );
183
- return;
184
- }
185
- }
186
- wpstg_install();
187
- }
188
-
189
  /**
190
  * Loads the plugin language files
191
  *
@@ -195,26 +154,26 @@ if( !class_exists( 'wpstaging' ) ) :
195
  */
196
  public function load_textdomain() {
197
  // Set filter for plugin's languages directory
198
- $wpstg_lang_dir = dirname( plugin_basename( WPSTG_PLUGIN_FILE ) ) . '/languages/';
199
- $wpstg_lang_dir = apply_filters( 'wpstg_languages_directory', $wpstg_lang_dir );
200
 
201
  // Traditional WordPress plugin locale filter
202
- $locale = apply_filters( 'plugin_locale', get_locale(), 'wpstg' );
203
- $mofile = sprintf( '%1$s-%2$s.mo', 'wpstg', $locale );
204
 
205
  // Setup paths to current locale file
206
  $mofile_local = $wpstg_lang_dir . $mofile;
207
  $mofile_global = WP_LANG_DIR . '/wpstg/' . $mofile;
208
 
209
- if( file_exists( $mofile_global ) ) {
210
  // Look in global /wp-content/languages/WPSTG folder
211
- load_textdomain( 'wpstg', $mofile_global );
212
- } elseif( file_exists( $mofile_local ) ) {
213
  // Look in local /wp-content/plugins/wp-staging/languages/ folder
214
- load_textdomain( 'wpstg', $mofile_local );
215
  } else {
216
  // Load the default language files
217
- load_plugin_textdomain( 'wpstg', false, $wpstg_lang_dir );
218
  }
219
  }
220
 
@@ -231,7 +190,7 @@ function wp_staging_loaded() {
231
 
232
  global $wpstg;
233
 
234
- if( !is_null( $wpstg ) ) {
235
  return $wpstg;
236
  }
237
 
@@ -240,7 +199,7 @@ function wp_staging_loaded() {
240
  //WPSTG();
241
  }
242
 
243
- add_action( 'plugins_loaded', 'wp_staging_loaded' );
244
 
245
  /* function WPSTG() {
246
  global $wpstg;
@@ -254,4 +213,4 @@ add_action( 'plugins_loaded', 'wp_staging_loaded' );
254
  } */
255
 
256
  // Deactivate WPSTG (Pro)
257
- add_action( 'activated_plugin', array('WPSTG_Utils', 'deactivate_other_instances') );
6
  * Description: Create a staging clone site for testing & developing
7
  * Author: WP-Staging, René Hermenau
8
  * Author URI: https://wordpress.org/plugins/wp-staging
9
+ * Version: 1.1.1
10
  * Text Domain: wpstg
11
  * Domain Path: languages
12
 
29
  * @author René Hermenau
30
  */
31
  // Exit if accessed directly
32
+ if ( !defined('ABSPATH') )
33
  exit;
34
 
35
  // Plugin version
36
+ if ( !defined('WPSTG_VERSION') ) {
37
+ define('WPSTG_VERSION', '1.1.1');
38
  }
39
  // Is compatible up to WordPress version
40
+ if ( !defined('WPSTG_WP_COMPATIBLE') ) {
41
+ define('WPSTG_WP_COMPATIBLE', '4.7');
42
  }
43
 
44
  // Plugin Folder Path
45
+ if ( !defined('WPSTG_PLUGIN_DIR') ) {
46
+ define('WPSTG_PLUGIN_DIR', plugin_dir_path(__FILE__));
 
 
 
 
 
47
  }
48
 
49
  // Files that needs to be loaded early
50
+ if ( !class_exists('WPSTG_Utils') ) {
51
+ require dirname(__FILE__) . '/includes/wpstg-utils.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  /*
55
  * Main class wpstaging
56
  */
57
+ if ( !class_exists('wpstaging') ) :
58
 
59
  /**
60
  * Main wpstg Class
75
  self::load_textdomain();
76
  }
77
 
78
+
79
  /**
80
  * Setup plugin constants
81
  *
85
  */
86
  private function setup_constants() {
87
  //global $wpdb;
88
+
89
  // Plugin Folder Path
90
+ if ( !defined('WPSTG_PLUGIN_DIR') ) {
91
+ define('WPSTG_PLUGIN_DIR', plugin_dir_path(__FILE__));
92
  }
93
 
94
  // Plugin Folder URL
95
+ if ( !defined('WPSTG_PLUGIN_URL') ) {
96
+ define('WPSTG_PLUGIN_URL', plugin_dir_url(__FILE__));
97
+ }
98
+
99
+ // Plugin Root File
100
+ if ( !defined('WPSTG_PLUGIN_FILE') ) {
101
+ define('WPSTG_PLUGIN_FILE', __FILE__);
102
  }
103
 
104
+ if ( !defined('WPSTG_NAME') ) {
105
+ define('WPSTG_NAME', 'WP Staging');
106
  }
107
 
108
+ if ( !defined('WPSTG_SLUG') ) {
109
+ define('WPSTG_SLUG', 'wp-staging');
110
  }
111
  }
112
 
122
  require_once WPSTG_PLUGIN_DIR . 'includes/logger.php';
123
  require_once WPSTG_PLUGIN_DIR . 'includes/scripts.php';
124
  require_once WPSTG_PLUGIN_DIR . 'includes/staging-functions.php';
125
+ if ( is_admin() || ( defined('WP_CLI') && WP_CLI ) ) {
126
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
127
  $wpstg_options = wpstg_get_settings(); // Load it on top of all
 
128
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/admin-actions.php';
129
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/admin-notices.php';
130
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/admin-footer.php';
133
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/welcome.php';
134
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
135
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
136
+ require_once WPSTG_PLUGIN_DIR . 'includes/install.php';
137
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/tools.php';
138
  require_once WPSTG_PLUGIN_DIR . 'includes/admin/upload-functions.php';
139
  require_once WPSTG_PLUGIN_DIR . 'includes/class-wpstg-license-handler.php';
145
  }
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  /**
149
  * Loads the plugin language files
150
  *
154
  */
155
  public function load_textdomain() {
156
  // Set filter for plugin's languages directory
157
+ $wpstg_lang_dir = dirname(plugin_basename(WPSTG_PLUGIN_FILE)) . '/languages/';
158
+ $wpstg_lang_dir = apply_filters('wpstg_languages_directory', $wpstg_lang_dir);
159
 
160
  // Traditional WordPress plugin locale filter
161
+ $locale = apply_filters('plugin_locale', get_locale(), 'wpstg');
162
+ $mofile = sprintf('%1$s-%2$s.mo', 'wpstg', $locale);
163
 
164
  // Setup paths to current locale file
165
  $mofile_local = $wpstg_lang_dir . $mofile;
166
  $mofile_global = WP_LANG_DIR . '/wpstg/' . $mofile;
167
 
168
+ if ( file_exists($mofile_global) ) {
169
  // Look in global /wp-content/languages/WPSTG folder
170
+ load_textdomain('wpstg', $mofile_global);
171
+ } elseif ( file_exists($mofile_local) ) {
172
  // Look in local /wp-content/plugins/wp-staging/languages/ folder
173
+ load_textdomain('wpstg', $mofile_local);
174
  } else {
175
  // Load the default language files
176
+ load_plugin_textdomain('wpstg', false, $wpstg_lang_dir);
177
  }
178
  }
179
 
190
 
191
  global $wpstg;
192
 
193
+ if ( !is_null($wpstg) ) {
194
  return $wpstg;
195
  }
196
 
199
  //WPSTG();
200
  }
201
 
202
+ add_action('plugins_loaded', 'wp_staging_loaded');
203
 
204
  /* function WPSTG() {
205
  global $wpstg;
213
  } */
214
 
215
  // Deactivate WPSTG (Pro)
216
+ add_action('activated_plugin', array('WPSTG_Utils', 'deactivate_other_instances'));