Showing preview only (1,185K chars total). Download the full file or copy to clipboard to get everything.
Repository: humanmade/backupwordpress
Branch: master
Commit: 440e341b38bc
Files: 164
Total size: 1.1 MB
Directory structure:
gitextract_p5en0dmf/
├── .bowerrc
├── .github/
│ └── ISSUE_TEMPLATE.md
├── .gitignore
├── .jshintrc
├── .scrutinizer.yml
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── admin/
│ ├── actions.php
│ ├── backups-table.php
│ ├── backups.php
│ ├── constants.php
│ ├── enable-support.php
│ ├── extensions.php
│ ├── faq.php
│ ├── filesystem-credentials.php
│ ├── menu.php
│ ├── page.php
│ ├── schedule-form-excludes.php
│ ├── schedule-form.php
│ ├── schedule-sentence.php
│ ├── schedule-settings.php
│ ├── server-info.php
│ └── upsell.php
├── assets/
│ ├── hmbkp.css
│ └── hmbkp.js
├── backdrop/
│ ├── README.md
│ ├── hm-backdrop.php
│ ├── license.txt
│ ├── namespace.php
│ ├── server.php
│ └── task.php
├── backupwordpress.php
├── bin/
│ ├── readme.txt
│ └── release.sh
├── bower.json
├── changelog.txt
├── classes/
│ ├── backup/
│ │ ├── class-backup-engine-database-imysqldump.php
│ │ ├── class-backup-engine-database-mysqldump.php
│ │ ├── class-backup-engine-database.php
│ │ ├── class-backup-engine-file-zip-archive.php
│ │ ├── class-backup-engine-file-zip.php
│ │ ├── class-backup-engine-file.php
│ │ ├── class-backup-engine.php
│ │ ├── class-backup-status.php
│ │ ├── class-backup-utilities.php
│ │ └── class-backup.php
│ ├── class-backupwordpress-wp-cli-command.php
│ ├── class-email-service.php
│ ├── class-excludes.php
│ ├── class-extensions.php
│ ├── class-notices.php
│ ├── class-path.php
│ ├── class-plugin.php
│ ├── class-requirement.php
│ ├── class-requirements.php
│ ├── class-scheduled-backup.php
│ ├── class-schedules.php
│ ├── class-service.php
│ ├── class-services.php
│ ├── class-setup.php
│ ├── class-site-size.php
│ ├── class-webhook-service.php
│ ├── class-wpremote-webhook-service.php
│ └── deprecated.php
├── composer.json
├── functions/
│ ├── core.php
│ └── interface.php
├── grunt/
│ ├── aliases.yml
│ ├── autoprefixer.js
│ ├── bumpup.js
│ ├── checktextdomain.js
│ ├── compress.js
│ ├── concat.js
│ ├── cssmin.js
│ ├── excludes
│ ├── jshint.js
│ ├── makepot.js
│ ├── replace.js
│ ├── shell.js
│ └── uglify.js
├── languages/
│ ├── backupwordpress-ca_ES.mo
│ ├── backupwordpress-ca_ES.po
│ ├── backupwordpress-cs_CZ.mo
│ ├── backupwordpress-cs_CZ.po
│ ├── backupwordpress-da_DK.mo
│ ├── backupwordpress-da_DK.po
│ ├── backupwordpress-de_DE.mo
│ ├── backupwordpress-de_DE.po
│ ├── backupwordpress-el_GR.mo
│ ├── backupwordpress-el_GR.po
│ ├── backupwordpress-en_AU.mo
│ ├── backupwordpress-en_AU.po
│ ├── backupwordpress-en_GB.mo
│ ├── backupwordpress-en_GB.po
│ ├── backupwordpress-es_ES.mo
│ ├── backupwordpress-es_ES.po
│ ├── backupwordpress-eu.mo
│ ├── backupwordpress-eu.po
│ ├── backupwordpress-fr_FR.mo
│ ├── backupwordpress-fr_FR.po
│ ├── backupwordpress-he_IL.mo
│ ├── backupwordpress-he_IL.po
│ ├── backupwordpress-it_IT.mo
│ ├── backupwordpress-it_IT.po
│ ├── backupwordpress-lt_LT.mo
│ ├── backupwordpress-lt_LT.po
│ ├── backupwordpress-lv_LV.mo
│ ├── backupwordpress-lv_LV.po
│ ├── backupwordpress-nl_NL.mo
│ ├── backupwordpress-nl_NL.po
│ ├── backupwordpress-pl_PL.mo
│ ├── backupwordpress-pl_PL.po
│ ├── backupwordpress-pt_BR.mo
│ ├── backupwordpress-pt_BR.po
│ ├── backupwordpress-ro_RO.mo
│ ├── backupwordpress-ro_RO.po
│ ├── backupwordpress-ru_RU.mo
│ ├── backupwordpress-ru_RU.po
│ ├── backupwordpress-sk_SK.mo
│ ├── backupwordpress-sk_SK.po
│ ├── backupwordpress-sr_RS.mo
│ ├── backupwordpress-sr_RS.po
│ ├── backupwordpress-zh-cn.mo
│ ├── backupwordpress-zh-cn.po
│ └── backupwordpress.pot
├── package.json
├── phpunit.xml
├── readme/
│ ├── readme-footer.txt
│ └── readme-header.txt
├── readme.md
├── readme.txt
├── tests/
│ ├── bootstrap.php
│ ├── class-backup-engine/
│ │ ├── common-database-backup-engine-tests.php
│ │ ├── common-file-backup-engine-tests.php
│ │ ├── test-class-backup-engine-database-imysqldump.php
│ │ ├── test-class-backup-engine-database-mysqldump.php
│ │ ├── test-class-backup-engine-database.php
│ │ ├── test-class-backup-engine-file-zip-archive.php
│ │ └── test-class-backup-engine-file-zip.php
│ ├── class-backup-utilities/
│ │ ├── test-get-executable-path.php
│ │ ├── test-get-home-path.php
│ │ └── test-safe-mode.php
│ ├── class-mock-backup-engines.php
│ ├── class-site-backup/
│ │ ├── test-backup-director.php
│ │ └── test-class-site-backup.php
│ ├── class-wp-test-hm-backup-testcase.php
│ ├── data/
│ │ └── response.json
│ ├── ini/
│ │ └── php.ini
│ ├── misc/
│ │ ├── test-path-in-open-basedir.php
│ │ ├── testDetermineStartTime.php
│ │ └── testUninstallActivateDeactivate.php
│ ├── schedule/
│ │ └── testScheduleTest.php
│ ├── test-backup-path.php
│ ├── test-backup-status.php
│ ├── test-excludes.php
│ ├── test-extensions.php
│ ├── test-get-files.php
│ ├── test-is-same-size-format.php
│ ├── test-notices.php
│ └── test-site-size.php
├── uninstall.php
└── whitelist-html/
├── README.md
└── whitelist-html.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .bowerrc
================================================
{
"directory": "assets",
"scripts": {
"postinstall": "rm -rf js/jquery"
}
}
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
### Description of issue
Replace this text with a short description
### Steps to recreate issue
1. Replace this
2. text with
3. the steps
4. to recreate
### Current behavior
Explain what it's doing and why it's wrong
### Expected behavior
Explain what it should be doing after it's fixed.
### Additional Useful Information
1. Results of Basic Troubleshooting Checklist?
================================================
FILE: .gitignore
================================================
.svn
node_modules
npm-debug.log
assets/jquery
readme/faq.txt
build
History.md
vendor
.idea
composer.lock
.DS_Store
releases
package-lock.json
tmp
================================================
FILE: .jshintrc
================================================
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,
"browser": true,
"devel": true,
"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"wp": false,
"hmbkp": false,
"ajaxurl": false
}
}
================================================
FILE: .scrutinizer.yml
================================================
filter:
excluded_paths: [ 'vendor/*', 'bin/*', 'backdrop/*', 'node_modules/*', 'readme/*', 'tests/*', 'languages/*', 'grunt/*', 'Gruntfile.js', '*.min.*']
before_commands:
- "composer self-update"
- "composer install --prefer-source --dev"
tools:
php_code_sniffer:
config: { standard: WordPress }
php_changetracking:
enabled: true
bug_patterns:
- '\bfix(?:es|ed)?\b'
feature_patterns:
- '\badd(?:s|ed)?\b'
- '\bimplement(?:s|ed)?\b'
js_hint: true
php_mess_detector:
config:
naming_rules: { boolean_method_name: true }
controversial_rules: { superglobals: false }
sensiolabs_security_checker: true
php_loc: true
php_hhvm:
enabled: true
command: hhvm
extensions:
- php
php_analyzer:
enabled: true
extensions:
- php
config:
parameter_reference_check: { enabled: false }
checkstyle: { enabled: false }
unreachable_code: { enabled: true }
check_access_control: { enabled: false }
typo_checks: { enabled: true }
check_variables: { enabled: true }
check_calls: { enabled: true, too_many_arguments: true, missing_argument: true, argument_type_checks: lenient }
suspicious_code: { enabled: true, non_existent_class_in_instanceof_check: true, non_existent_class_in_catch_clause: true, non_commented_switch_fallthrough: true, non_commented_empty_catch_block: true, precedence_in_condition_assignment: true, overriding_parameter: false, overriding_closure_use: false, parameter_closure_use_conflict: false, parameter_multiple_times: false, assignment_of_null_return: false, overriding_private_members: false, use_statement_alias_conflict: false }
dead_assignments: { enabled: true }
verify_php_doc_comments: { enabled: true, parameters: true, return: true, suggest_more_specific_types: true, ask_for_return_if_not_inferrable: true, ask_for_param_type_annotation: true }
loops_must_use_braces: { enabled: false }
check_usage_context: { enabled: true, foreach: { value_as_reference: true, traversable: true } }
simplify_boolean_return: { enabled: true }
phpunit_checks: { enabled: false }
reflection_checks: { enabled: false }
precedence_checks: { enabled: true, assignment_in_condition: true, comparison_of_bit_result: true }
basic_semantic_checks: { enabled: true }
unused_code: { enabled: true }
deprecation_checks: { enabled: true }
useless_function_calls: { enabled: true }
metrics_lack_of_cohesion_methods: { enabled: true }
metrics_coupling: { enabled: true, stable_code: { namespace_prefixes: { }, classes: { } } }
doctrine_parameter_binding: { enabled: false }
doctrine_entity_manager_injection: { enabled: false }
symfony_request_injection: { enabled: false }
doc_comment_fixes: { enabled: false }
reflection_fixes: { enabled: false }
use_statement_fixes: { enabled: true, remove_unused: true, preserve_multiple: false, preserve_blanklines: false, order_alphabetically: false }
# PHP Similarity Analyzer and Copy/paste Detector cannot be used at
# the same time right now. Make sure to either remove, or disable one.
php_cpd: false
php_pdepend: true
php_sim:
enabled: true
min_mass: 50
checks:
php:
code_rating: true
duplication: true
================================================
FILE: .travis.yml
================================================
language: php
sudo: false
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- 7.0
env:
# trunk:
- WP_VERSION=master WP_MULTISITE=0
- WP_VERSION=master WP_MULTISITE=1
# latest stable:
- WP_VERSION=4.3.1 WP_MULTISITE=0
# previous stable:
- WP_VERSION=4.2.5 WP_MULTISITE=0
# earliest supported:
- WP_VERSION=3.9.9 WP_MULTISITE=0
matrix:
allow_failures:
- php: hhvm
- php: 7.0
fast_finish: true
exclude:
# Only test latest version of WP with HHVM and PHP 7
- php: hhvm
env: WP_VERSION=3.9.9 WP_MULTISITE=0
- php: hhvm
env: WP_VERSION=4.2.5 WP_MULTISITE=0
- php: hhvm
env: WP_VERSION=4.3.1 WP_MULTISITE=0
- php: 7.0
env: WP_VERSION=3.9.9 WP_MULTISITE=0
- php: 7.0
env: WP_VERSION=4.2.5 WP_MULTISITE=0
- php: 7.0
env: WP_VERSION=4.3.1 WP_MULTISITE=0
cache:
directories:
- vendor
- $HOME/.composer/cache
before_install:
# set up WP install
- export WP_DEVELOP_DIR=/tmp/wordpress/
- mkdir -p $WP_DEVELOP_DIR
- git clone --depth=1 --branch $WP_VERSION git://develop.git.wordpress.org/ $WP_DEVELOP_DIR
# set up tests config
- cd $WP_DEVELOP_DIR
- cp wp-tests-config-sample.php wp-tests-config.php
- sed -i "s/youremptytestdbnamehere/wordpress_test/" wp-tests-config.php
- sed -i "s/yourusernamehere/root/" wp-tests-config.php
- sed -i "s/yourpasswordhere//" wp-tests-config.php
# set up database
- mysql -e 'CREATE DATABASE wordpress_test;' -uroot
- cd $TRAVIS_BUILD_DIR
install:
- git config --global user.email "paul@hmn.md"
- git config --global user.name "Paul de Wouters"
notifications:
email: false
slack:
secure: ZyXhKGpR/VtggG3vcCaZ+50HBn4STi2fOvMKrmZaeS44s+j6lhkYt7qT1UeU1o2Vox2WCrdqfZqT370f4OV3izAgf7Ln+vIYxZvCywL2Cyt4YbHVPX0pMwuDuAW6a1zG5oP87CFZh9YYCHQ6HfX9ATKtnqiuMFx/SjOcD1Yb4Lk=
before_script:
- cd $TRAVIS_BUILD_DIR
- composer self-update
- composer install --no-interaction
script:
- cd $TRAVIS_BUILD_DIR
- |
if [[ "$TRAVIS_PHP_VERSION" == "5.6" && "$WP_VERSION" == "master" && "$WP_MULTISITE" == "0" ]] ; then
phpunit --coverage-clover=coverage.xml
else
phpunit
fi
git:
depth: 1
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to BackUpWordPress
Thanks for stopping by, It's really great that you're here. BackUpWordPress thrives on the contributions of [many](https://github.com/xibodevelopment/backupwordpress/graphs/contributors) and there is always more to do.
There are four main ways you can contribute currently:
- Developing
- Testing
- Translating
- Security
## Developing
Develop your changes in a feature branch and send a pull request to BackUpWordPress' `master` branch for review.
Assign the Pull Request to the Lead Developer: Paul de Wouters, [@pdewouters](https://github.com/pdewouters).
You can use Grunt to generate a built copy of the plugin to test with:
```
npm install
grunt copy:build
```
We try to follow the [WordPress Core Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards).
## Testing
We're trying to solve a hard problem. BackUpWordPress aims to work reliably across 24%+ of the internet that WordPress is installed on. It needs to support the multitude of server setups, plugin and theme configurations and types of sites that WordPress itself can handle. In order to reach this goal we need to be continuously testing our changes to ensure they improve the things we intended to improve and avoid breaking things we didn't intend to break.
We rely on a few different kinds of tests:
- Unit tests help us ensure that small, atomic pieces of code (generally individual functions or methods) do what they should under a variety of input conditions. We use Travis to run them automatically against all new Pull Requests. If you submit a code change you should try to also submit some unit tests to cover the changes you are making. We're [working on documenting how to setup and run our unit tests locally](https://github.com/xibodevelopment/backupwordpress/issues/837).
- Integration tests are something we need, we don't currently have them.
- Manual testing of different hosting environments. If you have access to a specific hosting environment, you can help out hugely by installing BackUpWordPress and testing if it works correctly. We're working on a [host support matrix](https://github.com/xibodevelopment/backupwordpress/issues/838) that you can contribute your findings too but for now please just open a Github issue if you run into a problem.
## Translating
We want BackUpWordPress to be available in as many languages as possible.
All translations are managed here: https://translate.wordpress.org/projects/wp-plugins/backupwordpress/dev please contribute there rather than by submitting new translation files here. You'll need a WordPress.org account.
## Security
We take the security of BackUpWordPress extremely seriously. If you think you've found a security issue with the plugin (whether information disclosure, privilege escalation, or another issue), we'd appreciate responsible disclosure as soon as possible.
To report a security issue, you can email support@xibomarketing.com. We will attempt to give an initial response to security issues within 48 hours at most, however keep in mind that the team is distributed across various timezones, and delays may occur as we discuss internally.
(Please note: For testing, you should install a copy of the project and WordPress on your own server. Do not test on servers you do not own.)
Thank you for contributing!
================================================
FILE: Gruntfile.js
================================================
module.exports = function( grunt ) {
require( 'load-grunt-config' )( grunt );
};
================================================
FILE: admin/actions.php
================================================
<?php
namespace HM\BackUpWordPress;
/**
* Delete the backup and then redirect back to the backups page
*/
function request_delete_backup() {
check_admin_referer( 'hmbkp_delete_backup', 'hmbkp_delete_backup_nonce' );
$schedule = new Scheduled_Backup( sanitize_text_field( urldecode( $_GET['hmbkp_schedule_id'] ) ) );
$deleted = $schedule->delete_backup( sanitize_text_field( base64_decode( $_GET['hmbkp_backup_archive'] ) ) );
if ( is_wp_error( $deleted ) ) {
wp_die( $deleted->get_error_message() );
}
wp_safe_redirect( get_settings_url(), 303 );
die;
}
add_action( 'admin_post_hmbkp_request_delete_backup', 'HM\BackUpWordPress\request_delete_backup' );
/**
* Enable support and then redirect back to the backups page
*/
function request_enable_support() {
check_admin_referer( 'hmbkp_enable_support', 'hmbkp_enable_support_nonce' );
update_option( 'hmbkp_enable_support', true );
wp_safe_redirect( get_settings_url(), 303 );
die;
}
add_action( 'admin_post_hmbkp_request_enable_support', 'HM\BackUpWordPress\request_enable_support' );
/**
* Delete a schedule and all it's backups and then redirect back to the backups page
*/
function request_delete_schedule() {
check_admin_referer( 'hmbkp_delete_schedule', 'hmbkp_delete_schedule_nonce' );
$schedule = new Scheduled_Backup( sanitize_text_field( urldecode( $_GET['hmbkp_schedule_id'] ) ) );
$schedule->cancel( true );
wp_safe_redirect( get_settings_url(), 303 );
die;
}
add_action( 'admin_post_hmbkp_request_delete_schedule', 'HM\BackUpWordPress\request_delete_schedule' );
add_action( 'admin_post_hmbkp_request_credentials', function() {
global $wp_filesystem;
ob_start();
$creds = request_filesystem_credentials( '' );
ob_end_clean();
// Default to showing an error if we're not able to connect.
$url = add_query_arg( 'connection_error', 1, get_settings_url() );
/**
* If we have valid filesystem credentials then let's attempt
* to use them to create the backups directory. If we can't create it in
* WP_CONTENT_DIR then we fallback to trying in uploads.
*/
if ( WP_Filesystem( $creds ) ) {
// If we're able to connect then no need to redirect with an error.
$url = get_settings_url();
// If the backup path exists then let's just try to chmod it to the correct permissions.
if (
is_dir( Path::get_instance()->get_default_path() ) &&
! $wp_filesystem->chmod( Path::get_instance()->get_default_path(), FS_CHMOD_DIR )
) {
$url = add_query_arg( 'creation_error', 1, get_settings_url() );
} else {
// If the path doesn't exist then try to correct the permission for the parent directory and create it.
$wp_filesystem->chmod( dirname( Path::get_instance()->get_default_path() ), FS_CHMOD_DIR );
if (
! $wp_filesystem->mkdir( Path::get_instance()->get_default_path(), FS_CHMOD_DIR ) &&
! $wp_filesystem->mkdir( Path::get_instance()->get_fallback_path(), FS_CHMOD_DIR )
) {
$url = add_query_arg( 'creation_error', 1, get_settings_url() );
}
}
}
wp_safe_redirect( $url , 303 );
die;
} );
/**
* Perform a manual backup
*
* Handles ajax requests as well as standard GET requests
*/
function request_do_backup() {
if ( empty( $_REQUEST['hmbkp_schedule_id'] ) ) {
die;
}
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
check_ajax_referer( 'hmbkp_run_schedule', 'hmbkp_run_schedule_nonce' );
} else {
check_admin_referer( 'hmbkp_run_schedule', 'hmbkp_run_schedule_nonce' );
}
Path::get_instance()->cleanup();
// Fixes an issue on servers which only allow a single session per client
session_write_close();
$schedule_id = sanitize_text_field( urldecode( $_REQUEST['hmbkp_schedule_id'] ) );
$task = new \HM\Backdrop\Task( '\HM\BackUpWordPress\run_schedule_async', $schedule_id );
/**
* Backdrop doesn't cleanup tasks which fatal before they can finish
* so we manually cancel the task if it's already scheduled.
*/
if ( $task->is_scheduled() ) {
$task->cancel();
}
$task->schedule();
die;
}
add_action( 'wp_ajax_hmbkp_run_schedule', 'HM\BackUpWordPress\request_do_backup' );
function run_schedule_async( $schedule_id ) {
$schedule = new Scheduled_Backup( $schedule_id );
$schedule->run();
}
/**
* Send the download file to the browser and then redirect back to the backups page
*/
function request_download_backup() {
check_admin_referer( 'hmbkp_download_backup', 'hmbkp_download_backup_nonce' );
if ( ! file_exists( sanitize_text_field( base64_decode( $_GET['hmbkp_backup_archive'] ) ) ) ) {
return;
}
$url = str_replace( wp_normalize_path( Path::get_home_path() ), home_url( '/' ), trailingslashit( dirname( sanitize_text_field( base64_decode( $_GET['hmbkp_backup_archive'] ) ) ) ) ) . urlencode( pathinfo( sanitize_text_field( base64_decode( $_GET['hmbkp_backup_archive'] ) ), PATHINFO_BASENAME ) );
global $is_apache;
if ( $is_apache ) {
Path::get_instance()->protect_path( 'reset' );
$url = add_query_arg( 'key', HMBKP_SECURE_KEY, $url );
}
wp_safe_redirect( $url, 303 );
die;
}
add_action( 'admin_post_hmbkp_request_download_backup', 'HM\BackUpWordPress\request_download_backup' );
/**
* Cancels a running backup then redirect back to the backups page
*/
function request_cancel_backup() {
check_admin_referer( 'hmbkp_request_cancel_backup', 'hmbkp-request_cancel_backup_nonce' );
$schedule = new Scheduled_Backup( sanitize_text_field( urldecode( $_GET['hmbkp_schedule_id'] ) ) );
$status = $schedule->get_status();
// Delete the running backup
if ( $status->get_backup_filename() && file_exists( trailingslashit( Path::get_path() ) . $status->get_backup_filename() ) ) {
unlink( trailingslashit( Path::get_path() ) . $status->get_backup_filename() );
}
if ( file_exists( $status->get_status_filepath() ) ) {
unlink( $status->get_status_filepath() );
}
Path::get_instance()->cleanup();
wp_safe_redirect( get_settings_url(), 303 );
die;
}
add_action( 'admin_post_hmbkp_request_cancel_backup', 'HM\BackUpWordPress\request_cancel_backup' );
/**
* Dismiss an error and then redirect back to the backups page
*/
function dismiss_error() {
Path::get_instance()->cleanup();
Notices::get_instance()->clear_all_notices();
wp_safe_redirect( wp_get_referer(), 303 );
die;
}
add_action( 'wp_ajax_hmbkp_dismiss_error', 'HM\BackUpWordPress\dismiss_error' );
/**
* Catch the schedule service settings form submission
*
* Validate and either return errors or update the schedule
*/
function edit_schedule_services_submit() {
check_admin_referer( 'hmbkp-edit-schedule-services', 'hmbkp-edit-schedule-services-nonce' );
if ( empty( $_POST['hmbkp_schedule_id'] ) ) {
wp_die( __( 'The schedule ID was not provided. Aborting.', 'backupwordpress' ) );
}
$schedule = new Scheduled_Backup( sanitize_text_field( $_POST['hmbkp_schedule_id'] ) );
$errors = array();
// Save the service options
foreach ( Services::get_services( $schedule ) as $service ) {
$errors = array_merge( $errors, $service->save() );
}
$schedule->save();
if ( ! empty( $errors ) ) {
foreach ( $errors as $error ) {
add_settings_error( $error );
}
}
$redirect = remove_query_arg( array( 'hmbkp_panel', 'action' ), wp_get_referer() );
if ( ! empty( $errors ) ) {
$redirect = wp_get_referer();
}
wp_safe_redirect( $redirect, '303' );
die;
}
add_action( 'admin_post_hmbkp_edit_schedule_services_submit', 'HM\BackUpWordPress\edit_schedule_services_submit' );
/**
* Catch the schedule settings form submission
*
* Validate and either return errors or update the schedule
*/
function edit_schedule_submit() {
check_admin_referer( 'hmbkp-edit-schedule', 'hmbkp-edit-schedule-nonce' );
if ( empty( $_POST['hmbkp_schedule_id'] ) ) {
die;
}
$schedule = new Scheduled_Backup( sanitize_text_field( $_POST['hmbkp_schedule_id'] ) );
$site_size = new Site_Size( $schedule->get_type(), $schedule->get_excludes() );
$errors = $settings = array();
if ( isset( $_POST['hmbkp_schedule_type'] ) ) {
$schedule_type = sanitize_text_field( $_POST['hmbkp_schedule_type'] );
if ( ! trim( $schedule_type ) ) {
$errors['hmbkp_schedule_type'] = __( 'Backup type cannot be empty', 'backupwordpress' );
} elseif ( ! in_array( $schedule_type, array( 'complete', 'file', 'database' ) ) ) {
$errors['hmbkp_schedule_type'] = __( 'Invalid backup type', 'backupwordpress' );
} else {
$settings['type'] = $schedule_type;
}
}
if ( isset( $_POST['hmbkp_schedule_recurrence']['hmbkp_type'] ) ) {
$schedule_recurrence_type = sanitize_text_field( $_POST['hmbkp_schedule_recurrence']['hmbkp_type'] );
if ( empty( $schedule_recurrence_type ) ) {
$errors['hmbkp_schedule_recurrence']['hmbkp_type'] = __( 'Schedule cannot be empty', 'backupwordpress' );
} elseif ( ! in_array( $schedule_recurrence_type, array_keys( cron_schedules() ) ) && 'manually' !== $schedule_recurrence_type ) {
$errors['hmbkp_schedule_recurrence']['hmbkp_type'] = __( 'Invalid schedule', 'backupwordpress' );
} else {
$settings['recurrence'] = $schedule_recurrence_type;
}
}
if ( isset( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_week'] ) ) {
$day_of_week = sanitize_text_field( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_week'] );
if ( ! in_array( $day_of_week, array( 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday' ) ) ) {
$errors['hmbkp_schedule_start_day_of_week'] = __( 'Day of the week must be a valid, lowercase day name', 'backupwordpress' );
} else {
$settings['start_time']['day_of_week'] = $day_of_week;
}
}
if ( ( 'monthly' === $schedule_recurrence_type ) && isset( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_month'] ) ) {
$day_of_month = absint( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_day_of_month'] );
$options = array(
'min_range' => 1,
'max_range' => 31,
);
if ( false === filter_var( $day_of_month, FILTER_VALIDATE_INT, array( 'options' => $options ) ) ) {
$errors['hmbkp_schedule_start_day_of_month'] = __( 'Day of month must be between 1 and 31', 'backupwordpress' );
} else {
$settings['start_time']['day_of_month'] = $day_of_month;
}
}
if ( isset( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_hours'] ) ) {
$hours = absint( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_hours'] );
$options = array(
'min_range' => 0,
'max_range' => 23,
);
if ( false === filter_var( $hours, FILTER_VALIDATE_INT, array( 'options' => $options ) ) ) {
$errors['hmbkp_schedule_start_hours'] = __( 'Hours must be between 0 and 23', 'backupwordpress' );
} else {
$settings['start_time']['hours'] = $hours;
}
}
if ( isset( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_minutes'] ) ) {
$minutes = absint( $_POST['hmbkp_schedule_recurrence']['hmbkp_schedule_start_minutes'] );
$options = array(
'min_range' => 0,
'max_range' => 59,
);
if ( false === filter_var( $minutes, FILTER_VALIDATE_INT, array( 'options' => $options ) ) ) {
$errors['hmbkp_schedule_start_minutes'] = __( 'Minutes must be between 0 and 59', 'backupwordpress' );
} else {
$settings['start_time']['minutes'] = $minutes;
}
}
if ( isset( $_POST['hmbkp_schedule_max_backups'] ) ) {
$max_backups = sanitize_text_field( $_POST['hmbkp_schedule_max_backups'] );
if ( empty( $max_backups ) ) {
$errors['hmbkp_schedule_max_backups'] = __( 'Max backups can\'t be empty', 'backupwordpress' );
} elseif ( ! is_numeric( $max_backups ) ) {
$errors['hmbkp_schedule_max_backups'] = __( 'Max backups must be a number', 'backupwordpress' );
} elseif ( ! ( $max_backups >= 1 ) ) {
$errors['hmbkp_schedule_max_backups'] = __( 'Max backups must be greater than 0', 'backupwordpress' );
} elseif ( $site_size->is_site_size_cached() && disk_space_low( $site_size->get_site_size() * $max_backups ) ) {
$errors['hmbkp_schedule_max_backups'] = sprintf( __( 'Storing %s backups would use %s of disk space but your server only has %s free.', 'backupwordpress' ), '<code>' . number_format_i18n( $max_backups ) . '</code>', '<code>' . size_format( $max_backups * $site_size->get_site_size() ) . '</code>', '<code>' . size_format( disk_free_space( Path::get_path() ) ) . '</code>' );
} else {
$settings['max_backups'] = absint( $max_backups );
}
}
// Save the service options
foreach ( Services::get_services( $schedule ) as $service ) {
$errors = array_merge( $errors, $service->save() );
}
if ( ! empty( $settings['recurrence'] ) && ! empty( $settings['start_time'] ) ) {
// Calculate the start time depending on the recurrence
$start_time = determine_start_time( $settings['recurrence'], $settings['start_time'] );
if ( $start_time ) {
$schedule->set_schedule_start_time( $start_time );
}
}
if ( ! empty( $settings['recurrence'] ) ) {
$schedule->set_reoccurrence( $settings['recurrence'] );
}
if ( ! empty( $settings['type'] ) ) {
$schedule->set_type( $settings['type'] );
}
if ( ! empty( $settings['max_backups'] ) ) {
$schedule->set_max_backups( $settings['max_backups'] );
}
// Save the new settings
$schedule->save();
// Remove any old backups in-case max backups was reduced
$schedule->delete_old_backups();
if ( ! empty( $errors ) ) {
foreach ( $errors as $error ) {
add_settings_error( $error );
}
}
$redirect = remove_query_arg( array( 'hmbkp_panel', 'action' ), wp_get_referer() );
if ( ! empty( $errors ) ) {
$redirect = wp_get_referer();
}
wp_safe_redirect( $redirect, '303' );
die;
}
add_action( 'admin_post_hmbkp_edit_schedule_submit', 'HM\BackUpWordPress\edit_schedule_submit' );
/**
* Add an exclude rule
*
* @access public
* @return void
*/
function add_exclude_rule() {
check_admin_referer( 'hmbkp-add-exclude-rule', 'hmbkp-add-exclude-rule-nonce' );
if ( ! isset( $_GET['hmbkp_exclude_pathname'] ) ) {
return;
}
$schedule = new Scheduled_Backup( sanitize_text_field( $_GET['hmbkp_schedule_id'] ) );
$exclude_rule = sanitize_text_field( $_GET['hmbkp_exclude_pathname'] );
$schedule->set_excludes( $exclude_rule, true );
$schedule->save();
delete_transient( 'hmbkp_root_size' );
wp_safe_redirect( wp_get_referer(), '303' );
die;
}
add_action( 'admin_post_hmbkp_add_exclude_rule', 'HM\BackUpWordPress\add_exclude_rule' );
/**
* Delete an exclude rule
*
* @access public
* @return void
*/
function remove_exclude_rule() {
check_admin_referer( 'hmbkp_remove_exclude_rule', 'hmbkp-remove_exclude_rule_nonce' );
if ( ! isset( $_GET['hmbkp_remove_exclude'] ) ) {
die;
}
$schedule = new Scheduled_Backup( sanitize_text_field( $_GET['hmbkp_schedule_id'] ) );
$excludes = $schedule->get_excludes();
$exclude_rule_to_remove = stripslashes( sanitize_text_field( $_GET['hmbkp_remove_exclude'] ) );
$schedule->set_excludes( array_diff( $excludes->get_user_excludes(), (array) $exclude_rule_to_remove ) );
$schedule->save();
delete_transient( 'hmbkp_root_size' );
wp_safe_redirect( wp_get_referer(), '303' );
die;
}
add_action( 'admin_post_hmbkp_remove_exclude_rule', 'HM\BackUpWordPress\remove_exclude_rule' );
/**
*
* @param null
*/
function recalculate_directory_filesize() {
if ( ! isset( $_GET['hmbkp_recalculate_directory_filesize'] ) || ! check_admin_referer( 'hmbkp-recalculate_directory_filesize' ) ) {
return;
}
// Delete the cached directory size
@unlink( trailingslashit( Path::get_path() ) . '.files' );
$url = add_query_arg( array( 'action' => 'hmbkp_edit_schedule', 'hmbkp_panel' => 'hmbkp_edit_schedule_excludes' ), get_settings_url() );
if ( isset( $_GET['hmbkp_directory_browse'] ) ) {
$url = add_query_arg( 'hmbkp_directory_browse', sanitize_text_field( $_GET['hmbkp_directory_browse'] ), $url );
}
wp_safe_redirect( $url, '303' );
die;
}
add_action( 'load-' . HMBKP_ADMIN_PAGE, 'HM\BackUpWordPress\recalculate_directory_filesize' );
function calculate_site_size() {
$site_size = new Site_Size;
if ( ! $site_size->is_site_size_cached() ) {
$root = new \SplFileInfo( Path::get_root() );
$site_size->filesize( $root );
}
}
add_action( 'load-' . HMBKP_ADMIN_PAGE, 'HM\BackUpWordPress\calculate_site_size' );
/**
* Receive the heartbeat and return backup status
*/
function heartbeat_received( $response, $data ) {
if (!current_user_can('manage_options')) return $response;
$response['heartbeat_interval'] = 'fast';
if ( ! empty( $data['hmbkp_schedule_id'] ) ) {
$schedule = new Scheduled_Backup( sanitize_text_field( urldecode( $data['hmbkp_schedule_id'] ) ) );
$status = new Backup_Status( $schedule->get_id() );
if ( ! empty( $data['hmbkp_is_in_progress'] ) ) {
if ( ! $status->get_status() ) {
$response['hmbkp_schedule_status'] = 0;
// Slow the heartbeat back down
$response['heartbeat_interval'] = 'slow';
} else {
$response['hmbkp_schedule_status'] = schedule_status( $schedule, false );
}
}
if ( ! empty( $data['hmbkp_client_request'] ) ) {
$site_size = new Site_Size( $schedule->get_type(), $schedule->get_excludes() );
// Pass the site size to be displayed when it's ready.
if ( $site_size->is_site_size_cached() ) {
$response['hmbkp_site_size'] = $site_size->get_formatted_site_size();
ob_start();
require( HMBKP_PLUGIN_PATH . 'admin/schedule-form-excludes.php' );
$response['hmbkp_dir_sizes'] = ob_get_clean();
// Slow the heartbeat back down
$response['heartbeat_interval'] = 'slow';
}
}
}
return $response;
}
add_filter( 'heartbeat_received', 'HM\BackUpWordPress\heartbeat_received', 10, 2 );
/**
* Load the enable support modal contents
*
* @return void
*/
function load_enable_support() {
check_ajax_referer( 'hmbkp_nonce', '_wpnonce' );
require_once HMBKP_PLUGIN_PATH . 'admin/enable-support.php';
die;
}
add_action( 'wp_ajax_load_enable_support', 'HM\BackUpWordPress\load_enable_support' );
/**
* Display the running status via ajax
*/
function ajax_is_backup_in_progress() {
check_ajax_referer( 'hmbkp_nonce', 'nonce' );
if ( empty( $_POST['hmbkp_schedule_id'] ) ) {
die;
}
$schedule = new Scheduled_Backup( sanitize_text_field( urldecode( $_POST['hmbkp_schedule_id'] ) ) );
if ( ! $schedule->get_status() ) {
echo 0;
} else {
hmbkp_schedule_status( $schedule );
}
die;
}
add_action( 'wp_ajax_hmbkp_is_in_progress', 'HM\BackUpWordPress\ajax_is_backup_in_progress' );
/**
* Display the calculated size via ajax
*/
function ajax_calculate_backup_size() {
check_ajax_referer( 'hmbkp_nonce', 'nonce' );
if ( empty( $_POST['hmbkp_schedule_id'] ) ) {
die;
}
$schedule = new Scheduled_Backup( sanitize_text_field( urldecode( $_POST['hmbkp_schedule_id'] ) ) );
$recalculate_filesize = true;
require( HMBKP_PLUGIN_PATH . 'admin/schedule-sentence.php' );
die;
}
add_action( 'wp_ajax_hmbkp_calculate', 'HM\BackUpWordPress\ajax_calculate_backup_size' );
/**
* Test the cron response and if it's not 200 show a warning message
*/
function ajax_cron_test() {
check_ajax_referer( 'hmbkp_nonce', 'nonce' );
// Only run the test once per week
if ( get_transient( 'hmbkp_wp_cron_test_beacon' ) ) {
echo 1;
die;
}
// Skip the test if they are using Alternate Cron
if ( defined( 'ALTERNATE_WP_CRON' ) ) {
delete_option( 'hmbkp_wp_cron_test_failed' );
echo 1;
die;
}
$url = site_url( 'wp-cron.php' );
// Attempt to load wp-cron.php 3 times, if we get the same error each time then inform the user.
$response1 = wp_remote_head( $url, array( 'timeout' => 30 ) );
$response2 = wp_remote_head( $url, array( 'timeout' => 30 ) );
$response3 = wp_remote_head( $url, array( 'timeout' => 30 ) );
if ( is_wp_error( $response1 ) && is_wp_error( $response2 ) && is_wp_error( $response3 ) ) {
echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'backupwordpress' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups. See the %3$s for more details.', 'backupwordpress' ), '<code>wp-cron.php</code>', '<code>' . $response1->get_error_message() . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
update_option( 'hmbkp_wp_cron_test_failed', true );
} elseif ( ! in_array( 200, array_map( 'wp_remote_retrieve_response_code', array( $response1, $response2, $response3 ) ) ) ) {
echo '<div id="hmbkp-warning" class="updated fade"><p><strong>' . __( 'BackUpWordPress has detected a problem.', 'backupwordpress' ) . '</strong> ' . sprintf( __( '%1$s is returning a %2$s response which could mean cron jobs aren\'t getting fired properly. BackUpWordPress relies on wp-cron to run scheduled backups, and more generally relies on HTTP loopback connections not being blocked for manual backups. See the %3$s for more details.', 'backupwordpress' ), '<code>wp-cron.php</code>', '<code>' . esc_html( wp_remote_retrieve_response_code( $response1 ) ) . ' ' . esc_html( get_status_header_desc( wp_remote_retrieve_response_code( $response1 ) ) ) . '</code>', '<a href="http://wordpress.org/extend/plugins/backupwordpress/faq/">FAQ</a>' ) . '</p></div>';
update_option( 'hmbkp_wp_cron_test_failed', true );
} else {
echo 1;
delete_option( 'hmbkp_wp_cron_test_failed' );
set_transient( 'hmbkp_wp_cron_test_beacon', 1, WEEK_IN_SECONDS );
}
die;
}
add_action( 'wp_ajax_hmbkp_cron_test', 'HM\BackUpWordPress\ajax_cron_test' );
/**
* Remember notice dismissal
*/
function hmbkp_dismiss_notice() {
update_site_option( 'hmbkp_hide_info_notice', true );
}
add_action( 'wp_ajax_hmbkp_dismiss_notice', 'HM\BackUpWordPress\hmbkp_dismiss_notice' );
function hmbkp_dismiss_rate_notice() {
//Set rate notice to reappear after 30 days
$expiry = time() + 2592000;
update_site_option( 'hmbkp_hide_rate_notice', $expiry );
}
add_action( 'wp_ajax_hmbkp_dismiss_rate_notice', 'HM\BackUpWordPress\hmbkp_dismiss_rate_notice' );
================================================
FILE: admin/backups-table.php
================================================
<?php
namespace HM\BackUpWordPress;
?>
<table class="widefat">
<thead>
<tr>
<th scope="col"><?php backups_number( $schedule ); ?></th>
<th scope="col"><?php _e( 'Size', 'backupwordpress' ); ?></th>
<th scope="col"><?php _e( 'Type', 'backupwordpress' ); ?></th>
<th scope="col"><?php _e( 'Actions', 'backupwordpress' ); ?></th>
</tr>
</thead>
<tbody>
<?php if ( $schedule->get_backups() ) :
$schedule->delete_old_backups();
foreach ( $schedule->get_backups() as $file ) :
if ( ! file_exists( $file ) ) {
continue;
}
get_backup_row( $file, $schedule );
endforeach;
else : ?>
<tr>
<td class="hmbkp-no-backups" colspan="4"><?php _e( 'This is where your backups will appear once you have some.', 'backupwordpress' ); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
================================================
FILE: admin/backups.php
================================================
<?php
namespace HM\BackUpWordPress;
// Refresh the schedules from the database to make sure we have the latest changes
Schedules::get_instance()->refresh_schedules();
$schedules = Schedules::get_instance()->get_schedules();
if ( ! empty( $_GET['hmbkp_schedule_id'] ) ) {
$current_schedule = new Scheduled_Backup( sanitize_text_field( $_GET['hmbkp_schedule_id'] ) );
} else {
$current_schedule = reset( $schedules );
} ?>
<div class="wp-filter">
<ul class="filter-links">
<?php foreach ( $schedules as $schedule ) :
$status = new Backup_Status( $schedule->get_id() ); ?>
<li<?php if ( $status->get_status() ) { ?> title="<?php echo esc_attr( strip_tags( $status->get_status() ) ); ?>"<?php } ?>><a href="<?php echo esc_url( add_query_arg( 'hmbkp_schedule_id', $schedule->get_id(), HMBKP_ADMIN_URL ) ); ?>" class="<?php if ( $status->get_status() ) { ?>hmbkp-running<?php } ?> <?php if ( $schedule->get_id() === $current_schedule->get_id() ) { ?>current<?php } ?>"><?php echo esc_html( translated_schedule_title( $schedule->get_slug(), $schedule->get_name() ) ); ?> <span class="count">(<?php echo esc_html( count( $schedule->get_backups() ) ); ?>)</span></a></li>
<?php endforeach; ?>
<li><a href="<?php echo esc_url( add_query_arg( array( 'hmbkp_add_schedule' => '1', 'action' => 'hmbkp_edit_schedule', 'hmbkp_schedule_id' => time(), 'hmbkp_panel' => 'hmbkp_edit_schedule_settings' ), HMBKP_ADMIN_URL ) ); ?>" class="<?php if ( ! Schedules::get_instance()->get_schedule( $current_schedule->get_id() ) ) { ?> current<?php } ?>"> + <?php _e( 'add schedule', 'backupwordpress' ); ?></a></li>
</ul>
</div>
<?php // Don't continue if we don't have a schedule
if ( ! $schedule = $current_schedule ) {
return;
} ?>
<div data-hmbkp-schedule-id="<?php echo esc_attr( $schedule->get_id() ); ?>" class="hmbkp_schedule">
<?php require( HMBKP_PLUGIN_PATH . 'admin/schedule-sentence.php' ); ?>
<?php require( HMBKP_PLUGIN_PATH . 'admin/backups-table.php' ); ?>
</div>
================================================
FILE: admin/constants.php
================================================
<?php
namespace HM\BackUpWordPress;
?>
<div id="hmbkp-constants">
<p><?php printf( __( 'You can %1$s any of the following %2$s in your %3$s to control advanced settings. %4$s. Defined %5$s will be highlighted.', 'backupwordpress' ), '<code>define</code>', '<code>' . __( 'Constants', 'backupwordpress' ) . '</code>', '<code>wp-config.php</code>', '<a href="http://codex.wordpress.org/Editing_wp-config.php">' . __( 'The Codex can help', 'backupwordpress' ) . '</a>', '<code>' . __( 'Constants', 'backupwordpress' ) . '</code>' ); ?></p>
<table class="widefat">
<tr<?php if ( defined( 'HMBKP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_PATH</code></td>
<td>
<?php if ( defined( 'HMBKP_PATH' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_PATH ) . '</code>' ); ?></p>
<?php } ?>
<p><?php printf( __( 'The path to the folder you would like to store your backup files in, defaults to %s.', 'backupwordpress' ), '<code>' . esc_html( Path::get_path() ) . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_PATH', '/home/willmot/backups' );</code></p>
</td>
</tr>
<tr<?php if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_MYSQLDUMP_PATH</code></td>
<td>
<?php if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_MYSQLDUMP_PATH ) . '</code>' ); ?></p>
<?php } ?>
<p><?php printf( __( 'The path to your %1$s executable. Will be used for the %2$s part of the back up if available.', 'backupwordpress' ), '<code>mysqldump</code>', '<code>' . __( 'database', 'backupwordpress' ) . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_MYSQLDUMP_PATH', '/opt/local/bin/mysqldump' );</code></p>
</td>
</tr>
<tr<?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_ZIP_PATH</code></td>
<td>
<?php if ( defined( 'HMBKP_ZIP_PATH' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_ZIP_PATH ) . '</code>' ); ?></p>
<?php } ?>
<p><?php printf( __( 'The path to your %1$s executable. Will be used to zip up your %2$s and %3$s if available.', 'backupwordpress' ), '<code>zip</code>', '<code>' . __( 'files', 'backupwordpress' ) . '</code>', '<code>' . __( 'database', 'backupwordpress' ) . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_ZIP_PATH', '/opt/local/bin/zip' );</code></p>
</td>
</tr>
<tr<?php if ( defined( 'HMBKP_EXCLUDE' ) ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_EXCLUDE</code></td>
<td>
<?php if ( defined( 'HMBKP_EXCLUDE' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_EXCLUDE ) . '</code>' ); ?></p>
<?php } ?>
<p><?php _e( 'Comma separated list of files or directories to exclude, the backups directory is automatically excluded.', 'backupwordpress' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_EXCLUDE', '/wp-content/uploads/, /stats/, .svn/, *.txt' );</code></p>
</td>
</tr>
<tr<?php if ( defined( 'HMBKP_CAPABILITY' ) ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_CAPABILITY</code></td>
<td>
<?php if ( defined( 'HMBKP_CAPABILITY' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_CAPABILITY ) . '</code>' ); ?></p>
<?php } ?>
<p><?php printf( __( 'The capability to use when calling %1$s. Defaults to %2$s.', 'backupwordpress' ), '<code>add_menu_page</code>', '<code>manage_options</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_CAPABILITY', 'edit_posts' );</code></p>
</td>
</tr>
<tr<?php if ( defined( 'HMBKP_ROOT' ) ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_ROOT</code></td>
<td>
<?php if ( defined( 'HMBKP_ROOT' ) ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_ROOT ) . '</code>' ); ?></p>
<?php } ?>
<p><?php printf( __( 'The root directory that is backed up. Defaults to %s.', 'backupwordpress' ), '<code>' . Path::get_home_path() . '</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_ROOT', ABSPATH . 'wp/' );</code></p>
</td>
</tr>
<tr<?php if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME !== '11pm' ) { ?> class="hmbkp_active"<?php } ?>>
<td><code>HMBKP_SCHEDULE_TIME</code></td>
<td>
<?php if ( defined( 'HMBKP_SCHEDULE_TIME' ) && HMBKP_SCHEDULE_TIME !== '11pm' ) { ?>
<p><?php printf( __( 'You\'ve set it to: %s', 'backupwordpress' ), '<code>' . esc_html( HMBKP_SCHEDULE_TIME ) . '</code>' ); ?></p>
<?php } ?>
<p><?php printf( __( 'The time that your schedules should run. Defaults to %s.', 'backupwordpress' ), '<code>23:00</code>' ); ?> <?php _e( 'e.g.', 'backupwordpress' ); ?> <code>define( 'HMBKP_SCHEDULE_TIME', '07:30' );</code></p>
</td>
</tr>
<?php foreach ( Services::get_services() as $file => $service ) :
echo wp_kses_post( call_user_func( array( $service, 'constant' ) ) );
endforeach; ?>
</table>
</div>
================================================
FILE: admin/enable-support.php
================================================
<?php require_once HMBKP_PLUGIN_PATH . 'classes/class-requirements.php'; ?>
<h2><?php _e( 'Enable BackUpWordPress Support', 'backupwordpress' ); ?></h2>
<p class="howto"><?php printf( __( 'BackUpWordPress uses %s to provide support. In addition to allowing you to send and receive messages we also send the following server information along with your requests:', 'backupwordpress' ), '<a target="blank" href="https://www.intercom.io">Intercom</a>' ); ?></p>
<div class="server-info">
<?php foreach ( HM\BackUpWordPress\Requirements::get_requirement_groups() as $group ) : ?>
<table class="fixed widefat">
<thead>
<tr>
<th scope="col" colspan="2"><?php echo esc_html( ucwords( $group ) ); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ( HM\BackUpWordPress\Requirements::get_requirements( $group ) as $requirement ) : ?>
<?php if ( ( is_string( $requirement->raw_result() ) && strlen( $requirement->result() ) < 20 ) || is_bool( $requirement->raw_result() ) ) { ?>
<tr>
<td><?php echo esc_html( $requirement->name() ); ?></td>
<td>
<code><?php echo esc_html( $requirement->result() ); ?></code>
</td>
</tr>
<?php } else { ?>
<tr>
<td colspan="2">
<?php echo esc_html( $requirement->name() ); ?>
<pre><?php echo esc_html( $requirement->result() ); ?></pre>
</td>
</tr>
<?php } ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
</div>
<p class="howto"><?php _e( 'You can disable support in the future by deactivating BackUpWordPress.', 'backupwordpress' ); ?></p>
<a href="#" class="button-secondary hmbkp-thickbox-close"><?php _e( 'No, thanks', 'backupwordpress' ); ?></a>
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'hmbkp_request_enable_support' ), admin_url( 'admin-post.php' ) ), 'hmbkp_enable_support', 'hmbkp_enable_support_nonce' ) ); ?>" class="button-primary right"><?php _e( 'Yes, I want to enable support', 'backupwordpress' ); ?></a>
================================================
FILE: admin/extensions.php
================================================
<?php
namespace HM\BackUpWordPress;
?>
<div class="wrap">
<h1>
<a class="page-title-action" href="<?php echo esc_url( get_settings_url() ); ?>"><?php esc_html_e( '← Backups', 'backupwordpress' ); ?></a>
<?php esc_html_e( 'BackUpWordPress Extensions', 'backupwordpress' ); ?>
</h1>
<div class="wp-filter">
<p><?php esc_html_e( 'Extend BackUpWordPress by installing extensions. Extensions allow you to pick and choose the exact features you need whilst also supporting us, the developers, so we can continue working on BackUpWordPress.', 'backupwordpress' ); ?></p>
</div>
<?php
$extensions_data = Extensions::get_instance()->get_edd_data();
// Sort by title.
usort( $extensions_data, function( $a, $b ) {
return strcmp( $b->title->rendered, $a->title->rendered );
});
/**
* Include is required for the usage of is_plugin_active()
* to identify if a plugin is currently activated.
* This info is further used to display a correct action button
* depending on plugin's state (i.e. Update Now, Activate, Active).
*/
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
$installed_plugins = array();
foreach ( get_plugins() as $path => $plugin_info ) {
$installed_plugins[ strtolower( $plugin_info['Name'] ) ] = array(
'version' => $plugin_info['Version'],
'path' => $path,
'is_active' => is_plugin_active( $path ),
);
}
?>
<h3><?php esc_html_e( 'Remote Storage', 'backupwordpress' ); ?></h3>
<p><?php esc_html_e( 'It\'s important to store your backups somewhere other than on your site. Using the extensions below you can easily push your backups to one or more Cloud providers.', 'backupwordpress' ); ?></p>
<div class="wp-list-table widefat plugin-install">
<div id="the-list">
<?php $first = true; ?>
<?php foreach ( $extensions_data as $extension ) :
$extension_name_lowcase = strtolower( $extension->title->rendered );
$is_extension_installed = in_array( $extension_name_lowcase, array_keys( $installed_plugins ) );
$extension_version = $is_extension_installed ?
$installed_plugins[ $extension_name_lowcase ]['version'] : '';
$extension_path = $is_extension_installed ?
$installed_plugins[ $extension_name_lowcase ]['path'] : '';
$is_extension_active = $is_extension_installed ?
$installed_plugins[ $extension_name_lowcase ]['is_active'] : false;
?>
<div class="plugin-card plugin-card-<?php echo esc_attr( $extension->slug ); ?>">
<div class="plugin-card-top">
<div class="name column-name">
<h3>
<a href="<?php echo esc_url( $extension->link ); ?>" class="thickbox">
<?php echo esc_html( $extension->title->rendered ); ?>
<img src="<?php echo esc_url( $extension->featured_image_url ); ?>" class="plugin-icon" alt="" />
</a>
</h3>
</div>
<div class="action-links">
<ul class="plugin-action-buttons">
<?php
if (
current_user_can( 'install_plugins' ) ||
current_user_can( 'update_plugins' )
) : ?>
<li>
<?php
// Update Now - Installed and update is available.
if (
$is_extension_installed &&
version_compare( $extension_version, $extension->_edd_sl_version, '<' )
) :
$update_url = wp_nonce_url(
self_admin_url( 'update.php?action=upgrade-plugin&plugin=' . $extension_path ),
'upgrade-plugin_' . $extension_path
);
?>
<a
class="update-now button aria-button-if-js"
data-plugin="<?php echo esc_attr( $extension_path ); ?>"
data-slug="<?php echo esc_attr( $extension->slug ); ?>"
href="<?php echo esc_url( $update_url ); ?>"
aria-label="<?php printf( esc_attr__( 'Update %s now', 'backupwordpress' ), esc_attr( $extension->title->rendered ) ); ?>"
data-name="<?php esc_attr( $extension->title->rendered ); ?>">
<?php esc_html_e( 'Update Now', 'backupwordpress' ); ?>
</a>
<?php
// Active - Installed and activated, but no update.
elseif ( $is_extension_installed && $is_extension_active ) : ?>
<button
type="button"
class="button button-disabled"
disabled="disabled">
<?php echo esc_html_x( 'Active', 'Plugin status', 'backupwordpress' ); ?>
</button>
<?php
// Activate - Installed, but not activated.
elseif ( $is_extension_installed && ! $is_extension_active ) :
$activate_url = add_query_arg( array(
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $extension_path ),
'action' => 'activate',
'plugin' => $extension_path,
), network_admin_url( 'plugins.php' ) );
// TODO: Network Activate?
?>
<a
href="<?php echo esc_url( $activate_url ); ?>"
class="button activate-now button-secondary"
aria-label="<?php printf( esc_attr__( 'Activate %s', 'backupwordpress' ), esc_attr( $extension->title->rendered ) ); ?>">
<?php esc_html_e( 'Activate', 'backupwordpress' ); ?>
</a>
<?php
// Buy Now - Not installed.
else : ?>
<a
class="install-now button-primary"
data-slug="<?php echo esc_attr( $extension->slug ); ?>"
href="<?php echo esc_url( $extension->link ); ?>"
aria-label="<?php printf( esc_attr__( 'Install %s now', 'backupwordpress' ), esc_attr( $extension->title->rendered ) ); ?>
data-name="<?php echo esc_attr( $extension->title->rendered ); ?>">
<?php printf( esc_html__( 'Buy Now $%s', 'backupwordpress' ), esc_html( $extension->edd_price ) ); ?>
</a>
<?php endif; ?>
</li>
<?php endif; ?>
<li>
<a
href="<?php echo esc_url( $extension->link ); ?>"
class="thickbox"
aria-label="<?php printf( esc_attr__( 'More information about %s', 'backupwordpress' ), esc_attr( $extension->title->rendered ) ) ; ?>"
data-title="<?php echo esc_attr( $extension->title->rendered ); ?>">
<?php esc_html_e( 'More Details', 'backupwordpress' ); ?>
</a>
</li>
</ul>
</div>
<div class="desc column-description">
<p><?php echo wp_kses_post( $extension->content->rendered ); ?></p>
</div>
</div>
<?php
$style = $first === true ? 'background-color:aliceblue;' : '';
$first = false;
?>
<div class="plugin-card-bottom" style="<?php echo esc_attr( $style ); ?>">
<div class="vers column-rating">
</div>
<div class="column-updated">
<?php printf(
wp_kses(
__( '<strong>Last Updated:</strong> %s ago', 'backupwordpress' ),
array(
'strong' => array(),
)
),
esc_html( human_time_diff( strtotime( $extension->modified ) ) )
); ?>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
================================================
FILE: admin/faq.php
================================================
<?php
echo '<p><strong>' . __( 'Where does BackUpWordPress store the backup files?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'Backups are stored on your server in <code>/wp-content/backups</code>, you can change the directory.', 'backupwordpress' ). '</p>' .
'<p>' . __( 'Important: By default BackUpWordPress backs up everything in your site root as well as your database, this includes any non WordPress folders that happen to be in your site root. This does mean that your backup directory can get quite large.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'What if I want to back up my site to another destination?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'We no longer sell or support the paid add-ons (e.g. for backups to Dropbox and Google Drive). It\'s certainly a good idea to backup to cloud storage to protect against server-wide risks. For this we recommend <a href="https://updraftplus.com/?afref=744" title="UpdraftPlus WordPress Backups" target="_blank">UpdraftPlus WordPress Backups</a> which can do things for free BackupWordPress Premium could do on a paid basis. Click here for <a href="https://updraftplus.com/backupwordpress/?afref=744" title="plugin comparison" target="_blank">full comparison</a>.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'How do I restore my site from a backup?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'You need to download the latest backup file either by clicking download on the backups page or via <code>FTP</code>. <code>Unzip</code> the files and upload all the files to your server overwriting your site. You can then import the database using your hosts database management tool (likely <code>phpMyAdmin</code>).', 'backupwordpress' ) . '</p>' .
'<p>' . __( 'See this guide for more details - <a href="https://bwp.hmn.md/support-center/restore-backup/" title="Go to support center" target="_blank">How to restore from backup</a>.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'Does BackUpWordPress back up the backups directory?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'No.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'I\'m not receiving my backups by email', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'Most servers have a filesize limit on email attachments, it\'s generally about 10mb. If your backup file is over that limit, it won\'t be sent attached to the email. Instead, you should receive an email with a link to download the backup. If you aren\'t even receiving that, then you likely have a mail issue on your server that you\'ll need to contact your host about.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'How many backups are stored by default?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'BackUpWordPress stores the last 10 backups by default.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'How long should a backup take?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'Unless your site is very large (many gigabytes) it should only take a few minutes to perform a backup. If your back up has been running for longer than an hour, it\'s safe to assume that something has gone wrong. Try de-activating and re-activating the plugin. If it keeps happening, contact support.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'What do I do if I get the wp-cron error message?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'The issue is that your <code>wp-cron.php</code> is not returning a <code>200</code> response when hit with a HTTP request originating from your own server, it could be several things. In most cases, it\'s an issue with the server / site.', 'backupwordpress' ) . '</p>' .
'<p>' . __( 'There are some things you can test to confirm this is the issue.', 'backupwordpress' ) . '</p>' .
'<ul><li>' . __( 'Are scheduled posts working? (They use wp-cron as well.)', 'backupwordpress' ) . '</li>' .
'<li>' . __( 'Are you hosted on Heart Internet? (wp-cron may not be supported by Heart Internet, see below for work-around.)', 'backupwordpress' ) . '</li>' .
'<li>' . __( 'If you click manual backup, does it work?', 'backupwordpress' ) . '</li>' .
'<li>' . __( 'Try adding <code>define( \'ALTERNATE_WP_CRON\', true );</code> to your <code>wp-config.php</code>. Do automatic backups work?', 'backupwordpress' ) . '</li>' .
'<li>' . __( 'Is your site private (i.e. is it behind some kind of authentication, maintenance plugin, .htaccess)? If so, wp-cron won\'t work until you remove it. If you are and you temporarily remove the authentication, do backups start working?', 'backupwordpress' ) . '</li></ul>' .
'<p>' . __( 'For further help, please post on our <a href="http://wordpress.org/support/plugin/backupwordpress" title="support forums" target="_blank">support forums</a>', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'How to get BackUpWordPress working in Heart Internet', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( 'The script to be entered into the Heart Internet cPanel is: <code>/usr/bin/php5 /home/sites/yourdomain.com/public_html/wp-cron.php</code> (note the space between php5 and the location of the file). The file <code>wp-cron.php</code> <code>chmod</code> must be set to <code>711</code>.', 'backupwordpress' ) . '</p>' .
'<p><strong>' . __( 'My backups seem to be failing?', 'backupwordpress' ) . '</strong></p>' .
'<p>' . __( '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, you can seek further help on our <a href="http://wordpress.org/support/plugin/backupwordpress" title="support forums" target="_blank">support forums</a>', 'backupwordpress' ) . '</p>';
================================================
FILE: admin/filesystem-credentials.php
================================================
<?php
$_POST['action'] = 'hmbkp_request_credentials';
$extra_fields = array( 'action' );
if ( ! isset( $_GET['creation_error'] ) ) {
request_filesystem_credentials( admin_url( 'admin-post.php' ), '', isset( $_GET['connection_error'] ), false, $extra_fields );
}
================================================
FILE: admin/menu.php
================================================
<?php
namespace HM\BackUpWordPress;
/**
* Add the backups menu item
* to the tools menu
*/
function admin_menu() {
if ( is_multisite() ) {
add_submenu_page( 'settings.php', __( 'Manage Backups | BackUpWordPress', 'backupwordpress' ), __( 'Backups', 'backupwordpress' ), ( defined( 'HMBKP_CAPABILITY' ) && HMBKP_CAPABILITY ) ? HMBKP_CAPABILITY : 'manage_options', HMBKP_PLUGIN_SLUG, 'HM\BackUpWordPress\manage_backups' );
} else {
add_management_page( __( 'Manage Backups', 'backupwordpress' ), __( 'Backups', 'backupwordpress' ), ( defined( 'HMBKP_CAPABILITY' ) && HMBKP_CAPABILITY ) ? HMBKP_CAPABILITY : 'manage_options', HMBKP_PLUGIN_SLUG, 'HM\BackUpWordPress\manage_backups' );
}
add_submenu_page( null, __( 'BackUpWordPress Extensions', 'backupwordpress' ), __( 'Extensions', 'backupwordpress' ), ( defined( 'HMBKP_CAPABILITY' ) && HMBKP_CAPABILITY ) ? HMBKP_CAPABILITY : 'manage_options', HMBKP_PLUGIN_SLUG . '_extensions', 'HM\BackUpWordPress\extensions' );
}
add_action( 'network_admin_menu', 'HM\BackUpWordPress\admin_menu' );
add_action( 'admin_menu', 'HM\BackUpWordPress\admin_menu' );
/**
* Load the backups admin page
* when the menu option is clicked
*
* @return null
*/
function manage_backups() {
require_once( HMBKP_PLUGIN_PATH . 'admin/page.php' );
}
/**
* Load the backups admin page
* when the menu option is clicked
*
* @return null
*/
function extensions() {
require_once( HMBKP_PLUGIN_PATH . 'admin/extensions.php' );
}
/**
* Highlights the 'Backups' submenu item when on the Extensions page
*
* @param string $submenu_file
* @return string $submenu_file The slug of the menu item to highlight
*/
function highlight_submenu( $submenu_file ) {
$screen = get_current_screen();
if ( 'tools_page_' . HMBKP_PLUGIN_SLUG . '_extensions' === $screen->id ) {
// Set the main plugin page to be the active submenu page
$submenu_file = HMBKP_PLUGIN_SLUG;
}
return $submenu_file;
}
add_filter( 'submenu_file', 'HM\BackUpWordPress\highlight_submenu' );
/**
* Add a link to the backups page to the plugin action links.
*
* @param array $links
* @param string $file
*
* @return array $links
*/
function plugin_action_link( $links, $file ) {
if ( false !== strpos( $file, HMBKP_PLUGIN_SLUG ) ) {
array_push( $links, '<a href="' . esc_url( HMBKP_ADMIN_URL ) . '">' . __( 'Backups', 'backupwordpress' ) . '</a>' );
}
return $links;
}
add_filter( 'plugin_action_links', 'HM\BackUpWordPress\plugin_action_link', 10, 2 );
/**
* Add Contextual Help to Backups tools page.
*
* Help is pulled from the readme FAQ.
*
* @return null
*/
function contextual_help() {
// Pre WordPress 3.3 compat
if ( ! method_exists( get_current_screen(), 'add_help_tab' ) ) {
return;
}
ob_start();
require_once( HMBKP_PLUGIN_PATH . 'admin/constants.php' );
$constants = ob_get_clean();
ob_start();
include_once( HMBKP_PLUGIN_PATH . 'admin/faq.php' );
$faq = ob_get_clean();
get_current_screen()->add_help_tab( array(
'title' => __( 'FAQ', 'backupwordpress' ),
'id' => 'hmbkp_faq',
'content' => wp_kses_post( $faq ),
) );
get_current_screen()->add_help_tab( array(
'title' => __( 'Constants', 'backupwordpress' ),
'id' => 'hmbkp_constants',
'content' => wp_kses_post( $constants ),
) );
require_once( HMBKP_PLUGIN_PATH . 'classes/class-requirements.php' );
ob_start();
require_once( HMBKP_PLUGIN_PATH . 'admin/server-info.php' );
$info = ob_get_clean();
get_current_screen()->add_help_tab(
array(
'title' => __( 'Server Info', 'backupwordpress' ),
'id' => 'hmbkp_server',
'content' => $info,
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . esc_html__( 'For more information:', 'backupwordpress' ) . '</strong></p><p><a href="https://github.com/xibodevelopment/backupwordpress" target="_blank">GitHub</a></p><p><a href="http://wordpress.org/tags/backupwordpress?forum_id=10" target="_blank">' . esc_html__( 'Support Forums', 'backupwordpress' ) . '</a></p><p><a href="https://translate.wordpress.org/projects/wp-plugins/backupwordpress/dev/" target="_blank">' . esc_html__( 'Help with translation', 'backupwordpress' ) . '</a></p>'
);
}
add_action( 'load-' . HMBKP_ADMIN_PAGE, 'HM\BackUpWordPress\contextual_help' );
================================================
FILE: admin/page.php
================================================
<?php
namespace HM\BackUpWordPress;
?>
<div class="wrap">
<h1>
BackUpWordPress
</h1>
<?php if ( has_server_permissions() ) : ?>
<?php include_once( HMBKP_PLUGIN_PATH . 'admin/backups.php' ); ?>
<?php include_once( HMBKP_PLUGIN_PATH . 'admin/upsell.php' ); ?>
<?php else : ?>
<?php include_once( HMBKP_PLUGIN_PATH . 'admin/filesystem-credentials.php' ); ?>
<?php endif; ?>
</div>
================================================
FILE: admin/schedule-form-excludes.php
================================================
<?php
namespace HM\BackUpWordPress;
$excludes = $schedule->get_excludes();
$user_excludes = $excludes->get_user_excludes(); ?>
<div class="hmbkp-exclude-settings">
<h3>
<?php esc_html_e( 'Currently Excluded', 'backupwordpress' ); ?>
</h3>
<p>
<?php esc_html_e( 'We automatically detect and ignore common Version Control Systems folders and other backup plugin folders.', 'backupwordpress' ); ?>
</p>
<table class="widefat">
<tbody>
<?php foreach ( $user_excludes as $key => $exclude ) :
$exclude_path = new \SplFileInfo( trailingslashit( Path::get_root() ) . ltrim( str_ireplace( Path::get_root(), '', $exclude ), '/' ) ); ?>
<tr>
<th scope="row">
<?php if ( $exclude_path->isFile() ) : ?>
<div class="dashicons dashicons-media-default"></div>
<?php elseif ( $exclude_path->isDir() ) : ?>
<div class="dashicons dashicons-portfolio"></div>
<?php endif; ?>
</th>
<td>
<code><?php echo esc_html( str_ireplace( Path::get_root(), '', $exclude ) ); ?></code>
</td>
<td>
<?php if (
( in_array( $exclude, $excludes->get_default_excludes() ) ) ||
( Path::get_path() === trailingslashit( Path::get_root() ) . untrailingslashit( $exclude ) )
) : ?>
<?php esc_html_e( 'Default rule', 'backupwordpress' ); ?>
<?php elseif ( defined( 'HMBKP_EXCLUDE' ) && false !== strpos( HMBKP_EXCLUDE, $exclude ) ) : ?>
<?php printf( esc_html__( 'Defined in %s', 'backupwordpress' ), 'wp-config.php' ); ?>
<?php else : ?>
<a href="<?php echo admin_action_url( 'remove_exclude_rule', array(
'hmbkp_remove_exclude' => $exclude,
'hmbkp_schedule_id' => $schedule->get_id(),
) ); ?>" class="delete-action">
<?php esc_html_e( 'Stop excluding', 'backupwordpress' ); ?>
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<h3 id="directory-listing">
<?php esc_html_e( 'Your Site', 'backupwordpress' ); ?>
</h3>
<p>
<?php esc_html_e( 'Here\'s a directory listing of all files on your site, you can browse through and exclude files or folders that you don\'t want included in your backup.', 'backupwordpress' ); ?>
</p>
<?php
// The directory to display.
$directory = Path::get_root();
if ( isset( $_GET['hmbkp_directory_browse'] ) ) {
$untrusted_directory = urldecode( $_GET['hmbkp_directory_browse'] );
// Only allow real sub-directories of the site root to be browsed.
if (
false !== strpos( $untrusted_directory, Path::get_root() ) &&
is_dir( $untrusted_directory )
) {
$directory = $untrusted_directory;
}
}
$site_size = new Site_Size( 'file' );
$excluded_site_size = new Site_Size( 'file', $excludes );
// Kick off a recursive filesize scan.
$files = list_directory_by_total_filesize( $directory, $excludes );
?>
<table class="widefat">
<thead>
<tr>
<th></th>
<th scope="col"><?php esc_html_e( 'Name', 'backupwordpress' ); ?></th>
<th scope="col" class="column-format"><?php esc_html_e( 'Included Size', 'backupwordpress' ); ?></th>
<th scope="col" class="column-format"><?php esc_html_e( 'Permissions', 'backupwordpress' ); ?></th>
<th scope="col" class="column-format"><?php esc_html_e( 'Type', 'backupwordpress' ); ?></th>
<th scope="col" class="column-format"><?php esc_html_e( 'Status', 'backupwordpress' ); ?></th>
</tr>
<tr>
<th scope="row">
<div class="dashicons dashicons-admin-home"></div>
</th>
<th scope="col">
<?php if ( Path::get_root() !== $directory ) : ?>
<a href="<?php echo esc_url( remove_query_arg( 'hmbkp_directory_browse' ) ); ?>">
<?php echo esc_html( Path::get_root() ); ?>
</a>
<code>/</code>
<?php
$parents = array_filter( explode(
'/',
str_replace( trailingslashit( Path::get_root() ), '', trailingslashit( dirname( $directory ) ) )
) );
foreach ( $parents as $directory_basename ) : ?>
<a href="<?php echo esc_url( add_query_arg( 'hmbkp_directory_browse', urlencode( substr( $directory, 0, strpos( $directory, $directory_basename ) ) . $directory_basename ) ) ); ?>">
<?php echo esc_html( $directory_basename ); ?>
</a>
<code>/</code>
<?php endforeach; ?>
<?php echo esc_html( basename( $directory ) ); ?>
<?php else : ?>
<?php echo esc_html( Path::get_root() ); ?>
<?php endif; ?>
</th>
<td class="column-filesize">
<?php if ( Site_Size::is_site_size_being_calculated() ) : ?>
<span class="spinner is-active"></span>
<?php else :
$root = new \SplFileInfo( Path::get_root() );
$size = $site_size->filesize( $root );
$excluded_size = $excluded_site_size->filesize( $root );
$excluded_size = is_same_size_format( $size, $excluded_size ) ? (int) size_format( $excluded_size ) : size_format( $excluded_size );
?>
<code>
<?php
/* translators: 1: Excluded size 2: Overall site size */
printf(
esc_html__( '%1$s of %2$s', 'backupwordpress' ),
$excluded_size,
size_format( $size )
);
?>
<a class="dashicons dashicons-update" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'hmbkp_recalculate_directory_filesize', urlencode( Path::get_root() ) ), 'hmbkp-recalculate_directory_filesize' ) ); ?>">
<span><?php esc_html_e( 'Refresh', 'backupwordpress' ); ?></span>
</a>
</code>
<?php endif; ?>
<td>
<code><?php echo esc_html( substr( sprintf( '%o', fileperms( Path::get_root() ) ), - 4 ) ); ?></code>
</td>
<td>
<code>
<?php if ( is_link( Path::get_root() ) ) :
esc_html_e( 'Symlink', 'backupwordpress' );
elseif ( is_dir( Path::get_root() ) ) :
esc_html_e( 'Folder', 'backupwordpress' );
endif; ?>
</code>
</td>
<td></td>
</tr>
</thead>
<tbody>
<?php if ( $files ) :
foreach ( $files as $size => $file ) :
$is_excluded = $is_unreadable = false;
// Check if the file is excluded.
if ( $excludes->is_file_excluded( $file ) ) :
$is_excluded = true;
endif;
// Skip unreadable files.
if ( ! @realpath( $file->getPathname() ) || ! $file->isReadable() ) :
$is_unreadable = true;
endif;
?>
<tr>
<td>
<?php if ( $is_unreadable ) : ?>
<div class="dashicons dashicons-dismiss"></div>
<?php elseif ( $file->isFile() ) : ?>
<div class="dashicons dashicons-media-default"></div>
<?php elseif ( $file->isDir() ) : ?>
<div class="dashicons dashicons-portfolio"></div>
<?php endif; ?>
</td>
<td>
<?php if ( $is_unreadable ) : ?>
<code class="strikethrough" title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>">
<?php echo esc_html( $file->getBasename() ); ?>
</code>
<?php elseif ( $file->isFile() ) : ?>
<code title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>">
<?php echo esc_html( $file->getBasename() ); ?>
</code>
<?php elseif ( $file->isDir() ) : ?>
<code title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>">
<a href="<?php echo esc_url( add_query_arg( 'hmbkp_directory_browse', urlencode( wp_normalize_path( $file->getPathname() ) ) ) ); ?>">
<?php echo esc_html( $file->getBasename() ); ?>
</a>
</code>
<?php endif; ?>
</td>
<td class="column-format column-filesize">
<?php if ( $file->isDir() && Site_Size::is_site_size_being_calculated() ) : ?>
<span class="spinner is-active"></span>
<?php else :
$size = $site_size->filesize( $file );
if ( false !== $size ) :
$size = $size;
$excluded_size = $excluded_site_size->filesize( $file ); ?>
<code>
<?php
// Display `included of total size` info for directories and excluded files only.
if ( $file->isDir() || ( $file->isFile() && $is_excluded ) ) :
if ( $excluded_size ) {
$excluded_size = is_same_size_format( $size, $excluded_size ) ? (int) size_format( $excluded_size ) : size_format( $excluded_size );
}
if ( $size ) {
$size = size_format( $size );
}
/* translators: 1: Excluded size 2: Overall directory/file size */
printf(
esc_html__( '%1$s of %2$s', 'backupwordpress' ),
$excluded_size,
$size
);
elseif ( ! $is_unreadable ) :
echo esc_html( size_format( $size ) );
else :
echo '-';
endif; ?>
</code>
<?php else : ?>
<code>--</code>
<?php endif;
endif;
?>
</td>
<td>
<code>
<?php if ( ! $is_unreadable ) :
echo esc_html( substr( sprintf( '%o', $file->getPerms() ), - 4 ) );
else :
echo '-';
endif; ?>
</code>
</td>
<td>
<code>
<?php if ( $file->isLink() ) : ?>
<span title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>">
<?php esc_html_e( 'Symlink', 'backupwordpress' ); ?>
</span>
<?php elseif ( $file->isDir() ) :
esc_html_e( 'Folder', 'backupwordpress' );
else :
esc_html_e( 'File', 'backupwordpress' );
endif; ?>
</code>
</td>
<td class="column-format">
<?php if ( $is_unreadable ) : ?>
<strong title="<?php esc_attr_e( 'Unreadable files won\'t be backed up.', 'backupwordpress' ); ?>">
<?php esc_html_e( 'Unreadable', 'backupwordpress' ); ?>
</strong>
<?php elseif ( $is_excluded ) : ?>
<strong><?php esc_html_e( 'Excluded', 'backupwordpress' ); ?></strong>
<?php else :
$exclude_path = $file->getPathname();
// Excluded directories need to be trailingslashed.
if ( $file->isDir() ) :
$exclude_path = trailingslashit( wp_normalize_path( $file->getPathname() ) );
endif; ?>
<a href="<?php echo esc_url( wp_nonce_url(
add_query_arg( array(
'hmbkp_schedule_id' => $schedule->get_id(),
'action' => 'hmbkp_add_exclude_rule',
'hmbkp_exclude_pathname' => urlencode( $exclude_path ),
),
admin_url( 'admin-post.php' )
),
'hmbkp-add-exclude-rule',
'hmbkp-add-exclude-rule-nonce'
) ); ?>" class="button-secondary">
<?php esc_html_e( 'Exclude →', 'backupwordpress' ); ?>
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php else : ?>
<tr>
<td colspan="5">
<span class="description"><?php esc_html_e( 'This folder is empty', 'backupwordpress' ); ?></span>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<p class="submit">
<a href="<?php echo esc_url( get_settings_url() ) ?>" class="button-primary">
<?php esc_html_e( 'Done', 'backupwordpress' ); ?>
</a>
</p>
</div>
================================================
FILE: admin/schedule-form.php
================================================
<?php
namespace HM\BackUpWordPress;
?>
<h3><?php esc_html_e( 'Settings', 'backupwordpress' ); ?></h3>
<?php $hmbkp_form_errors = get_settings_errors(); ?>
<?php if ( ! empty( $hmbkp_form_errors ) ) { ?>
<div id="hmbkp-warning" class="error settings-error">
<?php foreach ( $hmbkp_form_errors as $error ) { ?>
<p><strong><?php echo wp_kses_data( $error ); ?></strong></p>
<?php } ?>
</div>
<?php }
// We can clear them now we've displayed them
clear_settings_errors();
?>
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
<input type="hidden" name="hmbkp_schedule_id" value="<?php echo esc_attr( $schedule->get_id() ); ?>" />
<input type="hidden" name="action" value="hmbkp_edit_schedule_submit" />
<?php wp_nonce_field( 'hmbkp-edit-schedule', 'hmbkp-edit-schedule-nonce' ); ?>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<label for="hmbkp_schedule_type"><?php _e( 'Backup', 'backupwordpress' ); ?></label>
</th>
<td>
<select name="hmbkp_schedule_type" id="hmbkp_schedule_type">
<option<?php selected( $schedule->get_type(), 'complete' ); ?> value="complete"><?php _e( 'Both Database & files', 'backupwordpress' ); ?></option>
<option<?php selected( $schedule->get_type(), 'file' ); ?> value="file"><?php _e( 'Files only', 'backupwordpress' ); ?></option>
<option<?php selected( $schedule->get_type(), 'database' ); ?> value="database"><?php _e( 'Database only', 'backupwordpress' ); ?></option>
</select>
</td>
</tr>
<tr>
<th scope="row">
<label for="hmbkp_schedule_recurrence_type"><?php _e( 'Schedule', 'backupwordpress' ); ?></label>
</th>
<td>
<select name="hmbkp_schedule_recurrence[hmbkp_type]" id="hmbkp_schedule_recurrence_type">
<option value="manually"><?php _e( 'Manual Only', 'backupwordpress' ); ?></option>
<?php foreach ( get_cron_schedules() as $cron_schedule => $cron_details ) : ?>
<option <?php selected( $schedule->get_reoccurrence(), $cron_schedule ); ?> value="<?php echo esc_attr( $cron_schedule ); ?>">
<?php esc_html_e( $cron_details['display'], 'backupwordpress' ); ?>
</option>
<?php endforeach; ?>
</select>
</td>
</tr>
<?php if ( ! $start_time = $schedule->get_schedule_start_time( false ) ) :
$start_time = time();
endif; ?>
<?php $start_date_array = date_parse( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $start_time ) ); ?>
<tr id="start-day" class="recurring-setting">
<th scope="row">
<label for="hmbkp_schedule_start_day_of_week"><?php _e( 'Start Day', 'backupwordpress' ); ?></label>
</th>
<td>
<select id="hmbkp_schedule_start_day_of_week" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_week]">
<?php $weekdays = array(
'monday' => __( 'Monday', 'backupwordpress' ),
'tuesday' => __( 'Tuesday', 'backupwordpress' ),
'wednesday' => __( 'Wednesday', 'backupwordpress' ),
'thursday' => __( 'Thursday', 'backupwordpress' ),
'friday' => __( 'Friday', 'backupwordpress' ),
'saturday' => __( 'Saturday', 'backupwordpress' ),
'sunday' => __( 'Sunday', 'backupwordpress' ),
);
foreach ( $weekdays as $key => $day ) : ?>
<option value="<?php echo esc_attr( $key ) ?>" <?php selected( strtolower( date_i18n( 'l', $start_time ) ), $key ); ?>><?php echo esc_html( $day ); ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr id="start-date" class="recurring-setting">
<th scope="row">
<label for="hmbkp_schedule_start_day_of_month"><?php _e( 'Start Day of Month', 'backupwordpress' ); ?></label>
</th>
<td>
<input type="number" min="0" max="31" step="1" id="hmbkp_schedule_start_day_of_month" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_day_of_month]" value="<?php echo esc_attr( $start_date_array['day'] ); ?>">
</td>
</tr>
<tr id="schedule-start" class="recurring-setting">
<th scope="row">
<label for="hmbkp_schedule_start_hours"><?php _e( 'Start Time', 'backupwordpress' ); ?></label>
</th>
<td>
<span class="field-group">
<label for="hmbkp_schedule_start_hours"><input type="number" min="0" max="23" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_hours]" id="hmbkp_schedule_start_hours" value="<?php echo esc_attr( $start_date_array['hour'] ); ?>">
<?php _e( 'Hours', 'backupwordpress' ); ?></label>
<label for="hmbkp_schedule_start_minutes"><input type="number" min="0" max="59" step="1" name="hmbkp_schedule_recurrence[hmbkp_schedule_start_minutes]" id="hmbkp_schedule_start_minutes" value="<?php echo esc_attr( $start_date_array['minute'] ); ?>">
<?php _e( 'Minutes', 'backupwordpress' ); ?></label>
</span>
<p class="description">
<?php esc_html_e( '24-hour format.', 'backupwordpress' ); ?>
<span class="twice-js <?php if ( $schedule->get_reoccurrence() !== 'fortnightly' ) { ?> hidden<?php } ?>"><?php _e( 'The second backup will run 12 hours after the first.', 'backupwordpress' ); ?><span>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="hmbkp_schedule_max_backups"><?php _e( 'Number of backups to store on this server', 'backupwordpress' ); ?></label>
</th>
<td>
<input type="number" id="hmbkp_schedule_max_backups" name="hmbkp_schedule_max_backups" min="1" step="1" value="<?php echo esc_attr( $schedule->get_max_backups() ); ?>" />
<p class="description">
<?php printf( __( 'Past this limit older backups will be deleted automatically.', 'backupwordpress' ) ); ?>
<?php
$site_size = new Site_Size( $schedule->get_type(), $schedule->get_excludes() );
if ( $site_size->is_site_size_cached() ) :
printf( __( 'This schedule will store a maximum of %s of backups.', 'backupwordpress' ), '<code>' . esc_html( size_format( $site_size->get_site_size() * $schedule->get_max_backups() ) ) . '</code>' );
endif; ?>
</p>
</td>
</tr>
<?php foreach ( Services::get_services( $schedule ) as $service ) :
$service->field();
endforeach; ?>
</tbody>
</table>
<?php submit_button( __( 'Done', 'backupwordpress' ) ); ?>
</form>
================================================
FILE: admin/schedule-sentence.php
================================================
<?php
namespace HM\BackUpWordPress;
$filesize = get_site_size_text( $schedule );
// Backup Type
$type = strtolower( human_get_type( $schedule->get_type() ) );
// Backup Time
$day = date_i18n( 'l', $schedule->get_next_occurrence( false ) );
// Next Backup
$next_backup = 'title="' . esc_attr( sprintf( __( 'The next backup will be on %1$s at %2$s %3$s', 'backupwordpress' ), date_i18n( get_option( 'date_format' ), $schedule->get_next_occurrence( false ) ), date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ), date_i18n( 'T', $schedule->get_next_occurrence( false ) ) ) ) . '"';
// Backup status
$status = new Backup_Status( $schedule->get_id() );
// Backup Re-occurrence
switch ( $schedule->get_reoccurrence() ) :
case 'hourly' :
$reoccurrence = date_i18n( 'i', $schedule->get_next_occurrence( false ) ) === '00' ? '<span ' . $next_backup . '>' . __( 'hourly on the hour', 'backupwordpress' ) . '</span>' : sprintf( __( 'hourly at %s minutes past the hour', 'backupwordpress' ), '<span ' . $next_backup . '>' . intval( date_i18n( 'i', $schedule->get_next_occurrence( false ) ) ) ) . '</span>';
break;
case 'daily' :
$reoccurrence = sprintf( __( 'daily at %s', 'backupwordpress' ), '<span ' . $next_backup . '>' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '</span>' );
break;
case 'twicedaily' :
$times[] = date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) );
$times[] = date_i18n( get_option( 'time_format' ), strtotime( '+ 12 hours', $schedule->get_next_occurrence( false ) ) );
sort( $times );
$reoccurrence = sprintf( __( 'every 12 hours at %1$s & %2$s', 'backupwordpress' ), '<span ' . $next_backup . '>' . esc_html( reset( $times ) ) . '</span>', '<span>' . esc_html( end( $times ) ) ) . '</span>';
break;
case 'weekly' :
$reoccurrence = sprintf( __( 'weekly on %1$s at %2$s', 'backupwordpress' ), '<span ' . $next_backup . '>' .esc_html( $day ) . '</span>', '<span>' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '</span>' );
break;
case 'fortnightly' :
$reoccurrence = sprintf( __( 'every two weeks on %1$s at %2$s', 'backupwordpress' ), '<span ' . $next_backup . '>' . $day . '</span>', '<span>' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '</span>' );
break;
case 'monthly' :
$reoccurrence = sprintf( __( 'on the %1$s of each month at %2$s', 'backupwordpress' ), '<span ' . $next_backup . '>' . esc_html( date_i18n( 'jS', $schedule->get_next_occurrence( false ) ) ) . '</span>', '<span>' . esc_html( date_i18n( get_option( 'time_format' ), $schedule->get_next_occurrence( false ) ) ) . '</span>' );
break;
case 'manually' :
$reoccurrence = __( 'manually', 'backupwordpress' );
break;
default :
$reoccurrence = __( 'manually', 'backupwordpress' );
$schedule->set_reoccurrence( 'manually' );
endswitch;
$server = '<code title="' . __( 'Check the help tab to learn how to change where your backups are stored.', 'backupwordpress' ) . '">' . esc_attr( str_replace( Path::get_home_path(), '', Path::get_path() ) ) . '</code>';
// Backup to keep
switch ( $schedule->get_max_backups() ) :
case 1 :
$backup_to_keep = sprintf( __( 'store the most recent backup in %s', 'backupwordpress' ), $server );
break;
case 0 :
$backup_to_keep = sprintf( __( 'don\'t store any backups in on this server', 'backupwordpress' ), Path::get_path() );
break;
default :
$backup_to_keep = sprintf( __( 'store the last %1$s backups in %2$s', 'backupwordpress' ), esc_html( $schedule->get_max_backups() ), $server );
endswitch;
$email_msg = '';
$services = array();
foreach ( Services::get_services( $schedule ) as $file => $service ) {
if ( is_wp_error( $service ) ) {
$email_msg = $service->get_error_message();
} elseif ( 'Email' === $service->name ) {
$email_msg = wp_kses_post( $service->display() );
} elseif ( $service->is_service_active() && $service->display() ) {
$services[] = esc_html( $service->display() );
}
}
if ( ! empty( $services ) && count( $services ) > 1 ) {
$services[ count( $services ) -2 ] .= ' & ' . $services[ count( $services ) -1 ];
array_pop( $services );
} ?>
<div class="hmbkp-schedule-sentence<?php if ( $status->get_status() ) { ?> hmbkp-running<?php } ?>">
<?php $sentence = sprintf( _x( 'Backup my %1$s %2$s %3$s, %4$s.', '1: Backup Type 2: Total size of backup 3: Schedule 4: Number of backups to store', 'backupwordpress' ), '<span>' . esc_html( $type ) . '</span>', $filesize, $reoccurrence, $backup_to_keep );
if ( $email_msg ) {
$sentence .= ' ' . $email_msg;
}
if ( ! empty( $services ) ) {
$sentence .= ' ' . sprintf( __( 'Send a copy of each backup to %s.', 'backupwordpress' ), implode( ', ', $services ) );
}
echo $sentence; ?>
<?php if ( Schedules::get_instance()->get_schedule( $schedule->get_id() ) ) :
schedule_status( $schedule );
endif; ?>
<?php require( HMBKP_PLUGIN_PATH . 'admin/schedule-settings.php' ); ?>
</div>
<?php
/**
* Returns a formatted string containing the calculated total site size or a message
* to indicate it is being calculated.
*
* @param HM\BackUpWordPress\Scheduled_Backup $schedule
*
* @return string
*/
function get_site_size_text( Scheduled_Backup $schedule ) {
if ( isset( $_GET['hmbkp_add_schedule'] ) ) {
return '';
}
$site_size = new Site_Size( $schedule->get_type(), $schedule->get_excludes() );
if ( 'database' === $schedule->get_type() || $site_size->is_site_size_cached() ) {
return sprintf(
'(<code title="' . __( 'Backups will be compressed and should be smaller than this.', 'backupwordpress' ) . '">%s</code>)',
esc_html( $site_size->get_formatted_site_size() )
);
}
return '';
}
================================================
FILE: admin/schedule-settings.php
================================================
<?php
namespace HM\BackUpWordPress;
if ( Schedules::get_instance()->get_schedule( $schedule->get_id() ) ) { ?>
<div class="hmbkp-schedule-actions row-actions">
<?php if ( is_backup_possible() ) : ?>
<a class="hmbkp-run" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'hmbkp_run_schedule', 'hmbkp_schedule_id' => $schedule->get_id() ), admin_url( 'admin-ajax.php' ) ), 'hmbkp_run_schedule', 'hmbkp_run_schedule_nonce' ) ); ?>"><?php _e( 'Run now', 'backupwordpress' ); ?></a> |
<?php endif; ?>
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'hmbkp_edit_schedule', 'hmbkp_panel' => 'hmbkp_edit_schedule_settings', 'hmbkp_schedule_id' => $schedule->get_id() ), get_settings_url() ), 'hmbkp-edit-schedule' ); ?>"><?php _e( 'Settings', 'backupwordpress' ); ?></a> |
<?php
// Only show excludes if we are backing up files
if ( 'database' !== $schedule->get_type() ) : ?>
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'hmbkp_edit_schedule', 'hmbkp_panel' => 'hmbkp_edit_schedule_excludes', 'hmbkp_schedule_id' => $schedule->get_id() ), get_settings_url() ) ); ?>"><?php _e( 'Excludes', 'backupwordpress' ); ?></a> |
<?php endif; ?>
<?php foreach ( Services::get_services( $schedule ) as $service ) :
if ( ! $service->has_form() ) {
continue;
} ?>
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'hmbkp_edit_schedule', 'hmbkp_panel' => 'hmbkp_edit_schedule_settings_' . $service->get_slug(), 'hmbkp_schedule_id' => $schedule->get_id() ), get_settings_url() ) ); ?>"><?php echo esc_html( $service->name ); ?></a> |
<?php endforeach; ?>
<a class="delete-action" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'hmbkp_request_delete_schedule', 'hmbkp_schedule_id' => $schedule->get_id() ), admin_url( 'admin-post.php' ) ), 'hmbkp_delete_schedule', 'hmbkp_delete_schedule_nonce' ) ); ?>"><?php _e( 'Delete', 'backupwordpress' ); ?></a>
</div>
<?php } ?>
<?php if ( ! isset( $_GET['action'] ) || 'hmbkp_edit_schedule' !== $_GET['action'] || ! isset( $_GET['hmbkp_panel'] ) ) {
return;
} ?>
<div class="hmbkp-schedule-settings">
<?php if ( 'hmbkp_edit_schedule' === $_GET['action'] && 'hmbkp_edit_schedule_settings' === $_GET['hmbkp_panel'] ) :
require( HMBKP_PLUGIN_PATH . 'admin/schedule-form.php' );
endif; ?>
<?php if ( 'hmbkp_edit_schedule' === $_GET['action'] && 'hmbkp_edit_schedule_excludes' === $_GET['hmbkp_panel'] ) :
require( HMBKP_PLUGIN_PATH . 'admin/schedule-form-excludes.php' );
endif; ?>
<?php // Show the service form if we are viewing one
foreach ( Services::get_services( $schedule ) as $service ) : ?>
<?php if ( 'hmbkp_edit_schedule' === $_GET['action'] && 'hmbkp_edit_schedule_settings_' . $service->get_slug() === $_GET['hmbkp_panel'] ) : ?>
<h3><?php echo esc_html( $service->name ); ?></h3>
<?php $hmbkp_form_errors = get_settings_errors();
if ( ! empty( $hmbkp_form_errors ) ) :
?>
<div id="hmbkp-warning" class="error settings-error">
<?php foreach ( $hmbkp_form_errors as $error ) : ?>
<p><strong><?php echo esc_html( $error ); ?></strong></p>
<?php endforeach; ?>
</div>
<?php endif;
// We can clear them now we've displayed them
clear_settings_errors(); ?>
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
<input type="hidden" name="hmbkp_schedule_id" value="<?php echo esc_attr( $schedule->get_id() ); ?>" />
<input type="hidden" name="action" value="hmbkp_edit_schedule_services_submit" />
<?php wp_nonce_field( 'hmbkp-edit-schedule-services', 'hmbkp-edit-schedule-services-nonce' ); ?>
<?php $service->form(); ?>
<?php submit_button( __( 'Done', 'backupwordpress' ) ); ?>
</form>
<?php break; ?>
<?php endif; ?>
<?php endforeach; ?>
</div>
================================================
FILE: admin/server-info.php
================================================
<?php
foreach ( HM\BackUpWordPress\Requirements::get_requirement_groups() as $group ) : ?>
<h3><?php echo esc_html( ucwords( $group ) ); ?></h3>
<table class="fixed widefat">
<tbody>
<?php foreach ( HM\BackUpWordPress\Requirements::get_requirements( $group ) as $requirement ) : ?>
<?php if ( ( is_string( $requirement->raw_result() ) && strlen( $requirement->result() ) < 20 ) || is_bool( $requirement->raw_result() ) ) : ?>
<tr>
<td><?php echo esc_html( $requirement->name() ); ?></td>
<td>
<code><?php echo esc_html( $requirement->result() ); ?></code>
</td>
</tr>
<?php elseif ( is_array( $requirement->raw_result() ) ) : ?>
<tr>
<td><?php echo esc_html( $requirement->name() ); ?></td>
<td>
<ul>
<pre><?php var_export( $requirement->raw_result() ); ?></pre>
</ul>
</td>
</tr>
<?php else : ?>
<tr>
<td colspan="2">
<?php echo esc_html( $requirement->name() ); ?>
<pre><?php echo esc_html( $requirement->result() ); ?></pre>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach;
foreach ( HM\BackUpWordPress\Services::get_services() as $file => $service ) :
echo wp_kses_post( call_user_func( array( $service, 'intercom_data_html' ) ) );
endforeach;
================================================
FILE: admin/upsell.php
================================================
<?php namespace HM\BackUpWordPress; ?>
<div class="hmbkp-upsell">
<?php
/** translators: the 1st placeholder is the first part of the anchor tag with the link to the plugin review page and the second is the closing anchor tag */
$cta_message = sprintf(
__( 'If you\'re finding BackUpWordPress useful, please %1$s rate it on the plugin directory%2$s.', 'backupwordpress' ),
'<a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/backupwordpress">',
'</a>'
);
$hide_notice = get_site_option( 'hmbkp_hide_rate_notice', false );
if(empty($hide_notice) || time() >= $hide_notice) {
?>
<div id="hmbkp-cta-message" class="updated rate notice is-dismissible">
<p><?php echo wp_kses_post( $cta_message ); ?></p>
<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'backupwordpress' ); ?></span></button>
</div>
</div>
<?php
}
================================================
FILE: assets/hmbkp.css
================================================
/*Constants Tab*/
.hmbkp_active td:first-child > code:before { content: "\00a0 \2713 "; font-size: 11px; }
.hmbkp_active { background: #E5F7E8; }
/*Fix the bottom margin for warning messages in the admin*/
div#hmbkp-warning, h2.nav-tab-wrapper + div[id^="hmbkp"] { margin: 20px 0 15px; }
h2 + div[id^="hmbkp"] input { max-width: 100%; }
li a.hmbkp-running:not(.current):before { width: 20px; height: 20px; margin: -1px 10px -5px 0; content: ""; background: transparent url('spinner-2x.gif') no-repeat 0 0; background-size: 20px; display: inline-block; }
.hmbkp-upsell { margin-top: 40px; padding-top: 16px; border-top: 1px solid #ccc; }
.hmbkp-schedule-sentence { font-size: 16px; margin: 0 0 20px 0; background-color: #FBFBFB; padding: 20px; border: 1px solid #e5e5e5; box-shadow: 0 1px 1px rgba( 0,0,0,.04 ); }
.hmbkp-schedule-sentence::before { content: "\2714"; margin-right: 10px; width: 16px; height: 60px; display: block; float: left; }
.hmbkp-schedule-sentence.hmbkp-error:before { content: "\2718"; }
.hmbkp-schedule-sentence.hmbkp-running:before { width: 20px; height: 80px; margin: -1px 10px 0 0; content: ""; background: transparent url('spinner-2x.gif') no-repeat 0 0; background-size: 20px; display: inline-block; }
.hmbkp-schedule-sentence .hmbkp-status { display: none; font-size: 12px; color: #666; margin: 2px 0 0 30px; }
.hmbkp-schedule-sentence.hmbkp-running .hmbkp-status { display: block; }
.hmbkp-schedule-sentence.hmbkp-running .hmbkp-schedule-actions { display: none; }
.hmbkp-schedule-sentence *:not(a)[title] { border-bottom: 1px dotted #CCC; cursor: help; }
.hmbkp-schedule-sentence .hmbkp-status[title] { border-bottom: none; }
.hmbkp-schedule-sentence .submit { padding: 0; }
.hmbkp-schedule-sentence .hmbkp-schedule-actions { visibility: visible; font-size: 12px; margin: 0 0 0 26px; padding: 10px 0 0; }
.hmbkp-schedule-actions a { white-space: nowrap; }
.hmbkp-schedule-sentence .row-actions { position: static; }
.hmbkp-schedule-settings { border-top: 1px solid #e5e5e5; margin: 20px -20px -20px; background-color: #f5f5f5; padding: 0 20px 20px; }
.hmbkp-ajax-loading, button.hmbkp-ajax-loading { padding-left: 20px; position: relative; }
.hmbkp-ajax-loading::after { content: ""; width: 16px; height: 16px; background-image: url('spinner-2x.gif'); background-size: 16px 16px; background-repeat: no-repeat; background-position: 0 0; position: absolute; right: -30px; top: 5px; }
.delete-action { color: #a00; transition: all 300ms ease; }
.delete-action:hover .delete-action:focus { color: red; transition: all 300ms ease; }
.strikethrough { text-decoration: line-through; }
table.widefat tbody tr:nth-child(odd) { background-color: #f9f9f9 }
.hmbkp-exclude-settings td:first-child, .hmbkp-exclude-settings th:first-child { width: 20px; padding-right: 0 }
.hmbkp-exclude-settings thead tr:last-child { background-color: #f9f9f9; }
.hmbkp-exclude-settings table .button-secondary { line-height: 18px; height: 20px; }
thead td { border-bottom: 1px solid #e1e1e1; }
.hmbkp-exclude-settings table .spinner { display: block; float: left; margin: 0; }
.hmbkp-schedule-settings .column-format code { white-space: nowrap; }
.column-filesize code { position: relative; }
.column-filesize .dashicons-update { display: none; overflow: hidden; position: absolute; width: 100%; left: 0; text-align: center; background-color: rgba( 255, 255, 255, .8 ) }
.column-filesize .dashicons-update span { display: none; }
.column-filesize:hover .dashicons-update { display: inline-block; }
.hmbkp-exclude-settings td span.reason { color: #CCC; }
.server-info { overflow: auto; max-height: 50%; outline: black 1px solid; }
.server-info pre { max-height: 100px; overflow-x:hidden; }
.page-title-action span.dashicons-admin-users { position: relative; display:inline-block; vertical-align: middle; top:-2px; }
pre { background-color: #eee; padding: 10px; white-space: pre; max-height: 320px; overflow: auto; word-wrap: normal !important; }
@media screen and (max-width: 768px) {
.wrap h2 {
padding: 10px 0 0 0;
}
.hmbkp-schedule-sentence::before { height: 80px; }
h2 .nav-tab {
display: block;
padding: 10px;
margin: 0;
}
.hmbkp-schedule-sentence {
margin: 10px 0;
padding: 10px;
}
#intercom-info { display: none; }
.hmbkp-schedule-settings { padding: 0 10px 10px; }
.hmbkp-exclude-settings table { margin: 0 -10px; border-left: none; border-right: none; width: calc(100% + 20px) }
.hmbkp-exclude-settings tr > *:first-child { display: none; }
.hmbkp-schedule-settings tr *:nth-child(4), .hmbkp-schedule-settings tr *:nth-child(5) { display: none; }
.hmbkp-schedule-settings thead tr:nth-child(2) { display: none; }
.hmbkp-schedule-settings { margin-left: -10px; margin-right: -10px; margin-bottom: -10px; }
table.widefat tbody tr:nth-child(even) { background-color: #fff }
table.widefat tbody tr:nth-child(odd) { background-color: #f9f9f9 }
}
================================================
FILE: assets/hmbkp.js
================================================
var BackUpWordPressAdmin = (function($){
'use strict';
var recurrenceType;
function init(){
recurrenceType = $( 'select#hmbkp_schedule_recurrence_type' );
// Don't ever cache ajax requests
$.ajaxSetup( {'cache': false} );
if ( recurrenceType.length ) {
hmbkpToggleScheduleFields( recurrenceType.val() );
$( document ).on( 'change', 'select#hmbkp_schedule_recurrence_type', function () {
hmbkpToggleScheduleFields( $( this ).val() );
} );
}
$('.notice.is-dismissible').on('click', '.notice-dismiss', function(){
$.post(
ajaxurl,
{
'action': 'hmbkp_dismiss_notice'
}
);
});
$('.notice.rate.is-dismissible').on('click', '.notice-dismiss', function(){
$.post(
ajaxurl,
{
'action': 'hmbkp_dismiss_rate_notice'
}
);
});
// Show delete confirm message for delete schedule
$( document ).on( 'click', '.hmbkp-schedule-actions .delete-action', function ( e ) {
if ( ! confirm( hmbkp.delete_schedule ) ) {
e.preventDefault();
}
} );
// Show delete confirm message for delete backup
$( document ).on( 'click', '.hmbkp_manage_backups_row .delete-action', function ( e ) {
if ( ! confirm( hmbkp.delete_backup ) ) {
e.preventDefault();
}
} );
// Show delete confirm message for remove exclude rule
$( document ).on( 'click', '.hmbkp-edit-schedule-excludes-form .delete-action', function ( e ) {
if ( ! confirm( hmbkp.remove_exclude_rule ) ) {
e.preventDefault();
}
} );
// Test the cron response using ajax
$.post( ajaxurl, {'nonce': hmbkp.nonce, 'action': 'hmbkp_cron_test'},
function ( data ) {
if ( data !== '1' ) {
$( '.wrap > h2' ).after( data );
}
}
);
// Run a backup
$( document ).on( 'click', '.hmbkp-run', function ( e ) {
wp.heartbeat.interval( 'fast' );
$( this ).closest( '.hmbkp-schedule-sentence' ).addClass( 'hmbkp-running' );
$( '.hmbkp-error' ).removeClass( 'hmbkp-error' );
var scheduleId = $( '[data-hmbkp-schedule-id]' ).attr( 'data-hmbkp-schedule-id' );
$.post(
ajaxurl,
{
'hmbkp_run_schedule_nonce': hmbkp.hmbkp_run_schedule_nonce,
'action': 'hmbkp_run_schedule',
'hmbkp_schedule_id': scheduleId
}
);
e.preventDefault();
} );
// Send the schedule id with the heartbeat
$( document ).on( 'heartbeat-send', function ( e, data ) {
data.hmbkp_schedule_id = $( '[data-hmbkp-schedule-id]' ).attr( 'data-hmbkp-schedule-id' );
if ( $( '.hmbkp-schedule-sentence.hmbkp-running' ).length ) {
data.hmbkp_is_in_progress = true;
} else {
data.hmbkp_client_request = 'site_size';
}
} );
// Update schedule status on heartbeat tick
$( document ).on( 'heartbeat-tick', function ( e, data ) {
// If the schedule has finished then reload the page
if ( data.hmbkp_schedule_status === 0 && ! $( '.hmbkp-error' ).length ) {
location.reload( true );
}
// If the schedule is still running then update the schedule status
if ( ( data.hmbkp_schedule_status !== 0 ) && ( data.hmbkp_schedule_status !== undefined ) ) {
$( '.hmbkp-status' ).replaceWith( data.hmbkp_schedule_status );
}
if ( ( data.hmbkp_site_size !== undefined ) && ( $( 'code.calculating' ).length ) ) {
$( 'code.calculating' ).text( data.hmbkp_site_size );
var excludes = $( '.hmbkp-exclude-settings' );
if ( excludes.length ) {
excludes.replaceWith( data.hmbkp_dir_sizes );
}
}
} );
// Closing ThickBox Modal Window
$( document ).on( 'click', '.hmbkp-thickbox-close', function ( e ) {
e.preventDefault();
window.parent.tb_remove();
} );
$( document ).on( 'click', '[id^="hmbkp-warning-"] .notice-dismiss', function(){
$.post(
ajaxurl,
{
'action': 'hmbkp_dismiss_error'
}
);
} );
}
function hmbkpToggleScheduleFields( recurrence ) {
recurrence = (
typeof recurrence !== 'undefined'
) ? recurrence : 'manually';
var settingFields = jQuery( '.recurring-setting' );
var scheduleSettingFields = jQuery( '#schedule-start' );
var twiceDailyNote = jQuery( '.twice-js' );
switch ( recurrence ) {
case 'manually':
settingFields.hide();
break;
case 'hourly' :
settingFields.hide();
break;
case 'daily' :
settingFields.hide();
scheduleSettingFields.show();
twiceDailyNote.hide();
break;
case 'twicedaily' :
settingFields.hide();
scheduleSettingFields.show();
twiceDailyNote.show();
break;
case 'weekly' : // fall through
case 'fortnightly' :
settingFields.hide();
jQuery( '#start-day' ).show();
scheduleSettingFields.show();
twiceDailyNote.hide();
break;
case 'monthly' :
settingFields.hide();
scheduleSettingFields.show();
jQuery( '#start-date' ).show();
twiceDailyNote.hide();
break;
}
}
return {
init: init
};
})(jQuery);
jQuery( document ).ready( BackUpWordPressAdmin.init );
================================================
FILE: backdrop/README.md
================================================
# Backdrop
Backdrop is a simple library that does one thing: allows you to run one-off
tasks in the background.
## How to Use
```php
function my_awesome_function( $id ) {
// Download initial data to my site. Might take a long time!
$data = wp_remote_get( 'http://example.com/' . $id );
if ( is_wp_error( $data ) ) {
return $data;
}
update_option( 'initial_data', $data );
}
add_action( 'init', function () {
if ( ! get_option( 'initial_data' ) ) {
$task = new \HM\Backdrop\Task( 'my_awesome_function', get_current_user_id() );
$task->schedule();
}
} );
```
## API
### `Task::__construct( $callback [, $...] )`
Creating a new task sets up all of the internal data for your task. Pass in your
callback followed by your arguments to the function, and Backdrop will call it
in a background process.
#### Arguments
* `$callback`: Callback method you want to use. Can be any callable type
(including object methods and static methods) **except for anonymous
functions**. Closures cannot be serialized, so they cannot be used for
Backdrop callbacks. This is an internal PHP limitation.
* `$...`: Any other arguments you'd like to pass to your callback, as variable
arguments. e.g. `new Task( 'a', 'b', 'c', 'd' )` maps to `a( 'b', 'c', 'd' )`
#### Return Value
None (constructor).
### `Task::schedule()`
Schedules your task to run. Typically runs after your page has been rendered, in
a separate process.
Backdrop de-duplicates tasks based on the arguments passed in. For example, you
can do `new Task( 'myfunc', 1 )` on every request, and only one will be run.
After this has been run, the next call will schedule again.
To avoid this, you should pass in unique identifiers as needed. Everything that
makes your task unique should be passed in and used by your function, as global
state may change.
#### Arguments
None.
#### Return Value
Either `true`, or a `WP_Error` on failure. The error object will indicate the
type of error; typically this is a `hm_backdrop_scheduled` if the task is
already scheduled to run or is currently running.
### `Task::is_scheduled()`
Checks whether your task is scheduled to run.
#### Arguments
None.
#### Return Value
Boolean indicating whether your task is scheduled to run, or is already running.
#### `Task::cancel()`
Cancels a previously scheduled task.
Note that if the task is already running, this will not cancel execution; it
simply removes it from the tasks scheduled to run.
#### Arguments
None.
#### Return Value
Either `true`, or a `WP_Error` on failure. The error object will indicate the
type of error; typically this is a `hm_backdrop_not_scheduled` if the task
hasn't been scheduled.
## Compatibility
Backdrop is compatible with PHP 5.2 and upwards.
### PHP 5.2
Use the `HM_Backdrop_Task` class (and `HM_Backdrop_Server`).
**Important note:** If subclassing `HM_Backdrop_Server` with 5.2 compatibility,
you *must* reimplement the `spawn` method, as PHP 5.2 does not include late
static bindings. This is automatically handled for 5.3+.
Here's a minimal implementation that you can use:
```
class MyBackdrop_Server extends HM_Backdrop_Server {
public static function spawn() {
return self::spawn_run( __CLASS__ );
}
}
```
### PHP 5.3+
Use the `HM\Backdrop\Task` class (and `HM\Backdrop\Server`). You can also import
the classes with the `use` keyword; for example, `use HM\Backdrop\Task` will
allow you to create tasks with `new Task`.
## License
Backdrop is licensed under the GPL version 2.
Copyright 2014 Human Made Limited
================================================
FILE: backdrop/hm-backdrop.php
================================================
<?php
require dirname( __FILE__ ) . '/server.php';
require dirname( __FILE__ ) . '/task.php';
if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
require dirname( __FILE__ ) . '/namespace.php';
add_action( 'wp_ajax_nopriv_hm_backdrop_run', 'HM\Backdrop\Server::spawn' );
}
else {
add_action( 'wp_ajax_nopriv_hm_backdrop_run', 'HM_Backdrop_Server::spawn' );
}
================================================
FILE: backdrop/license.txt
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: backdrop/namespace.php
================================================
<?php
namespace HM\Backdrop;
class Server extends \HM_Backdrop_Server {}
class Task extends \HM_Backdrop_Task {}
================================================
FILE: backdrop/server.php
================================================
<?php
class HM_Backdrop_Server {
public function run() {
if ( empty( $_POST['key'] ) ) {
return new WP_Error( 'hm_backdrop_no_key', __( 'No key supplied', 'hm_backdrop' ) );
}
$data = get_transient( 'hm_backdrop-' . $_POST['key'] );
if ( empty( $data ) ) {
return new WP_Error( 'hm_backdrop_invalid_key', __( 'Supplied key was not valid', 'hm_backdrop' ) );
}
$result = call_user_func_array( $data['callback'], $data['params'] );
delete_transient( 'hm_backdrop-' . $_POST['key'] );
if ( is_wp_error( $result ) ) {
return $result;
}
return true;
}
public static function spawn() {
$class = get_class();
if ( function_exists( 'get_called_class' ) ) {
$class = get_called_class();
}
return call_user_func( array( $class, 'spawn_run' ), $class );
}
protected static function spawn_run( $class ) {
$server = new $class();
$server->run();
exit;
}
}
================================================
FILE: backdrop/task.php
================================================
<?php
class HM_Backdrop_Task {
protected $key;
protected $callback;
protected $params = array();
public function __construct( $callback /* , $... */ ) {
$this->callback = $callback;
if ( func_num_args() > 1 ) {
$args = func_get_args();
$this->params = array_slice( $args, 1 );
}
$this->key = $this->get_unique_id();
}
public function schedule() {
if ( $this->is_scheduled() ) {
return new WP_Error( 'hm_backdrop_scheduled', __( 'Task is already scheduled to run', 'hm_backdrop' ) );
}
$data = array(
'callback' => $this->callback,
'params' => $this->params
);
set_transient( 'hm_backdrop-' . $this->key, $data, 300 );
add_action( 'shutdown', array( $this, 'spawn_server' ) );
return true;
}
public function is_scheduled() {
return (bool) $this->get_data();
}
public function cancel() {
if ( ! $this->is_scheduled() ) {
return new WP_Error( 'hm_backdrop_not_scheduled', __( 'Task is not scheduled to run', 'hm_backdrop' ) );
}
delete_transient( 'hm_backdrop-' . $this->key );
return true;
}
public function spawn_server() {
$server_url = admin_url( 'admin-ajax.php' );
$data = array(
'action' => 'hm_backdrop_run',
'key' => $this->key,
);
$args = array(
'body' => $data,
'timeout' => 0.01,
'blocking' => false,
'sslverify' => apply_filters( 'https_local_ssl_verify', false ),
);
wp_remote_post( $server_url, $args );
return true;
}
protected function get_data() {
return get_transient( 'hm_backdrop-' . $this->key );
}
protected function get_unique_id() {
return substr( sha1( serialize( $this->callback ) . serialize( $this->params ) ), -28 );
}
}
================================================
FILE: backupwordpress.php
================================================
<?php
/*
Plugin Name: BackUpWordPress
Plugin URI: https://updraftplus.com/backupwordpress/?afref=744
Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools → Backups</strong>. On multisite, you'll find me under the Network Settings menu.
Version: 3.10
Author: XIBO Ltd
Author URI: https://profiles.wordpress.org/xibodevelopment
License: GPL-2+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Text Domain: backupwordpress
Domain Path: /languages
Network: true
*/
/*
Copyright 2011 - 2018 XIBO Ltd
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Only load if >= PHP 5.3
if ( ! defined( 'HMBKP_PLUGIN_PATH' ) ) {
define( 'HMBKP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'HMBKP_BASENAME' ) ) {
define( 'HMBKP_BASENAME', plugin_basename( __FILE__ ) );
}
require_once( HMBKP_PLUGIN_PATH . 'classes/class-setup.php' );
register_activation_hook( __FILE__, array( 'HMBKP_Setup', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'HMBKP_Setup', 'deactivate' ) );
if ( HMBKP_Setup::meets_requirements() ) {
require_once( HMBKP_PLUGIN_PATH . 'classes/class-plugin.php' );
} else {
add_action( 'admin_init', array( 'HMBKP_Setup', 'self_deactivate' ) );
add_action( 'all_admin_notices', array( 'HMBKP_Setup', 'display_admin_notices' ) );
}
================================================
FILE: bin/readme.txt
================================================
=== BackUpWordPress ===
Contributors: xibodevelopment, willmot, dashaluna, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier, katmoody, sambulance, dnutbourne, snightingale
Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, xibodevelopment
Requires at least: 3.9
Tested up to: 5.1
Stable tag: 3.10
Simple automated backups of your WordPress-powered website.
== Description ==
BackupWordPress was created by our friends at HumanMade but is now under new ownership. We're committed to opensource and WordPress and will provide free support for the many BackupWordPress fans.
We'll make occasional updates to the free software - please send us any patches you'd like to see released here: [https://github.com/orgs/xibodevelopment/](https://github.com/orgs/xibodevelopment/)
However, we'll no longer be selling or supporting the paid add-ons (e.g. for backups to Dropbox and Google Drive). It's certainly a good idea to backup to cloud storage to protect against server-wide risks.
For this we recommend [UpdraftPlus WordPress Backups](https://updraftplus.com/?afref=744) which can do things for free BackupWordPress Premium could do on a paid basis. Click here for [full comparison](https://updraftplus.com/backupwordpress/?afref=744).
BackUpWordPress will back up your entire site including your database and all your files on a schedule that suits you. Try it now to see how easy it is!
This plugin requires PHP version 5.3.2 or later
= Features =
* Super simple to use, no setup required.
* Works in low memory, "shared host" environments.
* Manage multiple schedules.
* Option to have each backup file emailed to you.
* Uses `zip` and `mysqldump` for faster backups if they are available.
* Works on Linux & Windows Server.
* Exclude files and folders from your backups.
* Good support should you need help.
* Translations for Spanish, German, Chinese, Romanian, Russian, Serbian, Lithuanian, Italian, Czech, Dutch, French, Basque.
= Help develop this plugin =
The BackUpWordPress plugin is hosted on GitHub, if you want to help out with development or testing then head over to [https://github.com/orgs/xibodevelopment/backupwordpress/](https://github.com/orgs/xibodevelopment/backupwordpress/)
= Translations =
We'd also love help translating the plugin into more languages, if you can help then please visit [https://translate.wordpress.org/projects/wp-plugins/backupwordpress/dev/](https://translate.wordpress.org/projects/wp-plugins/backupwordpress/dev/) to start translating.
== Installation ==
1. Install BackUpWordPress either via the WordPress.org plugin directory, or by uploading the files to your server.
2. Activate the plugin.
3. Sit back and relax safe in the knowledge that your whole site will be backed up every day.
The plugin will try to use the `mysqldump` and `zip` commands via shell if they are available, using these will greatly improve the time it takes to back up your site.
== Frequently Asked Questions ==
**Where does BackUpWordPress store the backup files?**
Backups are stored on your server in `/wp-content/backups`, you can change the directory.
Important: By default BackUpWordPress backs up everything in your site root as well as your database, this includes any non WordPress folders that happen to be in your site root. This does mean that your backup directory can get quite large.
**What if I want to back up my site to another destination?**
We no longer be sell or support the paid add-ons (e.g. for backups to Dropbox and Google Drive). It's certainly a good idea to backup to cloud storage to protect against server-wide risks. For this we recommend [UpdraftPlus WordPress Backups](https://updraftplus.com/?afref=744) which can do things for free BackupWordPress Premium could do on a paid basis. Click here for [full comparison](https://updraftplus.com/backupwordpress/?afref=744).
**How do I restore my site from a backup?**
You need to download the latest backup file either by clicking download on the backups page or via `FTP`. `Unzip` the files and upload all the files to your server overwriting your site. You can then import the database using your hosts database management tool (likely `phpMyAdmin`).
**Does BackUpWordPress back up the backups directory?**
No.
**I'm not receiving my backups by email**
Most servers have a filesize limit on email attachments, it's generally about 10mb. If your backup file is over that limit, it won't be sent attached to the email. Instead, you should receive an email with a link to download the backup. If you aren't even receiving that, then you likely have a mail issue on your server that you'll need to contact your host about.
**How many backups are stored by default?**
BackUpWordPress stores the last 10 backups by default.
**How long should a backup take?**
Unless your site is very large (many gigabytes) it should only take a few minutes to perform a backup. If your back up has been running for longer than an hour, it's safe to assume that something has gone wrong. Try de-activating and re-activating the plugin. If it keeps happening, contact support.
**What do I do if I get the wp-cron error message?**
The issue is that your `wp-cron.php` is not returning a `200` response when hit with a HTTP request originating from your own server, it could be several things. In most cases, it's an issue with the server / site.
There are some things you can test to confirm this is the issue.
* Are scheduled posts working? (They use wp-cron as well.)
* Are you hosted on Heart Internet? (wp-cron may not be supported by Heart Internet, see below for work-around.)
* If you click manual backup, does it work?
* Try adding `define( 'ALTERNATE_WP_CRON', true );` to your `wp-config.php`. Do automatic backups work?
* Is your site private (i.e. is it behind some kind of authentication, maintenance plugin, .htaccess)? If so, wp-cron won't work until you remove it. If you are and you temporarily remove the authentication, do backups start working?
**How to get BackUpWordPress working in Heart Internet**
The script to be entered into the Heart Internet cPanel is: `/usr/bin/php5 /home/sites/yourdomain.com/public_html/wp-cron.php` (note the space between php5 and the location of the file). The file `wp-cron.php` `chmod` must be set to `711`.
**My backups seem to be failing?**
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, you can find further assistance on our <a href="http://wordpress.org/support/plugin/backupwordpress" title="support forums" target="_blank">support forums</a>.
**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>
For development issues, feature requests or anybody wishing to help out with development checkout <a href="https://github.com/orgs/xibodevelopment/backupwordpress/">BackUpWordPress on GitHub.</a>
== Screenshots ==
1. Manage multiple schedules.
2. Choose your schedule, backup type, number of backups to keep and whether to receive a notification email.
3. Easily manage exclude rules and see exactly which files are included and excluded from your backup.
== Upgrade Notice ==
= 3.4 =
* This version introduces a major refactoring of the code responsible for the core backup engine. We made sure to write
unit tests for the new code, and we have tested it on several user's sites. It fixes a lot of old bugs, and Windows
users should see major improvements to reliability.
= 3.3.4 =
* WordPress 4.4 compatibility.
= 3.3.1 =
* Fixes a bug that would prevent downloading backups since 3.3.0 - please update.
= 3.2.5 =
* Security fixes related to add_query_arg
= 3.2.1 =
* Important bug fixes. Please upgrade to this version to avoid incomplete or broken backups.
= 3.1.3 =
* Fixes backwards compatibility for add-ons and avoids a Fatal Error. Please upgrade straight to this version before upgrading your add-ons.
= 3.0.4 =
* Fixes a few minor bugs. Immediate update is recommended.
= 3.0.2 =
* Important: we have dropped support for PHP 5.2, you will not be able to activate BackUpWordPress on a server running PHP versions older than PHP 5.3.29
= 3.0.1 =
* This is a critical update. Fixes a bug in the core backup library. Please update immediately.
== Changelog ==
### 3.10 / 2019-06-12
* Fixed whitelist-html
### 3.9 / 2019-06-10
* Readme update
### 3.8 / 2018-11-01
* GNU Wording change
### 3.7.2 / 2018-10-29
* Check remove intercomm links
### 3.7.1 / 2018-09-11
* Fixed admin notices
### 3.7 / 2018-08-30
* Updated readme to reflect ownership changes
* Stripped out support and premium links
### 3.6.4 / 2016-06-02
* Various improvements to exclusion handling.
* i18n improvements.
* Misc. UI improvements.
### 3.6.3.1 / 2016-12-14
* Fix issue where low disk space caused the admin interface to be unavailable
* Fix issue where admin notices were causing databases and error logs to fill up
* Improves file size calculations
* Improves remaining disk space calculations
* Improves file exclusion methods
* Misc admin interface improvements
* Misc code quality improvements and bug fixes
### 3.6.2 / 2016-08-02
* Improves admin performance.
* Improves security in internationalised strings.
### 3.6.1 / 2016-04-26
* Bug fixes/improvements in disk space calculation
* Misc bug fixes
### 3.6.0 / 2016-03-31
* Fix a bug caused by using a function incompatible with min PHP version requirements
* Misc code quality improvements and bug fixes
* Fix bugs in the code responsible for admin notices
* Display disk space info
* Uninstall cleanup
* Introduce a dedicated extensions page
### 3.5 / 2016-03-10
* Reduce duplication and improve code readability when echoing filesizes
* Improve how filesizes are handled in the Your Site list
* Switch to storing site size data in a file, large sites could cause database errors when saving the option
* Re-remove the PHP User and Group Requirements
* Check that the backup file exists before attempting to check it's contents
* Only call getPerms on readable files to ensure we avoid a fatal error
* Ensure error are correctly check in verify_backup
* Use Symfony Process instead of shell_exec for all our system calls
* More unit tests
* Update dependencies
* Detect disabled functions defined in php.ini, now accounts for different separators.
### 3.4.5 / 2016-02-23
* Fix fatal error on upgrade
### 3.4.4 / 2016-02-23
* Ensure temporary files are correctly cleaned up before and after running a backup.
* Avoid killing site if plugin is active on PHP 52
* Allow custom secure key using filter
* Fixes a bug which caused the root path to the WordPress install to be miscalulated in certain setups.
### 3.4.4-beta
* Fixes a bug which caused the root path to the WordPress install to be miscalulated in certain setups.
### 3.4.3
* Fix a bug where backups were not downloadable when WordPress installed in a subdirectory
### 3.4.2
* Remove the usage of `shell_exec` in two of our warning messages, fixes a PHP Warning on systems with it disabled.
* Improve how we handle `open_basedir` restrictions, fixes a PHP Warning on some systems. Adds unit tests to cover `open_basedir` handling.
* Show an error message if neither `mysqldump` nor `PDO:mysql` are available. Database backups won't work without at least one of them.
* Improve our upgrade code for users upgrading from pre version 2.0. Fixes a possible fatal error and ensures backups and backup settings are correctly brought forward.
### 3.4.1
* Fix a possible `PHP Warning` in the Schedule Sentence.
### 3.4 / 2016/01/20
* Introduces a major re-factor of the underlying backups engine, many bugs fixed and much improved unit test coverage.
* Vastly improved Windows Server support.
* We no longer write errors and warnings to files on disk.
* Update to the latest version of `symfony/finder`.
* Update to the latest version of `ifsnop/mysqldump-php`.
### 3.3.4 / 2015-12-10
* Fixes styling issues with WordPress 4.4
### 3.3.3 / 2015-11-13
* Fix broken Intercom support window
* Fixes Typos in i18n strings
* Backups finish faster
* Fix an issue that caused the site size to report as twice as large as it should
* Adds PHP mysqldump fallback lib (`ifsnop/mysqldump-php`)
### 3.3.2 / 2015-10-15
* Misc improvements
### 3.3.1 / 2015-10-12
* Fix false positive error message.
* Fix broken download links
### 3.3.0 / 2015-10-09
* Dropped support for PclZip
* Fixed duplicate cron schedule interval names ( props ucavus )
* Corrected some typos, grammar and punctuation ( props ucavus )
* Fixed a bug in the WP CLI command ( props duritong )
* Better message for wp-cron related errors
* Replace 'bi-weekly' with less confusing wording
* Fixed a few errors misc reported by code quality tool
* Total site size display now subtracts excludes
* Many general improvements and bug fixes
#### 3.2.7 / 2015-07-27
* Pass schedule type instead of schedule id as context for the calculated sizes, it's more useful
* Simply output arrays rather than trying to be too clever about it
* Start tracking PDO availability through Intercom
* Catch database and files shell_exec warnings
* Test under PHP 5.6 in Travis
* Use the new backupwordpress@hmn.md email address everywhere
* Clarify how people request access to Slack and GlotPress
* Rewrite our contributing guidelines to be more comprehensive
* Add instructions to contributing.md
* Revert plugin name as it doesn't make a diff in search results
* Always return an integer
#### 3.2.6 / 2015-06-09
* Fixes admin page slug for multisite
#### 3.2.5 / 2015-04-29
* Fixes an issue when evaluating expression with empty
* Fixes a fatal error on PHP 5.3
* Displays other notices
* Updates stable tag
* Adds some escaping and sanitizing
* Defines plugins dir for different environments
* Adds tests for activation and deactivation hooks
* Adds a debugging function for tests
* Symlinks plugin into tests dir
* Splits out deactivation code into separate functions
* Fixes activation and deactivation hooks not being fired
* Exclude backups folder from size calculation
* Fixes a misplaced parenthesis
* Fixes how error messages are bubbled up
* get home path should return defined value
* Removes redundant exclude statement as CVS folders are excluded by default
* Adds a flag parameter to allow get_files to return all files including default excludes
#### 3.2.4 / 2015-04-01
* Fixes default exclude pattern that was too greedy.
#### 3.2.3 / 2015-04-01
* Fixes issue where files where 'cache' files were excluded by default.
* Updates brazilian portuguese translations.
* Fixes the issue with the 'no thanks' button in the Support modal and misc JS improvements. props SiamKreative.
#### 3.2.2 / 2015-03-25
* Fixes error in manual backups, caused by incorrect plugin version number in class, which is used for the JS script version.
#### 3.2.1 / 2015-03-25
* Check if shell_exec is available before running command
* Only validate day of month if this is the schedule type
* Make FS optional and fix the DB connect method
* (issue-770) Exclude the folder, not the wildcard
* (issue-751) Rename plugin
#### 3.2 / 2015-03-16
* (issue-698) skip mySql bug
* Use shell_exec
* Remove use statement
* Revert to using shell_exec
* Remove Process
* (cool-runnings-757) Add back session_write_close
* (issue-479) Hide hours and minutes for hourly backups
* (backupception) Only load if main site on multisite
* (all-paths-lead-to-rome) Set plugin path to main plugin file to avoid relative paths
* (socket-to-me-one-more-time) Fix paths
* Use socket if available
* Display errors
* Put the db dump in the archive first - fixes issue with large archive
* Dont wait for response
* Run schedule as a Backdrop task
* Pass array directly to function
* (issue-759) Fix require paths
* check PHP version before anything else
* Move plugin class to own file
* Skip mysql bug error
* Delete all BWP options
* Start the process
* Return and check WP_Error
* (what-time-is-backup) Extract hours and minutes from the date as an array for display
* Change plugin description if multisite
* Use wp_get_sites
* Add a comment
* We check for this on plugin instantiation
* Revert to clearing schedule and rescheduling
* Delete schedules and leftover options from subsites
* Ensure plugin only runs on main site
* Fix Too Many Schedules
* Use Symfony Process
* (fix-incorrect-type-error) File is an SPL object so get path
* Set root as default param
* Delete backdrop transient
* Force directory sizes recalculation
* Define VCS abbr
* Hide exclude patterns from Excludes list.
* Check if user can connect
* Test that the mysqldump command works
* Add a couple of mysql versions
* Automatically exclude VCS folders
* Calculate Root size correctly
* Get default rules from backup object
* Do not auto ignore dot files
* Count excluded
* Do not count excluded
* If its the root then return its size directly
* Fix typo in transient names
* Set and return class property instead
* List default excludes as such
* Require symfony finder
* Clear transients on deactivate
* Get list of files with Finder
* Load composer packages
* These are alredy filtered
* Add some default excludes
* Use absolute path for excludes added via UI
* Fix tests
* Fix conditional
* Fix syntax error in travis YML
* Run codesniffer only on pull requests
* Update tested WP versions
* Change min WP version required to match travis CI
* Fix readme changelog placement
* Add condtion for Cron and Ajax
* Fix deactivate logic
* Fixes recursive exclusion of files
#### 3.1.4 / 2015-02-24
* (upgrade-options) Bump version
* strtolower is redundant
* Upgrade routine - renames service settings to avoid backslashes.
* Use the Service name as the setting name
* Clear settings for schedule settings
* Fixes bug in displaying settings error notices
* Update version number
* Merge pull request #726 from humanmade/fix-fatal-error-missing-class-addons
* Leave bare minimum to avoid fatal error
* remove old main plugin class
#### 3.1.3 / 2015-02-04
* Keep deprecated classes in a deprecated.php file to avoid Fatal Error in addons during upgrade.
#### 3.1.2 / 2015-02-03
* (simplify-bwp-file-timestamp) Simplify the file name timestamp
* Fix class file name
* (fixup-setup-class) Add missing transients to uninstall routine
* switch Travis notifications to Slack instead of Hipchat
* Do not delete backups on uninstall
* wrap in parenthesis
* Fix include paths after moving uninstall to own file herpderp
* Update BackUp class include
* Add all cases to switch
* Pass scanned files sizes through conform_dir()
* Fix some classes and requires
* (origin/issue-684, issue-684) Fix namespaces
* Remove unnecessary wildcard from regex
* (crazy-refactor) Remove some duplication
* Formatting
* Fix Class name
* Blank line
* Uses a DirectoryIterator to delete files
* Remove tests for now
* Fix stable tag number
* Revert to using uninstall.php
* Add tests for uninstall and deactivate
* Remove double lie break
* Remove double line break
* Remove phpdocumentor
* We still need to require some scripts...
* We dont need to check for this constant in the hook callback
* Use get_col to directly have an array of schedule option names
* Remove namespacing
* Remove debugging
* Make the uninstall, activation and deactivation hooks work
* (change-singleton-implementation) Change the singleton implementation to not use the static() function
* path argument interfers with wp-cli path argument.
* Fix some scrutinizer issues, mostly major ones
* Consistent default name for database dumps
* Major 5.3 re-factoring fun
* Minor code formatting
* else if should be elseif
* Update the WP_CLI command to fix some issues
* Add support for copying and updating an existing backups
#### 3.1.0 / 2015-01-13
* Correct $response1 variable
* (origin/issue-652, issue-652) Suppress warnings from filesystem functions
* Remove debugging function
* (origin/issue-475, issue-475) Fix a French string
* Format the intercom data better
* Load Intercom in the admin footer
* Fix some HTML issues
* Add a function that returns a given option value
* Return Unknown if no average exists or invalid
* Add a start parameter to function
* Pass in the start time as a parameter
* Make strings translatable
* Escape values
* Adds a function to track backup duration and another to display it
* Adds Average Backup Duration Info
* Improve display of arrays
* Fixes open_basedir warnings
* Replace spaces with tabs for indentation
* (wp-cron-test-improvements) Improve the reliability of the wp-cron test
* Pop in the directory sizes
* Adapt heartbeat pulse
* Update Javascript
* Update constant name
* Load the default translations so that activation error message is in user language
* Fix a few translatable strings
* Update French translations
* Re-uglify Intercom js
* Use provided callback argument to determine current screen
* remove deprecated code
* Only show notices on BWP admin page
* Fix class name
* Make function public for now
* Get an instance of BWP to load functions
* Fix conditional
* Show admin notice if fails to meet requirements
* Remove unneeded function
* Fix references
* Refactor main class after addition of the Setup class
* Introduce a setup class
* Determine if we need to run a cleanup routine
* Introduce a custom hook for addons
* Refactor main plugin file into a singleton class
* Bring activation and deactivation into main plugin class
* css changes to fix support button alignment
* Fixes issue preventing backups from running without JS
* Remove back compat memory limit define
* Refactor HMBKP_Notices to support non-persistant notices
* Minor refactor for PHP minimum requirements notice
* Clear previous backup notices when running a new backup
* Fix issues with custom paths
* Improved singleton pattern
* Display errors in network admin
* Change to text input so multiple email address are supported
* Removes HTML tag from string
* Account for new schedule
* Make upsell sentence translatable
* fix return type
* Return true if transient exists
* Check if constant is defined
* Request the site size via heartbeat send
* Pass site size through heartbeat
* Only calculate if necessary
#### 3.0.4 / 2014-12-10
* Simplify the backup count display
* Enqueue scripts properly
* Change how we check directory_sizes
* Add BackUpWordPress test case class
* Move class to separate file
* Group help tab display functions
* Update POT file
* Make strings ready for translation
#### 3.0.3 / 2014-12-06
* Add French translations
* Update textdomain
* Fix deleted function
* Use HM_Backup function to determine if shell_exec is enabled
* Check if file is readable first
* Fix how we kick off Task
* Remove unused var
* Call recursive filescanner on admin page load
* Update package.json
* Update the POT file task params
* Replace hmbkp with backupwordpress as textdomain
* Exclude folders
* Add Grunt task options
* Remove hard line returns
* Display placeholder if exec fails
* Add 30 second time diff allowance
* Use $TRAVIS_BUILD_DIR
* we do this in travis.yml
* Regenerate github account info
* Update command to reflect function rename
* Update tests to reflect function name change
* Rename function
* Filter tests to run
* Fix group flags
* Calculate site size on page load
#### 3.0.2 / 2014-12-02
* Bump version
* Add parenthesis to require_once
* Remove disk space info
* Attempt to fix build
* define WP_TESTS_DIR
* Make sure current_action fnction is loaded
* Remove extra slashes and semicolons
* Remove the custom webhook service
* Better default WP_TESTS_DIR
* move trailingslash calls out of the loop for performance
* Minor code cleanup
* Correct path for hm-backup so it's tests are run
* add composer.lock
* Use scrutinizer code coverage
* add waffle.io badge
* Use up to date commands for coverage
* Add code rating
* Don't test 5.2
* Update readme.md
* excluded_dirs is deprecated
* Update scrutinizer config
* Add composer config and dev dependencies
* Make PHPUnit generate an XML for coveralls
* Add scrutinizer config
* Ignore vendor dir
* Add a link to Help page
* Move to activation hook
* Bump up required WP version
* Escape all the things
* Save errors to a notices option
* Reload page on errors
* Remove script
* Remove unneeded class
* Check PHP version on plugins loaded
* Check PHP version on activate
* Update readme
* Set required version to 5.3.2
* Update tests
* Allow for a 30 second delta in asserting schedule time
* Use the new build env on Travis
* Restrict plugin to be network only
* Fix admin URL logic
* Formatting
* Update readme changelog
#### 3.0.1 / 2014-11-20
* remove uneeded images
* latest hm-backup / fixes a serious bug in backups.
* Typos in v 3.0 changelog
* Specify POT filename in grunt task
* Update POT file
* Markdown readme
* Regenerate readme
* Add plugin headers
#### 3.0 / 2014-11-14
* Refactor the recursive filesize scanner
* correct text domain
* Remove unneede statements
* reload the excludes filelist in the correct place when someone excludes a file
* Latest backdrop
* Regenerate minified CSS
* Regenerate minified JS
* Fix cancel backup action
* WordPress Coding Standards
* Exit early if incompatible version of WordPress
* Update translations
* Update changelog
#### 3.0.0-beta / 2014-09-08
* Load minified CSS
* Formatting
* Biweekly wording
* Add missing period
* use nonce_url instead of manually adding the nonce query param
* close the settings form when done
* Design changes as per ticket
* Start tracking langauge in server info
* Right align the primary button in the enable support modal
* Re-factor the directory filesize code to use a single array instead of thoussands of transients
* Remove the warning that would show if you were using anything other than the latest stable, it's no longer needed now that the FAQ is local
* switch to using a single transient to store directory filesize data
* Add an anchor link
* Add error message
* Rename function
* Prefix GET params
* Update exclude rule action
* Adds function for building admin action urls
* fix vertical scroll
* Adds some functions to manage settings form submission errors
* Rename nonce and action
* fetch errors to display
* Form submission handling for BWP and add-ons settings
* Use a new function that persists form submission errors to a transient
* None check
* Pass the nonce around in the ajax request
* Enable support action links
* Check nonces
* Modify action URLs to use the admin_post hook
* Remove unneeded code
* New line at end
* Use admin_post hook
* Display schedule start time in local timezone
* Add an action hook that gives access to consumers to the backup progress
* Update translatable strings POT file
* Bump version
* Update min WP version and tested up to
* accidently used dash instead of underscore
* namespaced option and added option to uninstall.php
* basic show/hide of premium upsell
* Fix incorrect transient expiry
* Show the spinner in the tab if a schedule other than the current is running
* Snip snip
* Bring back the some javascript enhancements
* Switch to the PHP 5.2 compatible version of Backdrop
* Finish up support
* Brace up single line if's and foreach's
* Only load minified scripts and styles if WP_DEBUG isn't on
* Load the minified css and js files by default
* Remove the combined css files as we only have one now. Stop loading colorbox.
* Remove colorbox
* Improvements
* More improvements
* Don't die when directly running a backup on page load
* Re-factor the backup filesize calculation
* make capability filterable
* use core capabilities instead of custom
* Switch to Backdrop
* Fix typo in prefix
* Hook function onto admin_post
* Update delete link
* Bookmark current admin page for redirect
* Add custom capabilities and role
* Exclude BackUpWP by default
* Ignore the build folder
* Add more build excludes
* minify JS
* generate markdown readme
* minify css
* combine css
* regenerate readme
* Make links consistent for the grunt task
* Convert URLS to markdown
* Update lang files
* Add colorbox as bower dependency
* remove colorbox folder
* Remove colorbox submodule
* Change how we include FAQ
* Add readme partials
* Add package.json
* Add Gruntfile
* Add bower.json
* JSHint rules
* remove from ignore
* Update ignore list
* Add bower config
* Add FAQ strings
* Return the cached directory size early if we have it
* Re-factor the file browser scanner
* correct sprintf usage
* Handle saving service forms
* Codeing standards
* Move the error check outside of the foreach
* Remove uneeded $is_tab_visible
* Only show excludes for backups which include files
* Show destinations in the list of schedule links
* WordPress standard modal for enabling support
* Remove extra slash in include path
* Add a heading to the settings form
* More work on excludes
* Another todo
* Add some todos
* Don't include the parent directory in a browsable list
* More work on Excludes
* Switch to only storing 3 backups by default
* More work on redesign
* commented out enable support button till we figure out what to do with it
* made tabs responsive below 639px
* More work on redesign
* Add more default excludes
* Correctly highlight the tab for the first schedule
* Switch to tabs instead of subsubsub
* First bash at a redesign settings UX
#### 2.6.2
* Reverts a change to how the home path is calculated as it caused issues on installs where wp-config.php was stored outside of web root. Props to @mikelittle for the bug report.
#### 2.6.1
* Bump minimum WP requirement to 3.7.3, the latest security release on the 3.7 branch.
* Fix an issues that could cause schedule times to fail to account for timezone differences.
* Add a nonce check to the schedule settings.
* Fix a possible JS warning when removing an exclude rule.
* Our unit tests now run in PHP 5.2 again.
#### 2.6
* It's now possible to choose the time and day that your schedule will run on.
* Introduces several new unit tests around schedule timings.
* Fixes a bug that could cause the hourly schedule to run constantly.
* Improved the layout of the Constants help panel.
* If the backup root directory is unreadable then the plugin will no longer function.
* Update the backups table match the standard WordPress table styles.
* Improved styling for the settings dialogue.
* Improved styling for the Server Info help tab.
* /s/back ups/backups.
* Remove Deprecated call to `screen_icon`.
* Updated French translation.
* Update the `WP CLI` command to use the new method for registering command.
* Reload the schedules when re-setting up the default schedules so they show up straight away.
* s/dpesnt't/doesn't.
* Only show the estimated total schedule size when editing an existing schedule.
* Stop stripping 0 from the minutes on hourly backups so that backups at 10 (& 20, etc.) past the hour correctly show.
* Disable buttons whilst ajax requests are running.
* Move spinners outside the buttons as they didn't look very good inside.
* Improve the detection of the home path on multisite installs which have WordPress in a subdirectory.
* Track the time that the running backup is started and display how long a backup has been running for.
* Fix an issue that meant it wasn't possible to run multiple manual backups at the same time.
* Many other minor improvements.
#### 2.5
* BackUpWordPress now requires WordPress 3.7.1 as a minimum.
* Remove some old back-compat code that was required because we supported older WP versions.
* It's now possible to change the email address that notification emails are sent from using the `hmbkp_from_email` filter.
* The spinner is now retina!
* Close the PHP Session before starting the backup process to work around the 1 request per session issue. Backup status will now work on sites which happen to call `session_start`.
* Pass `max_execution_time` and the BackUpWordPress Plugin version back to support. * Include the users real name in support requests
* Stop passing `$_SERVER` with support requests as it can contain things like `.htaccess` passwords on some server configurations.
* Improve the display of the server info in the enable support popup.
* New screenshots
* Use `wp_safe_redirect` for internal redirects.
* Use `wp_is_writable` instead of `is_writable`.
#### 2.4.2
* In WordPress Multisite the backups admin page is now located in Network admin instead of the wp-admin of the main site.
* Fixed an issue with the new intercom support integration that could cause loading the backups page to timeout
* Fixed 3 stray PHP warnings.
* BackUpWordPress will now always be loaded before any BackUpWordPress Extensions.
* Fixed an issue that could cause a long modal (excludes) to show underneath the WP admin bar.
#### 2.4.1
* Add missing colorbox images
#### 2.4
* Support for new premium extensions for storing backups in a variety of online services.
* Exclude the WP DB Manager backups and WP Super Cache cache directories by default.
* We now use Intercom to offer support directly from within the plugin, opt-in of course.
* More i18n fixes / improvements.
* We no longer show download links if your backups directory isn't web accessible.
* Fix a bug that caused the plugin activation and deactivation hooks from firing.
* Correctly handle `MYSQL TIMESTAMP` columns in database dumps.
* `mysqldump` and `zip` are now correctly recognised on SmartOS.
* Schedule names are now translatable.
* Avoid having to re-calculate the filesize when a schedules type is set.
* Compatibility with WordPress 3.8
#### 2.3.2
* Correct version number.
#### 2.3.1
* Fix a PHP strict error.
* Save and close as separate buttons.
* Fix bug that caused multiple notification emails.
* Fixes typo in database option name.
* Updated translations.
* Improve PHP docblocks.
* Make schedules class a singleton.
* Exclude popular backup plugin folders by default.
* Exclude version control folders by default.
* Fix broken localisation.
* Use `wp_safe_redirect` instead of `wp_redirect` for internal form submissions
*
#### 2.3
* Replace Fancybox with Colorbox as Fancybox 2 isn't GPL compatible.
* Use the correct `HMBKP_ATTACHMENT_MAX_FILESIZE` constant consistently in the help section.
* Correct filename for some mis-named translation files.
* Show the total estimated disk space a schedule could take up (max backups * estimated site size).
* Fix a typo (your -> you're).
* Use the new time Constants and define backwords compatible ones for > than 3.5.
* Play nice with custom cron intervals.
* Main plugin file is now `backupwordpress.php` for consistency.
* Add Paul De Wouters (`pauldewouters`) as a contributor, welcome Paul!
* Don't remove non-backup files from custom backup paths.
* Fix a regression where setting a custom path which didn't exist could cause you to lose existing backups.
* When moving paths only move backup files.
* Make some untranslatable strings translatable.
* Don't allow a single schedule to run in multiple threads at once, should finally fix edge case issues where some load balancer / proxies were causing multiple backups per run.
* Only highlight the `HMBKP_SCHEDULE_TIME` constant in help if it's not the default value.
* Remove help text for deprecated `HMBKP_EMAIL`.
* Default to allways specificing `--single-transaction` when using `mysqldump` to backup the database, can be disabled by setting the `HMBKP_MYSQLDUMP_SINGLE_TRANSACTION` to `false`.
* Silence a `PHP Warning` if `mysql_pconnect` has been disabled.
* Ensure dot directories `.` & `..` are always skipped when looping the filesystem.
* Work around a warning in the latest version of MySQL when using the `-p` flag with `mysqldunmp`.
* Fix issues on IIS that could cause the root directory to be incorrectly calculated.
* Fix an issue on IIS that could cause the download backup url to be incorrect.
* Fix an issue on IIS that could mean your existing backups are lost when moving backup directory.
* Avoid a `PHP FATAL ERROR` if the `mysql_set_charset` doesn't exist.
* All unit tests now pass under IIS on Windows.
* Prefix the backup directory with `backupwordpress-` so that it's easier to identify.
* Re-calculate the backup directory name on plugin update and move backups.
* Fix some issues with how `HMBKP_SECURE_KEY` was generated.
#### 2.2.4
* Fix a fatal error on PHP 5.2, sorry! (again.)
#### 2.2.3
* Fix a parse error, sorry!
#### 2.2.2
* Fix a fatal error when uninstalling.
* Updated translations for Brazilian, French, Danish, Spanish, Czech, Slovakian, Polish, Italian, German, Latvian, Hebrew, Chinese & Dutch.
* Fix a possible notice when using the plugin on a server without internet access.
* Don't show the wp-cron error message when `WP_USE_ALTERNATE_CRON` is defined as true.
* Ability to override the max attachment size for email notifications using the new `HMBKP_ATTACHMENT_MAX_FILESIZE` constant.
* Nonce some ajax request.
* Silence warnings created if `is_executable`, `escapeshellcmd` or `escapeshellarg` are disabled.
* Handle situations where the mysql port is set to something wierd.
* Fallback to `mysql_connect` on system that disable `mysql_pconnect`.
* You can now force the `--single-transaction` param when using `mysqldump` by defining `HMBKP_MYSQLDUMP_SINGLE_TRANSACTION`.
* Unit tests for `HM_Backup::is_safe_mode_available()`.
* Silence possible PHP Warnings when unlinking files.
#### 2.2.1
* Stop storing a list of unreadable files in the backup warnings as it's too memory intensive.
* Revert the custom `RecursiveDirectoryIterator` as it caused an infinite loop on some servers.
* Show all errors and warnings in the popup shown when a manual backup completes.
* Write the .backup_error and .backup_warning files everytime an error or warning happens instead of waiting until the end of the backups process.
* Fix a couple of `PHP E_STRICT` notices.
* Catch more errors during the manual backup process and expose them to the user.
#### 2.2
* Don't repeatedly try to create the backups directory in the `uploads` if `uploads` isn't writable.
* Show the correct path in the warning message when the backups path can't be created.
* Include any user defined auth keys and salts when generating the HMBKP_SECURE_KEY.
* Stop relying on the built in WordPress schedules as other plugins can mess with them.
* Delete old backups everytime the backups page is viewed in an attempt to ensure old backups are always cleaned up.
* Improve modals on small screens and mobile devices.
* Use the retina spinner on retina screens.
* Update buttons to the new 3.5 style.
* Fix a possible fatal error caused when a symlink points to a location that is outside an `open_basedir` restriction.
* Fix an issue that could cause backups using PclZip with a custom backups path to fail.
* Security hardening by improving escaping, sanitizitation and validation.
* Increase the timeout on the ajax cron check, should fix issues with cron errors showing on slow sites.
* Only clear the cached backup filesize if the backup type changes.
* Add unit tests for all the schedule recurrences.
* Fix an issue which could cause weekly and monthly schedules to fail.
* Add an `uninstall.php` file which removes all BackUpWordPress data and options.
* Catch a possible fatal error in `RecursiveDirectoryIterator::hasChildren`.
* Fix an issue that could cause mysqldump errors to be ignored thus causing the backup process to use an incomplete mysqldump file.
#### 2.1.3
* Fix a regression in `2.1.2` that broke previewing and adding new exclude rules.
#### 2.1.2
* Fix an issue that could stop the settings panel from closing on save on servers which return `'0'` for ajax requests.
* Fix an issue that could cause the backup root to be set to `/` on sites with `site_url` and `home` set to different domains.
* The mysqldump fallback function will now be used if `mysqldump` produces an empty file.
* Fix a possible PHP `NOTICE` on Apache servers.
#### 2.1.1
* Fix a possible fatal error when a backup schedule is instantiated outside of wp-admin.
* Don't use functions from misc.php as loading it too early can cause fatal errors.
* Don't hardcode an English string in the JS, use the translated string instead.
* Properly skip dot files, should fix fatal errors on systems with `open_basedir` restrictions.
* Don't call `apache_mod_loaded` as it caused wierd DNS issue on some sites, use `global $is_apache` instead.
* Fix a possible double full stop at the end of the schedule sentence.
* Minor code cleanup.
#### 2.1
* Stop blocking people with `safe_mode = On` from using the plugin, instead just show a warning.
* Fix possible fatal error when setting schedule to monthly.
* Fix issues with download backup not working on some shared hosts.
* Fix issuses with download backup not working on sites with strange characters in the site name.
* Fix a bug could cause the update actions to fire on initial activation.
* Improved reliability when changing backup paths, now with Unit Tests.
* Generate the lists of excluded, included and unreadable files in a more memory efficient way, no more fatal errors on sites with lots of files.
* Bring back .htaccess protection of the backups directory on `Apache` servers with `mod_rewrite` enabled.
* Prepend a random string to the backups directory to make it harder to brute force guess.
* Fall back to storing the backups directoy in `uploads` if `WP_CONTENT_DIR` isn't writable.
* Attempt to catch `E_ERROR` level errors (Fatal errors) that happen during the backup process and offer to email them to support.
* Provide more granular status messages during the backup process.
* Show a spinner next to the schedule link when a backup is running on a schedule which you are not currently viewing.
* Improve the feedback when removing an exclude rule.
* Fix an issue that could cause an exclude rule to be marked as default when it in-fact isn't, thus not letting it be deleted.
* Add a line encouraging people to rate the plugin if they like it.
* Change the support line to point to the FAQ before recommending they contact support.
* Fix the link to the "How to Restore" post in the FAQ.
* Some string changes for translators, 18 changed strings.
#### 2.0.6
* Fix possible warning on plugin activation if the sites cron option is empty.
* Don't show the version warning in the help for Constants as that comes from the current version.
#### 2.0.5
* Re-setup the cron schedules if they get deleted somehow.
* Delete all BackUpWordPress cron entries when the plugin is deactivated.
* Introduce the `HMBKP_SCHEDULE_TIME` constant to allow control over the time schedules run.
* Make sure the schedule times and times of previous backups are shown in local time.
* Fix a bug that could cause the legacy backup schedule to be created on every update, not just when going from 1.x to 2.x.
* Improve the usefulness of the `wp-cron.php` response code check.
* Use the built in `site_format` function for human readable filesizes instead of defining our own function.
#### 2.0.4
* Revert the change to the way the plugin url and path were calculated as it caused regressions on some systems.
#### 2.0.3
* Fix issues with scheduled backups not firing in some cases.
* Better compatibility when the WP Remote plugin is active alongside BackUpWordPress.
* Catch and display more WP Cron errors.
* BackUpWordPress now fails to activate on WordPress 3.3.2 and below.
* Other minor fixes and improvements.
#### 2.0.2
* Only send backup failed emails if the backup actually failed.
* Turn off the generic "memory limit probably hit" message as it was showing for too many people.
* Fix a possible notice when the backup running filename is blank.
* Include the `wp_error` response in the cron check.
#### 2.0.1
* Fix fatal error on PHP 5.2.
#### 2.0
* Ability to have multiple schedules with separate settings & excludes per schedule.
* Ability to manage exclude rules and see exactly which files are included and excluded.
* Fix an issue with sites with an `open_basedir` restriction.
* Backups should now be much more reliable in low memory environments.
* Lots of other minor improvements and bug fixes.
#### 1.6.9
* Updated and improved translations across the board - props @elektronikLexikon.
* German translation - props @elektronikLexikon.
* New Basque translation - props Unai ZC.
* New Dutch translation - Anno De Vries.
* New Italian translation.
* Better support for when WordPress is installed in a sub directory - props @mattheu
#### 1.6.8
* French translation props Christophe - http://catarina.fr.
* Updated Spanish Translation props DD666 - https://github.com/radinamatic.
* Serbian translation props StefanRistic - https://github.com/StefanRistic.
* Lithuanian translation props Vincent G - http://www.Host1Free.com.
* Romanian translation.
* Fix conflict with WP Remote.
* Fix a minor issue where invalid email address's were still stored.
* The root path that is backed up can now be controlled by defining `HMBKP_ROOT`.
#### 1.6.7
* Fix issue with backups being listed in reverse chronological order.
* Fix issue with newest backup being deleted when you hit your max backups limit.
* It's now possible to have backups sent to multiple email address's by entering them as a comma separated list.
* Fix a bug which broke the ability to override the `mysqldump` path with `HMBKP_MYSQLDUMP_PATH`.
* Use `echo` rather than `pwd` when testing `shell_exec` as it's supported cross platform.
* Updated Spanish translation.
* Fix a minor spelling mistake.
* Speed up the manage backups page by caching the FAQ data for 24 hours.
#### 1.6.6
* Fix backup path issue with case sensitive filesystems.
#### 1.6.5
* Fix an issue with emailing backups that could cause the backup file to not be attached.
* Fix an issue that could cause the backup to be marked as running for ever if emailing the backup `FATAL` error'd.
* Never show the running backup in the list of backups.
* Show an error backup email failed to send.
* Fix possible notice when deleting a backup file which doesn't exist.
* Fix possible notice on older versions of `PHP` which don't define `E_DEPRECATED`.
* Make `HMBKP_SECURE_KEY` override-able.
* BackUpWordPress should now work when `ABSPATH` is `/`.
#### 1.6.4
* Don't show warning message as they cause to much panic.
* Move previous methods errors to warnings in fallback methods.
* Wrap `.htaccess` rewrite rules in if `mod_rewrite` check.
* Add link to new restore help article to FAQ.
* Fix issue that could cause "not using latest stable version" message to show when you were in-fact using the latest version.
* Bug fix in `zip command` check that could cause an incorrect `zip` path to be used.
* Detect and pass `MySQL` port to `mysqldump`.
#### 1.6.3
* Don't fail archive verification for errors in previous archive methods.
* Improved detection of the `zip` and `mysqldump` commands.
* Fix issues when `ABSPATH` is `/`.
* Remove reliance on `SECURE_AUTH_KEY` as it's often not defined.
* Use `warning()` not `error()` for issues reported by `zip`, `ZipArchive` & `PclZip`.
* Fix download zip on Windows when `ABSPATH` contains a trailing forward slash.
* Send backup email after backup completes so that fatal errors in email code don't stop the backup from completing.
* Add missing / to `PCLZIP_TEMPORARY_DIR` define.
* Catch and display errors during `mysqldump`.
#### 1.6.2
* Track `PHP` errors as backup warnings not errors.
* Only show warning message for `PHP` errors in BackUpWordPress files.
* Ability to dismiss the error / warning messages.
* Disable use of `PclZip` for full archive checking for now as it causes memory issues on some large sites.
* Don't delete "number of backups" setting on update.
* Better handling of multibyte characters in archive and database dump filenames.
* Mark backup as running and increase callback timeout to `500` when firing backup via ajax.
* Don't send backup email if backup failed.
* Filter out duplicate exclude rules.
#### 1.6.1
* Fix fatal error on PHP =< 5.3
#### 1.6
* Fixes issue with backups dir being included in backups on some Windows Servers.
* Consistent handling of symlinks across all archive methods (they are followed).
* Use .htaccess rewrite cond authentication to allow for secure http downloads of backup files.
* Track errors and warnings that happen during backup and expose them through admin.
* Fire manual backups using ajax instead of wp-cron, `HMBKP_DISABLE_MANUAL_BACKUP_CRON` is no longer needed and has been removed.
* Ability to cancel a running backup.
* Zip files are now integrity checked after every backup.
* More robust handling of failed / corrupt zips, backup process now fallsback through the various zip methods until one works.
* Use `mysql_query` instead of the depreciated `mysql_list_tables`.
#### 1.5.2
* Better handling of unreadable files in ZipArchive and the backup size calculation.
* Support for wp-cli, usage: `wp backup [--files_only] [--database_only] [--path<dir>] [--root<dir>] [--zip_command_path=<path>] [--mysqldump_command_path=<path>]`
#### 1.5.1
* Better detection of `zip` command.
* Don't delete user settings on update / deactivate.
* Use `ZipArchive` if `zip` is not available, still falls back to `PclZip` if neither `zip` nor `ZipArchive` are installed.
* Better exclude rule parsing, fixes lots of edge cases, excludes now pass all 52 unit tests.
* Improved the speed of the backup size calculation.
#### 1.5
* Re-written core backup engine should be more robust especially in edge case scenarios.
* 48 unit tests for the core backup engine, yay for unit tests.
* Remove some extraneous status information from the admin interface.
* Rename Advanced Options to Settings
* New `Constant` `HMBKP_CAPABILITY` to allow the default `add_menu_page` capability to be changed.
* Suppress possible filemtime warnings in some edge cases.
* 3.3 compatability.
* Set proper charset of MySQL backup, props valericus.
* Fix some inconsistencies between the estimated backup size and actual backup size when excluding files.
#### 1.4.1
* 1.4 was incorrectly marked as beta.
#### 1.4
* Most options can now be set on the backups page, all options can still be set by defining them as `Constants`.
* Russian translation, props valericus.
* All dates are now translatable.
* Fixed some strings which weren't translatable.
* New Constant `HMBKP_DISABLE_MANUAL_BACKUP_CRON` which enable you to disable the use of `wp_cron` for manual backups.
* Manual backups now work if `DISABLE_WP_CRON` is defined as `true`.
#### 1.3.2
* Spanish translation
* Bump PHP version check to 5.2.4
* Fallback to PHP mysqldump if shell_exec fails for any reason.
* Silently ignore unreadable files / folders
* Make sure binary data is properly exported when doing a mysqldump
* Use 303 instead of 302 when redirecting in the admin.
* Don't `set_time_limit` inside a loop
* Use WordPress 3.2 style buttons
* Don't pass an empty password to mysqldump
#### 1.3.1
* Check for PHP version. Deactivate plugin if running on PHP version 4.
#### 1.3
* Re-written back up engine, no longer copies everything to a tmp folder before zipping which should improve speed and reliability.
* Support for excluding files and folders, define `HMBKP_EXCLUDE` with a comma separated list of files and folders to exclude, supports wildcards `*`, path fragments and absolute paths.
* Full support for moving the backups directory, if you define a new backups directory then your existing backups will be moved to it.
* Work around issues caused by low MySQL `wait_timeout` setting.
* Add FAQ to readme.txt.
* Pull FAQ into the contextual help tab on the backups page.
* Block activation on old versions of WordPress.
* Stop guessing compressed backup file size, instead just show size of site uncompressed.
* Fix bug in `safe_mode` detection which could cause `Off` to act like `On`.
* Better name for the database dump file.
* Better name for the backup files.
* Improve styling for advanced options.
* Show examples for all advanced options.
* Language improvements.
* Layout tweaks.
#### 1.2
* Show live backup status in the back up now button when a back up is running.
* Show free disk space after total used by backups.
* Several langauge changes.
* Work around the 1 cron every 60 seconds limit.
* Store backup status in a 2 hour transient as a last ditch attempt to work around the "stuck on backup running" issue.
* Show a warning and disable backups when PHP is in Safe Mode, may try to work round issues and re-enable in the future.
* Highlight defined `Constants`.
* Show defaults for all `Constants`.
* Show a warning if both `HMBKP_FILES_ONLY` and `HMBKP_DATABASE_ONLY` are defined at the same time.
* Make sure options added in 1.1.4 are cleared on de-activate.
* Support `mysqldump on` Windows if it's available.
* New option to have each backup emailed to you on completion. Props @matheu for the contribution.
* Improved windows server support.
#### 1.1.4
* Fix a rare issue where database backups could fail when using the mysqldump PHP fallback if `mysql.max_links` is set to 2 or less.
* Don't suppress `mysql_connect` errors in the mysqldump PHP fallback.
* One time highlight of the most recent completed backup when viewing the manage backups page after a successful backup.
* Fix a spelling error in the `shell_exec` disabled message.
* Store the BackUpWordPress version as a `Constant` rather than a `Variable`.
* Don't `(float)` the BackUpWordPress version number, fixes issues with minor versions numbers being truncated.
* Minor PHPDoc improvements.
#### 1.1.3
* Attempt to re-connect if database connection hits a timeout while a backup is running, should fix issues with the "Back Up Now" button continuing to spin even though the backup is completed.
* When using `PCLZIP` as the zip fallback don't store the files with absolute paths. Should fix issues unzipping the file archives using "Compressed (zipped) Folders" on Windows XP.
#### 1.1.2
* Fix a bug that stopped `HMBKP_DISABLE_AUTOMATIC_BACKUP` from working.
#### 1.1.1
* Fix a possible `max_execution_timeout` fatal error when attempting to calculate the path to `mysqldump`.
* Clear the running backup status and reset the calculated filesize on update.
* Show a link to the manage backups page in the plugin description.
* Other general fixes.
#### 1.1
* Remove the logging facility as it provided little benefit and complicated the code, your existing logs will be deleted on update.
* Expose the various `Constants` that can be defined to change advanced settings.
* Added the ability to disable the automatic backups completely `define( 'HMBKP_DISABLE_AUTOMATIC_BACKUP', true );`.
* Added the ability to switch to file only or database only backups `define( 'HMBKP_FILES_ONLY', true );` Or `define( 'HMBKP_DATABASE_ONLY', true );`.
* Added the ability to define how many old backups should be kept `define( 'HMBKP_MAX_BACKUPS', 20 );`
* Added the ability to define the time that the daily backup should run `define( 'HMBKP_DAILY_SCHEDULE_TIME', '16:30' );`
* Tweaks to the backups page layout.
* General bug fixes and improvements.
#### 1.0.5
* Don't ajax load estimated backup size if it's already been calculated.
* Fix time in backup complete log message.
* Don't mark backup as running until cron has been called, will fix issues with backup showing as running even if cron never fired.
* Show number of backups saved message.
* Add a link to the backups page to the plugin action links.
#### 1.0.4
Don't throw PHP Warnings when `shell_exec` is disabled
#### 1.0.3
Minor bug fix release.
* Suppress `filesize()` warnings when calculating backup size.
* Plugin should now work when symlinked.
* Remove all options on deactivate, you should now be able to deactivate then activate to fix issues with settings etc. becoming corrupt.
* Call setup_defaults for users who update from backupwordpress 0.4.5 so they get new settings.
* Don't ajax ping running backup status quite so often.
#### 1.0.1 & 1.0.2
Fix some silly 1.0 bugs
#### 1.0
1.0 represents a total rewrite & rethink of the BackUpWordPress plugin with a focus on making it "Just Work". The management and development of the plugin has been taken over by [XIBO Ltd](http://hmn.md) the chaps behind [WP Remote](https://wpremote.com)
#### Previous
Version 0.4.5 and previous were developed by [wpdprx](http://profiles.wordpress.org/users/wpdprx/)
================================================
FILE: bin/release.sh
================================================
# release.sh
#
# Takes a tag to release, and syncs it to WordPress.org
TAG=3.10
PLUGIN="backupwordpress"
PLUGINDIR=$(pwd)
TMPDIR=$(pwd)/tmp/
# Fail on any error
set -e
if [[ $VERSION == "v*" ]]; then
# Starts with an extra "v", strip for the version
VERSION=${TAG:1}
else
VERSION="$TAG"
fi
echo "Version: $VERSION ."
if [ -d "${TMPDIR}" ]; then
# Wipe it clean
rm -rf "${TMPDIR}"
echo "Remove TMP"
fi
# Ensure the directory exists first
mkdir -p "${TMPDIR}"
echo "Make TMP: ${TMPDIR}"
# Make a Copy of all the files in the folder
rsync -av --progress --exclude=tmp/ --exclude=node_modules/ "${PWD}" "${TMPDIR}"
if [[ $? -ne 0 ]]; then
remove_tmp
echo "rsync $PLUGINDIR Failed. Aborting."
exit 1
fi
# Switch to build dir
cd "${TMPDIR}"
# change folder name to TAG ID
mv ${PLUGIN} ${TAG}
# THen CD into folder
cd ${TAG}
ls -lh
# Run build tasks
sed -e "s/{{TAG}}/$VERSION/g" < "$PLUGINDIR/bin/readme.txt" > readme.txt
# Remove special files
rm .gitignore
rm .bowerrc
rm .travis.yml
rm .jshintrc
rm -rf .git
rm -rf .github
rm CONTRIBUTING.md
rm changelog.txt
rm .scrutinizer.yml
rm phpunit.xml
rm bower.json
rm Gruntfile.js
rm package.json
rm composer.json
rm composer.lock
rm -rf bin
rm -rf grunt
rm -rf tmp
rm -rf readme
rm -rf tests
rm -rf node_modules
================================================
FILE: bower.json
================================================
{
"name": "backupwordpress",
"version": "3.6.0",
"homepage": "https://profiles.wordpress.org/xibodevelopment",
"authors": [
"XIBO Ltd"
],
"description": "Simple automated backups of your WordPress powered website.",
"main": "backupwordpress.php",
"license": "GPLv2",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"assets",
"test",
"tests"
],
"dependencies": {
}
}
================================================
FILE: changelog.txt
================================================
2741ba7 composer npm update
d5a5468 Update class-plugin to remove escaping
37bbf48 Update upsell.php
06d1ec7 Update upsell.php
c48fa22 Update page.php
b37d80d Update to bump up padding. Bumped up padding around schedule sentence.
25da000 Update to error notices. Removed extra extensions upsell and replaced non-dismissible notice with a dismissible notice. Both are at the top, though?
647b4a1 corrected improper URL inclusion
71570de This just adds error and debug logs to the automatic exclusions list in the class-excludes.php
9ecc8f6 Changing out upsell link (at bottom of admin page) to reflect link to site homepage for conversion funnel rather than link to in-admin extension page.
5191fc9 Changing out upsell link (at bottom of admin page) to reflect link to site homepage for conversion funnel rather than link to in-admin extension page.
d6ee584 Changing out upsell link (at bottom of admin page) to reflect link to site homepage for conversion funnel rather than link to in-admin extension page.
dae3fef Changing out upsell link (at bottom of admin page) to reflect link to site homepage for conversion funnel rather than link to in-admin extension page.
31a4d53 Update tags for wp.org
3928532 Fix wp-snapshots
335865c Rename ISSUE_TEMPLATE to ISSUE_TEMPLATE.md
8a04298 Update TEMPLATE file
34702b1 Create new ISSUE_TEMPLATE
f840674 Delete template.txt
19255c3 Create template.txt
a02d722 Check for correct server permission, else show site credentials form
32f6791 Minor - simplify 'if' statements. Fix coding standards - full stop after single line comment
7b9be93 Correct the order of error messages when both a custom path and the default paths are both unwritable.
badc2e4 Avoid a Warning when the backup path isn't readable
3f81248 Improve the ability to automatically create the backups directory
cd957da Clean up translatin strings - remove allowed HTML per string and add some allowed tags to generic output function for Server Notices in WP admin
45492c0 Use whitelist_html for translated strings to allow some HTML
1f4395a Clean up - combine conditions in if statements for better readability, alignment and indentation of code
611b878 Ensure Path is readable before calling `disk_free_space`
3267c87 s/sites/site's when used in a singulat possesive context
b9173ef Improved error messaging
0915923 WPCS fixes
1d5a525 Refactor the request_credentials code so it actually works
cdfe2e4 Show notice and hide backups list
6092f59 Force FTP form
7e01802 Add a function comment
fd95e12 Extract list of possible paths to own method
428a939 Fix code formatting
d4835f6 Display a form to get users connection credentials
17f238f Make notices dismissable
e9d99f8 Remove folder permissions notices
================================================
FILE: classes/backup/class-backup-engine-database-imysqldump.php
================================================
<?php
namespace HM\BackUpWordPress;
use Ifsnop\Mysqldump as IMysqldump;
/**
* Perform a database backup using the mysqldump-php library
*
* @see https://github.com/ifsnop/mysqldump-php
*/
class IMysqldump_Database_Backup_Engine extends Database_Backup_Engine {
public function __construct() {
parent::__construct();
}
/**
* Perform the database backupwordpress
*
* @return bool True if the backup completed successfully, else false.
*/
public function backup() {
try {
$dump = new IMysqldump\Mysqldump( $this->get_dsn(), $this->get_user(), $this->get_password(), $this->get_dump_settings() );
$dump->start( $this->get_backup_filepath() );
} catch ( \Exception $e ) {
$this->error( __CLASS__, $e->getMessage() );
}
return $this->verify_backup();
}
/**
* Get the settings for the database bump.
*
* @return array The array of database dump settings.
*/
public function get_dump_settings() {
/**
* Allow additional settings to be added.
*
* @param string[] $settings The array of settings.
* @todo can these be standardised across all database backup engines
*/
return apply_filters( 'hmbkp_imysqldump_command', array(
'default-character-set' => $this->get_charset(),
'hex-blob' => true,
'single-transaction' => defined( 'HMBKP_MYSQLDUMP_SINGLE_TRANSACTION' ) && HMBKP_MYSQLDUMP_SINGLE_TRANSACTION,
) );
}
/**
* Correctly calculates the DSN string for the various mysql
* connection variations including simplt hostname, non-standard ports
* and socket connections.
*
* @return string The DSN connection string
*/
public function get_dsn() {
$dsn = 'mysql:host=' . $this->get_host() . ';dbname=' . $this->get_name();
if ( $this->get_host() && $this->get_port() ) {
$dsn = 'mysql:host=' . $this->get_host() . ';port=' . $this->get_port() . ';dbname=' . $this->get_name();
} elseif ( $this->get_socket() ) {
$dsn = 'mysql:unix_socket=' . $this->get_socket() . ';dbname=' . $this->get_name();
}
return $dsn;
}
}
================================================
FILE: classes/backup/class-backup-engine-database-mysqldump.php
================================================
<?php
namespace HM\BackUpWordPress;
use Symfony\Component\Process\Process as Process;
/**
* Perform a database backup using the mysqldump cli command
*/
class Mysqldump_Database_Backup_Engine extends Database_Backup_Engine {
/**
* The path to the mysqldump executable
*
* @var string|false
*/
private $mysqldump_executable_path = '';
public function __construct() {
parent::__construct();
}
/**
* Calculate the path to the mysqldump executable.
*
* The executable path can be overridden using either the `HMBKP_MYSQLDUMP_PATH`
* Constant or the `hmbkp_mysqldump_executable_path` filter.
*
* If neither of those are set then we fallback to checking a number of
* common locations.
*
* @return string|false The path to the executable or false.
*/
public function get_mysqldump_executable_path() {
// Return now if it's set in a Constant
if ( defined( 'HMBKP_MYSQLDUMP_PATH' ) && HMBKP_MYSQLDUMP_PATH ) {
$this->mysqldump_executable_path = HMBKP_MYSQLDUMP_PATH;
}
/**
* Allow the executable path to be set via a filter
*
* @param string The path to the mysqldump executable
*/
$this->mysqldump_executable_path = apply_filters( 'hmbkp_mysqldump_executable_path', '' );
if ( ! $this->mysqldump_executable_path ) {
// List of possible mysqldump locations
$paths = array(
'mysqldump',
'/usr/local/bin/mysqldump',
'/usr/local/mysql/bin/mysqldump',
'/usr/mysql/bin/mysqldump',
'/usr/bin/mysqldump',
'/opt/local/lib/mysql6/bin/mysqldump',
'/opt/local/lib/mysql5/bin/mysqldump',
'/opt/local/lib/mysql4/bin/mysqldump',
'/xampp/mysql/bin/mysqldump',
'/Program Files/xampp/mysql/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 6.0/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 5.7/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 5.6/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 5.5/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 5.4/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump',
'/Program Files/MySQL/MySQL Server 4.1/bin/mysqldump',
'/opt/local/bin/mysqldump',
);
$this->mysqldump_executable_path = Backup_Utilities::get_executable_path( $paths );
}
return $this->mysqldump_executable_path;
}
/**
* Perform the database backup.
*
* @return bool Whether the backup completed successfully or not.
*/
public function backup() {
if ( ! $this->get_mysqldump_executable_path() ) {
return false;
}
// Grab the database connections args
$args = $this->get_mysql_connection_args();
// Allow lock-tables to be overridden
if ( defined( 'HMBKP_MYSQLDUMP_SINGLE_TRANSACTION' ) && HMBKP_MYSQLDUMP_SINGLE_TRANSACTION ) {
$args[] = '--single-transaction';
}
// Make sure binary data is exported properly
$args[] = '--hex-blob';
// The file we're saving too
$args[] = '-r ' . escapeshellarg( $this->get_backup_filepath() );
// The database we're dumping
$args[] = escapeshellarg( $this->get_name() );
$process = new Process( $this->get_mysqldump_executable_path() . ' ' . implode( ' ', $args ) );
$process->setTimeout( HOUR_IN_SECONDS );
try {
$process->run();
} catch ( \Exception $e ) {
$this->error( __CLASS__, $e->getMessage() );
}
if ( ! $process->isSuccessful() ) {
$this->error( __CLASS__, $process->getErrorOutput() );
}
return $this->verify_backup();
}
/**
* Get the connection args for the mysqldump command
*
* @return string[] The array of connection args
*/
public function get_mysql_connection_args() {
$args = array();
$args[] = '-u ' . escapeshellarg( $this->get_user() );
if ( $this->get_password() ) {
$args[] = '-p' . escapeshellarg( $this->get_password() );
}
$args[] = '-h ' . escapeshellarg( $this->get_host() );
if ( $this->get_port() ) {
$args[] = '-P ' . escapeshellarg( $this->get_port() );
}
if ( $this->get_socket() ) {
$args[] = '--protocol=socket -S ' . escapeshellarg( $this->get_socket() );
}
return $args;
}
}
================================================
FILE: classes/backup/class-backup-engine-database.php
================================================
<?php
namespace HM\BackUpWordPress;
/**
* The Database Backup Engine type
*
* All Database Backup Engine implementations should extend this class
*/
abstract class Database_Backup_Engine extends Backup_Engine {
/**
* The filename for the resulting Backup
*
* @var string
*/
public $backup_filename = '';
/**
* The database host string, typically the value of
* the `DB_HOST` Constant.
*
* @var string
*/
private $host = '';
/**
* The database socket, if it's using a socket connection
*
* @var string
*/
private $socket = '';
/**
* The database port, if a custom one is set
*
* @
gitextract_p5en0dmf/
├── .bowerrc
├── .github/
│ └── ISSUE_TEMPLATE.md
├── .gitignore
├── .jshintrc
├── .scrutinizer.yml
├── .travis.yml
├── CONTRIBUTING.md
├── Gruntfile.js
├── admin/
│ ├── actions.php
│ ├── backups-table.php
│ ├── backups.php
│ ├── constants.php
│ ├── enable-support.php
│ ├── extensions.php
│ ├── faq.php
│ ├── filesystem-credentials.php
│ ├── menu.php
│ ├── page.php
│ ├── schedule-form-excludes.php
│ ├── schedule-form.php
│ ├── schedule-sentence.php
│ ├── schedule-settings.php
│ ├── server-info.php
│ └── upsell.php
├── assets/
│ ├── hmbkp.css
│ └── hmbkp.js
├── backdrop/
│ ├── README.md
│ ├── hm-backdrop.php
│ ├── license.txt
│ ├── namespace.php
│ ├── server.php
│ └── task.php
├── backupwordpress.php
├── bin/
│ ├── readme.txt
│ └── release.sh
├── bower.json
├── changelog.txt
├── classes/
│ ├── backup/
│ │ ├── class-backup-engine-database-imysqldump.php
│ │ ├── class-backup-engine-database-mysqldump.php
│ │ ├── class-backup-engine-database.php
│ │ ├── class-backup-engine-file-zip-archive.php
│ │ ├── class-backup-engine-file-zip.php
│ │ ├── class-backup-engine-file.php
│ │ ├── class-backup-engine.php
│ │ ├── class-backup-status.php
│ │ ├── class-backup-utilities.php
│ │ └── class-backup.php
│ ├── class-backupwordpress-wp-cli-command.php
│ ├── class-email-service.php
│ ├── class-excludes.php
│ ├── class-extensions.php
│ ├── class-notices.php
│ ├── class-path.php
│ ├── class-plugin.php
│ ├── class-requirement.php
│ ├── class-requirements.php
│ ├── class-scheduled-backup.php
│ ├── class-schedules.php
│ ├── class-service.php
│ ├── class-services.php
│ ├── class-setup.php
│ ├── class-site-size.php
│ ├── class-webhook-service.php
│ ├── class-wpremote-webhook-service.php
│ └── deprecated.php
├── composer.json
├── functions/
│ ├── core.php
│ └── interface.php
├── grunt/
│ ├── aliases.yml
│ ├── autoprefixer.js
│ ├── bumpup.js
│ ├── checktextdomain.js
│ ├── compress.js
│ ├── concat.js
│ ├── cssmin.js
│ ├── excludes
│ ├── jshint.js
│ ├── makepot.js
│ ├── replace.js
│ ├── shell.js
│ └── uglify.js
├── languages/
│ ├── backupwordpress-ca_ES.mo
│ ├── backupwordpress-ca_ES.po
│ ├── backupwordpress-cs_CZ.mo
│ ├── backupwordpress-cs_CZ.po
│ ├── backupwordpress-da_DK.mo
│ ├── backupwordpress-da_DK.po
│ ├── backupwordpress-de_DE.mo
│ ├── backupwordpress-de_DE.po
│ ├── backupwordpress-el_GR.mo
│ ├── backupwordpress-el_GR.po
│ ├── backupwordpress-en_AU.mo
│ ├── backupwordpress-en_AU.po
│ ├── backupwordpress-en_GB.mo
│ ├── backupwordpress-en_GB.po
│ ├── backupwordpress-es_ES.mo
│ ├── backupwordpress-es_ES.po
│ ├── backupwordpress-eu.mo
│ ├── backupwordpress-eu.po
│ ├── backupwordpress-fr_FR.mo
│ ├── backupwordpress-fr_FR.po
│ ├── backupwordpress-he_IL.mo
│ ├── backupwordpress-he_IL.po
│ ├── backupwordpress-it_IT.mo
│ ├── backupwordpress-it_IT.po
│ ├── backupwordpress-lt_LT.mo
│ ├── backupwordpress-lt_LT.po
│ ├── backupwordpress-lv_LV.mo
│ ├── backupwordpress-lv_LV.po
│ ├── backupwordpress-nl_NL.mo
│ ├── backupwordpress-nl_NL.po
│ ├── backupwordpress-pl_PL.mo
│ ├── backupwordpress-pl_PL.po
│ ├── backupwordpress-pt_BR.mo
│ ├── backupwordpress-pt_BR.po
│ ├── backupwordpress-ro_RO.mo
│ ├── backupwordpress-ro_RO.po
│ ├── backupwordpress-ru_RU.mo
│ ├── backupwordpress-ru_RU.po
│ ├── backupwordpress-sk_SK.mo
│ ├── backupwordpress-sk_SK.po
│ ├── backupwordpress-sr_RS.mo
│ ├── backupwordpress-sr_RS.po
│ ├── backupwordpress-zh-cn.mo
│ ├── backupwordpress-zh-cn.po
│ └── backupwordpress.pot
├── package.json
├── phpunit.xml
├── readme/
│ ├── readme-footer.txt
│ └── readme-header.txt
├── readme.md
├── readme.txt
├── tests/
│ ├── bootstrap.php
│ ├── class-backup-engine/
│ │ ├── common-database-backup-engine-tests.php
│ │ ├── common-file-backup-engine-tests.php
│ │ ├── test-class-backup-engine-database-imysqldump.php
│ │ ├── test-class-backup-engine-database-mysqldump.php
│ │ ├── test-class-backup-engine-database.php
│ │ ├── test-class-backup-engine-file-zip-archive.php
│ │ └── test-class-backup-engine-file-zip.php
│ ├── class-backup-utilities/
│ │ ├── test-get-executable-path.php
│ │ ├── test-get-home-path.php
│ │ └── test-safe-mode.php
│ ├── class-mock-backup-engines.php
│ ├── class-site-backup/
│ │ ├── test-backup-director.php
│ │ └── test-class-site-backup.php
│ ├── class-wp-test-hm-backup-testcase.php
│ ├── data/
│ │ └── response.json
│ ├── ini/
│ │ └── php.ini
│ ├── misc/
│ │ ├── test-path-in-open-basedir.php
│ │ ├── testDetermineStartTime.php
│ │ └── testUninstallActivateDeactivate.php
│ ├── schedule/
│ │ └── testScheduleTest.php
│ ├── test-backup-path.php
│ ├── test-backup-status.php
│ ├── test-excludes.php
│ ├── test-extensions.php
│ ├── test-get-files.php
│ ├── test-is-same-size-format.php
│ ├── test-notices.php
│ └── test-site-size.php
├── uninstall.php
└── whitelist-html/
├── README.md
└── whitelist-html.php
SYMBOL INDEX (687 symbols across 65 files)
FILE: admin/actions.php
function request_delete_backup (line 8) | function request_delete_backup() {
function request_enable_support (line 30) | function request_enable_support() {
function request_delete_schedule (line 46) | function request_delete_schedule() {
function request_do_backup (line 111) | function request_do_backup() {
function run_schedule_async (line 145) | function run_schedule_async( $schedule_id ) {
function request_download_backup (line 153) | function request_download_backup() {
function request_cancel_backup (line 183) | function request_cancel_backup() {
function dismiss_error (line 211) | function dismiss_error() {
function edit_schedule_services_submit (line 229) | function edit_schedule_services_submit() {
function edit_schedule_submit (line 271) | function edit_schedule_submit() {
function add_exclude_rule (line 443) | function add_exclude_rule() {
function remove_exclude_rule (line 473) | function remove_exclude_rule() {
function recalculate_directory_filesize (line 502) | function recalculate_directory_filesize() {
function calculate_site_size (line 523) | function calculate_site_size() {
function heartbeat_received (line 538) | function heartbeat_received( $response, $data ) {
function load_enable_support (line 591) | function load_enable_support() {
function ajax_is_backup_in_progress (line 605) | function ajax_is_backup_in_progress() {
function ajax_calculate_backup_size (line 629) | function ajax_calculate_backup_size() {
function ajax_cron_test (line 651) | function ajax_cron_test() {
function hmbkp_dismiss_notice (line 711) | function hmbkp_dismiss_notice() {
function hmbkp_dismiss_rate_notice (line 716) | function hmbkp_dismiss_rate_notice() {
FILE: admin/menu.php
function admin_menu (line 9) | function admin_menu() {
function manage_backups (line 29) | function manage_backups() {
function extensions (line 40) | function extensions() {
function highlight_submenu (line 50) | function highlight_submenu( $submenu_file ) {
function plugin_action_link (line 74) | function plugin_action_link( $links, $file ) {
function contextual_help (line 92) | function contextual_help() {
FILE: admin/schedule-sentence.php
function get_site_size_text (line 150) | function get_site_size_text( Scheduled_Backup $schedule ) {
FILE: assets/hmbkp.js
function init (line 6) | function init(){
function hmbkpToggleScheduleFields (line 153) | function hmbkpToggleScheduleFields( recurrence ) {
FILE: backdrop/namespace.php
class Server (line 5) | class Server extends \HM_Backdrop_Server {}
class Task (line 6) | class Task extends \HM_Backdrop_Task {}
FILE: backdrop/server.php
class HM_Backdrop_Server (line 3) | class HM_Backdrop_Server {
method run (line 4) | public function run() {
method spawn (line 24) | public static function spawn() {
method spawn_run (line 33) | protected static function spawn_run( $class ) {
FILE: backdrop/task.php
class HM_Backdrop_Task (line 3) | class HM_Backdrop_Task {
method __construct (line 8) | public function __construct( $callback /* , $... */ ) {
method schedule (line 19) | public function schedule() {
method is_scheduled (line 35) | public function is_scheduled() {
method cancel (line 39) | public function cancel() {
method spawn_server (line 48) | public function spawn_server() {
method get_data (line 64) | protected function get_data() {
method get_unique_id (line 68) | protected function get_unique_id() {
FILE: classes/backup/class-backup-engine-database-imysqldump.php
class IMysqldump_Database_Backup_Engine (line 12) | class IMysqldump_Database_Backup_Engine extends Database_Backup_Engine {
method __construct (line 14) | public function __construct() {
method backup (line 23) | public function backup() {
method get_dump_settings (line 43) | public function get_dump_settings() {
method get_dsn (line 66) | public function get_dsn() {
FILE: classes/backup/class-backup-engine-database-mysqldump.php
class Mysqldump_Database_Backup_Engine (line 10) | class Mysqldump_Database_Backup_Engine extends Database_Backup_Engine {
method __construct (line 19) | public function __construct() {
method get_mysqldump_executable_path (line 34) | public function get_mysqldump_executable_path() {
method backup (line 86) | public function backup() {
method get_mysql_connection_args (line 131) | public function get_mysql_connection_args() {
FILE: classes/backup/class-backup-engine-database.php
class Database_Backup_Engine (line 10) | abstract class Database_Backup_Engine extends Backup_Engine {
method backup (line 47) | abstract public function backup();
method __construct (line 54) | public function __construct() {
method get_charset (line 70) | public function get_charset() {
method get_collate (line 80) | public function get_collate() {
method get_name (line 90) | public function get_name() {
method get_user (line 100) | public function get_user() {
method get_password (line 110) | public function get_password() {
method get_host (line 120) | public function get_host() {
method get_port (line 129) | public function get_port() {
method get_socket (line 138) | public function get_socket() {
method parse_db_host_constant (line 151) | public function parse_db_host_constant( $constant = 'DB_HOST' ) {
method verify_backup (line 194) | public function verify_backup() {
FILE: classes/backup/class-backup-engine-file-zip-archive.php
class Zip_Archive_File_Backup_Engine (line 8) | class Zip_Archive_File_Backup_Engine extends File_Backup_Engine {
method __construct (line 10) | public function __construct() {
method backup (line 14) | public function backup() {
FILE: classes/backup/class-backup-engine-file-zip.php
class Zip_File_Backup_Engine (line 10) | class Zip_File_Backup_Engine extends File_Backup_Engine {
method __construct (line 19) | public function __construct() {
method get_zip_executable_path (line 34) | public function get_zip_executable_path() {
method backup (line 70) | public function backup() {
method get_exclude_string (line 125) | public function get_exclude_string() {
FILE: classes/backup/class-backup-engine-file.php
class File_Backup_Engine (line 12) | abstract class File_Backup_Engine extends Backup_Engine {
method __construct (line 24) | public function __construct() {
method set_excludes (line 43) | public function set_excludes( Excludes $excludes ) {
method get_files (line 58) | public function get_files() {
method verify_backup (line 96) | public function verify_backup() {
FILE: classes/backup/class-backup-engine.php
class Backup_Engine (line 13) | abstract class Backup_Engine {
method __construct (line 36) | public function __construct() {
method verify_backup (line 57) | abstract public function verify_backup();
method get_backup_filepath (line 64) | public function get_backup_filepath() {
method get_backup_filename (line 73) | public function get_backup_filename() {
method set_backup_filename (line 82) | public function set_backup_filename( $filename ) {
method get_errors (line 94) | public function get_errors( $context = null ) {
method error (line 114) | public function error( $context, $error ) {
method get_warnings (line 133) | public function get_warnings( $context = null ) {
method warning (line 153) | public function warning( $context, $warning ) {
method error_handler (line 175) | public function error_handler( $type ) {
FILE: classes/backup/class-backup-status.php
class Backup_Status (line 8) | class Backup_Status {
method __construct (line 13) | public function __construct( $id ) {
method start (line 17) | public function start( $backup_filename, $status_message ) {
method get_backup_filename (line 27) | public function get_backup_filename() {
method is_started (line 40) | public function is_started() {
method finish (line 44) | public function finish() {
method get_status (line 56) | public function get_status() {
method set_status (line 79) | public function set_status( $message ) {
method get_start_time (line 101) | public function get_start_time() {
method get_status_filepath (line 122) | public function get_status_filepath() {
FILE: classes/backup/class-backup-utilities.php
class Backup_Utilities (line 10) | class Backup_Utilities {
method is_safe_mode_on (line 21) | public static function is_safe_mode_on( $ini_get_callback = 'ini_get' ) {
method get_executable_path (line 40) | public static function get_executable_path( $paths ) {
FILE: classes/backup/class-backup.php
class Backup (line 5) | class Backup {
method __construct (line 17) | public function __construct( $backup_filename, $database_dump_filename...
method set_type (line 22) | public function set_type( $type ) {
method set_backup_filename (line 26) | public function set_backup_filename( $filename ) {
method set_status (line 30) | public function set_status( Backup_Status $status ) {
method set_excludes (line 34) | public function set_excludes( Excludes $excludes ) {
method run (line 38) | public function run() {
method backup_database (line 54) | public function backup_database() {
method backup_files (line 108) | public function backup_files() {
method perform_backup (line 143) | public function perform_backup( array $backup_engines ) {
method get_warnings (line 168) | public function get_warnings() {
method get_errors (line 172) | public function get_errors() {
method warning (line 185) | public function warning( $context, $warning ) {
method error (line 203) | public function error( $context, $message ) {
method get_database_backup_filepath (line 208) | public function get_database_backup_filepath() {
method get_backup_filepath (line 212) | public function get_backup_filepath() {
method get_archive_filepath (line 222) | public function get_archive_filepath() {
FILE: classes/class-backupwordpress-wp-cli-command.php
class CLI (line 12) | class CLI extends \WP_CLI_Command {
method backup (line 43) | public function backup( $args, $assoc_args ) {
FILE: classes/class-email-service.php
class Email_Service (line 10) | class Email_Service extends Service {
method field (line 23) | public function field() {
method form (line 49) | public function form() {
method constant (line 53) | public static function constant() {
method display (line 80) | public function display() {
method is_service_active (line 97) | public function is_service_active() {
method update (line 109) | public function update( &$new_data, $old_data ) {
method get_email_address_array (line 140) | private function get_email_address_array() {
method action (line 151) | public function action( $action, Backup $backup ) {
method intercom_data (line 208) | public static function intercom_data() {
method intercom_data_html (line 212) | public static function intercom_data_html() {}
FILE: classes/class-excludes.php
class Excludes (line 8) | class Excludes {
method __construct (line 44) | public function __construct( $excludes = array() ) {
method set_excludes (line 57) | public function set_excludes( $excludes ) {
method get_excludes (line 73) | public function get_excludes() {
method get_excludes_for_regex (line 85) | public function get_excludes_for_regex() {
method get_user_excludes (line 114) | public function get_user_excludes() {
method get_default_excludes (line 131) | public function get_default_excludes() {
method normalize (line 159) | public function normalize( $excludes ) {
method is_file_excluded (line 193) | public function is_file_excluded( \SplFileInfo $file ) {
FILE: classes/class-extensions.php
class Extensions (line 9) | final class Extensions {
method __construct (line 29) | private function __construct() {
method __wakeup (line 35) | public function __wakeup() { throw new \Exception('may not be serializ...
method __clone (line 37) | public function __clone() { throw new \Exception('may not be cloned'); }
method get_instance (line 46) | public static function get_instance() {
method get_edd_data (line 63) | public function get_edd_data() {
method fetch (line 83) | protected function fetch( $endpoint, $ttl = DAY_IN_SECONDS ) {
FILE: classes/class-notices.php
class Notices (line 11) | class Notices {
method __construct (line 34) | protected function __construct() {}
method __clone (line 39) | public function __clone() { throw new \Exception('may not be cloned'); }
method __wakeup (line 44) | public function __wakeup() { throw new \Exception('may not be serializ...
method get_instance (line 53) | public static function get_instance() {
method set_notices (line 70) | public function set_notices( $context, array $messages, $persistent = ...
method get_notices (line 112) | public function get_notices( $context = '' ) {
method get_all_notices (line 134) | private function get_all_notices() {
method get_persistent_notices (line 143) | private function get_persistent_notices() {
method clear_all_notices (line 151) | public function clear_all_notices() {
FILE: classes/class-path.php
class Path (line 11) | class Path {
method __construct (line 45) | protected function __construct() {}
method __clone (line 50) | public function __clone() { throw new \Exception('may not be cloned'); }
method __wakeup (line 55) | public function __wakeup() { throw new \Exception('may not be serializ...
method get_instance (line 64) | public static function get_instance() {
method get_path (line 76) | public static function get_path() {
method get_root (line 83) | public static function get_root() {
method get_home_path (line 96) | public static function get_home_path( $site_path = ABSPATH ) {
method get_calculated_path (line 131) | private function get_calculated_path() {
method set_path (line 150) | public function set_path( $path ) {
method get_calculated_root (line 162) | private function get_calculated_root() {
method set_root (line 183) | public function set_root( $root ) {
method reset_path (line 187) | public function reset_path() {
method get_default_path (line 194) | public function get_default_path() {
method get_fallback_path (line 201) | public function get_fallback_path() {
method get_custom_path (line 212) | public function get_custom_path() {
method get_existing_paths (line 231) | public function get_existing_paths() {
method get_existing_path (line 255) | public function get_existing_path() {
method calculate_path (line 274) | public function calculate_path() {
method get_possible_paths (line 297) | public function get_possible_paths() {
method protect_path (line 328) | public function protect_path( $reset = 'no' ) {
method merge_existing_paths (line 373) | public function merge_existing_paths() {
method move_old_backups (line 391) | public function move_old_backups( $from ) {
method cleanup (line 433) | public function cleanup() {
class CleanUpIterator (line 452) | class CleanUpIterator extends \FilterIterator {
method accept (line 455) | public function accept() {
FILE: classes/class-plugin.php
class Plugin (line 8) | final class Plugin {
method __construct (line 19) | private function __construct() {
method get_instance (line 37) | public static function get_instance() {
method plugins_loaded (line 49) | public function plugins_loaded() {
method maybe_self_deactivate (line 73) | public function maybe_self_deactivate() {
method constants (line 94) | public function constants() {
method includes (line 126) | protected function includes() {
method hooks (line 197) | public function hooks() {
method scripts (line 220) | public function scripts( $hook ) {
method text_domain (line 258) | public function text_domain() {
method upgrade (line 280) | public function upgrade() {
method init (line 292) | public function init() {
method generate_key (line 303) | protected function generate_key() {
method load_first (line 329) | public function load_first() {
method schedule_hook_run (line 354) | public function schedule_hook_run( $id ) {
method styles (line 376) | public function styles( $hook ) {
method load_intercom_script (line 397) | public function load_intercom_script() {
method display_xibo_message (line 431) | public function display_xibo_message() {
FILE: classes/class-requirement.php
class Requirement (line 9) | abstract class Requirement {
method test (line 21) | protected static function test() {}
method name (line 26) | public function name() {
method result (line 33) | public function result() {
method raw_result (line 55) | public function raw_result() {
class Requirement_Zip_Archive (line 63) | class Requirement_Zip_Archive extends Requirement {
method test (line 73) | public static function test() {
class Requirement_Zip_Command_Path (line 90) | class Requirement_Zip_Command_Path extends Requirement {
method test (line 100) | public static function test() {
class Requirement_Mysqldump_Command_Path (line 115) | class Requirement_Mysqldump_Command_Path extends Requirement {
method test (line 125) | public static function test() {
class Requirement_PHP_Version (line 138) | class Requirement_PHP_Version extends Requirement {
method test (line 148) | public static function test() {
class Requirement_Cron_Array (line 157) | class Requirement_Cron_Array extends Requirement {
method test (line 167) | public static function test() {
class Requirement_Language (line 184) | class Requirement_Language extends Requirement {
method test (line 194) | public static function test() {
class Requirement_Safe_Mode (line 216) | class Requirement_Safe_Mode extends Requirement {
method test (line 226) | public static function test() {
class Requirement_PHP_Memory_Limit (line 235) | class Requirement_PHP_Memory_Limit extends Requirement {
method test (line 245) | public static function test() {
class Requirement_Backup_Path (line 254) | class Requirement_Backup_Path extends Requirement {
method test (line 264) | public static function test() {
class Requirement_Backup_Path_Permissions (line 273) | class Requirement_Backup_Path_Permissions extends Requirement {
method test (line 283) | public static function test() {
class Requirement_WP_CONTENT_DIR (line 295) | class Requirement_WP_CONTENT_DIR extends Requirement {
method test (line 305) | public static function test() {
class Requirement_WP_CONTENT_DIR_Permissions (line 314) | class Requirement_WP_CONTENT_DIR_Permissions extends Requirement {
method test (line 324) | public static function test() {
class Requirement_ABSPATH (line 333) | class Requirement_ABSPATH extends Requirement {
method test (line 343) | public static function test() {
class Requirement_Backup_Root_Path (line 352) | class Requirement_Backup_Root_Path extends Requirement {
method test (line 362) | public static function test() {
class Requirement_Calculated_Size (line 371) | class Requirement_Calculated_Size extends Requirement {
method test (line 381) | public static function test() {
class Requirement_WP_Cron_Test (line 405) | class Requirement_WP_Cron_Test extends Requirement {
method test (line 415) | public static function test() {
class Requirement_PHP_API (line 424) | class Requirement_PHP_API extends Requirement {
method test (line 434) | public static function test() {
class Requirement_Server_Software (line 443) | class Requirement_Server_Software extends Requirement {
method test (line 453) | public static function test() {
class Requirement_Server_OS (line 468) | class Requirement_Server_OS extends Requirement {
method test (line 478) | public static function test() {
class Requirement_PHP_Disable_Functions (line 487) | class Requirement_PHP_Disable_Functions extends Requirement {
method test (line 497) | public static function test() {
class Requirement_PHP_Open_Basedir (line 506) | class Requirement_PHP_Open_Basedir extends Requirement {
method test (line 516) | public static function test() {
class Requirement_Define_HMBKP_PATH (line 527) | class Requirement_Define_HMBKP_PATH extends Requirement {
method test (line 537) | public static function test() {
class Requirement_Define_HMBKP_ROOT (line 546) | class Requirement_Define_HMBKP_ROOT extends Requirement {
method test (line 556) | public static function test() {
class Requirement_Define_HMBKP_MYSQLDUMP_PATH (line 565) | class Requirement_Define_HMBKP_MYSQLDUMP_PATH extends Requirement {
method test (line 575) | public static function test() {
class Requirement_Define_HMBKP_ZIP_PATH (line 584) | class Requirement_Define_HMBKP_ZIP_PATH extends Requirement {
method test (line 594) | public static function test() {
class Requirement_Define_HMBKP_CAPABILITY (line 603) | class Requirement_Define_HMBKP_CAPABILITY extends Requirement {
method test (line 613) | public static function test() {
class Requirement_Define_HMBKP_EMAIL (line 622) | class Requirement_Define_HMBKP_EMAIL extends Requirement {
method test (line 632) | public static function test() {
class Requirement_Define_HMBKP_ATTACHMENT_MAX_FILESIZE (line 641) | class Requirement_Define_HMBKP_ATTACHMENT_MAX_FILESIZE extends Requireme...
method test (line 651) | public static function test() {
class Requirement_Define_HMBKP_EXCLUDE (line 660) | class Requirement_Define_HMBKP_EXCLUDE extends Requirement {
method test (line 670) | public static function test() {
class Requirement_Active_Plugins (line 676) | class Requirement_Active_Plugins extends Requirement {
method test (line 685) | public static function test() {
class Requirement_Home_Url (line 691) | class Requirement_Home_Url extends Requirement {
method test (line 698) | public static function test() {
class Requirement_Site_Url (line 704) | class Requirement_Site_Url extends Requirement {
method test (line 711) | public static function test() {
class Requirement_Plugin_Version (line 717) | class Requirement_Plugin_Version extends Requirement {
method test (line 723) | public static function test() {
class Requirement_Max_Exec (line 729) | class Requirement_Max_Exec extends Requirement {
method test (line 736) | public static function test() {
class Requirement_PDO (line 742) | class Requirement_PDO extends Requirement {
method test (line 749) | public static function test() {
class Requirement_Proc_Open (line 765) | class Requirement_Proc_Open extends Requirement {
method test (line 775) | public static function test() {
FILE: classes/class-requirements.php
class Requirements (line 9) | class Requirements {
method get_requirements (line 26) | public static function get_requirements( $group = '' ) {
method get_requirement_groups (line 41) | public static function get_requirement_groups() {
method register (line 51) | public static function register( $class, $group = 'misc' ) {
method instantiate (line 61) | private static function instantiate( $class ) {
FILE: classes/class-scheduled-backup.php
class Scheduled_Backup (line 13) | class Scheduled_Backup {
method __construct (line 53) | public function __construct( $id ) {
method get_id (line 99) | public function get_id() {
method get_slug (line 106) | public function get_slug() {
method get_schedule_option (line 123) | public function get_schedule_option( $option_name ) {
method get_name (line 134) | public function get_name() {
method get_type (line 143) | public function get_type() {
method set_type (line 152) | public function set_type( $type ) {
method get_excludes (line 163) | public function get_excludes() {
method set_excludes (line 175) | public function set_excludes( $exclude_rules, $append = false ) {
method get_max_backups (line 193) | public function get_max_backups() {
method set_max_backups (line 204) | public function set_max_backups( $max ) {
method get_status (line 208) | public function get_status() {
method set_status (line 217) | public function set_status( $message ) {
method get_service_options (line 230) | public function get_service_options( $service, $option = null ) {
method set_service_options (line 256) | public function set_service_options( $service, array $options ) {
method get_schedule_start_time (line 265) | public function get_schedule_start_time( $gmt = true ) {
method set_schedule_start_time (line 292) | public function set_schedule_start_time( $time ) {
method get_reoccurrence (line 304) | public function get_reoccurrence() {
method set_reoccurrence (line 315) | public function set_reoccurrence( $reoccurrence ) {
method get_interval (line 347) | public function get_interval() {
method get_next_occurrence (line 363) | public function get_next_occurrence( $gmt = true ) {
method is_cron_scheduled (line 379) | public function is_cron_scheduled() {
method schedule (line 387) | public function schedule() {
method unschedule (line 404) | public function unschedule() {
method run (line 412) | public function run() {
method get_backup_filename (line 456) | public function get_backup_filename() {
method get_database_dump_filename (line 465) | public function get_database_dump_filename() {
method do_action (line 474) | public function do_action( $action, Backup $backup ) {
method update_average_schedule_run_time (line 492) | public function update_average_schedule_run_time( $start, $end ) {
method get_schedule_average_duration (line 521) | public function get_schedule_average_duration() {
method get_backups (line 566) | public function get_backups() {
method delete_old_backups (line 594) | public function delete_old_backups() {
method delete_backup (line 611) | public function delete_backup( $filepath ) {
method delete_backups (line 638) | public function delete_backups() {
method save (line 646) | public function save() {
method cancel (line 666) | public function cancel( $delete_backups = false ) {
FILE: classes/class-schedules.php
class Schedules (line 8) | class Schedules {
method get_instance (line 23) | public static function get_instance() {
method __construct (line 37) | private function __construct() {
method refresh_schedules (line 41) | public function refresh_schedules() {
method get_schedules (line 65) | public function get_schedules() {
method get_schedule (line 75) | public function get_schedule( $id ) {
method instantiate (line 93) | private function instantiate( $id ) {
FILE: classes/class-service.php
class Service (line 9) | abstract class Service {
method __construct (line 25) | public function __construct( Scheduled_Backup $schedule ) {
method is_service_active (line 34) | abstract public function is_service_active();
method form (line 43) | abstract public function form();
method field (line 52) | abstract public function field();
method constant (line 59) | public static function constant() {}
method update (line 68) | abstract public function update( &$new_data, $old_data );
method display (line 75) | abstract public function display();
method action (line 89) | public function action( $action, Backup $backup ) {}
method get_slug (line 91) | public function get_slug() {
method get_field_name (line 101) | protected function get_field_name( $name ) {
method get_field_value (line 112) | protected function get_field_value( $name, $esc = 'esc_attr' ) {
method save (line 127) | public function save() {
method set_schedule (line 162) | public function set_schedule( Scheduled_Backup $schedule ) {
method fetch_destination_settings (line 172) | protected function fetch_destination_settings() {
method has_form (line 199) | public function has_form() {
method intercom_data (line 212) | public static function intercom_data() {}
method intercom_data_html (line 214) | public static function intercom_data_html() {}
FILE: classes/class-services.php
class Services (line 9) | class Services {
method instance (line 44) | public static function instance() {
method get_services (line 60) | public static function get_services( Scheduled_Backup $schedule = null...
method register (line 79) | public static function register( $filepath, $classname ) {
method unregister (line 94) | public static function unregister( $filepath ) {
method instantiate (line 112) | private static function instantiate( $classname ) {
FILE: classes/class-setup.php
class HMBKP_Setup (line 5) | class HMBKP_Setup {
method activate (line 20) | public static function activate() {
method deactivate (line 45) | public static function deactivate() {
method delete_schedules (line 60) | public static function delete_schedules() {
method trim_prefix (line 72) | public static function trim_prefix( $item ) {
method delete_transients (line 79) | public static function delete_transients() {
method self_deactivate (line 96) | public static function self_deactivate() {
method meets_requirements (line 119) | public static function meets_requirements() {
method is_supported_php_version (line 137) | protected static function is_supported_php_version() {
method is_supported_wp_version (line 147) | protected static function is_supported_wp_version() {
method display_admin_notices (line 155) | public static function display_admin_notices() {
method get_notice_message (line 166) | public static function get_notice_message() {
FILE: classes/class-site-size.php
class Site_Size (line 13) | class Site_Size {
method __construct (line 30) | public function __construct( $type = 'complete', Excludes $excludes = ...
method get_site_size (line 42) | public function get_site_size() {
method get_formatted_site_size (line 90) | public function get_formatted_site_size() {
method is_site_size_being_calculated (line 99) | public static function is_site_size_being_calculated() {
method is_site_size_cached (line 108) | public function is_site_size_cached() {
method recursive_filesize_scanner (line 119) | public function recursive_filesize_scanner() {
method filesize (line 177) | public function filesize( \SplFileInfo $file ) {
method directory_filesize (line 200) | public function directory_filesize( \SplFileInfo $file ) {
method rebuild_directory_filesizes (line 250) | public function rebuild_directory_filesizes() {
method get_cached_filesizes (line 265) | public function get_cached_filesizes( $max_age = WEEK_IN_SECONDS ) {
FILE: classes/class-webhook-service.php
class Webhook_Service (line 10) | abstract class Webhook_Service extends Service {
method get_secret_key (line 21) | abstract protected function get_secret_key();
method get_url (line 26) | abstract protected function get_url();
method action (line 35) | public function action( $action, Backup $backup ) {
method intercom_data (line 108) | public static function intercom_data() {
method intercom_data_html (line 112) | public static function intercom_data_html() {}
FILE: classes/class-wpremote-webhook-service.php
class WPRemote_Webhook_Service (line 10) | class WPRemote_Webhook_Service extends Webhook_Service {
method form (line 26) | public function form() {}
method field (line 33) | public function field() {}
method display (line 40) | public function display() {}
method update (line 46) | public function update( &$new_data, $old_data ) {}
method is_service_active (line 51) | public function is_service_active() {
method get_url (line 58) | protected function get_url() {
method get_secret_key (line 65) | protected function get_secret_key() {
FILE: classes/deprecated.php
class HMBKP_Service (line 8) | abstract class HMBKP_Service {}
class HMBKP_Services (line 14) | class HMBKP_Services {
method instance (line 50) | public static function instance() {
method register (line 66) | public static function register( $filepath, $classname ) {
method instantiate (line 78) | private static function instantiate( $classname ) {
FILE: functions/core.php
function update (line 9) | function update() {
function setup_default_schedules (line 298) | function setup_default_schedules() {
function cron_schedules (line 344) | function cron_schedules( $schedules = array() ) {
function rmdirtree (line 368) | function rmdirtree( $dir ) {
function has_server_permissions (line 404) | function has_server_permissions() {
function is_backup_possible (line 423) | function is_backup_possible() {
function get_max_attachment_size (line 447) | function get_max_attachment_size() {
function is_path_accessible (line 459) | function is_path_accessible( $dir ) {
function get_cron_schedules (line 474) | function get_cron_schedules() {
function determine_start_time (line 496) | function determine_start_time( $type, $times = array() ) {
function admin_action_url (line 587) | function admin_action_url( $action, array $query_args = array() ) {
function ignore_stderr (line 599) | function ignore_stderr() {
function list_directory_by_total_filesize (line 622) | function list_directory_by_total_filesize( $directory, Excludes $exclude...
FILE: functions/interface.php
function get_backup_row (line 11) | function get_backup_row( $file, Scheduled_Backup $schedule ) {
function admin_notices (line 61) | function admin_notices() {
function set_server_config_notices (line 154) | function set_server_config_notices() {
function plugin_row (line 263) | function plugin_row( $plugins ) {
function human_get_type (line 284) | function human_get_type( $type, Scheduled_Backup $schedule = null ) {
function schedule_status (line 313) | function schedule_status( Scheduled_Backup $schedule, $echo = true ) {
function backups_number (line 334) | function backups_number( Scheduled_Backup $schedule ) {
function translated_schedule_title (line 347) | function translated_schedule_title( $slug, $title ) {
function get_settings_url (line 381) | function get_settings_url( $slug = HMBKP_PLUGIN_SLUG ) {
function add_settings_error (line 400) | function add_settings_error( $error_message ) {
function hmbkp_add_settings_error (line 418) | function hmbkp_add_settings_error( $error_message ) {
function get_settings_errors (line 428) | function get_settings_errors() {
function clear_settings_errors (line 437) | function clear_settings_errors() {
function path_in_php_open_basedir (line 441) | function path_in_php_open_basedir( $path, $ini_get = 'ini_get' ) {
function is_same_size_format (line 482) | function is_same_size_format( $size, $other_size ) {
function disk_space_low (line 496) | function disk_space_low( $backup_size = false ) {
FILE: tests/bootstrap.php
function _manually_load_plugin (line 35) | function _manually_load_plugin() {
function hmbkp_var_dump (line 55) | function hmbkp_var_dump( $to_inspect ) {
FILE: tests/class-backup-engine/common-database-backup-engine-tests.php
class Common_Database_Backup_Engine_Tests (line 5) | abstract class Common_Database_Backup_Engine_Tests extends \HM_Backup_Un...
method setUp (line 15) | public function setUp() {
method tearDown (line 21) | public function tearDown() {
method test_backup (line 25) | public function test_backup() {
method test_backup_with_errors (line 32) | public function test_backup_with_errors() {
FILE: tests/class-backup-engine/common-file-backup-engine-tests.php
class Common_File_Backup_Engine_Tests (line 5) | abstract class Common_File_Backup_Engine_Tests extends \HM_Backup_UnitTe...
method setUp (line 15) | public function setUp() {
method tearDown (line 21) | public function tearDown() {
method test_backup (line 43) | public function test_backup() {
method test_backup_with_hidden_file (line 57) | public function test_backup_with_hidden_file() {
method test_backup_with_symlink_directory (line 76) | public function test_backup_with_symlink_directory() {
method test_backup_with_symlink_file (line 101) | public function test_backup_with_symlink_file() {
method test_backup_with_broken_symlink (line 126) | public function test_backup_with_broken_symlink() {
method test_backup_with_unreadable_file (line 155) | public function test_backup_with_unreadable_file() {
method test_backup_with_unreadable_directory (line 172) | public function test_backup_with_unreadable_directory() {
method test_file_with_strange_characters (line 189) | public function test_file_with_strange_characters() {
method test_complete_file_backup_with_excludes (line 208) | public function test_complete_file_backup_with_excludes() {
method test_complete_file_backup (line 233) | public function test_complete_file_backup() {
method test_adding_files_to_existing_backup (line 252) | public function test_adding_files_to_existing_backup() {
method test_backup_with_errors (line 275) | public function test_backup_with_errors() {
FILE: tests/class-backup-engine/test-class-backup-engine-database-imysqldump.php
class IMysqldump_Database_Backup_Engine_Tests (line 5) | class IMysqldump_Database_Backup_Engine_Tests extends Common_Database_Ba...
method setUp (line 9) | public function setUp() {
FILE: tests/class-backup-engine/test-class-backup-engine-database-mysqldump.php
class Mysqldump_Database_Backup_Engine_Tests (line 5) | class Mysqldump_Database_Backup_Engine_Tests extends Common_Database_Bac...
method setUp (line 9) | public function setUp() {
method test_default_command_path (line 17) | public function test_default_command_path() {
FILE: tests/class-backup-engine/test-class-backup-engine-database.php
class Database_Backup_Engine_Tests (line 5) | class Database_Backup_Engine_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 7) | function setUp() {
method test_db_host_localhost (line 11) | function test_db_host_localhost() {
method test_db_host_localhost_port (line 21) | function test_db_host_localhost_port() {
method test_db_host_localhost_socket (line 32) | function test_db_host_localhost_socket() {
method test_db_host_url (line 42) | function test_db_host_url() {
method test_db_host_ip (line 52) | function test_db_host_ip() {
FILE: tests/class-backup-engine/test-class-backup-engine-file-zip-archive.php
class Zip_Archive_File_Backup_Engine_Tests (line 5) | class Zip_Archive_File_Backup_Engine_Tests extends Common_File_Backup_En...
method setUp (line 9) | public function setUp() {
FILE: tests/class-backup-engine/test-class-backup-engine-file-zip.php
class Zip_File_Backup_Engine_Tests (line 5) | class Zip_File_Backup_Engine_Tests extends Common_File_Backup_Engine_Tes...
method setUp (line 9) | public function setUp() {
method test_backup_with_unreadable_directory (line 21) | public function test_backup_with_unreadable_directory() {
FILE: tests/class-backup-utilities/test-get-executable-path.php
class Backup_Engine_Get_Executable_Path_Tests (line 5) | class Backup_Engine_Get_Executable_Path_Tests extends \HM_Backup_UnitTes...
method setUp (line 7) | public function setUp() {
method test_can_pick_first_path (line 24) | public function test_can_pick_first_path() {
method test_can_pick_shuffled_command_path (line 28) | public function test_can_pick_shuffled_command_path() {
method test_remove_default_command_path (line 37) | public function test_remove_default_command_path() {
FILE: tests/class-backup-utilities/test-get-home-path.php
class Home_Path_Tests (line 5) | class Home_Path_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 7) | function setUp() {
method tearDown (line 11) | function tearDown() {
method test_standard_install (line 19) | function test_standard_install() {
method test_standard_install_in_subdirectory (line 28) | function test_standard_install_in_subdirectory() {
FILE: tests/class-backup-utilities/test-safe-mode.php
class Safe_Mode_Tests (line 5) | class Safe_Mode_Tests extends \HM_Backup_UnitTestCase {
method ini_get_mock (line 7) | function ini_get_mock() {
method testSafeModeEmpty (line 13) | function testSafeModeEmpty() {
method testSafeModeUpperCaseOff (line 23) | function testSafeModeUpperCaseOff() {
method testSafeModeLowerCaseOff (line 33) | function testSafeModeLowerCaseOff() {
method testSafeModeWierdCaseOff (line 43) | function testSafeModeWierdCaseOff() {
method testSafeModeStringZero (line 53) | function testSafeModeStringZero() {
method testSafeModeIntZero (line 63) | function testSafeModeIntZero() {
method testSafeModeFalse (line 73) | function testSafeModeFalse() {
method testSafeModeNull (line 83) | function testSafeModeNull() {
method testSafeModeIntOne (line 93) | function testSafeModeIntOne() {
method testSafeModeStringOne (line 103) | function testSafeModeStringOne() {
method testSafeModeUpperCaseOn (line 113) | function testSafeModeUpperCaseOn() {
method testSafeModeLowerCaseOn (line 123) | function testSafeModeLowerCaseOn() {
method testSafeModeWierdCaseOn (line 133) | function testSafeModeWierdCaseOn() {
method testSafeModeTrue (line 143) | function testSafeModeTrue() {
FILE: tests/class-mock-backup-engines.php
class Mock_Database_Backup_Engine (line 5) | class Mock_Database_Backup_Engine extends Database_Backup_Engine {
method __construct (line 7) | public function __construct() {
method backup (line 11) | public function backup() {
class Mock_File_Backup_Engine (line 17) | class Mock_File_Backup_Engine extends File_Backup_Engine {
method __construct (line 19) | public function __construct() {
method backup (line 23) | public function backup() {
class Mock_Backup_Engine (line 29) | class Mock_Backup_Engine extends Backup_Engine {
method __construct (line 31) | public function __construct() {
method backup (line 35) | public function backup() {
method verify_backup (line 39) | public function verify_backup() {
class Mock_Failing_Backup_Engine (line 45) | class Mock_Failing_Backup_Engine extends Backup_Engine {
method __construct (line 47) | public function __construct() {
method backup (line 51) | public function backup() {
method verify_backup (line 55) | public function verify_backup() {
FILE: tests/class-site-backup/test-backup-director.php
class Backup_Director_Tests (line 5) | class Backup_Director_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 7) | public function setUp() {
method test_backup_director_good (line 15) | public function test_backup_director_good() {
method test_backup_director_good_first (line 20) | public function test_backup_director_good_first() {
method test_backup_director_good_last (line 25) | public function test_backup_director_good_last() {
method test_backup_director_bad (line 30) | public function test_backup_director_bad() {
method test_backup_director_lots_of_bad (line 35) | public function test_backup_director_lots_of_bad() {
FILE: tests/class-site-backup/test-class-site-backup.php
class Site_Backup_Tests (line 5) | class Site_Backup_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 7) | public function setUp() {
method tearDown (line 14) | public function tearDown() {
method test_database_backup (line 18) | public function test_database_backup() {
method test_only_database_zipped_up (line 28) | public function test_only_database_zipped_up() {
method test_files_backup (line 45) | public function test_files_backup() {
method test_complete_backup (line 62) | public function test_complete_backup() {
method test_multiple_backups_exclude_backups (line 80) | public function test_multiple_backups_exclude_backups() {
FILE: tests/class-wp-test-hm-backup-testcase.php
class HM_Backup_UnitTestCase (line 3) | class HM_Backup_UnitTestCase extends WP_UnitTestCase {
method assertArchiveEquals (line 15) | function assertArchiveEquals( $zip_file, $filepaths, $root = ABSPATH ) {
method assertArchiveNotEquals (line 40) | function assertArchiveNotEquals( $zip_file, $filenames ) {
method assertArchiveContains (line 62) | function assertArchiveContains( $zip_file, $filepaths, $root = ABSPATH...
method assertArchiveNotContains (line 90) | function assertArchiveNotContains( $zip_file, $filenames ) {
method assertArchiveFileCount (line 115) | function assertArchiveFileCount( $zip_file, $file_count ) {
method pclzip_extract_as_string (line 123) | private function pclzip_extract_as_string( $zip_file ) {
method setup_test_data (line 144) | protected function setup_test_data() {
method cleanup_test_data (line 161) | protected function cleanup_test_data() {
method assertNotWPError (line 169) | public function assertNotWPError( $actual, $message = '' ) {
FILE: tests/misc/test-path-in-open-basedir.php
class testPathInOpenBasedir (line 5) | class testPathInOpenBasedir extends \HM_Backup_UnitTestCase {
method ini_get_mock (line 7) | function ini_get_mock() {
method test_empty_basedir (line 11) | public function test_empty_basedir() {
method test_not_in_basedir (line 18) | public function test_not_in_basedir() {
method test_is_basedir (line 25) | public function test_is_basedir() {
method test_in_basedir (line 32) | public function test_in_basedir() {
method test_deep_in_basedir (line 39) | public function test_deep_in_basedir() {
method test_multiple_basedir (line 46) | public function test_multiple_basedir() {
method test_preceding_basedir (line 53) | public function test_preceding_basedir() {
FILE: tests/misc/testDetermineStartTime.php
class testDetermineStartTimeTestCase (line 11) | class testDetermineStartTimeTestCase extends \HM_Backup_UnitTestCase {
method setUp (line 25) | public function setUp() {
method time (line 33) | public function time() {
method tearDown (line 40) | public function tearDown() {
method testDefaultArgs (line 48) | public function testDefaultArgs() {
method testFutureStart (line 83) | public function testFutureStart() {
method testHourlyPastStart (line 105) | public function testHourlyPastStart() {
method testTwiceDailyPastStart (line 127) | public function testTwiceDailyPastStart() {
method testDailyPastStart (line 152) | public function testDailyPastStart() {
method testWeeklyPastStart (line 171) | public function testWeeklyPastStart() {
method testWeeklyFutureStart (line 188) | public function testWeeklyFutureStart() {
method testFortnightlyPastStart (line 202) | public function testFortnightlyPastStart() {
method testMonthlyPastStart (line 220) | public function testMonthlyPastStart() {
method testMonthlyFutureStart (line 236) | public function testMonthlyFutureStart() {
FILE: tests/misc/testUninstallActivateDeactivate.php
class testUninstallActivateDeactivateTestCase (line 9) | class testUninstallActivateDeactivateTestCase extends HM_Backup_UnitTest...
method setUp (line 14) | public function setUp() {
method tearDown (line 18) | public function tearDown() {
method test_uninstall (line 22) | public function test_uninstall() {
method test_deactivate (line 40) | public function test_deactivate() {
method test_activate (line 50) | public function test_activate() {
FILE: tests/schedule/testScheduleTest.php
class testScheduleTestCase (line 10) | class testScheduleTestCase extends \HM_Backup_UnitTestCase {
method setUp (line 24) | public function setUp() {
method tearDown (line 36) | public function tearDown() {
method testDefaultSchedule (line 50) | public function testDefaultSchedule() {
method set_past_start_time (line 70) | public function set_past_start_time() {
method testSetrecurrences (line 81) | public function testSetrecurrences() {
method testReSetupAfterDeleteCron (line 102) | public function testReSetupAfterDeleteCron() {
method testSetFutureSchedule (line 132) | public function testSetFutureSchedule() {
method testUnschedule (line 152) | public function testUnschedule() {
method testAverageBackupDurationCorrectValuesMinutes (line 170) | public function testAverageBackupDurationCorrectValuesMinutes() {
method testAverageBackupDurationCorrectValuesHours (line 189) | public function testAverageBackupDurationCorrectValuesHours() {
method testAverageBackupDurationIncorrectValues (line 208) | public function testAverageBackupDurationIncorrectValues() {
method testAverageBackupDurationZeroValues (line 235) | public function testAverageBackupDurationZeroValues() {
method add_mock_backup_data (line 262) | protected function add_mock_backup_data( $data = array() ) {
FILE: tests/test-backup-path.php
class Test_Backup_Path (line 11) | class Test_Backup_Path extends \HM_Backup_UnitTestCase {
method setUp (line 13) | public function setUp() {
method tearDown (line 27) | public function tearDown() {
method testDefaultPath (line 58) | public function testDefaultPath() {
method testFallbackPath (line 69) | public function testFallbackPath() {
method testExistingPath (line 93) | public function testExistingPath() {
method testExistingPaths (line 112) | public function testExistingPaths() {
method testCustomPath (line 127) | public function testCustomPath() {
method testUnwritableCustomPath (line 142) | public function testUnwritableCustomPath() {
method testMergeExistingPath (line 159) | public function testMergeExistingPath() {
method testIsPathProtected (line 183) | public function testIsPathProtected() {
method generate_additional_paths (line 206) | private function generate_additional_paths() {
method test_cleanup (line 224) | public function test_cleanup() {
FILE: tests/test-backup-status.php
class Test_Backup_Status (line 10) | class Test_Backup_Status extends \HM_Backup_UnitTestCase {
method setUp (line 12) | public function setUp() {
method tearDown (line 19) | public function tearDown() {
method test_not_started (line 23) | public function test_not_started() {
method test_not_started_status_filepath (line 27) | public function test_not_started_status_filepath() {
method test_not_started_filename (line 31) | public function test_not_started_filename() {
method test_not_started_status (line 35) | public function test_not_started_status() {
method test_not_started_start_time (line 39) | public function test_not_started_start_time() {
method test_not_started_set_status (line 43) | public function test_not_started_set_status() {
method test_started (line 48) | public function test_started() {
method test_started_status_filepath (line 53) | public function test_started_status_filepath() {
method test_started_filename (line 58) | public function test_started_filename() {
method test_started_status (line 63) | public function test_started_status() {
method test_started_start_time (line 68) | public function test_started_start_time() {
method test_started_set_status (line 73) | public function test_started_set_status() {
method test_finish (line 79) | public function test_finish() {
method test_multiple_status_dont_clash (line 85) | public function test_multiple_status_dont_clash() {
FILE: tests/test-excludes.php
class Backup_Engine_Excludes (line 5) | class Backup_Engine_Excludes extends \HM_Backup_UnitTestCase {
method setUp (line 7) | public function setUp() {
method tearDown (line 17) | public function tearDown() {
method testBackUpDirIsExcludedWhenBackUpDirIsInRoot (line 21) | public function testBackUpDirIsExcludedWhenBackUpDirIsInRoot() {
method testNoExcludesExceptDefaults (line 30) | public function testNoExcludesExceptDefaults() {
method testExcludeAbsoluteDirPath (line 42) | public function testExcludeAbsoluteDirPath() {
method testExcludeAbsoluteRootDirPath (line 54) | public function testExcludeAbsoluteRootDirPath() {
method testExcludeDirPathFragment (line 65) | public function testExcludeDirPathFragment() {
method testExcludeAmbiguousAbsoluteDirPath (line 76) | public function testExcludeAmbiguousAbsoluteDirPath() {
method testExcludeAbsoluteFilePath (line 87) | public function testExcludeAbsoluteFilePath() {
method testExcludeAmbiguousAbsoluteFilePath (line 101) | public function testExcludeAmbiguousAbsoluteFilePath() {
method testExcludeAbsolutePathWithWildcardFile (line 115) | public function testExcludeAbsolutePathWithWildcardFile() {
method testExcludeAmbiguousAbsolutePathWithWildcardFile (line 129) | public function testExcludeAmbiguousAbsolutePathWithWildcardFile() {
method testExcludeWildcardFileName (line 143) | public function testExcludeWildcardFileName() {
method testExcludeAbsolutePathWithWildcardFileName (line 157) | public function testExcludeAbsolutePathWithWildcardFileName() {
method testExcludeAmbiguousAbsolutePathWithWildcardFileName (line 171) | public function testExcludeAmbiguousAbsolutePathWithWildcardFileName() {
method testExcludeWildcardFileExtension (line 185) | public function testExcludeWildcardFileExtension() {
method testExcludeAbsolutePathWithWildcardFileExtension (line 199) | public function testExcludeAbsolutePathWithWildcardFileExtension() {
method testExcludeAmbiguousAbsolutePathWithWildcardFileExtension (line 213) | public function testExcludeAmbiguousAbsolutePathWithWildcardFileExtens...
method testExcludePartialFilename (line 227) | public function testExcludePartialFilename() {
method testExcludePartialDirectory (line 241) | public function testExcludePartialDirectory() {
method testWildCard (line 255) | public function testWildCard() {
method test_excluded_file_directly_is_excluded (line 271) | public function test_excluded_file_directly_is_excluded() {
method test_excluded_file_via_parent_directory_is_excluded (line 294) | public function test_excluded_file_via_parent_directory_is_excluded() {
method test_non_excluded_file_is_excluded (line 318) | public function test_non_excluded_file_is_excluded() {
method get_and_prepare_files (line 336) | private function get_and_prepare_files() {
FILE: tests/test-extensions.php
class Extensions_Tests (line 5) | class Extensions_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 9) | public function setUp() {
method tearDown (line 14) | public function tearDown() {
method test_instance (line 18) | public function test_instance() {
method test_fetch_api_data (line 24) | public function test_fetch_api_data() {
method get_http_request_overide (line 36) | private function get_http_request_overide( $matched_url, $response_bod...
FILE: tests/test-get-files.php
class Backup_Engine_Get_Files (line 5) | class Backup_Engine_Get_Files extends \HM_Backup_UnitTestCase {
method setUp (line 7) | public function setUp() {
method tearDown (line 16) | public function tearDown() {
method test_get_files (line 21) | public function test_get_files() {
method test_get_files_includes_hidden_files (line 28) | public function test_get_files_includes_hidden_files() {
method test_unreadable_files_ignored (line 37) | public function test_unreadable_files_ignored() {
method test_unreadable_directory_ignored (line 50) | public function test_unreadable_directory_ignored() {
method test_vcs_ignored (line 63) | public function test_vcs_ignored() {
method test_default_excludes_ignored (line 72) | public function test_default_excludes_ignored() {
method test_excluded_git_in_filename_is_ignored (line 90) | public function test_excluded_git_in_filename_is_ignored() {
method test_excluded_dir_in_name_isnt_ignored (line 102) | public function test_excluded_dir_in_name_isnt_ignored() {
FILE: tests/test-is-same-size-format.php
class Is_Same_Size_Format_Tests (line 5) | class Is_Same_Size_Format_Tests extends \HM_Backup_UnitTestCase {
method test_both_same_size (line 7) | public function test_both_same_size() {
method test_not_both_same_size (line 11) | public function test_not_both_same_size() {
method test_both_strings (line 15) | public function test_both_strings() {
FILE: tests/test-notices.php
class Notice_Tests (line 5) | class Notice_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 7) | public function setUp() {
method tearDown (line 11) | public function tearDown() {
method test_no_notices_no_context (line 16) | public function test_no_notices_no_context() {
method test_no_notices_context (line 20) | public function test_no_notices_context() {
method test_set_single_notice_with_context (line 24) | public function test_set_single_notice_with_context() {
method test_get_notices_with_wrong_context (line 29) | public function test_get_notices_with_wrong_context() {
method test_empty_context (line 34) | public function test_empty_context() {
method test_empty_message (line 39) | public function test_empty_message() {
method test_set_multiple_notice_with_context (line 44) | public function test_set_multiple_notice_with_context() {
method test_set_multiple_notices_in_same_context (line 52) | public function test_set_multiple_notices_in_same_context() {
method test_set_multiple_persistant_notices_in_same_context (line 58) | public function test_set_multiple_persistant_notices_in_same_context() {
method test_set_duplicate_notice (line 65) | public function test_set_duplicate_notice() {
method test_set_duplicate_notices_different_contexts (line 71) | public function test_set_duplicate_notices_different_contexts() {
method test_clear_notices (line 77) | public function test_clear_notices() {
method test_persistant_notice (line 84) | public function test_persistant_notice() {
method test_set_persistant_single_notice_with_context (line 91) | public function test_set_persistant_single_notice_with_context() {
method test_get_persistant_notices_with_wrong_context (line 97) | public function test_get_persistant_notices_with_wrong_context() {
method test_set_persistant_multiple_notice_with_context (line 103) | public function test_set_persistant_multiple_notice_with_context() {
method reset_notices (line 112) | private function reset_notices() {
FILE: tests/test-site-size.php
class Site_Size_Tests (line 5) | class Site_Size_Tests extends \HM_Backup_UnitTestCase {
method setUp (line 7) | public function setUp() {
method tearDown (line 15) | public function tearDown() {
method test_rebuild_directory_filesizes (line 23) | public function test_rebuild_directory_filesizes() {
method test_filesize_excludes (line 31) | public function test_filesize_excludes() {
method test_lock (line 38) | public function test_lock() {
method test_is_site_cached (line 47) | public function test_is_site_cached() {
method test_old_cache_is_cleared (line 53) | public function test_old_cache_is_cleared() {
method test_site_size_file (line 68) | public function test_site_size_file() {
method test_site_size_formatted (line 74) | public function test_site_size_formatted() {
method test_site_size_database (line 80) | public function test_site_size_database() {
method test_site_size_without_filescanner_complete_equals_database (line 85) | public function test_site_size_without_filescanner_complete_equals_dat...
method test_site_size_with_filescanner_complete_equals_database_plus_files (line 94) | public function test_site_size_with_filescanner_complete_equals_databa...
method test_file_size_excluded_directly (line 115) | public function test_file_size_excluded_directly() {
method test_file_size_excluded_via_parent_directory (line 135) | public function test_file_size_excluded_via_parent_directory() {
method test_file_size_not_excluded_directly (line 160) | public function test_file_size_not_excluded_directly() {
FILE: whitelist-html/whitelist-html.php
function whitelist_html (line 43) | function whitelist_html( $text, $allowedtags = array(), $context = '' ) {
function print_whitelist_html (line 100) | function print_whitelist_html( $text, $allowedtags = array(), $context =...
Condensed preview — 164 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,248K chars).
[
{
"path": ".bowerrc",
"chars": 80,
"preview": "{\n\t\"directory\": \"assets\",\n\t\"scripts\": {\n\t\t\"postinstall\": \"rm -rf js/jquery\"\n\t}\n}"
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 375,
"preview": "### Description of issue\nReplace this text with a short description\n\n### Steps to recreate issue\n1. Replace this\n2. text"
},
{
"path": ".gitignore",
"chars": 145,
"preview": ".svn\nnode_modules\nnpm-debug.log\nassets/jquery\nreadme/faq.txt\nbuild\nHistory.md\nvendor\n.idea\ncomposer.lock\n.DS_Store\nrelea"
},
{
"path": ".jshintrc",
"chars": 467,
"preview": "{\n \"boss\": true,\n \"curly\": true,\n \"eqeqeq\": true,\n \"eqnull\": true,\n \"es3\": true,\n \"expr\": true,\n \"i"
},
{
"path": ".scrutinizer.yml",
"chars": 3664,
"preview": "filter:\n excluded_paths: [ 'vendor/*', 'bin/*', 'backdrop/*', 'node_modules/*', 'readme/*', 'tests/*', 'languages/*',"
},
{
"path": ".travis.yml",
"chars": 2171,
"preview": "language: php\nsudo: false\nphp:\n - 5.3\n - 5.4\n - 5.5\n - 5.6\n - hhvm\n - 7.0\n\nenv:\n # trunk:\n - WP_VERSION=master W"
},
{
"path": "CONTRIBUTING.md",
"chars": 3341,
"preview": "# Contributing to BackUpWordPress\n\nThanks for stopping by, It's really great that you're here. BackUpWordPress thrives o"
},
{
"path": "Gruntfile.js",
"chars": 82,
"preview": "module.exports = function( grunt ) {\n\trequire( 'load-grunt-config' )( grunt );\n};\n"
},
{
"path": "admin/actions.php",
"chars": 22015,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Delete the backup and then redirect back to the backups page\n */\nfunction r"
},
{
"path": "admin/backups-table.php",
"chars": 842,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n?>\n\n<table class=\"widefat\">\n\n\t<thead>\n\n\t\t<tr>\n\n\t\t\t<th scope=\"col\"><?php backups_nu"
},
{
"path": "admin/backups.php",
"chars": 1988,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n// Refresh the schedules from the database to make sure we have the latest changes"
},
{
"path": "admin/constants.php",
"chars": 5387,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n?>\n\n<div id=\"hmbkp-constants\">\n\n\t<p><?php printf( __( 'You can %1$s any of the fol"
},
{
"path": "admin/enable-support.php",
"chars": 1994,
"preview": "<?php require_once HMBKP_PLUGIN_PATH . 'classes/class-requirements.php'; ?>\n\n<h2><?php _e( 'Enable BackUpWordPress Suppo"
},
{
"path": "admin/extensions.php",
"chars": 7180,
"preview": "<?php\nnamespace HM\\BackUpWordPress;\n?>\n\n<div class=\"wrap\">\n\t<h1>\n\t\t<a class=\"page-title-action\" href=\"<?php echo esc_url"
},
{
"path": "admin/faq.php",
"chars": 5933,
"preview": "<?php\necho '<p><strong>' . __( 'Where does BackUpWordPress store the backup files?', 'backupwordpress' ) . '</strong></p"
},
{
"path": "admin/filesystem-credentials.php",
"chars": 268,
"preview": "<?php\n\n$_POST['action'] = 'hmbkp_request_credentials';\n$extra_fields = array( 'action' );\n\nif ( ! isset( $_GET['creat"
},
{
"path": "admin/menu.php",
"chars": 4260,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Add the backups menu item\n * to the tools menu\n */\nfunction admin_menu() {\n"
},
{
"path": "admin/page.php",
"chars": 407,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n?>\n\n<div class=\"wrap\">\n\n\t<h1>\n\n\t\tBackUpWordPress\n\n\t</h1>\n\n\t<?php if ( has_server_p"
},
{
"path": "admin/schedule-form-excludes.php",
"chars": 11208,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n$excludes = $schedule->get_excludes();\n$user_excludes = $excludes->get_user_e"
},
{
"path": "admin/schedule-form.php",
"chars": 6392,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n?>\n\n<h3><?php esc_html_e( 'Settings', 'backupwordpress' ); ?></h3>\n\n<?php $hmbkp_f"
},
{
"path": "admin/schedule-sentence.php",
"chars": 5840,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n$filesize = get_site_size_text( $schedule );\n\n// Backup Type\n$type = strtolower( h"
},
{
"path": "admin/schedule-settings.php",
"chars": 3873,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nif ( Schedules::get_instance()->get_schedule( $schedule->get_id() ) ) { ?>\n\n\t<div "
},
{
"path": "admin/server-info.php",
"chars": 1335,
"preview": "<?php\n\nforeach ( HM\\BackUpWordPress\\Requirements::get_requirement_groups() as $group ) : ?>\n\n\t<h3><?php echo esc_html( u"
},
{
"path": "admin/upsell.php",
"chars": 918,
"preview": "<?php namespace HM\\BackUpWordPress; ?>\n<div class=\"hmbkp-upsell\">\n\n<?php\n/** translators: the 1st placeholder is the fi"
},
{
"path": "assets/hmbkp.css",
"chars": 4985,
"preview": "/*Constants Tab*/\n.hmbkp_active td:first-child > code:before { content: \"\\00a0 \\2713 \"; font-size: 11px; }\n.hmbkp_activ"
},
{
"path": "assets/hmbkp.js",
"chars": 4979,
"preview": "var BackUpWordPressAdmin = (function($){\n\t'use strict';\n\n\tvar recurrenceType;\n\n\tfunction init(){\n\n\t\trecurrenceType = $( "
},
{
"path": "backdrop/README.md",
"chars": 3523,
"preview": "# Backdrop\nBackdrop is a simple library that does one thing: allows you to run one-off\ntasks in the background.\n\n## How "
},
{
"path": "backdrop/hm-backdrop.php",
"chars": 365,
"preview": "<?php\n\nrequire dirname( __FILE__ ) . '/server.php';\nrequire dirname( __FILE__ ) . '/task.php';\n\nif ( version_compare( PH"
},
{
"path": "backdrop/license.txt",
"chars": 18093,
"preview": "\n GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 F"
},
{
"path": "backdrop/namespace.php",
"chars": 114,
"preview": "<?php\n\nnamespace HM\\Backdrop;\n\nclass Server extends \\HM_Backdrop_Server {}\nclass Task extends \\HM_Backdrop_Task {}"
},
{
"path": "backdrop/server.php",
"chars": 903,
"preview": "<?php\n\nclass HM_Backdrop_Server {\n\tpublic function run() {\n\t\tif ( empty( $_POST['key'] ) ) {\n\t\t\treturn new WP_Error( 'hm"
},
{
"path": "backdrop/task.php",
"chars": 1668,
"preview": "<?php\n\nclass HM_Backdrop_Task {\n\tprotected $key;\n\tprotected $callback;\n\tprotected $params = array();\n\n\tpublic function _"
},
{
"path": "backupwordpress.php",
"chars": 1984,
"preview": "<?php\n/*\nPlugin Name: BackUpWordPress\nPlugin URI: https://updraftplus.com/backupwordpress/?afref=744\nDescription: Simple"
},
{
"path": "bin/readme.txt",
"chars": 56935,
"preview": "=== BackUpWordPress ===\nContributors: xibodevelopment, willmot, dashaluna, pauldewouters, joehoyle, mattheu, tcrsavage, "
},
{
"path": "bin/release.sh",
"chars": 1275,
"preview": "# release.sh\n#\n# Takes a tag to release, and syncs it to WordPress.org\n\nTAG=3.10\nPLUGIN=\"backupwordpress\"\nPLUGINDIR=$(pw"
},
{
"path": "bower.json",
"chars": 401,
"preview": "{\n\t\"name\": \"backupwordpress\",\n\t\"version\": \"3.6.0\",\n\t\"homepage\": \"https://profiles.wordpress.org/xibodevelopment\",\n\t\"auth"
},
{
"path": "changelog.txt",
"chars": 2711,
"preview": "2741ba7 composer npm update\nd5a5468 Update class-plugin to remove escaping\n37bbf48 Update upsell.php\n06d1ec7 Update upse"
},
{
"path": "classes/backup/class-backup-engine-database-imysqldump.php",
"chars": 2049,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nuse Ifsnop\\Mysqldump as IMysqldump;\n\n/**\n * Perform a database backup using the my"
},
{
"path": "classes/backup/class-backup-engine-database-mysqldump.php",
"chars": 4116,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nuse Symfony\\Component\\Process\\Process as Process;\n\n/**\n * Perform a database backu"
},
{
"path": "classes/backup/class-backup-engine-database.php",
"chars": 4544,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * The Database Backup Engine type\n *\n * All Database Backup Engine implementa"
},
{
"path": "classes/backup/class-backup-engine-file-zip-archive.php",
"chars": 1164,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Perform a file backup using the native PHP ZipArchive extension\n */\nclass Z"
},
{
"path": "classes/backup/class-backup-engine-file-zip.php",
"chars": 4106,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nuse Symfony\\Component\\Process\\Process as Process;\n\n/**\n * Perform a file backup us"
},
{
"path": "classes/backup/class-backup-engine-file.php",
"chars": 2531,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nuse Symfony\\Component\\Finder\\Finder as Finder;\n\n/**\n * The File Backup Engine type"
},
{
"path": "classes/backup/class-backup-engine.php",
"chars": 5230,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * The base Backup Engine\n *\n * Base Backup Engine types should extend this cl"
},
{
"path": "classes/backup/class-backup-status.php",
"chars": 2499,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Manages status and progress of a backup\n */\nclass Backup_Status {\n\n\tprivate"
},
{
"path": "classes/backup/class-backup-utilities.php",
"chars": 1539,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nuse Symfony\\Component\\Process\\Process as Process;\n\n/**\n * A set of Backup Utility "
},
{
"path": "classes/backup/class-backup.php",
"chars": 6214,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Backup {\n\n\tprivate $excludes;\n\tpublic $warnings = array();\n\tpublic $errors ="
},
{
"path": "classes/class-backupwordpress-wp-cli-command.php",
"chars": 2689,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Implement backup command\n *\n * @todo fix\n * @package wp-cli\n * @subpackage "
},
{
"path": "classes/class-email-service.php",
"chars": 7164,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Email notifications for backups\n *\n * @extends Service\n */\nclass Email_Serv"
},
{
"path": "classes/class-excludes.php",
"chars": 4633,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Manages exclude rules\n */\nclass Excludes {\n\n\t/**\n\t * The array of exclude r"
},
{
"path": "classes/class-extensions.php",
"chars": 2049,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Class Extensions\n * @package HM\\BackUpWordPress\n */\nfinal class Extensions "
},
{
"path": "classes/class-notices.php",
"chars": 3855,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Class for managing notices\n *\n * Notices are messages along with an associa"
},
{
"path": "classes/class-path.php",
"chars": 11786,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Manages both the backup path and site root\n *\n * Handles calculating & prot"
},
{
"path": "classes/class-plugin.php",
"chars": 14388,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Class Plugin\n */\nfinal class Plugin {\n\tconst PLUGIN_VERSION = '3.10';\n\n\t/**"
},
{
"path": "classes/class-requirement.php",
"chars": 14641,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * An abstract requirement class, individual requirements should\n * extend thi"
},
{
"path": "classes/class-requirements.php",
"chars": 1284,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * A singleton to handle the registering, unregistering\n * and storage of indi"
},
{
"path": "classes/class-scheduled-backup.php",
"chars": 15524,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * The Backup Scheduler\n *\n * Handles everything related to managing and runni"
},
{
"path": "classes/class-schedules.php",
"chars": 1762,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * A simple class for loading schedules\n */\nclass Schedules {\n\n\t/**\n\t * An arr"
},
{
"path": "classes/class-service.php",
"chars": 4866,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * An abstract service class, individual services should\n * extend this class\n"
},
{
"path": "classes/class-services.php",
"chars": 2588,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * A singleton to handle the registering, de-registering\n * and storage of ser"
},
{
"path": "classes/class-setup.php",
"chars": 3997,
"preview": "<?php\n/**\n * Class BackUpWordPress_Setup\n */\nclass HMBKP_Setup {\n\n\t/**\n\t * Defines the minimum version of WordPress requ"
},
{
"path": "classes/class-site-size.php",
"chars": 7607,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nuse HM\\Backdrop\\Task;\nuse Symfony\\Component\\Finder\\Finder;\n\n/**\n * Site Size class"
},
{
"path": "classes/class-webhook-service.php",
"chars": 2896,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Webhook notifications for backups\n *\n * @extends Service\n */\nabstract class"
},
{
"path": "classes/class-wpremote-webhook-service.php",
"chars": 1249,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Webhook notifications for backups on WPRemote\n *\n * @extends Service\n */\ncl"
},
{
"path": "classes/deprecated.php",
"chars": 1633,
"preview": "<?php\n\n\n/**\n * An abstract service class, individual services should\n * extend this class\n */\nabstract class HMBKP_Servi"
},
{
"path": "composer.json",
"chars": 782,
"preview": "{\n \"name\" : \"xibodevelopment/backupwordpress\",\n \"description\": \"Simple automated backups of your WordPress p"
},
{
"path": "functions/core.php",
"chars": 20889,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Handles anything that needs to be\n * done when the plugin is updated\n */\nfu"
},
{
"path": "functions/interface.php",
"chars": 15674,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Displays a row in the manage backups table\n *\n * @param string "
},
{
"path": "grunt/aliases.yml",
"chars": 707,
"preview": "build-dev:\n - makepot\n - autoprefixer\n - cssmin\n - uglify\n - shell\n - compress:dev\n\nbuild:\n - autoprefixer\n - cs"
},
{
"path": "grunt/autoprefixer.js",
"chars": 63,
"preview": "module.exports = {\n\tno_dest: {\n\t\tsrc: 'assets/hmbkp.css'\n\t}\n};\n"
},
{
"path": "grunt/bumpup.js",
"chars": 111,
"preview": "module.exports = {\n\toptions: {\n\t\tupdateProps: {\n\t\t\tpackage: 'package.json'\n\t\t}\n\t},\n\tfiles: ['package.json']\n};\n"
},
{
"path": "grunt/checktextdomain.js",
"chars": 614,
"preview": "module.exports = {\n\tstandard: {\n\t\toptions: {\n\t\t\ttext_domain: 'backupwordpress', //Specify allowed domain(s),\n\t\t\tcorrect_"
},
{
"path": "grunt/compress.js",
"chars": 352,
"preview": "module.exports = {\n\tmain: {\n\t\toptions: {\n\t\t\tarchive: 'releases/<%= package.name %>-<%= package.version %>.zip'\n\t\t},\n\t\tex"
},
{
"path": "grunt/concat.js",
"chars": 154,
"preview": "module.exports = {\n\treadme: {\n\t\tsrc : [\n\t\t\t'readme/readme-header.txt',\n\t\t\t'readme/faq.txt',\n\t\t\t'readme/readme-footer.txt"
},
{
"path": "grunt/cssmin.js",
"chars": 140,
"preview": "module.exports = {\n\tminify: {\n\t\texpand: true,\n\t\tcwd : 'assets/',\n\t\tsrc : ['hmbkp.css'],\n\t\tdest : 'assets/',\n\t\text "
},
{
"path": "grunt/excludes",
"chars": 287,
"preview": ".DS_Store\n.svn\n.git\n.gitignore\n.gitmodules\n.editorconfig\n.sass-cache\nnode_modules\n.bowerrc\n.travis.yml\nbin\ngrunt\nrelease"
},
{
"path": "grunt/jshint.js",
"chars": 452,
"preview": "module.exports = {\n\toptions: {\n\t\t'boss': true,\n\t\t'curly': true,\n\t\t'eqeqeq': true,\n\t\t'eqnull': true,\n\t\t'es3': true,\n\t\t'ex"
},
{
"path": "grunt/makepot.js",
"chars": 689,
"preview": "module.exports = {\n\ttarget: {\n\t\toptions: {\n\t\t\tmainFile: 'backupwordpress.php',\n\t\t\tpotFilename: 'backupwordpress.pot',\n\t\t"
},
{
"path": "grunt/replace.js",
"chars": 1233,
"preview": "module.exports = {\n\tpluginClassVersion: {\n\t\tsrc: [\n\t\t\t'classes/class-plugin.php'\n\t\t],\n\t\toverwrite: true,\n\t\treplacements:"
},
{
"path": "grunt/shell.js",
"chars": 141,
"preview": "module.exports = {\n\tbuild: {\n\t\tcommand: 'mkdir -p releases/svn && rsync -avzrR --exclude-from \\'grunt/excludes\\' . relea"
},
{
"path": "grunt/uglify.js",
"chars": 141,
"preview": "module.exports = {\n\toptions: {\n\t\tpreserveComments: 'some'\n\t},\n\tplugin : {\n\t\tfiles: {\n\t\t\t'assets/hmbkp.min.js': ['assets/"
},
{
"path": "languages/backupwordpress-ca_ES.po",
"chars": 16867,
"preview": "# Translation of 2.x in Catalan\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\""
},
{
"path": "languages/backupwordpress-cs_CZ.po",
"chars": 22178,
"preview": "# Translation of 2.x in Czech\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n\""
},
{
"path": "languages/backupwordpress-da_DK.po",
"chars": 22720,
"preview": "# Translation of 2.x in Danish\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n"
},
{
"path": "languages/backupwordpress-de_DE.po",
"chars": 24722,
"preview": "# Translation of 2.x in German\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n"
},
{
"path": "languages/backupwordpress-el_GR.po",
"chars": 16865,
"preview": "# Translation of 2.x in Greek\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n\""
},
{
"path": "languages/backupwordpress-en_AU.po",
"chars": 28139,
"preview": "# Copyright (C) 2018 XIBO Ltd\n# This file is distributed under the GPL-2.0+.\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Bac"
},
{
"path": "languages/backupwordpress-en_GB.po",
"chars": 28103,
"preview": "# Copyright (C) 2015 XIBO Ltd\n# This file is distributed under the GPL-2.0+.\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Bac"
},
{
"path": "languages/backupwordpress-es_ES.po",
"chars": 22843,
"preview": "# Translation of 2.x in Spanish (Spain)\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nm"
},
{
"path": "languages/backupwordpress-eu.po",
"chars": 16863,
"preview": "# Translation of 2.x in Basque\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n"
},
{
"path": "languages/backupwordpress-fr_FR.po",
"chars": 43161,
"preview": "# Translation of 3.x in French (France)\n# This file is distributed under the same license as the 3.x package.\nmsgid \"\"\nm"
},
{
"path": "languages/backupwordpress-he_IL.po",
"chars": 18361,
"preview": "# Translation of 2.x in Hebrew\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n"
},
{
"path": "languages/backupwordpress-it_IT.po",
"chars": 22353,
"preview": "# Translation of 2.x in Italian\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\""
},
{
"path": "languages/backupwordpress-lt_LT.po",
"chars": 16935,
"preview": "# Translation of 2.x in Lithuanian\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr"
},
{
"path": "languages/backupwordpress-lv_LV.po",
"chars": 21755,
"preview": "# Translation of 2.x in Latvian\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\""
},
{
"path": "languages/backupwordpress-nl_NL.po",
"chars": 17931,
"preview": "# Translation of 2.x in Dutch\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n\""
},
{
"path": "languages/backupwordpress-pl_PL.po",
"chars": 22728,
"preview": "# Translation of 2.x in Polish\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n"
},
{
"path": "languages/backupwordpress-pt_BR.po",
"chars": 49280,
"preview": "msgid \"\"\r\nmsgstr \"\"\r\n\"Project-Id-Version: BackUpWordPress v3.1.3\\n\"\r\n\"Report-Msgid-Bugs-To: \\n\"\r\n\"POT-Creation-Date: \\n\""
},
{
"path": "languages/backupwordpress-ro_RO.po",
"chars": 16918,
"preview": "# Translation of 2.x in Romanian\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \""
},
{
"path": "languages/backupwordpress-ru_RU.po",
"chars": 23413,
"preview": "# Translation of 2.x in Russian\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\""
},
{
"path": "languages/backupwordpress-sk_SK.po",
"chars": 21954,
"preview": "# Translation of 2.x in Slovak\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\"\n"
},
{
"path": "languages/backupwordpress-sr_RS.po",
"chars": 16943,
"preview": "# Translation of 2.x in Serbian\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nmsgstr \"\""
},
{
"path": "languages/backupwordpress-zh-cn.po",
"chars": 17577,
"preview": "# Translation of 2.x in Chinese (China)\n# This file is distributed under the same license as the 2.x package.\nmsgid \"\"\nm"
},
{
"path": "languages/backupwordpress.pot",
"chars": 41194,
"preview": "# Copyright (C) 2018 XIBO Ltd\n# This file is distributed under the GPL-2+.\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: BackU"
},
{
"path": "package.json",
"chars": 1249,
"preview": "{\n \"name\": \"BackUpWordPress\",\n \"version\": \"3.9\",\n \"description\": \"Simple automated backups of your WordPress powered "
},
{
"path": "phpunit.xml",
"chars": 417,
"preview": "<phpunit\n\tbootstrap=\"tests/bootstrap.php\"\n\tbackupGlobals=\"false\"\n\tcolors=\"true\"\n\tconvertErrorsToExceptions=\"true\"\n\tconve"
},
{
"path": "readme/readme-footer.txt",
"chars": 50122,
"preview": "**Further Support & Feedback**\n\nGeneral support questions should be posted in the <a href=\"http://wordpress.org/tags/bac"
},
{
"path": "readme/readme-header.txt",
"chars": 1996,
"preview": "=== BackUpWordPress ===\nContributors: xibodevelopment, willmot, dashaluna, pauldewouters, joehoyle, mattheu, tcrsavage, "
},
{
"path": "readme.md",
"chars": 1477,
"preview": "## BackUpWordPress\nSimple automated backups of your WordPress powered website.\n\nBackUpWordPress is a well tested, onsite"
},
{
"path": "readme.txt",
"chars": 56937,
"preview": "=== BackUpWordPress ===\nContributors: xibodevelopment, willmot, dashaluna, pauldewouters, joehoyle, mattheu, tcrsavage, "
},
{
"path": "tests/bootstrap.php",
"chars": 2050,
"preview": "<?php\n\n/**\n * Bootstrap the plugin unit testing environment.\n *\n * @package BackUpWordPress\n * @subpackage tests\n */\n\n/*"
},
{
"path": "tests/class-backup-engine/common-database-backup-engine-tests.php",
"chars": 920,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nabstract class Common_Database_Backup_Engine_Tests extends \\HM_Backup_UnitTestCase"
},
{
"path": "tests/class-backup-engine/common-file-backup-engine-tests.php",
"chars": 8295,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nabstract class Common_File_Backup_Engine_Tests extends \\HM_Backup_UnitTestCase {\n\n"
},
{
"path": "tests/class-backup-engine/test-class-backup-engine-database-imysqldump.php",
"chars": 266,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass IMysqldump_Database_Backup_Engine_Tests extends Common_Database_Backup_Engin"
},
{
"path": "tests/class-backup-engine/test-class-backup-engine-database-mysqldump.php",
"chars": 543,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Mysqldump_Database_Backup_Engine_Tests extends Common_Database_Backup_Engine"
},
{
"path": "tests/class-backup-engine/test-class-backup-engine-database.php",
"chars": 1549,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Database_Backup_Engine_Tests extends \\HM_Backup_UnitTestCase {\n\n\tfunction se"
},
{
"path": "tests/class-backup-engine/test-class-backup-engine-file-zip-archive.php",
"chars": 252,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Zip_Archive_File_Backup_Engine_Tests extends Common_File_Backup_Engine_Tests"
},
{
"path": "tests/class-backup-engine/test-class-backup-engine-file-zip.php",
"chars": 1035,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Zip_File_Backup_Engine_Tests extends Common_File_Backup_Engine_Tests {\n\n\tpro"
},
{
"path": "tests/class-backup-utilities/test-get-executable-path.php",
"chars": 1184,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Backup_Engine_Get_Executable_Path_Tests extends \\HM_Backup_UnitTestCase {\n\n\t"
},
{
"path": "tests/class-backup-utilities/test-get-home-path.php",
"chars": 1695,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Home_Path_Tests extends \\HM_Backup_UnitTestCase {\n\n\tfunction setUp() {\n\t\t$th"
},
{
"path": "tests/class-backup-utilities/test-safe-mode.php",
"chars": 3163,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Safe_Mode_Tests extends \\HM_Backup_UnitTestCase {\n\n\tfunction ini_get_mock() "
},
{
"path": "tests/class-mock-backup-engines.php",
"chars": 830,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Mock_Database_Backup_Engine extends Database_Backup_Engine {\n\n\tpublic functi"
},
{
"path": "tests/class-site-backup/test-backup-director.php",
"chars": 1502,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Backup_Director_Tests extends \\HM_Backup_UnitTestCase {\n\n\tpublic function se"
},
{
"path": "tests/class-site-backup/test-class-site-backup.php",
"chars": 2817,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Site_Backup_Tests extends \\HM_Backup_UnitTestCase {\n\n\tpublic function setUp("
},
{
"path": "tests/class-wp-test-hm-backup-testcase.php",
"chars": 5893,
"preview": "<?php\n\nclass HM_Backup_UnitTestCase extends WP_UnitTestCase {\n\n\tprotected $test_root = __DIR__;\n\n\t/**\n\t * Assert that a "
},
{
"path": "tests/data/response.json",
"chars": 18254,
"preview": "[{\"id\":24261,\"date\":\"2016-03-01T15:40:08\",\"date_gmt\":\"2016-03-01T15:40:08\",\"guid\":{\"rendered\":\"https:\\/\\/bwp.hmn.md\\/?po"
},
{
"path": "tests/ini/php.ini",
"chars": 4273,
"preview": "[PHP]\n\n; Recommended that short tags - <? and ?> - are not used.\n; Default Value: On\n; Development Value: Off\n; Producti"
},
{
"path": "tests/misc/test-path-in-open-basedir.php",
"chars": 1535,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass testPathInOpenBasedir extends \\HM_Backup_UnitTestCase {\n\n function ini_ge"
},
{
"path": "tests/misc/testDetermineStartTime.php",
"chars": 8991,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Unit tests for the determine_start_time function\n *\n * @see determine_start"
},
{
"path": "tests/misc/testUninstallActivateDeactivate.php",
"chars": 1352,
"preview": "<?php\n\n/**\n * Unit tests for the HMBKP_Path class\n *\n * @see HMBKP_Path\n * @extends HM_Backup_UnitTestCase\n */\nclass tes"
},
{
"path": "tests/schedule/testScheduleTest.php",
"chars": 6724,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Tests for methods dealing with scheduling backups\n *\n * @extends WP_UnitTes"
},
{
"path": "tests/test-backup-path.php",
"chars": 6160,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Unit tests for the Path class\n *\n * @see Path\n * @extends HM_Backup_UnitTes"
},
{
"path": "tests/test-backup-status.php",
"chars": 2843,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\n/**\n * Unit tests for the Backup_Status class\n *\n * @extends HM_Backup_UnitTestCas"
},
{
"path": "tests/test-excludes.php",
"chars": 9782,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Backup_Engine_Excludes extends \\HM_Backup_UnitTestCase {\n\n\tpublic function s"
},
{
"path": "tests/test-extensions.php",
"chars": 1328,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Extensions_Tests extends \\HM_Backup_UnitTestCase {\n\n\tprivate $extensions;\n\n\t"
},
{
"path": "tests/test-get-files.php",
"chars": 2900,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Backup_Engine_Get_Files extends \\HM_Backup_UnitTestCase {\n\n\tpublic function "
},
{
"path": "tests/test-is-same-size-format.php",
"chars": 432,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Is_Same_Size_Format_Tests extends \\HM_Backup_UnitTestCase {\n\n\tpublic functio"
},
{
"path": "tests/test-notices.php",
"chars": 4657,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Notice_Tests extends \\HM_Backup_UnitTestCase {\n\n\tpublic function setUp() {\n\t"
},
{
"path": "tests/test-site-size.php",
"chars": 5925,
"preview": "<?php\n\nnamespace HM\\BackUpWordPress;\n\nclass Site_Size_Tests extends \\HM_Backup_UnitTestCase {\n\n\tpublic function setUp() "
},
{
"path": "uninstall.php",
"chars": 1034,
"preview": "<?php\n\nif ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {\n\texit;\n}\n\nif ( ! current_user_can( 'activate_plugins' ) ) {\n\texit;\n}\n"
},
{
"path": "whitelist-html/README.md",
"chars": 6334,
"preview": "# Whitelist HTML\n\nIntroduces an `esc_*()`-like function for when you need to allow *some* HTML.\n\n## Rationale\n### Backgr"
},
{
"path": "whitelist-html/whitelist-html.php",
"chars": 3763,
"preview": "<?php\n\n/**\n * Escapes text for HTML output, allowing certain tags\n *\n * Takes an arbitrary string and ensures it's safe "
}
]
// ... and 22 more files (download for full content)
About this extraction
This page contains the full source code of the humanmade/backupwordpress GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 164 files (1.1 MB), approximately 318.5k tokens, and a symbol index with 687 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.