HEX
Server: Apache/2.4.65 (Debian)
System: Linux wordpress-7cb4c6b6f6-qgbk2 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: www-data (33)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/webp-express/lib/dismissable-messages/0.23.0/elementor.php
<?php

namespace WebPExpress;

$elementorActivated = in_array('elementor/elementor.php', get_option('active_plugins', []));
$showMessage = false;
if ($elementorActivated) {
    try {
        // The following is wrapped in a try statement because it depends on Elementor classes which might be subject to change
        if (\Elementor\Plugin::$instance->experiments->is_feature_active( 'e_optimized_css_loading' ) === false) {
            $showMessage = true;
        }
    } catch (\Exception $e) {
        // Well, just bad luck.
    }
}

if ($showMessage) {
    DismissableMessages::printDismissableMessage(
        'info',
        '<p>' .
            'You see this message because you using Elementor, you rely solely on Alter HTML for webp, and Elementor is currently set up to use external css. ' .
            'You might want to reconfigure Elementor so it inlines the CSS. This will allow Alter HTML to replace the image urls of backgrounds. ' .
            'To reconfigure, go to <i>Elementor > Settings > Experiments</i> and activate "Improved CSS Loading". ' .
            'Note: This requires that Alter HTML is configured to "Replace image URLs". ' .
            'For more information, <a target="_blank" href="https://wordpress.org/support/topic/background-images-not-working-as-webp-elementor/#post-15060686">' .
            'head over here</a>' .
        '</p>',
        '0.23.0/elementor',
        'Got it!'
    );
} else {
    DismissableMessages::dismissMessage('0.23.0/elementor');
}