/home/techb158/on-time-movers.com/wp-content/themes/Divi/includes/builder
Edit: /home/techb158/on-time-movers.com/wp-content/themes/Divi/includes/builder/conditions.php (6164B)
array_get( $_POST, 'action' );
}
$data_actions = array(
'et_fb_retrieve_builder_data',
'et_fb_update_builder_assets',
'et_pb_process_computed_property',
);
return isset( $_POST['action'] ) && in_array( $_POST['action'], $data_actions, true );
// phpcs:enable
}
endif;
if ( ! function_exists( 'et_builder_should_load_all_data' ) ) :
/**
* Determine whether to load full builder data.
*
* @return bool
*/
function et_builder_should_load_all_data() {
$needs_cached_definitions = et_core_is_fb_enabled() && ! et_fb_dynamic_asset_exists( 'definitions' );
return $needs_cached_definitions || ( ET_Builder_Element::is_saving_cache() || et_builder_is_loading_data() );
}
endif;
if ( ! function_exists( 'et_builder_should_load_all_module_data' ) ) :
/**
* Determine whether to load all module data.
*
* @return bool
*/
function et_builder_should_load_all_module_data() {
if ( ! et_builder_is_frontend() ) {
// Always load everything when not a frontend request.
return true;
}
$needs_cached_definitions = et_core_is_fb_enabled();
$et_dynamic_module_framework = et_builder_dynamic_module_framework();
$result = $needs_cached_definitions || ( ET_Builder_Element::is_saving_cache() || et_builder_is_loading_data() ) || 'on' !== $et_dynamic_module_framework;
/**
* Whether to load all module data,
* including all module classes, on a given page load.
*
* @since 4.10.0
*
* @param bool $result Whether to load all module data.
*/
return apply_filters( 'et_builder_should_load_all_module_data', $result );
}
endif;
if ( ! function_exists( 'et_builder_dynamic_module_framework' ) ) :
/**
* Determine whether module framework is on.
*
* @return string
*/
function et_builder_dynamic_module_framework() {
global $shortname;
if ( et_is_builder_plugin_active() ) {
$options = get_option( 'et_pb_builder_options', array() );
$et_dynamic_module_framework = isset( $options['performance_main_dynamic_module_framework'] ) ? $options['performance_main_dynamic_module_framework'] : 'on';
} else {
$et_dynamic_module_framework = et_get_option( $shortname . '_dynamic_module_framework', 'on' );
}
return $et_dynamic_module_framework;
}
endif;
if ( ! function_exists( 'et_builder_is_mod_pagespeed_enabled' ) ) :
/**
* Determine whether Mod PageSpeed is enabled.
*
* @return bool
*/
function et_builder_is_mod_pagespeed_enabled() {
static $enabled;
if ( isset( $enabled ) ) {
// Use the cached value.
return $enabled;
}
$key = 'et_check_mod_pagespeed';
$version = get_transient( $key );
if ( false === $version ) {
// Mod PageSpeed is an output filter, hence it can't be detected from within the request.
// To figure out whether it is active or not:
// 1. Use `wp_remote_get` to make another request.
// 2. Retrieve PageSpeed version from response headers (if set).
// 3. Save the value in a transient for 24h.
// The `et_check_mod_pagespeed` url parameter is also added to the request so
// we can exit early (content is irrelevant, only headers matter).
$args = [
$key => 'on',
];
// phpcs:disable WordPress.Security.NonceVerification -- Only checking arg is set.
if ( isset( $_REQUEST['PageSpeed'] ) ) {
// This isn't really needed but it's harmless and makes testing a lot easier.
$args['PageSpeed'] = sanitize_text_field( $_REQUEST['PageSpeed'] );
}
// phpcs:enable
$request = wp_remote_get( add_query_arg( $args, get_home_url() ) );
// Apache header.
$version = wp_remote_retrieve_header( $request, 'x-mod-pagespeed' );
if ( empty( $version ) ) {
// Nginx header.
$version = wp_remote_retrieve_header( $request, 'x-page-speed' );
}
set_transient( $key, $version, DAY_IN_SECONDS );
}
// Cache the value.
$enabled = ! empty( $version );
return $enabled;
}
endif;