Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable backups via constant #1191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions functions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,14 @@ function has_server_permissions() {
*/
function is_backup_possible() {

/**
* Kill switch to disable backups with constant `HMBKP_DISABLE` set to true.
* For example in local or development environments.
*/
if (defined(HMBKP_DISABLE) && HMBKP_DISABLE === true){
return false;
}

if ( ! has_server_permissions() || ! is_dir( Path::get_path() ) ) {
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ The script to be entered into the Heart Internet cPanel is: `/usr/bin/php5 /home

If your backups are failing, it's commonly caused by a lack of available resources on your server. To establish this is the case, exclude the complete (or parts of the) uploads folder and run a backup. If that succeeds, you know it's probably a server issue. If it does not succeed, report the results to our support team for further help. You can contact support by enabling support from your Admin Dashboard (recommended), or emailing [email protected]

**Disable backup in local or development environments**

To disable backups add "define('HMBKP_DISABLE', true);" to your wp-config.php.

**Further Support & Feedback**

General support questions should be posted in the <a href="http://wordpress.org/tags/backupwordpress?forum_id=10">WordPress support forums, tagged with backupwordpress.</a>
Expand Down