Backup and Restore WordPress – WPBackItUp Backup Plugin - Version 1.1.4

Version Description

Download this release

Release Info

Developer jcpeden
Plugin Icon 128x128 Backup and Restore WordPress – WPBackItUp Backup Plugin
Version 1.1.4
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.4

backups/WP Backitup-Export-2013-02-13-0921.zip ADDED
Binary file
backups/status.log CHANGED
@@ -1 +1 @@
1
- <ul><li>Uploading restoration file...Done!</li><li>Unzipping...Done!</li><li>Validating zip...Done!</li><li>Restoring wp-content directory...Done!</li><li>Restoring database...Done!</li><li>Restoration complete. Please refresh the page.</li></ul>
1
+ <ul><li>Creating backup directory...Done!</li><li>Backing up your files...Done!</li><li>Backing up your database...Done!</li><li>Creating backup zip...Done!</li><li>Backup file created successfully. You can download your backup file using the link above.</li></ul>
css/admin-style.css DELETED
@@ -1,63 +0,0 @@
1
- /* WP Backitup CSS */
2
-
3
- .error { color: #ff0000;}
4
-
5
- p {
6
- line-height: 1.4em;
7
- }
8
-
9
- #content {
10
- float: left;
11
- width: 65%;
12
- }
13
-
14
- #sidebar {
15
- float: right;
16
- width: 30%;
17
- }
18
-
19
- .widget {
20
- padding: 1em;
21
- }
22
-
23
- input {padding: 0;}
24
-
25
- h3 {
26
- margin: 0;
27
- padding: 1em 0 0 0;
28
- }
29
-
30
- ul {padding: 1em 0 0 0;}
31
-
32
- iframe {
33
- height: 0;
34
- margin: 0;
35
- padding: 0;
36
- position: absolute;
37
- top: 0;
38
- right: 0;
39
- width: 0;
40
- }
41
-
42
- .wp-backitup-section {
43
- border-bottom: 1px solid #ddd;
44
- clear:both;
45
- }
46
-
47
- #backup-button, #restore-form {
48
- float: left;
49
- margin: 0 5px 5px 0;
50
- }
51
-
52
- .status-icon {
53
- display: inline;
54
- height: 16px;
55
- visibility: hidden;
56
- width: 16px;
57
- }
58
-
59
- .status-icon img {margin-top: 3px;}
60
-
61
- #restore_form {margin-right: 5px;}
62
-
63
- #restore-button {margin-top: 22px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/admin.css ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.1.4
5
+ * @since 1.1.4
6
+ */
7
+
8
+ /* Global */
9
+ .error { color: #ff0000;}
10
+
11
+ p {line-height: 1.4em;}
12
+
13
+ ul {padding: 1em 0 0 0;}
14
+
15
+ h3 {
16
+ margin: 0;
17
+ padding: 1em 0 0 0;
18
+ }
19
+
20
+ iframe {
21
+ height: 0;
22
+ margin: 0;
23
+ padding: 0;
24
+ position: absolute;
25
+ top: 0;
26
+ right: 0;
27
+ width: 0;
28
+ z-index: -10;
29
+ }
30
+
31
+ .submit {
32
+ padding: 0;
33
+ }
34
+
35
+ /* Content */
36
+ #content {
37
+ float: left;
38
+ width: 65%;
39
+ }
40
+
41
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
42
+
43
+ .status-icon {
44
+ display: inline;
45
+ height: 16px;
46
+ position: relative;
47
+ top: 3px;
48
+ left: 5px;
49
+ visibility: hidden;
50
+ width: 16px;
51
+ }
52
+
53
+ /* Sidebar */
54
+ #sidebar {
55
+ float: right;
56
+ width: 30%;
57
+ }
58
+
59
+ .widget {padding: 1em;}
css/wp-backitup.css DELETED
@@ -1,63 +0,0 @@
1
- /* WP Backitup CSS */
2
-
3
- .error { color: #ff0000;}
4
-
5
- p {
6
- line-height: 1.4em;
7
- }
8
-
9
- #content {
10
- float: left;
11
- width: 65%;
12
- }
13
-
14
- #sidebar {
15
- float: right;
16
- width: 30%;
17
- }
18
-
19
- .widget {
20
- padding: 1em;
21
- }
22
-
23
- input {padding: 0;}
24
-
25
- h3 {
26
- margin: 0;
27
- padding: 1em 0 0 0;
28
- }
29
-
30
- ul {padding: 1em 0 0 0;}
31
-
32
- iframe {
33
- height: 0;
34
- margin: 0;
35
- padding: 0;
36
- position: absolute;
37
- top: 0;
38
- right: 0;
39
- width: 0;
40
- }
41
-
42
- .wp-backitup-section {
43
- border-bottom: 1px solid #ddd;
44
- clear:both;
45
- }
46
-
47
- #backup-button, #restore-form {
48
- float: left;
49
- margin: 0 5px 5px 0;
50
- }
51
-
52
- .status-icon {
53
- display: inline;
54
- height: 16px;
55
- visibility: hidden;
56
- width: 16px;
57
- }
58
-
59
- .status-icon img {margin-top: 3px;}
60
-
61
- #restore_form {margin-right: 5px;}
62
-
63
- #restore-button {margin-top: 22px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin_page.php DELETED
@@ -1 +0,0 @@
1
- <?php
 
