/home/techb158/balacoffee.com/wp-content/themes/Divi/includes/builder/plugin-compat
NameSizeModeActions
scripts/-0755rm
styles/-0755rm
advanced-custom-fields-pro.php1680644editdlrm
advanced-custom-fields.php93690644editdlrm
amazon-s3-and-cloudfront-pro.php10350644editdlrm
amazon-s3-and-cloudfront.php31930644editdlrm
autoptimize.php11330644editdlrm
caldera-forms.php12650644editdlrm
cartflows.php19220644editdlrm
cdn-enabler.php14720644editdlrm
coursepress.php10940644editdlrm
divi-filterable-blog-module.php10610644editdlrm
divi-module-code-snippet.php15880644editdlrm
divi-testimonial-slider.php13030644editdlrm
divi_layout_injector.php30930644editdlrm
divi_woo_layout_injector.php14020644editdlrm
dk-pdf.php19410644editdlrm
ds-divi-rocket.php10810644editdlrm
easy-digital-downloads.php45220644editdlrm
eventon.php32690644editdlrm
events-manager.php15620644editdlrm
final-tiles-grid-gallery-lite.php14620644editdlrm
gravityforms.php7320644editdlrm
gravityformssignature.php17070644editdlrm
ht-knowledge-base.php16800644editdlrm
imagify.php32120644editdlrm
insert-pages.php14500644editdlrm
jucra-acf-google-maps-for-divi.php12960644editdlrm
kvcore-idx.php9150644editdlrm
landing-pages.php10170644editdlrm
m-chart.php13100644editdlrm
mappress-google-maps-for-wordpress.php17440644editdlrm
megamenu.php16400644editdlrm
modern-events-calendar-lite.php11860644editdlrm
nex-forms-express-wp-form-builder.php13500644editdlrm
paid-memberships-pro.php13880644editdlrm
photo-gallery.php14040644editdlrm
pilotpress.php15810644editdlrm
popup-maker.php55440644editdlrm
relevanssi-premium.php2470644editdlrm
relevanssi.php18950644editdlrm
sellsy.php10870644editdlrm
seo-by-rank-math.php18360644editdlrm
sfwd-lms.php46160644editdlrm
sg-cachepress.php26680644editdlrm
siteorigin-panels.php14660644editdlrm
sitepress-multilingual-cms.php97470644editdlrm
table-of-contents-plus.php10440644editdlrm
the-events-calendar-community-events.php13520644editdlrm
the-events-calendar.php75480644editdlrm
toolbar-publish-button.php10390644editdlrm
woo-paypalplus.php13480644editdlrm
woocommerce.php111200644editdlrm
wordpress-mu-domain-mapping.php15710644editdlrm
wordpress-seo.php25490644editdlrm
wp-job-manager.php19300644editdlrm
wp-responsive-table.php12180644editdlrm
wp-rocket.php13750644editdlrm
wp-smush-pro.php1560644editdlrm
wp-smushit.php54730644editdlrm
wp-views.php32980644editdlrm
wp3d-models.php11060644editdlrm
wpml-sticky-links.php14320644editdlrm
yith-woocommerce-dynamic-pricing-and-discounts-premium.php21020644editdlrm
Edit: /home/techb158/balacoffee.com/wp-content/themes/Divi/includes/builder/plugin-compat/wp-smushit.php (5473B)
plugin_id = $this->_get_plugin_id(); $this->init_hooks(); } /** * Get the currently activated plugin id as the FREE and PRO versions are separate plugins. * * @since 4.0.5 * * @return string */ protected function _get_plugin_id() { if ( ! function_exists( 'is_plugin_active' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $pro = 'wp-smush-pro/wp-smush.php'; $free = 'wp-smushit/wp-smush.php'; return is_plugin_active( $pro ) ? $pro : $free; } /** * Hook methods to WordPress * * Latest plugin version: 1601 * * @return void */ public function init_hooks() { // Bail if there's no version found if ( ! $this->get_plugin_version() ) { return; } $enabled = array( // phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification 'vb' => et_()->array_get( $_GET, 'et_fb' ), 'bfb' => et_()->array_get( $_GET, 'et_bfb' ), 'tb' => et_()->array_get( $_GET, 'et_tb' ), // phpcs:enable ); // Smush 3.16.1+ deprecated wp_smush_should_skip_parse in favor of wp_smush_should_skip_lazy_load. // Use version check to maintain backward compatibility with older Smush versions. $plugin_version = $this->get_plugin_version(); if ( $plugin_version && version_compare( $plugin_version, '3.16.1', '>=' ) ) { add_filter( 'wp_smush_should_skip_lazy_load', array( $this, 'maybe_skip_parse' ), 11 ); } else { add_filter( 'wp_smush_should_skip_parse', array( $this, 'maybe_skip_parse' ), 11 ); } if ( $enabled['vb'] || $enabled['bfb'] || $enabled['tb'] ) { // Plugin's `enqueue` function will cause a PHP notice unless // early exit is forced using the following custom filter add_filter( 'wp_smush_enqueue', '__return_false' ); $class = $this->get_smush_class(); if ( ! empty( $class ) ) { // @phpcs:ignore Generic.PHP.ForbiddenFunctions.Found $mod = call_user_func( array( $class, 'get_instance' ) )->core()->mod; $props = get_object_vars( $mod ); if ( isset( $props['lazy'] ) ) { // In Smush 3.3+, lazy loading enqueues and inlines several // scripts but the instance is public so we can get a // reference and remove the enqueuing action. remove_action( 'wp_enqueue_scripts', array( $props['lazy'], 'enqueue_assets' ) ); } else { // The lazy loading instance is private in Smush 3.2.* so // we dequeue the script it enqueues as those versions // only load a single script. add_action( 'wp_enqueue_scripts', array( $this, 'dequeue_lazy_load' ) ); } } } add_filter( 'et_core_page_resource_get_data', array( $this, 'maybe_get_background_images_cdn' ), 10, 3 ); } /** * Disable Smush page parsing in VB. * * @param boolean $skip * * @return boolean */ public function maybe_skip_parse( $skip ) { if ( et_core_is_fb_enabled() ) { return true; } return $skip; } /** * Get the base Smush class name. * * @since 4.0.3 * * @return string */ public function get_smush_class() { $classes = array( 'WP_Smush', // @since 3.3.0 'Smush\\WP_Smush', ); foreach ( $classes as $test ) { if ( class_exists( $test ) ) { return $test; } } return ''; } /** * Dequeue Smush lazy load in builder. * * @since 4.0.10 */ public function dequeue_lazy_load() { if ( wp_script_is( 'smush-lazy-load', 'enqueued' ) ) { wp_dequeue_script( 'smush-lazy-load' ); } } /** * Maybe convert background images local URL inside the styles into CDN before it's * saved as static resource. * * @since 4.4.9 * * @param array $data_resource * @param string $context * @param ET_Core_PageResource $page_resource * * @return string */ public function maybe_get_background_images_cdn( $data_resource, $context, $page_resource ) { // Bail early if the context is not 'file' or the data resource is empty or resource // is not unified (single post & builder is being used). if ( 'file' !== $context || empty( $data_resource ) || ! strpos( $page_resource->slug, 'unified' ) ) { return $data_resource; } if ( ! class_exists( '\Smush\Core\Settings' ) || ! class_exists( '\Smush\Core\Modules\Helpers\Parser' ) ) { return $data_resource; } $smush_settings = Smush\Core\Settings::get_instance(); $cdn = $smush_settings->get( 'cdn' ); $background_images = $smush_settings->get( 'background_images' ); // Both of CDN and Background Images modules should be activated. if ( ! $cdn || ! $background_images ) { return $data_resource; } $new_data_resource = $data_resource; $smush_parser = new Smush\Core\Modules\Helpers\Parser(); $smush_parser->enable( 'cdn' ); $smush_parser->enable( 'background_images' ); // Converting background images local URL into CDN. foreach ( $data_resource as $priority => $data_part ) { $new_data_part = array(); foreach ( $data_part as $data ) { $new_data_part[] = $smush_parser->parse_page( $data ); } $new_data_resource[ $priority ] = $new_data_part; } return $new_data_resource; } } new ET_Builder_Plugin_Compat_Smush();