Skip to content

Commit

Permalink
Pro release 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Honemo committed Jun 19, 2024
1 parent b9e9e84 commit fc0d8da
Show file tree
Hide file tree
Showing 97 changed files with 3,829 additions and 2,850 deletions.
1 change: 1 addition & 0 deletions assets/js/backup-downloader.min.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/js/notice.min.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 25 additions & 20 deletions backwpup.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/*
* Plugin Name: BackWPup
* Plugin URI: http://backwpup.com
* Plugin URI: https://backwpup.com/
* Description: WordPress Backup Plugin
* Author: WP MEDIA SAS
* Author URI: https://wp-media.me/
* Version: 4.1.0
* Author: BackWPup – WordPress Backup & Restore Plugin
* Author URI: https://backwpup.com
* Version: 4.1.1
* Requires at least: 3.9
* Requires PHP: 7.2
* Text Domain: backwpup
Expand Down Expand Up @@ -75,6 +75,9 @@ private function __construct()
'slug' => 'backwpup',
];

// Register the third party services.
BackWPup_ThirdParties::register();

// Load pro features
if (self::$is_pro) {
$license = new License(
Expand Down Expand Up @@ -164,8 +167,8 @@ private function __construct()
// Work with wp-cli
if (defined(\WP_CLI::class) && WP_CLI && method_exists(\WP_CLI::class, 'add_command')) {
WP_CLI::add_command('backwpup', \BackWPup_WP_CLI::class);
}
}
}
}

/**
* @return self
Expand Down Expand Up @@ -224,20 +227,22 @@ public static function get_plugin_data($name = null)
'version' => 'Version',
],
'plugin'
);
self::$plugin_data['name'] = trim(self::$plugin_data['name']);
//set some extra vars
self::$plugin_data['basename'] = plugin_basename(__DIR__);
self::$plugin_data['mainfile'] = __FILE__;
self::$plugin_data['plugindir'] = untrailingslashit(__DIR__);
self::$plugin_data['hash'] = get_site_option('backwpup_cfg_hash');
if (empty(self::$plugin_data['hash']) || strlen(self::$plugin_data['hash']) < 6
|| strlen(
self::$plugin_data['hash']
) > 12) {
self::$plugin_data['hash'] = self::get_generated_hash(6);
update_site_option('backwpup_cfg_hash', self::$plugin_data['hash']);
}
);
self::$plugin_data['name'] = trim( self::$plugin_data['name'] );
// set some extra vars.
self::$plugin_data['basename'] = plugin_basename( __DIR__ );
self::$plugin_data['mainfile'] = __FILE__;
self::$plugin_data['plugindir'] = untrailingslashit( __DIR__ );
self::$plugin_data['pluginincdir'] = untrailingslashit( self::$plugin_data['plugindir'] . '/inc' );
self::$plugin_data['plugin3rdpartydir'] = untrailingslashit( self::$plugin_data['pluginincdir'] . '/ThirdParty' );
self::$plugin_data['hash'] = get_site_option( 'backwpup_cfg_hash' );
if ( empty( self::$plugin_data['hash'] ) || strlen( self::$plugin_data['hash'] ) < 6
|| strlen(
self::$plugin_data['hash']
) > 12 ) {
self::$plugin_data['hash'] = self::get_generated_hash( 6 );
update_site_option( 'backwpup_cfg_hash', self::$plugin_data['hash'] );
}
if (defined('WP_TEMP_DIR') && is_dir(WP_TEMP_DIR)) {
self::$plugin_data['temp'] = str_replace(
'\\',
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
== Changelog ==
= 4.1.1 =
Release date: Jun 18, 2024

* Changed: AutoExclude the cache plugin folders from the backup
* Fixed: Problems with the sql dump of the database
* Fixed: Update phpseclib library to fix issues in Windows environment.

= 4.1.0 =
Release date: Jun 4, 2024

Expand Down
65 changes: 65 additions & 0 deletions inc/ThirdParty/Autoptimize.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace BackWPup\ThirdParty;

class Autoptimize implements ThirdPartyInterface {

/**
* {@inheritdoc}
*
* @param array $excluded_folders
*
* @return mixed
*/
public function exclude_folders( $excluded_folders ) {
if (
! is_array( $excluded_folders ) ||
! self::is_active() ||
in_array( AUTOPTIMIZE_PLUGIN_DIR, $excluded_folders, true )
) {
return $excluded_folders;
}
$excluded_folders[] = AUTOPTIMIZE_PLUGIN_DIR;
return $excluded_folders;
}