includes/download.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- //Define variables
3
- $wp_backitup_path = dirname(dirname(__FILE__));
4
- $wp_content_dirname = basename(dirname(dirname(dirname(dirname(__FILE__)))));
5
- $wp_backitup_dirname = basename($wp_backitup_path);
6
-
7
- //build download link
8
- if(glob($wp_backitup_path . "/backups/*.zip")) {
9
- echo '<ul>';
10
- foreach (glob($wp_backitup_path . "/backups/*.zip") as $file) {
11
- $filename = basename($file);
12
- echo '<li>Download most recent export file: <a href="' .site_url() .'/' .$wp_content_dirname .'/' .'plugins/' .$wp_backitup_dirname. '/backups/' .$filename .'">' .$filename .'</a></li>';
13
- }
14
- echo '</ul>';
15
- } else {
16
- echo '<p>No export file available for download. Please create one.</p>';
17
- }
18
- die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.php ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Lite
4
+ *
5
+ * @package WPBackitup Lite
6
+ *
7
+ * @global object $wpdb
8
+ *
9
+ * @author jcpeden
10
+ * @version 1.1.4
11
+ */
12
+ /*
13
+ Plugin Name: WP Backitup Lite
14
+ Plugin URI: http://www.wpbackitup.com
15
+ Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
16
+ Version: 1.1.4
17
+ Author: John Peden
18
+ Author URI: http://www.johncpeden.com
19
+ License: GPL3
20
+
21
+ Copyright 2012-2013 John Peden (email : support@wpbackitup.com)
22
+
23
+ This program is free software: you can redistribute it and/or modify
24
+ it under the terms of the GNU General Public License as published by
25
+ the Free Software Foundation, either version 3 of the License, or
26
+ (at your option) any later version.
27
+
28
+ This program is distributed in the hope that it will be useful,
29
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
30
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31
+ GNU General Public License for more details.
32
+
33
+ You should have received a copy of the GNU General Public License
34
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
35
+ */
36
+
37
+ // Include constants file
38
+ require_once( dirname( __FILE__ ) . '/lib/constants.php' );
39
+
40
+ class WPBackitup {
41
+ var $namespace = "wp-backitup-lite";
42
+ var $friendly_name = "WP Backitup Lite";
43
+ var $version = "1.1.3";
44
+
45
+ // Default plugin options
46
+ var $defaults = array(
47
+ 'presstrends' => "enabled"
48
+ );
49
+
50
+ /**
51
+ * Instantiation construction
52
+ *
53
+ * @uses add_action()
54
+ * @uses WPBackitup::wp_register_scripts()
55
+ * @uses WPBackitup::wp_register_styles()
56
+ */
57
+ function __construct() {
58
+ // Name of the option_value to store plugin options in
59
+ $this->option_name = '_' . $this->namespace . '--options';
60
+
61
+ // Load all library files used by this plugin
62
+ $libs = glob( WPBACKITUP_DIRNAME . '/lib/*.php' );
63
+ foreach( $libs as $lib ) {
64
+ include_once( $lib );
65
+ }
66
+
67
+ /**
68
+ * Make this plugin available for translation.
69
+ * Translations can be added to the /languages/ directory.
70
+ */
71
+ load_theme_textdomain( $this->namespace, WPBACKITUP_DIRNAME . '/languages' );
72
+
73
+ // Add all action, filter and shortcode hooks
74
+ $this->_add_hooks();
75
+ }
76
+
77
+ /**
78
+ * Add in various hooks
79
+ *
80
+ * Place all add_action, add_filter, add_shortcode hook-ins here
81
+ */
82
+ private function _add_hooks() {
83
+ // Options page for configuration
84
+ add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
85
+ // Route requests for form processing
86
+ add_action( 'init', array( &$this, 'route' ) );
87
+
88
+ // Add a settings link next to the "Deactivate" link on the plugin listing page
89
+ add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
90
+
91
+ // Register all JavaScripts for this plugin
92
+ add_action( 'init', array( &$this, 'wp_register_scripts' ), 1 );
93
+ // Register all Stylesheets for this plugin
94
+ add_action( 'init', array( &$this, 'wp_register_styles' ), 1 );
95
+ }
96
+
97
+ /**
98
+ * Process update page form submissions
99
+ *
100
+ * @uses WPBackitup::sanitize()
101
+ * @uses wp_redirect()
102
+ * @uses wp_verify_nonce()
103
+ */
104
+ private function _admin_options_update() {
105
+ // Verify submission for processing using wp_nonce
106
+ if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-update-options" ) ) {
107
+ $data = array();
108
+ /**
109
+ * Loop through each POSTed value and sanitize it to protect against malicious code. Please
110
+ * note that rich text (or full HTML fields) should not be processed by this function and
111
+ * dealt with directly.
112
+ */
113
+ foreach( $_POST['data'] as $key => $val ) {
114
+ $data[$key] = $this->_sanitize( $val );
115
+ }
116
+
117
+ /**
118
+ * Place your options processing and storage code here
119
+ */
120
+
121
+ // Update the options value with the data submitted
122
+ update_option( $this->option_name, $data );
123
+
124
+ // Redirect back to the options page with the message flag to show the saved message
125
+ wp_safe_redirect( $_REQUEST['_wp_http_referer'] . '&message=1' );
126
+ exit;
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Sanitize data
132
+ *
133
+ * @param mixed $str The data to be sanitized
134
+ *
135
+ * @uses wp_kses()
136
+ *
137
+ * @return mixed The sanitized version of the data
138
+ */
139
+ private function _sanitize( $str ) {
140
+ if ( !function_exists( 'wp_kses' ) ) {
141
+ require_once( ABSPATH . 'wp-includes/kses.php' );
142
+ }
143
+ global $allowedposttags;
144
+ global $allowedprotocols;
145
+
146
+ if ( is_string( $str ) ) {
147
+ $str = wp_kses( $str, $allowedposttags, $allowedprotocols );
148
+ } elseif( is_array( $str ) ) {
149
+ $arr = array();
150
+ foreach( (array) $str as $key => $val ) {
151
+ $arr[$key] = $this->_sanitize( $val );
152
+ }
153
+ $str = $arr;
154
+ }
155
+
156
+ return $str;
157
+ }
158
+
159
+ /**
160
+ * Hook into register_activation_hook action
161
+ *
162
+ * Put code here that needs to happen when your plugin is first activated (database
163
+ * creation, permalink additions, etc.)
164
+ */
165
+ static function activate() {
166
+ // Do activation actions
167
+ }
168
+
169
+ /**
170
+ * Define the admin menu options for this plugin
171
+ *
172
+ * @uses add_action()
173
+ * @uses add_options_page()
174
+ */
175
+ function admin_menu() {
176
+ $page_hook = add_menu_page( $this->friendly_name, $this->friendly_name, 'administrator', $this->namespace, array( &$this, 'admin_options_page' ), WPBACKITUP_URLPATH .'/images/icon.png', 77);
177
+
178
+ // Add print scripts and styles action based off the option page hook
179
+ add_action( 'admin_print_scripts-' . $page_hook, array( &$this, 'admin_print_scripts' ) );
180
+ add_action( 'admin_print_styles-' . $page_hook, array( &$this, 'admin_print_styles' ) );
181
+ }
182
+
183
+
184
+ /**
185
+ * The admin section options page rendering method
186
+ *
187
+ * @uses current_user_can()
188
+ * @uses wp_die()
189
+ */
190
+ function admin_options_page() {
191
+ if( !current_user_can( 'manage_options' ) ) {
192
+ wp_die( 'You do not have sufficient permissions to access this page' );
193
+ }
194
+
195
+ $page_title = $this->friendly_name . ' Options';
196
+ $namespace = $this->namespace;
197
+
198
+ include( WPBACKITUP_DIRNAME . "/views/options.php" );
199
+ }
200
+
201
+ /**
202
+ * Load JavaScript for the admin options page
203
+ *
204
+ * @uses wp_enqueue_script()
205
+ */
206
+ function admin_print_scripts() {
207
+ wp_enqueue_script( "{$this->namespace}-admin" );
208
+ }
209
+
210
+ /**
211
+ * Load Stylesheet for the admin options page
212
+ *
213
+ * @uses wp_enqueue_style()
214
+ */
215
+ function admin_print_styles() {
216
+ wp_enqueue_style( "{$this->namespace}-admin" );
217
+ }
218
+
219
+ /**
220
+ * Hook into register_deactivation_hook action
221
+ *
222
+ * Put code here that needs to happen when your plugin is deactivated
223
+ */
224
+ static function deactivate() {
225
+ // Do deactivation actions
226
+ }
227
+
228
+ /**
229
+ * Retrieve the stored plugin option or the default if no user specified value is defined
230
+ *
231
+ * @param string $option_name The name of the TrialAccount option you wish to retrieve
232
+ *
233
+ * @uses get_option()
234
+ *
235
+ * @return mixed Returns the option value or false(boolean) if the option is not found
236
+ */
237
+ function get_option( $option_name ) {
238
+ // Load option values if they haven't been loaded already
239
+ if( !isset( $this->options ) || empty( $this->options ) ) {
240
+ $this->options = get_option( $this->option_name, $this->defaults );
241
+ }
242
+
243
+ if( isset( $this->options[$option_name] ) ) {
244
+ return $this->options[$option_name]; // Return user's specified option value
245
+ } elseif( isset( $this->defaults[$option_name] ) ) {
246
+ return $this->defaults[$option_name]; // Return default option value
247
+ }
248
+ return false;
249
+ }
250
+
251
+ /**
252
+ * Initialization function to hook into the WordPress init action
253
+ *
254
+ * Instantiates the class on a global variable and sets the class, actions
255
+ * etc. up for use.
256
+ */
257
+ static function instance() {
258
+ global $WPBackitup;
259
+
260
+ // Only instantiate the Class if it hasn't been already
261
+ if( !isset( $WPBackitup ) ) $WPBackitup = new WPBackitup();
262
+ }
263
+
264
+ /**
265
+ * Hook into plugin_action_links filter
266
+ *
267
+ * Adds a "Settings" link next to the "Deactivate" link in the plugin listing page
268
+ * when the plugin is active.
269
+ *
270
+ * @param object $links An array of the links to show, this will be the modified variable
271
+ * @param string $file The name of the file being processed in the filter
272
+ */
273
+ function plugin_action_links( $links, $file ) {
274
+ if( $file == plugin_basename( WPBACKITUP_DIRNAME . '/' . basename( __FILE__ ) ) ) {
275
+ $old_links = $links;
276
+ $new_links = array(
277
+ "settings" => '<a href="options-general.php?page=' . $this->namespace . '">' . __( 'Settings' ) . '</a>'
278
+ );
279
+ $links = array_merge( $new_links, $old_links );
280
+ }
281
+
282
+ return $links;
283
+ }
284
+
285
+ /**
286
+ * Route the user based off of environment conditions
287
+ *
288
+ * This function will handling routing of form submissions to the appropriate
289
+ * form processor.
290
+ *
291
+ * @uses WPBackitup::_admin_options_update()
292
+ */
293
+ function route() {
294
+ $uri = $_SERVER['REQUEST_URI'];
295
+ $protocol = isset( $_SERVER['HTTPS'] ) ? 'https' : 'http';
296
+ $hostname = $_SERVER['HTTP_HOST'];
297
+ $url = "{$protocol}://{$hostname}{$uri}";
298
+ $is_post = (bool) ( strtoupper( $_SERVER['REQUEST_METHOD'] ) == "POST" );
299
+
300
+ // Check if a nonce was passed in the request
301
+ if( isset( $_REQUEST['_wpnonce'] ) ) {
302
+ $nonce = $_REQUEST['_wpnonce'];
303
+
304
+ // Handle POST requests
305
+ if( $is_post ) {
306
+ if( wp_verify_nonce( $nonce, "{$this->namespace}-update-options" ) ) {
307
+ $this->_admin_options_update();
308
+ }
309
+ }
310
+ // Handle GET requests
311
+ else {
312
+
313
+ }
314
+ }
315
+ }
316
+
317
+ /**
318
+ * Register scripts used by this plugin for enqueuing elsewhere
319
+ *
320
+ * @uses wp_register_script()
321
+ */
322
+ function wp_register_scripts() {
323
+ // Admin JavaScript
324
+ wp_register_script( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/js/admin.js", array( 'jquery' ), $this->version, true );
325
+ }
326
+
327
+ /**
328
+ * Register styles used by this plugin for enqueuing elsewhere
329
+ *
330
+ * @uses wp_register_style()
331
+ */
332
+ function wp_register_styles() {
333
+ // Admin Stylesheet
334
+ wp_register_style( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/css/admin.css", array(), $this->version, 'screen' );
335
+ }
336
+ }
337
+ if( !isset( $WPBackitup ) ) {
338
+ WPBackitup::instance();
339
+ }
340
+
341
+ register_activation_hook( __FILE__, array( 'WPBackitup', 'activate' ) );
342
+ register_deactivation_hook( __FILE__, array( 'WPBackitup', 'deactivate' ) );
js/admin.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.1.4
5
+ * @since 1.1.4
6
+ */
7
+
8
+ (function($){
9
+ //define backup variables
10
+ var backup = {
11
+ action: 'backup',
12
+ beforeSend: function() {
13
+ $('.backup-icon').css('visibility','visible');
14
+ $("#status").empty();
15
+ setInterval(display_log, 1000);
16
+ }
17
+ };
18
+ //define download variables
19
+ var download = {
20
+ action: 'download'
21
+ };
22
+ //define logreader variables
23
+ var logreader = {
24
+ action: 'logreader'
25
+ };
26
+ //define logreader function
27
+ function display_log() {
28
+ $.post(ajaxurl, logreader, function(response) {
29
+ $("#status").html(response);
30
+ });
31
+ }
32
+ //define download function
33
+ function download_link() {
34
+ $.post(ajaxurl, download, function(response) {
35
+ $("#download-link").html(response);
36
+ });
37
+ }
38
+
39
+ //execute download (on page load/refresh)
40
+ download_link();
41
+
42
+ //execute backup on button click
43
+ $(".backup-button").click( function() {
44
+ $.post(ajaxurl, backup, function(response) {
45
+ download_link();
46
+ clearInterval(display_log);
47
+ $('.backup-icon').fadeOut(1000);
48
+ $("#php").html(response); //Return PHP messages, used for development
49
+ });
50
+ })
51
+ //execute restore on button click
52
+ $("#restore-form").submit(function() {
53
+ $('.restore-icon').css('visibility','visible');
54
+ $("#status").empty();
55
+ setInterval(display_log, 1000);
56
+ $("#restore-form").attr("target","upload_target");
57
+ $("#upload_target").load(function (){
58
+ importRestore();
59
+ });
60
+ });
61
+
62
+ //define importRestore function
63
+ function importRestore() {
64
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; //process upload
65
+ $("#php").html(ret); //Return PHP messages, used for development
66
+ clearInterval(display_log);
67
+ $('.restore-icon').fadeOut(1000);
68
+ }
69
+ })(jQuery);
js/wp-backitup.js DELETED
@@ -1,69 +0,0 @@
1
- jQuery(document).ready(function($) {
2
-
3
- //define backup variables
4
- var wpBackitupBackup = {
5
- action: 'wpbackitup_backup',
6
- beforeSend: function() {
7
- $('#wp-backitup-backup .status-icon').css('visibility','visible');
8
- $("#wp-backitup-status").empty();
9
- setInterval(logreader, 1000);
10
- }
11
- };
12
-
13
- //define download variables
14
- var wpBackitupDownload = {
15
- action: 'wpbackitup_download'
16
- };
17
-
18
- //define logreader variables
19
- var wpBackitupLogReader = {
20
- action: 'wpbackitup_logreader'
21
- };
22
-
23
- //define logreader function
24
- function logreader() {
25
- $.post(ajaxurl, wpBackitupLogReader, function(response) {
26
- $("#wp-backitup-status").html(response);
27
- });
28
- }
29
-
30
- //define download function
31
- function download() {
32
- $.post(ajaxurl, wpBackitupDownload, function(response) {
33
- $("#wp-backitup-download-status").html(response);
34
- });
35
- }
36
-
37
- //execute download (on page load/refresh)
38
- download();
39
-
40
- //execute backup on button click
41
- $("#wpBackitupBackup").click( function() {
42
- $.post(ajaxurl, wpBackitupBackup, function(response) {
43
- download(); //Build download link
44
- clearInterval(logreader); //Stop checking for status updates
45
- $('#wp-backitup-backup .status-icon').fadeOut(1000); //Fade process indicator
46
- $("#wp-backitup-php").html(response); //Return PHP messages, used for development
47
- });
48
- })
49
-
50
- //execture restore on button click
51
- $("#restore-form").submit(function() {
52
- $('#wp-backitup-restore .status-icon').css('visibility','visible'); //display process icon
53
- $("#wp-backitup-status").empty(); //clear status messages
54
- setInterval(logreader, 1000); //check for status updates every second
55
- $("#restore-form").attr("target","upload_target"); //specify target for form submission
56
- $("#upload_target").load(function (){
57
- importRestore(); //on iframe load, run restore function
58
- });
59
- });
60
-
61
- //define importRestore function
62
- function importRestore() {
63
- var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; //process upload
64
- $("#wp-backitup-php").html(ret); //Return PHP messages, used for development
65
- download(); //Create download link
66
- clearInterval(logreader); //Stop checking for status messages
67
- $('#wp-backitup-restore .status-icon').fadeOut(1000); //hide process icon
68
- }
69
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/constants.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WPBackitup
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.1.4
9
+ * @since 1.1.3
10
+ */
11
+
12
+ // The current version of this plugin
13
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.1.3' );
14
+
15
+ // The directory the plugin resides in
16
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
17
+
18
+ // The URL path of this plugin
19
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
20
+
21
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
{includes → lib}/functions.php RENAMED
@@ -1,145 +1,251 @@
1
- <?php //Define the create_dir function
2
- if(!function_exists('create_dir')) {
3
- function create_dir($dir) {
4
- if( !is_dir($dir) ) {
5
- @mkdir($dir, 0755);
6
- }
7
- return true;
8
- }
9
- }
10
-
11
- //Define recusive_copy function
12
- if(!function_exists('recursive_copy')) {
13
- function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
14
- if( is_dir($dir) ) { //If the directory exists
15
- if ($dh = opendir($dir) ) {
16
- while(($file = readdir($dh)) !== false) { //While there are files in the directory
17
- if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
18
- if (!is_dir( $dir.$file ) ) {
19
- //Copy files to destination directory
20
- $fsrc = fopen($dir .$file,'r');
21
- $fdest = fopen($target_path .$file,'w+');
22
- $len = stream_copy_to_stream($fsrc,$fdest);
23
- fclose($fsrc);
24
- fclose($fdest);
25
- } else { //If $file is a directory
26
- $destdir = $target_path .$file; //Modify the destination dir
27
- if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
28
- @mkdir($destdir, 0755);
29
- }
30
- recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
31
- }
32
- }
33
- }
34
- closedir($dh);
35
- }
36
- }
37
- return true;
38
- }
39
- }
40
-
41
- //Define DB backup function
42
- if(!function_exists('db_backup')) {
43
- function db_backup($path) {
44
- global $wpdb;
45
- $row = $wpdb->get_results('SHOW TABLES', ARRAY_N);
46
- $tables = array();
47
- foreach($row as $value) {
48
- $tables[] = $value[0];
49
- }
50
- $handle = fopen($path .'db-backup.sql', 'w+');
51
- foreach($tables as $table) {
52
- $result = $wpdb->get_results('SELECT * FROM '.$table,ARRAY_N);
53
- $testing = $wpdb->get_row('SELECT * FROM '.$table,ARRAY_N);
54
- $num_fields=count($testing);
55
- $return = '';
56
- $return.= 'DROP TABLE IF EXISTS '.$table.';';
57
- $row2 = $wpdb->get_row('SHOW CREATE TABLE '.$table,ARRAY_N);
58
- $return.= "\n\n".$row2[1].";\n\n";
59
- foreach($result as $row) {
60
- $return.= 'INSERT INTO '.$table.' VALUES(';
61
- for($j=0; $j<$num_fields; $j++) {
62
- $row[$j] = addslashes($row[$j]);
63
- $row[$j] = ereg_replace("\n", "\\n",$row[$j]);
64
- if (isset($row[$j])) {
65
- $return .= '"' .$row[$j] .'"';
66
- } else {
67
- $return .= '"';
68
- }
69
- if ($j<($num_fields-1)) { $return.= ', '; }
70
- }
71
- $return.= ");\n";
72
- }
73
- $return.="\n\n\n";
74
- fwrite($handle, $return);
75
- }
76
- fclose($handle);
77
- return true;
78
- }
79
- }
80
-
81
- //Define the create_siteinfo function
82
- if(!function_exists('create_siteinfo')) {
83
- function create_siteinfo($path, $table_prefix) {
84
- $siteinfo = $path ."backupsiteinfo.txt";
85
- $handle = fopen($siteinfo, 'w+');
86
- $entry = site_url( '/' ) ."\n$table_prefix";
87
- fwrite($handle, $entry);
88
- fclose($handle);
89
- return true;
90
- }
91
- }
92
-
93
- //Define recursive_delete function
94
- if(!function_exists('recursive_delete')){
95
- function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
96
- if( is_dir($dir) ){
97
- if($dh = opendir($dir)) {
98
- while( ($file = readdir($dh)) !== false ) {
99
- if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
100
- if(!is_dir($dir .'/'. $file)) {
101
- unlink($dir .'/'. $file);
102
- } else {
103
- recursive_delete($dir.'/'. $file, $ignore);
104
- }
105
- }
106
- }
107
- }
108
- @rmdir($dir);
109
- closedir($dh);
110
- }
111
- return true;
112
- }
113
- }
114
-
115
- //Define zip function
116
- function zip($source, $destination, $ignore) {
117
- if (is_string($source)) $source_arr = array($source); // convert it to array
118
- if (!extension_loaded('zip')) {
119
- return false;
120
- }
121
- $zip = new ZipArchive();
122
- if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
123
- return false;
124
- }
125
- foreach ($source_arr as $source) {
126
- if (!file_exists($source)) continue;
127
- $source = str_replace('\\', '/', realpath($source));
128
- if (is_dir($source) === true) {
129
- $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
130
- foreach ($files as $file) {
131
- if (!preg_match($ignore, $file)) {
132
- $file = str_replace('\\', '/', realpath($file));
133
- if (is_dir($file) === true) {
134
- $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
135
- } else if (is_file($file) === true) {
136
- $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
137
- }
138
- }
139
- }
140
- } else if (is_file($source) === true) {
141
- $zip->addFromString(basename($source), file_get_contents($source));
142
- }
143
- }
144
- return $zip->close();
145
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup Lite
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.1.4
9
+ * @since 1.1.3
10
+ */
11
+
12
+ //load backup function
13
+ function backup() {
14
+ include_once 'includes/backup.php';
15
+ }
16
+ add_action('wp_ajax_backup', 'backup');
17
+
18
+ //load download function
19
+ function download() {
20
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
21
+ echo '<ul>';
22
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
23
+ $filename = basename($file);
24
+ echo '<li>Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a></li>';
25
+ }
26
+ echo '</ul>';
27
+ } else {
28
+ echo '<p>No export file available for download. Please create one.</p>';
29
+ }
30
+ die();
31
+ }
32
+ add_action('wp_ajax_download', 'download');
33
+
34
+ //load logreader function
35
+ function logreader() {
36
+ $log = WPBACKITUP_DIRNAME .'/backups/status.log';
37
+ if(file_exists($log) ) {
38
+ readfile($log);
39
+ }
40
+ die();
41
+ }
42
+ add_action('wp_ajax_logreader', 'logreader');
43
+
44
+ //define create_dir function
45
+ if(!function_exists('create_dir')) {
46
+ function create_dir($dir) {
47
+ if( !is_dir($dir) ) {
48
+ @mkdir($dir, 0755);
49
+ }
50
+ return true;
51
+ }
52
+ }
53
+
54
+ //Define recusive_copy function
55
+ if(!function_exists('recursive_copy')) {
56
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
57
+ if( is_dir($dir) ) { //If the directory exists
58
+ if ($dh = opendir($dir) ) {
59
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
60
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
61
+ if (!is_dir( $dir.$file ) ) {
62
+ //Copy files to destination directory
63
+ $fsrc = fopen($dir .$file,'r');
64
+ $fdest = fopen($target_path .$file,'w+');
65
+ $len = stream_copy_to_stream($fsrc,$fdest);
66
+ fclose($fsrc);
67
+ fclose($fdest);
68
+ } else { //If $file is a directory
69
+ $destdir = $target_path .$file; //Modify the destination dir
70
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
71
+ @mkdir($destdir, 0755);
72
+ }
73
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
74
+ }
75
+ }
76
+ }
77
+ closedir($dh);
78
+ }
79
+ }
80
+ return true;
81
+ }
82
+ }
83
+
84
+ //Define DB backup function
85
+ if(!function_exists('db_backup')) {
86
+ function db_backup($path) {
87
+ global $wpdb;
88
+ $row = $wpdb->get_results('SHOW TABLES', ARRAY_N);
89
+ $tables = array();
90
+ foreach($row as $value) {
91
+ $tables[] = $value[0];
92
+ }
93
+ $handle = fopen($path .'db-backup.sql', 'w+');
94
+ foreach($tables as $table) {
95
+ $result = $wpdb->get_results('SELECT * FROM '.$table,ARRAY_N);
96
+ $testing = $wpdb->get_row('SELECT * FROM '.$table,ARRAY_N);
97
+ $num_fields=count($testing);
98
+ $return = '';
99
+ $return.= 'DROP TABLE IF EXISTS '.$table.';';
100
+ $row2 = $wpdb->get_row('SHOW CREATE TABLE '.$table,ARRAY_N);
101
+ $return.= "\n\n".$row2[1].";\n\n";
102
+ foreach($result as $row) {
103
+ $return.= 'INSERT INTO '.$table.' VALUES(';
104
+ for($j=0; $j<$num_fields; $j++) {
105
+ $row[$j] = addslashes($row[$j]);
106
+ $row[$j] = ereg_replace("\n", "\\n",$row[$j]);
107
+ if (isset($row[$j])) {
108
+ $return .= '"' .$row[$j] .'"';
109
+ } else {
110
+ $return .= '"';
111
+ }
112
+ if ($j<($num_fields-1)) { $return.= ', '; }
113
+ }
114
+ $return.= ");\n";
115
+ }
116
+ $return.="\n\n\n";
117
+ fwrite($handle, $return);
118
+ }
119
+ fclose($handle);
120
+ return true;
121
+ }
122
+ }
123
+
124
+ //Define the create_siteinfo function
125
+ if(!function_exists('create_siteinfo')) {
126
+ function create_siteinfo($path, $table_prefix) {
127
+ $siteinfo = $path ."backupsiteinfo.txt";
128
+ $handle = fopen($siteinfo, 'w+');
129
+ $entry = site_url( '/' ) ."\n$table_prefix";
130
+ fwrite($handle, $entry);
131
+ fclose($handle);
132
+ return true;
133
+ }
134
+ }
135
+
136
+ //Define recursive_delete function
137
+ if(!function_exists('recursive_delete')){
138
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
139
+ if( is_dir($dir) ){
140
+ if($dh = opendir($dir)) {
141
+ while( ($file = readdir($dh)) !== false ) {
142
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
143
+ if(!is_dir($dir .'/'. $file)) {
144
+ unlink($dir .'/'. $file);
145
+ } else {
146
+ recursive_delete($dir.'/'. $file, $ignore);
147
+ }
148
+ }
149
+ }
150
+ }
151
+ @rmdir($dir);
152
+ closedir($dh);
153
+ }
154
+ return true;
155
+ }
156
+ }
157
+
158
+ //Define zip function
159
+ function zip($source, $destination, $ignore) {
160
+ if (is_string($source)) $source_arr = array($source); // convert it to array
161
+ if (!extension_loaded('zip')) {
162
+ return false;
163
+ }
164
+ $zip = new ZipArchive();
165
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
166
+ return false;
167
+ }
168
+ foreach ($source_arr as $source) {
169
+ if (!file_exists($source)) continue;
170
+ $source = str_replace('\\', '/', realpath($source));
171
+ if (is_dir($source) === true) {
172
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
173
+ foreach ($files as $file) {
174
+ if (!preg_match($ignore, $file)) {
175
+ $file = str_replace('\\', '/', realpath($file));
176
+ if (is_dir($file) === true) {
177
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
178
+ } else if (is_file($file) === true) {
179
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
180
+ }
181
+ }
182
+ }
183
+ } else if (is_file($source) === true) {
184
+ $zip->addFromString(basename($source), file_get_contents($source));
185
+ }
186
+ }
187
+ return $zip->close();
188
+ }
189
+
190
+ //load presstrends
191
+ function load_presstrends() {
192
+ global $WPBackitup;
193
+ if($WPBackitup->get_option( 'presstrends' ) == 'enabled') {
194
+ // PressTrends Account API Key
195
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
196
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
197
+
198
+ // Start of Metrics
199
+ global $wpdb;
200
+ $data = get_transient( 'presstrends_cache_data' );
201
+ if ( !$data || $data == '' ) {
202
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
203
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
204
+
205
+ $count_posts = wp_count_posts();
206
+ $count_pages = wp_count_posts( 'page' );
207
+ $comments_count = wp_count_comments();
208
+
209
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
210
+ if ( function_exists( 'wp_get_theme' ) ) {
211
+ $theme_data = wp_get_theme();
212
+ $theme_name = urlencode( $theme_data->Name );
213
+ } else {
214
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
215
+ $theme_name = $theme_data['Name'];
216
+ }
217
+
218
+ $plugin_name = '&';
219
+ foreach ( get_plugins() as $plugin_info ) {
220
+ $plugin_name .= $plugin_info['Name'] . '&';
221
+ }
222
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
223
+ $plugin_data = get_plugin_data( __FILE__ );
224
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
225
+ $data = array(
226
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
227
+ 'posts' => $count_posts->publish,
228
+ 'pages' => $count_pages->publish,
229
+ 'comments' => $comments_count->total_comments,
230
+ 'approved' => $comments_count->approved,
231
+ 'spam' => $comments_count->spam,
232
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
233
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
234
+ 'theme_version' => $plugin_data['Version'],
235
+ 'theme_name' => $theme_name,
236
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
237
+ 'plugins' => count( get_option( 'active_plugins' ) ),
238
+ 'plugin' => urlencode( $plugin_name ),
239
+ 'wpversion' => get_bloginfo( 'version' ),
240
+ );
241
+
242
+ foreach ( $data as $k => $v ) {
243
+ $url .= $k . '/' . $v . '/';
244
+ }
245
+ wp_remote_get( $url );
246
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
247
+ }
248
+ }
249
+ }
250
+ // PressTrends WordPress Action
251
+ add_action('admin_init', 'load_presstrends');
{includes → lib/includes}/backup.php RENAMED
@@ -1,29 +1,34 @@
1
  <?php
