HEX
Server: Apache/2
System: Linux s01 6.1.0-34-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.135-1 (2025-04-25) x86_64
User: beestg (1003)
PHP: 8.3.25
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/beestg/public_html/wp-content/themes/Divi/includes/builder/plugin-compat/wp-rocket.php
<?php // phpcs:ignore WordPress.Files.FileName -- We don't follow WP filename format.
if ( ! defined( 'ABSPATH' ) ) {
	// Exit if accessed directly.
	exit;
}

/**
 * ET_Builder_Plugin_Compat_WP_Rocket class file.
 *
 * @class   ET_Builder_Plugin_Compat_WP_Rocket
 * @package Divi
 * @subpackage Builder
 * @since 4.14.5
 * @link https://wp-rocket.me/
 */
class ET_Builder_Plugin_Compat_WP_Rocket extends ET_Builder_Plugin_Compat_Base {
	/**
	 * Constructor.
	 *
	 * @since 4.14.5
	 */
	public function __construct() {
		$this->plugin_id = 'wp-rocket/wp-rocket.php';
		$this->init_hooks();
	}

	/**
	 * Hook methods to WordPress.
	 *
	 * @since 4.14.5
	 *
	 * @return void
	 */
	public function init_hooks() {
		// Bail if there's no version found.
		if ( ! $this->get_plugin_version() ) {
			return;
		}

		add_filter( 'rocket_rucss_safelist', array( $this, 'et_rocket_css_safelist' ), 10, 1 );
	}

	/**
	 * CSS safelist to exclude from WP Rocket's 'Unused CSS' option.
	 * The array may contain CSS filenames, IDs or classes.
	 *
	 * @since 4.14.5
	 *
	 * @param array[] $css_safelist list of CSS filenames, IDs or classes.
	 *
	 * @return array[]
	 */
	public function et_rocket_css_safelist( $css_safelist ) {
		$et_css_safelist = array(
			'.et_pb_blog_grid',
		);

		return array_merge( $css_safelist, $et_css_safelist );
	}
}

new ET_Builder_Plugin_Compat_WP_Rocket();