/**
* {@inheritdoc}
*
* @param array $excluded_cache_folders
*
* @return mixed
*/
public function exclude_cache_folders( $excluded_cache_folders ) {
if (
! is_array( $excluded_cache_folders ) ||
! self::is_active() ||
in_array( AUTOPTIMIZE_CACHE_DIR, $excluded_cache_folders, true )
) {
return $excluded_cache_folders;
}
$excluded_cache_folders[] = AUTOPTIMIZE_CACHE_DIR;
return $excluded_cache_folders;
}

/**
* {@inheritdoc}.
*
* @return bool
*/
public static function is_active(): bool {
return defined( 'AUTOPTIMIZE_PLUGIN_VERSION' );
}

/**
* {@inheritdoc}
*
* @return void
*/
public function init(): void {
if ( self::is_active() ) {
add_filter( 'backwpup_exclusion_plugins_folders', [ $this, 'exclude_folders' ] );
add_filter( 'backwpup_exclusion_plugins_cache_folders', [ $this, 'exclude_cache_folders' ] );
}
}
}
72 changes: 72 additions & 0 deletions inc/ThirdParty/Breeze.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace BackWPup\ThirdParty;

class Breeze implements ThirdPartyInterface {
/**
* {@inheritdoc}
*
* @param array $excluded_folders
*
* @return mixed
*/
public function exclude_folders( $excluded_folders ) {
if (
! is_array( $excluded_folders ) ||
! self::is_active()
) {
return $excluded_folders;
}
if ( ! in_array( BREEZE_PLUGIN_DIR, $excluded_folders, true ) ) {
$excluded_folders[] = BREEZE_PLUGIN_DIR;
}
if ( ! in_array( WP_CONTENT_DIR . '/breeze-config', $excluded_folders, true ) ) {
$excluded_folders[] = WP_CONTENT_DIR . '/breeze-config';
}
return $excluded_folders;
}

/**
* {@inheritdoc}
*
* @param array $excluded_cache_folders
*
* @return mixed
*/
public function exclude_cache_folders( $excluded_cache_folders ) {
if (
! is_array( $excluded_cache_folders ) ||
! self::is_active()
) {
return $excluded_cache_folders;
}
if ( ! in_array( BREEZE_MINIFICATION_CACHE, $excluded_cache_folders, true ) ) {
$excluded_cache_folders[] = BREEZE_MINIFICATION_CACHE;
}
if ( ! in_array( BREEZE_MINIFICATION_EXTRA, $excluded_cache_folders, true ) ) {
$excluded_cache_folders[] = BREEZE_MINIFICATION_EXTRA;
}
return $excluded_cache_folders;
}

/**
* {@inheritdoc}.
*
* @return bool
*/
public static function is_active(): bool {
return defined( 'BREEZE_VERSION' );
}

/**
* {@inheritdoc}
*
* @return void
*/
public function init(): void {
if ( self::is_active() ) {
add_filter( 'backwpup_exclusion_plugins_folders', [ $this, 'exclude_folders' ] );
add_filter( 'backwpup_exclusion_plugins_cache_folders', [ $this, 'exclude_cache_folders' ] );
}
}
}
77 changes: 77 additions & 0 deletions inc/ThirdParty/HummingbirdPerformance.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

namespace BackWPup\ThirdParty;