2
- //limite process to 5 minutes
3
  @set_time_limit(900);
4
 
5
  //Define variables
6
  $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
7
- $backup_project_path = BACKUP_PATH .$backup_project_dirname .'/';
8
- $wp_content_path = dirname(dirname(dirname(dirname(__FILE__)))) .'/';
 
 
 
 
 
9
 
10
  //create log file
11
- $log = BACKUP_PATH . "status.log";
12
  $fh = fopen($log, 'w') or die("can't open file");
13
  fwrite($fh, '<ul>');
14
 
15
  //Check to see if the directory is writeable
16
  fwrite($fh, '<li>Creating backup directory...');
17
- if(!is_writeable(BACKUP_PATH)) {
18
  fwrite($fh, '</li><li class="error">Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.</li></ul>');
19
  die();
20
  } else {
21
  //If the directory is writeable, create the backup folder if it doesn't exist
22
  if( !is_dir($backup_project_path) ) {
23
- @mkdir($backup_project_path, 0755);
24
  fwrite($fh, 'Done!</li>');
25
  }
26
- foreach(glob(BACKUP_PATH . "*.zip") as $zip) {
27
  unlink($zip);
28
  }
29
  }
@@ -58,10 +63,9 @@ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
58
 
59
  //Zip the project dir
60
  fwrite($fh, '<li>Creating backup zip...');
