mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix SiteGround Optimizer plugin compatibility
This commit is contained in:
parent
ceb6391b2b
commit
e678a2c020
2 changed files with 29 additions and 0 deletions
|
@ -38,4 +38,16 @@ return array(
|
|||
return new PPEC\SettingsImporter( $settings );
|
||||
},
|
||||
|
||||
'compat.plugin-script-names' => static function( $container ) : array {
|
||||
return array(
|
||||
'ppcp-smart-button',
|
||||
'ppcp-oxxo',
|
||||
'ppcp-pay-upon-invoice',
|
||||
'ppcp-vaulting-myaccount-payments',
|
||||
'ppcp-gateway-settings',
|
||||
'ppcp-webhooks-status-page',
|
||||
'ppcp-tracking',
|
||||
);
|
||||
},
|
||||
|
||||
);
|
||||
|
|
|
@ -39,6 +39,7 @@ class CompatModule implements ModuleInterface {
|
|||
*/
|
||||
public function run( ContainerInterface $c ): void {
|
||||
$this->initialize_ppec_compat_layer( $c );
|
||||
$this->fix_site_ground_optimizer_compatibility( $c );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,4 +77,20 @@ class CompatModule implements ModuleInterface {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixes the compatibility issue for <a href="https://wordpress.org/plugins/sg-cachepress/">SiteGround Optimizer plugin</a>.
|
||||
*
|
||||
* @link https://wordpress.org/plugins/sg-cachepress/
|
||||
*
|
||||
* @param ContainerInterface $c The Container.
|
||||
*/
|
||||
protected function fix_site_ground_optimizer_compatibility( ContainerInterface $c ): void {
|
||||
$ppcp_script_names = $c->get( 'compat.plugin-script-names' );
|
||||
add_filter(
|
||||
'sgo_js_minify_exclude',
|
||||
function ( array $scripts ) use ( $ppcp_script_names ) {
|
||||
return array_merge( $scripts, $ppcp_script_names );
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue