Not compatible with page cache
-
There are some problems if page cache plugins are used:
Inline CSS for browser scrollbar width is hardcoded in output based on current browser user-agent in
inc/dynamic-css/block-editor-compatibility.phpat line 217:// Detect the operating system and set the typical scrollbar width.
$user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
$scrollbar_widths = [
'Win' => '17px',
'Mac' => '15px',
'Linux' => '15px',
];
$scrollbar_width = '0';
foreach ( $scrollbar_widths as $platform => $width ) {
if ( strpos( $user_agent, $platform ) !== false ) {
$scrollbar_width = $width;
break;
}
}
$dynamic_css .= '
:root {
[...some lines removed...]
--ast-scrollbar-width: ' . $scrollbar_width . ';
}A
wp_get_attachment_image_attributesfilter changessrcattribute of header image in output based on current browser user-agent ininc/markup-extras.phpline 2036:if ( astra_check_is_ie() ) {
// Replace header logo url to retina logo url.
$attr['src'] = $retina_logo;
}A
get_custom_logofilter changessrcattribute of header image in output based on current browser user-agent ininc/markup-extras.phpline 290:if ( astra_check_is_ie() ) {
// Replace header logo url to retina logo url.
$attr['src'] = $retina_logo;
}The above used function
astra_check_is_ie()can be foundinc/extras.phpat line 301:/**
* Function to check if it is Internet Explorer.
*
* @return true | false boolean
*/
function astra_check_is_ie() {
$is_ie = false;
if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
$ua = htmlentities( sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ), ENT_QUOTES, 'UTF-8' ); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___SERVER__HTTP_USER_AGENT__ -- Need to check if its ie.
if ( strpos( $ua, 'Trident/7.0' ) !== false ) {
$is_ie = true;
}
}
return apply_filters( 'astra_check_is_ie', $is_ie );
}Astra 4.8.11
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
The topic ‘Not compatible with page cache’ is closed to new replies.