61
- require(WPBACKITUP_PLUGIN_PATH .'includes/recurse_zip.php');
62
  $z = new recurseZip();
63
  $src = rtrim($backup_project_path, '/');
64
- $z->compress($src, BACKUP_PATH);
65
  fwrite($fh, 'Done!</li>');
66
 
67
  //Delete backup dir
1
  <?php
2
+ //limit process to 15 minutes
3
  @set_time_limit(900);
4
 
5
  //Define variables
6
  $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
7
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
8
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
9
+
10
+ //create the backup dir
11
+ if( !is_dir(WPBACKITUP_DIRNAME ."/backups") ) {
12
+ @mkdir(WPBACKITUP_DIRNAME ."/backups", 0775);
13
+ }
14
 
15
  //create log file
16
+ $log = WPBACKITUP_DIRNAME ."/backups/status.log";
17
  $fh = fopen($log, 'w') or die("can't open file");
18
  fwrite($fh, '<ul>');
19
 
20
  //Check to see if the directory is writeable
21
  fwrite($fh, '<li>Creating backup directory...');
22
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
23
  fwrite($fh, '</li><li class="error">Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.</li></ul>');
24
  die();
25
  } else {
26
  //If the directory is writeable, create the backup folder if it doesn't exist
27
  if( !is_dir($backup_project_path) ) {
28
+ @mkdir($backup_project_path, 0775);
29
  fwrite($fh, 'Done!</li>');
30
  }
31
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
32
  unlink($zip);
33
  }
