first commit

This commit is contained in:
Roman Pyrih
2023-07-24 08:30:51 +02:00
commit c2e100a763
7128 changed files with 1622619 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
/**
* Perfmatters plugin: https://perfmatters.io/
*/
class Brizy_Compatibilities_Perfmatters {
public function __construct() {
add_action( 'after_setup_theme', [ $this, 'disablePluginOptions' ] );
}
public function disablePluginOptions() {
if ( ! isset( $_GET[ Brizy_Editor::prefix( '-edit' ) ] ) && ! isset( $_GET[ Brizy_Editor::prefix( '-edit-iframe' ) ] ) ) {
return;
}
add_action( 'option_perfmatters_options', [ $this, 'removeOptions' ] );
}
public function removeOptions( $options ) {
if ( isset( $options['assets']['defer_js'] ) ) {
unset( $options['assets']['defer_js'] );
}
if ( isset( $options['assets']['delay_js'] ) ) {
unset( $options['assets']['delay_js'] );
}
return $options;
}
}