Backup and Restore WordPress – WPBackItUp Backup Plugin - Version 1.7.2

Version Description

Download this release

Release Info

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

Code changes from version 1.7.1 to 1.7.2

Files changed (261) hide show
  1. assets/banner-772x250.jpg +0 -0
  2. assets/screenshot-1.png +0 -0
  3. assets/screenshot-2.png +0 -0
  4. assets/screenshot-3.png +0 -0
  5. tags/1.0.6/backups/status.log +1 -0
  6. tags/1.0.6/css/wp-backitup.css +52 -0
  7. {images → tags/1.0.6/images}/loader.gif +0 -0
  8. tags/1.0.6/includes/admin_page.php +1 -0
  9. tags/1.0.6/includes/backup.php +78 -0
  10. tags/1.0.6/includes/download.php +18 -0
  11. tags/1.0.6/includes/functions.php +113 -0
  12. tags/1.0.6/includes/recurse_zip.php +1 -0
  13. tags/1.0.6/js/wp-backitup.js +48 -0
  14. tags/1.0.6/readme.txt +119 -0
  15. tags/1.0.6/wp-backitup.php +75 -0
  16. tags/1.0.7/backups/status.log +1 -0
  17. tags/1.0.7/css/wp-backitup.css +52 -0
  18. tags/1.0.7/images/loader.gif +0 -0
  19. tags/1.0.7/includes/admin_page.php +1 -0
  20. tags/1.0.7/includes/backup.php +78 -0
  21. tags/1.0.7/includes/download.php +18 -0
  22. tags/1.0.7/includes/functions.php +176 -0
  23. tags/1.0.7/includes/recurse_zip.php +1 -0
  24. tags/1.0.7/includes/restore.php +312 -0
  25. tags/1.0.7/js/ajaxfileupload.js +201 -0
  26. tags/1.0.7/js/wp-backitup.js +69 -0
  27. tags/1.0.7/readme.txt +120 -0
  28. tags/1.0.7/screenshots/screenshot-1.png +0 -0
  29. tags/1.0.7/screenshots/screenshot-2.png +0 -0
  30. tags/1.0.7/screenshots/screenshot-3.png +0 -0
  31. tags/1.0.7/wp-backitup.php +75 -0
  32. tags/1.0.8/backups/status.log +1 -0
  33. tags/1.0.8/css/wp-backitup.css +63 -0
  34. {images → tags/1.0.8/images}/icon.png +0 -0
  35. {images → tags/1.0.8/images}/icon32.png +0 -0
  36. tags/1.0.8/images/loader.gif +0 -0
  37. tags/1.0.8/includes/admin_page.php +1 -0
  38. tags/1.0.8/includes/backup.php +78 -0
  39. tags/1.0.8/includes/download.php +18 -0
  40. tags/1.0.8/includes/functions.php +145 -0
  41. tags/1.0.8/includes/recurse_zip.php +1 -0
  42. tags/1.0.8/js/wp-backitup.js +69 -0
  43. tags/1.0.8/readme.txt +152 -0
  44. tags/1.0.8/screenshots/screenshot-1.png +0 -0
  45. tags/1.0.8/screenshots/screenshot-2.png +0 -0
  46. tags/1.0.8/screenshots/screenshot-3.png +0 -0
  47. tags/1.0.8/wp-backitup.php +77 -0
  48. tags/1.0.9/backups/status.log +1 -0
  49. tags/1.0.9/css/wp-backitup.css +63 -0
  50. tags/1.0.9/images/icon.png +0 -0
  51. tags/1.0.9/images/icon32.png +0 -0
  52. tags/1.0.9/images/loader.gif +0 -0
  53. tags/1.0.9/includes/admin_page.php +1 -0
  54. tags/1.0.9/includes/backup.php +78 -0
  55. tags/1.0.9/includes/download.php +18 -0
  56. tags/1.0.9/includes/functions.php +145 -0
  57. tags/1.0.9/includes/recurse_zip.php +1 -0
  58. tags/1.0.9/js/wp-backitup.js +69 -0
  59. tags/1.0.9/readme.txt +158 -0
  60. tags/1.0.9/screenshots/screenshot-1.png +0 -0
  61. tags/1.0.9/screenshots/screenshot-2.png +0 -0
  62. tags/1.0.9/screenshots/screenshot-3.png +0 -0
  63. tags/1.0.9/wp-backitup.php +147 -0
  64. tags/1.1.0/backups/status.log +1 -0
  65. tags/1.1.0/css/wp-backitup.css +63 -0
  66. tags/1.1.0/images/icon.png +0 -0
  67. tags/1.1.0/images/icon32.png +0 -0
  68. tags/1.1.0/images/loader.gif +0 -0
  69. tags/1.1.0/includes/admin_page.php +1 -0
  70. tags/1.1.0/includes/backup.php +78 -0
  71. tags/1.1.0/includes/download.php +18 -0
  72. tags/1.1.0/includes/functions.php +145 -0
  73. tags/1.1.0/includes/recurse_zip.php +1 -0
  74. tags/1.1.0/js/wp-backitup.js +69 -0
  75. tags/1.1.0/readme.txt +164 -0
  76. tags/1.1.0/screenshots/screenshot-1.png +0 -0
  77. tags/1.1.0/screenshots/screenshot-2.png +0 -0
  78. tags/1.1.0/screenshots/screenshot-3.png +0 -0
  79. tags/1.1.0/wp-backitup.php +135 -0
  80. tags/1.1.1/backups/status.log +1 -0
  81. tags/1.1.1/css/admin-style.css +63 -0
  82. tags/1.1.1/css/wp-backitup.css +63 -0
  83. tags/1.1.1/images/icon.png +0 -0
  84. tags/1.1.1/images/icon32.png +0 -0
  85. tags/1.1.1/images/loader.gif +0 -0
  86. tags/1.1.1/includes/admin_page.php +1 -0
  87. tags/1.1.1/includes/backup.php +78 -0
  88. tags/1.1.1/includes/download.php +18 -0
  89. tags/1.1.1/includes/functions.php +145 -0
  90. tags/1.1.1/includes/recurse_zip.php +1 -0
  91. tags/1.1.1/js/wp-backitup.js +69 -0
  92. tags/1.1.1/readme.txt +165 -0
  93. tags/1.1.1/screenshots/screenshot-1.png +0 -0
  94. tags/1.1.1/screenshots/screenshot-2.png +0 -0
  95. tags/1.1.1/screenshots/screenshot-3.png +0 -0
  96. tags/1.1.1/wp-backitup.php +138 -0
  97. tags/1.1.2/backups/status.log +1 -0
  98. tags/1.1.2/css/admin-style.css +63 -0
  99. tags/1.1.2/css/wp-backitup.css +63 -0
  100. tags/1.1.2/images/icon.png +0 -0
  101. tags/1.1.2/images/icon32.png +0 -0
  102. tags/1.1.2/images/loader.gif +0 -0
  103. tags/1.1.2/includes/admin_page.php +1 -0
  104. tags/1.1.2/includes/backup.php +78 -0
  105. tags/1.1.2/includes/download.php +18 -0
  106. tags/1.1.2/includes/functions.php +145 -0
  107. tags/1.1.2/includes/recurse_zip.php +1 -0
  108. tags/1.1.2/js/wp-backitup.js +69 -0
  109. tags/1.1.2/readme.txt +165 -0
  110. tags/1.1.2/screenshots/screenshot-1.png +0 -0
  111. tags/1.1.2/screenshots/screenshot-2.png +0 -0
  112. tags/1.1.2/screenshots/screenshot-3.png +0 -0
  113. tags/1.1.2/wp-backitup.php +138 -0
  114. tags/1.1.4/backups/WP Backitup-Export-2013-02-13-0921.zip +0 -0
  115. tags/1.1.4/backups/status.log +1 -0
  116. tags/1.1.4/css/admin.css +59 -0
  117. tags/1.1.4/images/icon.png +0 -0
  118. tags/1.1.4/images/icon32.png +0 -0
  119. tags/1.1.4/images/loader.gif +0 -0
  120. tags/1.1.4/index.php +342 -0
  121. tags/1.1.4/js/admin.js +69 -0
  122. tags/1.1.4/lib/constants.php +21 -0
  123. tags/1.1.4/lib/functions.php +251 -0
  124. tags/1.1.4/lib/includes/backup.php +82 -0
  125. tags/1.1.4/lib/recurse_zip.php +1 -0
  126. tags/1.1.4/license.txt +674 -0
  127. tags/1.1.4/readme.txt +183 -0
  128. tags/1.1.4/screenshots/screenshot-1.png +0 -0
  129. tags/1.1.4/screenshots/screenshot-2.png +0 -0
  130. tags/1.1.4/screenshots/screenshot-3.png +0 -0
  131. tags/1.1.4/views/options.php +47 -0
  132. tags/1.1.6/backups/status.log +1 -0
  133. tags/1.1.6/css/admin.css +59 -0
  134. tags/1.1.6/images/icon.png +0 -0
  135. tags/1.1.6/images/icon32.png +0 -0
  136. tags/1.1.6/images/loader.gif +0 -0
  137. tags/1.1.6/index.php +342 -0
  138. tags/1.1.6/js/admin.js +51 -0
  139. tags/1.1.6/lib/constants.php +21 -0
  140. tags/1.1.6/lib/functions.php +251 -0
  141. tags/1.1.6/lib/includes/backup.php +93 -0
  142. tags/1.1.6/lib/recurse_zip.php +1 -0
  143. tags/1.1.6/license.txt +674 -0
  144. tags/1.1.6/readme.txt +201 -0
  145. tags/1.1.6/screenshots/screenshot-1.png +0 -0
  146. tags/1.1.6/screenshots/screenshot-2.png +0 -0
  147. tags/1.1.6/screenshots/screenshot-3.png +0 -0
  148. tags/1.1.6/views/options.php +46 -0
  149. tags/1.2.0/backups/status.log +1 -0
  150. tags/1.2.0/css/admin.css +64 -0
  151. tags/1.2.0/images/icon.png +0 -0
  152. tags/1.2.0/images/icon32.png +0 -0
  153. tags/1.2.0/images/loader.gif +0 -0
  154. tags/1.2.0/index.php +342 -0
  155. tags/1.2.0/js/admin.js +93 -0
  156. tags/1.2.0/js/ajaxfileupload.js +205 -0
  157. tags/1.2.0/languages/wp-backitup-pro.mo +0 -0
  158. tags/1.2.0/languages/wp-backitup-pro.po +270 -0
  159. tags/1.2.0/lib/constants.php +24 -0
  160. tags/1.2.0/lib/functions.php +233 -0
  161. tags/1.2.0/lib/includes/backup.php +121 -0
  162. tags/1.2.0/lib/includes/recurse_zip.php +1 -0
  163. tags/1.2.0/license.txt +674 -0
  164. tags/1.2.0/logs/status.log +1 -0
  165. tags/1.2.0/readme.txt +213 -0
  166. tags/1.2.0/views/options.php +38 -0
  167. tags/1.2.1/backups/status.log +1 -0
  168. tags/1.2.1/css/admin.css +64 -0
  169. tags/1.2.1/images/icon.png +0 -0
  170. tags/1.2.1/images/icon32.png +0 -0
  171. tags/1.2.1/images/loader.gif +0 -0
  172. tags/1.2.1/index.php +342 -0
  173. tags/1.2.1/js/admin.js +93 -0
  174. tags/1.2.1/js/ajaxfileupload.js +205 -0
  175. tags/1.2.1/languages/wp-backitup-pro.mo +0 -0
  176. tags/1.2.1/languages/wp-backitup-pro.po +270 -0
  177. tags/1.2.1/lib/constants.php +24 -0
  178. tags/1.2.1/lib/functions.php +233 -0
  179. tags/1.2.1/lib/includes/backup.php +121 -0
  180. tags/1.2.1/lib/includes/recurse_zip.php +1 -0
  181. tags/1.2.1/license.txt +674 -0
  182. tags/1.2.1/logs/status.log +1 -0
  183. tags/1.2.1/readme.txt +213 -0
  184. tags/1.2.1/views/options.php +38 -0
  185. tags/1.2.2/backups/status.log +1 -0
  186. tags/1.2.2/css/admin.css +64 -0
  187. tags/1.2.2/images/icon.png +0 -0
  188. tags/1.2.2/images/icon32.png +0 -0
  189. tags/1.2.2/images/loader.gif +0 -0
  190. tags/1.2.2/index.php +380 -0
  191. tags/1.2.2/js/admin.js +92 -0
  192. tags/1.2.2/js/ajaxfileupload.js +205 -0
  193. tags/1.2.2/languages/wp-backitup-pro.mo +0 -0
  194. tags/1.2.2/languages/wp-backitup-pro.po +270 -0
  195. tags/1.2.2/lib/constants.php +24 -0
  196. tags/1.2.2/lib/functions.php +241 -0
  197. tags/1.2.2/lib/includes/backup.php +119 -0
  198. tags/1.2.2/lib/includes/recurse_zip.php +1 -0
  199. tags/1.2.2/license.txt +674 -0
  200. tags/1.2.2/logs/status.log +1 -0
  201. tags/1.2.2/readme.txt +219 -0
  202. tags/1.2.2/views/options.php +42 -0
  203. tags/1.3.0/backups/status.log +1 -0
  204. tags/1.3.0/css/admin.css +64 -0
  205. tags/1.3.0/images/icon.png +0 -0
  206. tags/1.3.0/images/icon32.png +0 -0
  207. tags/1.3.0/images/loader.gif +0 -0
  208. tags/1.3.0/index.php +375 -0
  209. tags/1.3.0/js/admin.js +82 -0
  210. tags/1.3.0/js/ajaxfileupload.js +204 -0
  211. tags/1.3.0/languages/template_en_US.po +395 -0
  212. tags/1.3.0/languages/wp-backitup-pro.mo +0 -0
  213. tags/1.3.0/languages/wp-backitup-pro.po +270 -0
  214. tags/1.3.0/lib/constants.php +24 -0
  215. tags/1.3.0/lib/functions.php +264 -0
  216. tags/1.3.0/lib/includes/auto_update.php +141 -0
  217. tags/1.3.0/lib/includes/backup.php +106 -0
  218. tags/1.3.0/lib/includes/recurse_zip.php +1 -0
  219. tags/1.3.0/lib/includes/restore.php +392 -0
  220. tags/1.3.0/lib/includes/restore_from_path.php +360 -0
  221. tags/1.3.0/license.txt +674 -0
  222. tags/1.3.0/logs/status.log +1 -0
  223. tags/1.3.0/readme.txt +186 -0
  224. tags/1.3.0/views/options.php +89 -0
  225. tags/1.4.0/css/admin.css +63 -0
  226. tags/1.4.0/images/icon.png +0 -0
  227. tags/1.4.0/images/icon32.png +0 -0
  228. tags/1.4.0/images/loader.gif +0 -0
  229. tags/1.4.0/index.php +375 -0
  230. tags/1.4.0/js/admin.js +125 -0
  231. tags/1.4.0/js/ajaxfileupload.js +204 -0
  232. tags/1.4.0/languages/en-GB.mo +0 -0
  233. tags/1.4.0/languages/en-GB.po +326 -0
  234. tags/1.4.0/lib/constants.php +24 -0
  235. tags/1.4.0/lib/functions.php +264 -0
  236. tags/1.4.0/lib/includes/auto_update.php +141 -0
  237. tags/1.4.0/lib/includes/backup.php +105 -0
  238. tags/1.4.0/lib/includes/recurse_zip.php +1 -0
  239. tags/1.4.0/lib/includes/restore.php +400 -0
  240. tags/1.4.0/lib/includes/restore_from_path.php +360 -0
  241. tags/1.4.0/license.txt +674 -0
  242. tags/1.4.0/logs/status.log +1 -0
  243. tags/1.4.0/readme.txt +216 -0
  244. tags/1.4.0/views/options.php +155 -0
  245. tags/1.4.1/css/admin.css +63 -0
  246. tags/1.4.1/images/icon.png +0 -0
  247. tags/1.4.1/images/icon32.png +0 -0
  248. tags/1.4.1/images/loader.gif +0 -0
  249. tags/1.4.1/index.php +375 -0
  250. tags/1.4.1/js/admin.js +125 -0
  251. tags/1.4.1/js/ajaxfileupload.js +204 -0
  252. tags/1.4.1/languages/en-GB.mo +0 -0
  253. tags/1.4.1/languages/en-GB.po +326 -0
  254. tags/1.4.1/lib/constants.php +26 -0
  255. tags/1.4.1/lib/functions.php +319 -0
  256. tags/1.4.1/lib/includes/auto_update.php +141 -0
  257. tags/1.4.1/lib/includes/backup.php +112 -0
  258. tags/1.4.1/lib/includes/recurse_zip.php +1 -0
  259. tags/1.4.1/lib/includes/restore.php +400 -0
  260. tags/1.4.1/lib/includes/restore_from_path.php +360 -0
  261. tags/1.4.1/license.txt +114 -0
assets/banner-772x250.jpg ADDED
Binary file
assets/screenshot-1.png ADDED
Binary file
assets/screenshot-2.png ADDED
Binary file
assets/screenshot-3.png ADDED
Binary file
tags/1.0.6/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>
tags/1.0.6/css/wp-backitup.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* WP Backitup CSS */
2
+
3
+ .error { color: #ff0000;}
4
+
5
+ input {padding: 0;}
6
+
7
+ h3 {
8
+ margin: 0;
9
+ padding: 1em 0 0 0;
10
+ }
11
+
12
+ ul {padding: 1em 0 0 0;}
13
+
14
+ iframe {
15
+ height: 0;
16
+ margin: 0;
17
+ padding: 0;
18
+ position: absolute;
19
+ top: 0;
20
+ right: 0;
21
+ width: 0;
22
+ }
23
+
24
+ .wp-backitup-section {clear:both;}
25
+
26
+ #backup-button, #restore-form {
27
+ float: left;
28
+ margin: 0 5px 5px 0;
29
+ }
30
+
31
+ #backup-button a {
32
+ display: block;
33
+ padding: 3px 8px;
34
+ -webkit-border-radius: 10px;
35
+ -moz-border-radius: 10px;
36
+ border-radius: 10px;
37
+ }
38
+
39
+ .status-icon {
40
+ display: inline;
41
+ height: 16px;
42
+ visibility: hidden;
43
+ width: 16px;
44
+ }
45
+
46
+ .status-icon img {margin-top: 3px;}
47
+
48
+ #wp-backitup-restore .status-icon img {margin-top: 7px;}
49
+
50
+ #restore_form {margin-right: 5px;}
51
+
52
+ #restore-button {margin-top: 22px;}
{images → tags/1.0.6/images}/loader.gif RENAMED
File without changes
tags/1.0.6/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.6/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // 5 minutes per image should be PLENTY
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Export file created successfully. You can download your export file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.0.6/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.0.6/includes/functions.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ) ) { //If $file is a 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
+ }
tags/1.0.6/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.6/js/wp-backitup.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ //define backup variables
3
+ var wpBackitupBackup = {
4
+ action: 'wpbackitup_backup',
5
+ beforeSend: function() {
6
+ $('#wp-backitup-backup .status-icon').css('visibility','visible');
7
+ $("#wp-backitup-status").empty();
8
+ setInterval(logreader, 1000);
9
+ }
10
+ };
11
+
12
+ //define download variables
13
+ var wpBackitupDownload = {
14
+ action: 'wpbackitup_download'
15
+ };
16
+
17
+ //define logreader variables
18
+ var wpBackitupLogReader = {
19
+ action: 'wpbackitup_logreader'
20
+ };
21
+
22
+ //define logreader function
23
+ function logreader() {
24
+ $.post(ajaxurl, wpBackitupLogReader, function(response) {
25
+ $("#wp-backitup-status").html(response);
26
+ });
27
+ }
28
+
29
+ //define download function
30
+ function download() {
31
+ $.post(ajaxurl, wpBackitupDownload, function(response) {
32
+ $("#wp-backitup-download-status").html(response);
33
+ });
34
+ }
35
+
36
+ //execute download (on page load/refresh)
37
+ download();
38
+
39
+ //execute backup on button click
40
+ $("#wpBackitupBackup").click( function() {
41
+ $.post(ajaxurl, wpBackitupBackup, function(response) {
42
+ download(); //Build download link
43
+ clearInterval(logreader); //Stop checking for status updates
44
+ $('#wp-backitup-backup .status-icon').fadeOut(1000); //Fade process indicator
45
+ $("#wp-backitup-php").html(response); //Return PHP messages, used for development
46
+ });
47
+ })
48
+ });
tags/1.0.6/readme.txt ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: jcpeden
3
+ Donate link: http://www.wpBackitup.com
4
+ Tags: backup, restore, clone, database, wp-content, files
5
+ Requires at least: 3.4
6
+ Tested up to: 3.5
7
+ Stable tag: 1.0.6
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ WP Backitup allows you to backup your database and wp-content folder. This allows you to quickly clone, backup and restore any of your Wordpress sites.
12
+
13
+ == Description ==
14
+
15
+ WP Backitup uses nothing but PHP to allow you to backup and restore your Wordpress database, plugins, themes and uploads directories. You can create a
16
+ backup of any site and, using WP Backitup, quickly import your files, settings and content into a new site.
17
+
18
+ == Installation ==
19
+
20
+ Installation of the plugin is straightforward:
21
+
22
+ 1. Upload the directory `wp-Backitup` to the `/wp-content/plugins/` directory.
23
+ 1. Activate the plugin through the `Plugins` menu in WordPress.
24
+ 1. Through the Wordpress dashboard, browse to Tools > WP Backitup.
25
+
26
+ == Frequently Asked Questions ==
27
+
28
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
29
+ Yes
30
+
31
+ = Will WP Backitup work on Windows hosting? =
32
+ Yes
33
+
34
+ = Are you going to be making progress bars both for backing up and restoring with this plugin? =
35
+ Not at this time.
36
+
37
+ = Can this plugin back to Amazon S3? =
38
+ Not at this time.
39
+
40
+ = Is there an auto back up schedule feature? =
41
+ Not at this time.
42
+
43
+ = Will the plugin work with Wordpres version x.x? =
44
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
45
+
46
+ = Can this backup one version of WordPress to a different version? =
47
+ No. It is absolutely critical that your WordPress versions are exactly the same.
48
+
49
+ = Will WP Backitup work on WordPress Multisite? =
50
+ It is untested with Wordpress multisite and probably will not work.
51
+
52
+ = Does the plugin copy the database details as well? =
53
+ Yes, a database dump is created with each backup.
54
+
55
+ = 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? =
56
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
57
+
58
+ = Does WP Backitup need to be installed? =
59
+ 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.
60
+
61
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
62
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
63
+
64
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
65
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
66
+
67
+ = Do you do regularly update this product to match with WP version updates? =
68
+ Yes.
69
+
70
+ == Screenshots ==
71
+ 1. Once activated, the plugin loads a new menu into Tools > WP Backitup.
72
+ 2. Simply click 'Export' to generate a backup of your site. The plugin will update you on its progress.
73
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
74
+
75
+ == Changelog ==
76
+
77
+ = 1.0.6 =
78
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
79
+
80
+ = 1.0.5 =
81
+ * 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.
82
+
83
+ = 1.0.4 =
84
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
85
+
86
+ = 1.0.3 =
87
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
88
+
89
+ = 1.0.2 =
90
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
91
+
92
+ = 1.0.1 =
93
+ * Increased PHP timeout to 900 seconds (5 minutes).
94
+
95
+ = 1.0 =
96
+ * Plugin released.
97
+
98
+ == Upgrade Notice ==
99
+
100
+ = 1.0.6 =
101
+ * Non-critical upgrade.
102
+
103
+ = 1.0.5 =
104
+ * Critical upgrade: More stable, increased flexibility and power.
105
+
106
+ = 1.0.4 =
107
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
108
+
109
+ = 1.0.3 =
110
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
111
+
112
+ = 1.0.2 =
113
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
114
+
115
+ = 1.0.1 =
116
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
117
+
118
+ = 1.0 =
119
+ Initial version of the plugin.
tags/1.0.6/wp-backitup.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Backitup
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.0.6
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 C. Peden ( email : mail@johncpeden.com )
15
+ */
16
+
17
+ //define constants
18
+ define("WPBACKITUP_PLUGIN_URL", WP_PLUGIN_URL ."/wp-backitup/");
19
+ define("WPBACKITUP_PLUGIN_PATH", WP_PLUGIN_DIR."/wp-backitup/");
20
+ define("WPBACKITUP_DIRNAME", "wp-backitup");
21
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
22
+
23
+ //add plugin options
24
+ function wpbackitup_options_init() {
25
+ register_setting ('wpbackitup_options', 'wpbackitup', 'wpbackitup_options_validate');
26
+ }
27
+ add_action('admin_init', 'wpbackitup_options_init' );
28
+
29
+ //load admin menu
30
+ function wpbackitup_admin_menus() {
31
+ $wpbackituppage = add_submenu_page( 'tools.php', 'WP BackItUp', 'WP BackItUp', 'manage_options', 'wp-backitup', 'wpbackitup_admin' );
32
+ add_action('admin_print_scripts-'.$wpbackituppage, 'wpbackitup_javascript');
33
+ add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_stylesheet' );
34
+ }
35
+ add_action('admin_menu', 'wpbackitup_admin_menus');
36
+
37
+ //enqueue javascript
38
+ function wpbackitup_javascript() {
39
+ wp_enqueue_script('wpbackitup-javascript', WPBACKITUP_PLUGIN_URL.'/js/wp-backitup.js');
40
+ wp_enqueue_script('ajaxfileupload', WPBACKITUP_PLUGIN_URL.'/js/ajaxfileupload.js');
41
+ }
42
+
43
+ //enqueue stylesheet
44
+ function wpbackitup_stylesheet(){
45
+ wp_enqueue_style('wpbackitup-stylesheet', WPBACKITUP_PLUGIN_URL.'/css/wp-backitup.css');
46
+ }
47
+
48
+ //load plugin functions
49
+ include_once 'includes/functions.php';
50
+
51
+ //load admin page
52
+ function wpbackitup_admin() {
53
+ include_once('includes/admin_page.php');
54
+ }
55
+
56
+ //load backup function
57
+ function wpbackitup_backup() {
58
+ include 'includes/backup.php';
59
+ }
60
+ add_action('wp_ajax_wpbackitup_backup', 'wpbackitup_backup');
61
+
62
+ //load download function
63
+ function wpbackitup_download() {
64
+ include 'includes/download.php';
65
+ }
66
+ add_action('wp_ajax_wpbackitup_download', 'wpbackitup_download');
67
+
68
+ //load download function
69
+ function wpbackitup_logreader() {
70
+ if(file_exists(BACKUP_PATH .'/status.log') ) {
71
+ readfile(BACKUP_PATH .'/status.log');
72
+ }
73
+ die();
74
+ }
75
+ add_action('wp_ajax_wpbackitup_logreader', 'wpbackitup_logreader');
tags/1.0.7/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>Export file created successfully. You can download your export file using the link above.</li></ul>
tags/1.0.7/css/wp-backitup.css ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* WP Backitup CSS */
2
+
3
+ .error { color: #ff0000;}
4
+
5
+ input {padding: 0;}
6
+
7
+ h3 {
8
+ margin: 0;
9
+ padding: 1em 0 0 0;
10
+ }
11
+
12
+ ul {padding: 1em 0 0 0;}
13
+
14
+ iframe {
15
+ height: 0;
16
+ margin: 0;
17
+ padding: 0;
18
+ position: absolute;
19
+ top: 0;
20
+ right: 0;
21
+ width: 0;
22
+ }
23
+
24
+ .wp-backitup-section {clear:both;}
25
+
26
+ #backup-button, #restore-form {
27
+ float: left;
28
+ margin: 0 5px 5px 0;
29
+ }
30
+
31
+ #backup-button a {
32
+ display: block;
33
+ padding: 3px 8px;
34
+ -webkit-border-radius: 10px;
35
+ -moz-border-radius: 10px;
36
+ border-radius: 10px;
37
+ }
38
+
39
+ .status-icon {
40
+ display: inline;
41
+ height: 16px;
42
+ visibility: hidden;
43
+ width: 16px;
44
+ }
45
+
46
+ .status-icon img {margin-top: 3px;}
47
+
48
+ #wp-backitup-restore .status-icon img {margin-top: 7px;}
49
+
50
+ #restore_form {margin-right: 5px;}
51
+
52
+ #restore-button {margin-top: 22px;}
tags/1.0.7/images/loader.gif ADDED
Binary file
tags/1.0.7/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.7/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // 5 minutes per image should be PLENTY
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Export file created successfully. You can download your export file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.0.7/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.0.7/includes/functions.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ) ) { //If $file is a 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
+ //defube db_import function
116
+ if(!function_exists('db_import')) {
117
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
118
+ global $wpdb;
119
+ $sql_files = glob($restoration_dir_path . "/*.sql");
120
+ foreach($sql_files as $sql_file) {
121
+ $templine = ''; // Temporary variable, used to store current query
122
+ $lines = file($sql_file); // Read in entire file
123
+ foreach ($lines as $line) { // Loop through each line
124
+ if (substr($line, 0, 2) == '--' || $line == '') continue; // Skip it if it's a comment
125
+ $templine .= $line; // Add this line to the current segment
126
+ if (substr(trim($line), -1, 1) == ';') { // If it has a semicolon at the end, it's the end of the query
127
+ //replace imported site url with current site url
128
+ if( strstr( trim($templine), trim($import_siteurl) ) == TRUE ) //If import site url is found
129
+ $templine = str_replace( trim($import_siteurl), trim($current_siteurl), $templine ); // Replace import site url with current site url
130
+ //if the table prefixes are different, replace the imported site prefixes with the current prefixes
131
+ if ($table_prefix != $import_table_prefix) {
132
+ if( strstr( trim($templine), trim($import_table_prefix) ) == TRUE ) //If import table prefix is found
133
+ $templine = str_replace( trim($import_table_prefix), trim($table_prefix), $templine ); // Replace import site table prefix with current site table prefix
134
+ }
135
+ // Perform the query
136
+ if( mysqli_query($dbc, $templine) === FALSE)
137
+ print('Error performing query \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />');
138
+ $templine = ''; // Reset temp variable to empty
139
+ }
140
+ }
141
+ }
142
+ return true;
143
+ }
144
+ }
145
+
146
+ //Define zip function
147
+ function zip($source, $destination, $ignore) {
148
+ if (is_string($source)) $source_arr = array($source); // convert it to array
149
+ if (!extension_loaded('zip')) {
150
+ return false;
151
+ }
152
+ $zip = new ZipArchive();
153
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
154
+ return false;
155
+ }
156
+ foreach ($source_arr as $source) {
157
+ if (!file_exists($source)) continue;
158
+ $source = str_replace('\\', '/', realpath($source));
159
+ if (is_dir($source) === true) {
160
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
161
+ foreach ($files as $file) {
162
+ if (!preg_match($ignore, $file)) {
163
+ $file = str_replace('\\', '/', realpath($file));
164
+ if (is_dir($file) === true) {
165
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
166
+ } else if (is_file($file) === true) {
167
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
168
+ }
169
+ }
170
+ }
171
+ } else if (is_file($source) === true) {
172
+ $zip->addFromString(basename($source), file_get_contents($source));
173
+ }
174
+ }
175
+ return $zip->close();
176
+ }
tags/1.0.7/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.7/includes/restore.php ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //define constants
3
+ define("WP_BACKITUP_DIRNAME", basename(dirname(dirname(__FILE__))) );
4
+ define("BACKUP_PATH", dirname(dirname(__FILE__)) .'/backups/' );
5
+ define('WP_CONTENT_PATH', dirname(dirname(dirname(dirname(__FILE__)))));
6
+
7
+ //create log file
8
+ $log = BACKUP_PATH . "status.log";
9
+ $fh = fopen($log, 'w') or die("can't open file");
10
+ fwrite($fh, '<ul>');
11
+
12
+ //include functions
13
+ require('functions.php');
14
+
15
+ // 5 minutes per image should be PLENTY
16
+ @set_time_limit(900);
17
+
18
+
19
+ //Delete any zips in the upload directory first
20
+ foreach (glob(BACKUP_PATH .'*.zip') as $file) {
21
+ unlink($file);
22
+ }
23
+
24
+ //Move the uploaded zip to the plugin directory
25
+ fwrite($fh, "<li>Uploading restoration file...");
26
+ $restore_file_name = basename( $_FILES['wpbackitup-zip']['name']);
27
+ $restore_path = BACKUP_PATH . $restore_file_name;
28
+ if(move_uploaded_file($_FILES['wpbackitup-zip']['tmp_name'], $restore_path)) {
29
+ fwrite($fh, "Done!</li>");
30
+ } else {
31
+ fwrite($fh, "</li><li class=\"error\">Your file could not be uploaded.</li></ul>");
32
+ recursive_delete($restoration_dir_path);
33
+ unlink(BACKUP_PATH . $restore_file_name);
34
+ fclose($fh);
35
+ die();
36
+
37
+ }
38
+
39
+ //Unzip the uploaded restore file
40
+ fwrite($fh, "<li>Unzipping...");
41
+ $zip = new ZipArchive;
42
+ $res = $zip->open(BACKUP_PATH . $restore_file_name);
43
+ if ($res === TRUE) {
44
+ $zip->extractTo(BACKUP_PATH);
45
+ $zip->close();
46
+ fwrite($fh, "Done!</li>");
47
+ } else {
48
+ fwrite($fh, "</li><li class=\"error\">Your restoration file could not be unzipped.</li></ul>");
49
+ recursive_delete($restoration_dir_path);
50
+ unlink(BACKUP_PATH . $restore_file_name);
51
+ fclose($fh);
52
+ die();
53
+ }
54
+
55
+ //Identify the restoration directory
56
+ fwrite($fh, "<li>Validating zip...");
57
+ if(count(glob(BACKUP_PATH . "*", GLOB_ONLYDIR)) == 1) { //does this need wilcard?
58
+ foreach(glob(BACKUP_PATH . "*", GLOB_ONLYDIR) as $dir) { //does this need wilcard?
59
+ $restoration_dir_path = $dir;
60
+ }
61
+ }
62
+ if(glob($restoration_dir_path .'/backupsiteinfo.txt') ){
63
+ fwrite($fh, "Done!</li>");
64
+ } else {
65
+ fwrite($fh, "</li><li class=\"error\">Your zip file does not contain backupsiteinfo.txt. Please choose another file.</li></ul>");
66
+ recursive_delete($restoration_dir_path);
67
+ unlink(BACKUP_PATH . $restore_file_name);
68
+ fclose($fh);
69
+ die();
70
+ }
71
+
72
+ //If themes dir is present, restore it to wp-content
73
+ if(glob($restoration_dir_path . "/themes")) {
74
+ fwrite($fh, "<li>Restoring themes...");
75
+ $themes_dir = WP_CONTENT_PATH .'/themes';
76
+ if(!recursive_delete($themes_dir)) {
77
+ fwrite($fh, "</li><li class=\"error\">Unable to remove existing themes directory for import. Please check your CHMOD settings in /wp-content/themes.</li></ul>");
78
+ recursive_delete($restoration_dir_path);
79
+ unlink(BACKUP_PATH . $restore_file_name);
80
+ fclose($fh);
81
+ die();
82
+ }
83
+ if(!create_dir($themes_dir)) {
84
+ fwrite($fh, "</li><li class=\"error\">Unable to create new themes directory for import. Please check your CHMOD settings in /wp-content/themes.</li></ul>");
85
+ recursive_delete($restoration_dir_path);
86
+ unlink(BACKUP_PATH . $restore_file_name);
87
+ fclose($fh);
88
+ die();
89
+ }
90
+ if(recusive_copy($restoration_dir_path .'/themes', $themes_dir, array( 'cgi-bin', '.', '..','._', $restore_file_name )) ) {
91
+ fwrite($fh, "Done!</li>");
92
+ } else {
93
+ fwrite($fh, "</li><li class=\"error\">Unable to import themes. Please try again.</li></ul>");
94
+ recursive_delete($restoration_dir_path);
95
+ unlink(BACKUP_PATH . $restore_file_name);
96
+ fclose($fh);
97
+ die();
98
+ }
99
+ } else {
100
+ fwrite($fh, "<li class=\"error\">Warning: Themes directory not detected in import file.</li>");
101
+ }
102
+
103
+ //If uploads dir is present, restore it to wp-content
104
+ if(glob($restoration_dir_path . "/uploads")) {
105
+ fwrite($fh, "<li>Restoring uploads...");
106
+ $uploads_dir = WP_CONTENT_PATH .'/uploads';
107
+ if(!recursive_delete($uploads_dir) ){
108
+ fwrite($fh, "</li><li class=\"error\">Unable to create new uploads directory for import. Please check your CHMOD settings in /wp-content/uploads.</li></ul>");
109
+ recursive_delete($restoration_dir_path);
110
+ unlink(BACKUP_PATH . $restore_file_name);
111
+ fclose($fh);
112
+ die();
113
+ }
114
+ if(!create_dir($uploads_dir) ) {
115
+ fwrite($fh, "</li><li class=\"error\">Unable to create new uploads directory for import. Please check your CHMOD settings in /wp-content/uploads.</li></ul>");
116
+ recursive_delete($restoration_dir_path);
117
+ unlink(BACKUP_PATH . $restore_file_name);
118
+ fclose($fh);
119
+ die();
120
+ }
121
+ if (recusive_copy($restoration_dir_path .'/uploads', $uploads_dir, array( 'cgi-bin', '.', '..','._', $restore_file_name )) ) {
122
+ fwrite($fh, "Done!</li>");
123
+ } else {
124
+ fwrite($fh, "</li><li class=\"error\">Unable to import uploads. Please try again.</li></ul>");
125
+ recursive_delete($restoration_dir_path);
126
+ unlink(BACKUP_PATH . $restore_file_name);
127
+ fclose($fh);
128
+ die();
129
+ }
130
+ } else {
131
+ fwrite($fh, "<li class=\"error\">Warning: Uploads directory not detected in import file.</li>");
132
+ }
133
+
134
+ //If plugins dir is present, restore it to wp-content (exclude wp-backitup)
135
+ if(glob($restoration_dir_path . "/plugins")) {
136
+ fwrite($fh, "<li>Restoring plugins...");
137
+ $plugins_dir = WP_CONTENT_PATH .'/plugins';
138
+ if(!recursive_delete($plugins_dir, array('cgi-bin','.','..','._', WP_BACKITUP_DIRNAME) ) ) {
139
+ fwrite($fh, "</li><li class=\"error\">Unable to create new plugins directory for import. Please check your CHMOD settings in /wp-content/plugins.</li></ul>");
140
+ recursive_delete($restoration_dir_path);
141
+ unlink(BACKUP_PATH . $restore_file_name);
142
+ fclose($fh);
143
+ die();
144
+ }
145
+ if(!create_dir($plugins_dir) ){
146
+ fwrite($fh, "</li><li class=\"error\">Unable to create new plugins directory for import. Please check your CHMOD settings in /wp-content/plugins.</li></ul>");
147
+ recursive_delete($restoration_dir_path);
148
+ unlink(BACKUP_PATH . $restore_file_name);
149
+ fclose($fh);
150
+ die();
151
+ }
152
+ if( recusive_copy($restoration_dir_path .'/plugins', $plugins_dir, array( 'cgi-bin', '.', '..','._', $restore_file_name )) ) {
153
+ fwrite($fh, "Done!</li>");
154
+ } else {
155
+ fwrite($fh, "</li><li class=\"error\">Unable to import plugins. Please try again.</li></ul>");
156
+ recursive_delete($restoration_dir_path);
157
+ unlink(BACKUP_PATH . $restore_file_name);
158
+ fclose($fh);
159
+ die();
160
+ }
161
+ } else {
162
+ fwrite($fh, "<li class=\"error\">Warning: Plugins directory not detected in import file.</li>");
163
+ }
164
+
165
+ //if there is a database dump to restore
166
+ if(glob($restoration_dir_path . "/*.sql")) {
167
+ //collect connection information from form
168
+ fwrite($fh, "<li>Restoring database...");
169
+ $db_name = $_POST['db_name'];
170
+ $db_user = $_POST['db_user'];
171
+ $db_pass = $_POST['db_pass'];
172
+ $db_host = $_POST['db_host'];
173
+ $table_prefix = $_POST['table_prefix'];
174
+ $user_id = $_POST['user_id'];
175
+ //Connect to DB
176
+ $dbc = mysqli_connect($db_host, $db_user, $db_pass, $db_name); //OR die ('Could not connect to your database: ' . );
177
+ if ( !$dbc ) {
178
+ fwrite($fh, "</li><li class=\"error\">Unable to connect to your current database: " .mysqli_connect_error() ."</li></ul>");
179
+ recursive_delete($restoration_dir_path);
180
+ unlink(BACKUP_PATH . $restore_file_name);
181
+ fclose($fh);
182
+ die();
183
+ }
184
+ //get siteurl
185
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name =\"siteurl\";";
186
+ if ($result = mysqli_query($dbc, $q1)) {
187
+ while ($row = mysqli_fetch_row($result)) {
188
+ $siteurl = $row[0];
189
+ }
190
+ mysqli_free_result($result);
191
+ } else {
192
+ fwrite($fh, "</li><li class=\"error\">Unable to get current site URL from database. Please try again.</li></ul>");
193
+ recursive_delete($restoration_dir_path);
194
+ unlink(BACKUP_PATH . $restore_file_name);
195
+ fclose($fh);
196
+ die();
197
+ }
198
+ //get homeurl
199
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name =\"home\";";
200
+ if ($result = mysqli_query($dbc, $q2)) {
201
+ while ($row = mysqli_fetch_row($result)) {
202
+ $homeurl = $row[0];
203
+ }
204
+ mysqli_free_result($result);
205
+ } else {
206
+ fwrite($fh, "</li><li class=\"error\">Unable to get current home URL from database. Please try again.</li></ul>");
207
+ recursive_delete($restoration_dir_path);
208
+ unlink(BACKUP_PATH . $restore_file_name);
209
+ fclose($fh);
210
+ die();
211
+ }
212
+ //get user login
213
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
214
+ if ($result = mysqli_query($dbc, $q3)) {
215
+ while ($row = mysqli_fetch_row($result)) {
216
+ $user_login = $row[0];
217
+ }
218
+ mysqli_free_result($result);
219
+ } else {
220
+ fwrite($fh, "</li><li class=\"error\">Unable to get current user ID from database. Please try again.</li></ul>");
221
+ recursive_delete($restoration_dir_path);
222
+ unlink(BACKUP_PATH . $restore_file_name);
223
+ fclose($fh);
224
+ die();
225
+ }
226
+ //get user pass
227
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
228
+ if ($result = mysqli_query($dbc, $q4)) {
229
+ while ($row = mysqli_fetch_row($result)) {
230
+ $user_pass = $row[0];
231
+ }
232
+ mysqli_free_result($result);
233
+ } else {
234
+ fwrite($fh, "</li><li class=\"error\">Unable to get current user password from database. Please try again.</li></ul>");
235
+ recursive_delete($restoration_dir_path);
236
+ unlink(BACKUP_PATH . $restore_file_name);
237
+ fclose($fh);
238
+ die();
239
+ }
240
+ //get user email
241
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
242
+ if ($result = mysqli_query($dbc, $q5)) {
243
+ while ($row = mysqli_fetch_row($result)) {
244
+ $user_email = $row[0];
245
+ }
246
+ mysqli_free_result($result);
247
+ } else {
248
+ fwrite($fh, "</li><li class=\"error\">Unable to get current user email from database. Please try again.</li></ul>");
249
+ recursive_delete($restoration_dir_path);
250
+ unlink(BACKUP_PATH . $restore_file_name);
251
+ fclose($fh);
252
+ die();
253
+ }
254
+ //Collect previous backup site url start
255
+ $import_siteinfo_lines = file($restoration_dir_path .'/backupsiteinfo.txt');
256
+ $import_siteurl = trim($import_siteinfo_lines[0]);
257
+ $current_siteurl = trim($siteurl ,'/');
258
+ $import_table_prefix = $import_siteinfo_lines[1];
259
+ //import the database
260
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
261
+ fwrite($fh, "</li><li class=\"error\">Unable to get import your database. This may require importing the file manually.</li></ul>");
262
+ recursive_delete($restoration_dir_path);
263
+ unlink(BACKUP_PATH . $restore_file_name);
264
+ fclose($fh);
265
+ die();
266
+ }
267
+ //update the database
268
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value=\"" .$current_siteurl ."\" WHERE option_name=\"siteurl\"";
269
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value=\"" .$homeurl ."\" WHERE option_name=\"home\"";
270
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login=\"" .$user_login ."\", user_pass=\"" .$user_pass ."\", user_email=\"" .$user_email ."\" WHERE ID=\"" .$user_id ."\"";
271
+ if(!mysqli_query($dbc, $q6) ) {
272
+ fwrite($fh, "</li><li class=\"error\">Unable to update your current site URL value. This may require importing the file manually.</li></ul>");
273
+ recursive_delete($restoration_dir_path);
274
+ unlink(BACKUP_PATH . $restore_file_name);
275
+ fclose($fh);
276
+ die();
277
+ }
278
+ if(!mysqli_query($dbc, $q7) ) {
279
+ fwrite($fh, "</li><li class=\"error\">Unable to update your current home URL value. This may require importing the file manually.</li></ul>");
280
+ recursive_delete($restoration_dir_path);
281
+ unlink(BACKUP_PATH . $restore_file_name);
282
+ fclose($fh);
283
+ die();
284
+ }
285
+ if(!mysqli_query($dbc, $q8) ) {
286
+ fwrite($fh, "</li><li class=\"error\">Unable to update your user information. This may require importing the file manually.</li></ul>");
287
+ recursive_delete($restoration_dir_path);
288
+ unlink(BACKUP_PATH . $restore_file_name);
289
+ fclose($fh);
290
+ die();
291
+ }
292
+ fwrite($fh, "Done!</li>");
293
+ } else {
294
+ fwrite($fh, "<li class=\"error\">Warning: Database not detected in import file.</li>");
295
+ }
296
+
297
+ //Disconnect
298
+ mysqli_close($dbc);
299
+
300
+ //Delete the restoration directory
301
+ recursive_delete($restoration_dir_path);
302
+
303
+ //Delete zip
304
+ unlink(BACKUP_PATH . $restore_file_name);
305
+
306
+ //close log file
307
+ fwrite($fh, '<li>Restoration complete. Please refresh the page.</li>');
308
+ fwrite($fh, '</ul>');
309
+ fclose($fh);
310
+
311
+ //End backup function
312
+ die();
tags/1.0.7/js/ajaxfileupload.js ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ jQuery.extend({
3
+
4
+
5
+ createUploadIframe: function(id, uri)
6
+ {
7
+ //create frame
8
+ var frameId = 'jUploadFrame' + id;
9
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
10
+ if(window.ActiveXObject)
11
+ {
12
+ if(typeof uri== 'boolean'){
13
+ iframeHtml += ' src="' + 'javascript:false' + '"';
14
+
15
+ }
16
+ else if(typeof uri== 'string'){
17
+ iframeHtml += ' src="' + uri + '"';
18
+
19
+ }
20
+ }
21
+ iframeHtml += ' />';
22
+ jQuery(iframeHtml).appendTo(document.body);
23
+
24
+ return jQuery('#' + frameId).get(0);
25
+ },
26
+ createUploadForm: function(id, fileElementId, data)
27
+ {
28
+ //create form
29
+ var formId = 'jUploadForm' + id;
30
+ var fileId = 'jUploadFile' + id;
31
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
32
+ if(data)
33
+ {
34
+ for(var i in data)
35
+ {
36
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
37
+ }
38
+ }
39
+ var oldElement = jQuery('#' + fileElementId);
40
+ var newElement = jQuery(oldElement).clone();
41
+ jQuery(oldElement).attr('id', fileId);
42
+ jQuery(oldElement).before(newElement);
43
+ jQuery(oldElement).appendTo(form);
44
+
45
+
46
+
47
+ //set attributes
48
+ jQuery(form).css('position', 'absolute');
49
+ jQuery(form).css('top', '-1200px');
50
+ jQuery(form).css('left', '-1200px');
51
+ jQuery(form).appendTo('body');
52
+ return form;
53
+ },
54
+
55
+ ajaxFileUpload: function(s) {
56
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
57
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
58
+ var id = new Date().getTime()
59
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
60
+ var io = jQuery.createUploadIframe(id, s.secureuri);
61
+ var frameId = 'jUploadFrame' + id;
62
+ var formId = 'jUploadForm' + id;
63
+ // Watch for a new set of requests
64
+ if ( s.global && ! jQuery.active++ )
65
+ {
66
+ jQuery.event.trigger( "ajaxStart" );
67
+ }
68
+ var requestDone = false;
69
+ // Create the request object
70
+ var xml = {}
71
+ if ( s.global )
72
+ jQuery.event.trigger("ajaxSend", [xml, s]);
73
+ // Wait for a response to come back
74
+ var uploadCallback = function(isTimeout)
75
+ {
76
+ var io = document.getElementById(frameId);
77
+ try
78
+ {
79
+ if(io.contentWindow)
80
+ {
81
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
82
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
83
+
84
+ }else if(io.contentDocument)
85
+ {
86
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
87
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
88
+ }
89
+ }catch(e)
90
+ {
91
+ jQuery.handleError(s, xml, null, e);
92
+ }
93
+ if ( xml || isTimeout == "timeout")
94
+ {
95
+ requestDone = true;
96
+ var status;
97
+ try {
98
+ status = isTimeout != "timeout" ? "success" : "error";
99
+ // Make sure that the request was successful or notmodified
100
+ if ( status != "error" )
101
+ {
102
+ // process the data (runs the xml through httpData regardless of callback)
103
+ var data = jQuery.uploadHttpData( xml, s.dataType );
104
+ // If a local callback was specified, fire it and pass it the data
105
+ if ( s.success )
106
+ s.success( data, status );
107
+
108
+ // Fire the global callback
109
+ if( s.global )
110
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
111
+ } else
112
+ jQuery.handleError(s, xml, status);
113
+ } catch(e)
114
+ {
115
+ status = "error";
116
+ jQuery.handleError(s, xml, status, e);
117
+ }
118
+
119
+ // The request was completed
120
+ if( s.global )
121
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
122
+
123
+ // Handle the global AJAX counter
124
+ if ( s.global && ! --jQuery.active )
125
+ jQuery.event.trigger( "ajaxStop" );
126
+
127
+ // Process result
128
+ if ( s.complete )
129
+ s.complete(xml, status);
130
+
131
+ jQuery(io).unbind()
132
+
133
+ setTimeout(function()
134
+ { try
135
+ {
136
+ jQuery(io).remove();
137
+ jQuery(form).remove();
138
+
139
+ } catch(e)
140
+ {
141
+ jQuery.handleError(s, xml, null, e);
142
+ }
143
+
144
+ }, 100)
145
+
146
+ xml = null
147
+
148
+ }
149
+ }
150
+ // Timeout checker
151
+ if ( s.timeout > 0 )
152
+ {
153
+ setTimeout(function(){
154
+ // Check to see if the request is still happening
155
+ if( !requestDone ) uploadCallback( "timeout" );
156
+ }, s.timeout);
157
+ }
158
+ try
159
+ {
160
+
161
+ var form = jQuery('#' + formId);
162
+ jQuery(form).attr('action', s.url);
163
+ jQuery(form).attr('method', 'POST');
164
+ jQuery(form).attr('target', frameId);
165
+ if(form.encoding)
166
+ {
167
+ jQuery(form).attr('encoding', 'multipart/form-data');
168
+ }
169
+ else
170
+ {
171
+ jQuery(form).attr('enctype', 'multipart/form-data');
172
+ }
173
+ jQuery(form).submit();
174
+
175
+ } catch(e)
176
+ {
177
+ jQuery.handleError(s, xml, null, e);
178
+ }
179
+
180
+ jQuery('#' + frameId).load(uploadCallback );
181
+ return {abort: function () {}};
182
+
183
+ },
184
+
185
+ uploadHttpData: function( r, type ) {
186
+ var data = !type;
187
+ data = type == "xml" || data ? r.responseXML : r.responseText;
188
+ // If the type is "script", eval it in global context
189
+ if ( type == "script" )
190
+ jQuery.globalEval( data );
191
+ // Get the JavaScript object, if JSON is used.
192
+ if ( type == "json" )
193
+ eval( "data = " + data );
194
+ // evaluate scripts within html
195
+ if ( type == "html" )
196
+ jQuery("<div>").html(data).evalScripts();
197
+
198
+ return data;
199
+ }
200
+ })
201
+
tags/1.0.7/js/wp-backitup.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
tags/1.0.7/readme.txt ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: jcpeden
3
+ Donate link: http://www.wpbackitup.com
4
+ Tags: backup, restore, clone, database, wp-content, files
5
+ Requires at least: 3.4
6
+ Tested up to: 3.4.2
7
+ Stable tag: 1.0.7
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ WP BackItUp allows you to backup your database and wp-content folder. This allows you to quickly clone, backup and restore any of your Wordpress sites.
12
+
13
+ == Description ==
14
+
15
+ WP BackItUp uses nothing but PHP to allow you to backup and restore your Wordpress database, plugins, themes and uploads directories. You can create a
16
+ backup of any site and, using WP BackItUp, quickly import your files, settings and content into a new site.
17
+
18
+ == Installation ==
19
+
20
+ Installation of the plugin is straightforward:
21
+
22
+ 1. Upload the directory `wp-backitup` to the `/wp-content/plugins/` directory.
23
+ 1. Activate the plugin through the `Plugins` menu in WordPress.
24
+ 1. Through the Wordpress dashboard, browse to Tools > WP BackItUp.
25
+
26
+ == Frequently Asked Questions ==
27
+
28
+
29
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
30
+ Yes
31
+
32
+ = Will WP Backitup work on Windows hosting? =
33
+ Yes
34
+
35
+ = Are you going to be making progress bars both for backing up and restoring with this plugin? =
36
+ Not at this time.
37
+
38
+ = Can this plugin back to Amazon S3? =
39
+ Not at this time.
40
+
41
+ = Is there an auto back up schedule feature? =
42
+ Not at this time.
43
+
44
+ = Will the plugin work with Wordpres version x.x? =
45
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
46
+
47
+ = Can this backup one version of WordPress to a different version? =
48
+ No. It is absolutely critical that your WordPress versions are exactly the same.
49
+
50
+ = Will WP Backitup work on WordPress Multisite? =
51
+ It is untested with Wordpress multisite and probably will not work.
52
+
53
+ = Does the plugin copy the database details as well? =
54
+ Yes, a database dump is created with each backup.
55
+
56
+ = 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? =
57
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
58
+
59
+ = Does WP Backitup need to be installed? =
60
+ 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.
61
+
62
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
63
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
64
+
65
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
66
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
67
+
68
+ = Do you do regularly update this product to match with WP version updates? =
69
+ Yes.
70
+
71
+ == Screenshots ==
72
+ 1. Once activated, the plugin loads a new menu into Tools > WP Backitup.
73
+ 2. Simply click 'Export' to generate a backup of your site. The plugin will update you on its progress.
74
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
75
+
76
+ == Changelog ==
77
+
78
+ = 1.0.6 =
79
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
80
+
81
+ = 1.0.5 =
82
+ * 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.
83
+
84
+ = 1.0.4 =
85
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
86
+
87
+ = 1.0.3 =
88
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
89
+
90
+ = 1.0.2 =
91
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
92
+
93
+ = 1.0.1 =
94
+ * Increased PHP timeout to 900 seconds (5 minutes).
95
+
96
+ = 1.0 =
97
+ * Plugin released.
98
+
99
+ == Upgrade Notice ==
100
+
101
+ = 1.0.6 =
102
+ * Non-critical upgrade.
103
+
104
+ = 1.0.5 =
105
+ * Critical upgrade: More stable, increased flexibility and power.
106
+
107
+ = 1.0.4 =
108
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
109
+
110
+ = 1.0.3 =
111
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
112
+
113
+ = 1.0.2 =
114
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
115
+
116
+ = 1.0.1 =
117
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
118
+
119
+ = 1.0 =
120
+ Initial version of the plugin.
tags/1.0.7/screenshots/screenshot-1.png ADDED
Binary file
tags/1.0.7/screenshots/screenshot-2.png ADDED
Binary file
tags/1.0.7/screenshots/screenshot-3.png ADDED
Binary file
tags/1.0.7/wp-backitup.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP BackItUp
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.0.7
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 C. Peden ( email : mail@johncpeden.com )
15
+ */
16
+
17
+ //define constants
18
+ define("WPBACKITUP_PLUGIN_URL", WP_PLUGIN_URL ."/wp-backitup/");
19
+ define("WPBACKITUP_PLUGIN_PATH", WP_PLUGIN_DIR."/wp-backitup/");
20
+ define("WPBACKITUP_DIRNAME", "wp-backitup");
21
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
22
+
23
+ //add plugin options
24
+ function wpbackitup_options_init() {
25
+ register_setting ('wpbackitup_options', 'wpbackitup', 'wpbackitup_options_validate');
26
+ }
27
+ add_action('admin_init', 'wpbackitup_options_init' );
28
+
29
+ //load admin menu
30
+ function wpbackitup_admin_menus() {
31
+ $wpbackituppage = add_submenu_page( 'tools.php', 'WP BackItUp', 'WP BackItUp', 'manage_options', 'wp-backitup', 'wpbackitup_admin' );
32
+ add_action('admin_print_scripts-'.$wpbackituppage, 'wpbackitup_javascript');
33
+ add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_stylesheet' );
34
+ }
35
+ add_action('admin_menu', 'wpbackitup_admin_menus');
36
+
37
+ //enqueue javascript
38
+ function wpbackitup_javascript() {
39
+ wp_enqueue_script('wpbackitup-javascript', WPBACKITUP_PLUGIN_URL.'/js/wp-backitup.js');
40
+ wp_enqueue_script('ajaxfileupload', WPBACKITUP_PLUGIN_URL.'/js/ajaxfileupload.js');
41
+ }
42
+
43
+ //enqueue stylesheet
44
+ function wpbackitup_stylesheet(){
45
+ wp_enqueue_style('wpbackitup-stylesheet', WPBACKITUP_PLUGIN_URL.'/css/wp-backitup.css');
46
+ }
47
+
48
+ //load plugin functions
49
+ include_once 'includes/functions.php';
50
+
51
+ //load admin page
52
+ function wpbackitup_admin() {
53
+ include_once('includes/admin_page.php');
54
+ }
55
+
56
+ //load backup function
57
+ function wpbackitup_backup() {
58
+ include 'includes/backup.php';
59
+ }
60
+ add_action('wp_ajax_wpbackitup_backup', 'wpbackitup_backup');
61
+
62
+ //load download function
63
+ function wpbackitup_download() {
64
+ include 'includes/download.php';
65
+ }
66
+ add_action('wp_ajax_wpbackitup_download', 'wpbackitup_download');
67
+
68
+ //load download function
69
+ function wpbackitup_logreader() {
70
+ if(file_exists(BACKUP_PATH .'/status.log') ) {
71
+ readfile(BACKUP_PATH .'/status.log');
72
+ }
73
+ die();
74
+ }
75
+ add_action('wp_ajax_wpbackitup_logreader', 'wpbackitup_logreader');
tags/1.0.8/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>
tags/1.0.8/css/wp-backitup.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
{images → tags/1.0.8/images}/icon.png RENAMED
File without changes
{images → tags/1.0.8/images}/icon32.png RENAMED
File without changes
tags/1.0.8/images/loader.gif ADDED
Binary file
tags/1.0.8/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.8/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip' ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.0.8/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.0.8/includes/functions.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
tags/1.0.8/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.8/js/wp-backitup.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
tags/1.0.8/readme.txt ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Backitup ===
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.0.8
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 creates a backup zip of your site&apos;s content and configuration in just a single click, right from your Wordpress dashboard. There is no need to FTP into your site and no knowledge of MySQL or PHPMyAdmin is required.
17
+
18
+ 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.
19
+
20
+ = Automatically Restore Your Backup Zips =
21
+ The optional <a href="http://www.wpbackitup.com/addons/" title="WP Backitup Restoration Addon">WP Backitup Restoration Addon</a> can be purchased from the plugin site and 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>).
22
+
23
+ = Manually Restore Your Backup Zips =
24
+ 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.
25
+
26
+ = Easy To Install and Use =
27
+ 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).
28
+
29
+ = More questions? =
30
+ 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://wordpress.org/extend/plugins/wp-backitup/faq/" title="WP Backitup FAQ">FAQ page</a>?
31
+
32
+ == Installation ==
33
+
34
+ Installation of the plugin is straightforward:
35
+
36
+ 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
37
+ 1. Activate the plugin.
38
+ 1. A new menu called 'Backup/Restore' will be added to your toolbar.
39
+ 1. Click 'Backup/Restore' to access WP-Backitup
40
+
41
+ == Frequently Asked Questions ==
42
+
43
+ = Can I manually restore my backup zips? =
44
+ 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.
45
+
46
+ = Is there an easier way to restore my backup zips? =
47
+ Yes, purchase and download the <a href="http://www.wpbackitup.com/addons/" title="WP Backitup Restoration Addon">WP Backitup Restoration Addon</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
48
+
49
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
50
+ It is tested on a wide variety of hosting environments and site configurations. Please use the <a href="http://wordpress.org/support/plugin/wp-backitup">support forum</a> if you are having trouble.
51
+
52
+ = Will WP Backitup work on Windows hosting? =
53
+ Yes.
54
+
55
+ = Are you going to be making progress bars both for backing up and restoring with this plugin? =
56
+ This will be available in a future release.
57
+
58
+ = Can this plugin back to Amazon S3/Dropbox? =
59
+ This will be available in a future release.
60
+
61
+ = Is there an auto back up schedule feature? =
62
+ This will be available in a future release.
63
+
64
+ = Will the plugin work with Wordpres version x.x? =
65
+ WP Backitup is untested on older versions of Wordpress. Please feel free to try it and use the <a href="http://wordpress.org/support/plugin/wp-backitup">support forum</a> or the voting system on the <a href="http://wordpress.org/support/plugin/wp-backitup">plugin page</a> to tell others.
66
+
67
+ = Can this backup one version of WordPress to a different version? =
68
+ No. It is absolutely critical that your WordPress versions are exactly the same.
69
+
70
+ = Will WP Backitup work on WordPress Multisite? =
71
+ The plugin can be network-activated within WPMS but sites must be backed-up individually.
72
+
73
+ = Does the plugin copy the database details as well? =
74
+ Yes, a database dump is created with each backup.
75
+
76
+ = 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? =
77
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
78
+
79
+ = Does WP Backitup need to be installed? =
80
+ 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.
81
+
82
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
83
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
84
+
85
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
86
+ I`ve tested up to 15 themes, 40 plugins and 350 posts/pages without any issues.
87
+
88
+ = Do you do regularly update this product to match with WP version updates? =
89
+ Yes.
90
+
91
+ == Screenshots ==
92
+ 1. Once activated, the plugin loads a new menu into your toolbar.
93
+ 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on its progress.
94
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
95
+
96
+ == Changelog ==
97
+
98
+ = 1.0.8 =
99
+ * Modified plugin administration and loaded menu tab in main toolbar.
100
+
101
+ = 1.0.7 =
102
+ * 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.
103
+
104
+ = 1.0.6 =
105
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
106
+
107
+ = 1.0.5 =
108
+ * 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.
109
+
110
+ = 1.0.4 =
111
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
112
+
113
+ = 1.0.3 =
114
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
115
+
116
+ = 1.0.2 =
117
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
118
+
119
+ = 1.0.1 =
120
+ * Increased PHP timeout to 900 seconds (5 minutes).
121
+
122
+ = 1.0 =
123
+ * Plugin released.
124
+
125
+ == Upgrade Notice ==
126
+
127
+ = 1.0.8 =
128
+ * Recommended upgrade. Added links to admin menu.
129
+
130
+ = 1.0.7 =
131
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
132
+
133
+ = 1.0.6 =
134
+ * Non-critical upgrade.
135
+
136
+ = 1.0.5 =
137
+ * Critical upgrade: More stable, increased flexibility and power.
138
+
139
+ = 1.0.4 =
140
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
141
+
142
+ = 1.0.3 =
143
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
144
+
145
+ = 1.0.2 =
146
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
147
+
148
+ = 1.0.1 =
149
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
150
+
151
+ = 1.0 =
152
+ Initial version of the plugin.
tags/1.0.8/screenshots/screenshot-1.png ADDED
Binary file
tags/1.0.8/screenshots/screenshot-2.png ADDED
Binary file
tags/1.0.8/screenshots/screenshot-3.png ADDED
Binary file
tags/1.0.8/wp-backitup.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Backitup
4
+ * Plugin URI: http://wordpress.org/extend/plugins/wp-backitup/
5
+ * Description: Backup your content, settings, themes, plugins and media in just a few simple clicks.
6
+ * Version: 1.0.8
7
+ * Author: John Peden
8
+ * Author URI: http://www.wpbackitup.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", WP_PLUGIN_URL ."/wp-backitup/");
19
+ define("WPBACKITUP_PLUGIN_PATH", WP_PLUGIN_DIR."/wp-backitup/");
20
+ define("WPBACKITUP_DIRNAME", "wp-backitup");
21
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
22
+
23
+ //load admin menu
24
+ function wpbackitup_admin_menus() {
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_scripts-'.$wpbackituppage, 'wpbackitup_javascript');
27
+ add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_stylesheet' );
28
+ }
29
+ add_action('admin_menu', 'wpbackitup_admin_menus');
30
+
31
+ //enqueue javascript
32
+ function wpbackitup_javascript() {
33
+ wp_enqueue_script('wpbackitup-javascript', WPBACKITUP_PLUGIN_URL.'/js/wp-backitup.js');
34
+ //this needs moved to addon dir (as above)
35
+ wp_enqueue_script('ajaxfileupload', WPBACKITUP_PLUGIN_URL.'/js/ajaxfileupload.js');
36
+ }
37
+
38
+ //enqueue stylesheet
39
+ function wpbackitup_stylesheet(){
40
+ wp_enqueue_style('wpbackitup-stylesheet', WPBACKITUP_PLUGIN_URL.'/css/wp-backitup.css');
41
+ }
42
+
43
+ //load plugin functions
44
+ include_once 'includes/functions.php';
45
+
46
+ //load admin page
47
+ function wpbackitup_admin() {
48
+ include_once('includes/admin_page.php');
49
+ }
50
+
51
+ //load backup function
52
+ function wpbackitup_backup() {
53
+ include 'includes/backup.php';
54
+ }
55
+ add_action('wp_ajax_wpbackitup_backup', 'wpbackitup_backup');
56
+
57
+ //load download function
58
+ function wpbackitup_download() {
59
+ include 'includes/download.php';
60
+ }
61
+ add_action('wp_ajax_wpbackitup_download', 'wpbackitup_download');
62
+
63
+ //load download function
64
+ function wpbackitup_logreader() {
65
+ if(file_exists(BACKUP_PATH .'/status.log') ) {
66
+ readfile(BACKUP_PATH .'/status.log');
67
+ }
68
+ die();
69
+ }
70
+ add_action('wp_ajax_wpbackitup_logreader', 'wpbackitup_logreader');
71
+
72
+ //load addons
73
+ if(is_dir(WPBACKITUP_PLUGIN_PATH . "addons")){
74
+ foreach(glob(WPBACKITUP_PLUGIN_PATH . "addons/*/") as $addon) {
75
+ include_once $addon .'index.php';
76
+ }
77
+ }
tags/1.0.9/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>
tags/1.0.9/css/wp-backitup.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
tags/1.0.9/images/icon.png ADDED
Binary file
tags/1.0.9/images/icon32.png ADDED
Binary file
tags/1.0.9/images/loader.gif ADDED
Binary file
tags/1.0.9/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.9/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip' ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.0.9/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.0.9/includes/functions.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
tags/1.0.9/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.0.9/js/wp-backitup.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
tags/1.0.9/readme.txt ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Backitup ===
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.0.9
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 creates a backup zip of your site&apos;s content and configuration in just a single click, right from your Wordpress dashboard. There is no need to FTP into your site and no knowledge of MySQL or PHPMyAdmin is required.
17
+
18
+ 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.
19
+
20
+ = Automatically Restore Your Backup Zips =
21
+ The optional <a href="http://www.wpbackitup.com/addons/" title="WP Backitup Restoration Addon">WP Backitup Restoration Addon</a> can be purchased from the plugin site and 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>).
22
+
23
+ = Manually Restore Your Backup Zips =
24
+ 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.
25
+
26
+ = Easy To Install and Use =
27
+ 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).
28
+
29
+ = More questions? =
30
+ 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://wordpress.org/extend/plugins/wp-backitup/faq/" title="WP Backitup FAQ">FAQ page</a>?
31
+
32
+ == Installation ==
33
+
34
+ Installation of the plugin is straightforward:
35
+
36
+ 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
37
+ 1. Activate the plugin.
38
+ 1. A new menu called 'Backup/Restore' will be added to your toolbar.
39
+ 1. Click 'Backup/Restore' to access WP-Backitup
40
+
41
+ == Frequently Asked Questions ==
42
+
43
+ = Can I manually restore my backup zips? =
44
+ 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.
45
+
46
+ = Is there an easier way to restore my backup zips? =
47
+ Yes, purchase and download the <a href="http://www.wpbackitup.com/addons/" title="WP Backitup Restoration Addon">WP Backitup Restoration Addon</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
48
+
49
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
50
+ Yes
51
+
52
+ = Will WP Backitup work on Windows hosting? =
53
+ Yes
54
+
55
+ = Are you going to be making progress bars both for backing up and restoring with this plugin? =
56
+ Not at this time.
57
+
58
+ = Can this plugin back to Amazon S3? =
59
+ Not at this time.
60
+
61
+ = Is there an auto back up schedule feature? =
62
+ Not at this time.
63
+
64
+ = Will the plugin work with Wordpres version x.x? =
65
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
66
+
67
+ = Can this backup one version of WordPress to a different version? =
68
+ No. It is absolutely critical that your WordPress versions are exactly the same.
69
+
70
+ = Will WP Backitup work on WordPress Multisite? =
71
+ It is untested with Wordpress multisite and probably will not work.
72
+
73
+ = Does the plugin copy the database details as well? =
74
+ Yes, a database dump is created with each backup.
75
+
76
+ = 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? =
77
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
78
+
79
+ = Does WP Backitup need to be installed? =
80
+ 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.
81
+
82
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
83
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
84
+
85
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
86
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
87
+
88
+ = Do you do regularly update this product to match with WP version updates? =
89
+ Yes.
90
+
91
+ == Screenshots ==
92
+ 1. Once activated, the plugin loads a new menu into your toolbar.
93
+ 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on its progress.
94
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
95
+
96
+ == Changelog ==
97
+
98
+ = 1.0.9 =
99
+ * Added Presstrends tracking code.
100
+
101
+ = 1.0.8 =
102
+ * Modified plugin administration and loaded menu tab in main toolbar.
103
+
104
+ = 1.0.7 =
105
+ * 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.
106
+
107
+ = 1.0.6 =
108
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
109
+
110
+ = 1.0.5 =
111
+ * 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.
112
+
113
+ = 1.0.4 =
114
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
115
+
116
+ = 1.0.3 =
117
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
118
+
119
+ = 1.0.2 =
120
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
121
+
122
+ = 1.0.1 =
123
+ * Increased PHP timeout to 900 seconds (5 minutes).
124
+
125
+ = 1.0 =
126
+ * Plugin released.
127
+
128
+ == Upgrade Notice ==
129
+
130
+ = 1.0.9 =
131
+ * Non-essential upgrade. Added Presstrends code.
132
+
133
+ = 1.0.8 =
134
+ * Recommended upgrade. Added links to admin menu.
135
+
136
+ = 1.0.7 =
137
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
138
+
139
+ = 1.0.6 =
140
+ * Non-critical upgrade.
141
+
142
+ = 1.0.5 =
143
+ * Critical upgrade: More stable, increased flexibility and power.
144
+
145
+ = 1.0.4 =
146
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
147
+
148
+ = 1.0.3 =
149
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
150
+
151
+ = 1.0.2 =
152
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
153
+
154
+ = 1.0.1 =
155
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
156
+
157
+ = 1.0 =
158
+ Initial version of the plugin.
tags/1.0.9/screenshots/screenshot-1.png ADDED
Binary file
tags/1.0.9/screenshots/screenshot-2.png ADDED
Binary file
tags/1.0.9/screenshots/screenshot-3.png ADDED
Binary file
tags/1.0.9/wp-backitup.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Backitup
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.0
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", WP_PLUGIN_URL ."/wp-backitup/");
19
+ define("WPBACKITUP_PLUGIN_PATH", WP_PLUGIN_DIR."/wp-backitup/");
20
+ define("WPBACKITUP_DIRNAME", "wp-backitup");
21
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
22
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
23
+
24
+ //load admin menu
25
+ function wpbackitup_admin_menus() {
26
+ $wpbackituppage = add_menu_page( __( 'WP Backitup', 'wpBackitup' ), __( 'Backup', 'wpBackitup' ), 'manage_options', 'wp-backitup', 'wpbackitup_admin', plugin_dir_url(__FILE__ ) .'images/icon.png', 77);
27
+ add_action('admin_print_scripts-'.$wpbackituppage, 'wpbackitup_javascript');
28
+ add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_stylesheet' );
29
+ }
30
+ add_action('admin_menu', 'wpbackitup_admin_menus');
31
+
32
+ //enqueue javascript
33
+ function wpbackitup_javascript() {
34
+ wp_enqueue_script('wpbackitup-javascript', WPBACKITUP_PLUGIN_URL.'/js/wp-backitup.js');
35
+ //this needs moved to addon dir (as above)
36
+ wp_enqueue_script('ajaxfileupload', WPBACKITUP_PLUGIN_URL.'/js/ajaxfileupload.js');
37
+ }
38
+
39
+ //enqueue stylesheet
40
+ function wpbackitup_stylesheet(){
41
+ wp_enqueue_style('wpbackitup-stylesheet', WPBACKITUP_PLUGIN_URL.'/css/wp-backitup.css');
42
+ }
43
+
44
+ //load plugin functions
45
+ include_once 'includes/functions.php';
46
+
47
+ //load admin page
48
+ function wpbackitup_admin() {
49
+ include_once('includes/admin_page.php');
50
+ }
51
+
52
+ //load backup function
53
+ function wpbackitup_backup() {
54
+ include 'includes/backup.php';
55
+ }
56
+ add_action('wp_ajax_wpbackitup_backup', 'wpbackitup_backup');
57
+
58
+ //load download function
59
+ function wpbackitup_download() {
60
+ include 'includes/download.php';
61
+ }
62
+ add_action('wp_ajax_wpbackitup_download', 'wpbackitup_download');
63
+
64
+ //load download function
65
+ function wpbackitup_logreader() {
66
+ if(file_exists(BACKUP_PATH .'/status.log') ) {
67
+ readfile(BACKUP_PATH .'/status.log');
68
+ }
69
+ die();
70
+ }
71
+ add_action('wp_ajax_wpbackitup_logreader', 'wpbackitup_logreader');
72
+
73
+ //load addons
74
+ function dir_contains_children($dir) {
75
+ $result = false;
76
+ if($dh = opendir($dir)) {
77
+ while(!$result && ($file = readdir($dh)) !== false) {
78
+ if($file != ("."||"..") {
79
+ include $file;
80
+ }
81
+ }
82
+ closedir($dh);
83
+ }
84
+
85
+ /**
86
+ * PressTrends Plugin API
87
+ */
88
+ function presstrends_WPBackitup_plugin() {
89
+
90
+ // PressTrends Account API Key
91
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
92
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
93
+
94
+ // Start of Metrics
95
+ global $wpdb;
96
+ $data = get_transient( 'presstrends_cache_data' );
97
+ if ( !$data || $data == '' ) {
98
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
99
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
100
+
101
+ $count_posts = wp_count_posts();
102
+ $count_pages = wp_count_posts( 'page' );
103
+ $comments_count = wp_count_comments();
104
+
105
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
106
+ if ( function_exists( 'wp_get_theme' ) ) {
107
+ $theme_data = wp_get_theme();
108
+ $theme_name = urlencode( $theme_data->Name );
109
+ } else {
110
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
111
+ $theme_name = $theme_data['Name'];
112
+ }
113
+
114
+ $plugin_name = '&';
115
+ foreach ( get_plugins() as $plugin_info ) {
116
+ $plugin_name .= $plugin_info['Name'] . '&';
117
+ }
118
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
119
+ $plugin_data = get_plugin_data( __FILE__ );
120
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
121
+ $data = array(
122
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
123
+ 'posts' => $count_posts->publish,
124
+ 'pages' => $count_pages->publish,
125
+ 'comments' => $comments_count->total_comments,
126
+ 'approved' => $comments_count->approved,
127
+ 'spam' => $comments_count->spam,
128
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
129
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
130
+ 'theme_version' => $plugin_data['Version'],
131
+ 'theme_name' => $theme_name,
132
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
133
+ 'plugins' => count( get_option( 'active_plugins' ) ),
134
+ 'plugin' => urlencode( $plugin_name ),
135
+ 'wpversion' => get_bloginfo( 'version' ),
136
+ );
137
+
138
+ foreach ( $data as $k => $v ) {
139
+ $url .= $k . '/' . $v . '/';
140
+ }
141
+ wp_remote_get( $url );
142
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
143
+ }
144
+ }
145
+
146
+ // PressTrends WordPress Action
147
+ add_action('admin_init', 'presstrends_WPBackitup_plugin');
tags/1.1.0/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>
tags/1.1.0/css/wp-backitup.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
tags/1.1.0/images/icon.png ADDED
Binary file
tags/1.1.0/images/icon32.png ADDED
Binary file
tags/1.1.0/images/loader.gif ADDED
Binary file
tags/1.1.0/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.0/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip' ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.1.0/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.1.0/includes/functions.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
tags/1.1.0/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.0/js/wp-backitup.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
tags/1.1.0/readme.txt ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Backitup ===
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.0
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 creates a backup zip of your site&apos;s content and configuration in just a single click, right from your Wordpress dashboard. There is no need to FTP into your site and no knowledge of MySQL or PHPMyAdmin is required.
17
+
18
+ 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.
19
+
20
+ = Automatically Restore Your Backup Zips =
21
+ The optional <a href="http://www.wpbackitup.com/addons/" title="WP Backitup Restoration Addon">WP Backitup Restoration Addon</a> can be purchased from the plugin site and 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>).
22
+
23
+ = Manually Restore Your Backup Zips =
24
+ 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.
25
+
26
+ = Easy To Install and Use =
27
+ 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).
28
+
29
+ = More questions? =
30
+ 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://wordpress.org/extend/plugins/wp-backitup/faq/" title="WP Backitup FAQ">FAQ page</a>?
31
+
32
+ == Installation ==
33
+
34
+ Installation of the plugin is straightforward:
35
+
36
+ 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
37
+ 1. Activate the plugin.
38
+ 1. A new menu called 'Backup/Restore' will be added to your toolbar.
39
+ 1. Click 'Backup/Restore' to access WP-Backitup
40
+
41
+ == Frequently Asked Questions ==
42
+
43
+ = Can I manually restore my backup zips? =
44
+ 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.
45
+
46
+ = Is there an easier way to restore my backup zips? =
47
+ Yes, purchase and download the <a href="http://www.wpbackitup.com/addons/" title="WP Backitup Restoration Addon">WP Backitup Restoration Addon</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
48
+
49
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
50
+ Yes
51
+
52
+ = Will WP Backitup work on Windows hosting? =
53
+ Yes
54
+
55
+ = Are you going to be making progress bars both for backing up and restoring with this plugin? =
56
+ Not at this time.
57
+
58
+ = Can this plugin back to Amazon S3? =
59
+ Not at this time.
60
+
61
+ = Is there an auto back up schedule feature? =
62
+ Not at this time.
63
+
64
+ = Will the plugin work with Wordpres version x.x? =
65
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
66
+
67
+ = Can this backup one version of WordPress to a different version? =
68
+ No. It is absolutely critical that your WordPress versions are exactly the same.
69
+
70
+ = Will WP Backitup work on WordPress Multisite? =
71
+ It is untested with Wordpress multisite and probably will not work.
72
+
73
+ = Does the plugin copy the database details as well? =
74
+ Yes, a database dump is created with each backup.
75
+
76
+ = 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? =
77
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
78
+
79
+ = Does WP Backitup need to be installed? =
80
+ 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.
81
+
82
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
83
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
84
+
85
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
86
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
87
+
88
+ = Do you do regularly update this product to match with WP version updates? =
89
+ Yes.
90
+
91
+ == Screenshots ==
92
+ 1. Once activated, the plugin loads a new menu into your toolbar.
93
+ 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on its progress.
94
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
95
+
96
+ == Changelog ==
97
+
98
+ = 1.1.0 =
99
+ * Fixed bugs with addons system.
100
+
101
+ = 1.0.9 =
102
+ * Added Presstrends tracking code.
103
+
104
+ = 1.0.8 =
105
+ * Modified plugin administration and loaded menu tab in main toolbar.
106
+
107
+ = 1.0.7 =
108
+ * 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.
109
+
110
+ = 1.0.6 =
111
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
112
+
113
+ = 1.0.5 =
114
+ * 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.
115
+
116
+ = 1.0.4 =
117
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
118
+
119
+ = 1.0.3 =
120
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
121
+
122
+ = 1.0.2 =
123
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
124
+
125
+ = 1.0.1 =
126
+ * Increased PHP timeout to 900 seconds (5 minutes).
127
+
128
+ = 1.0 =
129
+ * Plugin released.
130
+
131
+ == Upgrade Notice ==
132
+
133
+ = 1.1.0 =
134
+ * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
135
+
136
+ = 1.0.9 =
137
+ * Non-essential upgrade. Added Presstrends code.
138
+
139
+ = 1.0.8 =
140
+ * Recommended upgrade. Added links to admin menu.
141
+
142
+ = 1.0.7 =
143
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
144
+
145
+ = 1.0.6 =
146
+ * Non-critical upgrade.
147
+
148
+ = 1.0.5 =
149
+ * Critical upgrade: More stable, increased flexibility and power.
150
+
151
+ = 1.0.4 =
152
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
153
+
154
+ = 1.0.3 =
155
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
156
+
157
+ = 1.0.2 =
158
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
159
+
160
+ = 1.0.1 =
161
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
162
+
163
+ = 1.0 =
164
+ Initial version of the plugin.
tags/1.1.0/screenshots/screenshot-1.png ADDED
Binary file
tags/1.1.0/screenshots/screenshot-2.png ADDED
Binary file
tags/1.1.0/screenshots/screenshot-3.png ADDED
Binary file
tags/1.1.0/wp-backitup.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Backitup
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.0
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", WP_PLUGIN_URL ."/wp-backitup/");
19
+ define("WPBACKITUP_PLUGIN_PATH", WP_PLUGIN_DIR."/wp-backitup/");
20
+ define("WPBACKITUP_DIRNAME", "wp-backitup");
21
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
22
+ define("BACKUP_PATH", WPBACKITUP_PLUGIN_PATH .'backups/');
23
+
24
+ //load admin menu
25
+ function wpbackitup_admin_menus() {
26
+ $wpbackituppage = add_menu_page( __( 'WP Backitup', 'wpBackitup' ), __( 'Backup', 'wpBackitup' ), 'manage_options', 'wp-backitup', 'wpbackitup_admin', plugin_dir_url(__FILE__ ) .'images/icon.png', 77);
27
+ add_action('admin_print_scripts-'.$wpbackituppage, 'wpbackitup_javascript');
28
+ add_action('admin_print_styles-' .$wpbackituppage, 'wpbackitup_stylesheet' );
29
+ }
30
+ add_action('admin_menu', 'wpbackitup_admin_menus');
31
+
32
+ //enqueue javascript
33
+ function wpbackitup_javascript() {
34
+ wp_enqueue_script('wpbackitup-javascript', WPBACKITUP_PLUGIN_URL.'/js/wp-backitup.js');
35
+ //this needs moved to addon dir (as above)
36
+ wp_enqueue_script('ajaxfileupload', WPBACKITUP_PLUGIN_URL.'/js/ajaxfileupload.js');
37
+ }
38
+
39
+ //enqueue stylesheet
40
+ function wpbackitup_stylesheet(){
41
+ wp_enqueue_style('wpbackitup-stylesheet', WPBACKITUP_PLUGIN_URL.'/css/wp-backitup.css');
42
+ }
43
+
44
+ //load plugin functions
45
+ include_once 'includes/functions.php';
46
+
47
+ //load admin page
48
+ function wpbackitup_admin() {
49
+ include_once('includes/admin_page.php');
50
+ }
51
+
52
+ //load backup function
53
+ function wpbackitup_backup() {
54
+ include 'includes/backup.php';
55
+ }
56
+ add_action('wp_ajax_wpbackitup_backup', 'wpbackitup_backup');
57
+
58
+ //load download function
59
+ function wpbackitup_download() {
60
+ include 'includes/download.php';
61
+ }
62
+ add_action('wp_ajax_wpbackitup_download', 'wpbackitup_download');
63
+
64
+ //load download function
65
+ function wpbackitup_logreader() {
66
+ if(file_exists(BACKUP_PATH .'/status.log') ) {
67
+ readfile(BACKUP_PATH .'/status.log');
68
+ }
69
+ die();
70
+ }
71
+ add_action('wp_ajax_wpbackitup_logreader', 'wpbackitup_logreader');
72
+
73
+ /**
74
+ * PressTrends Plugin API
75
+ */
76
+ function presstrends_WPBackitup_plugin() {
77
+
78
+ // PressTrends Account API Key
79
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
80
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
81
+
82
+ // Start of Metrics
83
+ global $wpdb;
84
+ $data = get_transient( 'presstrends_cache_data' );
85
+ if ( !$data || $data == '' ) {
86
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
87
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
88
+
89
+ $count_posts = wp_count_posts();
90
+ $count_pages = wp_count_posts( 'page' );
91
+ $comments_count = wp_count_comments();
92
+
93
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
94
+ if ( function_exists( 'wp_get_theme' ) ) {
95
+ $theme_data = wp_get_theme();
96
+ $theme_name = urlencode( $theme_data->Name );
97
+ } else {
98
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
99
+ $theme_name = $theme_data['Name'];
100
+ }
101
+
102
+ $plugin_name = '&';
103
+ foreach ( get_plugins() as $plugin_info ) {
104
+ $plugin_name .= $plugin_info['Name'] . '&';
105
+ }
106
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
107
+ $plugin_data = get_plugin_data( __FILE__ );
108
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
109
+ $data = array(
110
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
111
+ 'posts' => $count_posts->publish,
112
+ 'pages' => $count_pages->publish,
113
+ 'comments' => $comments_count->total_comments,
114
+ 'approved' => $comments_count->approved,
115
+ 'spam' => $comments_count->spam,
116
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
117
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
118
+ 'theme_version' => $plugin_data['Version'],
119
+ 'theme_name' => $theme_name,
120
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
121
+ 'plugins' => count( get_option( 'active_plugins' ) ),
122
+ 'plugin' => urlencode( $plugin_name ),
123
+ 'wpversion' => get_bloginfo( 'version' ),
124
+ );
125
+
126
+ foreach ( $data as $k => $v ) {
127
+ $url .= $k . '/' . $v . '/';
128
+ }
129
+ wp_remote_get( $url );
130
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
131
+ }
132
+ }
133
+
134
+ // PressTrends WordPress Action
135
+ add_action('admin_init', 'presstrends_WPBackitup_plugin');
tags/1.1.1/backups/status.log ADDED
@@ -0,0 +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>
tags/1.1.1/css/admin-style.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
tags/1.1.1/css/wp-backitup.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
tags/1.1.1/images/icon.png ADDED
Binary file
tags/1.1.1/images/icon32.png ADDED
Binary file
tags/1.1.1/images/loader.gif ADDED
Binary file
tags/1.1.1/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.1/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip' ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.1.1/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.1.1/includes/functions.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
tags/1.1.1/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.1/js/wp-backitup.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
tags/1.1.1/readme.txt ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.
tags/1.1.1/screenshots/screenshot-1.png ADDED
Binary file
tags/1.1.1/screenshots/screenshot-2.png ADDED
Binary file
tags/1.1.1/screenshots/screenshot-3.png ADDED
Binary file
tags/1.1.1/wp-backitup.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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');
tags/1.1.2/backups/status.log ADDED
@@ -0,0 +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>
tags/1.1.2/css/admin-style.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
tags/1.1.2/css/wp-backitup.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;}
tags/1.1.2/images/icon.png ADDED
Binary file
tags/1.1.2/images/icon32.png ADDED
Binary file
tags/1.1.2/images/loader.gif ADDED
Binary file
tags/1.1.2/includes/admin_page.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.2/includes/backup.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
30
+
31
+ //Backup content to project dir
32
+ fwrite($fh, '<li>Backing up your files...');
33
+ //Backup with copy
34
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip' ) ) ) {
35
+ fwrite($fh, 'Done!</li>');
36
+ } else {
37
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
38
+ die();
39
+ }
40
+
41
+ //Dump DB to project dir
42
+ fwrite($fh, '<li>Backing up your database...');
43
+ if( db_backup($backup_project_path) ) {
44
+ fwrite($fh, 'Done!</li>');
45
+ } else {
46
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
47
+ recursive_delete($backup_project_path);
48
+ die();
49
+ }
50
+
51
+ //Create siteinfo in project dir
52
+ global $wpdb;
53
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
54
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
55
+ recursive_delete($backup_project_path);
56
+ die();
57
+ }
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
68
+ if(!recursive_delete($backup_project_path)) {
69
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
70
+ }
71
+
72
+ //close log file
73
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
74
+ fwrite($fh, '</ul>');
75
+ fclose($fh);
76
+
77
+ //End backup function
78
+ die();
tags/1.1.2/includes/download.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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();
tags/1.1.2/includes/functions.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
tags/1.1.2/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.2/js/wp-backitup.js ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
tags/1.1.2/readme.txt ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.2
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.
tags/1.1.2/screenshots/screenshot-1.png ADDED
Binary file
tags/1.1.2/screenshots/screenshot-2.png ADDED
Binary file
tags/1.1.2/screenshots/screenshot-3.png ADDED
Binary file
tags/1.1.2/wp-backitup.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.2
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');
tags/1.1.4/backups/WP Backitup-Export-2013-02-13-0921.zip ADDED
Binary file
tags/1.1.4/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>
tags/1.1.4/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;}
tags/1.1.4/images/icon.png ADDED
Binary file
tags/1.1.4/images/icon32.png ADDED
Binary file
tags/1.1.4/images/loader.gif ADDED
Binary file
tags/1.1.4/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' ) );
tags/1.1.4/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);
tags/1.1.4/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' ) );
tags/1.1.4/lib/functions.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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');
tags/1.1.4/lib/includes/backup.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
35
+
36
+ //Backup content to project dir
37
+ fwrite($fh, '<li>Backing up your files...');
38
+ //Backup with copy
39
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip' ) ) ) {
40
+ fwrite($fh, 'Done!</li>');
41
+ } else {
42
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
43
+ die();
44
+ }
45
+
46
+ //Dump DB to project dir
47
+ fwrite($fh, '<li>Backing up your database...');
48
+ if( db_backup($backup_project_path) ) {
49
+ fwrite($fh, 'Done!</li>');
50
+ } else {
51
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
52
+ recursive_delete($backup_project_path);
53
+ die();
54
+ }
55
+
56
+ //Create siteinfo in project dir
57
+ global $wpdb;
58
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
59
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
60
+ recursive_delete($backup_project_path);
61
+ die();
62
+ }
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
72
+ if(!recursive_delete($backup_project_path)) {
73
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
74
+ }
75
+
76
+ //close log file
77
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
78
+ fwrite($fh, '</ul>');
79
+ fclose($fh);
80
+
81
+ //End backup function
82
+ die();
tags/1.1.4/lib/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php
tags/1.1.4/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>.
tags/1.1.4/readme.txt ADDED
@@ -0,0 +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.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.
tags/1.1.4/screenshots/screenshot-1.png ADDED
Binary file
tags/1.1.4/screenshots/screenshot-2.png ADDED
Binary file
tags/1.1.4/screenshots/screenshot-3.png ADDED
Binary file
tags/1.1.4/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>
tags/1.1.6/backups/status.log ADDED
@@ -0,0 +1 @@
 
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>
tags/1.1.6/css/admin.css ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.1.6
5
+ * @since 1.1.3
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;}
tags/1.1.6/images/icon.png ADDED
Binary file
tags/1.1.6/images/icon32.png ADDED
Binary file
tags/1.1.6/images/loader.gif ADDED
Binary file
tags/1.1.6/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.6
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.6
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.6";
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' ) );
tags/1.1.6/js/admin.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.1.6
5
+ * @since 1.1.3
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
+ })(jQuery);
tags/1.1.6/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.6
9
+ * @since 1.1.3
10
+ */
11
+
12
+ // The current version of this plugin
13
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.1.5' );
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' ) );
tags/1.1.6/lib/functions.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup Lite
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.1.6
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');
tags/1.1.6/lib/includes/backup.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Constants used by this plugin
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.1.6
10
+ * @since 1.1.3
11
+ */
12
+
13
+ //limit process to 15 minutes
14
+ @set_time_limit(900);
15
+
16
+ //Define variables
17
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
18
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
19
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
20
+
21
+ //create the backup dir
22
+ if( !is_dir(WPBACKITUP_DIRNAME ."/backups") ) {
23
+ @mkdir(WPBACKITUP_DIRNAME ."/backups", 0775);
24
+ }
25
+
26
+ //create log file
27
+ $log = WPBACKITUP_DIRNAME ."/backups/status.log";
28
+ $fh = fopen($log, 'w') or die("can't open file");
29
+ fwrite($fh, '<ul>');
30
+
31
+ //Check to see if the directory is writeable
32
+ fwrite($fh, '<li>Creating backup directory...');
33
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
34
+ fwrite($fh, '</li><li class="error">Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.</li></ul>');
35
+ die();
36
+ } else {
37
+ //If the directory is writeable, create the backup folder if it doesn't exist
38
+ if( !is_dir($backup_project_path) ) {
39
+ @mkdir($backup_project_path, 0775);
40
+ fwrite($fh, 'Done!</li>');
41
+ }
42
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
43
+ unlink($zip);
44
+ }
45
+ }
46
+
47
+ //Backup content to project dir
48
+ fwrite($fh, '<li>Backing up your files...');
49
+ //Backup with copy
50
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
51
+ fwrite($fh, 'Done!</li>');
52
+ } else {
53
+ fwrite($fh, '</li><li class="error">Unable to backup your files. Please try again.</li></ul>');
54
+ die();
55
+ }
56
+
57
+ //Dump DB to project dir
58
+ fwrite($fh, '<li>Backing up your database...');
59
+ if( db_backup($backup_project_path) ) {
60
+ fwrite($fh, 'Done!</li>');
61
+ } else {
62
+ fwrite($fh, '</li><li class="error">Unable to backup your database. Please try again.</li></ul>');
63
+ recursive_delete($backup_project_path);
64
+ die();
65
+ }
66
+
67
+ //Create siteinfo in project dir
68
+ global $wpdb;
69
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
70
+ fwrite($fh, '<li class="error">Unable to create site information file. Please try again.</li></ul>');
71
+ recursive_delete($backup_project_path);
72
+ die();
73
+ }
74
+
75
+ //Zip the project dir
76
+ fwrite($fh, '<li>Creating backup zip...');
77
+ $z = new recurseZip();
78
+ $src = rtrim($backup_project_path, '/');
79
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
80
+ fwrite($fh, 'Done!</li>');
81
+
82
+ //Delete backup dir
83
+ if(!recursive_delete($backup_project_path)) {
84
+ fwrite($fh, '<li class="error">Warning: Unable to cleanup your backup directory.</li>');
85
+ }
86
+
87
+ //close log file
88
+ fwrite($fh, '<li>Backup file created successfully. You can download your backup file using the link above.</li>');
89
+ fwrite($fh, '</ul>');
90
+ fclose($fh);
91
+
92
+ //End backup function
93
+ die();
tags/1.1.6/lib/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * Recurse zip function
1
  *
2
  * @package WP Backitup Pro
3
  *
4
  * @author jcpeden
5
  * @version 1.1.6
6
  * @since 1.1.3
7
  */
1
+ <?php
2
  * Recurse zip function
3
  *
4
  * @package WP Backitup Pro
5
  *
6
  * @author jcpeden
7
  * @version 1.1.6
8
  * @since 1.1.3
9
  */
tags/1.1.6/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>.
tags/1.1.6/readme.txt ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
7
+ Stable tag: 1.1.6
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.6 =
100
+ * Forced backup process to ignore cache files
101
+
102
+ = 1.1.5 =
103
+ * Fixed minor bugs in the code.
104
+
105
+ = 1.1.4 =
106
+ * Fixed minor bugs in tracking code and options.
107
+
108
+ = 1.1.3 =
109
+ * Re-wrote plugin in OOP, added option to disable Presstrends tracking code.
110
+
111
+ = 1.1.2 =
112
+ * Fixed issue with stylesheet not being loaded.
113
+
114
+ = 1.1.1 =
115
+ * Fixed issue with plugin not detecing addons
116
+
117
+ = 1.1.0 =
118
+ * Fixed bugs with addons system.
119
+
120
+ = 1.0.9 =
121
+ * Added Presstrends tracking code.
122
+
123
+ = 1.0.8 =
124
+ * Modified plugin administration and loaded menu tab in main toolbar.
125
+
126
+ = 1.0.7 =
127
+ * 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.
128
+
129
+ = 1.0.6 =
130
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
131
+
132
+ = 1.0.5 =
133
+ * 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.
134
+
135
+ = 1.0.4 =
136
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
137
+
138
+ = 1.0.3 =
139
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
140
+
141
+ = 1.0.2 =
142
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
143
+
144
+ = 1.0.1 =
145
+ * Increased PHP timeout to 900 seconds (5 minutes).
146
+
147
+ = 1.0 =
148
+ * Plugin released.
149
+
150
+ == Upgrade Notice ==
151
+
152
+ = 1.1.6 =
153
+ * Recommended upgrade. Backup process faster and more stable.
154
+
155
+ = 1.1.5 =
156
+ * Non-critical upgrade. Fixed minor bugs in code.
157
+
158
+ = 1.1.4 =
159
+ * Non-critical upgrade. Fixed bugs in code.
160
+
161
+ = 1.1.3 =
162
+ * Non-critical upgrade. Re-wrote plugin in object-oriented PHP.
163
+
164
+ = 1.1.2 =
165
+ * Critical upgrade. Fixed issue with stylesheet.
166
+
167
+ = 1.1.1 =
168
+ * Critical upgrade. Fixed further bugs with addons system.
169
+
170
+ = 1.1.0 =
171
+ * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
172
+
173
+ = 1.0.9 =
174
+ * Non-essential upgrade. Added Presstrends code.
175
+
176
+ = 1.0.8 =
177
+ * Recommended upgrade. Added links to admin menu.
178
+
179
+ = 1.0.7 =
180
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
181
+
182
+ = 1.0.6 =
183
+ * Non-critical upgrade.
184
+
185
+ = 1.0.5 =
186
+ * Critical upgrade: More stable, increased flexibility and power.
187
+
188
+ = 1.0.4 =
189
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
190
+
191
+ = 1.0.3 =
192
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
193
+
194
+ = 1.0.2 =
195
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
196
+
197
+ = 1.0.1 =
198
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
199
+
200
+ = 1.0 =
201
+ Initial version of the plugin.
tags/1.1.6/screenshots/screenshot-1.png ADDED
Binary file
tags/1.1.6/screenshots/screenshot-2.png ADDED
Binary file
tags/1.1.6/screenshots/screenshot-3.png ADDED
Binary file
tags/1.1.6/views/options.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <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>
3
+ <h2><?php echo $page_title; ?></h2>
4
+ <div id="content">
5
+ <h3><?php _e('Backup', $this->namespace ); ?></h3>
6
+ <p><?php _e('Create a backup file of this site\'s content and settings.', $this->namespace ); ?></p>
7
+ <p><a href="#" class="backup-button button-primary"><?php _e( "Backup", $this->namespace ); ?> ) ?></a><img class="backup-icon status-icon" src="<?php echo WPBACKITUP_URLPATH. "/images/loader.gif"; ?>" height="16" width="16" /></p>
8
+ <h3>Download</h3>
9
+ <p><div id="download-link"></div></p>
10
+ <h3>Status</h3>
11
+ <p><div id="status">Nothing to report</div></p>
12
+ </div>
13
+ <div id="sidebar">
14
+ <div class="widget" id="restore-widget">
15
+ <h3 class="promo">Restore Your Backups</h3>
16
+ <p>You can restore your backup zips by importing them manually or by getting WP Backitup Pro.</p>
17
+ <p><a class="button-primary" href="http://www.wpbackitup.com/wp-backitup-pro/">Read more</a></p>
18
+ </div>
19
+ <div class="widget">
20
+ <h3 class="promo">Need support?</h3>
21
+ <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>
22
+ <p>You can also refer to the <a href="http://www.wpbackitup.com/documentation/">WP Backitup documentation</a>.</p>
23
+ </div>
24
+ <div class="widget">
25
+ <h3 class="promo">Spread the Word!</h3>
26
+ <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>
27
+ <p><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
28
+ <input type="hidden" name="cmd" value="_s-xclick">
29
+ <input type="hidden" name="hosted_button_id" value="QSHPK8EDMAW9N">
30
+ <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.">
31
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
32
+ </form></p>
33
+ <p>Or you could <a href="http://wordpress.org/extend/plugins/wp-backitup/">rate the plugin 5&#9733; on Wordpress.org</a>.</p>
34
+ </div>
35
+ <div class="widget">
36
+ <h3 class="promo">Presstrends</h3>
37
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
38
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
39
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label>Enable</label></p>
40
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label>Disable</label></p>
41
+ <p>Help to improve Easy Webtrends by enabling <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
42
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
43
+ </form>
44
+ </div>
45
+ </div>
46
+ </div>
tags/1.2.0/backups/status.log ADDED
@@ -0,0 +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>
tags/1.2.0/css/admin.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.2.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ /* Global */
9
+ .error { color: #ff0000;}
10
+
11
+ p {line-height: 1.4em;}
12
+
13
+ td {padding: 0;}
14
+
15
+ ul {padding: 1em 0 0 0;}
16
+
17
+ h3 {
18
+ margin: 0;
19
+ padding: 1em 0 0 0;
20
+ }
21
+
22
+ iframe {
23
+ height: 0;
24
+ margin: 0;
25
+ padding: 0;
26
+ position: absolute;
27
+ top: 0;
28
+ right: 0;
29
+ width: 0;
30
+ z-index: -10;
31
+ }
32
+
33
+ .submit {
34
+ padding: 0;
35
+ }
36
+
37
+ /* Content */
38
+ #content {
39
+ float: left;
40
+ width: 65%;
41
+ }
42
+
43
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
44
+
45
+ .status-icon {
46
+ display: inline;
47
+ height: 16px;
48
+ position: relative;
49
+ top: 3px;
50
+ left: 5px;
51
+ visibility: hidden;
52
+ width: 16px;
53
+ }
54
+
55
+ /* Sidebar */
56
+ #sidebar {
57
+ float: right;
58
+ width: 30%;
59
+ }
60
+
61
+ .widget {padding: 1em;}
62
+ .errorMessage{
63
+ color: red;
64
+ }
tags/1.2.0/images/icon.png ADDED
Binary file
tags/1.2.0/images/icon32.png ADDED
Binary file
tags/1.2.0/images/loader.gif ADDED
Binary file
tags/1.2.0/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.2.0
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.2.0
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 = WPBACKITUP_ITEM_NAME;
43
+ var $version = WPBACKITUP_VERSION;
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' ) );
tags/1.2.0/js/admin.js ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.2.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ (function($){
9
+
10
+
11
+ //define backup variables
12
+ var backup = {
13
+ action: 'backup',
14
+ beforeSend: function() {
15
+ $('.backup-icon').css('visibility','visible');
16
+ var htmlText = "<div class='prerequisites'>Checking Prerequisites: <span class='currentStatus'>Pending</span></div><div class='backupfiles'>Backing up files: <span class='currentStatus'>Pending</span></div><div class='backupdb'>Backing up database: <span class='currentStatus'>Pending</span></div><div class='infofile'>Creating Info File: <span class='currentStatus'>Pending</span></div><div class='zipfile'>Creating Zip File: <span class='currentStatus'>Pending</span></div><div class='cleanup'>Cleaning Up: <span class='currentStatus'>Pending</span></div><div class='errorMessage'><span class='currentStatus'></span></div>";
17
+ $("#status").html(htmlText);
18
+ window.intervalDefine = setInterval(display_log, 1000);
19
+ }
20
+ };
21
+ //define download variables
22
+ var download = {
23
+ action: 'download'
24
+ };
25
+ //define logreader variables
26
+ var logreader = {
27
+ action: 'logreader'
28
+ };
29
+ //define logreader function
30
+ function display_log() {
31
+ $.post(ajaxurl, logreader, function(response) {
32
+ var xmlObj = $(response);
33
+ xmlObj.each(function(){
34
+ var attributename = "." + $(this).attr('code');
35
+ $(attributename).find(".currentStatus").html($(this).text());
36
+ if($(this).attr('code') == "finalinfo" || $(this).attr('code') == "errorMessage")
37
+ {
38
+ clearInterval(window.intervalDefine);
39
+ }
40
+ });
41
+ });
42
+ }
43
+ //define download function
44
+ function download_link() {
45
+ $.post(ajaxurl, download, function(response) {
46
+ $("#download-link").html(response);
47
+ });
48
+ }
49
+
50
+ //execute download (on page load/refresh)
51
+ download_link();
52
+
53
+ //execute backup on button click
54
+ $(".backup-button").click( function() {
55
+ $.post(ajaxurl, backup, function(response) {
56
+ download_link();
57
+ clearInterval(display_log);
58
+ $('.backup-icon').fadeOut(1000);
59
+ $("#php").html(response); //Return PHP messages, used for development
60
+ });
61
+ })
62
+
63
+ //execute restore on button click
64
+ $("#restore-form").submit(function() {
65
+ var maximum = $("#maximum").val();
66
+ var fil = document.getElementById("wpbackitup-zip");
67
+ var sizes = fil.files[0].size;
68
+ var sizesd = sizes/(1024*1024);
69
+ if(sizesd > maximum)
70
+ {
71
+ $("#status").html("<span style='color: red'>File size exceeds maxium upload size.</span>");
72
+ return false;
73
+ }
74
+ var htmlvals = '<div class="upload">Uploading file: <span class="currentStatus">Pending</span></div><div class="unzipping">Unzipping Files: <span class="currentStatus">Pending</span></div><div class="validation">Validating Zip File: <span class="currentStatus">Pending</span></div><div class="wpcontent">Replacing WP-CONTENT Directory: <span class="currentStatus">Pending</span></div><div class="database">Restoring Database: <span class="currentStatus">Pending</span></div><div class="infomessage"><span class="currentStatus"></span></div><div class="errorMessage"><span class="currentStatus"></span></div>';
75
+
76
+ $("#status").html(htmlvals);
77
+ $(".upload").find('.currentStatus').html('In Progress');
78
+ $('.restore-icon').css('visibility','visible');
79
+ window.intervalDefine = setInterval(display_log, 1000);
80
+ $("#restore-form").attr("target","upload_target");
81
+ $("#upload_target").load(function (){
82
+ importRestore();
83
+ });
84
+ });
85
+
86
+ //define importRestore function
87
+ function importRestore() {
88
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; //process upload
89
+ $("#php").html(ret); //Return PHP messages, used for development
90
+ clearInterval(display_log);
91
+ $('.restore-icon').fadeOut(1000);
92
+ }
93
+ })(jQuery);
tags/1.2.0/js/ajaxfileupload.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Ajax File Upload
3
+ *
4
+ * @version 1.2.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ jQuery.extend({
9
+ createUploadIframe: function(id, uri)
10
+ {
11
+ //create frame
12
+ var frameId = 'jUploadFrame' + id;
13
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
14
+ if(window.ActiveXObject)
15
+ {
16
+ if(typeof uri== 'boolean'){
17
+ iframeHtml += ' src="' + 'javascript:false' + '"';
18
+
19
+ }
20
+ else if(typeof uri== 'string'){
21
+ iframeHtml += ' src="' + uri + '"';
22
+
23
+ }
24
+ }
25
+ iframeHtml += ' />';
26
+ jQuery(iframeHtml).appendTo(document.body);
27
+
28
+ return jQuery('#' + frameId).get(0);
29
+ },
30
+ createUploadForm: function(id, fileElementId, data)
31
+ {
32
+ //create form
33
+ var formId = 'jUploadForm' + id;
34
+ var fileId = 'jUploadFile' + id;
35
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
36
+ if(data)
37
+ {
38
+ for(var i in data)
39
+ {
40
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
41
+ }
42
+ }
43
+ var oldElement = jQuery('#' + fileElementId);
44
+ var newElement = jQuery(oldElement).clone();
45
+ jQuery(oldElement).attr('id', fileId);
46
+ jQuery(oldElement).before(newElement);
47
+ jQuery(oldElement).appendTo(form);
48
+
49
+
50
+
51
+ //set attributes
52
+ jQuery(form).css('position', 'absolute');
53
+ jQuery(form).css('top', '-1200px');
54
+ jQuery(form).css('left', '-1200px');
55
+ jQuery(form).appendTo('body');
56
+ return form;
57
+ },
58
+
59
+ ajaxFileUpload: function(s) {
60
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
61
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
62
+ var id = new Date().getTime()
63
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
64
+ var io = jQuery.createUploadIframe(id, s.secureuri);
65
+ var frameId = 'jUploadFrame' + id;
66
+ var formId = 'jUploadForm' + id;
67
+ // Watch for a new set of requests
68
+ if ( s.global && ! jQuery.active++ )
69
+ {
70
+ jQuery.event.trigger( "ajaxStart" );
71
+ }
72
+ var requestDone = false;
73
+ // Create the request object
74
+ var xml = {}
75
+ if ( s.global )
76
+ jQuery.event.trigger("ajaxSend", [xml, s]);
77
+ // Wait for a response to come back
78
+ var uploadCallback = function(isTimeout)
79
+ {
80
+ var io = document.getElementById(frameId);
81
+ try
82
+ {
83
+ if(io.contentWindow)
84
+ {
85
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
86
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
87
+
88
+ }else if(io.contentDocument)
89
+ {
90
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
91
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
92
+ }
93
+ }catch(e)
94
+ {
95
+ jQuery.handleError(s, xml, null, e);
96
+ }
97
+ if ( xml || isTimeout == "timeout")
98
+ {
99
+ requestDone = true;
100
+ var status;
101
+ try {
102
+ status = isTimeout != "timeout" ? "success" : "error";
103
+ // Make sure that the request was successful or notmodified
104
+ if ( status != "error" )
105
+ {
106
+ // process the data (runs the xml through httpData regardless of callback)
107
+ var data = jQuery.uploadHttpData( xml, s.dataType );
108
+ // If a local callback was specified, fire it and pass it the data
109
+ if ( s.success )
110
+ s.success( data, status );
111
+
112
+ // Fire the global callback
113
+ if( s.global )
114
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
115
+ } else
116
+ jQuery.handleError(s, xml, status);
117
+ } catch(e)
118
+ {
119
+ status = "error";
120
+ jQuery.handleError(s, xml, status, e);
121
+ }
122
+
123
+ // The request was completed
124
+ if( s.global )
125
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
126
+
127
+ // Handle the global AJAX counter
128
+ if ( s.global && ! --jQuery.active )
129
+ jQuery.event.trigger( "ajaxStop" );
130
+
131
+ // Process result
132
+ if ( s.complete )
133
+ s.complete(xml, status);
134
+
135
+ jQuery(io).unbind()
136
+
137
+ setTimeout(function()
138
+ { try
139
+ {
140
+ jQuery(io).remove();
141
+ jQuery(form).remove();
142
+
143
+ } catch(e)
144
+ {
145
+ jQuery.handleError(s, xml, null, e);
146
+ }
147
+
148
+ }, 100)
149
+
150
+ xml = null
151
+
152
+ }
153
+ }
154
+ // Timeout checker
155
+ if ( s.timeout > 0 )
156
+ {
157
+ setTimeout(function(){
158
+ // Check to see if the request is still happening
159
+ if( !requestDone ) uploadCallback( "timeout" );
160
+ }, s.timeout);
161
+ }
162
+ try
163
+ {
164
+
165
+ var form = jQuery('#' + formId);
166
+ jQuery(form).attr('action', s.url);
167
+ jQuery(form).attr('method', 'POST');
168
+ jQuery(form).attr('target', frameId);
169
+ if(form.encoding)
170
+ {
171
+ jQuery(form).attr('encoding', 'multipart/form-data');
172
+ }
173
+ else
174
+ {
175
+ jQuery(form).attr('enctype', 'multipart/form-data');
176
+ }
177
+ jQuery(form).submit();
178
+
179
+ } catch(e)
180
+ {
181
+ jQuery.handleError(s, xml, null, e);
182
+ }
183
+
184
+ jQuery('#' + frameId).load(uploadCallback );
185
+ return {abort: function () {}};
186
+
187
+ },
188
+
189
+ uploadHttpData: function( r, type ) {
190
+ var data = !type;
191
+ data = type == "xml" || data ? r.responseXML : r.responseText;
192
+ // If the type is "script", eval it in global context
193
+ if ( type == "script" )
194
+ jQuery.globalEval( data );
195
+ // Get the JavaScript object, if JSON is used.
196
+ if ( type == "json" )
197
+ eval( "data = " + data );
198
+ // evaluate scripts within html
199
+ if ( type == "html" )
200
+ jQuery("<div>").html(data).evalScripts();
201
+
202
+ return data;
203
+ }
204
+ })
205
+
tags/1.2.0/languages/wp-backitup-pro.mo ADDED
Binary file
tags/1.2.0/languages/wp-backitup-pro.po ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup Pro\n"
4
+ "POT-Creation-Date: 2013-02-17 11:26-0000\n"
5
+ "PO-Revision-Date: 2013-02-17 11:26-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: WP Backitup <support@wpbackitup.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: index.php:328
19
+ msgid "Settings"
20
+ msgstr ""
21
+
22
+ #: lib/functions.php:46
23
+ msgid "Download most recent export file"
24
+ msgstr ""
25
+
26
+ #: lib/functions.php:50
27
+ msgid "No export file available for download. Please create one."
28
+ msgstr ""
29
+
30
+ #: lib/includes/backup.php:25 lib/includes/restore.php:24
31
+ msgid "Can't open file"
32
+ msgstr ""
33
+
34
+ #: lib/includes/backup.php:29
35
+ msgid "Creating backup directory..."
36
+ msgstr ""
37
+
38
+ #: lib/includes/backup.php:31
39
+ msgid ""
40
+ "Cannot create backup directory. Please check the CHMOD settings of your wp-"
41
+ "backitup plugin directory"
42
+ msgstr ""
43
+
44
+ #: lib/includes/backup.php:37 lib/includes/restore.php:142
45
+ msgid "Done"
46
+ msgstr ""
47
+
48
+ #: lib/includes/backup.php:45
49
+ msgid "Backing up your files..."
50
+ msgstr ""
51
+
52
+ #: lib/includes/backup.php:50
53
+ msgid "Unable to backup your files. Please try again."
54
+ msgstr ""
55
+
56
+ #: lib/includes/backup.php:55
57
+ msgid "Backing up your database..."
58
+ msgstr ""
59
+
60
+ #: lib/includes/backup.php:57 lib/includes/backup.php:77
61
+ #: lib/includes/restore.php:156 lib/includes/restore.php:174
62
+ #: lib/includes/restore.php:200 lib/includes/restore.php:336
63
+ msgid "Done!"
64
+ msgstr ""
65
+
66
+ #: lib/includes/backup.php:59
67
+ msgid "Unable to backup your database. Please try again."
68
+ msgstr ""
69
+
70
+ #: lib/includes/backup.php:67
71
+ msgid "Unable to create site information file. Please try again."
72
+ msgstr ""
73
+
74
+ #: lib/includes/backup.php:73
75
+ msgid "Creating backup zip..."
76
+ msgstr ""
77
+
78
+ #: lib/includes/backup.php:81
79
+ msgid "Warning: Unable to cleanup your backup directory."
80
+ msgstr ""
81
+
82
+ #: lib/includes/backup.php:85
83
+ msgid ""
84
+ "Backup file created successfully. You can download your backup file using "
85
+ "the link above."
86
+ msgstr ""
87
+
88
+ #: lib/includes/restore.php:133
89
+ msgid "No file selected"
90
+ msgstr ""
91
+
92
+ #: lib/includes/restore.php:138
93
+ msgid "Uploading restoration file..."
94
+ msgstr ""
95
+
96
+ #: lib/includes/restore.php:144
97
+ msgid "Your file could not be uploaded"
98
+ msgstr ""
99
+
100
+ #: lib/includes/restore.php:158
101
+ msgid "Your restoration file could not be unzipped."
102
+ msgstr ""
103
+
104
+ #: lib/includes/restore.php:165
105
+ msgid "Validating zip..."
106
+ msgstr ""
107
+
108
+ #: lib/includes/restore.php:176
109
+ msgid ""
110
+ "Your zip file appears to be invalid. Please ensure you chose the correct zip "
111
+ "file."
112
+ msgstr ""
113
+
114
+ #: lib/includes/restore.php:184
115
+ msgid "Restoring wp-content directory..."
116
+ msgstr ""
117
+
118
+ #: lib/includes/restore.php:186
119
+ msgid ""
120
+ "Unable to remove existing wp-content directory for import. Please check your "
121
+ "CHMOD settings in /wp-content/."
122
+ msgstr ""
123
+
124
+ #: lib/includes/restore.php:193
125
+ msgid ""
126
+ "Unable to create new wp-content directory for import. Please check your "
127
+ "CHMOD settings in /wp-content/."
128
+ msgstr ""
129
+
130
+ #: lib/includes/restore.php:202
131
+ msgid "Unable to import wp-content. Please try again."
132
+ msgstr ""
133
+
134
+ #: lib/includes/restore.php:212
135
+ msgid "Restoring database..."
136
+ msgstr ""
137
+
138
+ #: lib/includes/restore.php:222
139
+ msgid "Unable to connect to your current database"
140
+ msgstr ""
141
+
142
+ #: lib/includes/restore.php:236
143
+ msgid "Unable to get current site URL from database. Please try again."
144
+ msgstr ""
145
+
146
+ #: lib/includes/restore.php:250
147
+ msgid "Unable to get current home URL from database. Please try again."
148
+ msgstr ""
149
+
150
+ #: lib/includes/restore.php:264
151
+ msgid "Unable to get current user ID from database. Please try again."
152
+ msgstr ""
153
+
154
+ #: lib/includes/restore.php:278
155
+ msgid "Unable to get current user password from database. Please try again."
156
+ msgstr ""
157
+
158
+ #: lib/includes/restore.php:292
159
+ msgid "Unable to get current user email from database. Please try again."
160
+ msgstr ""
161
+
162
+ #: lib/includes/restore.php:305
163
+ msgid ""
164
+ "Unable to get import your database. This may require importing the file "
165
+ "manually."
166
+ msgstr ""
167
+
168
+ #: lib/includes/restore.php:323
169
+ msgid ""
170
+ "Unable to update your current home URL value. This may require importing the "
171
+ "file manually."
172
+ msgstr ""
173
+
174
+ #: lib/includes/restore.php:330
175
+ msgid ""
176
+ "Unable to update your user information. This may require importing the file "
177
+ "manually."
178
+ msgstr ""
179
+
180
+ #: lib/includes/restore.php:338
181
+ msgid "Warning: Database not detected in import file."
182
+ msgstr ""
183
+
184
+ #: lib/includes/restore.php:351
185
+ msgid "Restoration complete. Please refresh the page."
186
+ msgstr ""
187
+
188
+ #: views/options.php:6 views/options.php:8
189
+ msgid "Backup"
190
+ msgstr ""
191
+
192
+ #: views/options.php:7
193
+ msgid "Create a backup file of this site's content and settings."
194
+ msgstr ""
195
+
196
+ #: views/options.php:9
197
+ msgid "Download"
198
+ msgstr ""
199
+
200
+ #: views/options.php:11 views/options.php:23
201
+ msgid "Restore"
202
+ msgstr ""
203
+
204
+ #: views/options.php:14
205
+ msgid ""
206
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
207
+ "plugins, uploads and settings."
208
+ msgstr ""
209
+
210
+ #: views/options.php:25
211
+ msgid "Status"
212
+ msgstr ""
213
+
214
+ #: views/options.php:26
215
+ msgid "Nothing to report"
216
+ msgstr ""
217
+
218
+ #: views/options.php:35 views/options.php:56
219
+ msgid "License Key"
220
+ msgstr ""
221
+
222
+ #: views/options.php:39
223
+ msgid "Automatic updates enabled"
224
+ msgstr ""
225
+
226
+ #: views/options.php:41
227
+ msgid "Activate automatic updates by entering your license key"
228
+ msgstr ""
229
+
230
+ #: views/options.php:46
231
+ msgid "Active"
232
+ msgstr ""
233
+
234
+ #: views/options.php:47
235
+ msgid "Update"
236
+ msgstr ""
237
+
238
+ #: views/options.php:49
239
+ msgid "Inactive"
240
+ msgstr ""
241
+
242
+ #: views/options.php:50
243
+ msgid "Activate"
244
+ msgstr ""
245
+
246
+ #: views/options.php:55
247
+ msgid "Need Support?"
248
+ msgstr ""
249
+
250
+ #: views/options.php:60
251
+ msgid "Spread the Word"
252
+ msgstr ""
253
+
254
+ #: views/options.php:65
255
+ msgid "Enable"
256
+ msgstr ""
257
+
258
+ #: views/options.php:66
259
+ msgid "Disable"
260
+ msgstr ""
261
+
262
+ #: views/options.php:67
263
+ msgid ""
264
+ "Help to improve Easy Webtrends by enabling <a href=\"http://www.presstrends."
265
+ "io\" target=\"_blank\">Presstrends</a>"
266
+ msgstr ""
267
+
268
+ #: views/options.php:68
269
+ msgid "Save"
270
+ msgstr ""
tags/1.2.0/lib/constants.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WP Backitup Pro
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.2.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.2.0' );
13
+
14
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
19
+
20
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
21
+
22
+ if( !defined( 'WPBACKITUP_SITE_URL' ) ) define( 'WPBACKITUP_SITE_URL', 'http://www.wpbackitup.com' );
23
+
24
+ if( !defined( 'WPBACKITUP_ITEM_NAME' ) ) define( 'WPBACKITUP_ITEM_NAME', 'WP Backitup Lite' );
tags/1.2.0/lib/functions.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup Pro
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.2.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ // include recurseZip class
13
+ if( !class_exists( 'recurseZip' ) ) {
14
+ include_once 'includes/recurse_zip.php';
15
+ }
16
+
17
+ //load backup function
18
+ function backup() {
19
+ include_once 'includes/backup.php';
20
+ }
21
+ add_action('wp_ajax_backup', 'backup');
22
+
23
+ //load download function
24
+ function download() {
25
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
26
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
27
+ $filename = basename($file);
28
+ echo 'Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a>';
29
+ }
30
+ } else {
31
+ echo 'No export file available for download. Please create one.';
32
+ }
33
+ die();
34
+ }
35
+ add_action('wp_ajax_download', 'download');
36
+
37
+ //load logreader function
38
+ function logreader() {
39
+ $log = WPBACKITUP_DIRNAME .'/logs/status.log';
40
+ if(file_exists($log) ) {
41
+ readfile($log);
42
+ }
43
+ die();
44
+ }
45
+ add_action('wp_ajax_logreader', 'logreader');
46
+
47
+ //define create_dir function
48
+ if(!function_exists('create_dir')) {
49
+ function create_dir($dir) {
50
+ if( !is_dir($dir) ) {
51
+ @mkdir($dir, 0755);
52
+ }
53
+ return true;
54
+ }
55
+ }
56
+
57
+ //Define recusive_copy function
58
+ if(!function_exists('recursive_copy')) {
59
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
60
+ if( is_dir($dir) ) { //If the directory exists
61
+ if ($dh = opendir($dir) ) {
62
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
63
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
64
+ if (!is_dir( $dir.$file ) ) {
65
+ //Copy files to destination directory
66
+ $fsrc = fopen($dir .$file,'r');
67
+ $fdest = fopen($target_path .$file,'w+');
68
+ $len = stream_copy_to_stream($fsrc,$fdest);
69
+ fclose($fsrc);
70
+ fclose($fdest);
71
+ } else { //If $file is a directory
72
+ $destdir = $target_path .$file; //Modify the destination dir
73
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
74
+ @mkdir($destdir, 0755);
75
+ }
76
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
77
+ }
78
+ }
79
+ }
80
+ closedir($dh);
81
+ }
82
+ }
83
+ return true;
84
+ }
85
+ }
86
+
87
+ //Define DB backup function
88
+ if(!function_exists('db_backup')) {
89
+ function db_backup($path) {
90
+ $handle = fopen($path .'db-backup.sql', 'w+');
91
+
92
+
93
+ $path_sql = $path .'/db-backup.sql';
94
+ $db_name = DB_NAME;
95
+ $db_user = DB_USER;
96
+ $db_pass = DB_PASSWORD;
97
+ $db_host = DB_HOST;
98
+
99
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name");
100
+ fwrite($handle,$output);
101
+ fclose($handle);
102
+ return true;
103
+ }
104
+ }
105
+
106
+ //Define the create_siteinfo function
107
+ if(!function_exists('create_siteinfo')) {
108
+ function create_siteinfo($path, $table_prefix) {
109
+ $siteinfo = $path ."backupsiteinfo.txt";
110
+ $handle = fopen($siteinfo, 'w+');
111
+ $entry = site_url( '/' ) ."\n$table_prefix";
112
+ fwrite($handle, $entry);
113
+ fclose($handle);
114
+ return true;
115
+ }
116
+ }
117
+
118
+ //Define recursive_delete function
119
+ if(!function_exists('recursive_delete')){
120
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
121
+ if( is_dir($dir) ){
122
+ if($dh = opendir($dir)) {
123
+ while( ($file = readdir($dh)) !== false ) {
124
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
125
+ if(!is_dir($dir .'/'. $file)) {
126
+ unlink($dir .'/'. $file);
127
+ } else {
128
+ recursive_delete($dir.'/'. $file, $ignore);
129
+ }
130
+ }
131
+ }
132
+ }
133
+ @rmdir($dir);
134
+ closedir($dh);
135
+ }
136
+ return true;
137
+ }
138
+ }
139
+
140
+ //Define zip function
141
+ function zip($source, $destination, $ignore) {
142
+ if (is_string($source)) $source_arr = array($source); // convert it to array
143
+ if (!extension_loaded('zip')) {
144
+ return false;
145
+ }
146
+ $zip = new ZipArchive();
147
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
148
+ return false;
149
+ }
150
+ foreach ($source_arr as $source) {
151
+ if (!file_exists($source)) continue;
152
+ $source = str_replace('\\', '/', realpath($source));
153
+ if (is_dir($source) === true) {
154
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
155
+ foreach ($files as $file) {
156
+ if (!preg_match($ignore, $file)) {
157
+ $file = str_replace('\\', '/', realpath($file));
158
+ if (is_dir($file) === true) {
159
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
160
+ } else if (is_file($file) === true) {
161
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
162
+ }
163
+ }
164
+ }
165
+ } else if (is_file($source) === true) {
166
+ $zip->addFromString(basename($source), file_get_contents($source));
167
+ }
168
+ }
169
+ return $zip->close();
170
+ }
171
+
172
+ //load presstrends
173
+ function load_presstrends() {
174
+ global $WPBackitup;
175
+ if($WPBackitup->get_option( 'presstrends' ) == 'enabled') {
176
+ // PressTrends Account API Key
177
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
178
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
179
+
180
+ // Start of Metrics
181
+ global $wpdb;
182
+ $data = get_transient( 'presstrends_cache_data' );
183
+ if ( !$data || $data == '' ) {
184
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
185
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
186
+
187
+ $count_posts = wp_count_posts();
188
+ $count_pages = wp_count_posts( 'page' );
189
+ $comments_count = wp_count_comments();
190
+
191
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
192
+ if ( function_exists( 'wp_get_theme' ) ) {
193
+ $theme_data = wp_get_theme();
194
+ $theme_name = urlencode( $theme_data->Name );
195
+ } else {
196
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
197
+ $theme_name = $theme_data['Name'];
198
+ }
199
+
200
+ $plugin_name = '&';
201
+ foreach ( get_plugins() as $plugin_info ) {
202
+ $plugin_name .= $plugin_info['Name'] . '&';
203
+ }
204
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
205
+ $plugin_data = get_plugin_data( __FILE__ );
206
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
207
+ $data = array(
208
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
209
+ 'posts' => $count_posts->publish,
210
+ 'pages' => $count_pages->publish,
211
+ 'comments' => $comments_count->total_comments,
212
+ 'approved' => $comments_count->approved,
213
+ 'spam' => $comments_count->spam,
214
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
215
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
216
+ 'theme_version' => $plugin_data['Version'],
217
+ 'theme_name' => $theme_name,
218
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
219
+ 'plugins' => count( get_option( 'active_plugins' ) ),
220
+ 'plugin' => urlencode( $plugin_name ),
221
+ 'wpversion' => get_bloginfo( 'version' ),
222
+ );
223
+
224
+ foreach ( $data as $k => $v ) {
225
+ $url .= $k . '/' . $v . '/';
226
+ }
227
+ wp_remote_get( $url );
228
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
229
+ }
230
+ }
231
+ }
232
+ // PressTrends WordPress Action
233
+ add_action('admin_init', 'load_presstrends');
tags/1.2.0/lib/includes/backup.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Backup Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.2.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ global $WPBackitup;
14
+
15
+ //limit process to 15 minutes
16
+ @set_time_limit(900);
17
+
18
+ //Define variables
19
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
20
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
21
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
22
+
23
+ //create log file
24
+
25
+ $log = WPBACKITUP_DIRNAME ."/logs/status.log";
26
+ unlink($log);
27
+ $fh = fopen($log, 'w') or die("Can't open log file");
28
+
29
+ //Delete the existing backup directory
30
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
31
+
32
+ //Re-create and empty backup dir
33
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
34
+ fwrite($fh, '<status code="prerequsites">Failed</status>');
35
+ fwrite($fh, '<error code="errorMessage">Error: Unable to create new directory for backup. Please check your CHMOD settings in ' .WPBACKITUP_DIR_PATH .'.</error>');
36
+
37
+ fclose($fh);
38
+
39
+ die();
40
+ }
41
+
42
+ //Check to see if the directory is writeable
43
+
44
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
45
+ fwrite($fh, '<status code="prerequsites">Failed</status>');
46
+ fwrite($fh, '<error code="errorMessage">Error: Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.</error>');
47
+
48
+ die();
49
+ } else {
50
+ //If the directory is writeable, create the backup folder if it doesn't exist
51
+ if( !is_dir($backup_project_path) ) {
52
+ @mkdir($backup_project_path, 0755);
53
+ fwrite($fh, '<status code="prerequisites">Done</status>');
54
+ }
55
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
56
+ unlink($zip);
57
+ }
58
+ }
59
+
60
+ //Backup content to project dir
61
+
62
+ //Backup with copy
63
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
64
+ fwrite($fh, '<status code="backupfiles">Done</status>');
65
+ } else {
66
+ fwrite($fh, '<status code="backupfiles">Failed</status>');
67
+ fwrite($fh, '<error code="errorMessage">Error: Unable to backup your files. Please try again.</error>');
68
+ die();
69
+ }
70
+
71
+ //Dump DB to project dir
72
+
73
+
74
+ if( db_backup($backup_project_path) ) {
75
+ fwrite($fh, '<status code="backupdb">Done</status>');
76
+ } else {
77
+ fwrite($fh, '<error code="errorMessage">Error: Unable to backup your database. Please try again.</error>');
78
+ recursive_delete($backup_project_path);
79
+ die();
80
+ }
81
+
82
+ //Create siteinfo in project dir
83
+ global $wpdb;
84
+
85
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
86
+ fwrite($fh, '<status code="infofile">Failed</status>');
87
+ fwrite($fh, '<error code="errorMessage">Error: Unable to create site information file. Please try again.</error>');
88
+ recursive_delete($backup_project_path);
89
+
90
+ die();
91
+ }
92
+ else
93
+ {
94
+ fwrite($fh, '<status code="infofile">Done</status>');
95
+ }
96
+
97
+ //Zip the project dir
98
+
99
+ $z = new recurseZip();
100
+ $src = rtrim($backup_project_path, '/');
101
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
102
+ fwrite($fh, '<status code="zipfile">Done</status>');
103
+
104
+ //Delete backup dir
105
+ if(!recursive_delete($backup_project_path)) {
106
+ fwrite($fh, '<status code="cleanup">Failed</status>');
107
+ fwrite($fh, '<error code="errorMessage">Error: Warning: Unable to cleanup your backup directory.</error>');
108
+
109
+ }
110
+ else
111
+ {
112
+ fwrite($fh, '<status code="cleanup">Done</status>');
113
+ }
114
+
115
+ //close log file
116
+ fwrite($fh, '<status code="finalinfo">Backup file created successfully. You can download your backup file using the link above.</status>');
117
+ fwrite($fh, '<status code="end">End</status>');
118
+ fclose($fh);
119
+
120
+ //End backup function
121
+ die();
tags/1.2.0/lib/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * WP Backitup Recurse Zip Function
1
  *
2
  * @package WP Backitup Pro
3
  *
4
  * @author jcpeden
5
  * @version 1.2.0
6
  * @since 1.0.1
7
  */
1
+ <?php
2
  * WP Backitup Recurse Zip Function
3
  *
4
  * @package WP Backitup Pro
5
  *
6
  * @author jcpeden
7
  * @version 1.2.0
8
  * @since 1.0.1
9
  */
tags/1.2.0/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>.
tags/1.2.0/logs/status.log ADDED
@@ -0,0 +1 @@
 
1
+ <status code="prerequisites">Done</status><status code="backupfiles">Done</status><status code="backupdb">Done</status><status code="infofile">Done</status><status code="zipfile">Done</status><status code="cleanup">Done</status><status code="finalinfo">Backup file created successfully. You can download your backup file using the link above.</status><status code="end">End</status>
tags/1.2.0/readme.txt ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
7
+ Stable tag: 1.2.0
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.2.0 =
100
+ * Fixed issues with broken directory tree, brought versioning inline with WP Backitup Pro
101
+
102
+ = 1.1.7 =
103
+ * Setup backup to use mysqldump and shellexec.
104
+
105
+ = 1.1.6 =
106
+ * Forced backup process to ignore cache files.
107
+
108
+ = 1.1.5 =
109
+ * Fixed minor bugs in the code.
110
+
111
+ = 1.1.4 =
112
+ * Fixed minor bugs in tracking code and options.
113
+
114
+ = 1.1.3 =
115
+ * Re-wrote plugin in OOP, added option to disable Presstrends tracking code.
116
+
117
+ = 1.1.2 =
118
+ * Fixed issue with stylesheet not being loaded.
119
+
120
+ = 1.1.1 =
121
+ * Fixed issue with plugin not detecing addons
122
+
123
+ = 1.1.0 =
124
+ * Fixed bugs with addons system.
125
+
126
+ = 1.0.9 =
127
+ * Added Presstrends tracking code.
128
+
129
+ = 1.0.8 =
130
+ * Modified plugin administration and loaded menu tab in main toolbar.
131
+
132
+ = 1.0.7 =
133
+ * 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.
134
+
135
+ = 1.0.6 =
136
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
137
+
138
+ = 1.0.5 =
139
+ * 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.
140
+
141
+ = 1.0.4 =
142
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
143
+
144
+ = 1.0.3 =
145
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
146
+
147
+ = 1.0.2 =
148
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
149
+
150
+ = 1.0.1 =
151
+ * Increased PHP timeout to 900 seconds (5 minutes).
152
+
153
+ = 1.0 =
154
+ * Plugin released.
155
+
156
+ == Upgrade Notice ==
157
+
158
+ = 1.2.0 =
159
+ * Critical upgrade. Plugin broken for most users without this update.
160
+
161
+ = 1.1.7 =
162
+ * Recommended upgrade. Backup process faster and more stable.
163
+
164
+ = 1.1.6 =
165
+ * Recommended upgrade. Backup process faster and more stable.
166
+
167
+ = 1.1.5 =
168
+ * Non-critical upgrade. Fixed minor bugs in code.
169
+
170
+ = 1.1.4 =
171
+ * Non-critical upgrade. Fixed bugs in code.
172
+
173
+ = 1.1.3 =
174
+ * Non-critical upgrade. Re-wrote plugin in object-oriented PHP.
175
+
176
+ = 1.1.2 =
177
+ * Critical upgrade. Fixed issue with stylesheet.
178
+
179
+ = 1.1.1 =
180
+ * Critical upgrade. Fixed further bugs with addons system.
181
+
182
+ = 1.1.0 =
183
+ * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
184
+
185
+ = 1.0.9 =
186
+ * Non-essential upgrade. Added Presstrends code.
187
+
188
+ = 1.0.8 =
189
+ * Recommended upgrade. Added links to admin menu.
190
+
191
+ = 1.0.7 =
192
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
193
+
194
+ = 1.0.6 =
195
+ * Non-critical upgrade.
196
+
197
+ = 1.0.5 =
198
+ * Critical upgrade: More stable, increased flexibility and power.
199
+
200
+ = 1.0.4 =
201
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
202
+
203
+ = 1.0.3 =
204
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
205
+
206
+ = 1.0.2 =
207
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
208
+
209
+ = 1.0.1 =
210
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
211
+
212
+ = 1.0 =
213
+ Initial version of the plugin.
tags/1.2.0/views/options.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <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>
3
+ <h2><?php echo $page_title; ?></h2>
4
+ <div id="content">
5
+ <h3><?php _e('Backup', $this->namespace ); ?></h3>
6
+ <p><?php _e('Create a backup file of this site\'s content and settings.', $this->namespace ); ?></p>
7
+ <p><a href="#" class="backup-button button-primary"><?php _e( "Backup", $this->namespace ); ?></a><img class="backup-icon status-icon" src="<?php echo WPBACKITUP_URLPATH. "/images/loader.gif"; ?>" height="16" width="16" /></p>
8
+ <h3>Download</h3>
9
+ <p><div id="download-link"></div></p>
10
+ <h3>Status</h3>
11
+ <p><div id="status">Nothing to report</div></p>
12
+ </div>
13
+ <div id="sidebar">
14
+ <div class="widget" id="restore-widget">
15
+ <h3 class="promo">Go Pro!</h3>
16
+ <p>Upgrade to <a href="http://www.wpbackitup.com/wp-backitup-pro/">WP Backitup Pro</a> and restore your backups with a few simple clicks!</p>
17
+ <p><a class="button-primary" href="http://www.wpbackitup.com/wp-backitup-pro/">Read more</a></p>
18
+ </div>
19
+ <div class="widget">
20
+ <h3 class="promo">Need support?</h3>
21
+ <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>
22
+ </div>
23
+ <div class="widget">
24
+ <h3 class="promo">Spread the Word!</h3>
25
+ <p>Why not <a href="http://wordpress.org/extend/plugins/wp-backitup/">rate the plugin 5&#9733; on Wordpress.org</a>?</p>
26
+ </div>
27
+ <div class="widget">
28
+ <h3 class="promo">Presstrends</h3>
29
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
30
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
31
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label>Enable</label></p>
32
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label>Disable</label></p>
33
+ <p>Help to improve Easy Webtrends by enabling <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
34
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
35
+ </form>
36
+ </div>
37
+ </div>
38
+ </div>
tags/1.2.1/backups/status.log ADDED
@@ -0,0 +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>
tags/1.2.1/css/admin.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.2.1
5
+ * @since 1.0.1
6
+ */
7
+
8
+ /* Global */
9
+ .error { color: #ff0000;}
10
+
11
+ p {line-height: 1.4em;}
12
+
13
+ td {padding: 0;}
14
+
15
+ ul {padding: 1em 0 0 0;}
16
+
17
+ h3 {
18
+ margin: 0;
19
+ padding: 1em 0 0 0;
20
+ }
21
+
22
+ iframe {
23
+ height: 0;
24
+ margin: 0;
25
+ padding: 0;
26
+ position: absolute;
27
+ top: 0;
28
+ right: 0;
29
+ width: 0;
30
+ z-index: -10;
31
+ }
32
+
33
+ .submit {
34
+ padding: 0;
35
+ }
36
+
37
+ /* Content */
38
+ #content {
39
+ float: left;
40
+ width: 65%;
41
+ }
42
+
43
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
44
+
45
+ .status-icon {
46
+ display: inline;
47
+ height: 16px;
48
+ position: relative;
49
+ top: 3px;
50
+ left: 5px;
51
+ visibility: hidden;
52
+ width: 16px;
53
+ }
54
+
55
+ /* Sidebar */
56
+ #sidebar {
57
+ float: right;
58
+ width: 30%;
59
+ }
60
+
61
+ .widget {padding: 1em;}
62
+ .errorMessage{
63
+ color: red;
64
+ }
tags/1.2.1/images/icon.png ADDED
Binary file
tags/1.2.1/images/icon32.png ADDED
Binary file
tags/1.2.1/images/loader.gif ADDED
Binary file
tags/1.2.1/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.2.1
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.2.1
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 WPBackitupLite {
41
+ var $namespace = "wp-backitup-lite";
42
+ var $friendly_name = WPBACKITUP_ITEM_NAME;
43
+ var $version = WPBACKITUP_VERSION;
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
+ WPBackitupLite::instance();
339
+ }
340
+
341
+ register_activation_hook( __FILE__, array( 'WPBackitup', 'activate' ) );
342
+ register_deactivation_hook( __FILE__, array( 'WPBackitup', 'deactivate' ) );
tags/1.2.1/js/admin.js ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.2.1
5
+ * @since 1.0.1
6
+ */
7
+
8
+ (function($){
9
+
10
+
11
+ //define backup variables
12
+ var backup = {
13
+ action: 'backup',
14
+ beforeSend: function() {
15
+ $('.backup-icon').css('visibility','visible');
16
+ var htmlText = "<div class='prerequisites'>Checking Prerequisites: <span class='currentStatus'>Pending</span></div><div class='backupfiles'>Backing up files: <span class='currentStatus'>Pending</span></div><div class='backupdb'>Backing up database: <span class='currentStatus'>Pending</span></div><div class='infofile'>Creating Info File: <span class='currentStatus'>Pending</span></div><div class='zipfile'>Creating Zip File: <span class='currentStatus'>Pending</span></div><div class='cleanup'>Cleaning Up: <span class='currentStatus'>Pending</span></div><div class='errorMessage'><span class='currentStatus'></span></div>";
17
+ $("#status").html(htmlText);
18
+ window.intervalDefine = setInterval(display_log, 1000);
19
+ }
20
+ };
21
+ //define download variables
22
+ var download = {
23
+ action: 'download'
24
+ };
25
+ //define logreader variables
26
+ var logreader = {
27
+ action: 'logreader'
28
+ };
29
+ //define logreader function
30
+ function display_log() {
31
+ $.post(ajaxurl, logreader, function(response) {
32
+ var xmlObj = $(response);
33
+ xmlObj.each(function(){
34
+ var attributename = "." + $(this).attr('code');
35
+ $(attributename).find(".currentStatus").html($(this).text());
36
+ if($(this).attr('code') == "finalinfo" || $(this).attr('code') == "errorMessage")
37
+ {
38
+ clearInterval(window.intervalDefine);
39
+ }
40
+ });
41
+ });
42
+ }
43
+ //define download function
44
+ function download_link() {
45
+ $.post(ajaxurl, download, function(response) {
46
+ $("#download-link").html(response);
47
+ });
48
+ }
49
+
50
+ //execute download (on page load/refresh)
51
+ download_link();
52
+
53
+ //execute backup on button click
54
+ $(".backup-button").click( function() {
55
+ $.post(ajaxurl, backup, function(response) {
56
+ download_link();
57
+ clearInterval(display_log);
58
+ $('.backup-icon').fadeOut(1000);
59
+ $("#php").html(response); //Return PHP messages, used for development
60
+ });
61
+ })
62
+
63
+ //execute restore on button click
64
+ $("#restore-form").submit(function() {
65
+ var maximum = $("#maximum").val();
66
+ var fil = document.getElementById("wpbackitup-zip");
67
+ var sizes = fil.files[0].size;
68
+ var sizesd = sizes/(1024*1024);
69
+ if(sizesd > maximum)
70
+ {
71
+ $("#status").html("<span style='color: red'>File size exceeds maxium upload size.</span>");
72
+ return false;
73
+ }
74
+ var htmlvals = '<div class="upload">Uploading file: <span class="currentStatus">Pending</span></div><div class="unzipping">Unzipping Files: <span class="currentStatus">Pending</span></div><div class="validation">Validating Zip File: <span class="currentStatus">Pending</span></div><div class="wpcontent">Replacing WP-CONTENT Directory: <span class="currentStatus">Pending</span></div><div class="database">Restoring Database: <span class="currentStatus">Pending</span></div><div class="infomessage"><span class="currentStatus"></span></div><div class="errorMessage"><span class="currentStatus"></span></div>';
75
+
76
+ $("#status").html(htmlvals);
77
+ $(".upload").find('.currentStatus').html('In Progress');
78
+ $('.restore-icon').css('visibility','visible');
79
+ window.intervalDefine = setInterval(display_log, 1000);
80
+ $("#restore-form").attr("target","upload_target");
81
+ $("#upload_target").load(function (){
82
+ importRestore();
83
+ });
84
+ });
85
+
86
+ //define importRestore function
87
+ function importRestore() {
88
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; //process upload
89
+ $("#php").html(ret); //Return PHP messages, used for development
90
+ clearInterval(display_log);
91
+ $('.restore-icon').fadeOut(1000);
92
+ }
93
+ })(jQuery);
tags/1.2.1/js/ajaxfileupload.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Ajax File Upload
3
+ *
4
+ * @version 1.2.1
5
+ * @since 1.0.1
6
+ */
7
+
8
+ jQuery.extend({
9
+ createUploadIframe: function(id, uri)
10
+ {
11
+ //create frame
12
+ var frameId = 'jUploadFrame' + id;
13
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
14
+ if(window.ActiveXObject)
15
+ {
16
+ if(typeof uri== 'boolean'){
17
+ iframeHtml += ' src="' + 'javascript:false' + '"';
18
+
19
+ }
20
+ else if(typeof uri== 'string'){
21
+ iframeHtml += ' src="' + uri + '"';
22
+
23
+ }
24
+ }
25
+ iframeHtml += ' />';
26
+ jQuery(iframeHtml).appendTo(document.body);
27
+
28
+ return jQuery('#' + frameId).get(0);
29
+ },
30
+ createUploadForm: function(id, fileElementId, data)
31
+ {
32
+ //create form
33
+ var formId = 'jUploadForm' + id;
34
+ var fileId = 'jUploadFile' + id;
35
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
36
+ if(data)
37
+ {
38
+ for(var i in data)
39
+ {
40
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
41
+ }
42
+ }
43
+ var oldElement = jQuery('#' + fileElementId);
44
+ var newElement = jQuery(oldElement).clone();
45
+ jQuery(oldElement).attr('id', fileId);
46
+ jQuery(oldElement).before(newElement);
47
+ jQuery(oldElement).appendTo(form);
48
+
49
+
50
+
51
+ //set attributes
52
+ jQuery(form).css('position', 'absolute');
53
+ jQuery(form).css('top', '-1200px');
54
+ jQuery(form).css('left', '-1200px');
55
+ jQuery(form).appendTo('body');
56
+ return form;
57
+ },
58
+
59
+ ajaxFileUpload: function(s) {
60
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
61
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
62
+ var id = new Date().getTime()
63
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
64
+ var io = jQuery.createUploadIframe(id, s.secureuri);
65
+ var frameId = 'jUploadFrame' + id;
66
+ var formId = 'jUploadForm' + id;
67
+ // Watch for a new set of requests
68
+ if ( s.global && ! jQuery.active++ )
69
+ {
70
+ jQuery.event.trigger( "ajaxStart" );
71
+ }
72
+ var requestDone = false;
73
+ // Create the request object
74
+ var xml = {}
75
+ if ( s.global )
76
+ jQuery.event.trigger("ajaxSend", [xml, s]);
77
+ // Wait for a response to come back
78
+ var uploadCallback = function(isTimeout)
79
+ {
80
+ var io = document.getElementById(frameId);
81
+ try
82
+ {
83
+ if(io.contentWindow)
84
+ {
85
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
86
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
87
+
88
+ }else if(io.contentDocument)
89
+ {
90
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
91
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
92
+ }
93
+ }catch(e)
94
+ {
95
+ jQuery.handleError(s, xml, null, e);
96
+ }
97
+ if ( xml || isTimeout == "timeout")
98
+ {
99
+ requestDone = true;
100
+ var status;
101
+ try {
102
+ status = isTimeout != "timeout" ? "success" : "error";
103
+ // Make sure that the request was successful or notmodified
104
+ if ( status != "error" )
105
+ {
106
+ // process the data (runs the xml through httpData regardless of callback)
107
+ var data = jQuery.uploadHttpData( xml, s.dataType );
108
+ // If a local callback was specified, fire it and pass it the data
109
+ if ( s.success )
110
+ s.success( data, status );
111
+
112
+ // Fire the global callback
113
+ if( s.global )
114
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
115
+ } else
116
+ jQuery.handleError(s, xml, status);
117
+ } catch(e)
118
+ {
119
+ status = "error";
120
+ jQuery.handleError(s, xml, status, e);
121
+ }
122
+
123
+ // The request was completed
124
+ if( s.global )
125
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
126
+
127
+ // Handle the global AJAX counter
128
+ if ( s.global && ! --jQuery.active )
129
+ jQuery.event.trigger( "ajaxStop" );
130
+
131
+ // Process result
132
+ if ( s.complete )
133
+ s.complete(xml, status);
134
+
135
+ jQuery(io).unbind()
136
+
137
+ setTimeout(function()
138
+ { try
139
+ {
140
+ jQuery(io).remove();
141
+ jQuery(form).remove();
142
+
143
+ } catch(e)
144
+ {
145
+ jQuery.handleError(s, xml, null, e);
146
+ }
147
+
148
+ }, 100)
149
+
150
+ xml = null
151
+
152
+ }
153
+ }
154
+ // Timeout checker
155
+ if ( s.timeout > 0 )
156
+ {
157
+ setTimeout(function(){
158
+ // Check to see if the request is still happening
159
+ if( !requestDone ) uploadCallback( "timeout" );
160
+ }, s.timeout);
161
+ }
162
+ try
163
+ {
164
+
165
+ var form = jQuery('#' + formId);
166
+ jQuery(form).attr('action', s.url);
167
+ jQuery(form).attr('method', 'POST');
168
+ jQuery(form).attr('target', frameId);
169
+ if(form.encoding)
170
+ {
171
+ jQuery(form).attr('encoding', 'multipart/form-data');
172
+ }
173
+ else
174
+ {
175
+ jQuery(form).attr('enctype', 'multipart/form-data');
176
+ }
177
+ jQuery(form).submit();
178
+
179
+ } catch(e)
180
+ {
181
+ jQuery.handleError(s, xml, null, e);
182
+ }
183
+
184
+ jQuery('#' + frameId).load(uploadCallback );
185
+ return {abort: function () {}};
186
+
187
+ },
188
+
189
+ uploadHttpData: function( r, type ) {
190
+ var data = !type;
191
+ data = type == "xml" || data ? r.responseXML : r.responseText;
192
+ // If the type is "script", eval it in global context
193
+ if ( type == "script" )
194
+ jQuery.globalEval( data );
195
+ // Get the JavaScript object, if JSON is used.
196
+ if ( type == "json" )
197
+ eval( "data = " + data );
198
+ // evaluate scripts within html
199
+ if ( type == "html" )
200
+ jQuery("<div>").html(data).evalScripts();
201
+
202
+ return data;
203
+ }
204
+ })
205
+
tags/1.2.1/languages/wp-backitup-pro.mo ADDED
Binary file
tags/1.2.1/languages/wp-backitup-pro.po ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup Pro\n"
4
+ "POT-Creation-Date: 2013-02-17 11:26-0000\n"
5
+ "PO-Revision-Date: 2013-02-17 11:26-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: WP Backitup <support@wpbackitup.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: index.php:328
19
+ msgid "Settings"
20
+ msgstr ""
21
+
22
+ #: lib/functions.php:46
23
+ msgid "Download most recent export file"
24
+ msgstr ""
25
+
26
+ #: lib/functions.php:50
27
+ msgid "No export file available for download. Please create one."
28
+ msgstr ""
29
+
30
+ #: lib/includes/backup.php:25 lib/includes/restore.php:24
31
+ msgid "Can't open file"
32
+ msgstr ""
33
+
34
+ #: lib/includes/backup.php:29
35
+ msgid "Creating backup directory..."
36
+ msgstr ""
37
+
38
+ #: lib/includes/backup.php:31
39
+ msgid ""
40
+ "Cannot create backup directory. Please check the CHMOD settings of your wp-"
41
+ "backitup plugin directory"
42
+ msgstr ""
43
+
44
+ #: lib/includes/backup.php:37 lib/includes/restore.php:142
45
+ msgid "Done"
46
+ msgstr ""
47
+
48
+ #: lib/includes/backup.php:45
49
+ msgid "Backing up your files..."
50
+ msgstr ""
51
+
52
+ #: lib/includes/backup.php:50
53
+ msgid "Unable to backup your files. Please try again."
54
+ msgstr ""
55
+
56
+ #: lib/includes/backup.php:55
57
+ msgid "Backing up your database..."
58
+ msgstr ""
59
+
60
+ #: lib/includes/backup.php:57 lib/includes/backup.php:77
61
+ #: lib/includes/restore.php:156 lib/includes/restore.php:174
62
+ #: lib/includes/restore.php:200 lib/includes/restore.php:336
63
+ msgid "Done!"
64
+ msgstr ""
65
+
66
+ #: lib/includes/backup.php:59
67
+ msgid "Unable to backup your database. Please try again."
68
+ msgstr ""
69
+
70
+ #: lib/includes/backup.php:67
71
+ msgid "Unable to create site information file. Please try again."
72
+ msgstr ""
73
+
74
+ #: lib/includes/backup.php:73
75
+ msgid "Creating backup zip..."
76
+ msgstr ""
77
+
78
+ #: lib/includes/backup.php:81
79
+ msgid "Warning: Unable to cleanup your backup directory."
80
+ msgstr ""
81
+
82
+ #: lib/includes/backup.php:85
83
+ msgid ""
84
+ "Backup file created successfully. You can download your backup file using "
85
+ "the link above."
86
+ msgstr ""
87
+
88
+ #: lib/includes/restore.php:133
89
+ msgid "No file selected"
90
+ msgstr ""
91
+
92
+ #: lib/includes/restore.php:138
93
+ msgid "Uploading restoration file..."
94
+ msgstr ""
95
+
96
+ #: lib/includes/restore.php:144
97
+ msgid "Your file could not be uploaded"
98
+ msgstr ""
99
+
100
+ #: lib/includes/restore.php:158
101
+ msgid "Your restoration file could not be unzipped."
102
+ msgstr ""
103
+
104
+ #: lib/includes/restore.php:165
105
+ msgid "Validating zip..."
106
+ msgstr ""
107
+
108
+ #: lib/includes/restore.php:176
109
+ msgid ""
110
+ "Your zip file appears to be invalid. Please ensure you chose the correct zip "
111
+ "file."
112
+ msgstr ""
113
+
114
+ #: lib/includes/restore.php:184
115
+ msgid "Restoring wp-content directory..."
116
+ msgstr ""
117
+
118
+ #: lib/includes/restore.php:186
119
+ msgid ""
120
+ "Unable to remove existing wp-content directory for import. Please check your "
121
+ "CHMOD settings in /wp-content/."
122
+ msgstr ""
123
+
124
+ #: lib/includes/restore.php:193
125
+ msgid ""
126
+ "Unable to create new wp-content directory for import. Please check your "
127
+ "CHMOD settings in /wp-content/."
128
+ msgstr ""
129
+
130
+ #: lib/includes/restore.php:202
131
+ msgid "Unable to import wp-content. Please try again."
132
+ msgstr ""
133
+
134
+ #: lib/includes/restore.php:212
135
+ msgid "Restoring database..."
136
+ msgstr ""
137
+
138
+ #: lib/includes/restore.php:222
139
+ msgid "Unable to connect to your current database"
140
+ msgstr ""
141
+
142
+ #: lib/includes/restore.php:236
143
+ msgid "Unable to get current site URL from database. Please try again."
144
+ msgstr ""
145
+
146
+ #: lib/includes/restore.php:250
147
+ msgid "Unable to get current home URL from database. Please try again."
148
+ msgstr ""
149
+
150
+ #: lib/includes/restore.php:264
151
+ msgid "Unable to get current user ID from database. Please try again."
152
+ msgstr ""
153
+
154
+ #: lib/includes/restore.php:278
155
+ msgid "Unable to get current user password from database. Please try again."
156
+ msgstr ""
157
+
158
+ #: lib/includes/restore.php:292
159
+ msgid "Unable to get current user email from database. Please try again."
160
+ msgstr ""
161
+
162
+ #: lib/includes/restore.php:305
163
+ msgid ""
164
+ "Unable to get import your database. This may require importing the file "
165
+ "manually."
166
+ msgstr ""
167
+
168
+ #: lib/includes/restore.php:323
169
+ msgid ""
170
+ "Unable to update your current home URL value. This may require importing the "
171
+ "file manually."
172
+ msgstr ""
173
+
174
+ #: lib/includes/restore.php:330
175
+ msgid ""
176
+ "Unable to update your user information. This may require importing the file "
177
+ "manually."
178
+ msgstr ""
179
+
180
+ #: lib/includes/restore.php:338
181
+ msgid "Warning: Database not detected in import file."
182
+ msgstr ""
183
+
184
+ #: lib/includes/restore.php:351
185
+ msgid "Restoration complete. Please refresh the page."
186
+ msgstr ""
187
+
188
+ #: views/options.php:6 views/options.php:8
189
+ msgid "Backup"
190
+ msgstr ""
191
+
192
+ #: views/options.php:7
193
+ msgid "Create a backup file of this site's content and settings."
194
+ msgstr ""
195
+
196
+ #: views/options.php:9
197
+ msgid "Download"
198
+ msgstr ""
199
+
200
+ #: views/options.php:11 views/options.php:23
201
+ msgid "Restore"
202
+ msgstr ""
203
+
204
+ #: views/options.php:14
205
+ msgid ""
206
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
207
+ "plugins, uploads and settings."
208
+ msgstr ""
209
+
210
+ #: views/options.php:25
211
+ msgid "Status"
212
+ msgstr ""
213
+
214
+ #: views/options.php:26
215
+ msgid "Nothing to report"
216
+ msgstr ""
217
+
218
+ #: views/options.php:35 views/options.php:56
219
+ msgid "License Key"
220
+ msgstr ""
221
+
222
+ #: views/options.php:39
223
+ msgid "Automatic updates enabled"
224
+ msgstr ""
225
+
226
+ #: views/options.php:41
227
+ msgid "Activate automatic updates by entering your license key"
228
+ msgstr ""
229
+
230
+ #: views/options.php:46
231
+ msgid "Active"
232
+ msgstr ""
233
+
234
+ #: views/options.php:47
235
+ msgid "Update"
236
+ msgstr ""
237
+
238
+ #: views/options.php:49
239
+ msgid "Inactive"
240
+ msgstr ""
241
+
242
+ #: views/options.php:50
243
+ msgid "Activate"
244
+ msgstr ""
245
+
246
+ #: views/options.php:55
247
+ msgid "Need Support?"
248
+ msgstr ""
249
+
250
+ #: views/options.php:60
251
+ msgid "Spread the Word"
252
+ msgstr ""
253
+
254
+ #: views/options.php:65
255
+ msgid "Enable"
256
+ msgstr ""
257
+
258
+ #: views/options.php:66
259
+ msgid "Disable"
260
+ msgstr ""
261
+
262
+ #: views/options.php:67
263
+ msgid ""
264
+ "Help to improve Easy Webtrends by enabling <a href=\"http://www.presstrends."
265
+ "io\" target=\"_blank\">Presstrends</a>"
266
+ msgstr ""
267
+
268
+ #: views/options.php:68
269
+ msgid "Save"
270
+ msgstr ""
tags/1.2.1/lib/constants.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WP Backitup Pro
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.2.1
9
+ * @since 1.0.1
10
+ */
11
+
12
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.2.1' );
13
+
14
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
19
+
20
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
21
+
22
+ if( !defined( 'WPBACKITUP_SITE_URL' ) ) define( 'WPBACKITUP_SITE_URL', 'http://www.wpbackitup.com' );
23
+
24
+ if( !defined( 'WPBACKITUP_ITEM_NAME' ) ) define( 'WPBACKITUP_ITEM_NAME', 'WP Backitup Lite' );
tags/1.2.1/lib/functions.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup Pro
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.2.1
9
+ * @since 1.0.1
10
+ */
11
+
12
+ // include recurseZip class
13
+ if( !class_exists( 'recurseZip' ) ) {
14
+ include_once 'includes/recurse_zip.php';
15
+ }
16
+
17
+ //load backup function
18
+ function backup() {
19
+ include_once 'includes/backup.php';
20
+ }
21
+ add_action('wp_ajax_backup', 'backup');
22
+
23
+ //load download function
24
+ function download() {
25
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
26
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
27
+ $filename = basename($file);
28
+ echo 'Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a>';
29
+ }
30
+ } else {
31
+ echo 'No export file available for download. Please create one.';
32
+ }
33
+ die();
34
+ }
35
+ add_action('wp_ajax_download', 'download');
36
+
37
+ //load logreader function
38
+ function logreader() {
39
+ $log = WPBACKITUP_DIRNAME .'/logs/status.log';
40
+ if(file_exists($log) ) {
41
+ readfile($log);
42
+ }
43
+ die();
44
+ }
45
+ add_action('wp_ajax_logreader', 'logreader');
46
+
47
+ //define create_dir function
48
+ if(!function_exists('create_dir')) {
49
+ function create_dir($dir) {
50
+ if( !is_dir($dir) ) {
51
+ @mkdir($dir, 0755);
52
+ }
53
+ return true;
54
+ }
55
+ }
56
+
57
+ //Define recusive_copy function
58
+ if(!function_exists('recursive_copy')) {
59
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
60
+ if( is_dir($dir) ) { //If the directory exists
61
+ if ($dh = opendir($dir) ) {
62
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
63
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
64
+ if (!is_dir( $dir.$file ) ) {
65
+ //Copy files to destination directory
66
+ $fsrc = fopen($dir .$file,'r');
67
+ $fdest = fopen($target_path .$file,'w+');
68
+ $len = stream_copy_to_stream($fsrc,$fdest);
69
+ fclose($fsrc);
70
+ fclose($fdest);
71
+ } else { //If $file is a directory
72
+ $destdir = $target_path .$file; //Modify the destination dir
73
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
74
+ @mkdir($destdir, 0755);
75
+ }
76
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
77
+ }
78
+ }
79
+ }
80
+ closedir($dh);
81
+ }
82
+ }
83
+ return true;
84
+ }
85
+ }
86
+
87
+ //Define DB backup function
88
+ if(!function_exists('db_backup')) {
89
+ function db_backup($path) {
90
+ $handle = fopen($path .'db-backup.sql', 'w+');
91
+
92
+
93
+ $path_sql = $path .'/db-backup.sql';
94
+ $db_name = DB_NAME;
95
+ $db_user = DB_USER;
96
+ $db_pass = DB_PASSWORD;
97
+ $db_host = DB_HOST;
98
+
99
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name");
100
+ fwrite($handle,$output);
101
+ fclose($handle);
102
+ return true;
103
+ }
104
+ }
105
+
106
+ //Define the create_siteinfo function
107
+ if(!function_exists('create_siteinfo')) {
108
+ function create_siteinfo($path, $table_prefix) {
109
+ $siteinfo = $path ."backupsiteinfo.txt";
110
+ $handle = fopen($siteinfo, 'w+');
111
+ $entry = site_url( '/' ) ."\n$table_prefix";
112
+ fwrite($handle, $entry);
113
+ fclose($handle);
114
+ return true;
115
+ }
116
+ }
117
+
118
+ //Define recursive_delete function
119
+ if(!function_exists('recursive_delete')){
120
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
121
+ if( is_dir($dir) ){
122
+ if($dh = opendir($dir)) {
123
+ while( ($file = readdir($dh)) !== false ) {
124
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
125
+ if(!is_dir($dir .'/'. $file)) {
126
+ unlink($dir .'/'. $file);
127
+ } else {
128
+ recursive_delete($dir.'/'. $file, $ignore);
129
+ }
130
+ }
131
+ }
132
+ }
133
+ @rmdir($dir);
134
+ closedir($dh);
135
+ }
136
+ return true;
137
+ }
138
+ }
139
+
140
+ //Define zip function
141
+ function zip($source, $destination, $ignore) {
142
+ if (is_string($source)) $source_arr = array($source); // convert it to array
143
+ if (!extension_loaded('zip')) {
144
+ return false;
145
+ }
146
+ $zip = new ZipArchive();
147
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
148
+ return false;
149
+ }
150
+ foreach ($source_arr as $source) {
151
+ if (!file_exists($source)) continue;
152
+ $source = str_replace('\\', '/', realpath($source));
153
+ if (is_dir($source) === true) {
154
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
155
+ foreach ($files as $file) {
156
+ if (!preg_match($ignore, $file)) {
157
+ $file = str_replace('\\', '/', realpath($file));
158
+ if (is_dir($file) === true) {
159
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
160
+ } else if (is_file($file) === true) {
161
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
162
+ }
163
+ }
164
+ }
165
+ } else if (is_file($source) === true) {
166
+ $zip->addFromString(basename($source), file_get_contents($source));
167
+ }
168
+ }
169
+ return $zip->close();
170
+ }
171
+
172
+ //load presstrends
173
+ function load_presstrends() {
174
+ global $WPBackitup;
175
+ if($WPBackitup->get_option( 'presstrends' ) == 'enabled') {
176
+ // PressTrends Account API Key
177
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
178
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
179
+
180
+ // Start of Metrics
181
+ global $wpdb;
182
+ $data = get_transient( 'presstrends_cache_data' );
183
+ if ( !$data || $data == '' ) {
184
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
185
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
186
+
187
+ $count_posts = wp_count_posts();
188
+ $count_pages = wp_count_posts( 'page' );
189
+ $comments_count = wp_count_comments();
190
+
191
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
192
+ if ( function_exists( 'wp_get_theme' ) ) {
193
+ $theme_data = wp_get_theme();
194
+ $theme_name = urlencode( $theme_data->Name );
195
+ } else {
196
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
197
+ $theme_name = $theme_data['Name'];
198
+ }
199
+
200
+ $plugin_name = '&';
201
+ foreach ( get_plugins() as $plugin_info ) {
202
+ $plugin_name .= $plugin_info['Name'] . '&';
203
+ }
204
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
205
+ $plugin_data = get_plugin_data( __FILE__ );
206
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
207
+ $data = array(
208
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
209
+ 'posts' => $count_posts->publish,
210
+ 'pages' => $count_pages->publish,
211
+ 'comments' => $comments_count->total_comments,
212
+ 'approved' => $comments_count->approved,
213
+ 'spam' => $comments_count->spam,
214
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
215
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
216
+ 'theme_version' => $plugin_data['Version'],
217
+ 'theme_name' => $theme_name,
218
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
219
+ 'plugins' => count( get_option( 'active_plugins' ) ),
220
+ 'plugin' => urlencode( $plugin_name ),
221
+ 'wpversion' => get_bloginfo( 'version' ),
222
+ );
223
+
224
+ foreach ( $data as $k => $v ) {
225
+ $url .= $k . '/' . $v . '/';
226
+ }
227
+ wp_remote_get( $url );
228
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
229
+ }
230
+ }
231
+ }
232
+ // PressTrends WordPress Action
233
+ add_action('admin_init', 'load_presstrends');
tags/1.2.1/lib/includes/backup.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Backup Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.2.1
10
+ * @since 1.0.1
11
+ */
12
+
13
+ global $WPBackitup;
14
+
15
+ //limit process to 15 minutes
16
+ @set_time_limit(900);
17
+
18
+ //Define variables
19
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
20
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
21
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
22
+
23
+ //create log file
24
+
25
+ $log = WPBACKITUP_DIRNAME ."/logs/status.log";
26
+ unlink($log);
27
+ $fh = fopen($log, 'w') or die("Can't open log file");
28
+
29
+ //Delete the existing backup directory
30
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
31
+
32
+ //Re-create and empty backup dir
33
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
34
+ fwrite($fh, '<status code="prerequsites">Failed</status>');
35
+ fwrite($fh, '<error code="errorMessage">Error: Unable to create new directory for backup. Please check your CHMOD settings in ' .WPBACKITUP_DIR_PATH .'.</error>');
36
+
37
+ fclose($fh);
38
+
39
+ die();
40
+ }
41
+
42
+ //Check to see if the directory is writeable
43
+
44
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
45
+ fwrite($fh, '<status code="prerequsites">Failed</status>');
46
+ fwrite($fh, '<error code="errorMessage">Error: Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.</error>');
47
+
48
+ die();
49
+ } else {
50
+ //If the directory is writeable, create the backup folder if it doesn't exist
51
+ if( !is_dir($backup_project_path) ) {
52
+ @mkdir($backup_project_path, 0755);
53
+ fwrite($fh, '<status code="prerequisites">Done</status>');
54
+ }
55
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
56
+ unlink($zip);
57
+ }
58
+ }
59
+
60
+ //Backup content to project dir
61
+
62
+ //Backup with copy
63
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
64
+ fwrite($fh, '<status code="backupfiles">Done</status>');
65
+ } else {
66
+ fwrite($fh, '<status code="backupfiles">Failed</status>');
67
+ fwrite($fh, '<error code="errorMessage">Error: Unable to backup your files. Please try again.</error>');
68
+ die();
69
+ }
70
+
71
+ //Dump DB to project dir
72
+
73
+
74
+ if( db_backup($backup_project_path) ) {
75
+ fwrite($fh, '<status code="backupdb">Done</status>');
76
+ } else {
77
+ fwrite($fh, '<error code="errorMessage">Error: Unable to backup your database. Please try again.</error>');
78
+ recursive_delete($backup_project_path);
79
+ die();
80
+ }
81
+
82
+ //Create siteinfo in project dir
83
+ global $wpdb;
84
+
85
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
86
+ fwrite($fh, '<status code="infofile">Failed</status>');
87
+ fwrite($fh, '<error code="errorMessage">Error: Unable to create site information file. Please try again.</error>');
88
+ recursive_delete($backup_project_path);
89
+
90
+ die();
91
+ }
92
+ else
93
+ {
94
+ fwrite($fh, '<status code="infofile">Done</status>');
95
+ }
96
+
97
+ //Zip the project dir
98
+
99
+ $z = new recurseZip();
100
+ $src = rtrim($backup_project_path, '/');
101
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
102
+ fwrite($fh, '<status code="zipfile">Done</status>');
103
+
104
+ //Delete backup dir
105
+ if(!recursive_delete($backup_project_path)) {
106
+ fwrite($fh, '<status code="cleanup">Failed</status>');
107
+ fwrite($fh, '<error code="errorMessage">Error: Warning: Unable to cleanup your backup directory.</error>');
108
+
109
+ }
110
+ else
111
+ {
112
+ fwrite($fh, '<status code="cleanup">Done</status>');
113
+ }
114
+
115
+ //close log file
116
+ fwrite($fh, '<status code="finalinfo">Backup file created successfully. You can download your backup file using the link above.</status>');
117
+ fwrite($fh, '<status code="end">End</status>');
118
+ fclose($fh);
119
+
120
+ //End backup function
121
+ die();
tags/1.2.1/lib/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * WP Backitup Recurse Zip Function
1
  *
2
  * @package WP Backitup Pro
3
  *
4
  * @author jcpeden
5
  * @version 1.2.1
6
  * @since 1.0.1
7
  */
1
+ <?php
2
  * WP Backitup Recurse Zip Function
3
  *
4
  * @package WP Backitup Pro
5
  *
6
  * @author jcpeden
7
  * @version 1.2.1
8
  * @since 1.0.1
9
  */
tags/1.2.1/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>.
tags/1.2.1/logs/status.log ADDED
@@ -0,0 +1 @@
 
1
+ <status code="prerequisites">Done</status><status code="backupfiles">Done</status><status code="backupdb">Done</status><status code="infofile">Done</status><status code="zipfile">Done</status><status code="cleanup">Done</status><status code="finalinfo">Backup file created successfully. You can download your backup file using the link above.</status><status code="end">End</status>
tags/1.2.1/readme.txt ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
7
+ Stable tag: 1.2.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.2.1 =
100
+ * Fixed issues with broken directory tree, brought versioning inline with WP Backitup Pro
101
+
102
+ = 1.1.7 =
103
+ * Setup backup to use mysqldump and shellexec.
104
+
105
+ = 1.1.6 =
106
+ * Forced backup process to ignore cache files.
107
+
108
+ = 1.1.5 =
109
+ * Fixed minor bugs in the code.
110
+
111
+ = 1.1.4 =
112
+ * Fixed minor bugs in tracking code and options.
113
+
114
+ = 1.1.3 =
115
+ * Re-wrote plugin in OOP, added option to disable Presstrends tracking code.
116
+
117
+ = 1.1.2 =
118
+ * Fixed issue with stylesheet not being loaded.
119
+
120
+ = 1.1.1 =
121
+ * Fixed issue with plugin not detecing addons
122
+
123
+ = 1.1.0 =
124
+ * Fixed bugs with addons system.
125
+
126
+ = 1.0.9 =
127
+ * Added Presstrends tracking code.
128
+
129
+ = 1.0.8 =
130
+ * Modified plugin administration and loaded menu tab in main toolbar.
131
+
132
+ = 1.0.7 =
133
+ * 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.
134
+
135
+ = 1.0.6 =
136
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
137
+
138
+ = 1.0.5 =
139
+ * 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.
140
+
141
+ = 1.0.4 =
142
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
143
+
144
+ = 1.0.3 =
145
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
146
+
147
+ = 1.0.2 =
148
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
149
+
150
+ = 1.0.1 =
151
+ * Increased PHP timeout to 900 seconds (5 minutes).
152
+
153
+ = 1.0 =
154
+ * Plugin released.
155
+
156
+ == Upgrade Notice ==
157
+
158
+ = 1.2.1 =
159
+ * Critical upgrade. Plugin broken for most users without this update.
160
+
161
+ = 1.1.7 =
162
+ * Recommended upgrade. Backup process faster and more stable.
163
+
164
+ = 1.1.6 =
165
+ * Recommended upgrade. Backup process faster and more stable.
166
+
167
+ = 1.1.5 =
168
+ * Non-critical upgrade. Fixed minor bugs in code.
169
+
170
+ = 1.1.4 =
171
+ * Non-critical upgrade. Fixed bugs in code.
172
+
173
+ = 1.1.3 =
174
+ * Non-critical upgrade. Re-wrote plugin in object-oriented PHP.
175
+
176
+ = 1.1.2 =
177
+ * Critical upgrade. Fixed issue with stylesheet.
178
+
179
+ = 1.1.1 =
180
+ * Critical upgrade. Fixed further bugs with addons system.
181
+
182
+ = 1.1.0 =
183
+ * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
184
+
185
+ = 1.0.9 =
186
+ * Non-essential upgrade. Added Presstrends code.
187
+
188
+ = 1.0.8 =
189
+ * Recommended upgrade. Added links to admin menu.
190
+
191
+ = 1.0.7 =
192
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
193
+
194
+ = 1.0.6 =
195
+ * Non-critical upgrade.
196
+
197
+ = 1.0.5 =
198
+ * Critical upgrade: More stable, increased flexibility and power.
199
+
200
+ = 1.0.4 =
201
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
202
+
203
+ = 1.0.3 =
204
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
205
+
206
+ = 1.0.2 =
207
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
208
+
209
+ = 1.0.1 =
210
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
211
+
212
+ = 1.0 =
213
+ Initial version of the plugin.
tags/1.2.1/views/options.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <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>
3
+ <h2><?php echo $page_title; ?></h2>
4
+ <div id="content">
5
+ <h3><?php _e('Backup', $this->namespace ); ?></h3>
6
+ <p><?php _e('Create a backup file of this site\'s content and settings.', $this->namespace ); ?></p>
7
+ <p><a href="#" class="backup-button button-primary"><?php _e( "Backup", $this->namespace ); ?></a><img class="backup-icon status-icon" src="<?php echo WPBACKITUP_URLPATH. "/images/loader.gif"; ?>" height="16" width="16" /></p>
8
+ <h3>Download</h3>
9
+ <p><div id="download-link"></div></p>
10
+ <h3>Status</h3>
11
+ <p><div id="status">Nothing to report</div></p>
12
+ </div>
13
+ <div id="sidebar">
14
+ <div class="widget" id="restore-widget">
15
+ <h3 class="promo">Go Pro!</h3>
16
+ <p>Upgrade to <a href="http://www.wpbackitup.com/wp-backitup-pro/">WP Backitup Pro</a> and restore your backups with a few simple clicks!</p>
17
+ <p><a class="button-primary" href="http://www.wpbackitup.com/wp-backitup-pro/">Read more</a></p>
18
+ </div>
19
+ <div class="widget">
20
+ <h3 class="promo">Need support?</h3>
21
+ <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>
22
+ </div>
23
+ <div class="widget">
24
+ <h3 class="promo">Spread the Word!</h3>
25
+ <p>Why not <a href="http://wordpress.org/extend/plugins/wp-backitup/">rate the plugin 5&#9733; on Wordpress.org</a>?</p>
26
+ </div>
27
+ <div class="widget">
28
+ <h3 class="promo">Presstrends</h3>
29
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
30
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
31
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label>Enable</label></p>
32
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label>Disable</label></p>
33
+ <p>Help to improve Easy Webtrends by enabling <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
34
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
35
+ </form>
36
+ </div>
37
+ </div>
38
+ </div>
tags/1.2.2/backups/status.log ADDED
@@ -0,0 +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>
tags/1.2.2/css/admin.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.2.1
5
+ * @since 1.0.1
6
+ */
7
+
8
+ /* Global */
9
+ .error { color: #ff0000;}
10
+
11
+ p {line-height: 1.4em;}
12
+
13
+ td {padding: 0;}
14
+
15
+ ul {padding: 1em 0 0 0;}
16
+
17
+ h3 {
18
+ margin: 0;
19
+ padding: 1em 0 0 0;
20
+ }
21
+
22
+ iframe {
23
+ height: 0;
24
+ margin: 0;
25
+ padding: 0;
26
+ position: absolute;
27
+ top: 0;
28
+ right: 0;
29
+ width: 0;
30
+ z-index: -10;
31
+ }
32
+
33
+ .submit {
34
+ padding: 0;
35
+ }
36
+
37
+ /* Content */
38
+ #content {
39
+ float: left;
40
+ width: 65%;
41
+ }
42
+
43
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
44
+
45
+ .status-icon {
46
+ display: inline;
47
+ height: 16px;
48
+ position: relative;
49
+ top: 3px;
50
+ left: 5px;
51
+ visibility: hidden;
52
+ width: 16px;
53
+ }
54
+
55
+ /* Sidebar */
56
+ #sidebar {
57
+ float: right;
58
+ width: 30%;
59
+ }
60
+
61
+ .widget {padding: 1em;}
62
+ .errorMessage{
63
+ color: red;
64
+ }
tags/1.2.2/images/icon.png ADDED
Binary file
tags/1.2.2/images/icon32.png ADDED
Binary file
tags/1.2.2/images/loader.gif ADDED
Binary file
tags/1.2.2/index.php ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Lite
4
+ *
5
+ * @package WP Backitup Lite
6
+ *
7
+ * @global object $wpdb
8
+ *
9
+ * @author jcpeden
10
+ * @version 1.2.2
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.2.2
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
+ // Include constants file
37
+ include_once dirname( __FILE__ ) . '/lib/constants.php';
38
+
39
+ class WPBackitupLite {
40
+ var $namespace = "wp-backitup-lite";
41
+ var $friendly_name = WPBACKITUP_ITEM_NAME;
42
+ var $version = WPBACKITUP_VERSION;
43
+
44
+ // Default plugin options
45
+ var $defaults = array(
46
+ 'presstrends' => "enabled",
47
+ 'license_key' => "",
48
+ 'status' => "inactive"
49
+ );
50
+
51
+ /**
52
+ * Instantiation construction
53
+ *
54
+ * @uses add_action()
55
+ * @uses WPBackitupLite::wp_register_scripts()
56
+ * @uses WPBackitupLite::wp_register_styles()
57
+ */
58
+ function __construct() {
59
+ // Name of the option_value to store plugin options in
60
+ $this->option_name = '_' . $this->namespace . '--options';
61
+
62
+ // Load all library files used by this plugin
63
+ $libs = glob( WPBACKITUP_DIRNAME . '/lib/*.php' );
64
+ foreach( $libs as $lib ) {
65
+ include_once $lib;
66
+ }
67
+
68
+ /**
69
+ * Make this plugin available for translation.
70
+ * Translations can be added to the /languages/ directory.
71
+ */
72
+ load_theme_textdomain( $this->namespace, WPBACKITUP_DIRNAME . '/languages' );
73
+
74
+ // Add all action, filter and shortcode hooks
75
+ $this->_add_hooks();
76
+ }
77
+
78
+ /**
79
+ * Add in various hooks
80
+ *
81
+ * Place all add_action, add_filter, add_shortcode hook-ins here
82
+ */
83
+ private function _add_hooks() {
84
+ // Options page for configuration
85
+ add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
86
+ // Route requests for form processing
87
+ add_action( 'init', array( &$this, 'route' ) );
88
+
89
+ // Add a settings link next to the "Deactivate" link on the plugin listing page
90
+ add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
91
+
92
+ // Register all JavaScripts for this plugin
93
+ add_action( 'init', array( &$this, 'wp_register_scripts' ), 1 );
94
+ // Register all Stylesheets for this plugin
95
+ add_action( 'init', array( &$this, 'wp_register_styles' ), 1 );
96
+ }
97
+
98
+ /**
99
+ * Process update page form submissions
100
+ *
101
+ * @uses WPBackitupLite::sanitize()
102
+ * @uses wp_redirect()
103
+ * @uses wp_verify_nonce()
104
+ */
105
+ private function _admin_options_update() {
106
+
107
+ // Verify submission for processing using wp_nonce
108
+ if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-update-options" ) ) {
109
+ //create data array
110
+ $data = array();
111
+
112
+ /**
113
+ * Loop through each POSTed value and sanitize it to protect against malicious code. Please
114
+ * note that rich text (or full HTML fields) should not be processed by this function and
115
+ * dealt with directly.
116
+ */
117
+ foreach( $_POST['data'] as $key => $val ) {
118
+ $data[$key] = $this->_sanitize( $val );
119
+ }
120
+
121
+ //check license status and try to activate if invalid
122
+ $license = trim ( $data['license_key'] );
123
+
124
+ // Check license
125
+ $api_params = array(
126
+ 'edd_action' => 'check_license',
127
+ 'license' => $license,
128
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME )
129
+ );
130
+
131
+ // Call the custom API
132
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
133
+
134
+ // make sure the response came back okay
135
+ if ( is_wp_error( $response ) )
136
+ return false;
137
+
138
+ // decode the license data
139
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
140
+
141
+ if( $license_data->license != 'valid' ) {
142
+ // Try to activate license (process is almost identical to check_license)
143
+ $api_params = array(
144
+ 'edd_action'=> 'activate_license',
145
+ 'license' => $license,
146
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME ) // the name of our product in EDD
147
+ );
148
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ) );
149
+ if ( is_wp_error( $response ) )
150
+ return false;
151
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
152
+ }
153
+
154
+ /* Manually define status value */
155
+ $data['status'] = $license_data->license;
156
+
157
+ // Update the options value with the data submitted
158
+ update_option( $this->option_name, $data );
159
+
160
+ // Redirect back to the options page with the message flag to show the saved message
161
+ wp_safe_redirect( $_REQUEST['_wp_http_referer'] . '&update=1' );
162
+ exit;
163
+ }
164
+ }
165
+
166
+ /**
167
+ * Sanitize data
168
+ *
169
+ * @param mixed $str The data to be sanitized
170
+ *
171
+ * @uses wp_kses()
172
+ *
173
+ * @return mixed The sanitized version of the data
174
+ */
175
+ private function _sanitize( $str ) {
176
+ if ( !function_exists( 'wp_kses' ) ) {
177
+ include_once ABSPATH . 'wp-includes/kses.php';
178
+ }
179
+ global $allowedposttags;
180
+ global $allowedprotocols;
181
+
182
+ if ( is_string( $str ) ) {
183
+ $str = wp_kses( $str, $allowedposttags, $allowedprotocols );
184
+ } elseif( is_array( $str ) ) {
185
+ $arr = array();
186
+ foreach( (array) $str as $key => $val ) {
187
+ $arr[$key] = $this->_sanitize( $val );
188
+ }
189
+ $str = $arr;
190
+ }
191
+
192
+ return $str;
193
+ }
194
+
195
+ /**
196
+ * Hook into register_activation_hook action
197
+ *
198
+ * Put code here that needs to happen when your plugin is first activated (database
199
+ * creation, permalink additions, etc.)
200
+ */
201
+ static function activate() {
202
+ // Do activation actions
203
+ }
204
+
205
+ /**
206
+ * Define the admin menu options for this plugin
207
+ *
208
+ * @uses add_action()
209
+ * @uses add_options_page()
210
+ */
211
+ function admin_menu() {
212
+ $page_hook = add_menu_page( $this->friendly_name, $this->friendly_name, 'administrator', $this->namespace, array( &$this, 'admin_options_page' ), WPBACKITUP_URLPATH .'/images/icon.png', 73);
213
+
214
+ // Add print scripts and styles action based off the option page hook
215
+ add_action( 'admin_print_scripts-' . $page_hook, array( &$this, 'admin_print_scripts' ) );
216
+ add_action( 'admin_print_styles-' . $page_hook, array( &$this, 'admin_print_styles' ) );
217
+ }
218
+
219
+
220
+ /**
221
+ * The admin section options page rendering method
222
+ *
223
+ * @uses current_user_can()
224
+ * @uses wp_die()
225
+ */
226
+ function admin_options_page() {
227
+ if( !current_user_can( 'manage_options' ) ) {
228
+ wp_die( 'You do not have sufficient permissions to access this page' );
229
+ }
230
+
231
+ $page_title = $this->friendly_name . ' Options';
232
+ $namespace = $this->namespace;
233
+
234
+ include WPBACKITUP_DIRNAME . "/views/options.php";
235
+ }
236
+
237
+ /**
238
+ * Load JavaScript for the admin options page
239
+ *
240
+ * @uses wp_enqueue_script()
241
+ */
242
+ function admin_print_scripts() {
243
+ wp_enqueue_script( "{$this->namespace}-admin" );
244
+ wp_enqueue_script( "{$this->namespace}-ajaxfileupload" );
245
+ }
246
+
247
+ /**
248
+ * Load Stylesheet for the admin options page
249
+ *
250
+ * @uses wp_enqueue_style()
251
+ */
252
+ function admin_print_styles() {
253
+ wp_enqueue_style( "{$this->namespace}-admin" );
254
+ }
255
+
256
+ /**
257
+ * Hook into register_deactivation_hook action
258
+ *
259
+ * Put code here that needs to happen when your plugin is deactivated
260
+ */
261
+ static function deactivate() {
262
+ // Do deactivation actions
263
+ }
264
+
265
+ /**
266
+ * Retrieve the stored plugin option or the default if no user specified value is defined
267
+ *
268
+ * @param string $option_name The name of the TrialAccount option you wish to retrieve
269
+ *
270
+ * @uses get_option()
271
+ *
272
+ * @return mixed Returns the option value or false(boolean) if the option is not found
273
+ */
274
+ function get_option( $option_name ) {
275
+ // Load option values if they haven't been loaded already
276
+ if( !isset( $this->options ) || empty( $this->options ) ) {
277
+ $this->options = get_option( $this->option_name, $this->defaults );
278
+ }
279
+
280
+ if( isset( $this->options[$option_name] ) ) {
281
+ return $this->options[$option_name]; // Return user's specified option value
282
+ } elseif( isset( $this->defaults[$option_name] ) ) {
283
+ return $this->defaults[$option_name]; // Return default option value
284
+ }
285
+ return false;
286
+ }
287
+
288
+ /**
289
+ * Initialization function to hook into the WordPress init action
290
+ *
291
+ * Instantiates the class on a global variable and sets the class, actions
292
+ * etc. up for use.
293
+ */
294
+ static function instance() {
295
+ global $WPBackitupLite;
296
+
297
+ // Only instantiate the Class if it hasn't been already
298
+ if( !isset( $WPBackitupLite ) ) $WPBackitupLite = new WPBackitupLite();
299
+ }
300
+
301
+ /**
302
+ * Hook into plugin_action_links filter
303
+ *
304
+ * Adds a "Settings" link next to the "Deactivate" link in the plugin listing page
305
+ * when the plugin is active.
306
+ *
307
+ * @param object $links An array of the links to show, this will be the modified variable
308
+ * @param string $file The name of the file being processed in the filter
309
+ */
310
+ function plugin_action_links( $links, $file ) {
311
+ if( $file == plugin_basename( WPBACKITUP_DIRNAME . '/' . basename( __FILE__ ) ) ) {
312
+ $old_links = $links;
313
+ $new_links = array(
314
+ "settings" => '<a href="admin.php?page=' . $this->namespace . '">' . __( 'Settings' ) . '</a>'
315
+ );
316
+ $links = array_merge( $new_links, $old_links );
317
+ }
318
+
319
+ return $links;
320
+ }
321
+
322
+ /**
323
+ * Route the user based off of environment conditions
324
+ *
325
+ * This function will handling routing of form submissions to the appropriate
326
+ * form processor.
327
+ *
328
+ * @uses WPBackitupLite::_admin_options_update()
329
+ */
330
+ function route() {
331
+ $uri = $_SERVER['REQUEST_URI'];
332
+ $protocol = isset( $_SERVER['HTTPS'] ) ? 'https' : 'http';
333
+ $hostname = $_SERVER['HTTP_HOST'];
334
+ $url = "{$protocol}://{$hostname}{$uri}";
335
+ $is_post = (bool) ( strtoupper( $_SERVER['REQUEST_METHOD'] ) == "POST" );
336
+
337
+ // Check if a nonce was passed in the request
338
+ if( isset( $_REQUEST['_wpnonce'] ) ) {
339
+ $nonce = $_REQUEST['_wpnonce'];
340
+
341
+ // Handle POST requests
342
+ if( $is_post ) {
343
+ if( wp_verify_nonce( $nonce, "{$this->namespace}-update-options" ) ) {
344
+ $this->_admin_options_update();
345
+ }
346
+ }
347
+ // Handle GET requests
348
+ else {
349
+
350
+ }
351
+ }
352
+ }
353
+
354
+ /**
355
+ * Register scripts used by this plugin for enqueuing elsewhere
356
+ *
357
+ * @uses wp_register_script()
358
+ */
359
+ function wp_register_scripts() {
360
+ // Admin JavaScript
361
+ wp_register_script( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/js/admin.js", array( 'jquery' ), $this->version, true );
362
+ wp_register_script( "{$this->namespace}-ajaxfileupload", WPBACKITUP_URLPATH . "/js/ajaxfileupload.js", array( 'jquery' ), $this->version, true );
363
+ }
364
+
365
+ /**
366
+ * Register styles used by this plugin for enqueuing elsewhere
367
+ *
368
+ * @uses wp_register_style()
369
+ */
370
+ function wp_register_styles() {
371
+ // Admin Stylesheet
372
+ wp_register_style( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/css/admin.css", array(), $this->version, 'screen' );
373
+ }
374
+ }
375
+ if( !isset( $WPBackitupLite ) ) {
376
+ WPBackitupLite::instance();
377
+ }
378
+
379
+ register_activation_hook( __FILE__, array( 'WPBackitupLite', 'activate' ) );
380
+ register_deactivation_hook( __FILE__, array( 'WPBackitupLite', 'deactivate' ) );
tags/1.2.2/js/admin.js ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.2.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ (function($){
9
+ //define backup variables
10
+ var backup = {
11
+ action: 'backup',
12
+ beforeSend: function() {
13
+ $('.backup-icon').css('visibility','visible');
14
+ var htmlText = "<div class='prerequisites'>Checking prerequisites: <span class='currentStatus'>Pending</span></div><div class='backupfiles'>Backing-up /wp-content/: <span class='currentStatus'>Pending</span></div><div class='backupdb'>Backing-up database: <span class='currentStatus'>Pending</span></div><div class='infofile'>Creating backup directory: <span class='currentStatus'>Pending</span></div><div class='zipfile'>Zipping backup directory: <span class='currentStatus'>Pending</span></div><div class='cleanup'>Cleaning up: <span class='currentStatus'>Pending</span></div><div class='errorMessage'><span class='currentStatus'></span></div>";
15
+ $("#status").html(htmlText);
16
+ window.intervalDefine = setInterval(display_log, 1000);
17
+ }
18
+ };
19
+ //define download variables
20
+ var download = {
21
+ action: 'download'
22
+ };
23
+ //define logreader variables
24
+ var logreader = {
25
+ action: 'logreader'
26
+ };
27
+ //define logreader function
28
+ function display_log() {
29
+ $.post(ajaxurl, logreader, function(response) {
30
+ var xmlObj = $(response);
31
+ xmlObj.each(function(){
32
+ var attributename = "." + $(this).attr('code');
33
+ $(attributename).find(".currentStatus").html($(this).text());
34
+ if($(this).attr('code') == "finalinfo" || $(this).attr('code') == "errorMessage")
35
+ {
36
+ clearInterval(window.intervalDefine);
37
+ }
38
+ });
39
+ });
40
+ }
41
+ //define download function
42
+ function download_link() {
43
+ $.post(ajaxurl, download, function(response) {
44
+ $("#download-link").html(response);
45
+ });
46
+ }
47
+
48
+ //execute download (on page load/refresh)
49
+ download_link();
50
+
51
+ //execute backup on button click
52
+ $(".backup-button").click( function() {
53
+ $.post(ajaxurl, backup, function(response) {
54
+ download_link();
55
+ clearInterval(display_log);
56
+ $('.backup-icon').fadeOut(1000);
57
+ $("#php").html(response); //Return PHP messages, used for development
58
+ });
59
+ return false;
60
+ })
61
+
62
+ //execute restore on button click
63
+ $("#restore-form").submit(function() {
64
+ var maximum = $("#maximum").val();
65
+ var fil = document.getElementById("wpbackitup-zip");
66
+ var sizes = fil.files[0].size;
67
+ var sizesd = sizes/(1024*1024);
68
+ if(sizesd > maximum) {
69
+ $("#status").html("<span style='color: red'>File size exceeds maxium upload size.</span>");
70
+ return false;
71
+ }
72
+ var htmlvals = '<div class="upload">Uploading: <span class="currentStatus">Pending</span></div><div class="unzipping">Unzipping: <span class="currentStatus">Pending</span></div><div class="validation">Validating restoration file: <span class="currentStatus">Pending</span></div><div class="wpcontent">Restoring /wp-content/ directory: <span class="currentStatus">Pending</span></div><div class="database">Restoring database: <span class="currentStatus">Pending</span></div><div class="infomessage"><span class="currentStatus"></span></div><div class="errorMessage"><span class="currentStatus"></span></div>';
73
+
74
+ $("#status").html(htmlvals);
75
+ $(".upload").find('.currentStatus').html('In Progress');
76
+ $('.restore-icon').css('visibility','visible');
77
+ window.intervalDefine = setInterval(display_log, 1000);
78
+ $("#restore-form").attr("target","upload_target");
79
+ $("#upload_target").load(function (){
80
+ importRestore();
81
+ });
82
+ return false;
83
+ });
84
+
85
+ //define importRestore function
86
+ function importRestore() {
87
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; //process upload
88
+ $("#php").html(ret); //Return PHP messages, used for development
89
+ clearInterval(display_log);
90
+ $('.restore-icon').fadeOut(1000);
91
+ }
92
+ })(jQuery);
tags/1.2.2/js/ajaxfileupload.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Ajax File Upload
3
+ *
4
+ * @version 1.2.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ jQuery.extend({
9
+ createUploadIframe: function(id, uri)
10
+ {
11
+ //create frame
12
+ var frameId = 'jUploadFrame' + id;
13
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
14
+ if(window.ActiveXObject)
15
+ {
16
+ if(typeof uri== 'boolean'){
17
+ iframeHtml += ' src="' + 'javascript:false' + '"';
18
+
19
+ }
20
+ else if(typeof uri== 'string'){
21
+ iframeHtml += ' src="' + uri + '"';
22
+
23
+ }
24
+ }
25
+ iframeHtml += ' />';
26
+ jQuery(iframeHtml).appendTo(document.body);
27
+
28
+ return jQuery('#' + frameId).get(0);
29
+ },
30
+ createUploadForm: function(id, fileElementId, data)
31
+ {
32
+ //create form
33
+ var formId = 'jUploadForm' + id;
34
+ var fileId = 'jUploadFile' + id;
35
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
36
+ if(data)
37
+ {
38
+ for(var i in data)
39
+ {
40
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
41
+ }
42
+ }
43
+ var oldElement = jQuery('#' + fileElementId);
44
+ var newElement = jQuery(oldElement).clone();
45
+ jQuery(oldElement).attr('id', fileId);
46
+ jQuery(oldElement).before(newElement);
47
+ jQuery(oldElement).appendTo(form);
48
+
49
+
50
+
51
+ //set attributes
52
+ jQuery(form).css('position', 'absolute');
53
+ jQuery(form).css('top', '-1200px');
54
+ jQuery(form).css('left', '-1200px');
55
+ jQuery(form).appendTo('body');
56
+ return form;
57
+ },
58
+
59
+ ajaxFileUpload: function(s) {
60
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
61
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
62
+ var id = new Date().getTime()
63
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
64
+ var io = jQuery.createUploadIframe(id, s.secureuri);
65
+ var frameId = 'jUploadFrame' + id;
66
+ var formId = 'jUploadForm' + id;
67
+ // Watch for a new set of requests
68
+ if ( s.global && ! jQuery.active++ )
69
+ {
70
+ jQuery.event.trigger( "ajaxStart" );
71
+ }
72
+ var requestDone = false;
73
+ // Create the request object
74
+ var xml = {}
75
+ if ( s.global )
76
+ jQuery.event.trigger("ajaxSend", [xml, s]);
77
+ // Wait for a response to come back
78
+ var uploadCallback = function(isTimeout)
79
+ {
80
+ var io = document.getElementById(frameId);
81
+ try
82
+ {
83
+ if(io.contentWindow)
84
+ {
85
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
86
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
87
+
88
+ }else if(io.contentDocument)
89
+ {
90
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
91
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
92
+ }
93
+ }catch(e)
94
+ {
95
+ jQuery.handleError(s, xml, null, e);
96
+ }
97
+ if ( xml || isTimeout == "timeout")
98
+ {
99
+ requestDone = true;
100
+ var status;
101
+ try {
102
+ status = isTimeout != "timeout" ? "success" : "error";
103
+ // Make sure that the request was successful or notmodified
104
+ if ( status != "error" )
105
+ {
106
+ // process the data (runs the xml through httpData regardless of callback)
107
+ var data = jQuery.uploadHttpData( xml, s.dataType );
108
+ // If a local callback was specified, fire it and pass it the data
109
+ if ( s.success )
110
+ s.success( data, status );
111
+
112
+ // Fire the global callback
113
+ if( s.global )
114
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
115
+ } else
116
+ jQuery.handleError(s, xml, status);
117
+ } catch(e)
118
+ {
119
+ status = "error";
120
+ jQuery.handleError(s, xml, status, e);
121
+ }
122
+
123
+ // The request was completed
124
+ if( s.global )
125
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
126
+
127
+ // Handle the global AJAX counter
128
+ if ( s.global && ! --jQuery.active )
129
+ jQuery.event.trigger( "ajaxStop" );
130
+
131
+ // Process result
132
+ if ( s.complete )
133
+ s.complete(xml, status);
134
+
135
+ jQuery(io).unbind()
136
+
137
+ setTimeout(function()
138
+ { try
139
+ {
140
+ jQuery(io).remove();
141
+ jQuery(form).remove();
142
+
143
+ } catch(e)
144
+ {
145
+ jQuery.handleError(s, xml, null, e);
146
+ }
147
+
148
+ }, 100)
149
+
150
+ xml = null
151
+
152
+ }
153
+ }
154
+ // Timeout checker
155
+ if ( s.timeout > 0 )
156
+ {
157
+ setTimeout(function(){
158
+ // Check to see if the request is still happening
159
+ if( !requestDone ) uploadCallback( "timeout" );
160
+ }, s.timeout);
161
+ }
162
+ try
163
+ {
164
+
165
+ var form = jQuery('#' + formId);
166
+ jQuery(form).attr('action', s.url);
167
+ jQuery(form).attr('method', 'POST');
168
+ jQuery(form).attr('target', frameId);
169
+ if(form.encoding)
170
+ {
171
+ jQuery(form).attr('encoding', 'multipart/form-data');
172
+ }
173
+ else
174
+ {
175
+ jQuery(form).attr('enctype', 'multipart/form-data');
176
+ }
177
+ jQuery(form).submit();
178
+
179
+ } catch(e)
180
+ {
181
+ jQuery.handleError(s, xml, null, e);
182
+ }
183
+
184
+ jQuery('#' + frameId).load(uploadCallback );
185
+ return {abort: function () {}};
186
+
187
+ },
188
+
189
+ uploadHttpData: function( r, type ) {
190
+ var data = !type;
191
+ data = type == "xml" || data ? r.responseXML : r.responseText;
192
+ // If the type is "script", eval it in global context
193
+ if ( type == "script" )
194
+ jQuery.globalEval( data );
195
+ // Get the JavaScript object, if JSON is used.
196
+ if ( type == "json" )
197
+ eval( "data = " + data );
198
+ // evaluate scripts within html
199
+ if ( type == "html" )
200
+ jQuery("<div>").html(data).evalScripts();
201
+
202
+ return data;
203
+ }
204
+ })
205
+
tags/1.2.2/languages/wp-backitup-pro.mo ADDED
Binary file
tags/1.2.2/languages/wp-backitup-pro.po ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup Pro\n"
4
+ "POT-Creation-Date: 2013-02-17 11:26-0000\n"
5
+ "PO-Revision-Date: 2013-02-17 11:26-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: WP Backitup <support@wpbackitup.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: index.php:328
19
+ msgid "Settings"
20
+ msgstr ""
21
+
22
+ #: lib/functions.php:46
23
+ msgid "Download most recent export file"
24
+ msgstr ""
25
+
26
+ #: lib/functions.php:50
27
+ msgid "No export file available for download. Please create one."
28
+ msgstr ""
29
+
30
+ #: lib/includes/backup.php:25 lib/includes/restore.php:24
31
+ msgid "Can't open file"
32
+ msgstr ""
33
+
34
+ #: lib/includes/backup.php:29
35
+ msgid "Creating backup directory..."
36
+ msgstr ""
37
+
38
+ #: lib/includes/backup.php:31
39
+ msgid ""
40
+ "Cannot create backup directory. Please check the CHMOD settings of your wp-"
41
+ "backitup plugin directory"
42
+ msgstr ""
43
+
44
+ #: lib/includes/backup.php:37 lib/includes/restore.php:142
45
+ msgid "Done"
46
+ msgstr ""
47
+
48
+ #: lib/includes/backup.php:45
49
+ msgid "Backing up your files..."
50
+ msgstr ""
51
+
52
+ #: lib/includes/backup.php:50
53
+ msgid "Unable to backup your files. Please try again."
54
+ msgstr ""
55
+
56
+ #: lib/includes/backup.php:55
57
+ msgid "Backing up your database..."
58
+ msgstr ""
59
+
60
+ #: lib/includes/backup.php:57 lib/includes/backup.php:77
61
+ #: lib/includes/restore.php:156 lib/includes/restore.php:174
62
+ #: lib/includes/restore.php:200 lib/includes/restore.php:336
63
+ msgid "Done!"
64
+ msgstr ""
65
+
66
+ #: lib/includes/backup.php:59
67
+ msgid "Unable to backup your database. Please try again."
68
+ msgstr ""
69
+
70
+ #: lib/includes/backup.php:67
71
+ msgid "Unable to create site information file. Please try again."
72
+ msgstr ""
73
+
74
+ #: lib/includes/backup.php:73
75
+ msgid "Creating backup zip..."
76
+ msgstr ""
77
+
78
+ #: lib/includes/backup.php:81
79
+ msgid "Warning: Unable to cleanup your backup directory."
80
+ msgstr ""
81
+
82
+ #: lib/includes/backup.php:85
83
+ msgid ""
84
+ "Backup file created successfully. You can download your backup file using "
85
+ "the link above."
86
+ msgstr ""
87
+
88
+ #: lib/includes/restore.php:133
89
+ msgid "No file selected"
90
+ msgstr ""
91
+
92
+ #: lib/includes/restore.php:138
93
+ msgid "Uploading restoration file..."
94
+ msgstr ""
95
+
96
+ #: lib/includes/restore.php:144
97
+ msgid "Your file could not be uploaded"
98
+ msgstr ""
99
+
100
+ #: lib/includes/restore.php:158
101
+ msgid "Your restoration file could not be unzipped."
102
+ msgstr ""
103
+
104
+ #: lib/includes/restore.php:165
105
+ msgid "Validating zip..."
106
+ msgstr ""
107
+
108
+ #: lib/includes/restore.php:176
109
+ msgid ""
110
+ "Your zip file appears to be invalid. Please ensure you chose the correct zip "
111
+ "file."
112
+ msgstr ""
113
+
114
+ #: lib/includes/restore.php:184
115
+ msgid "Restoring wp-content directory..."
116
+ msgstr ""
117
+
118
+ #: lib/includes/restore.php:186
119
+ msgid ""
120
+ "Unable to remove existing wp-content directory for import. Please check your "
121
+ "CHMOD settings in /wp-content/."
122
+ msgstr ""
123
+
124
+ #: lib/includes/restore.php:193
125
+ msgid ""
126
+ "Unable to create new wp-content directory for import. Please check your "
127
+ "CHMOD settings in /wp-content/."
128
+ msgstr ""
129
+
130
+ #: lib/includes/restore.php:202
131
+ msgid "Unable to import wp-content. Please try again."
132
+ msgstr ""
133
+
134
+ #: lib/includes/restore.php:212
135
+ msgid "Restoring database..."
136
+ msgstr ""
137
+
138
+ #: lib/includes/restore.php:222
139
+ msgid "Unable to connect to your current database"
140
+ msgstr ""
141
+
142
+ #: lib/includes/restore.php:236
143
+ msgid "Unable to get current site URL from database. Please try again."
144
+ msgstr ""
145
+
146
+ #: lib/includes/restore.php:250
147
+ msgid "Unable to get current home URL from database. Please try again."
148
+ msgstr ""
149
+
150
+ #: lib/includes/restore.php:264
151
+ msgid "Unable to get current user ID from database. Please try again."
152
+ msgstr ""
153
+
154
+ #: lib/includes/restore.php:278
155
+ msgid "Unable to get current user password from database. Please try again."
156
+ msgstr ""
157
+
158
+ #: lib/includes/restore.php:292
159
+ msgid "Unable to get current user email from database. Please try again."
160
+ msgstr ""
161
+
162
+ #: lib/includes/restore.php:305
163
+ msgid ""
164
+ "Unable to get import your database. This may require importing the file "
165
+ "manually."
166
+ msgstr ""
167
+
168
+ #: lib/includes/restore.php:323
169
+ msgid ""
170
+ "Unable to update your current home URL value. This may require importing the "
171
+ "file manually."
172
+ msgstr ""
173
+
174
+ #: lib/includes/restore.php:330
175
+ msgid ""
176
+ "Unable to update your user information. This may require importing the file "
177
+ "manually."
178
+ msgstr ""
179
+
180
+ #: lib/includes/restore.php:338
181
+ msgid "Warning: Database not detected in import file."
182
+ msgstr ""
183
+
184
+ #: lib/includes/restore.php:351
185
+ msgid "Restoration complete. Please refresh the page."
186
+ msgstr ""
187
+
188
+ #: views/options.php:6 views/options.php:8
189
+ msgid "Backup"
190
+ msgstr ""
191
+
192
+ #: views/options.php:7
193
+ msgid "Create a backup file of this site's content and settings."
194
+ msgstr ""
195
+
196
+ #: views/options.php:9
197
+ msgid "Download"
198
+ msgstr ""
199
+
200
+ #: views/options.php:11 views/options.php:23
201
+ msgid "Restore"
202
+ msgstr ""
203
+
204
+ #: views/options.php:14
205
+ msgid ""
206
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
207
+ "plugins, uploads and settings."
208
+ msgstr ""
209
+
210
+ #: views/options.php:25
211
+ msgid "Status"
212
+ msgstr ""
213
+
214
+ #: views/options.php:26
215
+ msgid "Nothing to report"
216
+ msgstr ""
217
+
218
+ #: views/options.php:35 views/options.php:56
219
+ msgid "License Key"
220
+ msgstr ""
221
+
222
+ #: views/options.php:39
223
+ msgid "Automatic updates enabled"
224
+ msgstr ""
225
+
226
+ #: views/options.php:41
227
+ msgid "Activate automatic updates by entering your license key"
228
+ msgstr ""
229
+
230
+ #: views/options.php:46
231
+ msgid "Active"
232
+ msgstr ""
233
+
234
+ #: views/options.php:47
235
+ msgid "Update"
236
+ msgstr ""
237
+
238
+ #: views/options.php:49
239
+ msgid "Inactive"
240
+ msgstr ""
241
+
242
+ #: views/options.php:50
243
+ msgid "Activate"
244
+ msgstr ""
245
+
246
+ #: views/options.php:55
247
+ msgid "Need Support?"
248
+ msgstr ""
249
+
250
+ #: views/options.php:60
251
+ msgid "Spread the Word"
252
+ msgstr ""
253
+
254
+ #: views/options.php:65
255
+ msgid "Enable"
256
+ msgstr ""
257
+
258
+ #: views/options.php:66
259
+ msgid "Disable"
260
+ msgstr ""
261
+
262
+ #: views/options.php:67
263
+ msgid ""
264
+ "Help to improve Easy Webtrends by enabling <a href=\"http://www.presstrends."
265
+ "io\" target=\"_blank\">Presstrends</a>"
266
+ msgstr ""
267
+
268
+ #: views/options.php:68
269
+ msgid "Save"
270
+ msgstr ""
tags/1.2.2/lib/constants.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WP Backitup lite
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.2.2
9
+ * @since 1.0.1
10
+ */
11
+
12
+ if( !defined( 'WPBACKITUP_ITEM_NAME' ) ) define( 'WPBACKITUP_ITEM_NAME', 'WP Backitup Lite' );
13
+
14
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.2.2' );
15
+
16
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
19
+
20
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
21
+
22
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
23
+
24
+ if( !defined( 'WPBACKITUP_SITE_URL' ) ) define( 'WPBACKITUP_SITE_URL', 'http://www.wpbackitup.com' );
tags/1.2.2/lib/functions.php ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup Pro
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.2.2
9
+ * @since 1.0.1
10
+ */
11
+
12
+ // localize the plugin
13
+ function lang_setup() {
14
+ global $WPBackitupLite;
15
+ load_plugin_textdomain($WPBackitupLite->namespace, false, dirname(plugin_basename(__FILE__)) . '/lang/');
16
+ }
17
+ add_action('after_setup_theme', 'lang_setup');
18
+
19
+ // include recurseZip class
20
+ if( !class_exists( 'recurseZip' ) ) {
21
+ include_once 'includes/recurse_zip.php';
22
+ }
23
+
24
+ //load backup function
25
+ function backup() {
26
+ include_once 'includes/backup.php';
27
+ }
28
+ add_action('wp_ajax_backup', 'backup');
29
+
30
+ //load download function
31
+ function download() {
32
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
33
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
34
+ $filename = basename($file);
35
+ echo 'Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a>';
36
+ }
37
+ } else {
38
+ echo 'No export file available for download. Please create one.';
39
+ }
40
+ die();
41
+ }
42
+ add_action('wp_ajax_download', 'download');
43
+
44
+ //load logreader function
45
+ function logreader() {
46
+ $log = WPBACKITUP_DIRNAME .'/logs/status.log';
47
+ if(file_exists($log) ) {
48
+ readfile($log);
49
+ }
50
+ die();
51
+ }
52
+ add_action('wp_ajax_logreader', 'logreader');
53
+
54
+ //define create_dir function
55
+ if(!function_exists('create_dir')) {
56
+ function create_dir($dir) {
57
+ if( !is_dir($dir) ) {
58
+ @mkdir($dir, 0755);
59
+ }
60
+ return true;
61
+ }
62
+ }
63
+
64
+ //Define recusive_copy function
65
+ if(!function_exists('recursive_copy')) {
66
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
67
+ if( is_dir($dir) ) { //If the directory exists
68
+ if ($dh = opendir($dir) ) {
69
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
70
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
71
+ if (!is_dir( $dir.$file ) ) {
72
+ //Copy files to destination directory
73
+ $fsrc = fopen($dir .$file,'r');
74
+ $fdest = fopen($target_path .$file,'w+');
75
+ $len = stream_copy_to_stream($fsrc,$fdest);
76
+ fclose($fsrc);
77
+ fclose($fdest);
78
+ } else { //If $file is a directory
79
+ $destdir = $target_path .$file; //Modify the destination dir
80
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
81
+ @mkdir($destdir, 0755);
82
+ }
83
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
84
+ }
85
+ }
86
+ }
87
+ closedir($dh);
88
+ }
89
+ }
90
+ return true;
91
+ }
92
+ }
93
+
94
+ //Define DB backup function
95
+ if(!function_exists('db_backup')) {
96
+ function db_backup($path) {
97
+
98
+ $handle = fopen($path .'db-backup.sql', 'w+');
99
+
100
+
101
+ $path_sql = $path .'/db-backup.sql';
102
+ $db_name = DB_NAME;
103
+ $db_user = DB_USER;
104
+ $db_pass = DB_PASSWORD;
105
+ $db_host = DB_HOST;
106
+
107
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name");
108
+ fwrite($handle,$output);
109
+ fclose($handle);
110
+ return true;
111
+ }
112
+ }
113
+
114
+ //Define the create_siteinfo function
115
+ if(!function_exists('create_siteinfo')) {
116
+ function create_siteinfo($path, $table_prefix) {
117
+ $siteinfo = $path ."backupsiteinfo.txt";
118
+ $handle = fopen($siteinfo, 'w+');
119
+ $entry = site_url( '/' ) ."\n$table_prefix";
120
+ fwrite($handle, $entry);
121
+ fclose($handle);
122
+ return true;
123
+ }
124
+ }
125
+
126
+ //Define recursive_delete function
127
+ if(!function_exists('recursive_delete')){
128
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
129
+ if( is_dir($dir) ){
130
+ if($dh = opendir($dir)) {
131
+ while( ($file = readdir($dh)) !== false ) {
132
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
133
+ if(!is_dir($dir .'/'. $file)) {
134
+ unlink($dir .'/'. $file);
135
+ } else {
136
+ recursive_delete($dir.'/'. $file, $ignore);
137
+ }
138
+ }
139
+ }
140
+ }
141
+ @rmdir($dir);
142
+ closedir($dh);
143
+ }
144
+ return true;
145
+ }
146
+ }
147
+
148
+ //Define zip function
149
+ function zip($source, $destination, $ignore) {
150
+ if (is_string($source)) $source_arr = array($source); // convert it to array
151
+ if (!extension_loaded('zip')) {
152
+ return false;
153
+ }
154
+ $zip = new ZipArchive();
155
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
156
+ return false;
157
+ }
158
+ foreach ($source_arr as $source) {
159
+ if (!file_exists($source)) continue;
160
+ $source = str_replace('\\', '/', realpath($source));
161
+ if (is_dir($source) === true) {
162
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
163
+ foreach ($files as $file) {
164
+ if (!preg_match($ignore, $file)) {
165
+ $file = str_replace('\\', '/', realpath($file));
166
+ if (is_dir($file) === true) {
167
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
168
+ } else if (is_file($file) === true) {
169
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
170
+ }
171
+ }
172
+ }
173
+ } else if (is_file($source) === true) {
174
+ $zip->addFromString(basename($source), file_get_contents($source));
175
+ }
176
+ }
177
+ return $zip->close();
178
+ }
179
+
180
+ //load presstrends
181
+ function load_presstrends() {
182
+ global $WPBackitupLite;
183
+ if($WPBackitupLite->get_option( 'presstrends' ) == 'enabled') {
184
+ // PressTrends Account API Key
185
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
186
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
187
+
188
+ // Start of Metrics
189
+ global $wpdb;
190
+ $data = get_transient( 'presstrends_cache_data' );
191
+ if ( !$data || $data == '' ) {
192
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
193
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
194
+
195
+ $count_posts = wp_count_posts();
196
+ $count_pages = wp_count_posts( 'page' );
197
+ $comments_count = wp_count_comments();
198
+
199
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
200
+ if ( function_exists( 'wp_get_theme' ) ) {
201
+ $theme_data = wp_get_theme();
202
+ $theme_name = urlencode( $theme_data->Name );
203
+ } else {
204
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
205
+ $theme_name = $theme_data['Name'];
206
+ }
207
+
208
+ $plugin_name = '&';
209
+ foreach ( get_plugins() as $plugin_info ) {
210
+ $plugin_name .= $plugin_info['Name'] . '&';
211
+ }
212
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
213
+ $plugin_data = get_plugin_data( __FILE__ );
214
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
215
+ $data = array(
216
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
217
+ 'posts' => $count_posts->publish,
218
+ 'pages' => $count_pages->publish,
219
+ 'comments' => $comments_count->total_comments,
220
+ 'approved' => $comments_count->approved,
221
+ 'spam' => $comments_count->spam,
222
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
223
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
224
+ 'theme_version' => $plugin_data['Version'],
225
+ 'theme_name' => $theme_name,
226
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
227
+ 'plugins' => count( get_option( 'active_plugins' ) ),
228
+ 'plugin' => urlencode( $plugin_name ),
229
+ 'wpversion' => get_bloginfo( 'version' ),
230
+ );
231
+
232
+ foreach ( $data as $k => $v ) {
233
+ $url .= $k . '/' . $v . '/';
234
+ }
235
+ wp_remote_get( $url );
236
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
237
+ }
238
+ }
239
+ }
240
+ // PressTrends WordPress Action
241
+ add_action('admin_init', 'load_presstrends');
tags/1.2.2/lib/includes/backup.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Backup Functions
5
+ *
6
+ * @package WP Backitup Lite
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.2.2
10
+ * @since 1.0.1
11
+ */
12
+
13
+ global $WPBackitupLite;
14
+
15
+ //limit process to 15 minutes
16
+ @set_time_limit(900);
17
+
18
+ //Define variables
19
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
20
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
21
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
22
+
23
+ //create log file
24
+
25
+ $log = WPBACKITUP_DIRNAME ."/logs/status.log";
26
+ unlink($log);
27
+ $fh = fopen($log, 'w') or die("Can't open log file");
28
+
29
+ //Delete the existing backup directory
30
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
31
+
32
+ //Re-create and empty backup dir
33
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
34
+ fwrite($fh, '<status code="prerequsites">'.__('Failed', $WPBackitupLite->namespace ).'</status>');
35
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to create new directory for backup. Please check your CHMOD settings in ' , $WPBackitupLite->namespace ).WPBACKITUP_DIR_PATH . '.</error>');
36
+
37
+ fclose($fh);
38
+
39
+ die();
40
+ }
41
+
42
+ //Check to see if the directory is writeable
43
+
44
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
45
+ fwrite($fh, '<status code="prerequsites">' . __('Failed', $WPBackitupLite->namespace ) . '</status>');
46
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.', $WPBackitupLite->namespace ) . '</error>');
47
+
48
+ die();
49
+ } else {
50
+ //If the directory is writeable, create the backup folder if it doesn't exist
51
+ if( !is_dir($backup_project_path) ) {
52
+ @mkdir($backup_project_path, 0755);
53
+ }
54
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
55
+ unlink($zip);
56
+ }
57
+ fwrite($fh, '<status code="prerequisites">' . __('Done', $WPBackitupLite->namespace ) . '</status>');
58
+ }
59
+
60
+ //Backup with copy
61
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
62
+ fwrite($fh, '<status code="backupfiles">' . __('Done',$WPBackitupLite->namespace ) . '</status>');
63
+ } else {
64
+ fwrite($fh, '<status code="backupfiles">' . __('Failed', $WPBackitupLite->namespace ) . '</status>');
65
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to backup your files. Please try again.', $WPBackitupLite->namespace ) . "</error>");
66
+ die();
67
+ }
68
+
69
+ //Dump DB to project dir
70
+
71
+
72
+ if( db_backup($backup_project_path) ) {
73
+ fwrite($fh, '<status code="backupdb">' . __('Done', $WPBackitupLite->namespace ) . '</status>');
74
+ } else {
75
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to backup your database. Please try again.', $WPBackitupLite->namespace ) . '</error>');
76
+ recursive_delete($backup_project_path);
77
+ die();
78
+ }
79
+
80
+ //Create siteinfo in project dir
81
+ global $wpdb;
82
+
83
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
84
+ fwrite($fh, '<status code="infofile">' . __('Failed' , $WPBackitupLite->namespace ) . '</status>');
85
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to create site information file. Please try again.', $WPBackitupLite->namespace ) . '</error>');
86
+ recursive_delete($backup_project_path);
87
+
88
+ die();
89
+ }
90
+ else
91
+ {
92
+ fwrite($fh, '<status code="infofile">' . __('Done', $WPBackitupLite->namespace ) . '</status>');
93
+ }
94
+
95
+ //Zip the project dir
96
+
97
+ $z = new recurseZip();
98
+ $src = rtrim($backup_project_path, '/');
99
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
100
+ fwrite($fh, '<status code="zipfile">' . __('Done', $WPBackitupLite->namespace ) . '</status>');
101
+
102
+ //Delete backup dir
103
+ if(!recursive_delete($backup_project_path)) {
104
+ fwrite($fh, '<status code="cleanup">' . __('Failed', $WPBackitupLite->namespace ). '</status>');
105
+ fwrite($fh, '<error code="errorMessage">' . __('Warning: Unable to cleanup your backup directory.', $WPBackitupLite->namespace ) . "</error>");
106
+
107
+ }
108
+ else
109
+ {
110
+ fwrite($fh, '<status code="cleanup">' . __('Done' , $WPBackitupLite->namespace ) . '</status>');
111
+ }
112
+
113
+ //close log file
114
+ fwrite($fh, '<status code="finalinfo">' . __('Backup file created successfully. You can download your backup file using the link above.', $WPBackitupLite->namespace ) . "</status>");
115
+ fwrite($fh, '<status code="end">' . __('End', $WPBackitupLite->namespace ) . '</status>');
116
+ fclose($fh);
117
+
118
+ //End backup function
119
+ die();
tags/1.2.2/lib/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * WP Backitup Recurse Zip Function
1
  *
2
  * @package WP Backitup Lite
3
  *
4
  * @author jcpeden
5
  * @version 1.2.2
6
  * @since 1.0.1
7
  */
1
+ <?php
2
  * WP Backitup Recurse Zip Function
3
  *
4
  * @package WP Backitup Lite
5
  *
6
  * @author jcpeden
7
  * @version 1.2.2
8
  * @since 1.0.1
9
  */
tags/1.2.2/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>.
tags/1.2.2/logs/status.log ADDED
@@ -0,0 +1 @@
 
1
+ <status code="prerequisites">Done</status><status code="backupfiles">Done</status><status code="backupdb">Done</status><status code="infofile">Done</status><status code="zipfile">Done</status><status code="cleanup">Done</status><status code="finalinfo">Backup file created successfully. You can download your backup file using the link above.</status><status code="end">End</status>
tags/1.2.2/readme.txt ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.1
7
+ Stable tag: 1.2.2
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.2.2 =
100
+ * Fixed fatal errors with plugin classname.
101
+
102
+ = 1.2.1 =
103
+ * Fixed issues with broken directory tree, brought versioning inline with WP Backitup Pro
104
+
105
+ = 1.1.7 =
106
+ * Setup backup to use mysqldump and shellexec.
107
+
108
+ = 1.1.6 =
109
+ * Forced backup process to ignore cache files.
110
+
111
+ = 1.1.5 =
112
+ * Fixed minor bugs in the code.
113
+
114
+ = 1.1.4 =
115
+ * Fixed minor bugs in tracking code and options.
116
+
117
+ = 1.1.3 =
118
+ * Re-wrote plugin in OOP, added option to disable Presstrends tracking code.
119
+
120
+ = 1.1.2 =
121
+ * Fixed issue with stylesheet not being loaded.
122
+
123
+ = 1.1.1 =
124
+ * Fixed issue with plugin not detecing addons
125
+
126
+ = 1.1.0 =
127
+ * Fixed bugs with addons system.
128
+
129
+ = 1.0.9 =
130
+ * Added Presstrends tracking code.
131
+
132
+ = 1.0.8 =
133
+ * Modified plugin administration and loaded menu tab in main toolbar.
134
+
135
+ = 1.0.7 =
136
+ * 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.
137
+
138
+ = 1.0.6 =
139
+ * Initial free version of the plugin distributed on Wordpress. This version can only backup.
140
+
141
+ = 1.0.5 =
142
+ * 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.
143
+
144
+ = 1.0.4 =
145
+ * Reduced the size of the plugin by re-using code. Added support for multiple table prefixes and media library import.
146
+
147
+ = 1.0.3 =
148
+ * Removed redundant code, allowed plugin to work with multiple table prefixes and user IDs other than 1.
149
+
150
+ = 1.0.2 =
151
+ * Fixed backup/restore function of database, plugins and themes dir. Removed PHP error notices if options are not set on admin page
152
+
153
+ = 1.0.1 =
154
+ * Increased PHP timeout to 900 seconds (5 minutes).
155
+
156
+ = 1.0 =
157
+ * Plugin released.
158
+
159
+ == Upgrade Notice ==
160
+
161
+ = 1.2.2 =
162
+ * Critical upgrade. Plugin broken for most users without this update.
163
+
164
+ = 1.2.1 =
165
+ * Critical upgrade. Plugin broken for most users without this update.
166
+
167
+ = 1.1.7 =
168
+ * Recommended upgrade. Backup process faster and more stable.
169
+
170
+ = 1.1.6 =
171
+ * Recommended upgrade. Backup process faster and more stable.
172
+
173
+ = 1.1.5 =
174
+ * Non-critical upgrade. Fixed minor bugs in code.
175
+
176
+ = 1.1.4 =
177
+ * Non-critical upgrade. Fixed bugs in code.
178
+
179
+ = 1.1.3 =
180
+ * Non-critical upgrade. Re-wrote plugin in object-oriented PHP.
181
+
182
+ = 1.1.2 =
183
+ * Critical upgrade. Fixed issue with stylesheet.
184
+
185
+ = 1.1.1 =
186
+ * Critical upgrade. Fixed further bugs with addons system.
187
+
188
+ = 1.1.0 =
189
+ * Non-critical upgrade. Fixed bugs with addons system that caused problems for some users.
190
+
191
+ = 1.0.9 =
192
+ * Non-essential upgrade. Added Presstrends code.
193
+
194
+ = 1.0.8 =
195
+ * Recommended upgrade. Added links to admin menu.
196
+
197
+ = 1.0.7 =
198
+ * Critical upgrade. Totally overhauled the plugin's construction, stability and features.
199
+
200
+ = 1.0.6 =
201
+ * Non-critical upgrade.
202
+
203
+ = 1.0.5 =
204
+ * Critical upgrade: More stable, increased flexibility and power.
205
+
206
+ = 1.0.4 =
207
+ * Critical upgrade: Many people have had trouble prior to this release. Flexibility has been increased and the plugin is now more stable and lightweight.
208
+
209
+ = 1.0.3 =
210
+ * Recommended upgrade: The plugin is more flexible and offers more helpful status and error messages.
211
+
212
+ = 1.0.2 =
213
+ * Critical upgrade: Plugin does not work on most systems without this upgrade
214
+
215
+ = 1.0.1 =
216
+ * This version increases PHP timeout if possible (upgrade if you are having timeout errors).
217
+
218
+ = 1.0 =
219
+ Initial version of the plugin.
tags/1.2.2/views/options.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script type="text/javascript" src="http://code.jquery.com/jquery.js"></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><?php _e('Backup', $namespace );?></h3>
7
+ <p><?php _e('Create a backup file of this site\'s content and settings.', $namespace ) ;?></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><?php _e('Download', $namespace );?></h3>
10
+ <p id="download-link"></p>
11
+ <h3><?php _e('Status', $namespace );?></h3>
12
+ <p><div id="status"><?php _e('Nothing to report', $namespace );?></div></p>
13
+ <?php if (site_url() == 'http://localhost/wpbackitup') {
14
+ echo '<p><div id="php">PHP messages here</div></p>';
15
+ } ?>
16
+ </div>
17
+ <div id="sidebar">
18
+ <div class="widget" id="restore-widget">
19
+ <h3 class="promo">Go Pro!</h3>
20
+ <p>Upgrade to <a href="http://www.wpbackitup.com/wp-backitup-pro/">WP Backitup Pro</a> and restore your backups with a few simple clicks!</p>
21
+ <p><a class="button-primary" href="http://www.wpbackitup.com/wp-backitup-pro/">Read more</a></p>
22
+ </div>
23
+ <div class="widget">
24
+ <h3 class="promo">Need support?</h3>
25
+ <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>
26
+ </div>
27
+ <div class="widget">
28
+ <h3 class="promo">Spread the Word!</h3>
29
+ <p>Why not <a href="http://wordpress.org/extend/plugins/wp-backitup/">rate the plugin 5&#9733; on Wordpress.org</a>?</p>
30
+ </div>
31
+ <div class="widget">
32
+ <h3 class="promo">Presstrends</h3>
33
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
34
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
35
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label>Enable</label></p>
36
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label>Disable</label></p>
37
+ <p>Help to improve Easy Webtrends by enabling <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
38
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
39
+ </form>
40
+ </div>
41
+ </div>
42
+ </div>
tags/1.3.0/backups/status.log ADDED
@@ -0,0 +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>
tags/1.3.0/css/admin.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.3.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ /* Global */
9
+ .error { color: #ff0000;}
10
+
11
+ p {line-height: 1.4em;}
12
+
13
+ td {padding: 0;}
14
+
15
+ ul {padding: 1em 0 0 0;}
16
+
17
+ h3 {
18
+ margin: 0;
19
+ padding: 1em 0 0 0;
20
+ }
21
+
22
+ iframe {
23
+ height: 0;
24
+ margin: 0;
25
+ padding: 0;
26
+ position: absolute;
27
+ top: 0;
28
+ right: 0;
29
+ width: 0;
30
+ z-index: -1;
31
+ }
32
+
33
+ .submit {
34
+ padding: 0;
35
+ }
36
+
37
+ /* Content */
38
+ #content {
39
+ float: left;
40
+ width: 65%;
41
+ }
42
+
43
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
44
+
45
+ .status-icon {
46
+ display: inline;
47
+ height: 16px;
48
+ position: relative;
49
+ top: 3px;
50
+ left: 5px;
51
+ visibility: hidden;
52
+ width: 16px;
53
+ }
54
+
55
+ /* Sidebar */
56
+ #sidebar {
57
+ float: right;
58
+ width: 30%;
59
+ }
60
+
61
+ .widget {padding: 1em;}
62
+ .errorMessage{
63
+ color: red;
64
+ }
tags/1.3.0/images/icon.png ADDED
Binary file
tags/1.3.0/images/icon32.png ADDED
Binary file
tags/1.3.0/images/loader.gif ADDED
Binary file
tags/1.3.0/index.php ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @global object $wpdb
8
+ *
9
+ * @author jcpeden
10
+ * @version 1.3.0
11
+ */
12
+ /*
13
+ Plugin Name: WP Backitup
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.3.0
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
+ // Include constants file
37
+ include_once dirname( __FILE__ ) . '/lib/constants.php';
38
+
39
+ class WPBackitup {
40
+ var $namespace = "wp-backitup";
41
+ var $friendly_name = WPBACKITUP_ITEM_NAME;
42
+ var $version = WPBACKITUP_VERSION;
43
+
44
+ // Default plugin options
45
+ var $defaults = array(
46
+ 'presstrends' => "enabled",
47
+ 'license_key' => "",
48
+ 'status' => "inactive"
49
+ );
50
+
51
+ /**
52
+ * Instantiation construction
53
+ *
54
+ * @uses add_action()
55
+ * @uses WPBackitup::wp_register_scripts()
56
+ * @uses WPBackitup::wp_register_styles()
57
+ */
58
+ function __construct() {
59
+ // Name of the option_value to store plugin options in
60
+ $this->option_name = '_' . $this->namespace . '--options';
61
+
62
+ // Load all library files used by this plugin
63
+ $libs = glob( WPBACKITUP_DIRNAME . '/lib/*.php' );
64
+ foreach( $libs as $lib ) {
65
+ include_once $lib;
66
+ }
67
+
68
+ /**
69
+ * Make this plugin available for translation.
70
+ * Translations can be added to the /languages/ directory.
71
+ */
72
+ load_theme_textdomain( $this->namespace, WPBACKITUP_DIRNAME . '/languages' );
73
+
74
+ // Add all action, filter and shortcode hooks
75
+ $this->_add_hooks();
76
+ }
77
+
78
+ /**
79
+ * Add in various hooks
80
+ */
81
+ private function _add_hooks() {
82
+ // Options page for configuration
83
+ add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
84
+ // Route requests for form processing
85
+ add_action( 'init', array( &$this, 'route' ) );
86
+
87
+ // Add a settings link next to the "Deactivate" link on the plugin listing page
88
+ add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
89
+
90
+ // Register all JavaScripts for this plugin
91
+ add_action( 'init', array( &$this, 'wp_register_scripts' ), 1 );
92
+ // Register all Stylesheets for this plugin
93
+ add_action( 'init', array( &$this, 'wp_register_styles' ), 1 );
94
+ }
95
+
96
+ /**
97
+ * Process update page form submissions and validate license key
98
+ *
99
+ * @uses WPBackitup::sanitize()
100
+ * @uses wp_redirect()
101
+ * @uses wp_verify_nonce()
102
+ * @uses wp_remote_get()
103
+ * @uses add_query_arg()
104
+ * @uses is_wp_error()
105
+ * @uses wp_remote_retrieve_body()
106
+ * @uses update_option()
107
+ * @uses wp_safe_redirect()
108
+ */
109
+ private function _admin_options_update() {
110
+
111
+ // Verify submission for processing using wp_nonce
112
+ if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-update-options" ) ) {
113
+ //create data array
114
+ $data = array();
115
+
116
+ /**
117
+ * Loop through each POSTed value and sanitize it to protect against malicious code. Please
118
+ * note that rich text (or full HTML fields) should not be processed by this function and
119
+ * dealt with directly.
120
+ */
121
+ foreach( $_POST['data'] as $key => $val ) {
122
+ $data[$key] = $this->_sanitize( $val );
123
+ }
124
+
125
+ //check license status and try to activate if invalid
126
+ $license = trim ( $data['license_key'] );
127
+
128
+ // Check license
129
+ $api_params = array(
130
+ 'edd_action' => 'check_license',
131
+ 'license' => $license,
132
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME )
133
+ );
134
+
135
+ // Call the custom API
136
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
137
+
138
+ // make sure the response came back okay
139
+ if ( is_wp_error( $response ) )
140
+ return false;
141
+
142
+ // decode the license data
143
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
144
+
145
+ if( $license_data->license != 'valid' ) {
146
+ // Try to activate license (process is almost identical to check_license)
147
+ $api_params = array(
148
+ 'edd_action'=> 'activate_license',
149
+ 'license' => $license,
150
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME ) // the name of our product in EDD
151
+ );
152
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ) );
153
+ if ( is_wp_error( $response ) )
154
+ return false;
155
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
156
+ }
157
+
158
+ /* Manually define status value */
159
+ $data['status'] = $license_data->license;
160
+
161
+ // Update the options value with the data submitted
162
+ update_option( $this->option_name, $data );
163
+
164
+ // Redirect back to the options page with the message flag to show the saved message
165
+ wp_safe_redirect( $_REQUEST['_wp_http_referer'] . '&update=1' );
166
+ exit;
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Sanitize data
172
+ *
173
+ * @param mixed $str The data to be sanitized
174
+ *
175
+ * @uses wp_kses()
176
+ *
177
+ * @return mixed The sanitized version of the data
178
+ */
179
+ private function _sanitize( $str ) {
180
+ if ( !function_exists( 'wp_kses' ) ) {
181
+ include_once ABSPATH . 'wp-includes/kses.php';
182
+ }
183
+ global $allowedposttags;
184
+ global $allowedprotocols;
185
+
186
+ if ( is_string( $str ) ) {
187
+ $str = wp_kses( $str, $allowedposttags, $allowedprotocols );
188
+ } elseif( is_array( $str ) ) {
189
+ $arr = array();
190
+ foreach( (array) $str as $key => $val ) {
191
+ $arr[$key] = $this->_sanitize( $val );
192
+ }
193
+ $str = $arr;
194
+ }
195
+
196
+ return $str;
197
+ }
198
+
199
+ /**
200
+ * Hook into register_activation_hook action
201
+ */
202
+ static function activate() {
203
+ // Do activation actions
204
+ }
205
+
206
+ /**
207
+ * Define the admin menu options for this plugin
208
+ *
209
+ * @uses add_action()
210
+ * @uses add_options_page()
211
+ */
212
+ function admin_menu() {
213
+ $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);
214
+
215
+ // Add print scripts and styles action based off the option page hook
216
+ add_action( 'admin_print_scripts-' . $page_hook, array( &$this, 'admin_print_scripts' ) );
217
+ add_action( 'admin_print_styles-' . $page_hook, array( &$this, 'admin_print_styles' ) );
218
+ }
219
+
220
+
221
+ /**
222
+ * The admin section options page rendering method
223
+ *
224
+ * @uses current_user_can()
225
+ * @uses wp_die()
226
+ */
227
+ function admin_options_page() {
228
+ if( !current_user_can( 'manage_options' ) ) {
229
+ wp_die( 'You do not have sufficient permissions to access this page' );
230
+ }
231
+
232
+ $page_title = $this->friendly_name . ' Options';
233
+ $namespace = $this->namespace;
234
+
235
+ include WPBACKITUP_DIRNAME . "/views/options.php";
236
+ }
237
+
238
+ /**
239
+ * Load JavaScript for the admin options page
240
+ *
241
+ * @uses wp_enqueue_script()
242
+ */
243
+ function admin_print_scripts() {
244
+ wp_enqueue_script( "{$this->namespace}-admin" );
245
+ wp_enqueue_script( "{$this->namespace}-ajaxfileupload" );
246
+ }
247
+
248
+ /**
249
+ * Load Stylesheet for the admin options page
250
+ *
251
+ * @uses wp_enqueue_style()
252
+ */
253
+ function admin_print_styles() {
254
+ wp_enqueue_style( "{$this->namespace}-admin" );
255
+ }
256
+
257
+ /**
258
+ * Hook into register_deactivation_hook action
259
+ *
260
+ * Put code here that needs to happen when your plugin is deactivated
261
+ */
262
+ static function deactivate() {
263
+ // Do deactivation actions
264
+ }
265
+
266
+ /**
267
+ * Retrieve the stored plugin option or the default if no user specified value is defined
268
+ *
269
+ * @param string $option_name The name of the TrialAccount option you wish to retrieve
270
+ *
271
+ * @uses get_option()
272
+ *
273
+ * @return mixed Returns the option value or false(boolean) if the option is not found
274
+ */
275
+ function get_option( $option_name ) {
276
+ // Load option values if they haven't been loaded already
277
+ if( !isset( $this->options ) || empty( $this->options ) ) {
278
+ $this->options = get_option( $this->option_name, $this->defaults );
279
+ }
280
+
281
+ if( isset( $this->options[$option_name] ) ) {
282
+ return $this->options[$option_name]; // Return user's specified option value
283
+ } elseif( isset( $this->defaults[$option_name] ) ) {
284
+ return $this->defaults[$option_name]; // Return default option value
285
+ }
286
+ return false;
287
+ }
288
+
289
+ /**
290
+ * Initialization function to hook into the WordPress init action
291
+ *
292
+ * Instantiates the class on a global variable and sets the class, actions
293
+ * etc. up for use.
294
+ */
295
+ static function instance() {
296
+ global $WPBackitup;
297
+
298
+ // Only instantiate the Class if it hasn't been already
299
+ if( !isset( $WPBackitup ) ) $WPBackitup = new WPBackitup();
300
+ }
301
+
302
+ /**
303
+ * Hook into plugin_action_links filter
304
+ *
305
+ * @param object $links An array of the links to show, this will be the modified variable
306
+ * @param string $file The name of the file being processed in the filter
307
+ */
308
+ function plugin_action_links( $links, $file ) {
309
+ if( $file == plugin_basename( WPBACKITUP_DIRNAME . '/' . basename( __FILE__ ) ) ) {
310
+ $old_links = $links;
311
+ $new_links = array(
312
+ "settings" => '<a href="admin.php?page=' . $this->namespace . '">' . __( 'Settings' ) . '</a>'
313
+ );
314
+ $links = array_merge( $new_links, $old_links );
315
+ }
316
+
317
+ return $links;
318
+ }
319
+
320
+ /**
321
+ * Route the user based off of environment conditions
322
+ *
323
+ * @uses WPBackitup::_admin_options_update()
324
+ */
325
+ function route() {
326
+ $uri = $_SERVER['REQUEST_URI'];
327
+ $protocol = isset( $_SERVER['HTTPS'] ) ? 'https' : 'http';
328
+ $hostname = $_SERVER['HTTP_HOST'];
329
+ $url = "{$protocol}://{$hostname}{$uri}";
330
+ $is_post = (bool) ( strtoupper( $_SERVER['REQUEST_METHOD'] ) == "POST" );
331
+
332
+ // Check if a nonce was passed in the request
333
+ if( isset( $_REQUEST['_wpnonce'] ) ) {
334
+ $nonce = $_REQUEST['_wpnonce'];
335
+
336
+ // Handle POST requests
337
+ if( $is_post ) {
338
+ if( wp_verify_nonce( $nonce, "{$this->namespace}-update-options" ) ) {
339
+ $this->_admin_options_update();
340
+ }
341
+ }
342
+ // Handle GET requests
343
+ else {
344
+
345
+ }
346
+ }
347
+ }
348
+
349
+ /**
350
+ * Register scripts used by this plugin for enqueuing elsewhere
351
+ *
352
+ * @uses wp_register_script()
353
+ */
354
+ function wp_register_scripts() {
355
+ // Admin JavaScript
356
+ wp_register_script( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/js/admin.js", array( 'jquery' ), $this->version, true );
357
+ wp_register_script( "{$this->namespace}-ajaxfileupload", WPBACKITUP_URLPATH . "/js/ajaxfileupload.js", array( 'jquery' ), $this->version, true );
358
+ }
359
+
360
+ /**
361
+ * Register styles used by this plugin for enqueuing elsewhere
362
+ *
363
+ * @uses wp_register_style()
364
+ */
365
+ function wp_register_styles() {
366
+ // Admin Stylesheet
367
+ wp_register_style( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/css/admin.css", array(), $this->version, 'screen' );
368
+ }
369
+ }
370
+ if( !isset( $WPBackitup ) ) {
371
+ WPBackitup::instance();
372
+ }
373
+
374
+ register_activation_hook( __FILE__, array( 'WPBackitup', 'activate' ) );
375
+ register_deactivation_hook( __FILE__, array( 'WPBackitup', 'deactivate' ) );
tags/1.3.0/js/admin.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.3.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ (function($){
9
+ //define backup variables
10
+ var backup = {
11
+ action: 'backup',
12
+ beforeSend: function() {
13
+ $('.backup-icon').css('visibility','visible');
14
+ var htmlText = "<div class='prerequisites'>Checking prerequisites: <span class='currentStatus'>Pending</span></div><div class='backupfiles'>Backing-up /wp-content/: <span class='currentStatus'>Pending</span></div><div class='backupdb'>Backing-up database: <span class='currentStatus'>Pending</span></div><div class='infofile'>Creating backup directory: <span class='currentStatus'>Pending</span></div><div class='zipfile'>Zipping backup directory: <span class='currentStatus'>Pending</span></div><div class='cleanup'>Cleaning up: <span class='currentStatus'>Pending</span></div><div class='errorMessage'><span class='currentStatus'></span></div>";
15
+ $("#status").html(htmlText);
16
+ window.intervalDefine = setInterval(display_log, 1000);
17
+ }
18
+ };
19
+
20
+ //define download variables
21
+ var download = {
22
+ action: 'download'
23
+ };
24
+ //define logreader variables
25
+ var logreader = {
26
+ action: 'logreader'
27
+ };
28
+ //define logreader function
29
+ function display_log() {
30
+ $.post(ajaxurl, logreader, function(response) {
31
+ var xmlObj = $(response);
32
+ xmlObj.each(function() {
33
+ var attributename = "." + $(this).attr('code');
34
+ $(attributename).find(".currentStatus").html($(this).text());
35
+ if($(this).attr('code') == "finalinfo" || $(this).attr('code') == "errorMessage") {
36
+ clearInterval(window.intervalDefine);
37
+ }
38
+ });
39
+ });
40
+ }
41
+
42
+ //define download function
43
+ function download_link() {
44
+ $.post(ajaxurl, download, function(response) {
45
+ $("#download-link").html(response);
46
+ });
47
+ }
48
+
49
+ //execute download (on page load/refresh)
50
+ download_link();
51
+
52
+ //execute backup on button click
53
+ $(".backup-button").click( function() {
54
+ $.post(ajaxurl, backup, function(response) {
55
+ download_link();
56
+ clearInterval(display_log);
57
+ $('.backup-icon').fadeOut(1000);
58
+ $("#php").html(response); //Return PHP messages, used for development
59
+ });
60
+ })
61
+
62
+ //execute restore on button click
63
+ $("#restore-form").submit(function() {
64
+ var htmlvals = '<div class="upload">Uploading: <span class="currentStatus">Pending</span></div><div class="unzipping">Unzipping: <span class="currentStatus">Pending</span></div><div class="validation">Validating restoration file: <span class="currentStatus">Pending</span></div><div class="wpcontent">Restoring /wp-content/ directory: <span class="currentStatus">Pending</span></div><div class="database">Restoring database: <span class="currentStatus">Pending</span></div><div class="infomessage"><span class="currentStatus"></span></div><div class="errorMessage"><span class="currentStatus"></span></div>';
65
+ $("#status").html(htmlvals);
66
+ $(".upload").find('.currentStatus').html('In Progress');
67
+ $('.restore-icon').css('visibility','visible');
68
+ window.intervalDefine = setInterval(display_log, 1000);
69
+ $("#restore-form").attr("target","upload_target");
70
+ $("#upload_target").load(function (){
71
+ importRestore();
72
+ });
73
+ });
74
+
75
+ //define importRestore function
76
+ function importRestore() {
77
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML; //process upload
78
+ $("#php").html(ret); //Return PHP messages, used for development
79
+ clearInterval(display_log);
80
+ $('.restore-icon').fadeOut(1000);
81
+ }
82
+ })(jQuery);
tags/1.3.0/js/ajaxfileupload.js ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Ajax File Upload
3
+ *
4
+ * @version 1.2.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ jQuery.extend({
9
+ createUploadIframe: function(id, uri)
10
+ {
11
+ //create frame
12
+ var frameId = 'jUploadFrame' + id;
13
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
14
+ if(window.ActiveXObject)
15
+ {
16
+ if(typeof uri== 'boolean'){
17
+ iframeHtml += ' src="' + 'javascript:false' + '"';
18
+
19
+ }
20
+ else if(typeof uri== 'string'){
21
+ iframeHtml += ' src="' + uri + '"';
22
+
23
+ }
24
+ }
25
+ iframeHtml += ' />';
26
+ jQuery(iframeHtml).appendTo(document.body);
27
+
28
+ return jQuery('#' + frameId).get(0);
29
+ },
30
+ createUploadForm: function(id, fileElementId, data)
31
+ {
32
+ //create form
33
+ var formId = 'jUploadForm' + id;
34
+ var fileId = 'jUploadFile' + id;
35
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
36
+ if(data)
37
+ {
38
+ for(var i in data)
39
+ {
40
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
41
+ }
42
+ }
43
+ var oldElement = jQuery('#' + fileElementId);
44
+ var newElement = jQuery(oldElement).clone();
45
+ jQuery(oldElement).attr('id', fileId);
46
+ jQuery(oldElement).before(newElement);
47
+ jQuery(oldElement).appendTo(form);
48
+
49
+
50
+
51
+ //set attributes
52
+ jQuery(form).css('position', 'absolute');
53
+ jQuery(form).css('top', '-1200px');
54
+ jQuery(form).css('left', '-1200px');
55
+ jQuery(form).appendTo('body');
56
+ return form;
57
+ },
58
+
59
+ ajaxFileUpload: function(s) {
60
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
61
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
62
+ var id = new Date().getTime()
63
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
64
+ var io = jQuery.createUploadIframe(id, s.secureuri);
65
+ var frameId = 'jUploadFrame' + id;
66
+ var formId = 'jUploadForm' + id;
67
+ // Watch for a new set of requests
68
+ if ( s.global && ! jQuery.active++ )
69
+ {
70
+ jQuery.event.trigger( "ajaxStart" );
71
+ }
72
+ var requestDone = false;
73
+ // Create the request object
74
+ var xml = {}
75
+ if ( s.global )
76
+ jQuery.event.trigger("ajaxSend", [xml, s]);
77
+ // Wait for a response to come back
78
+ var uploadCallback = function(isTimeout)
79
+ {
80
+ var io = document.getElementById(frameId);
81
+ try
82
+ {
83
+ if(io.contentWindow)
84
+ {
85
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
86
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
87
+
88
+ }else if(io.contentDocument)
89
+ {
90
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
91
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
92
+ }
93
+ }catch(e)
94
+ {
95
+ jQuery.handleError(s, xml, null, e);
96
+ }
97
+ if ( xml || isTimeout == "timeout")
98
+ {
99
+ requestDone = true;
100
+ var status;
101
+ try {
102
+ status = isTimeout != "timeout" ? "success" : "error";
103
+ // Make sure that the request was successful or notmodified
104
+ if ( status != "error" )
105
+ {
106
+ // process the data (runs the xml through httpData regardless of callback)
107
+ var data = jQuery.uploadHttpData( xml, s.dataType );
108
+ // If a local callback was specified, fire it and pass it the data
109
+ if ( s.success )
110
+ s.success( data, status );
111
+
112
+ // Fire the global callback
113
+ if( s.global )
114
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
115
+ } else
116
+ jQuery.handleError(s, xml, status);
117
+ } catch(e)
118
+ {
119
+ status = "error";
120
+ jQuery.handleError(s, xml, status, e);
121
+ }
122
+
123
+ // The request was completed
124
+ if( s.global )
125
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
126
+
127
+ // Handle the global AJAX counter
128
+ if ( s.global && ! --jQuery.active )
129
+ jQuery.event.trigger( "ajaxStop" );
130
+
131
+ // Process result
132
+ if ( s.complete )
133
+ s.complete(xml, status);
134
+
135
+ jQuery(io).unbind()
136
+
137
+ setTimeout(function()
138
+ { try
139
+ {
140
+ jQuery(io).remove();
141
+ jQuery(form).remove();
142
+
143
+ } catch(e)
144
+ {
145
+ jQuery.handleError(s, xml, null, e);
146
+ }
147
+
148
+ }, 100)
149
+
150
+ xml = null
151
+
152
+ }
153
+ }
154
+ // Timeout checker
155
+ if ( s.timeout > 0 )
156
+ {
157
+ setTimeout(function(){
158
+ // Check to see if the request is still happening
159
+ if( !requestDone ) uploadCallback( "timeout" );
160
+ }, s.timeout);
161
+ }
162
+ try
163
+ {
164
+
165
+ var form = jQuery('#' + formId);
166
+ jQuery(form).attr('action', s.url);
167
+ jQuery(form).attr('method', 'POST');
168
+ jQuery(form).attr('target', frameId);
169
+ if(form.encoding)
170
+ {
171
+ jQuery(form).attr('encoding', 'multipart/form-data');
172
+ }
173
+ else
174
+ {
175
+ jQuery(form).attr('enctype', 'multipart/form-data');
176
+ }
177
+ jQuery(form).submit();
178
+
179
+ } catch(e)
180
+ {
181
+ jQuery.handleError(s, xml, null, e);
182
+ }
183
+
184
+ jQuery('#' + frameId).load(uploadCallback );
185
+ return {abort: function () {}};
186
+
187
+ },
188
+
189
+ uploadHttpData: function( r, type ) {
190
+ var data = !type;
191
+ data = type == "xml" || data ? r.responseXML : r.responseText;
192
+ // If the type is "script", eval it in global context
193
+ if ( type == "script" )
194
+ jQuery.globalEval( data );
195
+ // Get the JavaScript object, if JSON is used.
196
+ if ( type == "json" )
197
+ eval( "data = " + data );
198
+ // evaluate scripts within html
199
+ if ( type == "html" )
200
+ jQuery("<div>").html(data).evalScripts();
201
+
202
+ return data;
203
+ }
204
+ })
tags/1.3.0/languages/template_en_US.po ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup Pro\n"
4
+ "POT-Creation-Date: 2013-02-17 11:26-0000\n"
5
+ "PO-Revision-Date: 2013-02-17 11:26-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: WP Backitup <support@wpbackitup.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: index.php:328
19
+ msgid "Settings"
20
+ msgstr "Bleh ble-bleh"
21
+
22
+ #: lib/functions.php:46
23
+ msgid "Download most recent export file"
24
+ msgstr ""
25
+
26
+ #: lib/functions.php:50
27
+ msgid "No export file available for download. Please create one."
28
+ msgstr ""
29
+
30
+ #: lib/includes/backup.php:25 lib/includes/restore.php:24
31
+ msgid "Can't open file"
32
+ msgstr ""
33
+
34
+ #: lib/includes/backup.php:29
35
+ msgid "Creating backup directory..."
36
+ msgstr ""
37
+
38
+ #: lib/includes/backup.php:31
39
+ msgid ""
40
+ "Cannot create backup directory. Please check the CHMOD settings of your wp-"
41
+ "backitup plugin directory"
42
+ msgstr ""
43
+
44
+ #: lib/includes/backup.php:37 lib/includes/restore.php:142
45
+ msgid "Done"
46
+ msgstr ""
47
+
48
+ #: lib/includes/backup.php:45
49
+ msgid "Backing up your files..."
50
+ msgstr ""
51
+
52
+ #: lib/includes/backup.php:50
53
+ msgid "Unable to backup your files. Please try again."
54
+ msgstr ""
55
+
56
+ #: lib/includes/backup.php:55
57
+ msgid "Backing up your database..."
58
+ msgstr ""
59
+
60
+ #: lib/includes/backup.php:57 lib/includes/backup.php:77
61
+ #: lib/includes/restore.php:156 lib/includes/restore.php:174
62
+ #: lib/includes/restore.php:200 lib/includes/restore.php:336
63
+ msgid "Done!"
64
+ msgstr ""
65
+
66
+ #: lib/includes/backup.php:59
67
+ msgid "Unable to backup your database. Please try again."
68
+ msgstr ""
69
+
70
+ #: lib/includes/backup.php:67
71
+ msgid "Unable to create site information file. Please try again."
72
+ msgstr ""
73
+
74
+ #: lib/includes/backup.php:73
75
+ msgid "Creating backup zip..."
76
+ msgstr ""
77
+
78
+ #: lib/includes/backup.php:81
79
+ msgid "Warning: Unable to cleanup your backup directory."
80
+ msgstr ""
81
+
82
+ #: lib/includes/backup.php:85
83
+ msgid ""
84
+ "Backup file created successfully. You can download your backup file using "
85
+ "the link above."
86
+ msgstr ""
87
+
88
+ #: lib/includes/restore.php:133
89
+ msgid "No file selected"
90
+ msgstr ""
91
+
92
+ #: lib/includes/restore.php:138
93
+ msgid "Uploading restoration file..."
94
+ msgstr ""
95
+
96
+ #: lib/includes/restore.php:144
97
+ msgid "Your file could not be uploaded"
98
+ msgstr ""
99
+
100
+ #: lib/includes/restore.php:158
101
+ msgid "Your restoration file could not be unzipped."
102
+ msgstr ""
103
+
104
+ #: lib/includes/restore.php:165
105
+ msgid "Validating zip..."
106
+ msgstr ""
107
+
108
+ #: lib/includes/restore.php:176
109
+ msgid ""
110
+ "Your zip file appears to be invalid. Please ensure you chose the correct zip "
111
+ "file."
112
+ msgstr ""
113
+
114
+ #: lib/includes/restore.php:184
115
+ msgid "Restoring wp-content directory..."
116
+ msgstr ""
117
+
118
+ #: lib/includes/restore.php:186
119
+ msgid ""
120
+ "Unable to remove existing wp-content directory for import. Please check your "
121
+ "CHMOD settings in /wp-content/."
122
+ msgstr ""
123
+
124
+ #: lib/includes/restore.php:193
125
+ msgid ""
126
+ "Unable to create new wp-content directory for import. Please check your "
127
+ "CHMOD settings in /wp-content/."
128
+ msgstr ""
129
+
130
+ #: lib/includes/restore.php:202
131
+ msgid "Unable to import wp-content. Please try again."
132
+ msgstr ""
133
+
134
+ #: lib/includes/restore.php:212
135
+ msgid "Restoring database..."
136
+ msgstr ""
137
+
138
+ #: lib/includes/restore.php:222
139
+ msgid "Unable to connect to your current database"
140
+ msgstr ""
141
+
142
+ #: lib/includes/restore.php:236
143
+ msgid "Unable to get current site URL from database. Please try again."
144
+ msgstr ""
145
+
146
+ #: lib/includes/restore.php:250
147
+ msgid "Unable to get current home URL from database. Please try again."
148
+ msgstr ""
149
+
150
+ #: lib/includes/restore.php:264
151
+ msgid "Unable to get current user ID from database. Please try again."
152
+ msgstr ""
153
+
154
+ #: lib/includes/restore.php:278
155
+ msgid "Unable to get current user password from database. Please try again."
156
+ msgstr ""
157
+
158
+ #: lib/includes/restore.php:292
159
+ msgid "Unable to get current user email from database. Please try again."
160
+ msgstr ""
161
+
162
+ #: lib/includes/restore.php:305
163
+ msgid ""
164
+ "Unable to get import your database. This may require importing the file "
165
+ "manually."
166
+ msgstr ""
167
+
168
+ #: lib/includes/restore.php:323
169
+ msgid ""
170
+ "Unable to update your current home URL value. This may require importing the "
171
+ "file manually."
172
+ msgstr ""
173
+
174
+ #: lib/includes/restore.php:330
175
+ msgid ""
176
+ "Unable to update your user information. This may require importing the file "
177
+ "manually."
178
+ msgstr ""
179
+
180
+ #: lib/includes/restore.php:338
181
+ msgid "Warning: Database not detected in import file."
182
+ msgstr ""
183
+
184
+ #: lib/includes/restore.php:351
185
+ msgid "Restoration complete. Please refresh the page."
186
+ msgstr ""
187
+
188
+ #: views/options.php:6 views/options.php:8
189
+ msgid "Backup"
190
+ msgstr ""
191
+
192
+ #: views/options.php:7
193
+ msgid "Create a backup file of this site's content and settings."
194
+ msgstr ""
195
+
196
+ #: views/options.php:9
197
+ msgid "Download"
198
+ msgstr ""
199
+
200
+ #: views/options.php:11 views/options.php:23
201
+ msgid "Restore"
202
+ msgstr ""
203
+
204
+ #: views/options.php:14
205
+ msgid ""
206
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
207
+ "plugins, uploads and settings."
208
+ msgstr ""
209
+
210
+ #: views/options.php:25
211
+ msgid "Status"
212
+ msgstr ""
213
+
214
+ #: views/options.php:26
215
+ msgid "Nothing to report"
216
+ msgstr ""
217
+
218
+ #: views/options.php:35 views/options.php:56
219
+ msgid "License Key"
220
+ msgstr ""
221
+
222
+ #: views/options.php:39
223
+ msgid "Automatic updates enabled"
224
+ msgstr ""
225
+
226
+ #: views/options.php:41
227
+ msgid "Activate automatic updates by entering your license key"
228
+ msgstr ""
229
+
230
+ #: views/options.php:46
231
+ msgid "Active"
232
+ msgstr ""
233
+
234
+ #: views/options.php:47
235
+ msgid "Update"
236
+ msgstr ""
237
+
238
+ #: views/options.php:49
239
+ msgid "Inactive"
240
+ msgstr ""
241
+
242
+ #: views/options.php:50
243
+ msgid "Activate"
244
+ msgstr ""
245
+
246
+ #: views/options.php:55
247
+ msgid "Need Support?"
248
+ msgstr ""
249
+
250
+ #: views/options.php:60
251
+ msgid "Spread the Word"
252
+ msgstr ""
253
+
254
+ #: views/options.php:65
255
+ msgid "Enable"
256
+ msgstr ""
257
+
258
+ #: views/options.php:66
259
+ msgid "Disable"
260
+ msgstr ""
261
+
262
+ #: views/options.php:67
263
+ msgid ""
264
+ "Help to improve Easy Webtrends by enabling <a href=\"http://www.presstrends."
265
+ "io\" target=\"_blank\">Presstrends</a>"
266
+ msgstr ""
267
+
268
+ #: views/options.php:68
269
+ msgid "Save"
270
+ msgstr ""
271
+
272
+ #: lib/includes/restore.php:37
273
+ msgid "In Progress"
274
+ msgstr ""
275
+
276
+ #: lib/includes/restore.php:149
277
+ msgid "Done"
278
+ msgstr ""
279
+
280
+ #: lib/includes/restore.php: 155
281
+ msgid "Error: Unable to create new directory for import. Please check your CHMOD settings in "
282
+ msgstr ""
283
+
284
+ #: lib/includes/restore.php: 155
285
+ msgid "Error: Unable to create new directory for import. Please check your CHMOD settings in "
286
+ msgstr ""
287
+
288
+ #: lib/includes/restore.php: 193
289
+ msgid "Error: Your restoration file could not be unzipped."
290
+ msgstr ""
291
+
292
+ #: lib/includes/restore.php: 211
293
+ msgid "Error: Your zip file appears to be invalid. Please ensure you chose the correct zip file."
294
+ msgstr ""
295
+
296
+ #: lib/includes/restore.php: 235
297
+ msgid "Error: Unable to connect to your current database: "
298
+ msgstr ""
299
+
300
+
301
+ #: lib/includes/restore.php: 249
302
+ msgid "Error: Unable to get current site URL from database. Please try again."
303
+ msgstr ""
304
+
305
+ #: lib/includes/restore.php: 263
306
+ msgid "Error: Unable to get current home URL from database. Please try again."
307
+ msgstr ""
308
+
309
+ #: lib/includes/restore.php: 277
310
+ msgid "Error: Unable to get current user ID from database. Please try again."
311
+ msgstr ""
312
+
313
+ #: lib/includes/restore.php: 291
314
+ msgid "Error: Unable to get current user password from database. Please try again."
315
+ msgstr ""
316
+
317
+ #: lib/includes/restore.php: 305
318
+ msgid "Error: Unable to get current user email from database. Please try again."
319
+ msgstr ""
320
+
321
+ #: lib/includes/restore.php: 319
322
+ msgid "Error: Unable to get import your database. This may require importing the file manually."
323
+ msgstr ""
324
+
325
+ #: lib/includes/restore.php: 330
326
+ msgid "Error: Unable to update your current site URL value. This may require importing the file manually."
327
+ msgstr ""
328
+
329
+ #: lib/includes/restore.php: 337
330
+ msgid "Error: Unable to update your current home URL value. This may require importing the file manually."
331
+ msgstr ""
332
+
333
+ #: lib/includes/restore.php: 344
334
+ msgid "Error: Unable to update your user information. This may require importing the file manually."
335
+ msgstr ""
336
+
337
+ #: lib/includes/restore.php: 352
338
+ msgid "Error: Warning: Database not detected in import file."
339
+ msgstr ""
340
+
341
+ #: lib/includes/restore.php: 360
342
+ msgid "Error: Unable to remove existing wp-content directory for import. Please check your CHMOD settings in /wp-content/."
343
+ msgstr ""
344
+
345
+ #: lib/includes/restore.php: 367
346
+ msgid "Error: Unable to create new wp-content directory for import. Please check your CHMOD settings in /wp-content/."
347
+ msgstr ""
348
+
349
+ #: lib/includes/restore.php: 376
350
+ msgid "Error: Unable to import wp-content. Please try again."
351
+ msgstr ""
352
+
353
+
354
+ #: lib/includes/restore.php: 392
355
+ msgid "Restoration Complete"
356
+ msgstr ""
357
+
358
+
359
+ #: lib/includes/backup.php: 35
360
+ msgid "Error: Unable to create new directory for backup. Please check your CHMOD settings in "
361
+ msgstr ""
362
+
363
+
364
+ #: lib/includes/backup.php: 46
365
+ msgid "Error: Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory."
366
+ msgstr ""
367
+
368
+
369
+
370
+ #: lib/includes/backup.php: 67
371
+ msgid "Error: Unable to backup your files. Please try again."
372
+ msgstr ""
373
+
374
+
375
+
376
+ #: lib/includes/backup.php: 77
377
+ msgid "Error: Unable to backup your database. Please try again."
378
+ msgstr ""
379
+
380
+
381
+
382
+ #: lib/includes/backup.php: 87
383
+ msgid "Error: Unable to create site information file. Please try again."
384
+ msgstr ""
385
+
386
+
387
+
388
+ #: lib/includes/backup.php: 107
389
+ msgid "Warning: Unable to cleanup your backup directory."
390
+ msgstr ""
391
+
392
+
393
+ #: lib/includes/backup.php: 116
394
+ msgid "Backup file created successfully. You can download your backup file using the link above."
395
+ msgstr ""
tags/1.3.0/languages/wp-backitup-pro.mo ADDED
Binary file
tags/1.3.0/languages/wp-backitup-pro.po ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup Pro\n"
4
+ "POT-Creation-Date: 2013-02-17 11:26-0000\n"
5
+ "PO-Revision-Date: 2013-02-17 11:26-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: WP Backitup <support@wpbackitup.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: __;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: index.php:328
19
+ msgid "Settings"
20
+ msgstr ""
21
+
22
+ #: lib/functions.php:46
23
+ msgid "Download most recent export file"
24
+ msgstr ""
25
+
26
+ #: lib/functions.php:50
27
+ msgid "No export file available for download. Please create one."
28
+ msgstr ""
29
+
30
+ #: lib/includes/backup.php:25 lib/includes/restore.php:24
31
+ msgid "Can't open file"
32
+ msgstr ""
33
+
34
+ #: lib/includes/backup.php:29
35
+ msgid "Creating backup directory..."
36
+ msgstr ""
37
+
38
+ #: lib/includes/backup.php:31
39
+ msgid ""
40
+ "Cannot create backup directory. Please check the CHMOD settings of your wp-"
41
+ "backitup plugin directory"
42
+ msgstr ""
43
+
44
+ #: lib/includes/backup.php:37 lib/includes/restore.php:142
45
+ msgid "Done"
46
+ msgstr ""
47
+
48
+ #: lib/includes/backup.php:45
49
+ msgid "Backing up your files..."
50
+ msgstr ""
51
+
52
+ #: lib/includes/backup.php:50
53
+ msgid "Unable to backup your files. Please try again."
54
+ msgstr ""
55
+
56
+ #: lib/includes/backup.php:55
57
+ msgid "Backing up your database..."
58
+ msgstr ""
59
+
60
+ #: lib/includes/backup.php:57 lib/includes/backup.php:77
61
+ #: lib/includes/restore.php:156 lib/includes/restore.php:174
62
+ #: lib/includes/restore.php:200 lib/includes/restore.php:336
63
+ msgid "Done!"
64
+ msgstr ""
65
+
66
+ #: lib/includes/backup.php:59
67
+ msgid "Unable to backup your database. Please try again."
68
+ msgstr ""
69
+
70
+ #: lib/includes/backup.php:67
71
+ msgid "Unable to create site information file. Please try again."
72
+ msgstr ""
73
+
74
+ #: lib/includes/backup.php:73
75
+ msgid "Creating backup zip..."
76
+ msgstr ""
77
+
78
+ #: lib/includes/backup.php:81
79
+ msgid "Warning: Unable to cleanup your backup directory."
80
+ msgstr ""
81
+
82
+ #: lib/includes/backup.php:85
83
+ msgid ""
84
+ "Backup file created successfully. You can download your backup file using "
85
+ "the link above."
86
+ msgstr ""
87
+
88
+ #: lib/includes/restore.php:133
89
+ msgid "No file selected"
90
+ msgstr ""
91
+
92
+ #: lib/includes/restore.php:138
93
+ msgid "Uploading restoration file..."
94
+ msgstr ""
95
+
96
+ #: lib/includes/restore.php:144
97
+ msgid "Your file could not be uploaded"
98
+ msgstr ""
99
+
100
+ #: lib/includes/restore.php:158
101
+ msgid "Your restoration file could not be unzipped."
102
+ msgstr ""
103
+
104
+ #: lib/includes/restore.php:165
105
+ msgid "Validating zip..."
106
+ msgstr ""
107
+
108
+ #: lib/includes/restore.php:176
109
+ msgid ""
110
+ "Your zip file appears to be invalid. Please ensure you chose the correct zip "
111
+ "file."
112
+ msgstr ""
113
+
114
+ #: lib/includes/restore.php:184
115
+ msgid "Restoring wp-content directory..."
116
+ msgstr ""
117
+
118
+ #: lib/includes/restore.php:186
119
+ msgid ""
120
+ "Unable to remove existing wp-content directory for import. Please check your "
121
+ "CHMOD settings in /wp-content/."
122
+ msgstr ""
123
+
124
+ #: lib/includes/restore.php:193
125
+ msgid ""
126
+ "Unable to create new wp-content directory for import. Please check your "
127
+ "CHMOD settings in /wp-content/."
128
+ msgstr ""
129
+
130
+ #: lib/includes/restore.php:202
131
+ msgid "Unable to import wp-content. Please try again."
132
+ msgstr ""
133
+
134
+ #: lib/includes/restore.php:212
135
+ msgid "Restoring database..."
136
+ msgstr ""
137
+
138
+ #: lib/includes/restore.php:222
139
+ msgid "Unable to connect to your current database"
140
+ msgstr ""
141
+
142
+ #: lib/includes/restore.php:236
143
+ msgid "Unable to get current site URL from database. Please try again."
144
+ msgstr ""
145
+
146
+ #: lib/includes/restore.php:250
147
+ msgid "Unable to get current home URL from database. Please try again."
148
+ msgstr ""
149
+
150
+ #: lib/includes/restore.php:264
151
+ msgid "Unable to get current user ID from database. Please try again."
152
+ msgstr ""
153
+
154
+ #: lib/includes/restore.php:278
155
+ msgid "Unable to get current user password from database. Please try again."
156
+ msgstr ""
157
+
158
+ #: lib/includes/restore.php:292
159
+ msgid "Unable to get current user email from database. Please try again."
160
+ msgstr ""
161
+
162
+ #: lib/includes/restore.php:305
163
+ msgid ""
164
+ "Unable to get import your database. This may require importing the file "
165
+ "manually."
166
+ msgstr ""
167
+
168
+ #: lib/includes/restore.php:323
169
+ msgid ""
170
+ "Unable to update your current home URL value. This may require importing the "
171
+ "file manually."
172
+ msgstr ""
173
+
174
+ #: lib/includes/restore.php:330
175
+ msgid ""
176
+ "Unable to update your user information. This may require importing the file "
177
+ "manually."
178
+ msgstr ""
179
+
180
+ #: lib/includes/restore.php:338
181
+ msgid "Warning: Database not detected in import file."
182
+ msgstr ""
183
+
184
+ #: lib/includes/restore.php:351
185
+ msgid "Restoration complete. Please refresh the page."
186
+ msgstr ""
187
+
188
+ #: views/options.php:6 views/options.php:8
189
+ msgid "Backup"
190
+ msgstr ""
191
+
192
+ #: views/options.php:7
193
+ msgid "Create a backup file of this site's content and settings."
194
+ msgstr ""
195
+
196
+ #: views/options.php:9
197
+ msgid "Download"
198
+ msgstr ""
199
+
200
+ #: views/options.php:11 views/options.php:23
201
+ msgid "Restore"
202
+ msgstr ""
203
+
204
+ #: views/options.php:14
205
+ msgid ""
206
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
207
+ "plugins, uploads and settings."
208
+ msgstr ""
209
+
210
+ #: views/options.php:25
211
+ msgid "Status"
212
+ msgstr ""
213
+
214
+ #: views/options.php:26
215
+ msgid "Nothing to report"
216
+ msgstr ""
217
+
218
+ #: views/options.php:35 views/options.php:56
219
+ msgid "License Key"
220
+ msgstr ""
221
+
222
+ #: views/options.php:39
223
+ msgid "Automatic updates enabled"
224
+ msgstr ""
225
+
226
+ #: views/options.php:41
227
+ msgid "Activate automatic updates by entering your license key"
228
+ msgstr ""
229
+
230
+ #: views/options.php:46
231
+ msgid "Active"
232
+ msgstr ""
233
+
234
+ #: views/options.php:47
235
+ msgid "Update"
236
+ msgstr ""
237
+
238
+ #: views/options.php:49
239
+ msgid "Inactive"
240
+ msgstr ""
241
+
242
+ #: views/options.php:50
243
+ msgid "Activate"
244
+ msgstr ""
245
+
246
+ #: views/options.php:55
247
+ msgid "Need Support?"
248
+ msgstr ""
249
+
250
+ #: views/options.php:60
251
+ msgid "Spread the Word"
252
+ msgstr ""
253
+
254
+ #: views/options.php:65
255
+ msgid "Enable"
256
+ msgstr ""
257
+
258
+ #: views/options.php:66
259
+ msgid "Disable"
260
+ msgstr ""
261
+
262
+ #: views/options.php:67
263
+ msgid ""
264
+ "Help to improve Easy Webtrends by enabling <a href=\"http://www.presstrends."
265
+ "io\" target=\"_blank\">Presstrends</a>"
266
+ msgstr ""
267
+
268
+ #: views/options.php:68
269
+ msgid "Save"
270
+ msgstr ""
tags/1.3.0/lib/constants.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WP Backitup Pro
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.3.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.3.0' );
13
+
14
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
19
+
20
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
21
+
22
+ if( !defined( 'WPBACKITUP_SITE_URL' ) ) define( 'WPBACKITUP_SITE_URL', 'http://www.wpbackitup.com' );
23
+
24
+ if( !defined( 'WPBACKITUP_ITEM_NAME' ) ) define( 'WPBACKITUP_ITEM_NAME', 'WP Backitup' );
tags/1.3.0/lib/functions.php ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.3.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ // localize the plugin
13
+ function lang_setup() {
14
+ global $WPBackitup;
15
+ load_plugin_textdomain($WPBackitup->namespace, false, dirname(plugin_basename(__FILE__)) . '/lang/');
16
+ }
17
+ add_action('after_setup_theme', 'lang_setup');
18
+
19
+ // include recurseZip class
20
+ if( !class_exists( 'recurseZip' ) ) {
21
+ include_once 'includes/recurse_zip.php';
22
+ }
23
+
24
+ // include auto-update class
25
+ if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
26
+ include_once 'includes/auto_update.php';
27
+ }
28
+
29
+ // retrieve our license key from the DB
30
+ $license_key = trim( $this->get_option( 'license_key' ) );
31
+
32
+ // setup the updater
33
+ $edd_updater = new EDD_SL_Plugin_Updater( WPBACKITUP_SITE_URL, dirname ( dirname ( __FILE__) ) .'/index.php', array(
34
+ 'version' => WPBACKITUP_VERSION, // current version number
35
+ 'license' => $license_key, // license key (used get_option above to retrieve from DB)
36
+ 'item_name' => WPBACKITUP_ITEM_NAME, // name of this plugin
37
+ 'author' => 'John Peden' // author of this plugin
38
+ )
39
+ );
40
+
41
+ //load backup function
42
+ function backup() {
43
+ include_once 'includes/backup.php';
44
+ }
45
+ add_action('wp_ajax_backup', 'backup');
46
+
47
+ //load restore_path function
48
+ function restore_path() {
49
+ include_once 'includes/restore_from_path.php';
50
+ }
51
+ add_action('wp_ajax_restore_path', 'restore_path');
52
+
53
+ //load download function
54
+ function download() {
55
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
56
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
57
+ $filename = basename($file);
58
+ echo 'Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a>';
59
+ }
60
+ } else {
61
+ echo 'No export file available for download. Please create one.';
62
+ }
63
+ die();
64
+ }
65
+ add_action('wp_ajax_download', 'download');
66
+
67
+ //load logreader function
68
+ function logreader() {
69
+ $log = WPBACKITUP_DIRNAME .'/logs/status.log';
70
+ if(file_exists($log) ) {
71
+ readfile($log);
72
+ }
73
+ die();
74
+ }
75
+ add_action('wp_ajax_logreader', 'logreader');
76
+
77
+ //define create_dir function
78
+ if(!function_exists('create_dir')) {
79
+ function create_dir($dir) {
80
+ if( !is_dir($dir) ) {
81
+ @mkdir($dir, 0755);
82
+ }
83
+ return true;
84
+ }
85
+ }
86
+
87
+ //Define recusive_copy function
88
+ if(!function_exists('recursive_copy')) {
89
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
90
+ if( is_dir($dir) ) { //If the directory exists
91
+ if ($dh = opendir($dir) ) {
92
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
93
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
94
+ if (!is_dir( $dir.$file ) ) {
95
+ //Copy files to destination directory
96
+ $fsrc = fopen($dir .$file,'r');
97
+ $fdest = fopen($target_path .$file,'w+');
98
+ $len = stream_copy_to_stream($fsrc,$fdest);
99
+ fclose($fsrc);
100
+ fclose($fdest);
101
+ } else { //If $file is a directory
102
+ $destdir = $target_path .$file; //Modify the destination dir
103
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
104
+ @mkdir($destdir, 0755);
105
+ }
106
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
107
+ }
108
+ }
109
+ }
110
+ closedir($dh);
111
+ }
112
+ }
113
+ return true;
114
+ }
115
+ }
116
+
117
+ //Define DB backup function
118
+ if(!function_exists('db_backup')) {
119
+ function db_backup($path) {
120
+
121
+ $handle = fopen($path .'db-backup.sql', 'w+');
122
+
123
+
124
+ $path_sql = $path .'/db-backup.sql';
125
+ $db_name = DB_NAME;
126
+ $db_user = DB_USER;
127
+ $db_pass = DB_PASSWORD;
128
+ $db_host = DB_HOST;
129
+
130
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name");
131
+ fwrite($handle,$output);
132
+ fclose($handle);
133
+ return true;
134
+ }
135
+ }
136
+
137
+ //Define the create_siteinfo function
138
+ if(!function_exists('create_siteinfo')) {
139
+ function create_siteinfo($path, $table_prefix) {
140
+ $siteinfo = $path ."backupsiteinfo.txt";
141
+ $handle = fopen($siteinfo, 'w+');
142
+ $entry = site_url( '/' ) ."\n$table_prefix";
143
+ fwrite($handle, $entry);
144
+ fclose($handle);
145
+ return true;
146
+ }
147
+ }
148
+
149
+ //Define recursive_delete function
150
+ if(!function_exists('recursive_delete')){
151
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
152
+ if( is_dir($dir) ){
153
+ if($dh = opendir($dir)) {
154
+ while( ($file = readdir($dh)) !== false ) {
155
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
156
+ if(!is_dir($dir .'/'. $file)) {
157
+ unlink($dir .'/'. $file);
158
+ } else {
159
+ recursive_delete($dir.'/'. $file, $ignore);
160
+ }
161
+ }
162
+ }
163
+ }
164
+ @rmdir($dir);
165
+ closedir($dh);
166
+ }
167
+ return true;
168
+ }
169
+ }
170
+
171
+ //Define zip function
172
+ function zip($source, $destination, $ignore) {
173
+ if (is_string($source)) $source_arr = array($source); // convert it to array
174
+ if (!extension_loaded('zip')) {
175
+ return false;
176
+ }
177
+ $zip = new ZipArchive();
178
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
179
+ return false;
180
+ }
181
+ foreach ($source_arr as $source) {
182
+ if (!file_exists($source)) continue;
183
+ $source = str_replace('\\', '/', realpath($source));
184
+ if (is_dir($source) === true) {
185
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
186
+ foreach ($files as $file) {
187
+ if (!preg_match($ignore, $file)) {
188
+ $file = str_replace('\\', '/', realpath($file));
189
+ if (is_dir($file) === true) {
190
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
191
+ } else if (is_file($file) === true) {
192
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
193
+ }
194
+ }
195
+ }
196
+ } else if (is_file($source) === true) {
197
+ $zip->addFromString(basename($source), file_get_contents($source));
198
+ }
199
+ }
200
+ return $zip->close();
201
+ }
202
+
203
+ //load presstrends
204
+ function load_presstrends() {
205
+ global $WPBackitup;
206
+ if($WPBackitup->get_option( 'presstrends' ) == 'enabled') {
207
+ // PressTrends Account API Key
208
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
209
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
210
+
211
+ // Start of Metrics
212
+ global $wpdb;
213
+ $data = get_transient( 'presstrends_cache_data' );
214
+ if ( !$data || $data == '' ) {
215
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
216
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
217
+
218
+ $count_posts = wp_count_posts();
219
+ $count_pages = wp_count_posts( 'page' );
220
+ $comments_count = wp_count_comments();
221
+
222
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
223
+ if ( function_exists( 'wp_get_theme' ) ) {
224
+ $theme_data = wp_get_theme();
225
+ $theme_name = urlencode( $theme_data->Name );
226
+ } else {
227
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
228
+ $theme_name = $theme_data['Name'];
229
+ }
230
+
231
+ $plugin_name = '&';
232
+ foreach ( get_plugins() as $plugin_info ) {
233
+ $plugin_name .= $plugin_info['Name'] . '&';
234
+ }
235
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
236
+ $plugin_data = get_plugin_data( __FILE__ );
237
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
238
+ $data = array(
239
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
240
+ 'posts' => $count_posts->publish,
241
+ 'pages' => $count_pages->publish,
242
+ 'comments' => $comments_count->total_comments,
243
+ 'approved' => $comments_count->approved,
244
+ 'spam' => $comments_count->spam,
245
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
246
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
247
+ 'theme_version' => $plugin_data['Version'],
248
+ 'theme_name' => $theme_name,
249
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
250
+ 'plugins' => count( get_option( 'active_plugins' ) ),
251
+ 'plugin' => urlencode( $plugin_name ),
252
+ 'wpversion' => get_bloginfo( 'version' ),
253
+ );
254
+
255
+ foreach ( $data as $k => $v ) {
256
+ $url .= $k . '/' . $v . '/';
257
+ }
258
+ wp_remote_get( $url );
259
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
260
+ }
261
+ }
262
+ }
263
+ // PressTrends WordPress Action
264
+ add_action('admin_init', 'load_presstrends');
tags/1.3.0/lib/includes/auto_update.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Auto Update
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.3.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ class EDD_SL_Plugin_Updater {
14
+ private $api_url = '';
15
+ private $api_data = array();
16
+ private $name = '';
17
+ private $slug = '';
18
+
19
+ /**
20
+ * Class constructor.
21
+ *
22
+ * @uses plugin_basename()
23
+ * @uses hook()
24
+ *
25
+ * @param string $_api_url The URL pointing to the custom API endpoint.
26
+ * @param string $_plugin_file Path to the plugin file.
27
+ * @param array $_api_data Optional data to send with API calls.
28
+ * @return void
29
+ */
30
+ function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
31
+ $this->api_url = trailingslashit( $_api_url );
32
+ $this->api_data = urlencode_deep( $_api_data );
33
+ $this->name = plugin_basename( $_plugin_file );
34
+ $this->slug = basename( $_plugin_file, '.php');
35
+ $this->version = $_api_data['version'];
36
+
37
+ // Set up hooks.
38
+ $this->hook();
39
+ }
40
+
41
+ /**
42
+ * Set up Wordpress filters to hook into WP's update process.
43
+ *
44
+ * @uses add_filter()
45
+ *
46
+ * @return void
47
+ */
48
+ private function hook() {
49
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
50
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
51
+ }
52
+
53
+ /**
54
+ * Check for Updates at the defined API endpoint and modify the update array.
55
+ *
56
+ * This function dives into the update api just when Wordpress creates its update array,
57
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
58
+ * It is reassembled from parts of the native Wordpress plugin update code.
59
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
60
+ *
61
+ * @uses api_request()
62
+ *
63
+ * @param array $_transient_data Update array build by Wordpress.
64
+ * @return array Modified update array with custom plugin data.
65
+ */
66
+ function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
67
+
68
+
69
+ if( empty( $_transient_data ) ) return $_transient_data;
70
+
71
+ $to_send = array( 'slug' => $this->slug );
72
+
73
+ $api_response = $this->api_request( 'plugin_latest_version', $to_send );
74
+
75
+ if( false !== $api_response && is_object( $api_response ) ) {
76
+ if( version_compare( $this->version, $api_response->new_version, '<' ) )
77
+ $_transient_data->response[$this->name] = $api_response;
78
+ }
79
+ return $_transient_data;
80
+ }
81
+
82
+
83
+ /**
84
+ * Updates information on the "View version x.x details" page with custom data.
85
+ *
86
+ * @uses api_request()
87
+ *
88
+ * @param mixed $_data
89
+ * @param string $_action
90
+ * @param object $_args
91
+ * @return object $_data
92
+ */
93
+ function plugins_api_filter( $_data, $_action = '', $_args = null ) {
94
+ if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
95
+
96
+ $to_send = array( 'slug' => $this->slug );
97
+
98
+ $api_response = $this->api_request( 'plugin_information', $to_send );
99
+ if ( false !== $api_response ) $_data = $api_response;
100
+
101
+ return $_data;
102
+ }
103
+
104
+ /**
105
+ * Calls the API and, if successfull, returns the object delivered by the API.
106
+ *
107
+ * @uses get_bloginfo()
108
+ * @uses wp_remote_post()
109
+ * @uses is_wp_error()
110
+ *
111
+ * @param string $_action The requested action.
112
+ * @param array $_data Parameters for the API action.
113
+ * @return false||object
114
+ */
115
+ private function api_request( $_action, $_data ) {
116
+
117
+ global $wp_version;
118
+
119
+ $data = array_merge( $this->api_data, $_data );
120
+ if( $data['slug'] != $this->slug )
121
+ return;
122
+
123
+ $api_params = array(
124
+ 'edd_action' => 'get_version',
125
+ 'license' => $data['license'],
126
+ 'name' => $data['item_name'],
127
+ 'slug' => $this->slug,
128
+ 'author' => $data['author']
129
+ );
130
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
131
+
132
+ if ( !is_wp_error( $request ) ):
133
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
134
+ if( $request )
135
+ $request->sections = maybe_unserialize( $request->sections );
136
+ return $request;
137
+ else:
138
+ return false;
139
+ endif;
140
+ }
141
+ }
tags/1.3.0/lib/includes/backup.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Backup Functions
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.3.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ global $WPBackitup;
14
+
15
+ //limit process to 15 minutes
16
+ @set_time_limit(900);
17
+
18
+ //Define variables
19
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
20
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
21
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
22
+
23
+ //create log file
24
+
25
+ $log = WPBACKITUP_DIRNAME ."/logs/status.log";
26
+ unlink($log);
27
+ $fh = fopen($log, 'w') or die("Can't open log file");
28
+
29
+ //Delete the existing backup directory
30
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
31
+
32
+ //Re-create and empty backup dir
33
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
34
+ fwrite($fh, '<status code="prerequsites">'.__('Failed', $WPBackitup->namespace ).'</status>');
35
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to create new directory for backup. Please check your CHMOD settings in ' , $WPBackitup->namespace ).WPBACKITUP_DIR_PATH . '.</error>');
36
+ fclose($fh);
37
+ die();
38
+ }
39
+
40
+ //Check to see if the directory is writeable
41
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
42
+ fwrite($fh, '<status code="prerequsites">' . __('Failed', $WPBackitup->namespace ) . '</status>');
43
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory.', $WPBackitup->namespace ) . '</error>');
44
+ die();
45
+ } else {
46
+ //If the directory is writeable, create the backup folder if it doesn't exist
47
+ if( !is_dir($backup_project_path) ) {
48
+ @mkdir($backup_project_path, 0755);
49
+ }
50
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
51
+ unlink($zip);
52
+ }
53
+ fwrite($fh, '<status code="prerequisites">' . __('Done', $WPBackitup->namespace ) . '</status>');
54
+ }
55
+
56
+ //Backup with copy
57
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
58
+ fwrite($fh, '<status code="backupfiles">' . __('Done',$WPBackitup->namespace ) . '</status>');
59
+ } else {
60
+ fwrite($fh, '<status code="backupfiles">' . __('Failed', $WPBackitup->namespace ) . '</status>');
61
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to backup your files. Please try again.', $WPBackitup->namespace ) . "</error>");
62
+ die();
63
+ }
64
+
65
+ //Dump DB to project dir
66
+ if( db_backup($backup_project_path) ) {
67
+ fwrite($fh, '<status code="backupdb">' . __('Done', $WPBackitup->namespace ) . '</status>');
68
+ } else {
69
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to backup your database. Please try again.', $WPBackitup->namespace ) . '</error>');
70
+ recursive_delete($backup_project_path);
71
+ die();
72
+ }
73
+
74
+ //Create siteinfo in project dir
75
+ global $wpdb;
76
+
77
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
78
+ fwrite($fh, '<status code="infofile">' . __('Failed' , $WPBackitup->namespace ) . '</status>');
79
+ fwrite($fh, '<error code="errorMessage">' . __('Error: Unable to create site information file. Please try again.', $WPBackitup->namespace ) . '</error>');
80
+ recursive_delete($backup_project_path);
81
+ die();
82
+ } else {
83
+ fwrite($fh, '<status code="infofile">' . __('Done', $WPBackitup->namespace ) . '</status>');
84
+ }
85
+
86
+ //Zip the project dir
87
+ $z = new recurseZip();
88
+ $src = rtrim($backup_project_path, '/');
89
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
90
+ fwrite($fh, '<status code="zipfile">' . __('Done', $WPBackitup->namespace ) . '</status>');
91
+
92
+ //Delete backup dir
93
+ if(!recursive_delete($backup_project_path)) {
94
+ fwrite($fh, '<status code="cleanup">' . __('Failed', $WPBackitup->namespace ). '</status>');
95
+ fwrite($fh, '<error code="errorMessage">' . __('Warning: Unable to cleanup your backup directory.', $WPBackitup->namespace ) . "</error>");
96
+ } else {
97
+ fwrite($fh, '<status code="cleanup">' . __('Done' , $WPBackitup->namespace ) . '</status>');
98
+ }
99
+
100
+ //close log file
101
+ fwrite($fh, '<status code="finalinfo">' . __('Backup file created successfully. You can download your backup file using the link above.', $WPBackitup->namespace ) . "</status>");
102
+ fwrite($fh, '<status code="end">' . __('End', $WPBackitup->namespace ) . '</status>');
103
+ fclose($fh);
104
+
105
+ //End backup function
106
+ die();
tags/1.3.0/lib/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * WP Backitup Recurse Zip Function
1
  *
2
  * @package WP Backitup
3
  *
4
  * @author jcpeden
5
  * @version 1.3.0
6
  * @since 1.0.1
7
  */
1
+ <?php
2
  * WP Backitup Recurse Zip Function
3
  *
4
  * @package WP Backitup
5
  *
6
  * @author jcpeden
7
  * @version 1.3.0
8
  * @since 1.0.1
9
  */
tags/1.3.0/lib/includes/restore.php ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Restore Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.3.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ //define constants
14
+ if( !defined( 'WP_DIR_PATH' ) ) define( 'WP_DIR_PATH', dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', basename(WPBACKITUP_DIR_PATH) );
19
+
20
+ if( !defined( 'WP_CONTENT_PATH' ) ) define( 'WP_CONTENT_PATH', dirname( dirname( WPBACKITUP_DIR_PATH ) ) ) ;
21
+
22
+ if(!function_exists('create_dir')) {
23
+ function create_dir($dir) {
24
+ if( !is_dir($dir) ) {
25
+ @mkdir($dir, 0755);
26
+ }
27
+ return true;
28
+ }
29
+ }
30
+
31
+ if(!function_exists('redo_to_checkpoint')) {
32
+ function redo_to_checkpoint($checkpoint) {
33
+
34
+ if($checkpoint == "db")
35
+ {
36
+ if( glob($restoration_dir_path . "*.cur") ) {
37
+ //collect connection information from form
38
+ fwrite($fh, '<status code="database">In Progress</status>');
39
+ include_once WP_DIR_PATH .'/wp-config.php';
40
+ //Add user to DB in v1.0.5
41
+ $user_id = $_POST['user_id'];
42
+ //Connect to DB
43
+ $output = db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc);
44
+ }
45
+
46
+ }
47
+
48
+ }
49
+ }
50
+
51
+ if(!function_exists('db_backup')) {
52
+ function db_backup($path) {
53
+ $handle = fopen($path .'db-backup.cur', 'w+');
54
+ $path_sql = $path .'db-backup.cur';
55
+ $db_name = DB_NAME;
56
+ $db_user = DB_USER;
57
+ $db_pass = DB_PASSWORD;
58
+ $db_host = DB_HOST;
59
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name > '$path_sql'");
60
+ fwrite($handle,$output);
61
+ fclose($handle);
62
+ return true;
63
+ }
64
+ }
65
+
66
+ //Define recusive_copy function
67
+ if(!function_exists('recursive_copy')) {
68
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
69
+ if( is_dir($dir) ) { //If the directory exists
70
+ if ($dh = opendir($dir) ) {
71
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
72
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
73
+ if (!is_dir( $dir.$file ) ) {
74
+ //Copy files to destination directory
75
+ //echo 'Copying ' .$dir .$file . ' to ' .$target_path .$file .'<br />';
76
+ $fsrc = fopen($dir .$file,'r');
77
+ $fdest = fopen($target_path .$file,'w+');
78
+ $len = stream_copy_to_stream($fsrc,$fdest);
79
+ fclose($fsrc);
80
+ fclose($fdest);
81
+ } else { //If $file is a directory
82
+ $destdir = $target_path .$file; //Modify the destination dir
83
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
84
+ @mkdir($destdir, 0755);
85
+ }
86
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
87
+ }
88
+ }
89
+ }
90
+ closedir($dh);
91
+ }
92
+ }
93
+ return true;
94
+ }
95
+ }
96
+
97
+ //Define recursive_delete function
98
+ if(!function_exists('recursive_delete')){
99
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
100
+ if( is_dir($dir) ){
101
+ if($dh = opendir($dir)) {
102
+ while( ($file = readdir($dh)) !== false ) {
103
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
104
+ if(!is_dir($dir .'/' .$file)) {
105
+ //echo 'Deleting ' .$dir .'/' .$file '<br />';
106
+ unlink($dir .'/' .$file);
107
+ } else {
108
+ recursive_delete($dir .'/' .$file, $ignore);
109
+ }
110
+ }
111
+ }
112
+ }
113
+ @rmdir($dir);
114
+ closedir($dh);
115
+ }
116
+ return true;
117
+ }
118
+ }
119
+
120
+ //define db_import function
121
+ if(!function_exists('db_import')) {
122
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
123
+ //13-4-13: John C Peden [mail@johncpeden.com] This was incomplete, I've updated to make it work
124
+ foreach(glob($restoration_dir_path . "*.sql") as $sql_file) {
125
+ $db_name = DB_NAME;
126
+ $db_user = DB_USER;
127
+ $db_pass = DB_PASSWORD;
128
+ $db_host = DB_HOST;
129
+ $command = "mysql --user='$db_user' --password='$db_pass' --host='$db_host' $db_name < '$sql_file'";
130
+ $output = shell_exec(($command));
131
+ }
132
+ return true;
133
+ }
134
+ }
135
+
136
+ //create log file
137
+ $log = WPBACKITUP_DIR_PATH .'/logs/status.log';
138
+ unlink($log);
139
+ $fh = fopen($log, 'w') or die( "Can't write to log file" );
140
+
141
+ // 15 minutes per image should be PLENTY
142
+ @set_time_limit(900);
143
+
144
+ //Delete the existing backup directory
145
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
146
+
147
+ //Re-create and empty backup dir
148
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
149
+ fwrite($fh, '<status code="errorMessage">Error: Unable to create new directory for import. Please check your CHMOD settings in' .WPBACKITUP_DIR_PATH.'.</status>');
150
+ fclose($fh);
151
+ die();
152
+ }
153
+
154
+ //Move the uploaded zip to the restoration directory
155
+ $restore_file_name = basename( $_FILES['wpbackitup-zip']['name']);
156
+ if( $restore_file_name == '') {
157
+ fwrite($fh, '<status code="errorMessage">Error: No file selected</status>');
158
+ fclose($fh);
159
+ die();
160
+ } else {
161
+ fwrite($fh, '<status code="upload">Done</status>');
162
+ }
163
+
164
+ //define create_dir function
165
+
166
+ fwrite($fh, '<status code="copyfiles">In Progress</status>');
167
+
168
+ $restore_path = WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name;
169
+ if(move_uploaded_file($_FILES['wpbackitup-zip']['tmp_name'], $restore_path)) {
170
+ // fwrite($fh, "Done!</li>");
171
+ } else {
172
+ // fwrite($fh, '</li><li class="error">Error: Your file could not be uploaded</li></ul>');
173
+ fclose($fh);
174
+ die();
175
+ }
176
+
177
+ //Unzip the uploaded restore file
178
+ fwrite($fh, '<status code="unzipping">In Progress</status>');
179
+
180
+ //include recurse_zip.php
181
+ include_once 'recurse_zip.php';
182
+ //unzip the upload
183
+ $zip = new ZipArchive;
184
+ $res = $zip->open(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
185
+ if ($res === TRUE) {
186
+ $zip->extractTo(WPBACKITUP_DIR_PATH .'/backups/');
187
+ $zip->close();
188
+ fwrite($fh, '<status code="unzipping">Done</status>');
189
+ } else {
190
+ fwrite($fh, '<status code="errorMessage">Error: Your restoration file could not be unzipped.</status>');
191
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
192
+ fclose($fh);
193
+ die();
194
+ }
195
+
196
+ //Identify the restoration directory
197
+ fwrite($fh, '<status code="validation">In Progress</status>');
198
+ if ( count( glob( WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) ) == 1 ) {
199
+ foreach( glob(WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) as $dir) {
200
+ $restoration_dir_path = $dir .'/';
201
+ }
202
+ }
203
+
204
+ //Validate the restoration
205
+ if(glob($restoration_dir_path .'backupsiteinfo.txt') ){
206
+ fwrite($fh, '<status code="validation">Done</status>');
207
+ } else {
208
+ fwrite($fh, '<status code="errorMessage">Error: Your zip file appears to be invalid. Please ensure you chose the correct zip file.</status>');
209
+ recursive_delete($restoration_dir_path);
210
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
211
+ fclose($fh);
212
+ die();
213
+ }
214
+ // Backup the current database
215
+ //
216
+ db_backup($restoration_dir_path);
217
+
218
+ //if there is a database dump to restore
219
+ if( glob($restoration_dir_path . "*.sql") ) {
220
+ //collect connection information from form
221
+ fwrite($fh, '<status code="database">In Progress</status>');
222
+ include_once WP_DIR_PATH .'/wp-config.php';
223
+ //Add user to DB in v1.0.5
224
+ $user_id = $_POST['user_id'];
225
+ //Connect to DB
226
+ //$output = db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc);
227
+ //13-4-13: John C Peden [mail@johncpeden.com] This seems to be erroneous, I've commented out.
228
+ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
229
+ if ( !$dbc ) {
230
+ fwrite($fh, '<status code="errorMessage">Error: Unable to connect to your current database: '. mysqli_connect_error() , '</status>');
231
+ recursive_delete($restoration_dir_path);
232
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
233
+ fclose($fh);
234
+ die();
235
+ }
236
+ //get siteurl
237
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='siteurl';";
238
+ if ($result = mysqli_query($dbc, $q1)) {
239
+ while ($row = mysqli_fetch_row($result)) {
240
+ $siteurl = $row[0];
241
+ }
242
+ mysqli_free_result($result);
243
+ } else {
244
+ fwrite($fh, '<status code="errorMessage">Error: Unable to get current site URL from database. Please try again.</status>');
245
+ recursive_delete($restoration_dir_path);
246
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
247
+ fclose($fh);
248
+ die();
249
+ }
250
+ //get homeurl
251
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='home';";
252
+ if ($result = mysqli_query($dbc, $q2)) {
253
+ while ($row = mysqli_fetch_row($result)) {
254
+ $homeurl = $row[0];
255
+ }
256
+ mysqli_free_result($result);
257
+ } else {
258
+ fwrite($fh, '<status code="errorMessage">Error: Unable to get current home URL from database. Please try again.</status>');
259
+ recursive_delete($restoration_dir_path);
260
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
261
+ fclose($fh);
262
+ die();
263
+ }
264
+ //get user login
265
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
266
+ if ($result = mysqli_query($dbc, $q3)) {
267
+ while ($row = mysqli_fetch_row($result)) {
268
+ $user_login = $row[0];
269
+ }
270
+ mysqli_free_result($result);
271
+ } else {
272
+ fwrite($fh, '<status code="errorMessage">Error: Unable to get current user ID from database. Please try again.</status>');
273
+ recursive_delete($restoration_dir_path);
274
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
275
+ fclose($fh);
276
+ die();
277
+ }
278
+ //get user pass
279
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
280
+ if ($result = mysqli_query($dbc, $q4)) {
281
+ while ($row = mysqli_fetch_row($result)) {
282
+ $user_pass = $row[0];
283
+ }
284
+ mysqli_free_result($result);
285
+ } else {
286
+ fwrite($fh, '<status code="errorMessage">Error: Unable to get current user password from database. Please try again.</status>');
287
+ recursive_delete($restoration_dir_path);
288
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
289
+ fclose($fh);
290
+ die();
291
+ }
292
+ //get user email
293
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
294
+ if ($result = mysqli_query($dbc, $q5)) {
295
+ while ($row = mysqli_fetch_row($result)) {
296
+ $user_email = $row[0];
297
+ }
298
+ mysqli_free_result($result);
299
+ } else {
300
+ fwrite($fh, '<status code="errorMessage">Error: Unable to get current user email from database. Please try again.</status>');
301
+ recursive_delete($restoration_dir_path);
302
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
303
+ fclose($fh);
304
+ die();
305
+ }
306
+ //Collect previous backup site url start
307
+ $import_siteinfo_lines = file($restoration_dir_path .'backupsiteinfo.txt');
308
+ $import_siteurl = trim($import_siteinfo_lines[0]);
309
+ $current_siteurl = trim($siteurl ,'/');
310
+ $import_table_prefix = $import_siteinfo_lines[1];
311
+ //import the database
312
+
313
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
314
+ fwrite($fh, '<status code="errorMessage">Error: Unable to get import your database. This may require importing the file manually.</status>');
315
+ recursive_delete($restoration_dir_path);
316
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
317
+ fclose($fh);
318
+ die();
319
+ }
320
+ //update the database
321
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value='" .$current_siteurl ."' WHERE option_name='siteurl'";
322
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value='" .$homeurl ."' WHERE option_name='home'";
323
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login='" .$user_login ."', user_pass='" .$user_pass ."', user_email='" .$user_email ."' WHERE ID='" .$user_id ."'";
324
+ if(!mysqli_query($dbc, $q6) ) {
325
+ fwrite($fh, '<status code="errorMessage">Error: Unable to update your current site URL value. This may require importing the file manually.</status>');
326
+ recursive_delete($restoration_dir_path);
327
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
328
+ fclose($fh);
329
+ die();
330
+ }
331
+ if(!mysqli_query($dbc, $q7) ) {
332
+ fwrite($fh, '<status code="errorMessage">Error: Unable to update your current home URL value. This may require importing the file manually.</status>');
333
+ recursive_delete($restoration_dir_path);
334
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
335
+ fclose($fh);
336
+ die();
337
+ }
338
+ if(!mysqli_query($dbc, $q8) ) {
339
+ fwrite($fh, '<status code="errorMessage">Error: Unable to update your user information. This may require importing the file manually.</status>');
340
+ recursive_delete($restoration_dir_path);
341
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
342
+ fclose($fh);
343
+ die();
344
+ }
345
+ fwrite($fh, '<status code="database">Done</status>');
346
+ } else {
347
+ fwrite($fh, '<status code="errorMessage">Error: Warning: Database not detected in import file.</status>');
348
+ }
349
+
350
+ //Disconnect
351
+ mysqli_close($dbc);
352
+ //Restore wp-content directories
353
+ fwrite($fh, '<status code="wpcontent">In Progress</status>');
354
+ if(!recursive_delete(WP_CONTENT_PATH, array( 'cgi-bin','.','..','._', WPBACKITUP_DIRNAME ))) {
355
+ fwrite($fh, '<status code="errorMessage">Error: Unable to remove existing wp-content directory for import. Please check your CHMOD settings in /wp-content/.</status>');
356
+ recursive_delete($restoration_dir_path);
357
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
358
+ fclose($fh);
359
+ die();
360
+ }
361
+ if(!create_dir(WP_CONTENT_PATH)) {
362
+ fwrite($fh, '<status code="errorMessage">Error: Unable to create new wp-content directory for import. Please check your CHMOD settings in /wp-content/.</status>');
363
+ recursive_delete($restoration_dir_path);
364
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
365
+ fclose($fh);
366
+ die();
367
+ }
368
+ if(recursive_copy($restoration_dir_path, WP_CONTENT_PATH .'/', array( 'cgi-bin', '.', '..','._', $restore_file_name, 'status.log', 'db-backup.sql', 'backupsiteinfo.txt')) ) {
369
+ fwrite($fh, '<status code="wpcontent">Done</status>');
370
+ } else {
371
+ fwrite($fh, '<status code="errorMessage">Error: Unable to import wp-content. Please try again.</status>');
372
+ recursive_delete($restoration_dir_path);
373
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
374
+ fclose($fh);
375
+ die();
376
+ }
377
+
378
+
379
+
380
+ //Delete the restoration directory
381
+ recursive_delete($restoration_dir_path);
382
+
383
+ //Delete zip
384
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
385
+
386
+ //close log file
387
+ fwrite($fh, '<status code="infomessage">Restoration Complete</status>');
388
+ fwrite($fh, '<status code="finalinfo">Finished</status>');
389
+ fclose($fh);
390
+
391
+ //End backup function
392
+ die();
tags/1.3.0/lib/includes/restore_from_path.php ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Restore Functions
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.3.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+
14
+ //define constants
15
+ if( !defined( 'WP_DIR_PATH' ) ) define( 'WP_DIR_PATH', dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) );
16
+
17
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
18
+
19
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', basename(WPBACKITUP_DIR_PATH) );
20
+
21
+ if( !defined( 'WP_CONTENT_PATH' ) ) define( 'WP_CONTENT_PATH', dirname( dirname( WPBACKITUP_DIR_PATH ) ) ) ;
22
+
23
+
24
+ //create log file
25
+ $log = WPBACKITUP_DIR_PATH .'/backups/status.log';
26
+ $fh = fopen($log, 'w') or die( "Can't open file" );
27
+ echo '<ul>';
28
+
29
+ // 15 minutes per image should be PLENTY
30
+ @set_time_limit(900);
31
+
32
+ //define create_dir function
33
+ if(!function_exists('create_dir')) {
34
+ function create_dir($dir) {
35
+ if( !is_dir($dir) ) {
36
+ @mkdir($dir, 0755);
37
+ }
38
+ return true;
39
+ }
40
+ }
41
+
42
+ //Define recusive_copy function
43
+ if(!function_exists('recursive_copy')) {
44
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
45
+ if( is_dir($dir) ) { //If the directory exists
46
+ if ($dh = opendir($dir) ) {
47
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
48
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
49
+ if (!is_dir( $dir.$file ) ) {
50
+ //Copy files to destination directory
51
+ //echo 'Copying ' .$dir .$file . ' to ' .$target_path .$file .'<br />';
52
+ $fsrc = fopen($dir .$file,'r');
53
+ $fdest = fopen($target_path .$file,'w+');
54
+ $len = stream_copy_to_stream($fsrc,$fdest);
55
+ fclose($fsrc);
56
+ fclose($fdest);
57
+ } else { //If $file is a directory
58
+ $destdir = $target_path .$file; //Modify the destination dir
59
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
60
+ @mkdir($destdir, 0755);
61
+ }
62
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
63
+ }
64
+ }
65
+ }
66
+ closedir($dh);
67
+ }
68
+ }
69
+ return true;
70
+ }
71
+ }
72
+
73
+ //Define recursive_delete function
74
+ if(!function_exists('recursive_delete')){
75
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
76
+ if( is_dir($dir) ){
77
+ if($dh = opendir($dir)) {
78
+ while( ($file = readdir($dh)) !== false ) {
79
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
80
+ if(!is_dir($dir .'/' .$file)) {
81
+ //echo 'Deleting ' .$dir .'/' .$file '<br />';
82
+ unlink($dir .'/' .$file);
83
+ } else {
84
+ recursive_delete($dir .'/' .$file, $ignore);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ @rmdir($dir);
90
+ closedir($dh);
91
+ }
92
+ return true;
93
+ }
94
+ }
95
+
96
+ //define db_import function
97
+ if(!function_exists('db_import')) {
98
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
99
+ global $wpdb;
100
+ $sql_files = glob($restoration_dir_path . "*.sql");
101
+ foreach($sql_files as $sql_file) {
102
+ $templine = ''; // Temporary variable, used to store current query
103
+ $lines = file($sql_file); // Read in entire file
104
+ foreach ($lines as $line) { // Loop through each line
105
+ if (substr($line, 0, 2) == '--' || $line == '') continue; // Skip it if it's a comment
106
+ $templine .= $line; // Add this line to the current segment
107
+ if (substr(trim($line), -1, 1) == ';') { // If it has a semicolon at the end, it's the end of the query
108
+ //replace imported site url with current site url
109
+ if( strstr( trim($templine), trim($import_siteurl) ) == TRUE ) //If import site url is found
110
+ $templine = str_replace( trim($import_siteurl), trim($current_siteurl), $templine ); // Replace import site url with current site url
111
+ //if the table prefixes are different, replace the imported site prefixes with the current prefixes
112
+ if ($table_prefix != $import_table_prefix) {
113
+ if( strstr( trim($templine), trim($import_table_prefix) ) == TRUE ) //If import table prefix is found
114
+ $templine = str_replace( trim($import_table_prefix), trim($table_prefix), $templine ); // Replace import site table prefix with current site table prefix
115
+ }
116
+ // Perform the query
117
+ if( mysqli_query($dbc, $templine) === FALSE)
118
+ print('Error performing query \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />');
119
+ $templine = ''; // Reset temp variable to empty
120
+ }
121
+ }
122
+ }
123
+ return true;
124
+ }
125
+ }
126
+
127
+ //Delete any zips in the upload directory first
128
+ foreach (glob(WPBACKITUP_DIR_PATH .'/backups/' .'*.zip') as $file) {
129
+ unlink($file);
130
+ }
131
+
132
+ //Move the uploaded zip to the restoration directory
133
+ $restore_file_name = $_GET['name'];
134
+
135
+ $orig_file_name = WP_DIR_PATH . "/wp-content/uploads/" . $_GET['name'];
136
+ if( $restore_file_name == '') {
137
+ echo '<li class="error">No file selected<li></ul>' ;
138
+ fclose($fh);
139
+ die();
140
+ } else {
141
+ echo '<li>Uploading restoration file...' ;
142
+ }
143
+
144
+ $restore_path = WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name;
145
+ if(copy($orig_file_name, $restore_path)) {
146
+ echo "Done!</li>";
147
+ } else {
148
+ echo '</li><li class="error">Your file could not be uploaded</li></ul>';
149
+ fclose($fh);
150
+ die();
151
+ }
152
+
153
+ //Unzip the uploaded restore file
154
+ echo "<li>Unzipping...";
155
+ //include recurse_zip.php
156
+ include_once 'recurse_zip.php';
157
+ //unzip the upload
158
+ $zip = new ZipArchive;
159
+ $res = $zip->open(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
160
+ if ($res === TRUE) {
161
+ $zip->extractTo(WPBACKITUP_DIR_PATH .'/backups/');
162
+ $zip->close();
163
+ echo 'Done!</li>';
164
+ } else {
165
+ echo '</li><li class="error">Your restoration file could not be unzipped.</li></ul>';
166
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
167
+ fclose($fh);
168
+ die();
169
+ }
170
+
171
+ //Identify the restoration directory
172
+ echo '<li>Validating zip...' ;
173
+ if ( count( glob( WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) ) == 1 ) {
174
+ foreach( glob(WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) as $dir) {
175
+ $restoration_dir_path = $dir .'/';
176
+ }
177
+ }
178
+
179
+ //Validate the restoration
180
+ if(glob($restoration_dir_path .'backupsiteinfo.txt') ){
181
+ echo 'Done!</li>';
182
+ } else {
183
+ echo '</li><li class="error">Your zip file appears to be invalid. Please ensure you chose the correct zip file.</li></ul>';
184
+ recursive_delete($restoration_dir_path);
185
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
186
+ fclose($fh);
187
+ die();
188
+ }
189
+
190
+ //Restore wp-content directories
191
+ echo "<li>Restoring wp-content directory..." ;
192
+ if(!recursive_delete(WP_CONTENT_PATH, array( 'cgi-bin','.','..','._', WPBACKITUP_DIRNAME ))) {
193
+ echo '</li><li class="error">Unable to remove existing wp-content directory for import. Please check your CHMOD settings in /wp-content/.</li></ul>';
194
+ recursive_delete($restoration_dir_path);
195
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
196
+ fclose($fh);
197
+ die();
198
+ }
199
+ if(!create_dir(WP_CONTENT_PATH)) {
200
+ echo '</li><li class="error">Unable to create new wp-content directory for import. Please check your CHMOD settings in /wp-content/.</li></ul>';
201
+ recursive_delete($restoration_dir_path);
202
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
203
+ fclose($fh);
204
+ die();
205
+ }
206
+ if(recursive_copy($restoration_dir_path, WP_CONTENT_PATH .'/', array( 'cgi-bin', '.', '..','._', $restore_file_name, 'status.log', 'db-backup.sql', 'backupsiteinfo.txt')) ) {
207
+ echo 'Done!</li>';
208
+ } else {
209
+ echo '</li><li class="error">Unable to import wp-content. Please try again.</li></ul>';
210
+ recursive_delete($restoration_dir_path);
211
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
212
+ fclose($fh);
213
+ die();
214
+ }
215
+
216
+ //if there is a database dump to restore
217
+ if( glob($restoration_dir_path . "*.sql") ) {
218
+ //collect connection information from form
219
+ echo "<li>Restoring database..." ;
220
+ include_once WP_DIR_PATH .'/wp-config.php';
221
+ //Add user to DB in v1.0.5
222
+ $user_id = $_GET['userid'];
223
+ //Connect to DB
224
+ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
225
+ if ( !$dbc ) {
226
+ echo '</li><li class="error">Unable to connect to your current database: " .mysqli_connect_error() ."</li></ul>';
227
+ recursive_delete($restoration_dir_path);
228
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
229
+ fclose($fh);
230
+ die();
231
+ }
232
+ //get siteurl
233
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='siteurl';";
234
+ if ($result = mysqli_query($dbc, $q1)) {
235
+ while ($row = mysqli_fetch_row($result)) {
236
+ $siteurl = $row[0];
237
+ }
238
+ mysqli_free_result($result);
239
+ } else {
240
+ echo '</li><li class="error">Unable to get current site URL from database. Please try again.</li></ul>';
241
+ recursive_delete($restoration_dir_path);
242
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
243
+ fclose($fh);
244
+ die();
245
+ }
246
+ //get homeurl
247
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='home';";
248
+ if ($result = mysqli_query($dbc, $q2)) {
249
+ while ($row = mysqli_fetch_row($result)) {
250
+ $homeurl = $row[0];
251
+ }
252
+ mysqli_free_result($result);
253
+ } else {
254
+ echo '</li><li class="error">Unable to get current home URL from database. Please try again.</li></ul>';
255
+ recursive_delete($restoration_dir_path);
256
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
257
+ fclose($fh);
258
+ die();
259
+ }
260
+ //get user login
261
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
262
+ if ($result = mysqli_query($dbc, $q3)) {
263
+ while ($row = mysqli_fetch_row($result)) {
264
+ $user_login = $row[0];
265
+ }
266
+ mysqli_free_result($result);
267
+ } else {
268
+ echo '</li><li class="error">Unable to get current user ID from database. Please try again.</li></ul>';
269
+ recursive_delete($restoration_dir_path);
270
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
271
+ fclose($fh);
272
+ die();
273
+ }
274
+ //get user pass
275
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
276
+ if ($result = mysqli_query($dbc, $q4)) {
277
+ while ($row = mysqli_fetch_row($result)) {
278
+ $user_pass = $row[0];
279
+ }
280
+ mysqli_free_result($result);
281
+ } else {
282
+ echo '</li><li class="error">Unable to get current user password from database. Please try again.</li></ul>';
283
+ recursive_delete($restoration_dir_path);
284
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
285
+ fclose($fh);
286
+ die();
287
+ }
288
+ //get user email
289
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
290
+ if ($result = mysqli_query($dbc, $q5)) {
291
+ while ($row = mysqli_fetch_row($result)) {
292
+ $user_email = $row[0];
293
+ }
294
+ mysqli_free_result($result);
295
+ } else {
296
+ echo '</li><li class="error">Unable to get current user email from database. Please try again.</li></ul>';
297
+ recursive_delete($restoration_dir_path);
298
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
299
+ fclose($fh);
300
+ die();
301
+ }
302
+ //Collect previous backup site url start
303
+ $import_siteinfo_lines = file($restoration_dir_path .'backupsiteinfo.txt');
304
+ $import_siteurl = trim($import_siteinfo_lines[0]);
305
+ $current_siteurl = trim($siteurl ,'/');
306
+ $import_table_prefix = $import_siteinfo_lines[1];
307
+ //import the database
308
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
309
+ echo '</li><li class="error">Unable to get import your database. This may require importing the file manually.</li></ul>';
310
+ recursive_delete($restoration_dir_path);
311
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
312
+ fclose($fh);
313
+ die();
314
+ }
315
+ //update the database
316
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value='" .$current_siteurl ."' WHERE option_name='siteurl'";
317
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value='" .$homeurl ."' WHERE option_name='home'";
318
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login='" .$user_login ."', user_pass='" .$user_pass ."', user_email='" .$user_email ."' WHERE ID='" .$user_id ."'";
319
+ if(!mysqli_query($dbc, $q6) ) {
320
+ echo '</li><li class="error">Unable to update your current site URL value. This may require importing the file manually.</li></ul>';
321
+ recursive_delete($restoration_dir_path);
322
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
323
+ fclose($fh);
324
+ die();
325
+ }
326
+ if(!mysqli_query($dbc, $q7) ) {
327
+ echo '</li><li class="error">Unable to update your current home URL value. This may require importing the file manually.</li></ul>';
328
+ recursive_delete($restoration_dir_path);
329
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
330
+ fclose($fh);
331
+ die();
332
+ }
333
+ if(!mysqli_query($dbc, $q8) ) {
334
+ echo '</li><li class="error">Unable to update your user information. This may require importing the file manually.</li></ul>';
335
+ recursive_delete($restoration_dir_path);
336
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
337
+ fclose($fh);
338
+ die();
339
+ }
340
+ echo 'Done!</li>';
341
+ } else {
342
+ echo '<li class="error">Warning: Database not detected in import file.</li>';
343
+ }
344
+
345
+ //Disconnect
346
+ mysqli_close($dbc);
347
+
348
+ //Delete the restoration directory
349
+ recursive_delete($restoration_dir_path);
350
+
351
+ //Delete zip
352
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
353
+
354
+ //close log file
355
+ echo '<li>Restoration complete. Please refresh the page.</li>';
356
+ echo '</ul>';
357
+ fclose($fh);
358
+
359
+ //End backup function
360
+ die();
tags/1.3.0/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>.
tags/1.3.0/logs/status.log ADDED
@@ -0,0 +1 @@
 
1
+ <status code="upload">Done</status><status code="copyfiles">In Progress</status><status code="unzipping">In Progress</status><status code="unzipping">Done</status><status code="validation">In Progress</status><status code="validation">Done</status><status code="database">In Progress</status><status code="database">Done</status><status code="wpcontent">In Progress</status><status code="wpcontent">Done</status><status code="infomessage">Restoration Complete</status><status code="finalinfo">Finished</status>
tags/1.3.0/readme.txt ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WP Backitup ===
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.2
6
+ Tested up to: 3.5.1
7
+ Stable tag: 1.3.0
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 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? <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="WP Backitup">WP Backitup Pro</a> offers all the features of <a href="http://wordpress.org/extend/plugins/wp-backitup/" title="WP Backitup Lite">WP Backitup</a> but allows you to import your backup zips in seconds, right from the Wordpress Dashboard.
23
+
24
+ = Easy To Install and Use =
25
+ Simply install the plugin directly to Wordpress and browse to the new menu 'WP Backitup'. 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).
26
+
27
+ = More questions? =
28
+ Why not head over to the <a href="http://www.wpbackitup.com/" title="WP Backitup">WP Backitup site</a>?
29
+
30
+ == Installation ==
31
+
32
+ Installation of the plugin is straightforward:
33
+
34
+ 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
35
+ 1. Activate the plugin.
36
+ 1. A new menu called 'WP Backitup' will be added to your toolbar.
37
+ 1. Click 'WP Backitup' to access the backup/restore interface.
38
+
39
+ == Frequently Asked Questions ==
40
+
41
+ = Can I manually restore my backup zips? =
42
+ 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.
43
+
44
+ = Is there an easier way to restore my backup zips? =
45
+ Yes, purchase and download <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="WP Backitup">WP Backitup</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
46
+
47
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
48
+ Yes.
49
+
50
+ = Will WP Backitup work on Windows hosting? =
51
+ Yes.
52
+
53
+ = Are you going to be makinggress bars both for backing up and restoring with this plugin? =
54
+ It is likely this will feature in a new version of WP Backitup.
55
+
56
+ = Can this plugin back to Amazon S3? =
57
+ This will feature in an upcoming version of WP Backitup.
58
+
59
+ = Is there an auto back up schedule feature? =
60
+ It is likely this will feature in a new version of WP Backitup.
61
+
62
+ = Will the plugin work with Wordpres version x.x? =
63
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
64
+
65
+ = Can this backup one version of WordPress to a different version? =
66
+ No. It is absolutely critical that your WordPress versions are exactly the same.
67
+
68
+ = Will WP Backitup work on WordPress Multisite? =
69
+ WP Backitup cannot yet backup/restore entire networks but it is compatible with WPMS sites.
70
+
71
+ = Does the plugin copy the database details as well? =
72
+ Yes, a database dump is created with each backup.
73
+
74
+ = 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? =
75
+ Yes. WP Backitup can be used to create a good starting point for any and all sites you work on.
76
+
77
+ = Does WP Backitup need to be installed? =
78
+ 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.
79
+
80
+ = Does WP Backitup backup plugins settings or just the plugins themselves? =
81
+ WP Backitup creates a database dump and a backup of all your themes, plugins and uploads.
82
+
83
+ = Do you have any ideas about how large a blog is too big for WP Backitup to handle? =
84
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
85
+
86
+ = Do you do regularly update thisduct to match with WP version updates? =
87
+ Yes.
88
+
89
+ == Screenshots ==
90
+ 1. Once activated, the plugin loads a new menu into your toolbar.
91
+ 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on itsgress.
92
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
93
+
94
+ == Changelog ==
95
+
96
+ = 1.3.0 =
97
+ Recommended upgrade: Amalgameted lite and pro versions of the plugin
98
+
99
+ = 1.2.2 =
100
+ Major updates to improve plugin performance and stability.
101
+
102
+ = 1.2.1 =
103
+ Minor updates to plugin functionality.
104
+
105
+ = 1.2.0 =
106
+ Brought versioning inline with WP Backitup Lite. Fixed incorrecy message on restore interface. Fixed restorationcess.
107
+
108
+ = 1.1.0 =
109
+ Backup from mysqldump, restore from mysql command line, restore functionality from uploaded files, file size limit check according to server before uploads, setInterval termination after operation, status update as the task completes using XML.
110
+
111
+ = 1.0.9 =
112
+ Introduced mysqldump for backup and shell exec for copy/delete operations.
113
+
114
+ = 1.0.8 =
115
+ Added ability to restore from server.
116
+
117
+ = 1.0.7 =
118
+ Improved auto-update facility and plugin stability.
119
+
120
+ = 1.0.6 =
121
+ Fixed critical issues the auto-upgradecess.
122
+
123
+ = 1.0.5 =
124
+ Fixed critical issues the auto-upgradecess.
125
+
126
+ = 1.0.4 =
127
+ Fixed issues with the restorationcess.
128
+
129
+ = 1.0.3 =
130
+ Fixed the auto-update engine and license key activation system.
131
+
132
+ = 1.0.2 =
133
+ Minor bugs patched for auto-update engine.
134
+
135
+ = 1.0.1 =
136
+ WP Backitup integrated with licensing and auto-update engine.
137
+
138
+ = 1.0.0 =
139
+ Initial version of the plugin released.
140
+
141
+ == Upgrade Notice ==
142
+
143
+ = 1.3.0 =
144
+ Recommended upgrade: Amalgameted lite and pro versions of the plugin
145
+
146
+ = 1.2.2 =
147
+ Critical upgrade: Major overhaul of plugin structure
148
+
149
+ = 1.2.1 =
150
+ Recommended upgrade: Minor update to plugin structure.
151
+
152
+ = 1.2.0 =
153
+ Recommended upgrade: Minor update to plugin structure.
154
+
155
+ = 1.1.0 =
156
+ Critical upgrade: Improved plugin performance.
157
+
158
+ = 1.0.9 =
159
+ Recommended upgrade: Improved reliability and performance.
160
+
161
+ = 1.0.8 =
162
+ Recommended upgrade: Improved functionality
163
+
164
+ = 1.0.7 =
165
+ Critical upgrade: Fixed major bugs with auto-upgradecess.
166
+
167
+ = 1.0.6 =
168
+ Critical upgrade: Fixed major bugs with auto-upgradecess.
169
+
170
+ = 1.0.5 =
171
+ Critical upgrade: Fixed major bugs with auto-upgradecess.
172
+
173
+ = 1.0.4 =
174
+ Critical upgrade: Fixed major bugs with restorationcess.
175
+
176
+ = 1.0.3 =
177
+ Critical upgrade: Patched auto-update engine.
178
+
179
+ = 1.0.2 =
180
+ Non-critical upgrade: Patched auto-update engine.
181
+
182
+ = 1.0.1 =
183
+ Recommended upgrade: Added the licensing and auto-update engine.
184
+
185
+ = 1.0.0 =
186
+ Initial version of the plugin.
tags/1.3.0/views/options.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <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>
3
+ <h2><?php echo $page_title; ?></h2>
4
+ <div id="content">
5
+ <h3><?php _e('Backup', $namespace );?></h3>
6
+ <p><?php _e('Create a backup file of this site\'s content and settings.', $namespace ) ;?></p>
7
+ <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>
8
+ <h3><?php _e('Download', $namespace );?></h3>
9
+ <p id="download-link"></p>
10
+
11
+ <!--Disable restoration form if the user has not activated-->
12
+ <?php $status = $this->get_option( 'status' );
13
+ if( $status !== false && $status == 'valid' ) { ?>
14
+ <h3><?php _e('Restore', $namespace );?></h3>
15
+ <iframe id="upload_target" name="upload_target" src=""></iframe>
16
+ <p><?php _e('Restore a WP Backitup zip file and overwrite this site\'s content, themes, plugins, uploads and settings.', $namespace );?></p>
17
+ <?php $max_upload = (int)(ini_get('upload_max_filesize'));
18
+ $max_post = (int)(ini_get('post_max_size'));
19
+ $memory_limit = (int)(ini_get('memory_limit'));
20
+ $upload_mb = min($max_upload, $max_post, $memory_limit); ?>
21
+ <p><?php _e( 'The maximum filesize you can upload is ', $namespace );
22
+ echo $upload_mb .'MB.'; ?>
23
+ </p>
24
+ <form id="restore-form" method="post" enctype="multipart/form-data" action="<?php echo WPBACKITUP_URLPATH .'/lib/includes/restore.php'; ?>">
25
+ <?php global $current_user; ?>
26
+ <input type="hidden" name="user_id" value="<?php echo $current_user->ID; ?>" />
27
+ <input type="hidden" name="maximum" id="maximum" value="<?php echo $upload_mb; ?>" />
28
+ <p><input name="wpbackitup-zip" id="wpbackitup-zip" type="file" /></p>
29
+ <p><input type="submit" class="restore-button button-primary" name="restore" value="<?php _e( "Restore", $namespace ) ?>" /><img class="restore-icon status-icon" src="<?php echo WPBACKITUP_URLPATH. "/images/loader.gif"; ?>" height="16" width="16" /></p>
30
+ </form>
31
+ <?php } ?>
32
+ <!--End of restoration form-->
33
+
34
+ <h3><?php _e('Status', $namespace );?></h3>
35
+ <p><div id="status"><?php _e('Nothing to report', $namespace );?></div></p>
36
+ <?php if (site_url() == 'http://localhost/wpbackitup') {
37
+ echo '<p><div id="php">PHP messages here</div></p>';
38
+ } ?>
39
+ </div>
40
+ <div id="sidebar">
41
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
42
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
43
+ <div class="widget">
44
+ <h3 class="promo"><?php _e('License Key', $namespace ); ?></h3>
45
+ <?php $license = $this->get_option( 'license_key' );
46
+ $status = $this->get_option( 'status' );
47
+ if( $status !== false && $status == 'valid' ) { ?>
48
+ <p><?php _e('Pro features and auto-updates enabled.', $namespace ); ?></p>
49
+ <?php } else { ?>
50
+ <p><?php _e('Activate auto-restore and auto-updates by entering your license key.', $namespace ); ?></p>
51
+ <?php } ?>
52
+ <p><input type="text" name="data[license_key]" id="license_key" value="<?php esc_attr_e( $license ); ?>">
53
+ <?php if( false !== $license ) {
54
+ if( $status !== false && $status == 'valid' ) { ?>
55
+ <span style="color:green;"><?php _e('Active', $namespace); ?></span></p>
56
+ <p class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e( "Update", $namespace ) ?>" /></p>
57
+ <?php } else { ?>
58
+ <span style="color:red;"><?php _e('Inactive', $namespace); ?></span></p>
59
+ <p class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e( "Activate", $namespace ) ?>" /></p>
60
+ <p><a href="http://www.wpbackitup.com/wp-backitup-pro"><?php _e('Purchase a license key', $namespace); ?></a></p>
61
+ <?php }
62
+ } ?>
63
+ </div>
64
+ <div class="widget">
65
+ <?php if( $status !== false && $status == 'valid' ) {
66
+ $support_anchor = __('WP Backitup support system',$namespace);
67
+ $support_url = 'http://www.wpbackitup.com/support/';
68
+ } else {
69
+ $support_anchor = __('support system',$namespace);
70
+ $support_url = 'http://wordpress.org/support/plugin/wp-backitup';
71
+ } ?>
72
+ <h3 class="promo"><?php _e('Need Help?', $namespace ); ?></h3>
73
+ <p><?php _e('Access the',$namespace); ?> <a href="<?php echo $support_url; ?>"><?php echo $support_anchor; ?></a>.</p>
74
+
75
+ </div>
76
+ <div class="widget">
77
+ <h3 class="promo"><?php _e('Spread the Word', $namespace ); ?></h3>
78
+ <p><a href="http://wordpress.org/extend/plugins/wp-backitup/"><?php _e('Rate WP Backitup', $namespace ); ?> 5&#9733;</a></p>
79
+ </div>
80
+ <div class="widget">
81
+ <h3 class="promo">Presstrends</h3>
82
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label><?php _e('Enable', $namespace ); ?></label></p>
83
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label><?php _e('Disable', $namespace ); ?></label></p>
84
+ <p><?php _e('Help to improve Easy Webtrends by enabling', $namespace ); ?> <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
85
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
86
+ </div>
87
+ </form>
88
+ </div>
89
+ </div>
tags/1.4.0/css/admin.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.4.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ /* Global */
9
+
10
+ .error { color: #ff0000;}
11
+
12
+ p {line-height: 1.4em;}
13
+
14
+ td {padding: 0;}
15
+
16
+ h3 {
17
+ margin: 0;
18
+ padding: 1em 0 0 0;
19
+ }
20
+
21
+ iframe {
22
+ height: 0;
23
+ margin: 0;
24
+ padding: 0;
25
+ position: absolute;
26
+ top: 0;
27
+ right: 0;
28
+ width: 0;
29
+ z-index: -1;
30
+ }
31
+
32
+ .submit { padding: 0; }
33
+
34
+ /* Content */
35
+ #content {
36
+ float: left;
37
+ width: 65%;
38
+ }
39
+
40
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
41
+
42
+ .status-icon {
43
+ display: inline;
44
+ height: 16px;
45
+ position: relative;
46
+ top: 3px;
47
+ left: 5px;
48
+ visibility: hidden;
49
+ width: 16px;
50
+ }
51
+
52
+ /** Status Reporting **/
53
+ .backup-status, .backup-status span, .backup-errors, .backup-errors span, .restore-status, .restore-status span, .restore-errors, .restore-errors span {
54
+ display: none;
55
+ }
56
+
57
+ /* Sidebar */
58
+ #sidebar {
59
+ float: right;
60
+ width: 30%;
61
+ }
62
+
63
+ .widget {padding: 1em;}
tags/1.4.0/images/icon.png ADDED
Binary file
tags/1.4.0/images/icon32.png ADDED
Binary file
tags/1.4.0/images/loader.gif ADDED
Binary file
tags/1.4.0/index.php ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @global object $wpdb
8
+ *
9
+ * @author jcpeden
10
+ * @version 1.4.0
11
+ */
12
+ /*
13
+ Plugin Name: WP Backitup
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.4.0
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
+ // Include constants file
37
+ include_once dirname( __FILE__ ) . '/lib/constants.php';
38
+
39
+ class WPBackitup {
40
+ var $namespace = "wp-backitup";
41
+ var $friendly_name = WPBACKITUP_ITEM_NAME;
42
+ var $version = WPBACKITUP_VERSION;
43
+
44
+ // Default plugin options
45
+ var $defaults = array(
46
+ 'presstrends' => "enabled",
47
+ 'license_key' => "cat",
48
+ 'status' => "inactive"
49
+ );
50
+
51
+ /**
52
+ * Instantiation construction
53
+ *
54
+ * @uses add_action()
55
+ * @uses WPBackitup::wp_register_scripts()
56
+ * @uses WPBackitup::wp_register_styles()
57
+ */
58
+ function __construct() {
59
+ // Name of the option_value to store plugin options in
60
+ $this->option_name = '_' . $this->namespace . '--options';
61
+
62
+ // Load all library files used by this plugin
63
+ $libs = glob( WPBACKITUP_DIRNAME . '/lib/*.php' );
64
+ foreach( $libs as $lib ) {
65
+ include_once $lib;
66
+ }
67
+
68
+ /**
69
+ * Make this plugin available for translation.
70
+ * Translations can be added to the /languages/ directory.
71
+ */
72
+ load_theme_textdomain( $this->namespace, WPBACKITUP_DIRNAME . '/languages' );
73
+
74
+ // Add all action, filter and shortcode hooks
75
+ $this->_add_hooks();
76
+ }
77
+
78
+ /**
79
+ * Add in various hooks
80
+ */
81
+ private function _add_hooks() {
82
+ // Options page for configuration
83
+ add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
84
+ // Route requests for form processing
85
+ add_action( 'init', array( &$this, 'route' ) );
86
+
87
+ // Add a settings link next to the "Deactivate" link on the plugin listing page
88
+ add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
89
+
90
+ // Register all JavaScripts for this plugin
91
+ add_action( 'init', array( &$this, 'wp_register_scripts' ), 1 );
92
+ // Register all Stylesheets for this plugin
93
+ add_action( 'init', array( &$this, 'wp_register_styles' ), 1 );
94
+ }
95
+
96
+ /**
97
+ * Process update page form submissions and validate license key
98
+ *
99
+ * @uses WPBackitup::sanitize()
100
+ * @uses wp_redirect()
101
+ * @uses wp_verify_nonce()
102
+ * @uses wp_remote_get()
103
+ * @uses add_query_arg()
104
+ * @uses is_wp_error()
105
+ * @uses wp_remote_retrieve_body()
106
+ * @uses update_option()
107
+ * @uses wp_safe_redirect()
108
+ */
109
+ private function _admin_options_update() {
110
+
111
+ // Verify submission for processing using wp_nonce
112
+ if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-update-options" ) ) {
113
+ //create data array
114
+ $data = array();
115
+
116
+ /**
117
+ * Loop through each POSTed value and sanitize it to protect against malicious code. Please
118
+ * note that rich text (or full HTML fields) should not be processed by this function and
119
+ * dealt with directly.
120
+ */
121
+ foreach( $_POST['data'] as $key => $val ) {
122
+ $data[$key] = $this->_sanitize( $val );
123
+ }
124
+
125
+ //check license status and try to activate if invalid
126
+ $license = trim ( $data['license_key'] );
127
+
128
+ // Check license
129
+ $api_params = array(
130
+ 'edd_action' => 'check_license',
131
+ 'license' => $license,
132
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME )
133
+ );
134
+
135
+ // Call the custom API
136
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
137
+
138
+ // make sure the response came back okay
139
+ if ( is_wp_error( $response ) )
140
+ return false;
141
+
142
+ // decode the license data
143
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
144
+
145
+ if( $license_data->license != 'valid' ) {
146
+ // Try to activate license (process is almost identical to check_license)
147
+ $api_params = array(
148
+ 'edd_action'=> 'activate_license',
149
+ 'license' => $license,
150
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME ) // the name of our product in EDD
151
+ );
152
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ) );
153
+ if ( is_wp_error( $response ) )
154
+ return false;
155
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
156
+ }
157
+
158
+ /* Manually define status value */
159
+ $data['status'] = $license_data->license;
160
+
161
+ // Update the options value with the data submitted
162
+ update_option( $this->option_name, $data );
163
+
164
+ // Redirect back to the options page with the message flag to show the saved message
165
+ wp_safe_redirect( $_REQUEST['_wp_http_referer'] . '&update=1' );
166
+ exit;
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Sanitize data
172
+ *
173
+ * @param mixed $str The data to be sanitized
174
+ *
175
+ * @uses wp_kses()
176
+ *
177
+ * @return mixed The sanitized version of the data
178
+ */
179
+ private function _sanitize( $str ) {
180
+ if ( !function_exists( 'wp_kses' ) ) {
181
+ include_once ABSPATH . 'wp-includes/kses.php';
182
+ }
183
+ global $allowedposttags;
184
+ global $allowedprotocols;
185
+
186
+ if ( is_string( $str ) ) {
187
+ $str = wp_kses( $str, $allowedposttags, $allowedprotocols );
188
+ } elseif( is_array( $str ) ) {
189
+ $arr = array();
190
+ foreach( (array) $str as $key => $val ) {
191
+ $arr[$key] = $this->_sanitize( $val );
192
+ }
193
+ $str = $arr;
194
+ }
195
+
196
+ return $str;
197
+ }
198
+
199
+ /**
200
+ * Hook into register_activation_hook action
201
+ */
202
+ static function activate() {
203
+ // Do activation actions
204
+ }
205
+
206
+ /**
207
+ * Define the admin menu options for this plugin
208
+ *
209
+ * @uses add_action()
210
+ * @uses add_options_page()
211
+ */
212
+ function admin_menu() {
213
+ $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);
214
+
215
+ // Add print scripts and styles action based off the option page hook
216
+ add_action( 'admin_print_scripts-' . $page_hook, array( &$this, 'admin_print_scripts' ) );
217
+ add_action( 'admin_print_styles-' . $page_hook, array( &$this, 'admin_print_styles' ) );
218
+ }
219
+
220
+
221
+ /**
222
+ * The admin section options page rendering method
223
+ *
224
+ * @uses current_user_can()
225
+ * @uses wp_die()
226
+ */
227
+ function admin_options_page() {
228
+ if( !current_user_can( 'manage_options' ) ) {
229
+ wp_die( 'You do not have sufficient permissions to access this page' );
230
+ }
231
+
232
+ $page_title = $this->friendly_name . ' Options';
233
+ $namespace = $this->namespace;
234
+
235
+ include WPBACKITUP_DIRNAME . "/views/options.php";
236
+ }
237
+
238
+ /**
239
+ * Load JavaScript for the admin options page
240
+ *
241
+ * @uses wp_enqueue_script()
242
+ */
243
+ function admin_print_scripts() {
244
+ wp_enqueue_script( "{$this->namespace}-admin" );
245
+ wp_enqueue_script( "{$this->namespace}-ajaxfileupload" );
246
+ }
247
+
248
+ /**
249
+ * Load Stylesheet for the admin options page
250
+ *
251
+ * @uses wp_enqueue_style()
252
+ */
253
+ function admin_print_styles() {
254
+ wp_enqueue_style( "{$this->namespace}-admin" );
255
+ }
256
+
257
+ /**
258
+ * Hook into register_deactivation_hook action
259
+ *
260
+ * Put code here that needs to happen when your plugin is deactivated
261
+ */
262
+ static function deactivate() {
263
+ // Do deactivation actions
264
+ }
265
+
266
+ /**
267
+ * Retrieve the stored plugin option or the default if no user specified value is defined
268
+ *
269
+ * @param string $option_name The name of the TrialAccount option you wish to retrieve
270
+ *
271
+ * @uses get_option()
272
+ *
273
+ * @return mixed Returns the option value or false(boolean) if the option is not found
274
+ */
275
+ function get_option( $option_name ) {
276
+ // Load option values if they haven't been loaded already
277
+ if( !isset( $this->options ) || empty( $this->options ) ) {
278
+ $this->options = get_option( $this->option_name, $this->defaults );
279
+ }
280
+
281
+ if( isset( $this->options[$option_name] ) ) {
282
+ return $this->options[$option_name]; // Return user's specified option value
283
+ } elseif( isset( $this->defaults[$option_name] ) ) {
284
+ return $this->defaults[$option_name]; // Return default option value
285
+ }
286
+ return false;
287
+ }
288
+
289
+ /**
290
+ * Initialization function to hook into the WordPress init action
291
+ *
292
+ * Instantiates the class on a global variable and sets the class, actions
293
+ * etc. up for use.
294
+ */
295
+ static function instance() {
296
+ global $WPBackitup;
297
+
298
+ // Only instantiate the Class if it hasn't been already
299
+ if( !isset( $WPBackitup ) ) $WPBackitup = new WPBackitup();
300
+ }
301
+
302
+ /**
303
+ * Hook into plugin_action_links filter
304
+ *
305
+ * @param object $links An array of the links to show, this will be the modified variable
306
+ * @param string $file The name of the file being processed in the filter
307
+ */
308
+ function plugin_action_links( $links, $file ) {
309
+ if( $file == plugin_basename( WPBACKITUP_DIRNAME . '/' . basename( __FILE__ ) ) ) {
310
+ $old_links = $links;
311
+ $new_links = array(
312
+ "settings" => '<a href="admin.php?page=' . $this->namespace . '">' . __( 'Manage' ) . '</a>'
313
+ );
314
+ $links = array_merge( $new_links, $old_links );
315
+ }
316
+
317
+ return $links;
318
+ }
319
+
320
+ /**
321
+ * Route the user based off of environment conditions
322
+ *
323
+ * @uses WPBackitup::_admin_options_update()
324
+ */
325
+ function route() {
326
+ $uri = $_SERVER['REQUEST_URI'];
327
+ $protocol = isset( $_SERVER['HTTPS'] ) ? 'https' : 'http';
328
+ $hostname = $_SERVER['HTTP_HOST'];
329
+ $url = "{$protocol}://{$hostname}{$uri}";
330
+ $is_post = (bool) ( strtoupper( $_SERVER['REQUEST_METHOD'] ) == "POST" );
331
+
332
+ // Check if a nonce was passed in the request
333
+ if( isset( $_REQUEST['_wpnonce'] ) ) {
334
+ $nonce = $_REQUEST['_wpnonce'];
335
+
336
+ // Handle POST requests
337
+ if( $is_post ) {
338
+ if( wp_verify_nonce( $nonce, "{$this->namespace}-update-options" ) ) {
339
+ $this->_admin_options_update();
340
+ }
341
+ }
342
+ // Handle GET requests
343
+ else {
344
+
345
+ }
346
+ }
347
+ }
348
+
349
+ /**
350
+ * Register scripts used by this plugin for enqueuing elsewhere
351
+ *
352
+ * @uses wp_register_script()
353
+ */
354
+ function wp_register_scripts() {
355
+ // Admin JavaScript
356
+ wp_register_script( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/js/admin.js", array( 'jquery' ), $this->version, true );
357
+ wp_register_script( "{$this->namespace}-ajaxfileupload", WPBACKITUP_URLPATH . "/js/ajaxfileupload.js", array( 'jquery' ), $this->version, true );
358
+ }
359
+
360
+ /**
361
+ * Register styles used by this plugin for enqueuing elsewhere
362
+ *
363
+ * @uses wp_register_style()
364
+ */
365
+ function wp_register_styles() {
366
+ // Admin Stylesheet
367
+ wp_register_style( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/css/admin.css", array(), $this->version, 'screen' );
368
+ }
369
+ }
370
+ if( !isset( $WPBackitup ) ) {
371
+ WPBackitup::instance();
372
+ }
373
+
374
+ register_activation_hook( __FILE__, array( 'WPBackitup', 'activate' ) );
375
+ register_deactivation_hook( __FILE__, array( 'WPBackitup', 'deactivate' ) );
tags/1.4.0/js/admin.js ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.4.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ (function($){
9
+ /* define backup variables */
10
+ var backup = {
11
+ action: 'backup',
12
+ beforeSend: function() {
13
+ /* display processing icon */
14
+ $('.backup-icon').css('visibility','visible');
15
+
16
+ /* hide default message, restore status and restore errors */
17
+ $('.default-status, .restore-status, .restore-errors').hide();
18
+
19
+ /* show backup status, backup errors */
20
+ $('.backup-status, .backup-errors').toggle();
21
+
22
+ window.intervalDefine = setInterval(display_log, 1000);
23
+ }
24
+ };
25
+
26
+ /* define download variables */
27
+ var download = {
28
+ action: 'download'
29
+ };
30
+
31
+ /* define logreader variables */
32
+ var logreader = {
33
+ action: 'logreader'
34
+ };
35
+
36
+ /* define logreader function */
37
+ function display_log() {
38
+ $.post(ajaxurl, logreader, function(response) {
39
+
40
+ /* Get response from log reader */
41
+ var xmlObj = $(response);
42
+
43
+ /* For each response */
44
+ xmlObj.each(function() {
45
+
46
+ /* Select correct status */
47
+ var attributename = "." + $(this).attr('class');
48
+
49
+ if ( $(this).html() == 0 ) {
50
+
51
+ /* If status returns 0, display 'Failed' */
52
+ $(attributename).find(".fail").fadeIn(500);
53
+
54
+ } else {
55
+
56
+ /* If status returns 1, display 'Done' or show detailed message */
57
+ $(attributename).find(".status").fadeIn(500);
58
+
59
+ }
60
+
61
+ /* If is final or error */
62
+ if($(this).attr('code') == "finalinfo") {
63
+
64
+ /* Stop logreader */
65
+ clearInterval(window.intervalDefine);
66
+ }
67
+ });
68
+ });
69
+ }
70
+
71
+ /* define download function */
72
+ function download_link() {
73
+ $.post(ajaxurl, download, function(response) {
74
+ $("#download-link").html(response);
75
+ });
76
+ }
77
+
78
+ /* execute download (on page load/refresh) */
79
+ download_link();
80
+
81
+ /* execute backup on button click */
82
+ $(".backup-button").click( function() {
83
+ $.post(ajaxurl, backup, function(response) {
84
+ download_link();
85
+ clearInterval(display_log);
86
+
87
+ /* fade out status icon */
88
+ $('.backup-icon').fadeOut(1000);
89
+
90
+ /* Return PHP messages, used for development */
91
+ $("#php").html(response);
92
+ });
93
+ })
94
+
95
+ /* execute restore on button click */
96
+ $("#restore-form").submit(function() {
97
+
98
+ /* display processing icon */
99
+ $('.restore-icon').css('visibility','visible');
100
+
101
+ /* hide default message, backup status and backup errors */
102
+ $('.default-status, .backup-status, .backup-errors').hide();
103
+
104
+ /* show restore status messages */
105
+ $('.restore-status, .restore-errors').toggle();
106
+
107
+ window.intervalDefine = setInterval(display_log, 1000);
108
+ $("#restore-form").attr("target","upload_target");
109
+ $("#upload_target").load(function (){
110
+ importRestore();
111
+ });
112
+ });
113
+
114
+ /* define importRestore function */
115
+ function importRestore() {
116
+
117
+ /* process upload */
118
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML;
119
+
120
+ /* Return PHP messages, used for development */
121
+ $("#php").html(ret);
122
+ clearInterval(display_log);
123
+ $('.restore-icon').fadeOut(1000);
124
+ }
125
+ })(jQuery);
tags/1.4.0/js/ajaxfileupload.js ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Ajax File Upload
3
+ *
4
+ * @version 1.4.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ jQuery.extend({
9
+ createUploadIframe: function(id, uri)
10
+ {
11
+ //create frame
12
+ var frameId = 'jUploadFrame' + id;
13
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
14
+ if(window.ActiveXObject)
15
+ {
16
+ if(typeof uri== 'boolean'){
17
+ iframeHtml += ' src="' + 'javascript:false' + '"';
18
+
19
+ }
20
+ else if(typeof uri== 'string'){
21
+ iframeHtml += ' src="' + uri + '"';
22
+
23
+ }
24
+ }
25
+ iframeHtml += ' />';
26
+ jQuery(iframeHtml).appendTo(document.body);
27
+
28
+ return jQuery('#' + frameId).get(0);
29
+ },
30
+ createUploadForm: function(id, fileElementId, data)
31
+ {
32
+ //create form
33
+ var formId = 'jUploadForm' + id;
34
+ var fileId = 'jUploadFile' + id;
35
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
36
+ if(data)
37
+ {
38
+ for(var i in data)
39
+ {
40
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
41
+ }
42
+ }
43
+ var oldElement = jQuery('#' + fileElementId);
44
+ var newElement = jQuery(oldElement).clone();
45
+ jQuery(oldElement).attr('id', fileId);
46
+ jQuery(oldElement).before(newElement);
47
+ jQuery(oldElement).appendTo(form);
48
+
49
+
50
+
51
+ //set attributes
52
+ jQuery(form).css('position', 'absolute');
53
+ jQuery(form).css('top', '-1200px');
54
+ jQuery(form).css('left', '-1200px');
55
+ jQuery(form).appendTo('body');
56
+ return form;
57
+ },
58
+
59
+ ajaxFileUpload: function(s) {
60
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
61
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
62
+ var id = new Date().getTime()
63
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
64
+ var io = jQuery.createUploadIframe(id, s.secureuri);
65
+ var frameId = 'jUploadFrame' + id;
66
+ var formId = 'jUploadForm' + id;
67
+ // Watch for a new set of requests
68
+ if ( s.global && ! jQuery.active++ )
69
+ {
70
+ jQuery.event.trigger( "ajaxStart" );
71
+ }
72
+ var requestDone = false;
73
+ // Create the request object
74
+ var xml = {}
75
+ if ( s.global )
76
+ jQuery.event.trigger("ajaxSend", [xml, s]);
77
+ // Wait for a response to come back
78
+ var uploadCallback = function(isTimeout)
79
+ {
80
+ var io = document.getElementById(frameId);
81
+ try
82
+ {
83
+ if(io.contentWindow)
84
+ {
85
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
86
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
87
+
88
+ }else if(io.contentDocument)
89
+ {
90
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
91
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
92
+ }
93
+ }catch(e)
94
+ {
95
+ jQuery.handleError(s, xml, null, e);
96
+ }
97
+ if ( xml || isTimeout == "timeout")
98
+ {
99
+ requestDone = true;
100
+ var status;
101
+ try {
102
+ status = isTimeout != "timeout" ? "success" : "error";
103
+ // Make sure that the request was successful or notmodified
104
+ if ( status != "error" )
105
+ {
106
+ // process the data (runs the xml through httpData regardless of callback)
107
+ var data = jQuery.uploadHttpData( xml, s.dataType );
108
+ // If a local callback was specified, fire it and pass it the data
109
+ if ( s.success )
110
+ s.success( data, status );
111
+
112
+ // Fire the global callback
113
+ if( s.global )
114
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
115
+ } else
116
+ jQuery.handleError(s, xml, status);
117
+ } catch(e)
118
+ {
119
+ status = "error";
120
+ jQuery.handleError(s, xml, status, e);
121
+ }
122
+
123
+ // The request was completed
124
+ if( s.global )
125
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
126
+
127
+ // Handle the global AJAX counter
128
+ if ( s.global && ! --jQuery.active )
129
+ jQuery.event.trigger( "ajaxStop" );
130
+
131
+ // Process result
132
+ if ( s.complete )
133
+ s.complete(xml, status);
134
+
135
+ jQuery(io).unbind()
136
+
137
+ setTimeout(function()
138
+ { try
139
+ {
140
+ jQuery(io).remove();
141
+ jQuery(form).remove();
142
+
143
+ } catch(e)
144
+ {
145
+ jQuery.handleError(s, xml, null, e);
146
+ }
147
+
148
+ }, 100)
149
+
150
+ xml = null
151
+
152
+ }
153
+ }
154
+ // Timeout checker
155
+ if ( s.timeout > 0 )
156
+ {
157
+ setTimeout(function(){
158
+ // Check to see if the request is still happening
159
+ if( !requestDone ) uploadCallback( "timeout" );
160
+ }, s.timeout);
161
+ }
162
+ try
163
+ {
164
+
165
+ var form = jQuery('#' + formId);
166
+ jQuery(form).attr('action', s.url);
167
+ jQuery(form).attr('method', 'POST');
168
+ jQuery(form).attr('target', frameId);
169
+ if(form.encoding)
170
+ {
171
+ jQuery(form).attr('encoding', 'multipart/form-data');
172
+ }
173
+ else
174
+ {
175
+ jQuery(form).attr('enctype', 'multipart/form-data');
176
+ }
177
+ jQuery(form).submit();
178
+
179
+ } catch(e)
180
+ {
181
+ jQuery.handleError(s, xml, null, e);
182
+ }
183
+
184
+ jQuery('#' + frameId).load(uploadCallback );
185
+ return {abort: function () {}};
186
+
187
+ },
188
+
189
+ uploadHttpData: function( r, type ) {
190
+ var data = !type;
191
+ data = type == "xml" || data ? r.responseXML : r.responseText;
192
+ // If the type is "script", eval it in global context
193
+ if ( type == "script" )
194
+ jQuery.globalEval( data );
195
+ // Get the JavaScript object, if JSON is used.
196
+ if ( type == "json" )
197
+ eval( "data = " + data );
198
+ // evaluate scripts within html
199
+ if ( type == "html" )
200
+ jQuery("<div>").html(data).evalScripts();
201
+
202
+ return data;
203
+ }
204
+ })
tags/1.4.0/languages/en-GB.mo ADDED
Binary file
tags/1.4.0/languages/en-GB.po ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup\n"
4
+ "POT-Creation-Date: 2013-07-29 00:59-0000\n"
5
+ "PO-Revision-Date: 2013-07-29 00:59-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: John Peden Ltd <mail@johncpeden.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: _e;__\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+ "X-Poedit-SearchPath-1: ..\n"
18
+
19
+ #: ../index.php:313
20
+ msgid "Manage"
21
+ msgstr ""
22
+
23
+ #: ../views/options.php:6 ../views/options.php:8
24
+ msgid "Backup"
25
+ msgstr ""
26
+
27
+ #: ../views/options.php:7
28
+ msgid "Create a backup file of this site's content and settings"
29
+ msgstr ""
30
+
31
+ #: ../views/options.php:9
32
+ msgid "Download"
33
+ msgstr ""
34
+
35
+ #: ../views/options.php:15 ../views/options.php:30
36
+ msgid "Restore"
37
+ msgstr ""
38
+
39
+ #: ../views/options.php:17
40
+ msgid ""
41
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
42
+ "plugins, uploads and settings"
43
+ msgstr ""
44
+
45
+ #: ../views/options.php:22
46
+ msgid "The maximum filesize you can upload is "
47
+ msgstr ""
48
+
49
+ #: ../views/options.php:35
50
+ msgid "Status"
51
+ msgstr ""
52
+
53
+ #: ../views/options.php:40
54
+ msgid "Nothing to report"
55
+ msgstr ""
56
+
57
+ #: ../views/options.php:45
58
+ msgid "Preparing to backup"
59
+ msgstr ""
60
+
61
+ #: ../views/options.php:45 ../views/options.php:46 ../views/options.php:47
62
+ #: ../views/options.php:48 ../views/options.php:49 ../views/options.php:50
63
+ #: ../views/options.php:66 ../views/options.php:67 ../views/options.php:68
64
+ #: ../views/options.php:69 ../views/options.php:70 ../views/options.php:71
65
+ #: ../views/options.php:72
66
+ msgid "Done"
67
+ msgstr ""
68
+
69
+ #: ../views/options.php:45 ../views/options.php:46 ../views/options.php:47
70
+ #: ../views/options.php:48 ../views/options.php:49 ../views/options.php:50
71
+ #: ../views/options.php:66 ../views/options.php:67 ../views/options.php:68
72
+ #: ../views/options.php:69 ../views/options.php:70 ../views/options.php:71
73
+ #: ../views/options.php:72
74
+ msgid "Failed"
75
+ msgstr ""
76
+
77
+ #: ../views/options.php:46
78
+ msgid "Backing-up /wp-content/"
79
+ msgstr ""
80
+
81
+ #: ../views/options.php:47
82
+ msgid "Backing-up database"
83
+ msgstr ""
84
+
85
+ #: ../views/options.php:48
86
+ msgid "Creating backup directory"
87
+ msgstr ""
88
+
89
+ #: ../views/options.php:49
90
+ msgid "Zipping backup directory"
91
+ msgstr ""
92
+
93
+ #: ../views/options.php:50 ../views/options.php:72
94
+ msgid "Cleaning up"
95
+ msgstr ""
96
+
97
+ #: ../views/options.php:51
98
+ msgid ""
99
+ "Backup file created successfully. You can download your backup file using "
100
+ "the link above"
101
+ msgstr ""
102
+
103
+ #: ../views/options.php:56
104
+ msgid ""
105
+ "Error: Unable to create new directory for backup. Please check your CHMOD "
106
+ "settings of your wp-backitup plugin directory"
107
+ msgstr ""
108
+
109
+ #: ../views/options.php:57
110
+ msgid ""
111
+ "Error: Cannot create backup directory. Please check the CHMOD settings of "
112
+ "your wp-backitup plugin directory"
113
+ msgstr ""
114
+
115
+ #: ../views/options.php:58
116
+ msgid "Error: Unable to backup your files. Please try again"
117
+ msgstr ""
118
+
119
+ #: ../views/options.php:59
120
+ msgid "Error: Unable to backup your database. Please try again"
121
+ msgstr ""
122
+
123
+ #: ../views/options.php:60
124
+ msgid "Error: Unable to create site information file. Please try again"
125
+ msgstr ""
126
+
127
+ #: ../views/options.php:61
128
+ msgid "Warning: Unable to cleanup your backup directory"
129
+ msgstr ""
130
+
131
+ #: ../views/options.php:66
132
+ msgid "Uploading restoration zip"
133
+ msgstr ""
134
+
135
+ #: ../views/options.php:67
136
+ msgid "Unzipping"
137
+ msgstr ""
138
+
139
+ #: ../views/options.php:68
140
+ msgid "Validating restoration zip"
141
+ msgstr ""
142
+
143
+ #: ../views/options.php:69
144
+ msgid "Setting checkpoint"
145
+ msgstr ""
146
+
147
+ #: ../views/options.php:70
148
+ msgid "Importing database"
149
+ msgstr ""
150
+
151
+ #: ../views/options.php:71
152
+ msgid "Importing /wp-content/ directory"
153
+ msgstr ""
154
+
155
+ #: ../views/options.php:73
156
+ msgid ""
157
+ "Restoration completed successfully. Please refresh the page and login to the "
158
+ "site again (with your current username and password)"
159
+ msgstr ""
160
+
161
+ #: ../views/options.php:78
162
+ msgid "Error: No file selected"
163
+ msgstr ""
164
+
165
+ #: ../views/options.php:79
166
+ msgid "Error: Your file could not be uploaded"
167
+ msgstr ""
168
+
169
+ #: ../views/options.php:80
170
+ msgid "Error: Your restoration file could not be unzipped"
171
+ msgstr ""
172
+
173
+ #: ../views/options.php:81
174
+ msgid ""
175
+ "Error: Your zip file appears to be invalid. Please ensure you chose the "
176
+ "correct zip file"
177
+ msgstr ""
178
+
179
+ #: ../views/options.php:82
180
+ msgid "Error: Cannot create restore point"
181
+ msgstr ""
182
+
183
+ #: ../views/options.php:83
184
+ msgid "Error: Unable to connect to your database"
185
+ msgstr ""
186
+
187
+ #: ../views/options.php:84
188
+ msgid "Error: Unable to get current site URL from database. Please try again"
189
+ msgstr ""
190
+
191
+ #: ../views/options.php:85
192
+ msgid "Error: Unable to get current home URL from database. Please try again"
193
+ msgstr ""
194
+
195
+ #: ../views/options.php:86
196
+ msgid "Error: Unable to get current user ID from database. Please try again"
197
+ msgstr ""
198
+
199
+ #: ../views/options.php:87
200
+ msgid ""
201
+ "Error: Unable to get current user password from database. Please try again"
202
+ msgstr ""
203
+
204
+ #: ../views/options.php:88
205
+ msgid "Error: Unable to get current user email from database. Please try again"
206
+ msgstr ""
207
+
208
+ #: ../views/options.php:89
209
+ msgid ""
210
+ "Error: Unable to get import your database. This may require importing the "
211
+ "file manually"
212
+ msgstr ""
213
+
214
+ #: ../views/options.php:90
215
+ msgid ""
216
+ "Error: Unable to update your current site URL value. This may require "
217
+ "importing the file manually"
218
+ msgstr ""
219
+
220
+ #: ../views/options.php:91
221
+ msgid ""
222
+ "Error: Unable to update your current home URL value. This may require "
223
+ "importing the file manually"
224
+ msgstr ""
225
+
226
+ #: ../views/options.php:92
227
+ msgid ""
228
+ "Error: Unable to update your user information. This may require importing "
229
+ "the file manually"
230
+ msgstr ""
231
+
232
+ #: ../views/options.php:93
233
+ msgid "Error: Warning: Database not detected in import file"
234
+ msgstr ""
235
+
236
+ #: ../views/options.php:94
237
+ msgid ""
238
+ "Error: Unable to remove existing wp-content directory for import. Please "
239
+ "check your CHMOD settings in /wp-content/"
240
+ msgstr ""
241
+
242
+ #: ../views/options.php:95
243
+ msgid ""
244
+ "Error: Unable to create new wp-content directory for import. Please check "
245
+ "your CHMOD settings in /wp-content/"
246
+ msgstr ""
247
+
248
+ #: ../views/options.php:96
249
+ msgid "Error: Unable to import wp-content. Please try again"
250
+ msgstr ""
251
+
252
+ #: ../views/options.php:97
253
+ msgid "Warning: Unable to cleanup import directory"
254
+ msgstr ""
255
+
256
+ #: ../views/options.php:108
257
+ msgid "License Key"
258
+ msgstr ""
259
+
260
+ #: ../views/options.php:112
261
+ msgid "Pro features and auto-updates enabled"
262
+ msgstr ""
263
+
264
+ #: ../views/options.php:114
265
+ msgid "Activate auto-restore and auto-updates by entering your license key"
266
+ msgstr ""
267
+
268
+ #: ../views/options.php:119
269
+ msgid "Active"
270
+ msgstr ""
271
+
272
+ #: ../views/options.php:120
273
+ msgid "Update"
274
+ msgstr ""
275
+
276
+ #: ../views/options.php:122
277
+ msgid "Inactive"
278
+ msgstr ""
279
+
280
+ #: ../views/options.php:123
281
+ msgid "Activate"
282
+ msgstr ""
283
+
284
+ #: ../views/options.php:124
285
+ msgid "Purchase a license key"
286
+ msgstr ""
287
+
288
+ #: ../views/options.php:131
289
+ msgid "WP Backitup support system"
290
+ msgstr ""
291
+
292
+ #: ../views/options.php:134
293
+ msgid "support system"
294
+ msgstr ""
295
+
296
+ #: ../views/options.php:137
297
+ msgid "Need Help?"
298
+ msgstr ""
299
+
300
+ #: ../views/options.php:138
301
+ msgid "Access the"
302
+ msgstr ""
303
+
304
+ #: ../views/options.php:142
305
+ msgid "Spread the Word"
306
+ msgstr ""
307
+
308
+ #: ../views/options.php:143
309
+ msgid "Rate WP Backitup"
310
+ msgstr ""
311
+
312
+ #: ../views/options.php:148
313
+ msgid "Enable"
314
+ msgstr ""
315
+
316
+ #: ../views/options.php:149
317
+ msgid "Disable"
318
+ msgstr ""
319
+
320
+ #: ../views/options.php:150
321
+ msgid "Help to improve Easy Webtrends by enabling"
322
+ msgstr ""
323
+
324
+ #: ../views/options.php:151
325
+ msgid "Save"
326
+ msgstr ""
tags/1.4.0/lib/constants.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.4.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.4.0' );
13
+
14
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
19
+
20
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
21
+
22
+ if( !defined( 'WPBACKITUP_SITE_URL' ) ) define( 'WPBACKITUP_SITE_URL', 'http://www.wpbackitup.com' );
23
+
24
+ if( !defined( 'WPBACKITUP_ITEM_NAME' ) ) define( 'WPBACKITUP_ITEM_NAME', 'WP Backitup' );
tags/1.4.0/lib/functions.php ADDED
@@ -0,0 +1,264 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.4.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ // localize the plugin
13
+ function lang_setup() {
14
+ global $WPBackitup;
15
+ load_plugin_textdomain($WPBackitup->namespace, false, dirname(plugin_basename(__FILE__)) . '/lang/');
16
+ }
17
+ add_action('after_setup_theme', 'lang_setup');
18
+
19
+ // include recurseZip class
20
+ if( !class_exists( 'recurseZip' ) ) {
21
+ include_once 'includes/recurse_zip.php';
22
+ }
23
+
24
+ // include auto-update class
25
+ if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
26
+ include_once 'includes/auto_update.php';
27
+ }
28
+
29
+ // retrieve our license key from the DB
30
+ $license_key = trim( $this->get_option( 'license_key' ) );
31
+
32
+ // setup the updater
33
+ $edd_updater = new EDD_SL_Plugin_Updater( WPBACKITUP_SITE_URL, dirname ( dirname ( __FILE__) ) .'/index.php', array(
34
+ 'version' => WPBACKITUP_VERSION, // current version number
35
+ 'license' => $license_key, // license key (used get_option above to retrieve from DB)
36
+ 'item_name' => WPBACKITUP_ITEM_NAME, // name of this plugin
37
+ 'author' => 'John Peden' // author of this plugin
38
+ )
39
+ );
40
+
41
+ //load backup function
42
+ function backup() {
43
+ include_once 'includes/backup.php';
44
+ }
45
+ add_action('wp_ajax_backup', 'backup');
46
+
47
+ //load restore_path function
48
+ function restore_path() {
49
+ include_once 'includes/restore_from_path.php';
50
+ }
51
+ add_action('wp_ajax_restore_path', 'restore_path');
52
+
53
+ //load download function
54
+ function download() {
55
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
56
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
57
+ $filename = basename($file);
58
+ echo 'Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a>';
59
+ }
60
+ } else {
61
+ echo 'No export file available for download. Please create one.';
62
+ }
63
+ die();
64
+ }
65
+ add_action('wp_ajax_download', 'download');
66
+
67
+ //load logreader function
68
+ function logreader() {
69
+ $log = WPBACKITUP_DIRNAME .'/logs/status.log';
70
+ if(file_exists($log) ) {
71
+ readfile($log);
72
+ }
73
+ die();
74
+ }
75
+ add_action('wp_ajax_logreader', 'logreader');
76
+
77
+ //define create_dir function
78
+ if(!function_exists('create_dir')) {
79
+ function create_dir($dir) {
80
+ if( !is_dir($dir) ) {
81
+ @mkdir($dir, 0755);
82
+ }
83
+ return true;
84
+ }
85
+ }
86
+
87
+ //Define recusive_copy function
88
+ if(!function_exists('recursive_copy')) {
89
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
90
+ if( is_dir($dir) ) { //If the directory exists
91
+ if ($dh = opendir($dir) ) {
92
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
93
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
94
+ if (!is_dir( $dir.$file ) ) {
95
+ //Copy files to destination directory
96
+ $fsrc = fopen($dir .$file,'r');
97
+ $fdest = fopen($target_path .$file,'w+');
98
+ $len = stream_copy_to_stream($fsrc,$fdest);
99
+ fclose($fsrc);
100
+ fclose($fdest);
101
+ } else { //If $file is a directory
102
+ $destdir = $target_path .$file; //Modify the destination dir
103
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
104
+ @mkdir($destdir, 0755);
105
+ }
106
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
107
+ }
108
+ }
109
+ }
110
+ closedir($dh);
111
+ }
112
+ }
113
+ return true;
114
+ }
115
+ }
116
+
117
+ //Define DB backup function
118
+ if(!function_exists('db_backup')) {
119
+ function db_backup($path) {
120
+
121
+ $handle = fopen($path .'db-backup.sql', 'w+');
122
+
123
+
124
+ $path_sql = $path .'/db-backup.sql';
125
+ $db_name = DB_NAME;
126
+ $db_user = DB_USER;
127
+ $db_pass = DB_PASSWORD;
128
+ $db_host = DB_HOST;
129
+
130
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name");
131
+ fwrite($handle,$output);
132
+ fclose($handle);
133
+ return true;
134
+ }
135
+ }
136
+
137
+ //Define the create_siteinfo function
138
+ if(!function_exists('create_siteinfo')) {
139
+ function create_siteinfo($path, $table_prefix) {
140
+ $siteinfo = $path ."backupsiteinfo.txt";
141
+ $handle = fopen($siteinfo, 'w+');
142
+ $entry = site_url( '/' ) ."\n$table_prefix";
143
+ fwrite($handle, $entry);
144
+ fclose($handle);
145
+ return true;
146
+ }
147
+ }
148
+
149
+ //Define recursive_delete function
150
+ if(!function_exists('recursive_delete')){
151
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
152
+ if( is_dir($dir) ){
153
+ if($dh = opendir($dir)) {
154
+ while( ($file = readdir($dh)) !== false ) {
155
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
156
+ if(!is_dir($dir .'/'. $file)) {
157
+ unlink($dir .'/'. $file);
158
+ } else {
159
+ recursive_delete($dir.'/'. $file, $ignore);
160
+ }
161
+ }
162
+ }
163
+ }
164
+ @rmdir($dir);
165
+ closedir($dh);
166
+ }
167
+ return true;
168
+ }
169
+ }
170
+
171
+ //Define zip function
172
+ function zip($source, $destination, $ignore) {
173
+ if (is_string($source)) $source_arr = array($source); // convert it to array
174
+ if (!extension_loaded('zip')) {
175
+ return false;
176
+ }
177
+ $zip = new ZipArchive();
178
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
179
+ return false;
180
+ }
181
+ foreach ($source_arr as $source) {
182
+ if (!file_exists($source)) continue;
183
+ $source = str_replace('\\', '/', realpath($source));
184
+ if (is_dir($source) === true) {
185
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
186
+ foreach ($files as $file) {
187
+ if (!preg_match($ignore, $file)) {
188
+ $file = str_replace('\\', '/', realpath($file));
189
+ if (is_dir($file) === true) {
190
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
191
+ } else if (is_file($file) === true) {
192
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
193
+ }
194
+ }
195
+ }
196
+ } else if (is_file($source) === true) {
197
+ $zip->addFromString(basename($source), file_get_contents($source));
198
+ }
199
+ }
200
+ return $zip->close();
201
+ }
202
+
203
+ //load presstrends
204
+ function load_presstrends() {
205
+ global $WPBackitup;
206
+ if($WPBackitup->get_option( 'presstrends' ) == 'enabled') {
207
+ // PressTrends Account API Key
208
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
209
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
210
+
211
+ // Start of Metrics
212
+ global $wpdb;
213
+ $data = get_transient( 'presstrends_cache_data' );
214
+ if ( !$data || $data == '' ) {
215
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
216
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
217
+
218
+ $count_posts = wp_count_posts();
219
+ $count_pages = wp_count_posts( 'page' );
220
+ $comments_count = wp_count_comments();
221
+
222
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
223
+ if ( function_exists( 'wp_get_theme' ) ) {
224
+ $theme_data = wp_get_theme();
225
+ $theme_name = urlencode( $theme_data->Name );
226
+ } else {
227
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
228
+ $theme_name = $theme_data['Name'];
229
+ }
230
+
231
+ $plugin_name = '&';
232
+ foreach ( get_plugins() as $plugin_info ) {
233
+ $plugin_name .= $plugin_info['Name'] . '&';
234
+ }
235
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
236
+ $plugin_data = get_plugin_data( __FILE__ );
237
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
238
+ $data = array(
239
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
240
+ 'posts' => $count_posts->publish,
241
+ 'pages' => $count_pages->publish,
242
+ 'comments' => $comments_count->total_comments,
243
+ 'approved' => $comments_count->approved,
244
+ 'spam' => $comments_count->spam,
245
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
246
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
247
+ 'theme_version' => $plugin_data['Version'],
248
+ 'theme_name' => $theme_name,
249
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
250
+ 'plugins' => count( get_option( 'active_plugins' ) ),
251
+ 'plugin' => urlencode( $plugin_name ),
252
+ 'wpversion' => get_bloginfo( 'version' ),
253
+ );
254
+
255
+ foreach ( $data as $k => $v ) {
256
+ $url .= $k . '/' . $v . '/';
257
+ }
258
+ wp_remote_get( $url );
259
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
260
+ }
261
+ }
262
+ }
263
+ // PressTrends WordPress Action
264
+ add_action('admin_init', 'load_presstrends');
tags/1.4.0/lib/includes/auto_update.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Auto Update
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ class EDD_SL_Plugin_Updater {
14
+ private $api_url = '';
15
+ private $api_data = array();
16
+ private $name = '';
17
+ private $slug = '';
18
+
19
+ /**
20
+ * Class constructor.
21
+ *
22
+ * @uses plugin_basename()
23
+ * @uses hook()
24
+ *
25
+ * @param string $_api_url The URL pointing to the custom API endpoint.
26
+ * @param string $_plugin_file Path to the plugin file.
27
+ * @param array $_api_data Optional data to send with API calls.
28
+ * @return void
29
+ */
30
+ function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
31
+ $this->api_url = trailingslashit( $_api_url );
32
+ $this->api_data = urlencode_deep( $_api_data );
33
+ $this->name = plugin_basename( $_plugin_file );
34
+ $this->slug = basename( $_plugin_file, '.php');
35
+ $this->version = $_api_data['version'];
36
+
37
+ // Set up hooks.
38
+ $this->hook();
39
+ }
40
+
41
+ /**
42
+ * Set up Wordpress filters to hook into WP's update process.
43
+ *
44
+ * @uses add_filter()
45
+ *
46
+ * @return void
47
+ */
48
+ private function hook() {
49
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
50
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
51
+ }
52
+
53
+ /**
54
+ * Check for Updates at the defined API endpoint and modify the update array.
55
+ *
56
+ * This function dives into the update api just when Wordpress creates its update array,
57
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
58
+ * It is reassembled from parts of the native Wordpress plugin update code.
59
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
60
+ *
61
+ * @uses api_request()
62
+ *
63
+ * @param array $_transient_data Update array build by Wordpress.
64
+ * @return array Modified update array with custom plugin data.
65
+ */
66
+ function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
67
+
68
+
69
+ if( empty( $_transient_data ) ) return $_transient_data;
70
+
71
+ $to_send = array( 'slug' => $this->slug );
72
+
73
+ $api_response = $this->api_request( 'plugin_latest_version', $to_send );
74
+
75
+ if( false !== $api_response && is_object( $api_response ) ) {
76
+ if( version_compare( $this->version, $api_response->new_version, '<' ) )
77
+ $_transient_data->response[$this->name] = $api_response;
78
+ }
79
+ return $_transient_data;
80
+ }
81
+
82
+
83
+ /**
84
+ * Updates information on the "View version x.x details" page with custom data.
85
+ *
86
+ * @uses api_request()
87
+ *
88
+ * @param mixed $_data
89
+ * @param string $_action
90
+ * @param object $_args
91
+ * @return object $_data
92
+ */
93
+ function plugins_api_filter( $_data, $_action = '', $_args = null ) {
94
+ if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
95
+
96
+ $to_send = array( 'slug' => $this->slug );
97
+
98
+ $api_response = $this->api_request( 'plugin_information', $to_send );
99
+ if ( false !== $api_response ) $_data = $api_response;
100
+
101
+ return $_data;
102
+ }
103
+
104
+ /**
105
+ * Calls the API and, if successfull, returns the object delivered by the API.
106
+ *
107
+ * @uses get_bloginfo()
108
+ * @uses wp_remote_post()
109
+ * @uses is_wp_error()
110
+ *
111
+ * @param string $_action The requested action.
112
+ * @param array $_data Parameters for the API action.
113
+ * @return false||object
114
+ */
115
+ private function api_request( $_action, $_data ) {
116
+
117
+ global $wp_version;
118
+
119
+ $data = array_merge( $this->api_data, $_data );
120
+ if( $data['slug'] != $this->slug )
121
+ return;
122
+
123
+ $api_params = array(
124
+ 'edd_action' => 'get_version',
125
+ 'license' => $data['license'],
126
+ 'name' => $data['item_name'],
127
+ 'slug' => $this->slug,
128
+ 'author' => $data['author']
129
+ );
130
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
131
+
132
+ if ( !is_wp_error( $request ) ):
133
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
134
+ if( $request )
135
+ $request->sections = maybe_unserialize( $request->sections );
136
+ return $request;
137
+ else:
138
+ return false;
139
+ endif;
140
+ }
141
+ }
tags/1.4.0/lib/includes/backup.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Backup Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ global $WPBackitup;
14
+
15
+ //limit process to 15 minutes
16
+ @set_time_limit(900);
17
+
18
+ //Define variables
19
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
20
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
21
+ $wp_content_path = dirname(dirname(dirname(dirname(dirname(__FILE__))))) .'/';
22
+
23
+ //create log file
24
+ $log = WPBACKITUP_DIRNAME ."/logs/status.log";
25
+ unlink($log);
26
+ $fh = fopen($log, 'w') or die("Can't open log file");
27
+
28
+ //Delete the existing backup directory
29
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
30
+
31
+ //Re-create and empty backup dir
32
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
33
+ fwrite($fh, '<div class="prerequsites">0</div>');
34
+ fwrite($fh, '<div class="error101">1</div>');
35
+ fclose($fh);
36
+ die();
37
+ }
38
+
39
+ //Check to see if the directory is writeable
40
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
41
+ fwrite($fh, '<div class="prerequsites">0</div>');
42
+ fwrite($fh, '<div class="error102">1</div>');
43
+ die();
44
+ } else {
45
+ //If the directory is writeable, create the backup folder if it doesn't exist
46
+ if( !is_dir($backup_project_path) ) {
47
+ @mkdir($backup_project_path, 0755);
48
+ }
49
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
50
+ unlink($zip);
51
+ }
52
+ fwrite($fh, '<div class="prerequisites">1</div>');
53
+ }
54
+
55
+ //Backup with copy
56
+ if(recursive_copy($wp_content_path, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
57
+ fwrite($fh, '<div class="backupfiles">1</div>');
58
+ } else {
59
+ fwrite($fh, '<div class="backupfiles">0</div>');
60
+ fwrite($fh, '<div class="error103">1</div>');
61
+ die();
62
+ }
63
+
64
+ //Dump DB to project dir
65
+ if( db_backup($backup_project_path) ) {
66
+ fwrite($fh, '<div class="backupdb">1</div>');
67
+ } else {
68
+ fwrite($fh, '<div class="backupdb">0</div>');
69
+ fwrite($fh, '<div class="error104">1</div>');
70
+ recursive_delete($backup_project_path);
71
+ die();
72
+ }
73
+
74
+ //Create siteinfo in project dir
75
+ global $wpdb;
76
+
77
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
78
+ fwrite($fh, '<div class="infofile">0</div>');
79
+ fwrite($fh, '<div class="error105">1</div>');
80
+ recursive_delete($backup_project_path);
81
+ die();
82
+ } else {
83
+ fwrite($fh, '<div class="infofile">1</div>');
84
+ }
85
+
86
+ //Zip the project dir
87
+ $z = new recurseZip();
88
+ $src = rtrim($backup_project_path, '/');
89
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
90
+ fwrite($fh, '<div class="zipfile">1</div>');
91
+
92
+ //Delete backup dir
93
+ if(!recursive_delete($backup_project_path)) {
94
+ fwrite($fh, '<div class="cleanup">0</div>');
95
+ fwrite($fh, '<div class="error106">1</div>');
96
+ } else {
97
+ fwrite($fh, '<div class="cleanup">1</div>');
98
+ }
99
+
100
+ //close log file
101
+ fwrite($fh, '<div class="finalinfo">1</div>');
102
+ fclose($fh);
103
+
104
+ //End backup function
105
+ die();
tags/1.4.0/lib/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * WP Backitup Recurse Zip Function
1
  *
2
  * @package WP Backitup
3
  *
4
  * @author jcpeden
5
  * @version 1.4.0
6
  * @since 1.0.1
7
  */
1
+ <?php
2
  * WP Backitup Recurse Zip Function
3
  *
4
  * @package WP Backitup
5
  *
6
  * @author jcpeden
7
  * @version 1.4.0
8
  * @since 1.0.1
9
  */
tags/1.4.0/lib/includes/restore.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Restore Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ //define constants
14
+ if( !defined( 'WP_DIR_PATH' ) ) define( 'WP_DIR_PATH', dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', basename(WPBACKITUP_DIR_PATH) );
19
+
20
+ if( !defined( 'WP_CONTENT_PATH' ) ) define( 'WP_CONTENT_PATH', dirname( dirname( WPBACKITUP_DIR_PATH ) ) ) ;
21
+
22
+ // Include recurse_zip.php
23
+ include_once 'recurse_zip.php';
24
+
25
+ //define create_dir function
26
+ if(!function_exists('create_dir')) {
27
+ function create_dir($dir) {
28
+ if( !is_dir($dir) ) {
29
+ @mkdir($dir, 0755);
30
+ }
31
+ return true;
32
+ }
33
+ }
34
+
35
+ if(!function_exists('redo_to_checkpoint')) {
36
+ function redo_to_checkpoint($checkpoint) {
37
+
38
+ if($checkpoint == "db")
39
+ {
40
+ if( glob($restoration_dir_path . "*.cur") ) {
41
+ //collect connection information from form
42
+ fwrite($fh, '<div class="database">In Progress</div>');
43
+ include_once WP_DIR_PATH .'/wp-config.php';
44
+ //Add user to DB in v1.0.5
45
+ $user_id = $_POST['user_id'];
46
+ //Connect to DB
47
+ $output = db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc);
48
+ }
49
+
50
+ }
51
+
52
+ }
53
+ }
54
+
55
+ if(!function_exists('db_backup')) {
56
+ function db_backup($path) {
57
+ $handle = fopen($path .'db-backup.cur', 'w+');
58
+ $path_sql = $path .'db-backup.cur';
59
+ $db_name = DB_NAME;
60
+ $db_user = DB_USER;
61
+ $db_pass = DB_PASSWORD;
62
+ $db_host = DB_HOST;
63
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name > '$path_sql'");
64
+ fwrite($handle,$output);
65
+ fclose($handle);
66
+ return true;
67
+ }
68
+ }
69
+
70
+ //Define recusive_copy function
71
+ if(!function_exists('recursive_copy')) {
72
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
73
+ if( is_dir($dir) ) { //If the directory exists
74
+ if ($dh = opendir($dir) ) {
75
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
76
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
77
+ if (!is_dir( $dir.$file ) ) {
78
+ //Copy files to destination directory
79
+ //echo 'Copying ' .$dir .$file . ' to ' .$target_path .$file .'<br />';
80
+ $fsrc = fopen($dir .$file,'r');
81
+ $fdest = fopen($target_path .$file,'w+');
82
+ $len = stream_copy_to_stream($fsrc,$fdest);
83
+ fclose($fsrc);
84
+ fclose($fdest);
85
+ } else { //If $file is a directory
86
+ $destdir = $target_path .$file; //Modify the destination dir
87
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
88
+ @mkdir($destdir, 0755);
89
+ }
90
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
91
+ }
92
+ }
93
+ }
94
+ closedir($dh);
95
+ }
96
+ }
97
+ return true;
98
+ }
99
+ }
100
+
101
+ //Define recursive_delete function
102
+ if(!function_exists('recursive_delete')){
103
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
104
+ if( is_dir($dir) ){
105
+ if($dh = opendir($dir)) {
106
+ while( ($file = readdir($dh)) !== false ) {
107
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
108
+ if(!is_dir($dir .'/' .$file)) {
109
+ //echo 'Deleting ' .$dir .'/' .$file '<br />';
110
+ unlink($dir .'/' .$file);
111
+ } else {
112
+ recursive_delete($dir .'/' .$file, $ignore);
113
+ }
114
+ }
115
+ }
116
+ }
117
+ @rmdir($dir);
118
+ closedir($dh);
119
+ }
120
+ return true;
121
+ }
122
+ }
123
+
124
+ //define db_import function
125
+ if(!function_exists('db_import')) {
126
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
127
+ //13-4-13: John C Peden [mail@johncpeden.com] This was incomplete, I've updated to make it work
128
+ foreach(glob($restoration_dir_path . "*.sql") as $sql_file) {
129
+ $db_name = DB_NAME;
130
+ $db_user = DB_USER;
131
+ $db_pass = DB_PASSWORD;
132
+ $db_host = DB_HOST;
133
+ $command = "mysql --user='$db_user' --password='$db_pass' --host='$db_host' $db_name < '$sql_file'";
134
+ $output = shell_exec(($command));
135
+ }
136
+ return true;
137
+ }
138
+ }
139
+
140
+ //create log file
141
+ $log = WPBACKITUP_DIR_PATH .'/logs/status.log';
142
+ unlink($log);
143
+ $fh = fopen($log, 'w') or die( "Can't write to log file" );
144
+
145
+ // 15 minutes per image should be PLENTY
146
+ @set_time_limit(900);
147
+
148
+ //Delete the existing backup directory
149
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
150
+
151
+ //Re-create and empty backup dir
152
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
153
+ fwrite($fh, '<div class="error201">1</div>');
154
+ fclose($fh);
155
+ die();
156
+ }
157
+
158
+ //Move the uploaded zip to the restoration directory
159
+ $restore_file_name = basename( $_FILES['wpbackitup-zip']['name']);
160
+ if( $restore_file_name == '') {
161
+ fwrite($fh, '<div class="error201">1</div>');
162
+ fclose($fh);
163
+ die();
164
+ }
165
+
166
+ $restore_path = WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name;
167
+ if(move_uploaded_file($_FILES['wpbackitup-zip']['tmp_name'], $restore_path)) {
168
+ fwrite($fh, '<div class="upload">1</div>');
169
+ } else {
170
+ fwrite($fh, '<div class="error203">1</div>');
171
+ fclose($fh);
172
+ die();
173
+ }
174
+
175
+ //unzip the upload
176
+ $zip = new ZipArchive;
177
+ $res = $zip->open(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
178
+ if ($res === TRUE) {
179
+ $zip->extractTo(WPBACKITUP_DIR_PATH .'/backups/');
180
+ $zip->close();
181
+ fwrite($fh, '<div class="unzipping">1</div>');
182
+ } else {
183
+ fwrite($fh, '<div class="error204">1</div>');
184
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
185
+ fclose($fh);
186
+ die();
187
+ }
188
+
189
+ //Identify the restoration directory
190
+ if ( count( glob( WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) ) == 1 ) {
191
+ foreach( glob(WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) as $dir) {
192
+ $restoration_dir_path = $dir .'/';
193
+ }
194
+ }
195
+
196
+ //Validate the restoration
197
+ if(glob($restoration_dir_path .'backupsiteinfo.txt') ){
198
+ fwrite($fh, '<div class="validation">1</div>');
199
+ } else {
200
+ fwrite($fh, '<div class="error204">1</div>');
201
+ recursive_delete($restoration_dir_path);
202
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
203
+ fclose($fh);
204
+ die();
205
+ }
206
+
207
+ // Backup the current database
208
+ if( db_backup($restoration_dir_path) ) {
209
+ fwrite($fh, '<div class="restore_point">1</div>');
210
+ } else {
211
+ fwrite($fh, '<div class="error205">1</div>');
212
+ fclose($fh);
213
+ die();
214
+ }
215
+
216
+ //if there is a database dump to restore
217
+ if( glob($restoration_dir_path . "*.sql") ) {
218
+
219
+ //Collect connection information from form
220
+ include_once WP_DIR_PATH .'/wp-config.php';
221
+
222
+ //Add user to DB in v1.0.5
223
+ $user_id = $_POST['user_id'];
224
+
225
+ //Connect to DB
226
+ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
227
+ if ( !$dbc ) {
228
+ fwrite($fh, '<div class="error206">1</div>');
229
+
230
+ recursive_delete($restoration_dir_path);
231
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
232
+ fclose($fh);
233
+ die();
234
+ }
235
+
236
+ //get siteurl
237
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='siteurl';";
238
+ if ($result = mysqli_query($dbc, $q1)) {
239
+ while ($row = mysqli_fetch_row($result)) {
240
+ $siteurl = $row[0];
241
+ }
242
+ mysqli_free_result($result);
243
+ } else {
244
+ fwrite($fh, '<div class="error207">1</div>');
245
+ recursive_delete($restoration_dir_path);
246
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
247
+ fclose($fh);
248
+ die();
249
+ }
250
+
251
+ //get homeurl
252
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='home';";
253
+ if ($result = mysqli_query($dbc, $q2)) {
254
+ while ($row = mysqli_fetch_row($result)) {
255
+ $homeurl = $row[0];
256
+ }
257
+ mysqli_free_result($result);
258
+ } else {
259
+ fwrite($fh, '<div class="error208">1</div>');
260
+ recursive_delete($restoration_dir_path);
261
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
262
+ fclose($fh);
263
+ die();
264
+ }
265
+
266
+ //get user login
267
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
268
+ if ($result = mysqli_query($dbc, $q3)) {
269
+ while ($row = mysqli_fetch_row($result)) {
270
+ $user_login = $row[0];
271
+ }
272
+ mysqli_free_result($result);
273
+ } else {
274
+ fwrite($fh, '<div class="error209">1</div>');
275
+ recursive_delete($restoration_dir_path);
276
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
277
+ fclose($fh);
278
+ die();
279
+ }
280
+
281
+ //get user pass
282
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
283
+ if ($result = mysqli_query($dbc, $q4)) {
284
+ while ($row = mysqli_fetch_row($result)) {
285
+ $user_pass = $row[0];
286
+ }
287
+ mysqli_free_result($result);
288
+ } else {
289
+ fwrite($fh, '<div class="error210">1</div>');
290
+ recursive_delete($restoration_dir_path);
291
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
292
+ fclose($fh);
293
+ die();
294
+ }
295
+
296
+ //get user email
297
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
298
+ if ($result = mysqli_query($dbc, $q5)) {
299
+ while ($row = mysqli_fetch_row($result)) {
300
+ $user_email = $row[0];
301
+ }
302
+ mysqli_free_result($result);
303
+ } else {
304
+ fwrite($fh, '<div class="error211">1</div>');
305
+ recursive_delete($restoration_dir_path);
306
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
307
+ fclose($fh);
308
+ die();
309
+ }
310
+
311
+ //Collect previous backup site url start
312
+ $import_siteinfo_lines = file($restoration_dir_path .'backupsiteinfo.txt');
313
+ $import_siteurl = trim($import_siteinfo_lines[0]);
314
+ $current_siteurl = trim($siteurl ,'/');
315
+ $import_table_prefix = $import_siteinfo_lines[1];
316
+
317
+ //import the database
318
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
319
+ fwrite($fh, '<div class="error212">1</div>');
320
+ recursive_delete($restoration_dir_path);
321
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
322
+ fclose($fh);
323
+ die();
324
+ }
325
+
326
+ //update the database
327
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value='" .$current_siteurl ."' WHERE option_name='siteurl'";
328
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value='" .$homeurl ."' WHERE option_name='home'";
329
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login='" .$user_login ."', user_pass='" .$user_pass ."', user_email='" .$user_email ."' WHERE ID='" .$user_id ."'";
330
+ if(!mysqli_query($dbc, $q6) ) {
331
+ fwrite($fh, '<div class="error213">1</div>');
332
+ recursive_delete($restoration_dir_path);
333
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
334
+ fclose($fh);
335
+ die();
336
+ }
337
+ if(!mysqli_query($dbc, $q7) ) {
338
+ fwrite($fh, '<div class="error214">1</div>');
339
+ recursive_delete($restoration_dir_path);
340
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
341
+ fclose($fh);
342
+ die();
343
+ }
344
+ if(!mysqli_query($dbc, $q8) ) {
345
+ fwrite($fh, '<div class="error215">1</div>');
346
+ recursive_delete($restoration_dir_path);
347
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
348
+ fclose($fh);
349
+ die();
350
+ }
351
+ fwrite($fh, '<div class="database">1</div>');
352
+ } else {
353
+ fwrite($fh, '<div class="error216">1</div>');
354
+ }
355
+
356
+ //Disconnect
357
+ mysqli_close($dbc);
358
+
359
+ //Restore wp-content directories
360
+ if(!recursive_delete(WP_CONTENT_PATH, array( 'cgi-bin','.','..','._', WPBACKITUP_DIRNAME ))) {
361
+ fwrite($fh, '<div class="error217">1</div>');
362
+ recursive_delete($restoration_dir_path);
363
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
364
+ fclose($fh);
365
+ die();
366
+ }
367
+ if(!create_dir(WP_CONTENT_PATH)) {
368
+ fwrite($fh, '<div class="error218">1</div>');
369
+ recursive_delete($restoration_dir_path);
370
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
371
+ fclose($fh);
372
+ die();
373
+ }
374
+ if(recursive_copy($restoration_dir_path, WP_CONTENT_PATH .'/', array( 'cgi-bin', '.', '..','._', $restore_file_name, 'status.log', 'db-backup.sql', 'backupsiteinfo.txt')) ) {
375
+ fwrite($fh, '<div class="wpcontent">1</div>');
376
+ } else {
377
+ fwrite($fh, '<div class="error219">1</div>');
378
+ recursive_delete($restoration_dir_path);
379
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
380
+ fclose($fh);
381
+ die();
382
+ }
383
+
384
+ //Delete the restoration directory
385
+ if(!recursive_delete($restoration_dir_path)) {
386
+ fwrite($fh, '<div class="error220">1</div>');
387
+ fclose($fh);
388
+ } else {
389
+ fwrite($fh, '<div class="cleanup">1</div>');
390
+ }
391
+
392
+ //Delete zip
393
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
394
+
395
+ //close log file
396
+ fwrite($fh, '<div class="finalinfo">1</div>');
397
+ fclose($fh);
398
+
399
+ //End backup function
400
+ die();
tags/1.4.0/lib/includes/restore_from_path.php ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Restore Functions
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+
14
+ //define constants
15
+ if( !defined( 'WP_DIR_PATH' ) ) define( 'WP_DIR_PATH', dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) );
16
+
17
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
18
+
19
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', basename(WPBACKITUP_DIR_PATH) );
20
+
21
+ if( !defined( 'WP_CONTENT_PATH' ) ) define( 'WP_CONTENT_PATH', dirname( dirname( WPBACKITUP_DIR_PATH ) ) ) ;
22
+
23
+
24
+ //create log file
25
+ $log = WPBACKITUP_DIR_PATH .'/backups/status.log';
26
+ $fh = fopen($log, 'w') or die( "Can't open file" );
27
+ echo '<ul>';
28
+
29
+ // 15 minutes per image should be PLENTY
30
+ @set_time_limit(900);
31
+
32
+ //define create_dir function
33
+ if(!function_exists('create_dir')) {
34
+ function create_dir($dir) {
35
+ if( !is_dir($dir) ) {
36
+ @mkdir($dir, 0755);
37
+ }
38
+ return true;
39
+ }
40
+ }
41
+
42
+ //Define recusive_copy function
43
+ if(!function_exists('recursive_copy')) {
44
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
45
+ if( is_dir($dir) ) { //If the directory exists
46
+ if ($dh = opendir($dir) ) {
47
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
48
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
49
+ if (!is_dir( $dir.$file ) ) {
50
+ //Copy files to destination directory
51
+ //echo 'Copying ' .$dir .$file . ' to ' .$target_path .$file .'<br />';
52
+ $fsrc = fopen($dir .$file,'r');
53
+ $fdest = fopen($target_path .$file,'w+');
54
+ $len = stream_copy_to_stream($fsrc,$fdest);
55
+ fclose($fsrc);
56
+ fclose($fdest);
57
+ } else { //If $file is a directory
58
+ $destdir = $target_path .$file; //Modify the destination dir
59
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
60
+ @mkdir($destdir, 0755);
61
+ }
62
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
63
+ }
64
+ }
65
+ }
66
+ closedir($dh);
67
+ }
68
+ }
69
+ return true;
70
+ }
71
+ }
72
+
73
+ //Define recursive_delete function
74
+ if(!function_exists('recursive_delete')){
75
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
76
+ if( is_dir($dir) ){
77
+ if($dh = opendir($dir)) {
78
+ while( ($file = readdir($dh)) !== false ) {
79
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
80
+ if(!is_dir($dir .'/' .$file)) {
81
+ //echo 'Deleting ' .$dir .'/' .$file '<br />';
82
+ unlink($dir .'/' .$file);
83
+ } else {
84
+ recursive_delete($dir .'/' .$file, $ignore);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ @rmdir($dir);
90
+ closedir($dh);
91
+ }
92
+ return true;
93
+ }
94
+ }
95
+
96
+ //define db_import function
97
+ if(!function_exists('db_import')) {
98
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
99
+ global $wpdb;
100
+ $sql_files = glob($restoration_dir_path . "*.sql");
101
+ foreach($sql_files as $sql_file) {
102
+ $templine = ''; // Temporary variable, used to store current query
103
+ $lines = file($sql_file); // Read in entire file
104
+ foreach ($lines as $line) { // Loop through each line
105
+ if (substr($line, 0, 2) == '--' || $line == '') continue; // Skip it if it's a comment
106
+ $templine .= $line; // Add this line to the current segment
107
+ if (substr(trim($line), -1, 1) == ';') { // If it has a semicolon at the end, it's the end of the query
108
+ //replace imported site url with current site url
109
+ if( strstr( trim($templine), trim($import_siteurl) ) == TRUE ) //If import site url is found
110
+ $templine = str_replace( trim($import_siteurl), trim($current_siteurl), $templine ); // Replace import site url with current site url
111
+ //if the table prefixes are different, replace the imported site prefixes with the current prefixes
112
+ if ($table_prefix != $import_table_prefix) {
113
+ if( strstr( trim($templine), trim($import_table_prefix) ) == TRUE ) //If import table prefix is found
114
+ $templine = str_replace( trim($import_table_prefix), trim($table_prefix), $templine ); // Replace import site table prefix with current site table prefix
115
+ }
116
+ // Perform the query
117
+ if( mysqli_query($dbc, $templine) === FALSE)
118
+ print('Error performing query \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />');
119
+ $templine = ''; // Reset temp variable to empty
120
+ }
121
+ }
122
+ }
123
+ return true;
124
+ }
125
+ }
126
+
127
+ //Delete any zips in the upload directory first
128
+ foreach (glob(WPBACKITUP_DIR_PATH .'/backups/' .'*.zip') as $file) {
129
+ unlink($file);
130
+ }
131
+
132
+ //Move the uploaded zip to the restoration directory
133
+ $restore_file_name = $_GET['name'];
134
+
135
+ $orig_file_name = WP_DIR_PATH . "/wp-content/uploads/" . $_GET['name'];
136
+ if( $restore_file_name == '') {
137
+ echo '<li class="error">No file selected<li></ul>' ;
138
+ fclose($fh);
139
+ die();
140
+ } else {
141
+ echo '<li>Uploading restoration file...' ;
142
+ }
143
+
144
+ $restore_path = WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name;
145
+ if(copy($orig_file_name, $restore_path)) {
146
+ echo "Done!</li>";
147
+ } else {
148
+ echo '</li><li class="error">Your file could not be uploaded</li></ul>';
149
+ fclose($fh);
150
+ die();
151
+ }
152
+
153
+ //Unzip the uploaded restore file
154
+ echo "<li>Unzipping...";
155
+ //include recurse_zip.php
156
+ include_once 'recurse_zip.php';
157
+ //unzip the upload
158
+ $zip = new ZipArchive;
159
+ $res = $zip->open(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
160
+ if ($res === TRUE) {
161
+ $zip->extractTo(WPBACKITUP_DIR_PATH .'/backups/');
162
+ $zip->close();
163
+ echo 'Done!</li>';
164
+ } else {
165
+ echo '</li><li class="error">Your restoration file could not be unzipped.</li></ul>';
166
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
167
+ fclose($fh);
168
+ die();
169
+ }
170
+
171
+ //Identify the restoration directory
172
+ echo '<li>Validating zip...' ;
173
+ if ( count( glob( WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) ) == 1 ) {
174
+ foreach( glob(WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) as $dir) {
175
+ $restoration_dir_path = $dir .'/';
176
+ }
177
+ }
178
+
179
+ //Validate the restoration
180
+ if(glob($restoration_dir_path .'backupsiteinfo.txt') ){
181
+ echo 'Done!</li>';
182
+ } else {
183
+ echo '</li><li class="error">Your zip file appears to be invalid. Please ensure you chose the correct zip file.</li></ul>';
184
+ recursive_delete($restoration_dir_path);
185
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
186
+ fclose($fh);
187
+ die();
188
+ }
189
+
190
+ //Restore wp-content directories
191
+ echo "<li>Restoring wp-content directory..." ;
192
+ if(!recursive_delete(WP_CONTENT_PATH, array( 'cgi-bin','.','..','._', WPBACKITUP_DIRNAME ))) {
193
+ echo '</li><li class="error">Unable to remove existing wp-content directory for import. Please check your CHMOD settings in /wp-content/.</li></ul>';
194
+ recursive_delete($restoration_dir_path);
195
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
196
+ fclose($fh);
197
+ die();
198
+ }
199
+ if(!create_dir(WP_CONTENT_PATH)) {
200
+ echo '</li><li class="error">Unable to create new wp-content directory for import. Please check your CHMOD settings in /wp-content/.</li></ul>';
201
+ recursive_delete($restoration_dir_path);
202
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
203
+ fclose($fh);
204
+ die();
205
+ }
206
+ if(recursive_copy($restoration_dir_path, WP_CONTENT_PATH .'/', array( 'cgi-bin', '.', '..','._', $restore_file_name, 'status.log', 'db-backup.sql', 'backupsiteinfo.txt')) ) {
207
+ echo 'Done!</li>';
208
+ } else {
209
+ echo '</li><li class="error">Unable to import wp-content. Please try again.</li></ul>';
210
+ recursive_delete($restoration_dir_path);
211
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
212
+ fclose($fh);
213
+ die();
214
+ }
215
+
216
+ //if there is a database dump to restore
217
+ if( glob($restoration_dir_path . "*.sql") ) {
218
+ //collect connection information from form
219
+ echo "<li>Restoring database..." ;
220
+ include_once WP_DIR_PATH .'/wp-config.php';
221
+ //Add user to DB in v1.0.5
222
+ $user_id = $_GET['userid'];
223
+ //Connect to DB
224
+ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
225
+ if ( !$dbc ) {
226
+ echo '</li><li class="error">Unable to connect to your current database: " .mysqli_connect_error() ."</li></ul>';
227
+ recursive_delete($restoration_dir_path);
228
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
229
+ fclose($fh);
230
+ die();
231
+ }
232
+ //get siteurl
233
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='siteurl';";
234
+ if ($result = mysqli_query($dbc, $q1)) {
235
+ while ($row = mysqli_fetch_row($result)) {
236
+ $siteurl = $row[0];
237
+ }
238
+ mysqli_free_result($result);
239
+ } else {
240
+ echo '</li><li class="error">Unable to get current site URL from database. Please try again.</li></ul>';
241
+ recursive_delete($restoration_dir_path);
242
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
243
+ fclose($fh);
244
+ die();
245
+ }
246
+ //get homeurl
247
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='home';";
248
+ if ($result = mysqli_query($dbc, $q2)) {
249
+ while ($row = mysqli_fetch_row($result)) {
250
+ $homeurl = $row[0];
251
+ }
252
+ mysqli_free_result($result);
253
+ } else {
254
+ echo '</li><li class="error">Unable to get current home URL from database. Please try again.</li></ul>';
255
+ recursive_delete($restoration_dir_path);
256
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
257
+ fclose($fh);
258
+ die();
259
+ }
260
+ //get user login
261
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
262
+ if ($result = mysqli_query($dbc, $q3)) {
263
+ while ($row = mysqli_fetch_row($result)) {
264
+ $user_login = $row[0];
265
+ }
266
+ mysqli_free_result($result);
267
+ } else {
268
+ echo '</li><li class="error">Unable to get current user ID from database. Please try again.</li></ul>';
269
+ recursive_delete($restoration_dir_path);
270
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
271
+ fclose($fh);
272
+ die();
273
+ }
274
+ //get user pass
275
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
276
+ if ($result = mysqli_query($dbc, $q4)) {
277
+ while ($row = mysqli_fetch_row($result)) {
278
+ $user_pass = $row[0];
279
+ }
280
+ mysqli_free_result($result);
281
+ } else {
282
+ echo '</li><li class="error">Unable to get current user password from database. Please try again.</li></ul>';
283
+ recursive_delete($restoration_dir_path);
284
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
285
+ fclose($fh);
286
+ die();
287
+ }
288
+ //get user email
289
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
290
+ if ($result = mysqli_query($dbc, $q5)) {
291
+ while ($row = mysqli_fetch_row($result)) {
292
+ $user_email = $row[0];
293
+ }
294
+ mysqli_free_result($result);
295
+ } else {
296
+ echo '</li><li class="error">Unable to get current user email from database. Please try again.</li></ul>';
297
+ recursive_delete($restoration_dir_path);
298
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
299
+ fclose($fh);
300
+ die();
301
+ }
302
+ //Collect previous backup site url start
303
+ $import_siteinfo_lines = file($restoration_dir_path .'backupsiteinfo.txt');
304
+ $import_siteurl = trim($import_siteinfo_lines[0]);
305
+ $current_siteurl = trim($siteurl ,'/');
306
+ $import_table_prefix = $import_siteinfo_lines[1];
307
+ //import the database
308
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
309
+ echo '</li><li class="error">Unable to get import your database. This may require importing the file manually.</li></ul>';
310
+ recursive_delete($restoration_dir_path);
311
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
312
+ fclose($fh);
313
+ die();
314
+ }
315
+ //update the database
316
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value='" .$current_siteurl ."' WHERE option_name='siteurl'";
317
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value='" .$homeurl ."' WHERE option_name='home'";
318
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login='" .$user_login ."', user_pass='" .$user_pass ."', user_email='" .$user_email ."' WHERE ID='" .$user_id ."'";
319
+ if(!mysqli_query($dbc, $q6) ) {
320
+ echo '</li><li class="error">Unable to update your current site URL value. This may require importing the file manually.</li></ul>';
321
+ recursive_delete($restoration_dir_path);
322
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
323
+ fclose($fh);
324
+ die();
325
+ }
326
+ if(!mysqli_query($dbc, $q7) ) {
327
+ echo '</li><li class="error">Unable to update your current home URL value. This may require importing the file manually.</li></ul>';
328
+ recursive_delete($restoration_dir_path);
329
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
330
+ fclose($fh);
331
+ die();
332
+ }
333
+ if(!mysqli_query($dbc, $q8) ) {
334
+ echo '</li><li class="error">Unable to update your user information. This may require importing the file manually.</li></ul>';
335
+ recursive_delete($restoration_dir_path);
336
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
337
+ fclose($fh);
338
+ die();
339
+ }
340
+ echo 'Done!</li>';
341
+ } else {
342
+ echo '<li class="error">Warning: Database not detected in import file.</li>';
343
+ }
344
+
345
+ //Disconnect
346
+ mysqli_close($dbc);
347
+
348
+ //Delete the restoration directory
349
+ recursive_delete($restoration_dir_path);
350
+
351
+ //Delete zip
352
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
353
+
354
+ //close log file
355
+ echo '<li>Restoration complete. Please refresh the page.</li>';
356
+ echo '</ul>';
357
+ fclose($fh);
358
+
359
+ //End backup function
360
+ die();
tags/1.4.0/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>.
tags/1.4.0/logs/status.log ADDED
@@ -0,0 +1 @@
 
1
+ <div class="upload">1</div><div class="unzipping">1</div><div class="validation">1</div><div class="restore_point">1</div><div class="database">1</div><div class="wpcontent">1</div><div class="cleanup">1</div><div class="finalinfo">1</div>
tags/1.4.0/readme.txt ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WordPress Backitup ===
2
+ Contributors: jcpeden
3
+ Donate link: http://www.wpbackitup.com
4
+ Tags: wordpress backup plugin, backup wordpress, wordpress database backup
5
+ Requires at least: 3.4.2
6
+ Tested up to: 3.6.0
7
+ Stable tag: 1.4.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ A Wordpress backup plugin that allows you to backup a Wordpress site (including your Wordpress database) in just one click.
12
+
13
+ == Description ==
14
+
15
+ = Want to backup Wordpress? =
16
+ Wordpress Backitup allows you to backup Wordpress (your entire Wordpress site and database) in just a single click. Wordpress Backitup creates a backup zip of your site&apos;s content and database and allows you to backup your Wordpress site right from the administration dashboard. You no longer need knowledge of FTP, MySQL or PHPMyAdmin.
17
+
18
+ = How easy is it to backup a Wordpress site? =
19
+ It should be easy to backup a Wordpress site, particularly your database but unfortunately unless you are familiar with the FTP, MySQL and/or PHPMyAdmin backing up your Wordpress site and its database can be quite a headache. As a result of it being difficult to backup Wordpress, many site owners just don't bother only to wish they had when their site is hacked or data is lost for some reason. Wordpress Backitup makes it easy to backup your site, just take a look at the video below.
20
+
21
+ = Wordpress Backitup makes it easy to backup your Wordpress site and database =
22
+ [youtube http://www.youtube.com/watch?v=o3RCzwLARSM]
23
+
24
+ = What does Wordpress Backitup actually backup? =
25
+ Wordpress Backitup creates a single, zipped backup of your entire site (minus Wordpress itself). This includes:
26
+ * The Wordpress database
27
+ * Wordpress plugins
28
+ * Wordpress uploads
29
+ * Wordpress themes
30
+ * Anything else in your wp-content directory
31
+
32
+ = How does Wordpress Backitup create a backup zip =
33
+ Creating a backup of your Wordpress site is easy, straightforward and for most sites very fast. Once Wordpress Backitup has been installed and activated, simply navigate to the Wordpress Backitup administration tab. From there, click the backup button and a number of things will happen in the background:
34
+
35
+ 1. Any existing backup zips created using Wordpress Backitup will be purged
36
+ 1. The contents of your entire wp-content directory will be copied to the backup directory
37
+ 1. A dump of your entire database will be copied to the backup directory
38
+ 1. The backup directory will be zipped
39
+ 1. A download link will be created and shown to you in the Wordpress Backitup administration window.
40
+
41
+ = How can I restore a Wordpress backup created with Wordpress Backitup? =
42
+ Need to restore a Wordpress site? Wordpress Backitup is definitely a great asset if you find yourself in this position. Assuming you've created a backup using Wordpress Backitup, you have two choices:
43
+
44
+ 1. Restore manually
45
+ 1. <a href="http://www.wpbackitup.com/plugins/wp-backitup-pro/" title="Buy a Wordpress Backitup Pro license">Buy a Wordpress Backitup Pro license</a> and use the built-in restore feature.
46
+
47
+ = How to manually restore a Wordpress backup created with Wordpress Backitup =
48
+ 1. Unzip the backup file
49
+ 1. Using FTP, delete the contents of your target wp-content directory
50
+ 1. Using FTP, upload the contents of your backup zip to the target site's wp-content directory
51
+ 1. Using MySQL/PHPMyAdmin, empty your target site's database
52
+ 1. Using MySQL/PHPMyAdmin, import the database dump from your backup zip into your target site.
53
+
54
+ == Installation ==
55
+
56
+ Installation of the plugin is straightforward:
57
+
58
+ 1. Upload the plugin to your plugins directory via FTP or through the Wordpress dashboard.
59
+ 1. Activate the plugin.
60
+ 1. A new menu called 'Wordpress Backitup' will be added to your toolbar.
61
+ 1. Click 'Wordpress Backitup' to access the backup/restore interface.
62
+
63
+ == Frequently Asked Questions ==
64
+
65
+ = Can I manually restore my backup zips? =
66
+ Sure! The backup zips generated by Wordpress Backitup contain a database dump and a copy of your wp-content directory. Simply upload your files and import your database.
67
+
68
+ = Is there an easier way to restore my backup zips? =
69
+ Yes, purchase and download <a href="http://www.wpbackitup.com/wp-backitup-pro/" title="Wordpress Backitup">Wordpress Backitup</a>. Once installed, you'll be able to restore you backup zips without FTP or MySQL.
70
+
71
+ = Will the plugin work on shared hosting/sub domains/webhost xxx? =
72
+ Yes.
73
+
74
+ = Will Wordpress Backitup work on Windows hosting? =
75
+ Yes.
76
+
77
+ = Are you going to be makinggress bars both for backing up and restoring with this plugin? =
78
+ It is likely this will feature in a new version of Wordpress Backitup.
79
+
80
+ = Can this plugin back to Amazon S3? =
81
+ This will feature in an upcoming version of Wordpress Backitup.
82
+
83
+ = Is there an auto back up schedule feature? =
84
+ It is likely this will feature in a new version of Wordpress Backitup.
85
+
86
+ = Will the plugin work with Wordpres version x.x? =
87
+ The plugin works on the latest release of WordPress and is updated to function with all new releases.
88
+
89
+ = Can this backup one version of WordPress to a different version? =
90
+ No. It is absolutely critical that your WordPress versions are exactly the same.
91
+
92
+ = Will Wordpress Backitup work on WordPress Multisite? =
93
+ Wordpress Backitup cannot yet backup/restore entire networks but it is compatible with WPMS sites.
94
+
95
+ = Does the plugin copy the database details as well? =
96
+ Yes, a database dump is created with each backup.
97
+
98
+ = 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? =
99
+ Yes. Wordpress Backitup can be used to create a good starting point for any and all sites you work on.
100
+
101
+ = Does Wordpress Backitup need to be installed? =
102
+ Yes. You must install the Wordpress Backitup plugin on the site you wish to backup and the site you wish to restore to. Its just a simple plugin.
103
+
104
+ = Does Wordpress Backitup backup plugins settings or just the plugins themselves? =
105
+ Wordpress Backitup creates a database dump and a backup of all your themes, plugins and uploads.
106
+
107
+ = Do you have any ideas about how large a blog is too big for Wordpress Backitup to handle? =
108
+ I`ve tested up to 5 themes, 20 plugins and 100 posts/pages without any issues.
109
+
110
+ = Do you do regularly update thisduct to match with WP version updates? =
111
+ Yes.
112
+
113
+ == Screenshots ==
114
+ 1. Once activated, the plugin loads a new menu into your toolbar.
115
+ 2. Simply click 'Backup' to generate a backup of your site. The plugin will update you on itsgress.
116
+ 3. When the backup has been created, click the download link to access a zipped backup of your site.
117
+
118
+ == Changelog ==
119
+
120
+ = 1.4.0 =
121
+ Fixed status reporting for backup/restore process and built-in localization.
122
+
123
+ = 1.3.0 =
124
+ Recommended upgrade: Amalgameted lite and pro versions of the plugin.
125
+
126
+ = 1.2.2 =
127
+ Major updates to improve plugin performance and stability.
128
+
129
+ = 1.2.1 =
130
+ Minor updates to plugin functionality.
131
+
132
+ = 1.2.0 =
133
+ Brought versioning inline with Wordpress Backitup Lite. Fixed incorrecy message on restore interface. Fixed restorationcess.
134
+
135
+ = 1.1.0 =
136
+ Backup from mysqldump, restore from mysql command line, restore functionality from uploaded files, file size limit check according to server before uploads, setInterval termination after operation, status update as the task completes using XML.
137
+
138
+ = 1.0.9 =
139
+ Introduced mysqldump for backup and shell exec for copy/delete operations.
140
+
141
+ = 1.0.8 =
142
+ Added ability to restore from server.
143
+
144
+ = 1.0.7 =
145
+ Improved auto-update facility and plugin stability.
146
+
147
+ = 1.0.6 =
148
+ Fixed critical issues the auto-upgradecess.
149
+
150
+ = 1.0.5 =
151
+ Fixed critical issues the auto-upgradecess.
152
+
153
+ = 1.0.4 =
154
+ Fixed issues with the restorationcess.
155
+
156
+ = 1.0.3 =
157
+ Fixed the auto-update engine and license key activation system.
158
+
159
+ = 1.0.2 =
160
+ Minor bugs patched for auto-update engine.
161
+
162
+ = 1.0.1 =
163
+ Wordpress Backitup integrated with licensing and auto-update engine.
164
+
165
+ = 1.0.0 =
166
+ Initial version of the plugin released.
167
+
168
+ == Upgrade Notice ==
169
+
170
+ = 1.4.0 =
171
+ Recommended upgrade: Fixed status reporting for backup/restore process and built-in localization.
172
+
173
+ = 1.3.0 =
174
+ Recommended upgrade: Amalgameted lite and pro versions of the plugin
175
+
176
+ = 1.2.2 =
177
+ Critical upgrade: Major overhaul of plugin structure
178
+
179
+ = 1.2.1 =
180
+ Recommended upgrade: Minor update to plugin structure.
181
+
182
+ = 1.2.0 =
183
+ Recommended upgrade: Minor update to plugin structure.
184
+
185
+ = 1.1.0 =
186
+ Critical upgrade: Improved plugin performance.
187
+
188
+ = 1.0.9 =
189
+ Recommended upgrade: Improved reliability and performance.
190
+
191
+ = 1.0.8 =
192
+ Recommended upgrade: Improved functionality
193
+
194
+ = 1.0.7 =
195
+ Critical upgrade: Fixed major bugs with auto-upgradecess.
196
+
197
+ = 1.0.6 =
198
+ Critical upgrade: Fixed major bugs with auto-upgradecess.
199
+
200
+ = 1.0.5 =
201
+ Critical upgrade: Fixed major bugs with auto-upgradecess.
202
+
203
+ = 1.0.4 =
204
+ Critical upgrade: Fixed major bugs with restorationcess.
205
+
206
+ = 1.0.3 =
207
+ Critical upgrade: Patched auto-update engine.
208
+
209
+ = 1.0.2 =
210
+ Non-critical upgrade: Patched auto-update engine.
211
+
212
+ = 1.0.1 =
213
+ Recommended upgrade: Added the licensing and auto-update engine.
214
+
215
+ = 1.0.0 =
216
+ Initial version of the plugin.
tags/1.4.0/views/options.php ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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><?php _e('Backup', $namespace );?></h3>
7
+ <p><?php _e('Create a backup file of this site\'s content and settings', $namespace ) ;?></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><?php _e('Download', $namespace );?></h3>
10
+ <p id="download-link"></p>
11
+
12
+ <!--Disable restoration form if the user has not activated-->
13
+ <?php $status = $this->get_option( 'status' );
14
+ if( $status !== false && $status == 'valid' ) { ?>
15
+ <h3><?php _e('Restore', $namespace );?></h3>
16
+ <iframe id="upload_target" name="upload_target" src=""></iframe>
17
+ <p><?php _e('Restore a WP Backitup zip file and overwrite this site\'s content, themes, plugins, uploads and settings', $namespace );?></p>
18
+ <?php $max_upload = (int)(ini_get('upload_max_filesize'));
19
+ $max_post = (int)(ini_get('post_max_size'));
20
+ $memory_limit = (int)(ini_get('memory_limit'));
21
+ $upload_mb = min($max_upload, $max_post, $memory_limit); ?>
22
+ <p><?php _e( 'The maximum filesize you can upload is ', $namespace );
23
+ echo $upload_mb .'MB.'; ?>
24
+ </p>
25
+ <form id="restore-form" method="post" enctype="multipart/form-data" action="<?php echo WPBACKITUP_URLPATH .'/lib/includes/restore.php'; ?>">
26
+ <?php global $current_user; ?>
27
+ <input type="hidden" name="user_id" value="<?php echo $current_user->ID; ?>" />
28
+ <input type="hidden" name="maximum" id="maximum" value="<?php echo $upload_mb; ?>" />
29
+ <p><input name="wpbackitup-zip" id="wpbackitup-zip" type="file" /></p>
30
+ <p><input type="submit" class="restore-button button-primary" name="restore" value="<?php _e( "Restore", $namespace ) ?>" /><img class="restore-icon status-icon" src="<?php echo WPBACKITUP_URLPATH. "/images/loader.gif"; ?>" height="16" width="16" /></p>
31
+ </form>
32
+ <?php } ?>
33
+ <!--End of restoration form-->
34
+
35
+ <h3><?php _e('Status', $namespace );?></h3>
36
+ <div id="status">
37
+
38
+ <!--default status message-->
39
+ <ul class="default-status">
40
+ <li><?php _e('Nothing to report', $namespace );?></li>
41
+ </ul>
42
+
43
+ <!--backup status messages-->
44
+ <ul class="backup-status">
45
+ <li class='prerequisites'><?php _e('Preparing to backup', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
46
+ <li class='backupfiles'><?php _e('Backing-up /wp-content/', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
47
+ <li class='backupdb'><?php _e('Backing-up database', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
48
+ <li class='infofile'><?php _e('Creating backup directory', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
49
+ <li class='zipfile'><?php _e('Zipping backup directory', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
50
+ <li class='cleanup'><?php _e('Cleaning up', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
51
+ <li class='finalinfo'><span class='status'><?php _e('Backup file created successfully. You can download your backup file using the link above', $namespace ); ?></span></li>
52
+ </ul>
53
+
54
+ <!--backup error messages-->
55
+ <ul class="backup-errors">
56
+ <li class="error101"><span class='status error'><?php _e('Error: Unable to create new directory for backup. Please check your CHMOD settings of your wp-backitup plugin directory' , $namespace ); ?>.</span></li>
57
+ <li class="error102"><span class='status error'><?php _e('Error: Cannot create backup directory. Please check the CHMOD settings of your wp-backitup plugin directory', $namespace ); ?>.</span></li>
58
+ <li class="error103"><span class='status error'><?php _e('Error: Unable to backup your files. Please try again', $namespace ); ?>.</span></li>
59
+ <li class="error104"><span class='status error'><?php _e('Error: Unable to backup your database. Please try again', $namespace ); ?>.</span></li>
60
+ <li class="error105"><span class='status error'><?php _e('Error: Unable to create site information file. Please try again', $namespace ); ?>.</span></li>
61
+ <li class="error106"><span class='status error'><?php _e('Warning: Unable to cleanup your backup directory', $namespace ); ?>.</span></li>
62
+ </ul>
63
+
64
+ <!--restore status messages-->
65
+ <ul class="restore-status">
66
+ <li class="upload"><?php _e('Uploading restoration zip', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
67
+ <li class="unzipping"><?php _e('Unzipping', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
68
+ <li class="validation"><?php _e('Validating restoration zip', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
69
+ <li class="restore_point"><?php _e('Setting checkpoint', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
70
+ <li class="database"><?php _e('Importing database', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
71
+ <li class="wpcontent"><?php _e('Importing /wp-content/ directory', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
72
+ <li class="cleanup"><?php _e('Cleaning up', $namespace );?>...<span class='status'><?php _e('Done', $namespace );?></span><span class='fail error'><?php _e('Failed', $namespace );?></span></li>
73
+ <li class='finalinfo'><span class='status'><?php _e('Restoration completed successfully. Please refresh the page and login to the site again (with your current username and password)', $namespace ); ?></span></li>
74
+ </ul>
75
+
76
+ <!--restore error messages-->
77
+ <ul class="restore-errors">
78
+ <li class="error201"><span class='status error'><?php _e('Error: No file selected', $namespace ); ?>.</span></li>
79
+ <li class="error202"><span class='status error'><?php _e('Error: Your file could not be uploaded', $namespace ); ?>.</span></li>
80
+ <li class="error203"><span class='status error'><?php _e('Error: Your restoration file could not be unzipped', $namespace ); ?>.</span></li>
81
+ <li class="error204"><span class='status error'><?php _e('Error: Your zip file appears to be invalid. Please ensure you chose the correct zip file', $namespace ); ?>.</span></li>
82
+ <li class="error205"><span class='status error'><?php _e('Error: Cannot create restore point', $namespace ); ?>.</span></li>
83
+ <li class="error206"><span class='status error'><?php _e('Error: Unable to connect to your database', $namespace ); ?>.</span></li>
84
+ <li class="error207"><span class='status error'><?php _e('Error: Unable to get current site URL from database. Please try again', $namespace ); ?>.</span></li>
85
+ <li class="error208"><span class='status error'><?php _e('Error: Unable to get current home URL from database. Please try again', $namespace ); ?>.</span></li>
86
+ <li class="error209"><span class='status error'><?php _e('Error: Unable to get current user ID from database. Please try again', $namespace ); ?>.</span></li>
87
+ <li class="error210"><span class='status error'><?php _e('Error: Unable to get current user password from database. Please try again', $namespace ); ?>.</span></li>
88
+ <li class="error211"><span class='status error'><?php _e('Error: Unable to get current user email from database. Please try again', $namespace ); ?>.</span></li>
89
+ <li class="error212"><span class='status error'><?php _e('Error: Unable to get import your database. This may require importing the file manually', $namespace ); ?>.</span></li>
90
+ <li class="error213"><span class='status error'><?php _e('Error: Unable to update your current site URL value. This may require importing the file manually', $namespace ); ?>.</span></li>
91
+ <li class="error214"><span class='status error'><?php _e('Error: Unable to update your current home URL value. This may require importing the file manually', $namespace ); ?>.</span></li>
92
+ <li class="error215"><span class='status error'><?php _e('Error: Unable to update your user information. This may require importing the file manually', $namespace ); ?>.</span></li>
93
+ <li class="error216"><span class='status error'><?php _e('Error: Warning: Database not detected in import file', $namespace ); ?>.</span></li>
94
+ <li class="error217"><span class='status error'><?php _e('Error: Unable to remove existing wp-content directory for import. Please check your CHMOD settings in /wp-content/', $namespace ); ?>.</span></li>
95
+ <li class="error218"><span class='status error'><?php _e('Error: Unable to create new wp-content directory for import. Please check your CHMOD settings in /wp-content/', $namespace ); ?>.</span></li>
96
+ <li class="error219"><span class='status error'><?php _e('Error: Unable to import wp-content. Please try again', $namespace ); ?>.</span></li>
97
+ <li class="error220"><span class='status error'><?php _e('Warning: Unable to cleanup import directory', $namespace ); ?>.</span></li>
98
+ </ul>
99
+ </div>
100
+ <?php if (site_url() == 'http://localhost/wpbackitup') {
101
+ echo '<p><div id="php">PHP messages here</p></div>';
102
+ } ?>
103
+ </div>
104
+ <div id="sidebar">
105
+ <form action="" method="post" id="<?php echo $namespace; ?>-form">
106
+ <?php wp_nonce_field( $namespace . "-update-options" ); ?>
107
+ <div class="widget">
108
+ <h3 class="promo"><?php _e('License Key', $namespace ); ?></h3>
109
+ <?php $license = $this->get_option( 'license_key' );
110
+ $status = $this->get_option( 'status' );
111
+ if( $status !== false && $status == 'valid' ) { ?>
112
+ <p><?php _e('Pro features and auto-updates enabled', $namespace ); ?></p>
113
+ <?php } else { ?>
114
+ <p><?php _e('Activate auto-restore and auto-updates by entering your license key', $namespace ); ?></p>
115
+ <?php } ?>
116
+ <p><input type="text" name="data[license_key]" id="license_key" value="<?php echo $license; ?>" />
117
+ <?php if( false !== $license ) {
118
+ if( $status !== false && $status == 'valid' ) { ?>
119
+ <span style="color:green;"><?php _e('Active', $namespace); ?></span></p>
120
+ <p class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e( "Update", $namespace ) ?>" /></p>
121
+ <?php } else { ?>
122
+ <span style="color:red;"><?php _e('Inactive', $namespace); ?></span></p>
123
+ <p class="submit"><input type="submit" name="Submit" class="button-secondary" value="<?php _e( "Activate", $namespace ) ?>" /></p>
124
+ <p><a href="http://www.wpbackitup.com/wp-backitup-pro"><?php _e('Purchase a license key', $namespace); ?></a></p>
125
+ <?php }
126
+ } ?>
127
+ </div>
128
+
129
+ <div class="widget">
130
+ <?php if( $status !== false && $status == 'valid' ) {
131
+ $support_anchor = __('WP Backitup support system',$namespace);
132
+ $support_url = 'http://www.wpbackitup.com/support/';
133
+ } else {
134
+ $support_anchor = __('support system',$namespace);
135
+ $support_url = 'http://wordpress.org/support/plugin/wp-backitup';
136
+ } ?>
137
+ <h3 class="promo"><?php _e('Need Help?', $namespace ); ?></h3>
138
+ <p><?php _e('Access the',$namespace); ?> <a href="<?php echo $support_url; ?>"><?php echo $support_anchor; ?></a>.</p>
139
+ </div>
140
+
141
+ <div class="widget">
142
+ <h3 class="promo"><?php _e('Spread the Word', $namespace ); ?></h3>
143
+ <p><a href="http://wordpress.org/extend/plugins/wp-backitup/"><?php _e('Rate WP Backitup', $namespace ); ?> 5&#9733;</a></p>
144
+ </div>
145
+
146
+ <div class="widget">
147
+ <h3 class="promo">Presstrends</h3>
148
+ <p><input type="radio" name="data[presstrends]" value="enabled" <?php if($this->get_option( 'presstrends' ) == 'enabled') echo 'checked'; ?>> <label><?php _e('Enable', $namespace ); ?></label></p>
149
+ <p><input type="radio" name="data[presstrends]" value="disabled" <?php if($this->get_option( 'presstrends' ) == 'disabled') echo 'checked'; ?>> <label><?php _e('Disable', $namespace ); ?></label></p>
150
+ <p><?php _e('Help to improve Easy Webtrends by enabling', $namespace ); ?> <a href="http://www.presstrends.io" target="_blank">Presstrends</a>.</p>
151
+ <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php _e( "Save", $namespace ) ?>" /></p>
152
+ </div>
153
+ </form>
154
+ </div>
155
+ </div>
tags/1.4.1/css/admin.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel Stylesheets
3
+ *
4
+ * @version 1.4.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ /* Global */
9
+
10
+ .error { color: #ff0000;}
11
+
12
+ p {line-height: 1.4em;}
13
+
14
+ td {padding: 0;}
15
+
16
+ h3 {
17
+ margin: 0;
18
+ padding: 1em 0 0 0;
19
+ }
20
+
21
+ iframe {
22
+ height: 0;
23
+ margin: 0;
24
+ padding: 0;
25
+ position: absolute;
26
+ top: 0;
27
+ right: 0;
28
+ width: 0;
29
+ z-index: -1;
30
+ }
31
+
32
+ .submit { padding: 0; }
33
+
34
+ /* Content */
35
+ #content {
36
+ float: left;
37
+ width: 65%;
38
+ }
39
+
40
+ #content input[type="text"], #content input[type="file"] {padding: 0;}
41
+
42
+ .status-icon {
43
+ display: inline;
44
+ height: 16px;
45
+ position: relative;
46
+ top: 3px;
47
+ left: 5px;
48
+ visibility: hidden;
49
+ width: 16px;
50
+ }
51
+
52
+ /** Status Reporting **/
53
+ .backup-status, .backup-status span, .backup-errors, .backup-errors span, .restore-status, .restore-status span, .restore-errors, .restore-errors span {
54
+ display: none;
55
+ }
56
+
57
+ /* Sidebar */
58
+ #sidebar {
59
+ float: right;
60
+ width: 30%;
61
+ }
62
+
63
+ .widget {padding: 1em;}
tags/1.4.1/images/icon.png ADDED
Binary file
tags/1.4.1/images/icon32.png ADDED
Binary file
tags/1.4.1/images/loader.gif ADDED
Binary file
tags/1.4.1/index.php ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @global object $wpdb
8
+ *
9
+ * @author jcpeden
10
+ * @version 1.4.1
11
+ */
12
+ /*
13
+ Plugin Name: WP Backitup
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.4.1
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
+ // Include constants file
37
+ include_once dirname( __FILE__ ) . '/lib/constants.php';
38
+
39
+ class WPBackitup {
40
+ var $namespace = "wp-backitup";
41
+ var $friendly_name = WPBACKITUP_ITEM_NAME;
42
+ var $version = WPBACKITUP_VERSION;
43
+
44
+ // Default plugin options
45
+ var $defaults = array(
46
+ 'presstrends' => "enabled",
47
+ 'license_key' => "",
48
+ 'status' => "inactive"
49
+ );
50
+
51
+ /**
52
+ * Instantiation construction
53
+ *
54
+ * @uses add_action()
55
+ * @uses WPBackitup::wp_register_scripts()
56
+ * @uses WPBackitup::wp_register_styles()
57
+ */
58
+ function __construct() {
59
+ // Name of the option_value to store plugin options in
60
+ $this->option_name = '_' . $this->namespace . '--options';
61
+
62
+ // Load all library files used by this plugin
63
+ $libs = glob( WPBACKITUP_DIRNAME . '/lib/*.php' );
64
+ foreach( $libs as $lib ) {
65
+ include_once $lib;
66
+ }
67
+
68
+ /**
69
+ * Make this plugin available for translation.
70
+ * Translations can be added to the /languages/ directory.
71
+ */
72
+ load_theme_textdomain( $this->namespace, WPBACKITUP_DIRNAME . '/languages' );
73
+
74
+ // Add all action, filter and shortcode hooks
75
+ $this->_add_hooks();
76
+ }
77
+
78
+ /**
79
+ * Add in various hooks
80
+ */
81
+ private function _add_hooks() {
82
+ // Options page for configuration
83
+ add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
84
+ // Route requests for form processing
85
+ add_action( 'init', array( &$this, 'route' ) );
86
+
87
+ // Add a settings link next to the "Deactivate" link on the plugin listing page
88
+ add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
89
+
90
+ // Register all JavaScripts for this plugin
91
+ add_action( 'init', array( &$this, 'wp_register_scripts' ), 1 );
92
+ // Register all Stylesheets for this plugin
93
+ add_action( 'init', array( &$this, 'wp_register_styles' ), 1 );
94
+ }
95
+
96
+ /**
97
+ * Process update page form submissions and validate license key
98
+ *
99
+ * @uses WPBackitup::sanitize()
100
+ * @uses wp_redirect()
101
+ * @uses wp_verify_nonce()
102
+ * @uses wp_remote_get()
103
+ * @uses add_query_arg()
104
+ * @uses is_wp_error()
105
+ * @uses wp_remote_retrieve_body()
106
+ * @uses update_option()
107
+ * @uses wp_safe_redirect()
108
+ */
109
+ private function _admin_options_update() {
110
+
111
+ // Verify submission for processing using wp_nonce
112
+ if( wp_verify_nonce( $_REQUEST['_wpnonce'], "{$this->namespace}-update-options" ) ) {
113
+ //create data array
114
+ $data = array();
115
+
116
+ /**
117
+ * Loop through each POSTed value and sanitize it to protect against malicious code. Please
118
+ * note that rich text (or full HTML fields) should not be processed by this function and
119
+ * dealt with directly.
120
+ */
121
+ foreach( $_POST['data'] as $key => $val ) {
122
+ $data[$key] = $this->_sanitize( $val );
123
+ }
124
+
125
+ //check license status and try to activate if invalid
126
+ $license = trim ( $data['license_key'] );
127
+
128
+ // Check license
129
+ $api_params = array(
130
+ 'edd_action' => 'check_license',
131
+ 'license' => $license,
132
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME )
133
+ );
134
+
135
+ // Call the custom API
136
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
137
+
138
+ // make sure the response came back okay
139
+ if ( is_wp_error( $response ) )
140
+ return false;
141
+
142
+ // decode the license data
143
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
144
+
145
+ if( $license_data->license != 'valid' ) {
146
+ // Try to activate license (process is almost identical to check_license)
147
+ $api_params = array(
148
+ 'edd_action'=> 'activate_license',
149
+ 'license' => $license,
150
+ 'item_name' => urlencode( WPBACKITUP_ITEM_NAME ) // the name of our product in EDD
151
+ );
152
+ $response = wp_remote_get( add_query_arg( $api_params, WPBACKITUP_SITE_URL ) );
153
+ if ( is_wp_error( $response ) )
154
+ return false;
155
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
156
+ }
157
+
158
+ /* Manually define status value */
159
+ $data['status'] = $license_data->license;
160
+
161
+ // Update the options value with the data submitted
162
+ update_option( $this->option_name, $data );
163
+
164
+ // Redirect back to the options page with the message flag to show the saved message
165
+ wp_safe_redirect( $_REQUEST['_wp_http_referer'] . '&update=1' );
166
+ exit;
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Sanitize data
172
+ *
173
+ * @param mixed $str The data to be sanitized
174
+ *
175
+ * @uses wp_kses()
176
+ *
177
+ * @return mixed The sanitized version of the data
178
+ */
179
+ private function _sanitize( $str ) {
180
+ if ( !function_exists( 'wp_kses' ) ) {
181
+ include_once ABSPATH . 'wp-includes/kses.php';
182
+ }
183
+ global $allowedposttags;
184
+ global $allowedprotocols;
185
+
186
+ if ( is_string( $str ) ) {
187
+ $str = wp_kses( $str, $allowedposttags, $allowedprotocols );
188
+ } elseif( is_array( $str ) ) {
189
+ $arr = array();
190
+ foreach( (array) $str as $key => $val ) {
191
+ $arr[$key] = $this->_sanitize( $val );
192
+ }
193
+ $str = $arr;
194
+ }
195
+
196
+ return $str;
197
+ }
198
+
199
+ /**
200
+ * Hook into register_activation_hook action
201
+ */
202
+ static function activate() {
203
+ // Do activation actions
204
+ }
205
+
206
+ /**
207
+ * Define the admin menu options for this plugin
208
+ *
209
+ * @uses add_action()
210
+ * @uses add_options_page()
211
+ */
212
+ function admin_menu() {
213
+ $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);
214
+
215
+ // Add print scripts and styles action based off the option page hook
216
+ add_action( 'admin_print_scripts-' . $page_hook, array( &$this, 'admin_print_scripts' ) );
217
+ add_action( 'admin_print_styles-' . $page_hook, array( &$this, 'admin_print_styles' ) );
218
+ }
219
+
220
+
221
+ /**
222
+ * The admin section options page rendering method
223
+ *
224
+ * @uses current_user_can()
225
+ * @uses wp_die()
226
+ */
227
+ function admin_options_page() {
228
+ if( !current_user_can( 'manage_options' ) ) {
229
+ wp_die( 'You do not have sufficient permissions to access this page' );
230
+ }
231
+
232
+ $page_title = $this->friendly_name . ' Options';
233
+ $namespace = $this->namespace;
234
+
235
+ include WPBACKITUP_DIRNAME . "/views/options.php";
236
+ }
237
+
238
+ /**
239
+ * Load JavaScript for the admin options page
240
+ *
241
+ * @uses wp_enqueue_script()
242
+ */
243
+ function admin_print_scripts() {
244
+ wp_enqueue_script( "{$this->namespace}-admin" );
245
+ wp_enqueue_script( "{$this->namespace}-ajaxfileupload" );
246
+ }
247
+
248
+ /**
249
+ * Load Stylesheet for the admin options page
250
+ *
251
+ * @uses wp_enqueue_style()
252
+ */
253
+ function admin_print_styles() {
254
+ wp_enqueue_style( "{$this->namespace}-admin" );
255
+ }
256
+
257
+ /**
258
+ * Hook into register_deactivation_hook action
259
+ *
260
+ * Put code here that needs to happen when your plugin is deactivated
261
+ */
262
+ static function deactivate() {
263
+ // Do deactivation actions
264
+ }
265
+
266
+ /**
267
+ * Retrieve the stored plugin option or the default if no user specified value is defined
268
+ *
269
+ * @param string $option_name The name of the TrialAccount option you wish to retrieve
270
+ *
271
+ * @uses get_option()
272
+ *
273
+ * @return mixed Returns the option value or false(boolean) if the option is not found
274
+ */
275
+ function get_option( $option_name ) {
276
+ // Load option values if they haven't been loaded already
277
+ if( !isset( $this->options ) || empty( $this->options ) ) {
278
+ $this->options = get_option( $this->option_name, $this->defaults );
279
+ }
280
+
281
+ if( isset( $this->options[$option_name] ) ) {
282
+ return $this->options[$option_name]; // Return user's specified option value
283
+ } elseif( isset( $this->defaults[$option_name] ) ) {
284
+ return $this->defaults[$option_name]; // Return default option value
285
+ }
286
+ return false;
287
+ }
288
+
289
+ /**
290
+ * Initialization function to hook into the WordPress init action
291
+ *
292
+ * Instantiates the class on a global variable and sets the class, actions
293
+ * etc. up for use.
294
+ */
295
+ static function instance() {
296
+ global $WPBackitup;
297
+
298
+ // Only instantiate the Class if it hasn't been already
299
+ if( !isset( $WPBackitup ) ) $WPBackitup = new WPBackitup();
300
+ }
301
+
302
+ /**
303
+ * Hook into plugin_action_links filter
304
+ *
305
+ * @param object $links An array of the links to show, this will be the modified variable
306
+ * @param string $file The name of the file being processed in the filter
307
+ */
308
+ function plugin_action_links( $links, $file ) {
309
+ if( $file == plugin_basename( WPBACKITUP_DIRNAME . '/' . basename( __FILE__ ) ) ) {
310
+ $old_links = $links;
311
+ $new_links = array(
312
+ "settings" => '<a href="admin.php?page=' . $this->namespace . '">' . __( 'Manage' ) . '</a>'
313
+ );
314
+ $links = array_merge( $new_links, $old_links );
315
+ }
316
+
317
+ return $links;
318
+ }
319
+
320
+ /**
321
+ * Route the user based off of environment conditions
322
+ *
323
+ * @uses WPBackitup::_admin_options_update()
324
+ */
325
+ function route() {
326
+ $uri = $_SERVER['REQUEST_URI'];
327
+ $protocol = isset( $_SERVER['HTTPS'] ) ? 'https' : 'http';
328
+ $hostname = $_SERVER['HTTP_HOST'];
329
+ $url = "{$protocol}://{$hostname}{$uri}";
330
+ $is_post = (bool) ( strtoupper( $_SERVER['REQUEST_METHOD'] ) == "POST" );
331
+
332
+ // Check if a nonce was passed in the request
333
+ if( isset( $_REQUEST['_wpnonce'] ) ) {
334
+ $nonce = $_REQUEST['_wpnonce'];
335
+
336
+ // Handle POST requests
337
+ if( $is_post ) {
338
+ if( wp_verify_nonce( $nonce, "{$this->namespace}-update-options" ) ) {
339
+ $this->_admin_options_update();
340
+ }
341
+ }
342
+ // Handle GET requests
343
+ else {
344
+
345
+ }
346
+ }
347
+ }
348
+
349
+ /**
350
+ * Register scripts used by this plugin for enqueuing elsewhere
351
+ *
352
+ * @uses wp_register_script()
353
+ */
354
+ function wp_register_scripts() {
355
+ // Admin JavaScript
356
+ wp_register_script( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/js/admin.js", array( 'jquery' ), $this->version, true );
357
+ wp_register_script( "{$this->namespace}-ajaxfileupload", WPBACKITUP_URLPATH . "/js/ajaxfileupload.js", array( 'jquery' ), $this->version, true );
358
+ }
359
+
360
+ /**
361
+ * Register styles used by this plugin for enqueuing elsewhere
362
+ *
363
+ * @uses wp_register_style()
364
+ */
365
+ function wp_register_styles() {
366
+ // Admin Stylesheet
367
+ wp_register_style( "{$this->namespace}-admin", WPBACKITUP_URLPATH . "/css/admin.css", array(), $this->version, 'screen' );
368
+ }
369
+ }
370
+ if( !isset( $WPBackitup ) ) {
371
+ WPBackitup::instance();
372
+ }
373
+
374
+ register_activation_hook( __FILE__, array( 'WPBackitup', 'activate' ) );
375
+ register_deactivation_hook( __FILE__, array( 'WPBackitup', 'deactivate' ) );
tags/1.4.1/js/admin.js ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Admin Control Panel JavaScripts
3
+ *
4
+ * @version 1.4.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ (function($){
9
+ /* define backup variables */
10
+ var backup = {
11
+ action: 'backup',
12
+ beforeSend: function() {
13
+ /* display processing icon */
14
+ $('.backup-icon').css('visibility','visible');
15
+
16
+ /* hide default message, restore status and restore errors */
17
+ $('.default-status, .restore-status, .restore-errors').hide();
18
+
19
+ /* show backup status, backup errors */
20
+ $('.backup-status, .backup-errors').toggle();
21
+
22
+ window.intervalDefine = setInterval(display_log, 1000);
23
+ }
24
+ };
25
+
26
+ /* define download variables */
27
+ var download = {
28
+ action: 'download'
29
+ };
30
+
31
+ /* define logreader variables */
32
+ var logreader = {
33
+ action: 'logreader'
34
+ };
35
+
36
+ /* define logreader function */
37
+ function display_log() {
38
+ $.post(ajaxurl, logreader, function(response) {
39
+
40
+ /* Get response from log reader */
41
+ var xmlObj = $(response);
42
+
43
+ /* For each response */
44
+ xmlObj.each(function() {
45
+
46
+ /* Select correct status */
47
+ var attributename = "." + $(this).attr('class');
48
+
49
+ if ( $(this).html() == 0 ) {
50
+
51
+ /* If status returns 0, display 'Failed' */
52
+ $(attributename).find(".fail").fadeIn(500);
53
+
54
+ } else {
55
+
56
+ /* If status returns 1, display 'Done' or show detailed message */
57
+ $(attributename).find(".status").fadeIn(500);
58
+
59
+ }
60
+
61
+ /* If is final or error */
62
+ if($(this).attr('code') == "finalinfo") {
63
+
64
+ /* Stop logreader */
65
+ clearInterval(window.intervalDefine);
66
+ }
67
+ });
68
+ });
69
+ }
70
+
71
+ /* define download function */
72
+ function download_link() {
73
+ $.post(ajaxurl, download, function(response) {
74
+ $("#download-link").html(response);
75
+ });
76
+ }
77
+
78
+ /* execute download (on page load/refresh) */
79
+ download_link();
80
+
81
+ /* execute backup on button click */
82
+ $(".backup-button").click( function() {
83
+ $.post(ajaxurl, backup, function(response) {
84
+ download_link();
85
+ clearInterval(display_log);
86
+
87
+ /* fade out status icon */
88
+ $('.backup-icon').fadeOut(1000);
89
+
90
+ /* Return PHP messages, used for development */
91
+ $("#php").html(response);
92
+ });
93
+ })
94
+
95
+ /* execute restore on button click */
96
+ $("#restore-form").submit(function() {
97
+
98
+ /* display processing icon */
99
+ $('.restore-icon').css('visibility','visible');
100
+
101
+ /* hide default message, backup status and backup errors */
102
+ $('.default-status, .backup-status, .backup-errors').hide();
103
+
104
+ /* show restore status messages */
105
+ $('.restore-status, .restore-errors').toggle();
106
+
107
+ window.intervalDefine = setInterval(display_log, 1000);
108
+ $("#restore-form").attr("target","upload_target");
109
+ $("#upload_target").load(function (){
110
+ importRestore();
111
+ });
112
+ });
113
+
114
+ /* define importRestore function */
115
+ function importRestore() {
116
+
117
+ /* process upload */
118
+ var ret = frames['upload_target'].document.getElementsByTagName("body")[0].innerHTML;
119
+
120
+ /* Return PHP messages, used for development */
121
+ $("#php").html(ret);
122
+ clearInterval(display_log);
123
+ $('.restore-icon').fadeOut(1000);
124
+ }
125
+ })(jQuery);
tags/1.4.1/js/ajaxfileupload.js ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WP Backitup Ajax File Upload
3
+ *
4
+ * @version 1.4.0
5
+ * @since 1.0.1
6
+ */
7
+
8
+ jQuery.extend({
9
+ createUploadIframe: function(id, uri)
10
+ {
11
+ //create frame
12
+ var frameId = 'jUploadFrame' + id;
13
+ var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
14
+ if(window.ActiveXObject)
15
+ {
16
+ if(typeof uri== 'boolean'){
17
+ iframeHtml += ' src="' + 'javascript:false' + '"';
18
+
19
+ }
20
+ else if(typeof uri== 'string'){
21
+ iframeHtml += ' src="' + uri + '"';
22
+
23
+ }
24
+ }
25
+ iframeHtml += ' />';
26
+ jQuery(iframeHtml).appendTo(document.body);
27
+
28
+ return jQuery('#' + frameId).get(0);
29
+ },
30
+ createUploadForm: function(id, fileElementId, data)
31
+ {
32
+ //create form
33
+ var formId = 'jUploadForm' + id;
34
+ var fileId = 'jUploadFile' + id;
35
+ var form = jQuery('<form action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');
36
+ if(data)
37
+ {
38
+ for(var i in data)
39
+ {
40
+ jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
41
+ }
42
+ }
43
+ var oldElement = jQuery('#' + fileElementId);
44
+ var newElement = jQuery(oldElement).clone();
45
+ jQuery(oldElement).attr('id', fileId);
46
+ jQuery(oldElement).before(newElement);
47
+ jQuery(oldElement).appendTo(form);
48
+
49
+
50
+
51
+ //set attributes
52
+ jQuery(form).css('position', 'absolute');
53
+ jQuery(form).css('top', '-1200px');
54
+ jQuery(form).css('left', '-1200px');
55
+ jQuery(form).appendTo('body');
56
+ return form;
57
+ },
58
+
59
+ ajaxFileUpload: function(s) {
60
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
61
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
62
+ var id = new Date().getTime()
63
+ var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
64
+ var io = jQuery.createUploadIframe(id, s.secureuri);
65
+ var frameId = 'jUploadFrame' + id;
66
+ var formId = 'jUploadForm' + id;
67
+ // Watch for a new set of requests
68
+ if ( s.global && ! jQuery.active++ )
69
+ {
70
+ jQuery.event.trigger( "ajaxStart" );
71
+ }
72
+ var requestDone = false;
73
+ // Create the request object
74
+ var xml = {}
75
+ if ( s.global )
76
+ jQuery.event.trigger("ajaxSend", [xml, s]);
77
+ // Wait for a response to come back
78
+ var uploadCallback = function(isTimeout)
79
+ {
80
+ var io = document.getElementById(frameId);
81
+ try
82
+ {
83
+ if(io.contentWindow)
84
+ {
85
+ xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
86
+ xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
87
+
88
+ }else if(io.contentDocument)
89
+ {
90
+ xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
91
+ xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
92
+ }
93
+ }catch(e)
94
+ {
95
+ jQuery.handleError(s, xml, null, e);
96
+ }
97
+ if ( xml || isTimeout == "timeout")
98
+ {
99
+ requestDone = true;
100
+ var status;
101
+ try {
102
+ status = isTimeout != "timeout" ? "success" : "error";
103
+ // Make sure that the request was successful or notmodified
104
+ if ( status != "error" )
105
+ {
106
+ // process the data (runs the xml through httpData regardless of callback)
107
+ var data = jQuery.uploadHttpData( xml, s.dataType );
108
+ // If a local callback was specified, fire it and pass it the data
109
+ if ( s.success )
110
+ s.success( data, status );
111
+
112
+ // Fire the global callback
113
+ if( s.global )
114
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
115
+ } else
116
+ jQuery.handleError(s, xml, status);
117
+ } catch(e)
118
+ {
119
+ status = "error";
120
+ jQuery.handleError(s, xml, status, e);
121
+ }
122
+
123
+ // The request was completed
124
+ if( s.global )
125
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
126
+
127
+ // Handle the global AJAX counter
128
+ if ( s.global && ! --jQuery.active )
129
+ jQuery.event.trigger( "ajaxStop" );
130
+
131
+ // Process result
132
+ if ( s.complete )
133
+ s.complete(xml, status);
134
+
135
+ jQuery(io).unbind()
136
+
137
+ setTimeout(function()
138
+ { try
139
+ {
140
+ jQuery(io).remove();
141
+ jQuery(form).remove();
142
+
143
+ } catch(e)
144
+ {
145
+ jQuery.handleError(s, xml, null, e);
146
+ }
147
+
148
+ }, 100)
149
+
150
+ xml = null
151
+
152
+ }
153
+ }
154
+ // Timeout checker
155
+ if ( s.timeout > 0 )
156
+ {
157
+ setTimeout(function(){
158
+ // Check to see if the request is still happening
159
+ if( !requestDone ) uploadCallback( "timeout" );
160
+ }, s.timeout);
161
+ }
162
+ try
163
+ {
164
+
165
+ var form = jQuery('#' + formId);
166
+ jQuery(form).attr('action', s.url);
167
+ jQuery(form).attr('method', 'POST');
168
+ jQuery(form).attr('target', frameId);
169
+ if(form.encoding)
170
+ {
171
+ jQuery(form).attr('encoding', 'multipart/form-data');
172
+ }
173
+ else
174
+ {
175
+ jQuery(form).attr('enctype', 'multipart/form-data');
176
+ }
177
+ jQuery(form).submit();
178
+
179
+ } catch(e)
180
+ {
181
+ jQuery.handleError(s, xml, null, e);
182
+ }
183
+
184
+ jQuery('#' + frameId).load(uploadCallback );
185
+ return {abort: function () {}};
186
+
187
+ },
188
+
189
+ uploadHttpData: function( r, type ) {
190
+ var data = !type;
191
+ data = type == "xml" || data ? r.responseXML : r.responseText;
192
+ // If the type is "script", eval it in global context
193
+ if ( type == "script" )
194
+ jQuery.globalEval( data );
195
+ // Get the JavaScript object, if JSON is used.
196
+ if ( type == "json" )
197
+ eval( "data = " + data );
198
+ // evaluate scripts within html
199
+ if ( type == "html" )
200
+ jQuery("<div>").html(data).evalScripts();
201
+
202
+ return data;
203
+ }
204
+ })
tags/1.4.1/languages/en-GB.mo ADDED
Binary file
tags/1.4.1/languages/en-GB.po ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP Backitup\n"
4
+ "POT-Creation-Date: 2013-07-29 00:59-0000\n"
5
+ "PO-Revision-Date: 2013-07-29 00:59-0000\n"
6
+ "Last-Translator: John Peden <john.peden@britishcouncil.org>\n"
7
+ "Language-Team: John Peden Ltd <mail@johncpeden.com>\n"
8
+ "Language: English\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.5.4\n"
13
+ "X-Poedit-KeywordsList: _e;__\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+ "X-Poedit-SearchPath-1: ..\n"
18
+
19
+ #: ../index.php:313
20
+ msgid "Manage"
21
+ msgstr ""
22
+
23
+ #: ../views/options.php:6 ../views/options.php:8
24
+ msgid "Backup"
25
+ msgstr ""
26
+
27
+ #: ../views/options.php:7
28
+ msgid "Create a backup file of this site's content and settings"
29
+ msgstr ""
30
+
31
+ #: ../views/options.php:9
32
+ msgid "Download"
33
+ msgstr ""
34
+
35
+ #: ../views/options.php:15 ../views/options.php:30
36
+ msgid "Restore"
37
+ msgstr ""
38
+
39
+ #: ../views/options.php:17
40
+ msgid ""
41
+ "Restore a WP Backitup zip file and overwrite this site's content, themes, "
42
+ "plugins, uploads and settings"
43
+ msgstr ""
44
+
45
+ #: ../views/options.php:22
46
+ msgid "The maximum filesize you can upload is "
47
+ msgstr ""
48
+
49
+ #: ../views/options.php:35
50
+ msgid "Status"
51
+ msgstr ""
52
+
53
+ #: ../views/options.php:40
54
+ msgid "Nothing to report"
55
+ msgstr ""
56
+
57
+ #: ../views/options.php:45
58
+ msgid "Preparing to backup"
59
+ msgstr ""
60
+
61
+ #: ../views/options.php:45 ../views/options.php:46 ../views/options.php:47
62
+ #: ../views/options.php:48 ../views/options.php:49 ../views/options.php:50
63
+ #: ../views/options.php:66 ../views/options.php:67 ../views/options.php:68
64
+ #: ../views/options.php:69 ../views/options.php:70 ../views/options.php:71
65
+ #: ../views/options.php:72
66
+ msgid "Done"
67
+ msgstr ""
68
+
69
+ #: ../views/options.php:45 ../views/options.php:46 ../views/options.php:47
70
+ #: ../views/options.php:48 ../views/options.php:49 ../views/options.php:50
71
+ #: ../views/options.php:66 ../views/options.php:67 ../views/options.php:68
72
+ #: ../views/options.php:69 ../views/options.php:70 ../views/options.php:71
73
+ #: ../views/options.php:72
74
+ msgid "Failed"
75
+ msgstr ""
76
+
77
+ #: ../views/options.php:46
78
+ msgid "Backing-up /wp-content/"
79
+ msgstr ""
80
+
81
+ #: ../views/options.php:47
82
+ msgid "Backing-up database"
83
+ msgstr ""
84
+
85
+ #: ../views/options.php:48
86
+ msgid "Creating backup directory"
87
+ msgstr ""
88
+
89
+ #: ../views/options.php:49
90
+ msgid "Zipping backup directory"
91
+ msgstr ""
92
+
93
+ #: ../views/options.php:50 ../views/options.php:72
94
+ msgid "Cleaning up"
95
+ msgstr ""
96
+
97
+ #: ../views/options.php:51
98
+ msgid ""
99
+ "Backup file created successfully. You can download your backup file using "
100
+ "the link above"
101
+ msgstr ""
102
+
103
+ #: ../views/options.php:56
104
+ msgid ""
105
+ "Error: Unable to create new directory for backup. Please check your CHMOD "
106
+ "settings of your wp-backitup plugin directory"
107
+ msgstr ""
108
+
109
+ #: ../views/options.php:57
110
+ msgid ""
111
+ "Error: Cannot create backup directory. Please check the CHMOD settings of "
112
+ "your wp-backitup plugin directory"
113
+ msgstr ""
114
+
115
+ #: ../views/options.php:58
116
+ msgid "Error: Unable to backup your files. Please try again"
117
+ msgstr ""
118
+
119
+ #: ../views/options.php:59
120
+ msgid "Error: Unable to backup your database. Please try again"
121
+ msgstr ""
122
+
123
+ #: ../views/options.php:60
124
+ msgid "Error: Unable to create site information file. Please try again"
125
+ msgstr ""
126
+
127
+ #: ../views/options.php:61
128
+ msgid "Warning: Unable to cleanup your backup directory"
129
+ msgstr ""
130
+
131
+ #: ../views/options.php:66
132
+ msgid "Uploading restoration zip"
133
+ msgstr ""
134
+
135
+ #: ../views/options.php:67
136
+ msgid "Unzipping"
137
+ msgstr ""
138
+
139
+ #: ../views/options.php:68
140
+ msgid "Validating restoration zip"
141
+ msgstr ""
142
+
143
+ #: ../views/options.php:69
144
+ msgid "Setting checkpoint"
145
+ msgstr ""
146
+
147
+ #: ../views/options.php:70
148
+ msgid "Importing database"
149
+ msgstr ""
150
+
151
+ #: ../views/options.php:71
152
+ msgid "Importing /wp-content/ directory"
153
+ msgstr ""
154
+
155
+ #: ../views/options.php:73
156
+ msgid ""
157
+ "Restoration completed successfully. Please refresh the page and login to the "
158
+ "site again (with your current username and password)"
159
+ msgstr ""
160
+
161
+ #: ../views/options.php:78
162
+ msgid "Error: No file selected"
163
+ msgstr ""
164
+
165
+ #: ../views/options.php:79
166
+ msgid "Error: Your file could not be uploaded"
167
+ msgstr ""
168
+
169
+ #: ../views/options.php:80
170
+ msgid "Error: Your restoration file could not be unzipped"
171
+ msgstr ""
172
+
173
+ #: ../views/options.php:81
174
+ msgid ""
175
+ "Error: Your zip file appears to be invalid. Please ensure you chose the "
176
+ "correct zip file"
177
+ msgstr ""
178
+
179
+ #: ../views/options.php:82
180
+ msgid "Error: Cannot create restore point"
181
+ msgstr ""
182
+
183
+ #: ../views/options.php:83
184
+ msgid "Error: Unable to connect to your database"
185
+ msgstr ""
186
+
187
+ #: ../views/options.php:84
188
+ msgid "Error: Unable to get current site URL from database. Please try again"
189
+ msgstr ""
190
+
191
+ #: ../views/options.php:85
192
+ msgid "Error: Unable to get current home URL from database. Please try again"
193
+ msgstr ""
194
+
195
+ #: ../views/options.php:86
196
+ msgid "Error: Unable to get current user ID from database. Please try again"
197
+ msgstr ""
198
+
199
+ #: ../views/options.php:87
200
+ msgid ""
201
+ "Error: Unable to get current user password from database. Please try again"
202
+ msgstr ""
203
+
204
+ #: ../views/options.php:88
205
+ msgid "Error: Unable to get current user email from database. Please try again"
206
+ msgstr ""
207
+
208
+ #: ../views/options.php:89
209
+ msgid ""
210
+ "Error: Unable to get import your database. This may require importing the "
211
+ "file manually"
212
+ msgstr ""
213
+
214
+ #: ../views/options.php:90
215
+ msgid ""
216
+ "Error: Unable to update your current site URL value. This may require "
217
+ "importing the file manually"
218
+ msgstr ""
219
+
220
+ #: ../views/options.php:91
221
+ msgid ""
222
+ "Error: Unable to update your current home URL value. This may require "
223
+ "importing the file manually"
224
+ msgstr ""
225
+
226
+ #: ../views/options.php:92
227
+ msgid ""
228
+ "Error: Unable to update your user information. This may require importing "
229
+ "the file manually"
230
+ msgstr ""
231
+
232
+ #: ../views/options.php:93
233
+ msgid "Error: Warning: Database not detected in import file"
234
+ msgstr ""
235
+
236
+ #: ../views/options.php:94
237
+ msgid ""
238
+ "Error: Unable to remove existing wp-content directory for import. Please "
239
+ "check your CHMOD settings in /wp-content/"
240
+ msgstr ""
241
+
242
+ #: ../views/options.php:95
243
+ msgid ""
244
+ "Error: Unable to create new wp-content directory for import. Please check "
245
+ "your CHMOD settings in /wp-content/"
246
+ msgstr ""
247
+
248
+ #: ../views/options.php:96
249
+ msgid "Error: Unable to import wp-content. Please try again"
250
+ msgstr ""
251
+
252
+ #: ../views/options.php:97
253
+ msgid "Warning: Unable to cleanup import directory"
254
+ msgstr ""
255
+
256
+ #: ../views/options.php:108
257
+ msgid "License Key"
258
+ msgstr ""
259
+
260
+ #: ../views/options.php:112
261
+ msgid "Pro features and auto-updates enabled"
262
+ msgstr ""
263
+
264
+ #: ../views/options.php:114
265
+ msgid "Activate auto-restore and auto-updates by entering your license key"
266
+ msgstr ""
267
+
268
+ #: ../views/options.php:119
269
+ msgid "Active"
270
+ msgstr ""
271
+
272
+ #: ../views/options.php:120
273
+ msgid "Update"
274
+ msgstr ""
275
+
276
+ #: ../views/options.php:122
277
+ msgid "Inactive"
278
+ msgstr ""
279
+
280
+ #: ../views/options.php:123
281
+ msgid "Activate"
282
+ msgstr ""
283
+
284
+ #: ../views/options.php:124
285
+ msgid "Purchase a license key"
286
+ msgstr ""
287
+
288
+ #: ../views/options.php:131
289
+ msgid "WP Backitup support system"
290
+ msgstr ""
291
+
292
+ #: ../views/options.php:134
293
+ msgid "support system"
294
+ msgstr ""
295
+
296
+ #: ../views/options.php:137
297
+ msgid "Need Help?"
298
+ msgstr ""
299
+
300
+ #: ../views/options.php:138
301
+ msgid "Access the"
302
+ msgstr ""
303
+
304
+ #: ../views/options.php:142
305
+ msgid "Spread the Word"
306
+ msgstr ""
307
+
308
+ #: ../views/options.php:143
309
+ msgid "Rate WP Backitup"
310
+ msgstr ""
311
+
312
+ #: ../views/options.php:148
313
+ msgid "Enable"
314
+ msgstr ""
315
+
316
+ #: ../views/options.php:149
317
+ msgid "Disable"
318
+ msgstr ""
319
+
320
+ #: ../views/options.php:150
321
+ msgid "Help to improve Easy Webtrends by enabling"
322
+ msgstr ""
323
+
324
+ #: ../views/options.php:151
325
+ msgid "Save"
326
+ msgstr ""
tags/1.4.1/lib/constants.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Constants used by this plugin
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.4.1
9
+ * @since 1.0.1
10
+ */
11
+
12
+ if( !defined( 'WPBACKITUP_VERSION' ) ) define( 'WPBACKITUP_VERSION', '1.4.1' );
13
+
14
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', dirname( dirname( __FILE__ ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_CONTENT_PATH' ) ) define( 'WPBACKITUP_CONTENT_PATH', dirname(dirname(dirname(dirname(__FILE__)))) .'/' );
19
+
20
+ if( !defined( 'WPBACKITUP_URLPATH' ) ) define( 'WPBACKITUP_URLPATH', WP_PLUGIN_URL . "/" . plugin_basename( WPBACKITUP_DIRNAME ) );
21
+
22
+ if( !defined( 'IS_AJAX_REQUEST' ) ) define( 'IS_AJAX_REQUEST', ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
23
+
24
+ if( !defined( 'WPBACKITUP_SITE_URL' ) ) define( 'WPBACKITUP_SITE_URL', 'http://www.wpbackitup.com' );
25
+
26
+ if( !defined( 'WPBACKITUP_ITEM_NAME' ) ) define( 'WPBACKITUP_ITEM_NAME', 'WP Backitup' );
tags/1.4.1/lib/functions.php ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WP Backitup Functions
4
+ *
5
+ * @package WP Backitup
6
+ *
7
+ * @author jcpeden
8
+ * @version 1.4.0
9
+ * @since 1.0.1
10
+ */
11
+
12
+ // localize the plugin
13
+ function lang_setup() {
14
+ global $WPBackitup;
15
+ load_plugin_textdomain($WPBackitup->namespace, false, dirname(plugin_basename(__FILE__)) . '/lang/');
16
+ }
17
+ add_action('after_setup_theme', 'lang_setup');
18
+
19
+ // include recurseZip class
20
+ if( !class_exists( 'recurseZip' ) ) {
21
+ include_once 'includes/recurse_zip.php';
22
+ }
23
+
24
+ // include auto-update class
25
+ if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
26
+ include_once 'includes/auto_update.php';
27
+ }
28
+
29
+ // retrieve our license key from the DB
30
+ $license_key = trim( $this->get_option( 'license_key' ) );
31
+
32
+ //define dbSize function
33
+ function dbSize($dbname) {
34
+ mysql_select_db($dbname);
35
+ $result = mysql_query("SHOW TABLE STATUS");
36
+ $dbsize = 0;
37
+ while($row = mysql_fetch_array($result)) {
38
+ $dbsize += $row["Data_length"] + $row["Index_length"];
39
+ }
40
+ return $dbsize;
41
+ }
42
+
43
+ //define formatFileSize function
44
+ function formatFileSize($bytes)
45
+ {
46
+ if ($bytes >= 1073741824)
47
+ {
48
+ $bytes = number_format($bytes / 1073741824, 2) . ' GB';
49
+ }
50
+ elseif ($bytes >= 1048576)
51
+ {
52
+ $bytes = number_format($bytes / 1048576, 2) . ' MB';
53
+ }
54
+ elseif ($bytes >= 1024)
55
+ {
56
+ $bytes = number_format($bytes / 1024, 2) . ' KB';
57
+ }
58
+ elseif ($bytes > 1)
59
+ {
60
+ $bytes = $bytes . ' bytes';
61
+ }
62
+ elseif ($bytes == 1)
63
+ {
64
+ $bytes = $bytes . ' byte';
65
+ }
66
+ else
67
+ {
68
+ $bytes = '0 bytes';
69
+ }
70
+
71
+ return $bytes;
72
+ }
73
+
74
+ //define dirSize function
75
+ function dirSize($directory) {
76
+ $size = 0;
77
+ foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file){
78
+ $size+=$file->getSize();
79
+ }
80
+ return $size;
81
+ }
82
+
83
+ //load backup function
84
+ function backup() {
85
+ include_once 'includes/backup.php';
86
+ }
87
+ add_action('wp_ajax_backup', 'backup');
88
+
89
+ //load restore_path function
90
+ function restore_path() {
91
+ include_once 'includes/restore_from_path.php';
92
+ }
93
+ add_action('wp_ajax_restore_path', 'restore_path');
94
+
95
+ //load download function
96
+ function download() {
97
+ if(glob(WPBACKITUP_DIRNAME . "/backups/*.zip")) {
98
+ foreach (glob(WPBACKITUP_DIRNAME . "/backups/*.zip") as $file) {
99
+ $filename = basename($file);
100
+ echo 'Download most recent export file: <a href="' .WPBACKITUP_URLPATH. '/backups/' .$filename .'">' .$filename .'</a>';
101
+ }
102
+ } else {
103
+ echo 'No export file available for download. Please create one.';
104
+ }
105
+ die();
106
+ }
107
+ add_action('wp_ajax_download', 'download');
108
+
109
+ //load logreader function
110
+ function logreader() {
111
+ $log = WPBACKITUP_DIRNAME .'/logs/status.log';
112
+ if(file_exists($log) ) {
113
+ readfile($log);
114
+ }
115
+ die();
116
+ }
117
+ add_action('wp_ajax_logreader', 'logreader');
118
+
119
+ //define create_dir function
120
+ if(!function_exists('create_dir')) {
121
+ function create_dir($dir) {
122
+ if( !is_dir($dir) ) {
123
+ @mkdir($dir, 0755);
124
+ }
125
+ return true;
126
+ }
127
+ }
128
+
129
+ //Define recusive_copy function
130
+ if(!function_exists('recursive_copy')) {
131
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
132
+ if( is_dir($dir) ) { //If the directory exists
133
+ if ($dh = opendir($dir) ) {
134
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
135
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
136
+ if (!is_dir( $dir.$file ) ) {
137
+ //Copy files to destination directory
138
+ $fsrc = fopen($dir .$file,'r');
139
+ $fdest = fopen($target_path .$file,'w+');
140
+ $len = stream_copy_to_stream($fsrc,$fdest);
141
+ fclose($fsrc);
142
+ fclose($fdest);
143
+ } else { //If $file is a directory
144
+ $destdir = $target_path .$file; //Modify the destination dir
145
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
146
+ @mkdir($destdir, 0755);
147
+ }
148
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
149
+ }
150
+ }
151
+ }
152
+ closedir($dh);
153
+ }
154
+ }
155
+ return true;
156
+ }
157
+ }
158
+
159
+ //Define DB backup function
160
+ if(!function_exists('db_backup')) {
161
+ function db_backup($path) {
162
+
163
+ $handle = fopen($path .'db-backup.sql', 'w+');
164
+
165
+ $path_sql = $path .'/db-backup.sql';
166
+ $db_name = DB_NAME;
167
+ $db_user = DB_USER;
168
+ $db_pass = DB_PASSWORD;
169
+ $db_host = DB_HOST;
170
+
171
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name");
172
+ fwrite($handle,$output);
173
+ fclose($handle);
174
+ return true;
175
+ }
176
+ }
177
+
178
+ //define dbDumpFileSize function
179
+ if(!function_exists('dbDumpFileSize')) {
180
+ function dbDumpFileSize($path) {
181
+ if(glob($path . "*.sql")) {
182
+ foreach (glob($path . "*.sql") as $db) {
183
+ $filesize = filesize($db);
184
+ }
185
+ }
186
+ if ($filesize > 1) {
187
+ return true;
188
+ }
189
+ }
190
+ }
191
+
192
+ //Define the create_siteinfo function
193
+ if(!function_exists('create_siteinfo')) {
194
+ function create_siteinfo($path, $table_prefix) {
195
+ $siteinfo = $path ."backupsiteinfo.txt";
196
+ $handle = fopen($siteinfo, 'w+');
197
+ $entry = site_url( '/' ) ."\n$table_prefix";
198
+ fwrite($handle, $entry);
199
+ fclose($handle);
200
+ return true;
201
+ }
202
+ }
203
+
204
+ //Define recursive_delete function
205
+ if(!function_exists('recursive_delete')){
206
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
207
+ if( is_dir($dir) ){
208
+ if($dh = opendir($dir)) {
209
+ while( ($file = readdir($dh)) !== false ) {
210
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
211
+ if(!is_dir($dir .'/'. $file)) {
212
+ unlink($dir .'/'. $file);
213
+ } else {
214
+ recursive_delete($dir.'/'. $file, $ignore);
215
+ }
216
+ }
217
+ }
218
+ }
219
+ @rmdir($dir);
220
+ closedir($dh);
221
+ }
222
+ return true;
223
+ }
224
+ }
225
+
226
+ //Define zip function
227
+ function zip($source, $destination, $ignore) {
228
+ if (is_string($source)) $source_arr = array($source); // convert it to array
229
+ if (!extension_loaded('zip')) {
230
+ return false;
231
+ }
232
+ $zip = new ZipArchive();
233
+ if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
234
+ return false;
235
+ }
236
+ foreach ($source_arr as $source) {
237
+ if (!file_exists($source)) continue;
238
+ $source = str_replace('\\', '/', realpath($source));
239
+ if (is_dir($source) === true) {
240
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
241
+ foreach ($files as $file) {
242
+ if (!preg_match($ignore, $file)) {
243
+ $file = str_replace('\\', '/', realpath($file));
244
+ if (is_dir($file) === true) {
245
+ $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
246
+ } else if (is_file($file) === true) {
247
+ $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
248
+ }
249
+ }
250
+ }
251
+ } else if (is_file($source) === true) {
252
+ $zip->addFromString(basename($source), file_get_contents($source));
253
+ }
254
+ }
255
+ return $zip->close();
256
+ }
257
+
258
+ //load presstrends
259
+ function load_presstrends() {
260
+ global $WPBackitup;
261
+ if($WPBackitup->get_option( 'presstrends' ) == 'enabled') {
262
+ // PressTrends Account API Key
263
+ $api_key = 'rwiyhqfp7eioeh62h6t3ulvcghn2q8cr7j5x';
264
+ $auth = 'lpa0nvlhyzbyikkwizk4navhtoaqujrbw';
265
+
266
+ // Start of Metrics
267
+ global $wpdb;
268
+ $data = get_transient( 'presstrends_cache_data' );
269
+ if ( !$data || $data == '' ) {
270
+ $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
271
+ $url = $api_base . $auth . '/api/' . $api_key . '/';
272
+
273
+ $count_posts = wp_count_posts();
274
+ $count_pages = wp_count_posts( 'page' );
275
+ $comments_count = wp_count_comments();
276
+
277
+ // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
278
+ if ( function_exists( 'wp_get_theme' ) ) {
279
+ $theme_data = wp_get_theme();
280
+ $theme_name = urlencode( $theme_data->Name );
281
+ } else {
282
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
283
+ $theme_name = $theme_data['Name'];
284
+ }
285
+
286
+ $plugin_name = '&';
287
+ foreach ( get_plugins() as $plugin_info ) {
288
+ $plugin_name .= $plugin_info['Name'] . '&';
289
+ }
290
+ // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
291
+ $plugin_data = get_plugin_data( __FILE__ );
292
+ $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
293
+ $data = array(
294
+ 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
295
+ 'posts' => $count_posts->publish,
296
+ 'pages' => $count_pages->publish,
297
+ 'comments' => $comments_count->total_comments,
298
+ 'approved' => $comments_count->approved,
299
+ 'spam' => $comments_count->spam,
300
+ 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
301
+ 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
302
+ 'theme_version' => $plugin_data['Version'],
303
+ 'theme_name' => $theme_name,
304
+ 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ),
305
+ 'plugins' => count( get_option( 'active_plugins' ) ),
306
+ 'plugin' => urlencode( $plugin_name ),
307
+ 'wpversion' => get_bloginfo( 'version' ),
308
+ );
309
+
310
+ foreach ( $data as $k => $v ) {
311
+ $url .= $k . '/' . $v . '/';
312
+ }
313
+ wp_remote_get( $url );
314
+ set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
315
+ }
316
+ }
317
+ }
318
+ // PressTrends WordPress Action
319
+ add_action('admin_init', 'load_presstrends');
tags/1.4.1/lib/includes/auto_update.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Auto Update
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ class EDD_SL_Plugin_Updater {
14
+ private $api_url = '';
15
+ private $api_data = array();
16
+ private $name = '';
17
+ private $slug = '';
18
+
19
+ /**
20
+ * Class constructor.
21
+ *
22
+ * @uses plugin_basename()
23
+ * @uses hook()
24
+ *
25
+ * @param string $_api_url The URL pointing to the custom API endpoint.
26
+ * @param string $_plugin_file Path to the plugin file.
27
+ * @param array $_api_data Optional data to send with API calls.
28
+ * @return void
29
+ */
30
+ function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
31
+ $this->api_url = trailingslashit( $_api_url );
32
+ $this->api_data = urlencode_deep( $_api_data );
33
+ $this->name = plugin_basename( $_plugin_file );
34
+ $this->slug = basename( $_plugin_file, '.php');
35
+ $this->version = $_api_data['version'];
36
+
37
+ // Set up hooks.
38
+ $this->hook();
39
+ }
40
+
41
+ /**
42
+ * Set up Wordpress filters to hook into WP's update process.
43
+ *
44
+ * @uses add_filter()
45
+ *
46
+ * @return void
47
+ */
48
+ private function hook() {
49
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
50
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
51
+ }
52
+
53
+ /**
54
+ * Check for Updates at the defined API endpoint and modify the update array.
55
+ *
56
+ * This function dives into the update api just when Wordpress creates its update array,
57
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
58
+ * It is reassembled from parts of the native Wordpress plugin update code.
59
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
60
+ *
61
+ * @uses api_request()
62
+ *
63
+ * @param array $_transient_data Update array build by Wordpress.
64
+ * @return array Modified update array with custom plugin data.
65
+ */
66
+ function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
67
+
68
+
69
+ if( empty( $_transient_data ) ) return $_transient_data;
70
+
71
+ $to_send = array( 'slug' => $this->slug );
72
+
73
+ $api_response = $this->api_request( 'plugin_latest_version', $to_send );
74
+
75
+ if( false !== $api_response && is_object( $api_response ) ) {
76
+ if( version_compare( $this->version, $api_response->new_version, '<' ) )
77
+ $_transient_data->response[$this->name] = $api_response;
78
+ }
79
+ return $_transient_data;
80
+ }
81
+
82
+
83
+ /**
84
+ * Updates information on the "View version x.x details" page with custom data.
85
+ *
86
+ * @uses api_request()
87
+ *
88
+ * @param mixed $_data
89
+ * @param string $_action
90
+ * @param object $_args
91
+ * @return object $_data
92
+ */
93
+ function plugins_api_filter( $_data, $_action = '', $_args = null ) {
94
+ if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
95
+
96
+ $to_send = array( 'slug' => $this->slug );
97
+
98
+ $api_response = $this->api_request( 'plugin_information', $to_send );
99
+ if ( false !== $api_response ) $_data = $api_response;
100
+
101
+ return $_data;
102
+ }
103
+
104
+ /**
105
+ * Calls the API and, if successfull, returns the object delivered by the API.
106
+ *
107
+ * @uses get_bloginfo()
108
+ * @uses wp_remote_post()
109
+ * @uses is_wp_error()
110
+ *
111
+ * @param string $_action The requested action.
112
+ * @param array $_data Parameters for the API action.
113
+ * @return false||object
114
+ */
115
+ private function api_request( $_action, $_data ) {
116
+
117
+ global $wp_version;
118
+
119
+ $data = array_merge( $this->api_data, $_data );
120
+ if( $data['slug'] != $this->slug )
121
+ return;
122
+
123
+ $api_params = array(
124
+ 'edd_action' => 'get_version',
125
+ 'license' => $data['license'],
126
+ 'name' => $data['item_name'],
127
+ 'slug' => $this->slug,
128
+ 'author' => $data['author']
129
+ );
130
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
131
+
132
+ if ( !is_wp_error( $request ) ):
133
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
134
+ if( $request )
135
+ $request->sections = maybe_unserialize( $request->sections );
136
+ return $request;
137
+ else:
138
+ return false;
139
+ endif;
140
+ }
141
+ }
tags/1.4.1/lib/includes/backup.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Backup Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ global $WPBackitup;
14
+
15
+ //limit process to 15 minutes
16
+ @set_time_limit(900);
17
+
18
+ //Define variables
19
+ $backup_project_dirname = get_bloginfo('name') .'-Export-' .date('Y-m-d-Hi');
20
+ $backup_project_path = WPBACKITUP_DIRNAME ."/backups/". $backup_project_dirname .'/';
21
+
22
+ //create log file
23
+ $log = WPBACKITUP_DIRNAME ."/logs/status.log";
24
+ unlink($log);
25
+ $fh = fopen($log, 'w') or die("Can't open log file");
26
+
27
+ //Delete the existing backup directory
28
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
29
+
30
+ //Re-create and empty backup dir
31
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
32
+ fwrite($fh, '<div class="prerequsites">0</div>');
33
+ fwrite($fh, '<div class="error101">1</div>');
34
+ fclose($fh);
35
+ die();
36
+ }
37
+
38
+ //Check to see if the directory is writeable
39
+ if(!is_writeable(WPBACKITUP_DIRNAME ."/backups/")) {
40
+ fwrite($fh, '<div class="prerequsites">0</div>');
41
+ fwrite($fh, '<div class="error102">1</div>');
42
+ die();
43
+ } else {
44
+ //If the directory is writeable, create the backup folder if it doesn't exist
45
+ if( !is_dir($backup_project_path) ) {
46
+ @mkdir($backup_project_path, 0755);
47
+ }
48
+ foreach(glob(WPBACKITUP_DIRNAME ."/backups/*.zip") as $zip) {
49
+ unlink($zip);
50
+ }
51
+ fwrite($fh, '<div class="prerequisites">1</div>');
52
+ }
53
+
54
+ //Backup with copy
55
+ if(recursive_copy(WPBACKITUP_CONTENT_PATH, $backup_project_path, $ignore = array( 'cgi-bin','.','..','._',$backup_project_dirname,'backupbuddy_backups','*.zip','cache' ) ) ) {
56
+ fwrite($fh, '<div class="backupfiles">1</div>');
57
+ } else {
58
+ fwrite($fh, '<div class="backupfiles">0</div>');
59
+ fwrite($fh, '<div class="error103">1</div>');
60
+ die();
61
+ }
62
+
63
+ //Dump DB to project dir
64
+ if( db_backup($backup_project_path) ) {
65
+ fwrite($fh, '<div class="backupdb">1</div>');
66
+ } else {
67
+ fwrite($fh, '<div class="backupdb">0</div>');
68
+ fwrite($fh, '<div class="error104">1</div>');
69
+ recursive_delete($backup_project_path);
70
+ die();
71
+ }
72
+
73
+ //Check DB filesize
74
+ if (!dbDumpFileSize($backup_project_path)) {
75
+ fwrite($fh, '<div class="backupdb">0</div>');
76
+ fwrite($fh, '<div class="error114">1</div>');
77
+ recursive_delete($backup_project_path);
78
+ die();
79
+ }
80
+
81
+ //Create siteinfo in project dir
82
+ global $wpdb;
83
+
84
+ if (!create_siteinfo($backup_project_path, $wpdb->prefix) ) {
85
+ fwrite($fh, '<div class="infofile">0</div>');
86
+ fwrite($fh, '<div class="error105">1</div>');
87
+ recursive_delete($backup_project_path);
88
+ die();
89
+ } else {
90
+ fwrite($fh, '<div class="infofile">1</div>');
91
+ }
92
+
93
+ //Zip the project dir
94
+ $z = new recurseZip();
95
+ $src = rtrim($backup_project_path, '/');
96
+ $z->compress($src, WPBACKITUP_DIRNAME ."/backups/");
97
+ fwrite($fh, '<div class="zipfile">1</div>');
98
+
99
+ //Delete backup dir
100
+ if(!recursive_delete($backup_project_path)) {
101
+ fwrite($fh, '<div class="cleanup">0</div>');
102
+ fwrite($fh, '<div class="error106">1</div>');
103
+ } else {
104
+ fwrite($fh, '<div class="cleanup">1</div>');
105
+ }
106
+
107
+ //close log file
108
+ fwrite($fh, '<div class="finalinfo">1</div>');
109
+ fclose($fh);
110
+
111
+ //End backup function
112
+ die();
tags/1.4.1/lib/includes/recurse_zip.php ADDED
@@ -0,0 +1 @@
 
0
  * WP Backitup Recurse Zip Function
1
  *
2
  * @package WP Backitup
3
  *
4
  * @author jcpeden
5
  * @version 1.4.0
6
  * @since 1.0.1
7
  */
1
+ <?php
2
  * WP Backitup Recurse Zip Function
3
  *
4
  * @package WP Backitup
5
  *
6
  * @author jcpeden
7
  * @version 1.4.0
8
  * @since 1.0.1
9
  */
tags/1.4.1/lib/includes/restore.php ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Restore Functions
5
+ *
6
+ * @package WP Backitup Pro
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+ //define constants
14
+ if( !defined( 'WP_DIR_PATH' ) ) define( 'WP_DIR_PATH', dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) );
15
+
16
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
17
+
18
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', basename(WPBACKITUP_DIR_PATH) );
19
+
20
+ if( !defined( 'WP_CONTENT_PATH' ) ) define( 'WP_CONTENT_PATH', dirname( dirname( WPBACKITUP_DIR_PATH ) ) ) ;
21
+
22
+ // Include recurse_zip.php
23
+ include_once 'recurse_zip.php';
24
+
25
+ //define create_dir function
26
+ if(!function_exists('create_dir')) {
27
+ function create_dir($dir) {
28
+ if( !is_dir($dir) ) {
29
+ @mkdir($dir, 0755);
30
+ }
31
+ return true;
32
+ }
33
+ }
34
+
35
+ if(!function_exists('redo_to_checkpoint')) {
36
+ function redo_to_checkpoint($checkpoint) {
37
+
38
+ if($checkpoint == "db")
39
+ {
40
+ if( glob($restoration_dir_path . "*.cur") ) {
41
+ //collect connection information from form
42
+ fwrite($fh, '<div class="database">In Progress</div>');
43
+ include_once WP_DIR_PATH .'/wp-config.php';
44
+ //Add user to DB in v1.0.5
45
+ $user_id = $_POST['user_id'];
46
+ //Connect to DB
47
+ $output = db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc);
48
+ }
49
+
50
+ }
51
+
52
+ }
53
+ }
54
+
55
+ if(!function_exists('db_backup')) {
56
+ function db_backup($path) {
57
+ $handle = fopen($path .'db-backup.cur', 'w+');
58
+ $path_sql = $path .'db-backup.cur';
59
+ $db_name = DB_NAME;
60
+ $db_user = DB_USER;
61
+ $db_pass = DB_PASSWORD;
62
+ $db_host = DB_HOST;
63
+ $output = shell_exec("mysqldump --user $db_user --password=$db_pass $db_name > '$path_sql'");
64
+ fwrite($handle,$output);
65
+ fclose($handle);
66
+ return true;
67
+ }
68
+ }
69
+
70
+ //Define recusive_copy function
71
+ if(!function_exists('recursive_copy')) {
72
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
73
+ if( is_dir($dir) ) { //If the directory exists
74
+ if ($dh = opendir($dir) ) {
75
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
76
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
77
+ if (!is_dir( $dir.$file ) ) {
78
+ //Copy files to destination directory
79
+ //echo 'Copying ' .$dir .$file . ' to ' .$target_path .$file .'<br />';
80
+ $fsrc = fopen($dir .$file,'r');
81
+ $fdest = fopen($target_path .$file,'w+');
82
+ $len = stream_copy_to_stream($fsrc,$fdest);
83
+ fclose($fsrc);
84
+ fclose($fdest);
85
+ } else { //If $file is a directory
86
+ $destdir = $target_path .$file; //Modify the destination dir
87
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
88
+ @mkdir($destdir, 0755);
89
+ }
90
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
91
+ }
92
+ }
93
+ }
94
+ closedir($dh);
95
+ }
96
+ }
97
+ return true;
98
+ }
99
+ }
100
+
101
+ //Define recursive_delete function
102
+ if(!function_exists('recursive_delete')){
103
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
104
+ if( is_dir($dir) ){
105
+ if($dh = opendir($dir)) {
106
+ while( ($file = readdir($dh)) !== false ) {
107
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
108
+ if(!is_dir($dir .'/' .$file)) {
109
+ //echo 'Deleting ' .$dir .'/' .$file '<br />';
110
+ unlink($dir .'/' .$file);
111
+ } else {
112
+ recursive_delete($dir .'/' .$file, $ignore);
113
+ }
114
+ }
115
+ }
116
+ }
117
+ @rmdir($dir);
118
+ closedir($dh);
119
+ }
120
+ return true;
121
+ }
122
+ }
123
+
124
+ //define db_import function
125
+ if(!function_exists('db_import')) {
126
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
127
+ //13-4-13: John C Peden [mail@johncpeden.com] This was incomplete, I've updated to make it work
128
+ foreach(glob($restoration_dir_path . "*.sql") as $sql_file) {
129
+ $db_name = DB_NAME;
130
+ $db_user = DB_USER;
131
+ $db_pass = DB_PASSWORD;
132
+ $db_host = DB_HOST;
133
+ $command = "mysql --user='$db_user' --password='$db_pass' --host='$db_host' $db_name < '$sql_file'";
134
+ $output = shell_exec(($command));
135
+ }
136
+ return true;
137
+ }
138
+ }
139
+
140
+ //create log file
141
+ $log = WPBACKITUP_DIR_PATH .'/logs/status.log';
142
+ unlink($log);
143
+ $fh = fopen($log, 'w') or die( "Can't write to log file" );
144
+
145
+ // 15 minutes per image should be PLENTY
146
+ @set_time_limit(900);
147
+
148
+ //Delete the existing backup directory
149
+ recursive_delete( WPBACKITUP_DIR_PATH .'/backups/' );
150
+
151
+ //Re-create and empty backup dir
152
+ if(!create_dir( WPBACKITUP_DIR_PATH .'/backups/' )) {
153
+ fwrite($fh, '<div class="error201">1</div>');
154
+ fclose($fh);
155
+ die();
156
+ }
157
+
158
+ //Move the uploaded zip to the restoration directory
159
+ $restore_file_name = basename( $_FILES['wpbackitup-zip']['name']);
160
+ if( $restore_file_name == '') {
161
+ fwrite($fh, '<div class="error201">1</div>');
162
+ fclose($fh);
163
+ die();
164
+ }
165
+
166
+ $restore_path = WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name;
167
+ if(move_uploaded_file($_FILES['wpbackitup-zip']['tmp_name'], $restore_path)) {
168
+ fwrite($fh, '<div class="upload">1</div>');
169
+ } else {
170
+ fwrite($fh, '<div class="error203">1</div>');
171
+ fclose($fh);
172
+ die();
173
+ }
174
+
175
+ //unzip the upload
176
+ $zip = new ZipArchive;
177
+ $res = $zip->open(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
178
+ if ($res === TRUE) {
179
+ $zip->extractTo(WPBACKITUP_DIR_PATH .'/backups/');
180
+ $zip->close();
181
+ fwrite($fh, '<div class="unzipping">1</div>');
182
+ } else {
183
+ fwrite($fh, '<div class="error204">1</div>');
184
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
185
+ fclose($fh);
186
+ die();
187
+ }
188
+
189
+ //Identify the restoration directory
190
+ if ( count( glob( WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) ) == 1 ) {
191
+ foreach( glob(WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) as $dir) {
192
+ $restoration_dir_path = $dir .'/';
193
+ }
194
+ }
195
+
196
+ //Validate the restoration
197
+ if(glob($restoration_dir_path .'backupsiteinfo.txt') ){
198
+ fwrite($fh, '<div class="validation">1</div>');
199
+ } else {
200
+ fwrite($fh, '<div class="error204">1</div>');
201
+ recursive_delete($restoration_dir_path);
202
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
203
+ fclose($fh);
204
+ die();
205
+ }
206
+
207
+ // Backup the current database
208
+ if( db_backup($restoration_dir_path) ) {
209
+ fwrite($fh, '<div class="restore_point">1</div>');
210
+ } else {
211
+ fwrite($fh, '<div class="error205">1</div>');
212
+ fclose($fh);
213
+ die();
214
+ }
215
+
216
+ //if there is a database dump to restore
217
+ if( glob($restoration_dir_path . "*.sql") ) {
218
+
219
+ //Collect connection information from form
220
+ include_once WP_DIR_PATH .'/wp-config.php';
221
+
222
+ //Add user to DB in v1.0.5
223
+ $user_id = $_POST['user_id'];
224
+
225
+ //Connect to DB
226
+ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
227
+ if ( !$dbc ) {
228
+ fwrite($fh, '<div class="error206">1</div>');
229
+
230
+ recursive_delete($restoration_dir_path);
231
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
232
+ fclose($fh);
233
+ die();
234
+ }
235
+
236
+ //get siteurl
237
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='siteurl';";
238
+ if ($result = mysqli_query($dbc, $q1)) {
239
+ while ($row = mysqli_fetch_row($result)) {
240
+ $siteurl = $row[0];
241
+ }
242
+ mysqli_free_result($result);
243
+ } else {
244
+ fwrite($fh, '<div class="error207">1</div>');
245
+ recursive_delete($restoration_dir_path);
246
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
247
+ fclose($fh);
248
+ die();
249
+ }
250
+
251
+ //get homeurl
252
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='home';";
253
+ if ($result = mysqli_query($dbc, $q2)) {
254
+ while ($row = mysqli_fetch_row($result)) {
255
+ $homeurl = $row[0];
256
+ }
257
+ mysqli_free_result($result);
258
+ } else {
259
+ fwrite($fh, '<div class="error208">1</div>');
260
+ recursive_delete($restoration_dir_path);
261
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
262
+ fclose($fh);
263
+ die();
264
+ }
265
+
266
+ //get user login
267
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
268
+ if ($result = mysqli_query($dbc, $q3)) {
269
+ while ($row = mysqli_fetch_row($result)) {
270
+ $user_login = $row[0];
271
+ }
272
+ mysqli_free_result($result);
273
+ } else {
274
+ fwrite($fh, '<div class="error209">1</div>');
275
+ recursive_delete($restoration_dir_path);
276
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
277
+ fclose($fh);
278
+ die();
279
+ }
280
+
281
+ //get user pass
282
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
283
+ if ($result = mysqli_query($dbc, $q4)) {
284
+ while ($row = mysqli_fetch_row($result)) {
285
+ $user_pass = $row[0];
286
+ }
287
+ mysqli_free_result($result);
288
+ } else {
289
+ fwrite($fh, '<div class="error210">1</div>');
290
+ recursive_delete($restoration_dir_path);
291
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
292
+ fclose($fh);
293
+ die();
294
+ }
295
+
296
+ //get user email
297
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
298
+ if ($result = mysqli_query($dbc, $q5)) {
299
+ while ($row = mysqli_fetch_row($result)) {
300
+ $user_email = $row[0];
301
+ }
302
+ mysqli_free_result($result);
303
+ } else {
304
+ fwrite($fh, '<div class="error211">1</div>');
305
+ recursive_delete($restoration_dir_path);
306
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
307
+ fclose($fh);
308
+ die();
309
+ }
310
+
311
+ //Collect previous backup site url start
312
+ $import_siteinfo_lines = file($restoration_dir_path .'backupsiteinfo.txt');
313
+ $import_siteurl = trim($import_siteinfo_lines[0]);
314
+ $current_siteurl = trim($siteurl ,'/');
315
+ $import_table_prefix = $import_siteinfo_lines[1];
316
+
317
+ //import the database
318
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
319
+ fwrite($fh, '<div class="error212">1</div>');
320
+ recursive_delete($restoration_dir_path);
321
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
322
+ fclose($fh);
323
+ die();
324
+ }
325
+
326
+ //update the database
327
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value='" .$current_siteurl ."' WHERE option_name='siteurl'";
328
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value='" .$homeurl ."' WHERE option_name='home'";
329
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login='" .$user_login ."', user_pass='" .$user_pass ."', user_email='" .$user_email ."' WHERE ID='" .$user_id ."'";
330
+ if(!mysqli_query($dbc, $q6) ) {
331
+ fwrite($fh, '<div class="error213">1</div>');
332
+ recursive_delete($restoration_dir_path);
333
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
334
+ fclose($fh);
335
+ die();
336
+ }
337
+ if(!mysqli_query($dbc, $q7) ) {
338
+ fwrite($fh, '<div class="error214">1</div>');
339
+ recursive_delete($restoration_dir_path);
340
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
341
+ fclose($fh);
342
+ die();
343
+ }
344
+ if(!mysqli_query($dbc, $q8) ) {
345
+ fwrite($fh, '<div class="error215">1</div>');
346
+ recursive_delete($restoration_dir_path);
347
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
348
+ fclose($fh);
349
+ die();
350
+ }
351
+ fwrite($fh, '<div class="database">1</div>');
352
+ } else {
353
+ fwrite($fh, '<div class="error216">1</div>');
354
+ }
355
+
356
+ //Disconnect
357
+ mysqli_close($dbc);
358
+
359
+ //Restore wp-content directories
360
+ if(!recursive_delete(WP_CONTENT_PATH, array( 'cgi-bin','.','..','._', WPBACKITUP_DIRNAME ))) {
361
+ fwrite($fh, '<div class="error217">1</div>');
362
+ recursive_delete($restoration_dir_path);
363
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
364
+ fclose($fh);
365
+ die();
366
+ }
367
+ if(!create_dir(WP_CONTENT_PATH)) {
368
+ fwrite($fh, '<div class="error218">1</div>');
369
+ recursive_delete($restoration_dir_path);
370
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
371
+ fclose($fh);
372
+ die();
373
+ }
374
+ if(recursive_copy($restoration_dir_path, WP_CONTENT_PATH .'/', array( 'cgi-bin', '.', '..','._', $restore_file_name, 'status.log', 'db-backup.sql', 'backupsiteinfo.txt')) ) {
375
+ fwrite($fh, '<div class="wpcontent">1</div>');
376
+ } else {
377
+ fwrite($fh, '<div class="error219">1</div>');
378
+ recursive_delete($restoration_dir_path);
379
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
380
+ fclose($fh);
381
+ die();
382
+ }
383
+
384
+ //Delete the restoration directory
385
+ if(!recursive_delete($restoration_dir_path)) {
386
+ fwrite($fh, '<div class="error220">1</div>');
387
+ fclose($fh);
388
+ } else {
389
+ fwrite($fh, '<div class="cleanup">1</div>');
390
+ }
391
+
392
+ //Delete zip
393
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
394
+
395
+ //close log file
396
+ fwrite($fh, '<div class="finalinfo">1</div>');
397
+ fclose($fh);
398
+
399
+ //End backup function
400
+ die();
tags/1.4.1/lib/includes/restore_from_path.php ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WP Backitup Restore Functions
5
+ *
6
+ * @package WP Backitup
7
+ *
8
+ * @author jcpeden
9
+ * @version 1.4.0
10
+ * @since 1.0.1
11
+ */
12
+
13
+
14
+ //define constants
15
+ if( !defined( 'WP_DIR_PATH' ) ) define( 'WP_DIR_PATH', dirname ( dirname ( dirname ( dirname ( dirname ( dirname ( __FILE__ ) ) ) ) ) ) );
16
+
17
+ if( !defined( 'WPBACKITUP_DIR_PATH' ) ) define( 'WPBACKITUP_DIR_PATH', dirname( dirname( dirname( __FILE__ ) ) ) );
18
+
19
+ if( !defined( 'WPBACKITUP_DIRNAME' ) ) define( 'WPBACKITUP_DIRNAME', basename(WPBACKITUP_DIR_PATH) );
20
+
21
+ if( !defined( 'WP_CONTENT_PATH' ) ) define( 'WP_CONTENT_PATH', dirname( dirname( WPBACKITUP_DIR_PATH ) ) ) ;
22
+
23
+
24
+ //create log file
25
+ $log = WPBACKITUP_DIR_PATH .'/backups/status.log';
26
+ $fh = fopen($log, 'w') or die( "Can't open file" );
27
+ echo '<ul>';
28
+
29
+ // 15 minutes per image should be PLENTY
30
+ @set_time_limit(900);
31
+
32
+ //define create_dir function
33
+ if(!function_exists('create_dir')) {
34
+ function create_dir($dir) {
35
+ if( !is_dir($dir) ) {
36
+ @mkdir($dir, 0755);
37
+ }
38
+ return true;
39
+ }
40
+ }
41
+
42
+ //Define recusive_copy function
43
+ if(!function_exists('recursive_copy')) {
44
+ function recursive_copy($dir, $target_path, $ignore = array( 'cgi-bin','..','._' ) ) {
45
+ if( is_dir($dir) ) { //If the directory exists
46
+ if ($dh = opendir($dir) ) {
47
+ while(($file = readdir($dh)) !== false) { //While there are files in the directory
48
+ if ( !in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
49
+ if (!is_dir( $dir.$file ) ) {
50
+ //Copy files to destination directory
51
+ //echo 'Copying ' .$dir .$file . ' to ' .$target_path .$file .'<br />';
52
+ $fsrc = fopen($dir .$file,'r');
53
+ $fdest = fopen($target_path .$file,'w+');
54
+ $len = stream_copy_to_stream($fsrc,$fdest);
55
+ fclose($fsrc);
56
+ fclose($fdest);
57
+ } else { //If $file is a directory
58
+ $destdir = $target_path .$file; //Modify the destination dir
59
+ if(!is_dir($destdir)) { //Create the destdir if it doesn't exist
60
+ @mkdir($destdir, 0755);
61
+ }
62
+ recursive_copy($dir .$file .'/', $target_path .$file .'/', $ignore);
63
+ }
64
+ }
65
+ }
66
+ closedir($dh);
67
+ }
68
+ }
69
+ return true;
70
+ }
71
+ }
72
+
73
+ //Define recursive_delete function
74
+ if(!function_exists('recursive_delete')){
75
+ function recursive_delete($dir, $ignore = array('cgi-bin','.','..','._') ){
76
+ if( is_dir($dir) ){
77
+ if($dh = opendir($dir)) {
78
+ while( ($file = readdir($dh)) !== false ) {
79
+ if (!in_array($file, $ignore) && substr($file, 0, 1) != '.') { //Check the file is not in the ignore array
80
+ if(!is_dir($dir .'/' .$file)) {
81
+ //echo 'Deleting ' .$dir .'/' .$file '<br />';
82
+ unlink($dir .'/' .$file);
83
+ } else {
84
+ recursive_delete($dir .'/' .$file, $ignore);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ @rmdir($dir);
90
+ closedir($dh);
91
+ }
92
+ return true;
93
+ }
94
+ }
95
+
96
+ //define db_import function
97
+ if(!function_exists('db_import')) {
98
+ function db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc) {
99
+ global $wpdb;
100
+ $sql_files = glob($restoration_dir_path . "*.sql");
101
+ foreach($sql_files as $sql_file) {
102
+ $templine = ''; // Temporary variable, used to store current query
103
+ $lines = file($sql_file); // Read in entire file
104
+ foreach ($lines as $line) { // Loop through each line
105
+ if (substr($line, 0, 2) == '--' || $line == '') continue; // Skip it if it's a comment
106
+ $templine .= $line; // Add this line to the current segment
107
+ if (substr(trim($line), -1, 1) == ';') { // If it has a semicolon at the end, it's the end of the query
108
+ //replace imported site url with current site url
109
+ if( strstr( trim($templine), trim($import_siteurl) ) == TRUE ) //If import site url is found
110
+ $templine = str_replace( trim($import_siteurl), trim($current_siteurl), $templine ); // Replace import site url with current site url
111
+ //if the table prefixes are different, replace the imported site prefixes with the current prefixes
112
+ if ($table_prefix != $import_table_prefix) {
113
+ if( strstr( trim($templine), trim($import_table_prefix) ) == TRUE ) //If import table prefix is found
114
+ $templine = str_replace( trim($import_table_prefix), trim($table_prefix), $templine ); // Replace import site table prefix with current site table prefix
115
+ }
116
+ // Perform the query
117
+ if( mysqli_query($dbc, $templine) === FALSE)
118
+ print('Error performing query \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />');
119
+ $templine = ''; // Reset temp variable to empty
120
+ }
121
+ }
122
+ }
123
+ return true;
124
+ }
125
+ }
126
+
127
+ //Delete any zips in the upload directory first
128
+ foreach (glob(WPBACKITUP_DIR_PATH .'/backups/' .'*.zip') as $file) {
129
+ unlink($file);
130
+ }
131
+
132
+ //Move the uploaded zip to the restoration directory
133
+ $restore_file_name = $_GET['name'];
134
+
135
+ $orig_file_name = WP_DIR_PATH . "/wp-content/uploads/" . $_GET['name'];
136
+ if( $restore_file_name == '') {
137
+ echo '<li class="error">No file selected<li></ul>' ;
138
+ fclose($fh);
139
+ die();
140
+ } else {
141
+ echo '<li>Uploading restoration file...' ;
142
+ }
143
+
144
+ $restore_path = WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name;
145
+ if(copy($orig_file_name, $restore_path)) {
146
+ echo "Done!</li>";
147
+ } else {
148
+ echo '</li><li class="error">Your file could not be uploaded</li></ul>';
149
+ fclose($fh);
150
+ die();
151
+ }
152
+
153
+ //Unzip the uploaded restore file
154
+ echo "<li>Unzipping...";
155
+ //include recurse_zip.php
156
+ include_once 'recurse_zip.php';
157
+ //unzip the upload
158
+ $zip = new ZipArchive;
159
+ $res = $zip->open(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
160
+ if ($res === TRUE) {
161
+ $zip->extractTo(WPBACKITUP_DIR_PATH .'/backups/');
162
+ $zip->close();
163
+ echo 'Done!</li>';
164
+ } else {
165
+ echo '</li><li class="error">Your restoration file could not be unzipped.</li></ul>';
166
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
167
+ fclose($fh);
168
+ die();
169
+ }
170
+
171
+ //Identify the restoration directory
172
+ echo '<li>Validating zip...' ;
173
+ if ( count( glob( WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) ) == 1 ) {
174
+ foreach( glob(WPBACKITUP_DIR_PATH .'/backups/*', GLOB_ONLYDIR ) as $dir) {
175
+ $restoration_dir_path = $dir .'/';
176
+ }
177
+ }
178
+
179
+ //Validate the restoration
180
+ if(glob($restoration_dir_path .'backupsiteinfo.txt') ){
181
+ echo 'Done!</li>';
182
+ } else {
183
+ echo '</li><li class="error">Your zip file appears to be invalid. Please ensure you chose the correct zip file.</li></ul>';
184
+ recursive_delete($restoration_dir_path);
185
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
186
+ fclose($fh);
187
+ die();
188
+ }
189
+
190
+ //Restore wp-content directories
191
+ echo "<li>Restoring wp-content directory..." ;
192
+ if(!recursive_delete(WP_CONTENT_PATH, array( 'cgi-bin','.','..','._', WPBACKITUP_DIRNAME ))) {
193
+ echo '</li><li class="error">Unable to remove existing wp-content directory for import. Please check your CHMOD settings in /wp-content/.</li></ul>';
194
+ recursive_delete($restoration_dir_path);
195
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
196
+ fclose($fh);
197
+ die();
198
+ }
199
+ if(!create_dir(WP_CONTENT_PATH)) {
200
+ echo '</li><li class="error">Unable to create new wp-content directory for import. Please check your CHMOD settings in /wp-content/.</li></ul>';
201
+ recursive_delete($restoration_dir_path);
202
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
203
+ fclose($fh);
204
+ die();
205
+ }
206
+ if(recursive_copy($restoration_dir_path, WP_CONTENT_PATH .'/', array( 'cgi-bin', '.', '..','._', $restore_file_name, 'status.log', 'db-backup.sql', 'backupsiteinfo.txt')) ) {
207
+ echo 'Done!</li>';
208
+ } else {
209
+ echo '</li><li class="error">Unable to import wp-content. Please try again.</li></ul>';
210
+ recursive_delete($restoration_dir_path);
211
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
212
+ fclose($fh);
213
+ die();
214
+ }
215
+
216
+ //if there is a database dump to restore
217
+ if( glob($restoration_dir_path . "*.sql") ) {
218
+ //collect connection information from form
219
+ echo "<li>Restoring database..." ;
220
+ include_once WP_DIR_PATH .'/wp-config.php';
221
+ //Add user to DB in v1.0.5
222
+ $user_id = $_GET['userid'];
223
+ //Connect to DB
224
+ $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
225
+ if ( !$dbc ) {
226
+ echo '</li><li class="error">Unable to connect to your current database: " .mysqli_connect_error() ."</li></ul>';
227
+ recursive_delete($restoration_dir_path);
228
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
229
+ fclose($fh);
230
+ die();
231
+ }
232
+ //get siteurl
233
+ $q1 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='siteurl';";
234
+ if ($result = mysqli_query($dbc, $q1)) {
235
+ while ($row = mysqli_fetch_row($result)) {
236
+ $siteurl = $row[0];
237
+ }
238
+ mysqli_free_result($result);
239
+ } else {
240
+ echo '</li><li class="error">Unable to get current site URL from database. Please try again.</li></ul>';
241
+ recursive_delete($restoration_dir_path);
242
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
243
+ fclose($fh);
244
+ die();
245
+ }
246
+ //get homeurl
247
+ $q2 = "SELECT option_value FROM " .$table_prefix ."options WHERE option_name ='home';";
248
+ if ($result = mysqli_query($dbc, $q2)) {
249
+ while ($row = mysqli_fetch_row($result)) {
250
+ $homeurl = $row[0];
251
+ }
252
+ mysqli_free_result($result);
253
+ } else {
254
+ echo '</li><li class="error">Unable to get current home URL from database. Please try again.</li></ul>';
255
+ recursive_delete($restoration_dir_path);
256
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
257
+ fclose($fh);
258
+ die();
259
+ }
260
+ //get user login
261
+ $q3 = "SELECT user_login FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
262
+ if ($result = mysqli_query($dbc, $q3)) {
263
+ while ($row = mysqli_fetch_row($result)) {
264
+ $user_login = $row[0];
265
+ }
266
+ mysqli_free_result($result);
267
+ } else {
268
+ echo '</li><li class="error">Unable to get current user ID from database. Please try again.</li></ul>';
269
+ recursive_delete($restoration_dir_path);
270
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
271
+ fclose($fh);
272
+ die();
273
+ }
274
+ //get user pass
275
+ $q4 = "SELECT user_pass FROM ". $table_prefix ."users WHERE ID=" .$user_id .";";
276
+ if ($result = mysqli_query($dbc, $q4)) {
277
+ while ($row = mysqli_fetch_row($result)) {
278
+ $user_pass = $row[0];
279
+ }
280
+ mysqli_free_result($result);
281
+ } else {
282
+ echo '</li><li class="error">Unable to get current user password from database. Please try again.</li></ul>';
283
+ recursive_delete($restoration_dir_path);
284
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
285
+ fclose($fh);
286
+ die();
287
+ }
288
+ //get user email
289
+ $q5 = "SELECT user_email FROM ". $table_prefix ."users WHERE ID=" .$user_id ."";
290
+ if ($result = mysqli_query($dbc, $q5)) {
291
+ while ($row = mysqli_fetch_row($result)) {
292
+ $user_email = $row[0];
293
+ }
294
+ mysqli_free_result($result);
295
+ } else {
296
+ echo '</li><li class="error">Unable to get current user email from database. Please try again.</li></ul>';
297
+ recursive_delete($restoration_dir_path);
298
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
299
+ fclose($fh);
300
+ die();
301
+ }
302
+ //Collect previous backup site url start
303
+ $import_siteinfo_lines = file($restoration_dir_path .'backupsiteinfo.txt');
304
+ $import_siteurl = trim($import_siteinfo_lines[0]);
305
+ $current_siteurl = trim($siteurl ,'/');
306
+ $import_table_prefix = $import_siteinfo_lines[1];
307
+ //import the database
308
+ if(!db_import($restoration_dir_path, $import_siteurl, $current_siteurl, $table_prefix, $import_table_prefix, $dbc)) {
309
+ echo '</li><li class="error">Unable to get import your database. This may require importing the file manually.</li></ul>';
310
+ recursive_delete($restoration_dir_path);
311
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
312
+ fclose($fh);
313
+ die();
314
+ }
315
+ //update the database
316
+ $q6 = "UPDATE ". $table_prefix ."options SET option_value='" .$current_siteurl ."' WHERE option_name='siteurl'";
317
+ $q7 = "UPDATE ". $table_prefix ."options SET option_value='" .$homeurl ."' WHERE option_name='home'";
318
+ $q8 = "UPDATE ". $table_prefix ."users SET user_login='" .$user_login ."', user_pass='" .$user_pass ."', user_email='" .$user_email ."' WHERE ID='" .$user_id ."'";
319
+ if(!mysqli_query($dbc, $q6) ) {
320
+ echo '</li><li class="error">Unable to update your current site URL value. This may require importing the file manually.</li></ul>';
321
+ recursive_delete($restoration_dir_path);
322
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
323
+ fclose($fh);
324
+ die();
325
+ }
326
+ if(!mysqli_query($dbc, $q7) ) {
327
+ echo '</li><li class="error">Unable to update your current home URL value. This may require importing the file manually.</li></ul>';
328
+ recursive_delete($restoration_dir_path);
329
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
330
+ fclose($fh);
331
+ die();
332
+ }
333
+ if(!mysqli_query($dbc, $q8) ) {
334
+ echo '</li><li class="error">Unable to update your user information. This may require importing the file manually.</li></ul>';
335
+ recursive_delete($restoration_dir_path);
336
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
337
+ fclose($fh);
338
+ die();
339
+ }
340
+ echo 'Done!</li>';
341
+ } else {
342
+ echo '<li class="error">Warning: Database not detected in import file.</li>';
343
+ }
344
+
345
+ //Disconnect
346
+ mysqli_close($dbc);
347
+
348
+ //Delete the restoration directory
349
+ recursive_delete($restoration_dir_path);
350
+
351
+ //Delete zip
352
+ unlink(WPBACKITUP_DIR_PATH .'/backups/' . $restore_file_name);
353
+
354
+ //close log file
355
+ echo '<li>Restoration complete. Please refresh the page.</li>';
356
+ echo '</ul>';
357
+ fclose($fh);
358
+
359
+ //End backup function
360
+ die();
tags/1.4.1/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 wor