34
  }
63
 
64
  //Zip the project dir
65
  fwrite($fh, '<li>Creating backup zip...');
 
66
  $z = new recurseZip();
67
  $src = rtrim($backup_project_path, '/');
68
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
69
  fwrite($fh, 'Done!</li>');
70
 
71
  //Delete backup dir
{includes → lib}/recurse_zip.php RENAMED
File without changes
license.txt ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
readme.txt CHANGED
@@ -1,165 +1,183 @@
1
- === WP Backitup Lite ===
2
- Contributors: jcpeden
3
- Donate link: http://www.wpbackitup.com
4
- Tags: backup wordpress, database backup, backup database, download database, backup and restore, restoring wordpress, restore wordpress, restore wordpress backup,
5
- Requires at least: 3.4
6
- Tested up to: 3.5
7
- Stable tag: 1.1.1
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- Create a backup zip of your content and settings with a single click that can be used to restore your site quickly and easily.
12
-
13
- == Description ==
14
-
15
- = The Simple Way to Backup Your Site =
16
- WP Backitup Lite creates a backup zip of your site&apos;s content and configuration in just a single click,
17
- right from your Wordpress dashboard. There is no need to FTP into your site and no knowledge of MySQL or PHPMyAdmin is required.
18
-
19
- You can use your backup zip to restore your site or to clone a site&apos;s content and settings when setting up a new one.
20
-
21
- = Automatically Restore Your Backup Zips =
22
- Tired of messing around in PHPMyAdmin and with FTP trying to restore you backups? Why not check out <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="WP Backitup Pro">WP Backitup Pro</a>? WP Backitup Pro offers all the features of WP Backitup Lite but allows you to import your backup zips in seconds, right from the Wordpress Dashboard (<a href="http://wordpress.org/extend/plugins/wp-backitup/screenshots/" title="WP Backitup Screenshots">screenshots</a>).
23
-
24
- = Manually Restore Your Backup Zips =
25
- WP Backitup generates a zip file containing a copy of your wp-content directory and a database dump. You can unzip it and <a href="http://codex.wordpress.org/Restoring_Your_Database_From_Backup">import your database</a> and files manually but this requires knowledge of FTP and MySQL.
26
-
27
- = Easy To Install and Use =
28
- Simply install the plugin directly to Wordpress and browse to the new menu 'Backup/Restore'. From there, just follow the on-screen instructions and watch as WP Backitup creates a backup of you site's plugins, themes and uploads as well as you content and settings (including all custom widgets and settings for any additional plugins).
29
-
30
- = More questions? =
31
- Why not head over to the <a href="http://www.wpbackitup.com/" title="WP Backitup">WP Backitup site</a> or take a look at the <a href="http://www.wpbackitup.com/support/" title="WP Backitup Support Forum">WP Backitup Support Forum</a>, if you need more help?
32
-
33
- == Installation ==
34
-
35
- Installation of the plugin is straightforward:
36
-
37
- 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
38
- 1. Activate the plugin.
39
- 1. A new menu called 'Backup/Restore' will be added to your toolbar.
40
- 1. Click 'Backup/Restore' to access WP-Backitup
41
-
42
- == Frequently Asked Questions ==
43
-
44
- = Can I manually restore my backup zips? =
45
- Sure! The backup zips generated by WP Backitup contain a database dump and a copy of your wp-content directory. Simply upload your files and import your database.
46
-
47
- = Is there an easier way to restore my backup zips? =
48
- Yes, purchase and download <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="WP Backitup Pro">WP Backitup Pro</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
49
-
50
- = Will the plugin work on shared hosting/sub domains/webhost xxx? =
51
- Yes.
52
-
53
- = Will WP Backitup work on Windows hosting? =
54
- Yes.
55
-
56
- = Are you going to be making progress bars both for backing up and restoring with this plugin? =
57
- It is likely this will feature in a new version of WP Backitup Pro.
58
-
59
- = Can this plugin back to Amazon S3? =
60
- This will feature in an upcoming version of WP Backitup Pro.
61
-
62
- = Is there an auto back up schedule feature? =
63
- It is likely this will feature in a new version of WP Backitup Pro.
64
-
65
- = Will the plugin work with Wordpres version x.x? =
66
- The plugin works on the latest release of WordPress and is updated to function with all new releases.
67
-
68
- = Can this backup one version of WordPress to a different version? =
69
- No. It is absolutely critical that your WordPress versions are exactly the same.
70
-
71
- = Will WP Backitup work on WordPress Multisite? =
72
- WP Backitup cannot yet backup/restore entire networks but it is compatible with WPMS sites.
73
-
74
- = Does the plugin copy the database details as well? =
75
- Yes, a database dump is created with each backup.
76
-
77
- = Can I make a basic WordPress site, with all my desired plugins and settings, make a few pages, setup permalinks, remove all the default junk and load in a basic themplate? =
78
- Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
79
-
80
- = Does WP Backitup need to be installed? =
81
- Yes. You must install the WP Backitup plugin on the site you wish to backup and the site you wish to restore to. Its just a simple plugin.
82
-
83
- = Does WP Backitup backup plugins settings or just the plugins themselves? =
84
- WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
85
-
86
- = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
87
- I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
88
-
89
- = Do you do regularly update this product to match with WP version updates? =
90
- Yes.
91
-
92
- == Screenshots ==
93
- 1. Once activated, the plugin loads a new menu into your toolbar.
94
- 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on its progress.
95
- 3. When the backup has been created, click the download link to access a zipped backup of your site.
96
-
97
- == Changelog ==
98
-
99
- = 1.1.0 =
100
- * Fixed bugs with addons system.
101
-
102
- = 1.0.9 =
103
- * Added Presstrends tracking code.
104
-
105
- = 1.0.8 =
106
- * Modified plugin administration and loaded menu tab in main toolbar.
107
-
108
- = 1.0.7 =
109
- * Added hooks to plugin to allow addons to be built and loaded into the free version of the theme, distributed through the Wordpress plugin repository. Backups were also limited to 20MB to ensure that the processes actually complete.
110
-
111
- = 1.0.6 =
112
- * Initial free version of the plugin distributed on Wordpress. This version can only backup.
113
-
114
- = 1.0.5 =
115
- * Modified backup to use AJAX and restore to use AJAX-like functionality. Added read-write for options so they are saved to DB on exit.
116
-
117
- = 1.0.4 =
118
- * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
119
-
120
- = 1.0.3 =
121
- * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
122
-
123
- = 1.0.2 =
124
- * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
125
-
126
- = 1.0.1 =
127
- * Increased PHP timeout to 900 seconds (5 minutes).
128
-
129
- = 1.0 =
130
- * Plugin released.
131
-
132
- == Upgrade Notice ==
133
-
134
- = 1.1.0 =
135
- * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
136
-
137
- = 1.0.9 =
138
- * Non-essential upgrade. Added Presstrends code.
139
-
140
- = 1.0.8 =
141
- * Recommended upgrade. Added links to admin menu.
142
-
143
- = 1.0.7 =
144
- * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
145
-
146
- = 1.0.6 =
147
- * Non-critical upgrade.
148
-
149
- = 1.0.5 =
150
- * Critical upgrade: More stable, increased flexibility and power.
151
-
152
- = 1.0.4 =
153
- * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
154
-
155
- = 1.0.3 =
156
- * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
157
-
158
- = 1.0.2 =
159
- * Critical upgrade: Plugin does not work on most systems without this upgrade
160
-
161
- = 1.0.1 =
162
- * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
163
-
164
- = 1.0 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  Initial version of the plugin.
1
+ === WP Backitup Lite ===
2
+ Contributors: jcpeden
3
+ Donate link: http://www.wpbackitup.com
4
+ Tags: backup wordpress, database backup, backup database, download database, backup and restore, restoring wordpress, restore wordpress, restore wordpress backup,
5
+ Requires at least: 3.4
6
+ Tested up to: 3.5
7
+ Stable tag: 1.1.4
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Create a backup zip of your content and settings with a single click that can be used to restore your site quickly and easily.
12
+
13
+ == Description ==
14
+
15
+ = The Simple Way to Backup Your Site =
16
+ WP Backitup Lite creates a backup zip of your site&apos;s content and configuration in just a single click,
17
+ right from your Wordpress dashboard. There is no need to FTP into your site and no knowledge of MySQL or PHPMyAdmin is required.
18
+
19
+ You can use your backup zip to restore your site or to clone a site&apos;s content and settings when setting up a new one.
20
+
21
+ = Automatically Restore Your Backup Zips =
22
+ Tired of messing around in PHPMyAdmin and with FTP trying to restore you backups? Why not check out <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="WP Backitup Pro">WP Backitup Pro</a>? WP Backitup Pro offers all the features of WP Backitup Lite but allows you to import your backup zips in seconds, right from the Wordpress Dashboard (<a href="http://wordpress.org/extend/plugins/wp-backitup/screenshots/" title="WP Backitup Screenshots">screenshots</a>).
23
+
24
+ = Manually Restore Your Backup Zips =
25
+ WP Backitup generates a zip file containing a copy of your wp-content directory and a database dump. You can unzip it and <a href="http://codex.wordpress.org/Restoring_Your_Database_From_Backup">import your database</a> and files manually but this requires knowledge of FTP and MySQL.
26
+
27
+ = Easy To Install and Use =
28
+ Simply install the plugin directly to Wordpress and browse to the new menu 'Backup/Restore'. From there, just follow the on-screen instructions and watch as WP Backitup creates a backup of you site's plugins, themes and uploads as well as you content and settings (including all custom widgets and settings for any additional plugins).
29
+
30
+ = More questions? =
31
+ Why not head over to the <a href="http://www.wpbackitup.com/" title="WP Backitup">WP Backitup site</a> or take a look at the <a href="http://www.wpbackitup.com/support/" title="WP Backitup Support Forum">WP Backitup Support Forum</a>, if you need more help?
32
+
33
+ == Installation ==
34
+
35
+ Installation of the plugin is straightforward:
36
+
37
+ 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
38
+ 1. Activate the plugin.
39
+ 1. A new menu called 'Backup/Restore' will be added to your toolbar.
40
+ 1. Click 'Backup/Restore' to access WP-Backitup
41
+
42
+ == Frequently Asked Questions ==
43
+
44
+ = Can I manually restore my backup zips? =
45
+ Sure! The backup zips generated by WP Backitup contain a database dump and a copy of your wp-content directory. Simply upload your files and import your database.
46
+
47
+ = Is there an easier way to restore my backup zips? =
48
+ Yes, purchase and download <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="WP Backitup Pro">WP Backitup Pro</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
49
+
50
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
51
+ Yes.
52
+
53
+ = Will WP Backitup work on Windows hosting? =
54
+ Yes.
55
+
56
+ = Are you going to be making progress bars both for backing up and restoring with this plugin? =
57
+ It is likely this will feature in a new version of WP Backitup Pro.
58
+
59
+ = Can this plugin back to Amazon S3? =
60
+ This will feature in an upcoming version of WP Backitup Pro.
61
+
62
+ = Is there an auto back up schedule feature? =
63
+ It is likely this will feature in a new version of WP Backitup Pro.
64
+
65
+ = Will the plugin work with Wordpres version x.x? =
66
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
67
+
68
+ = Can this backup one version of WordPress to a different version? =
69
+ No. It is absolutely critical that your WordPress versions are exactly the same.
70
+
71
+ = Will WP Backitup work on WordPress Multisite? =
72
+ WP Backitup cannot yet backup/restore entire networks but it is compatible with WPMS sites.
73
+
74
+ = Does the plugin copy the database details as well? =
75
+ Yes, a database dump is created with each backup.
76
+
77
+ = Can I make a basic WordPress site, with all my desired plugins and settings, make a few pages, setup permalinks, remove all the default junk and load in a basic themplate? =
78
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
79
+
80
+ = Does WP Backitup need to be installed? =
81
+ Yes. You must install the WP Backitup plugin on the site you wish to backup and the site you wish to restore to. Its just a simple plugin.
82
+
83
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
84
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
85
+
86
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
87
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
88
+
89
+ = Do you do regularly update this product to match with WP version updates? =
90
+ Yes.
91
+
92
+ == Screenshots ==
93
+ 1. Once activated, the plugin loads a new menu into your toolbar.
94
+ 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on its progress.
95
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
96
+
97
+ == Changelog ==
98
+
99
+ = 1.1.3 =
100
+ * Re-wrote plugin in OOP, added option to disable Presstrends tracking code.
101
+
102
+ = 1.1.2 =
103
+ * Fixed issue with stylesheet not being loaded.
104
+
105
+ = 1.1.1 =
106
+ * Fixed issue with plugin not detecing addons
107
+
108
+ = 1.1.0 =
109
+ * Fixed bugs with addons system.
110
+
111
+ = 1.0.9 =
112
+ * Added Presstrends tracking code.
113
+
114
+ = 1.0.8 =
115
+ * Modified plugin administration and loaded menu tab in main toolbar.
116
+
117
+ = 1.0.7 =
118
+ * Added hooks to plugin to allow addons to be built and loaded into the free version of the theme, distributed through the Wordpress plugin repository. Backups were also limited to 20MB to ensure that the processes actually complete.
119
+
120
+ = 1.0.6 =
121
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
122
+
123
+ = 1.0.5 =
124
+ * Modified backup to use AJAX and restore to use AJAX-like functionality. Added read-write for options so they are saved to DB on exit.
125
+
126
+ = 1.0.4 =
127
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
128
+
129
+ = 1.0.3 =
130
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
131
+
132
+ = 1.0.2 =
133
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
134
+
135
+ = 1.0.1 =
136
+ * Increased PHP timeout to 900 seconds (5 minutes).
137
+
138
+ = 1.0 =
139
+ * Plugin released.
140
+
141
+ == Upgrade Notice ==
142
+
143
+ = 1.1.3 =
144
+ * Non-critical upgrade. Re-wrote plugin in object-oriented PHP.
145
+
146
+ = 1.1.2 =
147
+ * Critical upgrade. Fixed issue with stylesheet.
148
+
149
+ = 1.1.1 =
150
+ * Critical upgrade. Fixed further bugs with addons system.
151
+
152
+ = 1.1.0 =
153
+ * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
154
+
155
+ = 1.0.9 =
156
+ * Non-essential upgrade. Added Presstrends code.
157
+
158
+ = 1.0.8 =
159
+ * Recommended upgrade. Added links to admin menu.
160
+
161
+ = 1.0.7 =
162
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
163
+
164
+ = 1.0.6 =
165
+ * Non-critical upgrade.
166
+
167
+ = 1.0.5 =
168
+ * Critical upgrade: More stable, increased flexibility and power.
169
+
170
+ = 1.0.4 =
171
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
172
+
173
+ = 1.0.3 =
174
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
175
+
176
+ = 1.0.2 =
177
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
178
+
179
+ = 1.0.1 =
180
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
181
+
182
+ = 1.0 =
183
  Initial version of the plugin.
