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

Version Description

  • New: Major version - Complete rewrite of the code base
  • New: Batch processing allows to clone even huge sites without any timeouts
  • New: Preparation for WP QUADS PRO with ability to copy file changes back to live site
  • New: Bypass (broken) third party plugins during wp staging related ajax requests to prevent processing errors. Use a mu plugin for this.
Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.5

LICENSE.txt → LICENSE RENAMED
@@ -1,13 +1,12 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
7
Everyone is permitted to copy and distribute verbatim copies
8
of this license document, but changing it is not allowed.
9
10
- Preamble
11
12
The licenses for most software are designed to take away your
13
freedom to share and change it. By contrast, the GNU General Public
@@ -16,7 +15,7 @@ software--to make sure the software is free for all its users. This
16
General Public License applies to most of the Free Software
17
Foundation's software and to any other program whose authors commit to
18
using it. (Some other Free Software Foundation software is covered by
19
- the GNU Library General Public License instead.) You can apply it to
20
your programs, too.
21
22
When we speak of free software, we are referring to freedom, not
@@ -57,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
57
The precise terms and conditions for copying, distribution and
58
modification follow.
59
60
- GNU GENERAL PUBLIC LICENSE
61
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
63
0. This License applies to any program or other work which contains
@@ -121,6 +120,7 @@ distribute the same sections as part of a whole which is a work based
121
on the Program, the distribution of the whole must be on the terms of
122
this License, whose permissions for other licensees extend to the
123
entire whole, and thus to each and every part regardless of who wrote it.
124
Thus, it is not the intent of this section to claim rights or contest
125
your rights to work written entirely by you; rather, the intent is to
126
exercise the right to control the distribution of derivative or
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
255
of preserving the free status of all derivatives of our free software and
256
of promoting the sharing and reuse of software generally.
257
258
- NO WARRANTY
259
260
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,4 +277,64 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
POSSIBILITY OF SUCH DAMAGES.
279
280
- END OF TERMS AND CONDITIONS
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
Everyone is permitted to copy and distribute verbatim copies
7
of this license document, but changing it is not allowed.
8
9
+ Preamble
10
11
The licenses for most software are designed to take away your
12
freedom to share and change it. By contrast, the GNU General Public
15
General Public License applies to most of the Free Software
16
Foundation's software and to any other program whose authors commit to
17
using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
your programs, too.
20
21
When we speak of free software, we are referring to freedom, not
56
The precise terms and conditions for copying, distribution and
57
modification follow.
58
59
+ GNU GENERAL PUBLIC LICENSE
60
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62
0. This License applies to any program or other work which contains
120
on the Program, the distribution of the whole must be on the terms of
121
this License, whose permissions for other licensees extend to the
122
entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
Thus, it is not the intent of this section to claim rights or contest
125
your rights to work written entirely by you; rather, the intent is to
126
exercise the right to control the distribution of derivative or
255
of preserving the free status of all derivatives of our free software and
256
of promoting the sharing and reuse of software generally.
257
258
+ NO WARRANTY
259
260
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
277
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
POSSIBILITY OF SUCH DAMAGES.
279
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ {description}
294
+ Copyright (C) {year} {fullname}
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ {signature of Ty Coon}, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
340
+
apps/Backend/Activation/Activation.php CHANGED
@@ -53,6 +53,9 @@ class Activation {
53
// Install Optimizer
54
$optimizer = new Optimizer();
55
$optimizer->installOptimizer();
56
}
57
58
}
53
// Install Optimizer
54
$optimizer = new Optimizer();
55
$optimizer->installOptimizer();
56
+
57
+ // Add the transient to redirect for class Welcome (not for multisites)
58
+ set_transient( 'wpstg_activation_redirect', true, 3600 );
59
}
60
61
}
apps/Backend/Activation/Welcome.php ADDED
@@ -0,0 +1,44 @@
1
+ <?php
2
+
3
+ namespace WPStaging\Backend\Activation;
4
+
5
+ // No Direct Access
6
+ if( !defined( "WPINC" ) ) {
7
+ die;
8
+ }
9
+
10
+ class Welcome {
11
+
12
+ public function __construct() {
13
+ add_action( 'admin_init', array( $this, 'welcome' ) );
14
+ }
15
+
16
+
17
+
18
+ /**
19
+ * Sends user to the welcome page on first activation of WPSTG as well as each
20
+ * time WPSTG is upgraded to a new version
21
+ *
22
+ * @access public
23
+ * @since 1.0.1
24
+ * @return void
25
+ */
26
+ public function welcome() {
27
+ // Bail if no activation redirect
28
+ if ( false === get_transient( 'wpstg_activation_redirect' ) ){
29
+ return;
30
+ }
31
+
32
+ // Delete the redirect transient
33
+ delete_transient( 'wpstg_activation_redirect' );
34
+
35
+ // Bail if activating from network, or bulk
36
+ if ( is_network_admin() || isset( $_GET['activate-multi'] ) ){
37
+ return;
38
+ }
39
+
40
+ wp_safe_redirect( admin_url( 'admin.php?page=wpstg-welcome' ) ); exit;
41
+ }
42
+
43
+
44
+ }
apps/Backend/Administrator.php CHANGED
@@ -73,6 +73,8 @@ class Administrator extends InjectionAware {
73
$loader = $this->di->get( "loader" );
74
75
$Activation = new \WPStaging\Backend\Activation\Activation();
76
77
$loader->addAction( "activated_plugin", $Activation, 'deactivate_other_instances' );
78
$loader->addAction( "admin_menu", $this, "addMenu", 10 );
@@ -189,6 +191,10 @@ class Administrator extends InjectionAware {
189
add_submenu_page(
190
"wpstg_clone", __( "WP Staging Tools", "wpstg" ), __( "Tools", "wpstg" ), "manage_options", "wpstg-tools", array($this, "getToolsPage")
191
);
192
193
if( class_exists( 'WPStaging\Backend\Pro\Licensing\Licensing' ) ) {
194
// Page: License
@@ -226,6 +232,13 @@ class Administrator extends InjectionAware {
226
227
require_once "{$this->path}views/clone/index.php";
228
}
229
230
/**
231
* Tools Page
73
$loader = $this->di->get( "loader" );
74
75
$Activation = new \WPStaging\Backend\Activation\Activation();
76
+
77
+ $Welcome = new Activation\Welcome();
78
79
$loader->addAction( "activated_plugin", $Activation, 'deactivate_other_instances' );
80
$loader->addAction( "admin_menu", $this, "addMenu", 10 );
191
add_submenu_page(
192
"wpstg_clone", __( "WP Staging Tools", "wpstg" ), __( "Tools", "wpstg" ), "manage_options", "wpstg-tools", array($this, "getToolsPage")
193
);
194
+ // Page: Tools
195
+ add_submenu_page(
196
+ "wpstg_clone", __( "WP Staging Welcome", "wpstg" ), __( "Get WP Staging Pro", "wpstg" ), "manage_options", "wpstg-welcome", array($this, "getWelcomePage")
197
+ );
198
199
if( class_exists( 'WPStaging\Backend\Pro\Licensing\Licensing' ) ) {
200
// Page: License
232
233
require_once "{$this->path}views/clone/index.php";
234
}
235
+
236
+ /**
237
+ * Welcome Page
238
+ */
239
+ public function getWelcomePage() {
240
+ require_once "{$this->path}views/welcome/welcome.php";
241
+ }
242
243
/**
244
* Tools Page
apps/Backend/Modules/Jobs/Data.php CHANGED
@@ -164,7 +164,7 @@ class Data extends JobExecutable
164
*/
165
protected function step1()
166
{
167
- $this->log( "Updating siteurl and homeurl in {$this->prefix}options {$this->db->last_error}", Logger::TYPE_ERROR );
168
169
$result = $this->db->query(
170
$this->db->prepare(
164
*/
165
protected function step1()
166
{
167
+ $this->log( "Updating siteurl and homeurl in {$this->prefix}options {$this->db->last_error}", Logger::TYPE_INFO );
168
169
$result = $this->db->query(
170
$this->db->prepare(
apps/Backend/Modules/Jobs/Delete.php CHANGED
@@ -268,31 +268,31 @@ class Delete extends Job
268
* @param array $excluded_dirs
269
* @return boolean false when its finished
270
*/
271
- // function deleteDirectoryNative( $dir = '' ) {
272
- //
273
- // if( !file_exists( $dir ) ) {
274
- // return $this->isFinished();
275
- // }
276
- //
277
- // if( !is_dir( $dir ) || is_link( $dir ) ) {
278
- // unlink( $dir );
279
- // return $this->isFinished();
280
- // }
281
- // foreach ( scandir( $dir ) as $item ) {
282
- // if( $item == '.' || $item == '..' ) {
283
- // continue;
284
- // }
285
- // if( !$this->deleteDirectoryNative( $dir . "/" . $item, false ) ) {
286
- // //chmod( $dir . "/" . $item, 0777 );
287
- // //if( !$this->deleteDirectoryNative( $dir . "/" . $item, false ) ){
288
- // //return false;
289
- // //}
290
- // }
291
- // };
292
- //
293
- // rmdir( $dir );
294
- // return $this->isFinished();
295
- // }
296
297
298
268
* @param array $excluded_dirs
269
* @return boolean false when its finished
270
*/
271
+ function deleteDirectoryNative( $dir = '' ) {
272
+
273
+ if( !file_exists( $dir ) ) {
274
+ return $this->isFinished();
275
+ }
276
+
277
+ if( !is_dir( $dir ) || is_link( $dir ) ) {
278
+ unlink( $dir );
279
+ return $this->isFinished();
280
+ }
281
+ foreach ( scandir( $dir ) as $item ) {
282
+ if( $item == '.' || $item == '..' ) {
283
+ continue;
284
+ }
285
+ if( !$this->deleteDirectoryNative( $dir . "/" . $item, false ) ) {
286
+ //chmod( $dir . "/" . $item, 0777 );
287
+ //if( !$this->deleteDirectoryNative( $dir . "/" . $item, false ) ){
288
+ //return false;
289
+ //}
290
+ }
291
+ };
292
+
293
+ rmdir( $dir );
294
+ return $this->isFinished();
295
+ }
296
297
298
apps/Backend/Modules/Jobs/Directories.php CHANGED
@@ -188,7 +188,7 @@ class Directories extends JobExecutable {
188
$this->options->totalFiles++;
189
190
$this->files[] = $fullPath;
191
-
192
/**
193
* Test and measure if its faster to copy at the same time while the array with folders is generated
194
*/
188
$this->options->totalFiles++;
189
190
$this->files[] = $fullPath;
191
+
192
/**
193
* Test and measure if its faster to copy at the same time while the array with folders is generated
194
*/
apps/Backend/Modules/Jobs/Job.php CHANGED
@@ -324,7 +324,7 @@ abstract class Job implements JobInterface
324
// Check if execution time is over threshold
325
///$time = round($this->start + $this->time(), 4);
326
$time = round($this->time() - $this->start, 4);
327
-
328
if ($time >= $this->executionLimit)
329
{
330
//$this->log('RESET TIME');
324
// Check if execution time is over threshold
325
///$time = round($this->start + $this->time(), 4);
326
$time = round($this->time() - $this->start, 4);
327
+ $this->debugLog( 'Execution time: ' . $time . ' Execution Limit' . $this->executionLimit );
328
if ($time >= $this->executionLimit)
329
{
330
//$this->log('RESET TIME');
apps/Backend/Modules/Jobs/JobExecutable.php CHANGED
@@ -39,7 +39,7 @@ abstract class JobExecutable extends Job
39
40
/**
41
* Prepare Response Array
42
- * @param bool $status
43
* @param bool $incrementCurrentStep
44
* @return array
45
*/
39
40
/**
41
* Prepare Response Array
42
+ * @param bool $status false when the job is not done
43
* @param bool $incrementCurrentStep
44
* @return array
45
*/
apps/Backend/Upgrade/Upgrade.php CHANGED
@@ -3,8 +3,6 @@
3
namespace WPStaging\Backend\Upgrade;
4
5
use WPStaging\WPStaging;
6
- //use WPStaging\Backend\Optimizer\Optimizer;
7
- //use WPStaging\Cron\Cron;
8
use WPStaging\Utils\Logger;
9
10
/**
3
namespace WPStaging\Backend\Upgrade;
4
5
use WPStaging\WPStaging;
6
use WPStaging\Utils\Logger;
7
8
/**
apps/Backend/public/css/wpstg-admin.css CHANGED
@@ -708,4 +708,65 @@ color:#777777;
708
709
#wpstg-check-space {
710
margin-left:8px;
711
}
708
709
#wpstg-check-space {
710
margin-left:8px;
711
+ }
712
+
713
+ /* welcome screen */
714
+ .wpstg-button.green {
715
+ display: inline-block;
716
+ background-color: #83c11f;
717
+ padding: 10px;
718
+ min-width: 170px;
719
+ color: white;
720
+ font-size: 16px;
721
+ text-decoration: none;
722
+ text-align: center;
723
+ margin-top: 20px;
724
+ }
725
+ #wpstg-welcome li {
726
+ font-size: 18px;
727
+ line-height: 29px;
728
+ position: relative;
729
+ padding-left: 23px;
730
+ list-style: none!important;
731
+ }
732
+ #wpstg-welcome {
733
+ margin-top:20px;
734
+ margin-right: 20px;
735
+ background-color: white;
736
+ }
737
+ .wpstg-heading-pro {
738
+ color: #0080ff;
739
+ font-weight: bold;
740
+ }
741
+ .wpstg-h2 {
742
+ margin-top: 0px;
743
+ margin-bottom: 1.2rem;
744
+ font-size: 30px;
745
+ line-height: 2.5rem;
746
+ }
747
+ #wpstg-welcome li:before {
748
+ width: 1em;
749
+ height: 100%;
750
+ background: url(data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%2377B227%22%20d%3D%22M1671%20566q0%2040%2D28%2068l%2D724%20724%2D136%20136q%2D28%2028%2D68%2028t%2D68%2D28l%2D136%2D136%2D362%2D362q%2D28%2D28%2D28%2D68t28%2D68l136%2D136q28%2D28%2068%2D28t68%2028l294%20295%20656%2D657q28%2D28%2068%2D28t68%2028l136%20136q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) left .4em no-repeat;
751
+ background-size: contain;
752
+ content: "";
753
+ position: absolute;
754
+ top: 0;
755
+ left: 0;
756
+ color: #77b227;
757
+ }
758
+ .wpstg-h1 {
759
+ font-size: 2.75em;
760
+ margin-bottom: 1.35rem;
761
+ font-size: 2.5em;
762
+ line-height: 3.68rem;
763
+ letter-spacing: normal;
764
+ }
765
+ #wpstg-welcome h2 {
766
+ margin: 0 0 15px;
767
+ }
768
+ #wpstg-welcome .wpstg-footer {
769
+ clear: both;
770
+ margin-top: 20px;
771
+ font-style: italic;
772
}
apps/Backend/views/_includes/messages/beta.php CHANGED
@@ -10,9 +10,9 @@
10
<a href="https://wordpress.org/plugins/backwpup/" target="_blank">BackWPup</a>
11
</p>
12
<p>
13
- I am not responsible for any damages this plugin will cause to your site.
14
<br>
15
- Do a full backup first!
16
</p>
17
<ul>
18
<li>
10
<a href="https://wordpress.org/plugins/backwpup/" target="_blank">BackWPup</a>
11
</p>
12
<p>
13
+ I am not responsible for any damages you do to your site;)
14
<br>
15
+ Create a full backup first.
16
</p>
17
<ul>
18
<li>
apps/Backend/views/_includes/messages/rating.php CHANGED
@@ -2,6 +2,8 @@
2
<p>
3
Awesome, you've been using <strong>WP Staging </strong> for more than 1 week.
4
May I ask you to give it a <strong>5-star</strong> rating on Wordpress?
5
</p>
6
7
<p>
2
<p>
3
Awesome, you've been using <strong>WP Staging </strong> for more than 1 week.
4
May I ask you to give it a <strong>5-star</strong> rating on Wordpress?
5
+ <br><br>
6
+ P.S. Looking for a way to copy plugins and theme files from staging to live site? Try out <a href="https://wp-staging.com" target="_blank">WP Staging Pro</a> <br>
7
</p>
8
9
<p>
apps/Backend/views/welcome/welcome.php ADDED
@@ -0,0 +1,15 @@
1
+ <div class="" id="wpstg-welcome">
2
+ <div style="border: 2px solid white;padding: 20px;margin-bottom:20px;">
3
+ <h2 class="wpstg-h2">
4
+ <span class="wpstg-heading-pro"><?php _e( 'WP Staging Pro', 'wpstg' ); ?></span><?php _e( ' - Copy Themes & Plugins from Staging to Live Site', 'wpstg' ); ?>
5
+ </h2>
6
+ <li><strong>Cloning</strong> - <?php _e( 'Create a clone of your website with a simple click', 'wpstg' ); ?></li>
7
+ <li><strong>Push Changes</strong> - <?php _e( 'Copy plugin and theme files from staging to live site', 'wpstg' ); ?></li>
8
+ <li><strong>Authentication</strong> - <?php _e( 'Staging Site is available to authenticated users only', 'wpstg' ); ?></li>
9
+ <li><strong>High Performance</strong> - <?php _e( 'Cloning process is fast and does not slow down website loading', 'wpstg' ); ?></li>
10
+ <li><strong>Secure</strong> - <?php _e( 'WP Staging is coded well for protection of your data', 'wpstg' ); ?></li>
11
+ <a href="http://wp-staging.com/?utm_source=wpstg&utm_medium=addon_page&utm_term=click-wpstaging-pro&utm_campaign=wpstaging" target="_blank" class="wpstg-button green">Buy WP Staging Pro</a>
12
+ <a href="<?php echo admin_url(); ?>admin.php?page=wpstg_clone" target="_self" style="margin-left:30px;">Skip - Start Cloning</a>
13
+ <div class="wpstg-footer"> <?php _e( 'Comes with our 30-day no questions asked money back guarantee', 'wpstg' ); ?></div>
14
+ </div>
15
+ </div>
apps/Core/WPStaging.php CHANGED
@@ -29,7 +29,7 @@ final class WPStaging {
29
/**
30
* Plugin version
31
*/
32
- const VERSION = "2.0.4";
33
34
/**
35
* Plugin name
@@ -147,7 +147,8 @@ final class WPStaging {
147
"toplevel_page_wpstg_clone",
148
"wp-staging_page_wpstg-settings",
149
"wp-staging_page_wpstg-tools",
150
- "wp-staging_page_wpstg-license"
151
);
152
153
// Load these css and js files only on wp staging admin pages
@@ -211,7 +212,6 @@ final class WPStaging {
211
"WPStaging" => array(
212
$this->pluginPath . 'apps' . DIRECTORY_SEPARATOR,
213
$this->pluginPath . 'apps' . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR,
214
- //$this->pluginPath . 'apps' . DIRECTORY_SEPARATOR . 'Backend' . DIRECTORY_SEPARATOR
215
)
216
) );
217
29
/**
30
* Plugin version
31
*/
32
+ const VERSION = "2.0.5";
33
34
/**
35
* Plugin name
147
"toplevel_page_wpstg_clone",
148
"wp-staging_page_wpstg-settings",
149
"wp-staging_page_wpstg-tools",
150
+ "wp-staging_page_wpstg-license",
151
+ "wp-staging_page_wpstg-welcome",
152
);
153
154
// Load these css and js files only on wp staging admin pages
212
"WPStaging" => array(
213
$this->pluginPath . 'apps' . DIRECTORY_SEPARATOR,
214
$this->pluginPath . 'apps' . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR,
215
)
216
) );
217
readme.txt CHANGED
@@ -1,229 +1,229 @@
1
- === WP Staging - DB & File Duplicator & Migration ===
2
-
3
- Author URL: https://wordpress.org/plugins/wp-staging
4
- Plugin URL: https://wordpress.org/plugins/wp-staging
5
- Contributors: ReneHermi, WP-Staging
6
- Donate link: https://wordpress.org/plugins/wp-staging
7
- 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.8
12
- Stable tag: 2.0.4
13
-
14
- A duplicator plugin! Clone, duplicate and migrate live sites to independent staging and development sites that are available only to administrators.
15
-
16
- == Description ==
17
-
18
- <strong>This cloning and staging plugin is well tested but work in progress. <br><br>
19
- If you find any issue, please open a [support ticket](https://wp-staging.com/support/ "support ticket").
20
- </strong>
21
- <br /><br />
22
- <strong>Note: </strong> For pushing plugins and theme files to live site, check out [https://wp-staging.com/](https://wp-staging.com/ "WP Staging Pro")
23
- <br /><br />
24
- <blockquote>
25
- <h4> WP Staging for WordPress Migration </h4>
26
- This duplicator plugin allows you to create an staging or development environment in seconds* <br /> <br />
27
- It creates a clone of your website into a subfolder of your main WordPress installation including an entire copy of your database.
28
- This sounds pretty simple and yes it is! All the hard time-consumptive database and file copying stuff including url replacements is done in the background.
29
- <br /> <br />
30
- I created this plugin because all other solutions are way too complex, overloaded with dozens of options or having server requirements which are not available on most shared hosting solutions.
31
- All these reasons prevent user from testing new plugins and updates first before installing them on their live website, so its time to release a plugin which has the potential to be merged into everyone´s wordpress workflow.
32
- <br /><br />
33
- <p><small><em>* Time of creation depends on size of your database and file size</em></small></p>
34
- </blockquote>
35
-
36
- WP Staging helps you to prevent your website from being broken or unavailable because of installing untested plugin updates!
37
-
38
- [youtube https://www.youtube.com/watch?v=Ye3fC6cdB3A]
39
-
40
- = Main Features =
41
-
42
- * <strong>Easy: </strong> Staging migration applicable for everyone. No configuration needed!
43
- * <strong>Fast: </strong> Migration process lasts only a few seconds or minutes, depending on the site's size and server I/O power
44
- * <strong>Safe: </strong> Access to staging site is granted for administrators only.
45
- <br /><br />
46
- <strong>More safe:</strong>
47
- <br>
48
- * Admin bar reflects that you are working on a staging site
49
- * Extensive logging if duplication and migration process fails.
50
-
51
- = What does not work or is not tested when running wordpress migration? =
52
-
53
- * Wordpress migration of wordpress multisites (not tested)
54
- * WordPress duplicating process on windows server (not tested but will probably work)
55
- Edit: Duplication on windows server seems to be working well: [Read more](https://wordpress.org/support/topic/wont-copy-files?replies=5 "Read more")
56
-
57
-
58
- <strong>Change your workflow of updating themes and plugins data:</strong>
59
-
60
- 1. Use WP Staging for migration of a production website to a clone site for staging purposes
61
- 2. Customize theme, configuration and plugins or install new plugins
62
- 3. Test everything on your staging site first
63
- 4. Everything running as expected? You are on the save side for migration of all these modifications to your production site!
64
-
65
-
66
- <h3> Why should i use a staging website? </h3>
67
-
68
- Plugin updates and theme customizations should be tested on a staging platform first. Its recommended to have the staging platform on the same server where the production website is located.
69
- When you run a plugin update or plan to install a new one, it is a necessary task to check first the modifications on a clone of your production website.
70
- This makes sure that any modifications is working on your website without throwing unexpected errors or preventing your site from loading. (Better known as the wordpress blank page error)
71
-
72
- Testing a plugin update before installing it in live environment isn´t done very often by most user because existing staging solutions are too complex and need a lot of time to create a
73
- up-to-date copy of your website.
74
-
75
- Some people are also afraid of installing plugins updates because they follow the rule "never touch a running system" with having in mind that untested updates are increasing the risk of breaking their site.
76
- I totally understand this and i am guilty as well here, but unfortunately this leads to one of the main reasons why WordPress installations are often outdated, not updated at all and unsecure due to this non-update behavior.
77
-
78
- <strong> I think its time to change this, so i created "WP Staging" for WordPress migration of staging sites</strong>
79
-
80
- <h3> Can´t i just use my local wordpress development copy for testing like xampp / lampp? </h3>
81
-
82
- Nope! If your local hardware and software environment is not a 100% exact clone of your production server there is NO guarantee that every aspect
83
- of your local copy is working on your live website exactely as you would expect it.
84
- There are some obvious things like differences in the config of php and the server you are running but even such non obvious settings like the amount of ram or the
85
- the cpu performance can lead to unexpected results on your production website.
86
- There are dozens of other possible cause of failure which can not be handled well when you are testing your changes on a local staging platform.
87
-
88
- This is were WP Staging steps in... Site cloning and staging site creation simplified!
89
-
90
- <h3>I just want to migrate the database from one installation to another</h3>
91
- If you want to migrate your local database to a already existing production site you can use a tool like WP Migrate DB.
92
- WP Staging is only for creating a staging site with latest data from your production site. So it goes the opposite way of WP Migrate DB.
93
- Both tools are excellent cooperating eachother.
94
-
95
- <h3>What are the benefits compared to a plugin like Duplicator?</h3>
96
- At first, i love the [Duplicator plugin](https://wordpress.org/plugins/duplicator/ "Duplicator plugin"). Duplicator is a great tool for migrating from development site to production one or from production site to development one.
97
- The downside is that Duplicator needs adjustments, manually interventions and prerequirements for this. Duplicator also needs some skills to be able to create a development / staging site, where WP Staging does not need more than a click from you.
98
- However, Duplicator is best placed to be a tool for first-time creation of your production site. This is something where it is very handy and powerful.
99
-
100
- So, if you have created a local or webhosted development site and you need to migrate this site the first time to your production domain than you are doing nothing wrong with using
101
- the Duplicator plugin! If you need all you latest production data like posts, updated plugins, theme data and styles in a testing environment than i recommend to use WP Staging instead!
102
-
103
- = I need you feedback =
104
- This plugin has been done in hundreds of hours to work on even the smallest shared webhosting package but i am limited in testing this only on a handful of different server so i need your help:
105
- Please open a [support request](https://wordpress.org/support/plugin/wp-staging/ "support request") and describe your problem exactely. In wp-content/wp-staging/logs you find extended logfiles. Have a look at them and let me know the error-thrown lines.
106
-
107
-
108
- = Important =
109
-
110
- Per default the staging site will have permalinks disabled because the staging site will be cloned into a subfolder and regular permalinks are not working
111
- without doing changes to your .htaccess or nginx.conf.
112
- In the majority of cases this is abolutely fine for a staging platform and you still will be able to test new plugins and do some theme changes on your staging platform.
113
- If you need the same permalink stucture on your staging platform as you have in your prodcution website you have to create a custom .htaccess for apache webserver
114
- or to adjust your nginx.conf.
115
-
116
-
117
- = How to install and setup? =
118
- Install it via the admin dashboard and to 'Plugins', click 'Add New' and search the plugins for 'Staging'. Install the plugin with 'Install Now'.
119
- After installation goto the settings page 'Staging' and do your adjustments there.
120
-
121
-
122
- == Frequently Asked Questions ==
123
-
124
-
125
- == Official Site ==
126
- https://wp-staging.com
127
-
128
- == Installation ==
129
- 1. Download the file "wp-staging" , unzip and place it in your wp-content/plugins/wp-staging folder. You can alternatively upload and install it via the WordPress plugin backend.
130
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
131
- 3. Start Plugins->Staging
132
-
133
- == Screenshots ==
134
-
135
- 1. Step 1. Create new WordPress staging site
136
- 2. Step 2. Scanning your website for files and database tables
137
- 3. Step 3. Wordpress Staging site creation in progress
138
- 4. Finish!
139
-
140
- == Changelog ==
141
-
142
-
143
- = 2.0.4 =
144
- * New: Major version - Complete rewrite of the code base
145
- * New: Batch processing allows to clone even huge sites without any timeouts
146
- * New: Preparation for WP QUADS PRO with ability to copy file changes back to live site
147
- * New: Bypass (broken) third party plugins during wp staging related ajax requests to prevent processing errors. Use a mu plugin for this.
148
-
149
- = 1.1.6 =
150
- * New: Add download link to WP Staging Beta Version 2.0.1
151
-
152
- = 1.1.5 =
153
- * Fix: Admin notice is throwing a false positive write permission error
154
- * New: Move log folder to wp-content/uploads/wp-staging/logs
155
- * New: Tested up to WP 4.7.3
156
-
157
- = 1.1.4 =
158
- * Fix: Fatal error Unsupported operand types
159
-
160
- = 1.1.3 =
161
- * New: Tested up to wp 4.7.2
162
- * Fix: Arrows in drop down for folder selection are distorted
163
- * Tweak: Show working log as default to make debugging easier
164
-
165
- = 1.1.2 =
166
- * Fix: Settings are not deleted when plugin is removed
167
- * Fix: Staging site is available for non administrators
168
-
169
- = 1.1.1 =
170
- * Fix: Change rating url
171
-
172
- = 1.1.0 =
173
- * New: Tested up to WP 4.6
174
- * New: Create a poll and ask what feature is most required
175
-
176
- = 1.0.9 =
177
- * Fix: Undefined WPSTG() warning
178
- * Fix: Change compatibility version to wp 4.5.3
179
-
180
- = 1.0.8 =
181
- * Tested up to WP 4.5.2
182
-
183
- = 1.0.7 =
184
- * Fix: Activation hook is not fired and staging site is not working properly
185
- * Performance: Increase default query copy limit to 1000
186
-
187
- = 1.0.6 =
188
- * Fix: Uninstalling plugin throwing error
189
- * Fix: Error permission admin notice although permission issues are correct
190
-
191
-
192
- = 1.0.5 =
193
- * New: Tested up to WP 4.5
194
- * Fix: Download system log not working
195
- * Fix: Click on Optimizer "Select all | none | invert" links leads to jumping
196
- * Tweak: Make clear that unselecting a checkbox will exlude table or file from copy process
197
- * Tweak: Remove unnecessary text
198
- * Tweak: Change beta notice in dashboard. WP Staging is stable
199
- * Tweak: Change twitter handle to @wpstg
200
-
201
- = 1.0.3 =
202
- * Fix: Missing const MASHFS_VERSION
203
- * Fix: Remove error "table XY has been created, BUT inserting rows failed."
204
- * Fix: Not tested up to 4.4.2 message shown although it's tested up to WP 4.4.2
205
- * New: Disable either free or pro version and does not allow to have both version enabled at the same time
206
-
207
- = 1.0.2 =
208
- * Tweak: Change setting description of uninstall option
209
- * Tweak: Lower tags in readme.txt
210
-
211
- = 1.0.1 =
212
- * New: Orange colored admin bar on staging site for better visualization and comparision between production live site and staging site
213
- * Tweak: Remove contact link on multisite notification
214
-
215
- = 1.0.0 =
216
- * Fix: Do not follow symlinks during file copy process
217
- * Fix: css error
218
- * Fix: Show "not-compatible" notice only when blog version is higher than plugin tested version.
219
- * Fix: undefined var $size
220
- * Fix: Check if $path is null before writing to remaining_files.json
221
- * Fix: $db_helper undefined message
222
- * Fix: Skip non utf8 encoded files during copying process
223
-
224
- Complete changelog: [https://wp-staging.com/changelog.txt](https://wp-staging.com/changelog.txt)
225
-
226
- == Upgrade Notice ==
227
-
228
- = 2.0.2 =
229
- 2.0.2 * New: Batch processing allows to clone even huge sites without any timeouts
1
+ === WP Staging - DB & File Duplicator & Migration ===
2
+
3
+ Author URL: https://wordpress.org/plugins/wp-staging
4
+ Plugin URL: https://wordpress.org/plugins/wp-staging
5
+ Contributors: ReneHermi, WP-Staging
6
+ Donate link: https://wordpress.org/plugins/wp-staging
7
+ 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.8
12
+ Stable tag: 2.0.5
13
+
14
+ A duplicator plugin! Clone, duplicate and migrate live sites to independent staging and development sites that are available only to administrators.
15
+
16
+ == Description ==
17
+
18
+ <strong>This cloning and staging plugin is well tested but work in progress. <br><br>
19
+ If you find any issue, please open a [support ticket](https://wp-staging.com/support/ "support ticket").
20
+ </strong>
21
+ <br /><br />
22
+ <strong>Note: </strong> For pushing plugins and theme files to live site, check out [https://wp-staging.com/](https://wp-staging.com/ "WP Staging Pro")
23
+ <br /><br />
24
+ <blockquote>
25
+ <h4> WP Staging for WordPress Migration </h4>
26
+ This duplicator plugin allows you to create an staging or development environment in seconds* <br /> <br />
27
+ It creates a clone of your website into a subfolder of your main WordPress installation including an entire copy of your database.
28
+ This sounds pretty simple and yes it is! All the hard time-consumptive database and file copying stuff including url replacements is done in the background.
29
+ <br /> <br />
30
+ I created this plugin because all other solutions are way too complex, overloaded with dozens of options or having server requirements which are not available on most shared hosting solutions.
31
+ All these reasons prevent user from testing new plugins and updates first before installing them on their live website, so its time to release a plugin which has the potential to be merged into everyone´s wordpress workflow.
32
+ <br /><br />
33
+ <p><small><em>* Time of creation depends on size of your database and file size</em></small></p>
34
+ </blockquote>
35
+
36
+ WP Staging helps you to prevent your website from being broken or unavailable because of installing untested plugin updates!
37
+
38
+ [youtube https://www.youtube.com/watch?v=Ye3fC6cdB3A]
39
+
40
+ = Main Features =
41
+
42
+ * <strong>Easy: </strong> Staging migration applicable for everyone. No configuration needed!
43
+ * <strong>Fast: </strong> Migration process lasts only a few seconds or minutes, depending on the site's size and server I/O power
44
+ * <strong>Safe: </strong> Access to staging site is granted for administrators only.
45
+ <br /><br />
46
+ <strong>More safe:</strong>
47
+ <br>
48
+ * Admin bar reflects that you are working on a staging site
49
+ * Extensive logging if duplication and migration process fails.
50
+
51
+ = What does not work or is not tested when running wordpress migration? =
52
+
53
+ * Wordpress migration of wordpress multisites (not tested)
54
+ * WordPress duplicating process on windows server (not tested but will probably work)
55
+ Edit: Duplication on windows server seems to be working well: [Read more](https://wordpress.org/support/topic/wont-copy-files?replies=5 "Read more")
56
+
57
+
58
+ <strong>Change your workflow of updating themes and plugins data:</strong>
59
+
60
+ 1. Use WP Staging for migration of a production website to a clone site for staging purposes
61
+ 2. Customize theme, configuration and plugins or install new plugins
62
+ 3. Test everything on your staging site first
63
+ 4. Everything running as expected? You are on the save side for migration of all these modifications to your production site!
64
+
65
+
66
+ <h3> Why should i use a staging website? </h3>
67
+
68
+ Plugin updates and theme customizations should be tested on a staging platform first. Its recommended to have the staging platform on the same server where the production website is located.
69
+ When you run a plugin update or plan to install a new one, it is a necessary task to check first the modifications on a clone of your production website.
70
+ This makes sure that any modifications is working on your website without throwing unexpected errors or preventing your site from loading. (Better known as the wordpress blank page error)
71
+
72
+ Testing a plugin update before installing it in live environment isn´t done very often by most user because existing staging solutions are too complex and need a lot of time to create a
73
+ up-to-date copy of your website.
74
+
75
+ Some people are also afraid of installing plugins updates because they follow the rule "never touch a running system" with having in mind that untested updates are increasing the risk of breaking their site.
76
+ I totally understand this and i am guilty as well here, but unfortunately this leads to one of the main reasons why WordPress installations are often outdated, not updated at all and unsecure due to this non-update behavior.
77
+
78
+ <strong> I think its time to change this, so i created "WP Staging" for WordPress migration of staging sites</strong>
79
+
80
+ <h3> Can´t i just use my local wordpress development copy for testing like xampp / lampp? </h3>
81
+
82
+ Nope! If your local hardware and software environment is not a 100% exact clone of your production server there is NO guarantee that every aspect
83
+ of your local copy is working on your live website exactely as you would expect it.
84
+ There are some obvious things like differences in the config of php and the server you are running but even such non obvious settings like the amount of ram or the
85
+ the cpu performance can lead to unexpected results on your production website.
86
+ There are dozens of other possible cause of failure which can not be handled well when you are testing your changes on a local staging platform.
87
+
88
+ This is were WP Staging steps in... Site cloning and staging site creation simplified!
89
+
90
+ <h3>I just want to migrate the database from one installation to another</h3>
91
+ If you want to migrate your local database to a already existing production site you can use a tool like WP Migrate DB.
92
+ WP Staging is only for creating a staging site with latest data from your production site. So it goes the opposite way of WP Migrate DB.
93
+ Both tools are excellent cooperating eachother.
94
+
95
+ <h3>What are the benefits compared to a plugin like Duplicator?</h3>
96
+ At first, i love the [Duplicator plugin](https://wordpress.org/plugins/duplicator/ "Duplicator plugin"). Duplicator is a great tool for migrating from development site to production one or from production site to development one.
97
+ The downside is that Duplicator needs adjustments, manually interventions and prerequirements for this. Duplicator also needs some skills to be able to create a development / staging site, where WP Staging does not need more than a click from you.
98
+ However, Duplicator is best placed to be a tool for first-time creation of your production site. This is something where it is very handy and powerful.
99
+
100
+ So, if you have created a local or webhosted development site and you need to migrate this site the first time to your production domain than you are doing nothing wrong with using
101
+ the Duplicator plugin! If you need all you latest production data like posts, updated plugins, theme data and styles in a testing environment than i recommend to use WP Staging instead!
102
+
103
+ = I need you feedback =
104
+ This plugin has been done in hundreds of hours to work on even the smallest shared webhosting package but i am limited in testing this only on a handful of different server so i need your help:
105
+ Please open a [support request](https://wordpress.org/support/plugin/wp-staging/ "support request") and describe your problem exactely. In wp-content/wp-staging/logs you find extended logfiles. Have a look at them and let me know the error-thrown lines.
106
+
107
+
108
+ = Important =
109
+
110
+ Per default the staging site will have permalinks disabled because the staging site will be cloned into a subfolder and regular permalinks are not working
111
+ without doing changes to your .htaccess or nginx.conf.
112
+ In the majority of cases this is abolutely fine for a staging platform and you still will be able to test new plugins and do some theme changes on your staging platform.
113
+ If you need the same permalink stucture on your staging platform as you have in your prodcution website you have to create a custom .htaccess for apache webserver
114
+ or to adjust your nginx.conf.
115
+
116
+
117
+ = How to install and setup? =
118
+ Install it via the admin dashboard and to 'Plugins', click 'Add New' and search the plugins for 'Staging'. Install the plugin with 'Install Now'.
119
+ After installation goto the settings page 'Staging' and do your adjustments there.
120
+
121
+
122
+ == Frequently Asked Questions ==
123
+
124
+
125
+ == Official Site ==
126
+ https://wp-staging.com
127
+
128
+ == Installation ==
129
+ 1. Download the file "wp-staging" , unzip and place it in your wp-content/plugins/wp-staging folder. You can alternatively upload and install it via the WordPress plugin backend.
130
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
131
+ 3. Start Plugins->Staging
132
+
133
+ == Screenshots ==
134
+
135
+ 1. Step 1. Create new WordPress staging site
136
+ 2. Step 2. Scanning your website for files and database tables
137
+ 3. Step 3. Wordpress Staging site creation in progress
138
+ 4. Finish!
139
+
140
+ == Changelog ==
141
+
142
+
143
+ = 2.0.5 =
144
+ * New: Major version - Complete rewrite of the code base
145
+ * New: Batch processing allows to clone even huge sites without any timeouts
146
+ * New: Preparation for WP QUADS PRO with ability to copy file changes back to live site
147
+ * New: Bypass (broken) third party plugins during wp staging related ajax requests to prevent processing errors. Use a mu plugin for this.
148
+
149
+ = 1.1.6 =
150
+ * New: Add download link to WP Staging Beta Version 2.0.1
151
+
152
+ = 1.1.5 =
153
+ * Fix: Admin notice is throwing a false positive write permission error
154
+ * New: Move log folder to wp-content/uploads/wp-staging/logs
155
+ * New: Tested up to WP 4.7.3
156
+
157
+ = 1.1.4 =
158
+ * Fix: Fatal error Unsupported operand types
159
+
160
+ = 1.1.3 =
161
+ * New: Tested up to wp 4.7.2
162
+ * Fix: Arrows in drop down for folder selection are distorted
163
+ * Tweak: Show working log as default to make debugging easier
164
+
165
+ = 1.1.2 =
166
+ * Fix: Settings are not deleted when plugin is removed
167
+ * Fix: Staging site is available for non administrators
168
+
169
+ = 1.1.1 =
170
+ * Fix: Change rating url
171
+
172
+ = 1.1.0 =
173
+ * New: Tested up to WP 4.6
174
+ * New: Create a poll and ask what feature is most required
175
+
176
+ = 1.0.9 =
177
+ * Fix: Undefined WPSTG() warning
178
+ * Fix: Change compatibility version to wp 4.5.3
179
+
180
+ = 1.0.8 =
181
+ * Tested up to WP 4.5.2
182
+
183
+ = 1.0.7 =
184
+ * Fix: Activation hook is not fired and staging site is not working properly
185
+ * Performance: Increase default query copy limit to 1000
186
+
187
+ = 1.0.6 =
188
+ * Fix: Uninstalling plugin throwing error
189
+ * Fix: Error permission admin notice although permission issues are correct
190
+
191
+
192
+ = 1.0.5 =
193
+ * New: Tested up to WP 4.5
194
+ * Fix: Download system log not working
195
+ * Fix: Click on Optimizer "Select all | none | invert" links leads to jumping
196
+ * Tweak: Make clear that unselecting a checkbox will exlude table or file from copy process
197
+ * Tweak: Remove unnecessary text
198
+ * Tweak: Change beta notice in dashboard. WP Staging is stable
199
+ * Tweak: Change twitter handle to @wpstg
200
+
201
+ = 1.0.3 =
202
+ * Fix: Missing const MASHFS_VERSION
203
+ * Fix: Remove error "table XY has been created, BUT inserting rows failed."
204
+ * Fix: Not tested up to 4.4.2 message shown although it's tested up to WP 4.4.2
205
+ * New: Disable either free or pro version and does not allow to have both version enabled at the same time
206
+
207
+ = 1.0.2 =
208
+ * Tweak: Change setting description of uninstall option
209
+ * Tweak: Lower tags in readme.txt
210
+
211
+ = 1.0.1 =
212
+ * New: Orange colored admin bar on staging site for better visualization and comparision between production live site and staging site
213
+ * Tweak: Remove contact link on multisite notification
214
+
215
+ = 1.0.0 =
216
+ * Fix: Do not follow symlinks during file copy process
217
+ * Fix: css error
218
+ * Fix: Show "not-compatible" notice only when blog version is higher than plugin tested version.
219
+ * Fix: undefined var $size
220
+ * Fix: Check if $path is null before writing to remaining_files.json
221
+ * Fix: $db_helper undefined message
222
+ * Fix: Skip non utf8 encoded files during copying process
223
+
224
+ Complete changelog: [https://wp-staging.com/changelog.txt](https://wp-staging.com/changelog.txt)
225
+
226
+ == Upgrade Notice ==
227
+
228
+ = 2.0.2 =
229
+ 2.0.2 * New: Batch processing allows to clone even huge sites without any timeouts
uninstall.php CHANGED
@@ -1,89 +1,89 @@
1
- <?php
2
-
3
- namespace WPStaging\Backend;
4
-
5
- use WPStaging\Backend\Optimizer\Optimizer;
6
-
7
- /**
8
- * Uninstall WP-Staging
9
- *
10
- * @package WPSTG
11
- * @subpackage Uninstall
12
- * @copyright Copyright (c) 2015, René Hermenau
13
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
14
- * @since 0.9.0
15
- */
16
- // No direct access
17
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
18
- exit;
19
- }
20
-
21
- class uninstall {
22
-
23
- public function __construct() {
24
-
25
- // Plugin Folder Path
26
- if( !defined( 'WPSTG_PLUGIN_DIR' ) ) {
27
- define( 'WPSTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
28
- }
29
-
30
- /**
31
- * Path to main WP Staging class
32
- * Make sure to not redeclare class in case free version has been installed previosly
33
- */
34
- if( !class_exists( 'WPStaging\WPStaging' ) ) {
35
- require_once plugin_dir_path( __FILE__ ) . "apps/Core/WPStaging.php";
36
- }
37
- $wpStaging = \WPStaging\WPStaging::getInstance();
38
-
39
- // Delete our must use plugin
40
- $this->deleteMuPlugin();
41
-
42
- $this->init();
43
- }
44
-
45
- private function init() {
46
- $options = json_decode( json_encode( get_option( "wpstg_settings", array() ) ) );
47
-
48
- if( isset( $options->unInstallOnDelete ) && '1' === $options->unInstallOnDelete ) {
49
- // Delete options
50
- delete_option( "wpstg_version_upgraded_from" );
51
- delete_option( "wpstg_version" );
52
- delete_option( "wpstg_installDate" );
53
- delete_option( "wpstg_firsttime" );
54
- delete_option( "wpstg_is_staging_site" );
55
- delete_option( "wpstg_settings" );
56
-
57
- /* Do not delete these fields without actually deleting the staging site
58
- * @create a delete routine which deletes the staging sites first
59
- */
60
- //delete_option( "wpstg_existing_clones" );
61
- //delete_option( "wpstg_existing_clones_beta" );
62
-
63
- // Old wpstg 1.3 options for admin notices
64
- delete_option( "wpstg_start_poll" );
65
- delete_option( "wpstg_hide_beta" );
66
- delete_option( "wpstg_RatingDiv" );
67
-
68
- // New 2.x options for admin notices
69
- delete_option( "wpstg_poll" );
70
- delete_option( "wpstg_rating" );
71
- delete_option( "wpstg_beta" );
72
-
73
- // Delete events
74
- wp_clear_scheduled_hook( 'wpstg_weekly_event' );
75
-
76
- }
77
- }
78
-
79
- /**
80
- * delete MuPlugin
81
- */
82
- private function deleteMuPlugin() {
83
- $optimizer = new Optimizer;
84
- $optimizer->unstallOptimizer();
85
- }
86
-
87
- }
88
-
89
- new uninstall();
1
+ <?php
2
+
3
+ namespace WPStaging\Backend;
4
+
5
+ use WPStaging\Backend\Optimizer\Optimizer;
6
+
7
+ /**
8
+ * Uninstall WP-Staging
9
+ *
10
+ * @package WPSTG
11
+ * @subpackage Uninstall
12
+ * @copyright Copyright (c) 2015, René Hermenau
13
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
14
+ * @since 0.9.0
15
+ */
16
+ // No direct access
17
+ if( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
18
+ exit;
19
+ }
20
+
21
+ class uninstall {
22
+
23
+ public function __construct() {
24
+
25
+ // Plugin Folder Path
26
+ if( !defined( 'WPSTG_PLUGIN_DIR' ) ) {
27
+ define( 'WPSTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
28
+ }
29
+
30
+ /**
31
+ * Path to main WP Staging class
32
+ * Make sure to not redeclare class in case free version has been installed previosly
33
+ */
34
+ if( !class_exists( 'WPStaging\WPStaging' ) ) {
35
+ require_once plugin_dir_path( __FILE__ ) . "apps/Core/WPStaging.php";
36
+ }
37
+ $wpStaging = \WPStaging\WPStaging::getInstance();
38
+
39
+ // Delete our must use plugin
40
+ $this->deleteMuPlugin();
41
+
42
+ $this->init();
43
+ }
44
+
45
+ private function init() {
46
+ $options = json_decode( json_encode( get_option( "wpstg_settings", array() ) ) );
47
+
48
+ if( isset( $options->unInstallOnDelete ) && '1' === $options->unInstallOnDelete ) {
49
+ // Delete options
50
+ delete_option( "wpstg_version_upgraded_from" );
51
+ delete_option( "wpstg_version" );
52
+ delete_option( "wpstg_installDate" );
53
+ delete_option( "wpstg_firsttime" );
54
+ delete_option( "wpstg_is_staging_site" );
55
+ delete_option( "wpstg_settings" );
56
+
57
+ /* Do not delete these fields without actually deleting the staging site
58
+ * @create a delete routine which deletes the staging sites first
59
+ */
60
+ //delete_option( "wpstg_existing_clones" );
61
+ //delete_option( "wpstg_existing_clones_beta" );
62
+
63
+ // Old wpstg 1.3 options for admin notices
64
+ delete_option( "wpstg_start_poll" );
65
+ delete_option( "wpstg_hide_beta" );
66
+ delete_option( "wpstg_RatingDiv" );
67
+
68
+ // New 2.x options for admin notices
69
+ delete_option( "wpstg_poll" );
70
+ delete_option( "wpstg_rating" );
71
+ delete_option( "wpstg_beta" );
72
+
73
+ // Delete events
74
+ wp_clear_scheduled_hook( 'wpstg_weekly_event' );
75
+
76
+ }
77
+ }
78
+
79
+ /**
80
+ * delete MuPlugin
81
+ */
82
+ private function deleteMuPlugin() {
83
+ $optimizer = new Optimizer;
84
+ $optimizer->unstallOptimizer();
85
+ }
86
+
87
+ }
88
+
89
+ new uninstall();
wp-staging.php CHANGED
@@ -1,80 +1,80 @@
1
- <?php
2
-
3
- /**
4
- * Plugin Name: WP Staging
5
- * Plugin URI: https://wordpress.org/plugins/wp-staging
6
- * Description: Create a staging clone site for testing & developing
7
- * Author: WP-Staging, René Hermenau, Ilgıt Yıldırım
8
- * Author URI: https://wordpress.org/plugins/wp-staging
9
- * Version: 2.0.4
10
- * Text Domain: wpstg
11
- * Domain Path: /languages/
12
-
13
- *
14
- * WP-Staging is free software: you can redistribute it and/or modify
15
- * it under the terms of the GNU General Public License as published by
16
- * the Free Software Foundation, either version 2 of the License, or
17
- * any later version.
18
- *
19
- * WP-Staging is distributed in the hope that it will be useful,
20
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- * GNU General Public License for more details.
23
- *
24
- * You should have received a copy of the GNU General Public License
25
- * along with Staging. If not, see <http://www.gnu.org/licenses/>.
26
- *
27
- * @package WPSTG
28
- * @category Core
29
- * @author René Hermenau, Ilgıt Yıldırım
30
- */
31
-
32
- // No Direct Access
33
- if (!defined("WPINC"))
34
- {
35
- die;
36
- }
37
-
38
- // Plugin Folder Path
39
- if( !defined( 'WPSTG_PLUGIN_DIR' ) ) {
40
- define( 'WPSTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
41
- }
42
- // Plugin Folder URL
43
- if( !defined( 'WPSTG_PLUGIN_URL' ) ) {
44
- define( 'WPSTG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
45
- }
46
-
47
- //require_once WPSTG_PLUGIN_DIR . 'apps/Backend/Install/install.php';
48
-
49
- /**
50
- * Path to main WP Staging class
51
- * Make sure to not redeclare class in case free version has been installed previosly
52
- */
53
- if (!class_exists( 'WPStaging\WPStaging' )){
54
- require_once plugin_dir_path(__FILE__) . "apps/Core/WPStaging.php";
55
- }
56
-
57
- $wpStaging = \WPStaging\WPStaging::getInstance();
58
-
59
- /**
60
- * Load a few important WP globals into WPStaging class to make them available via dependancy injection
61
- */
62
-
63
- // Wordpress DB Object
64
- if (isset($wpdb))
65
- {
66
- $wpStaging->set("wpdb", $wpdb);
67
- }
68
-
69
- // WordPress Filter Object
70
- if (isset($wp_filter))
71
- {
72
- $wpStaging->set("wp_filter", function() use(&$wp_filter) {
73
- return $wp_filter;
74
- });
75
- }
76
-
77
- /**
78
- * Inititalize WPStaging
79
- */
80
- $wpStaging->run();
1
+ <?php
2
+
3
+ /**
4
+ * Plugin Name: WP Staging
5
+ * Plugin URI: https://wordpress.org/plugins/wp-staging
6
+ * Description: Create a staging clone site for testing & developing
7
+ * Author: WP-Staging, René Hermenau, Ilgıt Yıldırım
8
+ * Author URI: https://wordpress.org/plugins/wp-staging
9
+ * Version: 2.0.5
10
+ * Text Domain: wpstg
11
+ * Domain Path: /languages/
12
+
13
+ *
14
+ * WP-Staging is free software: you can redistribute it and/or modify
15
+ * it under the terms of the GNU General Public License as published by
16
+ * the Free Software Foundation, either version 2 of the License, or
17
+ * any later version.
18
+ *
19
+ * WP-Staging is distributed in the hope that it will be useful,
20
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ * GNU General Public License for more details.
23
+ *
24
+ * You should have received a copy of the GNU General Public License
25
+ * along with Staging. If not, see <http://www.gnu.org/licenses/>.
26
+ *
27
+ * @package WPSTG
28
+ * @category Core
29
+ * @author René Hermenau, Ilgıt Yıldırım
30
+ */
31
+
32
+ // No Direct Access
33
+ if (!defined("WPINC"))
34
+ {
35
+ die;
36
+ }
37
+
38
+ // Plugin Folder Path
39
+ if( !defined( 'WPSTG_PLUGIN_DIR' ) ) {
40
+ define( 'WPSTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
41
+ }
42
+ // Plugin Folder URL
43
+ if( !defined( 'WPSTG_PLUGIN_URL' ) ) {
44
+ define( 'WPSTG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
45
+ }
46
+
47
+ //require_once WPSTG_PLUGIN_DIR . 'apps/Backend/Install/install.php';
48
+
49
+ /**
50
+ * Path to main WP Staging class
51
+ * Make sure to not redeclare class in case free version has been installed previosly
52
+ */
53
+ if (!class_exists( 'WPStaging\WPStaging' )){
54
+ require_once plugin_dir_path(__FILE__) . "apps/Core/WPStaging.php";
55
+ }
56
+
57
+ $wpStaging = \WPStaging\WPStaging::getInstance();
58
+
59
+ /**
60
+ * Load a few important WP globals into WPStaging class to make them available via dependancy injection
61
+ */
62
+
63
+ // Wordpress DB Object
64
+ if (isset($wpdb))
65
+ {
66
+ $wpStaging->set("wpdb", $wpdb);
67
+ }
68
+
69
+ // WordPress Filter Object
70
+ if (isset($wp_filter))
71
+ {
72
+ $wpStaging->set("wp_filter", function() use(&$wp_filter) {
73
+ return $wp_filter;
74
+ });
75
+ }
76
+
77
+ /**
78
+ * Inititalize WPStaging
79
+ */
80
+ $wpStaging->run();