-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
97 changed files
with
3,829 additions
and
2,850 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ] ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ] ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ] ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ] ); | ||
} | ||
} | ||
} |
Oops, something went wrong.