views/options.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript">var __namespace = '<?php echo $namespace; ?>';</script>
2
+ <div class="wrap">
3
+ <div id="wp-backitup-icon" class="icon32"><img src="<?php echo plugin_dir_url(dirname(__FILE__) ); ?>images/icon32.png" alt="WP Backitup Icon" height="32" width="32" /></div>
4
+ <h2><?php echo $page_title; ?></h2>
5
+ <div id="content">
6
+ <h3>Backup</h3>
7
+ <p>Create a backup file of this site's content and settings.</p>
8
+ <p><a href="#" class="backup-button button-primary"><?php _e( "Backup", $namespace ) ?></a><img class="backup-icon status-icon" src="<?php echo WPBACKITUP_URLPATH. "/images/loader.gif"; ?>" height="16" width="16" /></p>
9
+ <h3>Download</h3>
10
+ <p><div id="download-link"></div></p>
11
+ <h3>Status</h3>
12
+ <p><div id="status">Nothing to report</div></p>
13
+ </div>
14
+ <div id="sidebar">
15
+ <div class="widget" id="restore-widget">
16
+ <h3 class="promo">Restore Your Backups</h3>
17
+ <p>You can restore your backup zips by importing them manually or by getting WP Backitup Pro.</p>
18
+ <p><a class="button-primary" href="http://www.wpbackitup.com/wp-backitup-pro/">Read more</a></p>
19
+ </div>
20
+ <div class="widget">
21
+ <h3 class="promo">Need support?</h3>
22
+ <p>If you are having problems with this plugin please talk about them in the <a href="http://wordpress.org/support/plugin/wp-backitup">support forum</a>.</p>
23
+ <p>You can also refer to the <a href="http://www.wpbackitup.com/documentation/">WP Backitup documentation</a>.</p>
24
+ </div>
25
+ <div class="widget">
26
+ <h3 class="promo">Spread the Word!</h3>
27
+ <p>Want to help make WP Backitup even better? All donations are used to improve this plugin, so donate $10, $20 or $50 now!</p>
28
+ <p><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
29
+ <input type="hidden" name="cmd" value="_s-xclick">
30
+ <input type="hidden" name="hosted_button_id" value="QSHPK8EDMAW9N">
31
+ <input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
32
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
33
+ </form></p>
34
+ <p>Or you could <a href="http://wordpress.org/extend/plugins/wp-backitup/">rate the plugin 5&#9733; on Wordpress.org</a>.</p>
35
+ </div>
36
+ <div class="widget">
37
+ <h3 class="promo">Presstrends</h3>
38
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
39
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
40
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label>Enable</label></p>
41
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label>Disable</label></p>
42
+ <p>Help to improve Easy Webtrends by enabling <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
43
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
44
+ </form>
45
+ </div>
46
+ </div>
47
+ </div>
wp-backitup.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
- /**
3
- * Plugin Name: WP Backitup Lite
4
- * Plugin URI: http://www.wpbackitup.com
5
- * Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
6
- * Version: 1.1.1
7
- * Author: John Peden
8
- * Author URI: http://www.johncpeden.com
9
- * License: GPLv2 or later
10
- * Text Domain: wp-backitup
11
- */
12
-
13
- /*
14
- Copyright 2012-current John Peden Ltd ( email : support@wpbackitup.com )
15
- */
16
-
17
- //define constants
18
- define("WPBACKITUP_PLUGIN_URL", plugins_url('/', (__FILE__)) );
19
- define("WPBACKITUP_PLUGIN_PATH", plugin_dir_path(__FILE__) );
20
- define("WPBACKITUP_DIRNAME", basename(dirname(__FILE__)) );
21
- define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'/backups/' );
22
-
23
- //load admin menu
24
- function wpbackitup_admin_menu() {
25
- $wpbackituppage = add_menu_page( __( 'WP Backitup', 'wpBackitup' ), __( 'Backup/Restore', 'wpBackitup' ), 'manage_options', 'wp-backitup', 'wpbackitup_admin', plugin_dir_url(__FILE__ ) .'images/icon.png', 77);
26
- add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_admin_stylesheet' );
27
- add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_admin_javascript' );
28
- }
29
- add_action('admin_menu', 'wpbackitup_admin_menu');
30
-
31
- //enqueue stylesheet
32
- function wpbackitup_admin_stylesheet() {
33
- wp_enqueue_style( 'wpBackitupStylesheet', plugins_url('css/admin-style.css',(__FILE__)) );
34
- }
35
-
36
- //enqueue javascript
37
- function wpbackitup_admin_javascript() {
38
- wp_enqueue_script( 'wpBackitupJavascript', plugins_url('js/wp-backitup.js', (__FILE__)) );
39
- }
40
-
41
- //load plugin functions
42
- include_once 'includes/functions.php';
43
-
44
- //load admin page
45
- function wpbackitup_admin() {
46
- include_once('includes/admin_page.php');
47
- }
48
-
49
- //load backup function
50
- function wpbackitup_backup() {
51
- include 'includes/backup.php';
52
- }
53
- add_action('wp_ajax_wpbackitup_backup', 'wpbackitup_backup');
54
-
55
- //load download function
56
- function wpbackitup_download() {
57
- include 'includes/download.php';
58
- }
59
- add_action('wp_ajax_wpbackitup_download', 'wpbackitup_download');
60
-
61
- //load download function
62
- function wpbackitup_logreader() {
63
- if(file_exists(BACKUP_PATH .'/status.log') ) {
64
- readfile(BACKUP_PATH .'/status.log');
65
- }
66
- die();
67
- }
68
- add_action('wp_ajax_wpbackitup_logreader', 'wpbackitup_logreader');
69
-
70
- //load addons
71
- $dir = WPBACKITUP_PLUGIN_PATH . "addons/restore/";
72
- if(is_dir($dir)){
73
- include_once $dir .'index.php';
74
- }
75
-
76
- /**
77
- * PressTrends Plugin API
78
- */
79
- function presstrends_WPBackitup_plugin() {
80
-
81
- // PressTrends Account API Key
82
- $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
83
- $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
84
-
85
- // Start of Metrics
86
- global $wpdb;
87
- $data = get_transient( 'presstrends_cache_data' );
88
- if ( !$data || $data == '' ) {
89
- $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
90
- $url = $api_base . $auth . '/api/' . $api_key . '/';
91
-
92
- $count_posts = wp_count_posts();
93
- $count_pages = wp_count_posts( 'page' );
94
- $comments_count = wp_count_comments();
95
-
96
- // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
97
- if ( function_exists( 'wp_get_theme' ) ) {
98
- $theme_data = wp_get_theme();
99
- $theme_name = urlencode( $theme_data->Name );
100
- } else {
101
- $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
102
- $theme_name = $theme_data['Name'];
103
- }
104
-
105
- $plugin_name = '&';
106
- foreach ( get_plugins() as $plugin_info ) {
107
- $plugin_name .= $plugin_info['Name'] . '&';
108
- }
109
- // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
110
- $plugin_data = get_plugin_data( __FILE__ );
111
- $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
112
- $data = array(
113
- 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
114
- 'posts' => $count_posts->publish,
115
- 'pages' => $count_pages->publish,
116
- 'comments' => $comments_count->total_comments,
117
- 'approved' => $comments_count->approved,
118
- 'spam' => $comments_count->spam,
119
- 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
120
- 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
121
- 'theme_version' => $plugin_data['Version'],
122
- 'theme_name' => $theme_name,
123
- 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
124
- 'plugins' => count( get_option( 'active_plugins' ) ),
125
- 'plugin' => urlencode( $plugin_name ),
126
- 'wpversion' => get_bloginfo( 'version' ),
127
- );
128
-
129
- foreach ( $data as $k => $v ) {
130
- $url .= $k . '/' . $v . '/';
131
- }
132
- wp_remote_get( $url );
133
- set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
134
- }
135
- }
136
-
137
- // PressTrends WordPress Action
138
- add_action('admin_init', 'presstrends_WPBackitup_plugin');