class HummingbirdPerformance implements ThirdPartyInterface {

/**
* {@inheritdoc}
*
* @param array $excluded_folders
*
* @return mixed
*/
public function exclude_folders( $excluded_folders ) {
if (
! is_array( $excluded_folders ) ||
! self::is_active() ||
in_array( WPHB_DIR_PATH, $excluded_folders, true )
) {
return $excluded_folders;
}
$humming_bird_filesystem = \Hummingbird\Core\Filesystem::instance();
if ( ! in_array( $humming_bird_filesystem->basedir, $excluded_folders, true ) ) {
$excluded_folders[] = $humming_bird_filesystem->basedir;
}
if ( ! in_array( WPHB_DIR_PATH, $excluded_folders, true ) ) {
$excluded_folders[] = WPHB_DIR_PATH;
}
return $excluded_folders;
}

/**
* {@inheritdoc}
*
* @param array $excluded_cache_folders
*
* @return mixed
*/
public function exclude_cache_folders( $excluded_cache_folders ) {
if (
! is_array( $excluded_cache_folders ) ||
! self::is_active()
) {
return $excluded_cache_folders;
}
$humming_bird_filesystem = \Hummingbird\Core\Filesystem::instance();
if ( ! in_array( $humming_bird_filesystem->cache_dir, $excluded_cache_folders, true ) ) {
$excluded_cache_folders[] = $humming_bird_filesystem->cache_dir;
}
if ( ! in_array( $humming_bird_filesystem->gravatar_dir, $excluded_cache_folders, true ) ) {
$excluded_cache_folders[] = $humming_bird_filesystem->gravatar_dir;
}

return $excluded_cache_folders;
}

/**
* {@inheritdoc}.
*
* @return bool
*/
public static function is_active(): bool {
return defined( 'WPHB_VERSION' );
}

/**
* {@inheritdoc}
*
* @return void
*/
public function init(): void {
if ( self::is_active() ) {
add_filter( 'backwpup_exclusion_plugins_folders', [ $this, 'exclude_folders' ] );
add_filter( 'backwpup_exclusion_plugins_cache_folders', [ $this, 'exclude_cache_folders' ] );
}
}
}
67 changes: 67 additions & 0 deletions inc/ThirdParty/SGCachepress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

namespace BackWPup\ThirdParty;

class SGCachepress implements ThirdPartyInterface {

/**
* {@inheritdoc}
*
* @param array $excluded_folders
*
* @return mixed
*/
public function exclude_folders( $excluded_folders ) {
if (
! is_array( $excluded_folders ) ||
! self::is_active() ||
in_array( \SiteGround_Optimizer\DIR, $excluded_folders, true )
) {
return $excluded_folders;
}
$excluded_folders[] = \SiteGround_Optimizer\DIR;
return $excluded_folders;
}

/**
* {@inheritdoc}
*
* @param array $excluded_cache_folders
*
* @return mixed
*/
public function exclude_cache_folders( $excluded_cache_folders ) {
if (
! is_array( $excluded_cache_folders ) ||
! self::is_active()
) {
return $excluded_cache_folders;
}
$file_cacher = new \SiteGround_Optimizer\File_Cacher\File_Cacher();
if ( ! in_array( $file_cacher->get_cache_dir(), $excluded_cache_folders, true ) ) {
$excluded_cache_folders[] = $file_cacher->get_cache_dir();
}
return $excluded_cache_folders;
}

/**
* {@inheritdoc}.
*
* @return bool
*/
public static function is_active(): bool {
return defined( 'SiteGround_Optimizer\VERSION' );
}

/**
* {@inheritdoc}
*
* @return void
*/
public function init(): void {
if ( self::is_active() ) {
add_filter( 'backwpup_exclusion_plugins_folders', [ $this, 'exclude_folders' ] );
add_filter( 'backwpup_exclusion_plugins_cache_folders', [ $this, 'exclude_cache_folders' ] );
}
}
}
Loading

0 comments on commit fc0d8da

Please sign in to comment.