Version Description
- Security improvement
- Some environment checks were carried out which ensure that the plugin works seamlessly. The mentioned checks are necessary for the plugin to work as intended.
Download this release
Release Info
Developer | BackupGuard |
Plugin | WordPress Backup and Migrate Plugin – Backup Guard |
Version | 1.4.1 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.4.1
- BackupGuard.php +34 -55
- README.txt +19 -5
- backup.php +2 -2
- com/core/SGBoot.php +6 -10
- com/core/functions.php +21 -0
- com/core/notice/SGNoticeHandler.php +16 -0
- public/include/functions.php +22 -0
- public/services.php +1 -1
- public/templates/notices/missed_table.php +13 -0
- public/templates/notices/ping_permission.php +14 -0
BackupGuard.php
CHANGED
@@ -337,7 +337,7 @@ function backup_guard_create_schedule()
|
|
337 |
function backup_guard_get_manual_modal()
|
338 |
{
|
339 |
check_ajax_referer('backupGuardAjaxNonce', 'token');
|
340 |
-
if (
|
341 |
require_once(SG_PUBLIC_AJAX_PATH.'modalManualBackup.php');
|
342 |
}
|
343 |
exit();
|
@@ -403,11 +403,12 @@ function backup_guard_register_ajax_callbacks()
|
|
403 |
add_action('wp_ajax_backup_guard_cancelBackup', 'backup_guard_cancel_backup');
|
404 |
add_action('wp_ajax_backup_guard_checkBackupCreation', 'backup_guard_check_backup_creation');
|
405 |
add_action('wp_ajax_backup_guard_checkRestoreCreation', 'backup_guard_check_restore_creation');
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
|
|
411 |
add_action('wp_ajax_backup_guard_curlChecker', 'backup_guard_curl_checker');
|
412 |
add_action('wp_ajax_backup_guard_deleteBackup', 'backup_guard_delete_backup');
|
413 |
add_action('wp_ajax_backup_guard_getAction', 'backup_guard_get_action');
|
@@ -502,13 +503,6 @@ function backup_guard_check_php_version_compatibility()
|
|
502 |
add_action('init', 'backup_guard_init');
|
503 |
add_action('wp_ajax_nopriv_backup_guard_awake', 'backup_guard_awake_nopriv');
|
504 |
add_action('admin_post_backup_guard_cloudDropbox', 'backup_guard_cloud_dropbox');
|
505 |
-
add_action('admin_post_backup_guard_cloudGdrive', 'backup_guard_cloud_gdrive');
|
506 |
-
add_action('admin_post_backup_guard_cloudOneDrive', 'backup_guard_cloud_oneDrive');
|
507 |
-
|
508 |
-
function backup_guard_cloud_oneDrive()
|
509 |
-
{
|
510 |
-
require_once(SG_PUBLIC_AJAX_PATH.'cloudOneDrive.php');
|
511 |
-
}
|
512 |
|
513 |
function backup_guard_import_key_file()
|
514 |
{
|
@@ -576,25 +570,10 @@ function backup_guard_check_restore_creation()
|
|
576 |
|
577 |
function backup_guard_cloud_dropbox()
|
578 |
{
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
function backup_guard_cloud_ftp()
|
584 |
-
{
|
585 |
-
require_once(SG_PUBLIC_AJAX_PATH.'cloudFtp.php');
|
586 |
-
}
|
587 |
-
|
588 |
-
function backup_guard_cloud_amazon()
|
589 |
-
{
|
590 |
-
check_ajax_referer('backupGuardAjaxNonce', 'token');
|
591 |
-
require_once(SG_PUBLIC_AJAX_PATH.'cloudAmazon.php');
|
592 |
-
}
|
593 |
-
|
594 |
-
function backup_guard_cloud_gdrive()
|
595 |
-
{
|
596 |
-
check_ajax_referer('backupGuardAjaxNonce', 'token');
|
597 |
-
require_once(SG_PUBLIC_AJAX_PATH.'cloudGdrive.php');
|
598 |
}
|
599 |
|
600 |
function backup_guard_curl_checker()
|
@@ -730,7 +709,7 @@ function backup_guard_init()
|
|
730 |
{
|
731 |
backup_guard_register_ajax_callbacks();
|
732 |
// backupGuardPluginRedirect();
|
733 |
-
|
734 |
//check if database should be updated
|
735 |
if (backupGuardShouldUpdate()) {
|
736 |
SGBoot::install();
|
@@ -747,28 +726,28 @@ function backup_guard_schedule_action($id)
|
|
747 |
}
|
748 |
|
749 |
function sgBackupAdminInit() {
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
}
|
773 |
|
774 |
add_action('admin_init', 'sgBackupAdminInit');
|
337 |
function backup_guard_get_manual_modal()
|
338 |
{
|
339 |
check_ajax_referer('backupGuardAjaxNonce', 'token');
|
340 |
+
if (current_user_can( 'activate_plugins' )) {
|
341 |
require_once(SG_PUBLIC_AJAX_PATH.'modalManualBackup.php');
|
342 |
}
|
343 |
exit();
|
403 |
add_action('wp_ajax_backup_guard_cancelBackup', 'backup_guard_cancel_backup');
|
404 |
add_action('wp_ajax_backup_guard_checkBackupCreation', 'backup_guard_check_backup_creation');
|
405 |
add_action('wp_ajax_backup_guard_checkRestoreCreation', 'backup_guard_check_restore_creation');
|
406 |
+
add_action('wp_ajax_backup_guard_cloudDropbox', 'backup_guard_cloud_dropbox');
|
407 |
+
|
408 |
+
$pluginCapabilities = backupGuardGetCapabilities();
|
409 |
+
if ($pluginCapabilities != BACKUP_GUARD_CAPABILITIES_FREE) {
|
410 |
+
require_once dirname(__FILE__).'/BackupGuardPro.php';
|
411 |
+
}
|
412 |
add_action('wp_ajax_backup_guard_curlChecker', 'backup_guard_curl_checker');
|
413 |
add_action('wp_ajax_backup_guard_deleteBackup', 'backup_guard_delete_backup');
|
414 |
add_action('wp_ajax_backup_guard_getAction', 'backup_guard_get_action');
|
503 |
add_action('init', 'backup_guard_init');
|
504 |
add_action('wp_ajax_nopriv_backup_guard_awake', 'backup_guard_awake_nopriv');
|
505 |
add_action('admin_post_backup_guard_cloudDropbox', 'backup_guard_cloud_dropbox');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
|
507 |
function backup_guard_import_key_file()
|
508 |
{
|
570 |
|
571 |
function backup_guard_cloud_dropbox()
|
572 |
{
|
573 |
+
if (current_user_can('activate_plugins')) {
|
574 |
+
check_ajax_referer('backupGuardAjaxNonce', 'token');
|
575 |
+
require_once(SG_PUBLIC_AJAX_PATH . 'cloudDropbox.php');
|
576 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
}
|
578 |
|
579 |
function backup_guard_curl_checker()
|
709 |
{
|
710 |
backup_guard_register_ajax_callbacks();
|
711 |
// backupGuardPluginRedirect();
|
712 |
+
|
713 |
//check if database should be updated
|
714 |
if (backupGuardShouldUpdate()) {
|
715 |
SGBoot::install();
|
726 |
}
|
727 |
|
728 |
function sgBackupAdminInit() {
|
729 |
+
//load pro plugin updater
|
730 |
+
$pluginCapabilities = backupGuardGetCapabilities();
|
731 |
+
$isLoggedIn = is_user_logged_in();
|
732 |
+
|
733 |
+
if ($pluginCapabilities != BACKUP_GUARD_CAPABILITIES_FREE && $isLoggedIn) {
|
734 |
+
require_once(dirname(__FILE__).'/plugin-update-checker/plugin-update-checker.php');
|
735 |
+
require_once(dirname(__FILE__).'/plugin-update-checker/Puc/v4/Utils.php');
|
736 |
+
require_once(SG_LIB_PATH.'SGAuthClient.php');
|
737 |
+
|
738 |
+
$licenseKey = SGConfig::get('SG_LICENSE_KEY');
|
739 |
+
|
740 |
+
$updateChecker = Puc_v4_Factory::buildUpdateChecker(
|
741 |
+
BackupGuard\Config::URL.'/products/details/'.$licenseKey,
|
742 |
+
SG_BACKUP_GUARD_MAIN_FILE,
|
743 |
+
SG_PRODUCT_IDENTIFIER
|
744 |
+
);
|
745 |
+
|
746 |
+
$updateChecker->addHttpRequestArgFilter(array(
|
747 |
+
SGAuthClient::getInstance(),
|
748 |
+
'filterUpdateChecks'
|
749 |
+
));
|
750 |
+
}
|
751 |
}
|
752 |
|
753 |
add_action('admin_init', 'sgBackupAdminInit');
|
README.txt
CHANGED
@@ -6,7 +6,7 @@ Donate link: https://backup-guard.com/products/backup-wordpress
|
|
6 |
Tags: backup, wordpress backup plugin, backup plugin, database backup, migrate, back up
|
7 |
Requires at least: 3.8
|
8 |
Tested up to: 5.4.2
|
9 |
-
Stable tag: 1.4.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -60,7 +60,7 @@ See <strong>BackupGuard Free</strong> in action here: <a href="https://www.youtu
|
|
60 |
|
61 |
See <strong>BackupGuard Pro</strong> in action here: <a href="https://www.youtube.com/watch?v=TSPgmrSu-ls">https://www.youtube.com/watch?v=TSPgmrSu-ls</a>
|
62 |
|
63 |
-
<h4>A
|
64 |
|
65 |
A WordPress site migration is an easy task if performed properly. There are three different migration scenarios:
|
66 |
<ul>
|
@@ -69,11 +69,14 @@ A WordPress site migration is an easy task if performed properly. There are thre
|
|
69 |
<li>Migrate site between domains or hosts</li>
|
70 |
</ul>
|
71 |
|
72 |
-
Backup Guard
|
|
|
73 |
|
74 |
-
|
75 |
|
76 |
-
|
|
|
|
|
77 |
|
78 |
<h4>Documentation</h4>
|
79 |
The documentation can be found here: <a href="https://backup-guard.com/products/backup-wordpress/doc">https://backup-guard.com/products/backup-wordpress/doc</a>
|
@@ -108,6 +111,13 @@ The documentation can be found here: <a href="https://backup-guard.com/products
|
|
108 |
<li>Install <strong>Pro</strong> version: <a href="https://backup-guard.com/products/backup-wordpress/doc/install-backupguard-pro">here</a></li>
|
109 |
</ul>
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
= Can I use BackupGuard to migrate a website? =
|
112 |
|
113 |
The answer is Yes, you can! Backup Guard Pro supports advanced migration functionality which will help you easily migrate your website from one domain to another. All urls, images and other domain-dependent data will be properly refactored and deployed for the new domain.
|
@@ -157,6 +167,10 @@ When you are facing an issue of any kind with any of our products, the first thi
|
|
157 |
6. Site backup customization
|
158 |
|
159 |
== Changelog ==
|
|
|
|
|
|
|
|
|
160 |
= 1.4.0 =
|
161 |
* Plugin security improvements
|
162 |
|
6 |
Tags: backup, wordpress backup plugin, backup plugin, database backup, migrate, back up
|
7 |
Requires at least: 3.8
|
8 |
Tested up to: 5.4.2
|
9 |
+
Stable tag: 1.4.1
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
60 |
|
61 |
See <strong>BackupGuard Pro</strong> in action here: <a href="https://www.youtube.com/watch?v=TSPgmrSu-ls">https://www.youtube.com/watch?v=TSPgmrSu-ls</a>
|
62 |
|
63 |
+
<h4>A SPECIAL NOTE ON WORDPRESS MIGRATION/h4>
|
64 |
|
65 |
A WordPress site migration is an easy task if performed properly. There are three different migration scenarios:
|
66 |
<ul>
|
69 |
<li>Migrate site between domains or hosts</li>
|
70 |
</ul>
|
71 |
|
72 |
+
Backup Guard free version will help you migrate your website in case there is no change in the domain or the Database prefix.
|
73 |
+
If there is any change in the domain or the DB prefix, Backup Guard Pro will be of use.
|
74 |
|
75 |
+
Backup Guard Pro helps you to migrate in all of the above mentioned three cases in the smoothest possible way. You just have to Backup your site and Restore it in the new location. No additional work will be required, since we handle all changes for you.
|
76 |
|
77 |
+
The issues that users always deal with are: wrong site URL, images not loading, dashboard not being accessible, permalinks not working and more.
|
78 |
+
|
79 |
+
Backup Guard Pro will help you to skip all these problems because of its advanced refactoring and migrating engine.
|
80 |
|
81 |
<h4>Documentation</h4>
|
82 |
The documentation can be found here: <a href="https://backup-guard.com/products/backup-wordpress/doc">https://backup-guard.com/products/backup-wordpress/doc</a>
|
111 |
<li>Install <strong>Pro</strong> version: <a href="https://backup-guard.com/products/backup-wordpress/doc/install-backupguard-pro">here</a></li>
|
112 |
</ul>
|
113 |
|
114 |
+
= Does Backup Guard provide migration with the free version? =
|
115 |
+
|
116 |
+
It is possible to use migration with the free version if:
|
117 |
+
1. There is no change in the domain.
|
118 |
+
2. There is no change in the Database prefix.
|
119 |
+
Please note that even a single symbol change counts as a migration that should be done with the Pro version
|
120 |
+
|
121 |
= Can I use BackupGuard to migrate a website? =
|
122 |
|
123 |
The answer is Yes, you can! Backup Guard Pro supports advanced migration functionality which will help you easily migrate your website from one domain to another. All urls, images and other domain-dependent data will be properly refactored and deployed for the new domain.
|
167 |
6. Site backup customization
|
168 |
|
169 |
== Changelog ==
|
170 |
+
= 1.4.1 =
|
171 |
+
* Security improvement
|
172 |
+
* Some environment checks were carried out which ensure that the plugin works seamlessly. The mentioned checks are necessary for the plugin to work as intended.
|
173 |
+
|
174 |
= 1.4.0 =
|
175 |
* Plugin security improvements
|
176 |
|
backup.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Backup
|
5 |
* Plugin URI: https://backup-guard.com/products/backup-wordpress
|
6 |
* Description: Backup Guard is the most complete site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both.
|
7 |
-
* Version: 1.4.
|
8 |
* Author: BackupGuard
|
9 |
* Author URI: https://backup-guard.com/products/backup-wordpress
|
10 |
* License: GPL-2.0+
|
@@ -16,7 +16,7 @@ if (function_exists('activate_backup_guard')) {
|
|
16 |
}
|
17 |
|
18 |
if (!defined('SG_BACKUP_GUARD_VERSION')) {
|
19 |
-
define('SG_BACKUP_GUARD_VERSION', '1.4.
|
20 |
}
|
21 |
|
22 |
if (!defined('SG_BACKUP_GUARD_MAIN_FILE')) {
|
4 |
* Plugin Name: Backup
|
5 |
* Plugin URI: https://backup-guard.com/products/backup-wordpress
|
6 |
* Description: Backup Guard is the most complete site backup and restore plugin. We offer the easiest way to backup, restore or migrate your site. You can backup your files, database or both.
|
7 |
+
* Version: 1.4.1
|
8 |
* Author: BackupGuard
|
9 |
* Author URI: https://backup-guard.com/products/backup-wordpress
|
10 |
* License: GPL-2.0+
|
16 |
}
|
17 |
|
18 |
if (!defined('SG_BACKUP_GUARD_VERSION')) {
|
19 |
+
define('SG_BACKUP_GUARD_VERSION', '1.4.1');
|
20 |
}
|
21 |
|
22 |
if (!defined('SG_BACKUP_GUARD_MAIN_FILE')) {
|
com/core/SGBoot.php
CHANGED
@@ -71,16 +71,14 @@ class SGBoot
|
|
71 |
|
72 |
private static function installConfigTable($sgdb)
|
73 |
{
|
74 |
-
|
75 |
-
$sgdb->query('DROP TABLE IF EXISTS `'.SG_CONFIG_TABLE_NAME.'`;');
|
76 |
-
|
77 |
//create config table
|
78 |
$res = $sgdb->query(
|
79 |
'CREATE TABLE IF NOT EXISTS `'.SG_CONFIG_TABLE_NAME.'` (
|
80 |
`ckey` varchar(100) NOT NULL,
|
81 |
`cvalue` text NOT NULL,
|
82 |
PRIMARY KEY (`ckey`)
|
83 |
-
) DEFAULT CHARSET=utf8;'
|
84 |
);
|
85 |
if ($res===false) {
|
86 |
return false;
|
@@ -109,8 +107,7 @@ class SGBoot
|
|
109 |
|
110 |
private static function installScheduleTable($sgdb)
|
111 |
{
|
112 |
-
|
113 |
-
$sgdb->query('DROP TABLE IF EXISTS `'.SG_SCHEDULE_TABLE_NAME.'`;');
|
114 |
|
115 |
//create schedule table
|
116 |
$res = $sgdb->query(
|
@@ -121,7 +118,7 @@ class SGBoot
|
|
121 |
`schedule_options` varchar(255) NOT NULL,
|
122 |
`backup_options` text NOT NULL,
|
123 |
PRIMARY KEY (`id`)
|
124 |
-
) DEFAULT CHARSET=utf8;'
|
125 |
);
|
126 |
if ($res===false) {
|
127 |
return false;
|
@@ -132,8 +129,7 @@ class SGBoot
|
|
132 |
|
133 |
private static function installActionTable($sgdb)
|
134 |
{
|
135 |
-
|
136 |
-
$sgdb->query('DROP TABLE IF EXISTS `'.SG_ACTION_TABLE_NAME.'`;');
|
137 |
|
138 |
//create action table
|
139 |
$res = $sgdb->query(
|
@@ -148,7 +144,7 @@ class SGBoot
|
|
148 |
`update_date` datetime DEFAULT NULL,
|
149 |
`options` text NOT NULL,
|
150 |
PRIMARY KEY (`id`)
|
151 |
-
) DEFAULT CHARSET=utf8;"
|
152 |
);
|
153 |
if ($res===false) {
|
154 |
return false;
|
71 |
|
72 |
private static function installConfigTable($sgdb)
|
73 |
{
|
74 |
+
$dbEngine = backupGuardGetDatabaseEngine();
|
|
|
|
|
75 |
//create config table
|
76 |
$res = $sgdb->query(
|
77 |
'CREATE TABLE IF NOT EXISTS `'.SG_CONFIG_TABLE_NAME.'` (
|
78 |
`ckey` varchar(100) NOT NULL,
|
79 |
`cvalue` text NOT NULL,
|
80 |
PRIMARY KEY (`ckey`)
|
81 |
+
) ENGINE='.$dbEngine.' DEFAULT CHARSET=utf8;'
|
82 |
);
|
83 |
if ($res===false) {
|
84 |
return false;
|
107 |
|
108 |
private static function installScheduleTable($sgdb)
|
109 |
{
|
110 |
+
$dbEngine = backupGuardGetDatabaseEngine();
|
|
|
111 |
|
112 |
//create schedule table
|
113 |
$res = $sgdb->query(
|
118 |
`schedule_options` varchar(255) NOT NULL,
|
119 |
`backup_options` text NOT NULL,
|
120 |
PRIMARY KEY (`id`)
|
121 |
+
) ENGINE='.$dbEngine.' DEFAULT CHARSET=utf8;'
|
122 |
);
|
123 |
if ($res===false) {
|
124 |
return false;
|
129 |
|
130 |
private static function installActionTable($sgdb)
|
131 |
{
|
132 |
+
$dbEngine = backupGuardGetDatabaseEngine();
|
|
|
133 |
|
134 |
//create action table
|
135 |
$res = $sgdb->query(
|
144 |
`update_date` datetime DEFAULT NULL,
|
145 |
`options` text NOT NULL,
|
146 |
PRIMARY KEY (`id`)
|
147 |
+
) ENGINE=".$dbEngine." DEFAULT CHARSET=utf8;"
|
148 |
);
|
149 |
if ($res===false) {
|
150 |
return false;
|
com/core/functions.php
CHANGED
@@ -723,6 +723,27 @@ function backupGuardGetFileSelectiveRestore()
|
|
723 |
<?php
|
724 |
}
|
725 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
function backupGuardIncludeFile($filePath)
|
727 |
{
|
728 |
if (file_exists($filePath)) {
|
723 |
<?php
|
724 |
}
|
725 |
|
726 |
+
function checkAllMissedTables()
|
727 |
+
{
|
728 |
+
$sgdb = SGDatabase::getInstance();
|
729 |
+
$allTables = array(SG_CONFIG_TABLE_NAME, SG_SCHEDULE_TABLE_NAME, SG_ACTION_TABLE_NAME);
|
730 |
+
$missedTables = array();
|
731 |
+
$status = true;
|
732 |
+
|
733 |
+
foreach ($allTables as $table) {
|
734 |
+
$query = $sgdb->query("SELECT count(*) as isExists
|
735 |
+
FROM information_schema.TABLES
|
736 |
+
WHERE (TABLE_SCHEMA = '".DB_NAME."') AND (TABLE_NAME = '$table')"
|
737 |
+
);
|
738 |
+
|
739 |
+
if (empty($query[0]['isExists'])) {
|
740 |
+
$status = false;
|
741 |
+
}
|
742 |
+
}
|
743 |
+
|
744 |
+
return $status;
|
745 |
+
}
|
746 |
+
|
747 |
function backupGuardIncludeFile($filePath)
|
748 |
{
|
749 |
if (file_exists($filePath)) {
|
com/core/notice/SGNoticeHandler.php
CHANGED
@@ -8,6 +8,8 @@ class SGNoticeHandler
|
|
8 |
$this->checkMigrationError();
|
9 |
$this->checkRestoreNotWritableError();
|
10 |
$this->checkLiteSpeedWarning();
|
|
|
|
|
11 |
}
|
12 |
|
13 |
private function checkTimeoutError()
|
@@ -22,6 +24,13 @@ class SGNoticeHandler
|
|
22 |
}
|
23 |
}
|
24 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
private function checkMigrationError()
|
27 |
{
|
@@ -59,4 +68,11 @@ class SGNoticeHandler
|
|
59 |
}
|
60 |
}
|
61 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
8 |
$this->checkMigrationError();
|
9 |
$this->checkRestoreNotWritableError();
|
10 |
$this->checkLiteSpeedWarning();
|
11 |
+
$this->checkTables();
|
12 |
+
$this->checkPingFilePermission();
|
13 |
}
|
14 |
|
15 |
private function checkTimeoutError()
|
24 |
}
|
25 |
}
|
26 |
}
|
27 |
+
|
28 |
+
public function checkTables()
|
29 |
+
{
|
30 |
+
if (!checkAllMissedTables()) {
|
31 |
+
SGNotice::getInstance()->addNoticeFromTemplate('missed_table', SG_NOTICE_ERROR, true);
|
32 |
+
}
|
33 |
+
}
|
34 |
|
35 |
private function checkMigrationError()
|
36 |
{
|
68 |
}
|
69 |
}
|
70 |
}
|
71 |
+
|
72 |
+
private function checkPingFilePermission()
|
73 |
+
{
|
74 |
+
if (file_exists(SG_PING_FILE_PATH) && !is_readable(SG_PING_FILE_PATH)) {
|
75 |
+
SGNotice::getInstance()->addNoticeFromTemplate('ping_permission', SG_NOTICE_ERROR, true);
|
76 |
+
}
|
77 |
+
}
|
78 |
}
|
public/include/functions.php
CHANGED
@@ -223,10 +223,32 @@ function backupGuardShouldUpdate()
|
|
223 |
SGBoot::didUpdatePluginVersion();
|
224 |
return SG_FORCE_DB_TABLES_RESET;
|
225 |
}
|
|
|
|
|
|
|
|
|
226 |
|
227 |
return false;
|
228 |
}
|
229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
function backupGuardShouldActivateExtension($extension)
|
231 |
{
|
232 |
$extensionAdapter = SGExtension::getInstance();
|
223 |
SGBoot::didUpdatePluginVersion();
|
224 |
return SG_FORCE_DB_TABLES_RESET;
|
225 |
}
|
226 |
+
|
227 |
+
if (!checkAllMissedTables()) {
|
228 |
+
return true;
|
229 |
+
}
|
230 |
|
231 |
return false;
|
232 |
}
|
233 |
|
234 |
+
function backupGuardGetDatabaseEngine()
|
235 |
+
{
|
236 |
+
global $wpdb;
|
237 |
+
$dbName = $wpdb->dbname;
|
238 |
+
$engine = 'InnoDB';
|
239 |
+
$engineCheckSql = "SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = '$dbName'";
|
240 |
+
$result = $wpdb->get_results($engineCheckSql, ARRAY_A);
|
241 |
+
if (!empty($result)) {
|
242 |
+
$engineCheckSql = "SHOW TABLE STATUS WHERE Name = '".$wpdb->prefix."users' AND Engine = 'MyISAM'";
|
243 |
+
$result = $wpdb->get_results($engineCheckSql, ARRAY_A);
|
244 |
+
if (isset($result[0]['Engine']) && $result[0]['Engine'] == 'MyISAM') {
|
245 |
+
$engine = 'MyISAM';
|
246 |
+
}
|
247 |
+
}
|
248 |
+
|
249 |
+
return $engine;
|
250 |
+
}
|
251 |
+
|
252 |
function backupGuardShouldActivateExtension($extension)
|
253 |
{
|
254 |
$extensionAdapter = SGExtension::getInstance();
|
public/services.php
CHANGED
@@ -16,7 +16,7 @@ require_once(SG_PUBLIC_INCLUDE_PATH.'header.php');
|
|
16 |
<div class="action-links">
|
17 |
<ul class="plugin-action-buttons">
|
18 |
<li>
|
19 |
-
<p id="sg-migration-service-price"><b>$
|
20 |
</li>
|
21 |
<li>
|
22 |
<a class="oreder-now button btn-primary" target="_blank" data-slug="" href="<?php echo SG_MIGRATION_SERVICE_URL?>" aria-label="" data-name=""><?php _backupGuardT('Order now')?></a>
|
16 |
<div class="action-links">
|
17 |
<ul class="plugin-action-buttons">
|
18 |
<li>
|
19 |
+
<p id="sg-migration-service-price"><b>$84.95</b></p>
|
20 |
</li>
|
21 |
<li>
|
22 |
<a class="oreder-now button btn-primary" target="_blank" data-slug="" href="<?php echo SG_MIGRATION_SERVICE_URL?>" aria-label="" data-name=""><?php _backupGuardT('Order now')?></a>
|
public/templates/notices/missed_table.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="sg-error-notice-wrapper">
|
2 |
+
<h2 class="sg-red-color sg-notice-error-h2">
|
3 |
+
Database Issue
|
4 |
+
</h2>
|
5 |
+
<p class="sg-red-color sg-notice-error-p">
|
6 |
+
Some of the Backup Guard Database tables weren’t created for some reason.
|
7 |
+
<br>
|
8 |
+
That could become a problem when backing up. Please, contact our support team for the resolution of the problem.
|
9 |
+
</p>
|
10 |
+
<div class="sg-wrapper-less sg-notice-contact-wrapper">
|
11 |
+
<a href="<?php echo BACKUP_GUARD_WORDPRESS_SUPPORT_URL; ?>" class="btn btn-success" target="_blank">Contact us</a>
|
12 |
+
</div>
|
13 |
+
</div>
|
public/templates/notices/ping_permission.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="sg-error-notice-wrapper">
|
2 |
+
<h2 class="sg-red-color sg-notice-error-h2">
|
3 |
+
Permission issue
|
4 |
+
</h2>
|
5 |
+
<p class="sg-red-color sg-notice-error-p">
|
6 |
+
Seems one of the files needed for backup process doesn't have a writable permission. <br>The file can be found in the wp-content/uploads directory, backup-guard folder. You should give full permission (777) to that directory.
|
7 |
+
</p>
|
8 |
+
<p class="sg-red-color sg-notice-error-p">
|
9 |
+
If you still face a problem after giving the mentioned permission, please, contact our support team with the detailed description of your problem.
|
10 |
+
</p>
|
11 |
+
<div class="sg-wrapper-less sg-notice-contact-wrapper">
|
12 |
+
<a href="https://wordpress.org/support/plugin/backup/" class="btn btn-success" target="_blank">Contact us</a>
|
13 |
+
</div>
|
14 |
+
</div>
|