Pete (a11n)
Forum Replies Created
-
Forum: Plugins
In reply to: [Jetpack Boost - Website Speed, Performance and Critical CSS] CSSHappy to hear that!
Feel free to reach out again if anything isn’t working correctly. As for this thread, I’m marking it as resolved.
Hello there @susanna961
Thanks for the info.
I can see that the last time you generated critical css was on Monday and it was successful.
Successfully generating Critical CSS should clear the diagnostics. Updating a page, post, enabling/disabling a plugin or switching a theme could cause it to show that Critical CSS is outdated.
Could you try generating again and then without any other interactions with the site, go check on the WP diagnostic? It should be cleared up.
Hello there @wowlayers!
Thank you for the code example and information about your setup.
I think you’re on the right track and you’re using the right filter! Is it possible that you’re adding it to your theme?
If so that wouldn’t work, because if WordPress serves a cached file, it stops executing code that would normally execute on a non-cached request. In this case, any PHP code you add to the theme (or the theme’s PHP code) wouldn’t get executed.
Thankfully, WP Super Cache allows for a workaround.
First, you’ll need to modify your snippet a bit. Change this line:
add_filter('wp_cache_served_cache_file', 'modify_served_cache_file', 10, 1);
to this:
add_cacheaction('wp_cache_served_cache_file', 'modify_served_cache_file' );
This will tell WP Super Cache to run your code.
After that, create a new .php file inside
wp-content/plugins/wp-super-cache/plugins/
, and add the updated code to it.This will allow WordPress to execute your code and do the replacements!
Fingers crossed this works.
If it doesn’t, leave a comment so we can continue investigating.
Cheers!
- This reply was modified 1 month, 3 weeks ago by Pete (a11n). Reason: clarify file creation
Hey @nicklee0309!
The problem has been addressed here. We should be shipping out a Boost release that includes this in the upcoming week or two.
Forum: Plugins
In reply to: [WP Super Cache] Different operating systemsFor reference, the guidelines state:
Posting or accepting offers or requests for login information to a site. While plugin and theme authors may ask for this on their own support systems, they may not do so on www.remarpro.com for liability reasons.
So I did do bad. My bad.
- This reply was modified 3 months, 3 weeks ago by Pete (a11n). Reason: wrong paragraph
Forum: Plugins
In reply to: [WP Super Cache] Different operating systemsHey @sterndata!
The way I asked for the credentials is a standard procedure for the way we offer support at Automattic. I’m not sure anything “bad” was done in the way I asked.
Please correct me if I’m wrong.
Forum: Plugins
In reply to: [WP Super Cache] Different operating systemsHey!
The code you’ve provided in the screenshot should work! Though I see the button is in the top of the page – how are you adding it there? You should just be echoing your equivalent of
DYNAMIC_CACHE_BUTTON_TAG
that’s defined in the plugins directory of your WP Super Cache. As long as your code can find the string on the page, it should replace it with what’s necessary.Can you give me a screenshot of the settings above the advanced section? A note – you shouldn’t need late init for this to work.
I tested this locally with the following script and the page gets cached, and the button text updates on each refresh (It’s in a separate file in
wp-content/plugins/wp-super-cache/plugins/dynamic-button.php
:<?php
define( 'DYNAMIC_CACHE_BUTTON_TAG', '<span>OS BUTTON VERIFICATION</span>' );
if ( '' !== DYNAMIC_CACHE_BUTTON_TAG ) {
function dynamic_cache_button_tag_safety( $safety ) {
return 1;
}
add_cacheaction( 'wpsc_cachedata_safety', 'dynamic_cache_button_tag_safety' );
function dynamic_cache_button_tag_filter( $cachedata ) {
$button = '<button>Time now is ' . date( 'H:i:s' ) . '</button>';
return str_replace( DYNAMIC_CACHE_BUTTON_TAG, $button, $cachedata );
}
add_cacheaction( 'wpsc_cachedata', 'dynamic_cache_button_tag_filter' );
function dynamic_cache_button_tag_template_tag() {
echo DYNAMIC_CACHE_BUTTON_TAG; // This is the template tag.
}
function dynamic_cache_button_tag_init() {
add_action( 'wp_footer', 'dynamic_cache_button_tag_template_tag' );
}
add_cacheaction( 'add_cacheaction', 'dynamic_cache_button_tag_init' );
}https://share.cleanshot.com/yz8JX472
https://share.cleanshot.com/g9qmCKjV
These are the settings I used – https://share.cleanshot.com/vGmCRMwZ
- This reply was modified 3 months, 3 weeks ago by Pete (a11n). Reason: clarify super cache plugin's plugin
- This reply was modified 3 months, 3 weeks ago by Pete (a11n). Reason: add screenshots
Forum: Plugins
In reply to: [WP Super Cache] Different operating systemsHey!
WP Super Cache has a feature called “dynamic caching”. You can find it under the “Advanced” section in the “Advanced” tab.
So I imagine you could look into that to make the button a dynamic fragment. That should exclude it from the cache and show the correct button to people loading the page (depending on their OS).
Great! I’m happy to hear that.
Feel free to follow up for anything else.
- This reply was modified 4 months, 1 week ago by Pete (a11n).
Hello there!
Thank you so much for providing the site URL.
I was able to look into the issue and I think I might have pinpointed the problem.
The page that is timing out has an amazon ad (here’s a partial link – https://ir-na.amazon-adsystem.com/e/ir?t=gutternaut-20) that keeps loading and times out after ~90 seconds. You can try to open it for yourself to see that it doesn’t load (make sure you open it in a browser without an ad blocker). It’s probably why the critical css generation fails. I checked some other pages, but none of them have this problem.
If possible, could you try disabling the amazon related ad script on your site and see if generation works? If you can’t get it to work, I would advise you remove the script as it’s broken.
Have a great day!
Hey @nazar78 just jumping in to mention that we released Jetpack Boost 3.4.4 today. Could you try updating to that version to see if the site is still slow?
- This reply was modified 5 months, 1 week ago by Pete (a11n).
@defoi hey! Thanks for the follow up.
Happy to hear that!
And thanks again for the report, I really appreciate it.
Quick update – we have identified the cause for this. A release with the fix is coming.
Thanks for the reply @defoi
Could perhaps share your website URL as well? You can use the link I provided in my previous reply if you wish for it to remain private.
Cheers!