Hi,
I enabled rewrite for file optimizer on NGINX and I added into Additional nginx directives on Plesk these config:
location /_static/ {
fastcgi_pass unix:/var/run/fastcgi.sock;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/wp-content/plugins/powered-cache/includes/file-optimizer.php;
}
But I get error 404 on file resources…why?
O.S. Debian 12
NGINX v1.26.2
Thanks
]]>Good morning,
when I enable the plugin, ajax requests via WP REST API do not work, because the plugin cuts off the string /wp-json/
in the url.
It should be https://domain.com/wp-json/wp2/
��. instead it is https://domain.com/wp2/
How do I solve this? is there a bug?
Hello, when I use the form field in the wp-discuz plugin, the cache is disabled. I added a lot of cookies to the vary cache field but it didn’t work. For example, some cookies.
comment_author_email_fa8e28675549559f127549b6
comment_author_fa8e28675549559f127549b65b98fe
custom_field_6657284978c92_fa8e28675549559f127549b65b
PHPSESSID
How can I add this plugin to the cache?
]]>Hello,
when I enable Powered Cache the Woo Commerce Cart fragment doens’t refresh quantity products anymore.
Is it possibile to exclude it? Or disable the cache for WC Fragment?
Thanks
Hi,
if I enable Optimize HTML via Dom ParserImproves HTML minification efficiency option I get this PHP error on frontend:
Fatal error: Uncaught TypeError: Cannot assign null to property DOMElement::$id of type string in /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/Dependencies/voku/helper/AbstractSimpleHtmlDom.php:174 Stack trace: #0 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/Dependencies/voku/helper/HtmlMinDomObserverOptimizeAttributes.php(146): PoweredCache\Dependencies\voku\helper\AbstractSimpleHtmlDom->__set() #1 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/Dependencies/voku/helper/HtmlMin.php(1688): PoweredCache\Dependencies\voku\helper\HtmlMinDomObserverOptimizeAttributes->domElementAfterMinification() #2 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/Dependencies/voku/helper/HtmlMin.php(1667): PoweredCache\Dependencies\voku\helper\HtmlMin->notifyObserversAboutDomElementAfterMinification() #3 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/Dependencies/voku/helper/HtmlMin.php(1370): PoweredCache\Dependencies\voku\helper\HtmlMin->minifyHtmlDom() #4 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/FileOptimizer.php(301): PoweredCache\Dependencies\voku\helper\HtmlMin->minify() #5 /var/www/vhosts/stefanofattori.it/httpdocs/wp-content/plugins/powered-cache/includes/classes/FileOptimizer.php(191): PoweredCache\FileOptimizer->maybe_minify_html() #6 [internal function]: PoweredCache\FileOptimizer->process_buffer() #7 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/functions.php(5427): ob_end_flush() #8 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/class-wp-hook.php(324): wp_ob_end_flush_all() #9 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #10 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #11 /var/www/vhosts/stefanofattori.it/httpdocs/wp-includes/load.php(1280): do_action() #12 [internal function]: shutdown_action_hook() #13 {main} thrown in
I use a VPS with plesk, NGINX
Server webnginx/1.26.1
PHP8.3.11 (supporta valori a 64bit)
PHP SAPI fpm-fcgi
Versione di cURL7.88.1 OpenSSL/3.0.14
WordPress 6.6.2
Built-in Extensions: Cloudflare
Cloudflare extension for poweredcache. It allows to purge cloudflare cache within WordPress. How I can validate is this extension its working?
]]>Merhaba Mustafa Bey
Sayfalarda ve yaz?larda ?nbelle?i tamamen devre d??? b?rakabilirmiyiz, okunma say?lar? ve baz? kodlar?n ?al??mas?na engel oluyor. eklenti config.php ye define( ‘WP_CACHE’, true ); komutu ekledi?i i?in buda sayfalarda ve yaz?lara etki ediyor olabilir.
Daha ?nce eklentinizi denedim yukar?da yazd???m nedenlerden dolay? kald?mak zorunda kald?m.
]]>Again, thanks for your great plugin.
When I enable “Minify HTML” in basic settings, it has no effect. HTML is not minified. However, when I enable that setting and “Optimize HTML via Dom Parser – Improves HTML minification efficiency.” then minification works, but the HTML seems a bit off when using the DOM parser.
For instance, the closing </body>
and </html>
tag are removed. I’d prefer the non-DOM parser implementation anyway (at least to compare against).
BTW, whichever minify method is used, could you please append the HTML powered by comment at the end so that it’s possible to tell if Powered Cache’s caching is active on that page. Maybe a more concise one-liner, like the following:
</body></html><!-- Cache served by Powered Cache, Last modified: Fri, 03 May 2024 01:57:08 GMT -->
Testing on Windows dev machine, WordPress 6.5.2, Powered Cache 3.4.4, PHP 8.1.
Thanks.
]]>First, thanks again for your great plugin. I noticed some inconsistencies for post cache purging with comments.
In the admin/editor dashboard, there exist two options to edit comments: “Edit” (full page screen) and “Quick Edit” (AJAX, in-place comment editing).
Making changes on full-page “Edit” comment screen doesn’t purge the post cache in any scenario, whether editing the text, or changing the “status” (approve, disapprove, spam).
But the cache is purged when using the AJAX “Quick Edit” approach.
And there’s another thing I noticed. Paginated comments aren’t purged. For example, let’s say comments were broken into pages:
https://example.com/post/
https://example.com/post/comment-page-2/
https://example.com/post/comment-page-3/
And let’s say I used Quick Edit to approve or disapprove a comment or edit a comment or mark it as spam. Only the first page would get purged, while comment pages 2 and further would be left on disk.
Further, if I cleared a comment that appears on page 3, it would only clear the index page, and leave the “comment-page-3” on disk..
It would seem the easiest fix would be to purge the entire post and all sub-posts whenever a comment is edited or its status changes.
It’s easy to test this by setting the Break comments into pages with [NUMBER] top level comments per page
in the WordPress discussion settings page to one and post a couple of test comments.
Thanks.
]]>I would like to suggest a request regarding clearing the cache.
Would it be possible to automatically clear the cache after updating a plugin?
Thanks again for the excellent plugin. It’s very useful!
]]>Hello Dev(s), hope I am finding you well. Kindly advise if there is a filter to disable the Powered Cache, clear cache prompt when deactivating/activating plugins. Thanks
]]>Hello ,
Thanks for the great plugin.
I run a woo and I use element or plugin + widgets.
Is there a way to exclude dynamic widgets from element or?
For example (grid or carousel) products? that they change randomly every time someone enters the website.
Thank you !
]]>Hello, thanks for supporting a great plugin!
Due to the big problem of the influx of bots, is it possible to create a condition in the plugin?
The cache works for ��good�� bots and disables the cache for visits with an empty referrer.
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$down_reg = mb_strtolower($_SERVER['HTTP_USER_AGENT']);
$down_reg = str_replace(array(' '), '', $down_reg);
$find_bot_step1 = str_replace(array('yandex', 'google', 'pinterest'), ' this_is_bot! ', $down_reg);
$find_bot_step2 = explode(' ', $find_bot_step1);
if (isset($find_bot_step2[1]) == "this_is_bot!") {
return true;
}
Here we catch an empty referrer and disable the cache (!empty($_SERVER["HTTP_REFERER"])) {
It is necessary to send all bots for verification, otherwise it will not work.
]]>Hi
in site health I have this error. Do you have any idea? Many thanks
best
S
“Unable to detect page cache due to possible query loop issue. Please verify that the query loop test passes correctly. Error: Service Unavailable (code: http_503)
Using page caching improves the speed and performance of your site by serving static pages instead of generating each page from scratch each time a user visits.
The page cache is detected by looking for a possible active cache extension on the site, and also by making three requests to the home page and looking for one or more HTTP client caching response headers among the following headers:
cache-control, expires, age, last-modified, etag, x-cache-enabled, x-cache-disabled, x-srcache-store-status, x-srcache-fetch-status.”
]]>Once again, thanks for this great plugin.
Expected behavior: Always save the non-CDN site URL in the database for images (and other files) when updating a post or page.
Current behavior: When the CDN setting is enabled, any change to an image’s size in Gutenberg editor will save the CDN URL in the database (i.e., table: wp_posts, column: post_content) instead of the regular site URL.
Steps to reproduce:
I want to clarify that the CDN URL is getting transparently switched in Gutenberg even before the post is saved.
For instance, if you add an image (which WordPress defaults to “large”) then, switch it to “medium”, and save the page, the post will save with the medium URL pointing to the CDN.
But if you were to add a brand new image, let it default to “large”, the save the post, the CDN hostname would not be saved in the database. Which is the preferred behavior. Even resaving the page keeps the proper original URL intact. The switch only takes place when the size changes in the sidebar.
So this action is taking place before any initial save.
Two problems with this approach:
Thanks.
]]>First, thanks for this great plugin.
When a user visits a post, places a comment, and ticks the “Save my name, email, and website in this browser for the next time I comment.
” checkbox, Powered Cache will store a URL-specific cookie in that user’s browser so that single post is excluded from showing it’s cached version to that commenter.
This is clever, as it still shows cached pages to that person for posts they hadn’t commented on… yet.
But here’s the problem/bug:
Let’s say that user visits another post or page with a comment form. When they do, their author name, email address, and website URL is pulled from the three cookies WordPress core creates after they placed their last comment. For example:
comment_author_url_900150983cd24fb0d6963f7d28e17f72
comment_author_email_900150983cd24fb0d6963f7d28e17f72
comment_author_900150983cd24fb0d6963f7d28e17f72
These values are then inserted into the value
attribute of all comment forms site-wide and Powered Cache is caching it and showing it to all users. This commenter’s credentials are now exposed to all visitors.
I discovered this when testing this plugin on localhost via Edge browser. Left a comment, then visited several other pages.
Then I visited those pages using desktop Chrome, Firefox, and mobile Chrome, and oddly, I noticed the author name, email, and website field for several pages displayed the credentials I entered when I placed the first comment via Edge browser.
That’s when I looked in the “powered-cache” folder and noticed the author name, email, and website hardcoded into the cached pages.
All visitors would see this.
Most other caching plugins will not show cached pages to anyone who’s left a comment. They’ll check for the existence of a cookie that starts with “comment_author_” within the $_COOKIE array then exclude that person from receiving any cached pages. It’s a hammer-like approach, but prevents the sort of leakage detailed here.
I see you’re taking a similar approach within the get_rejected_cookies()
function, but stopping short of excluding comment_author_
matches.
And you’re trying to (admirably) thread the needle, by only blocking the page that person commented on instead of treating them similar to a logged-in user. This is a great performance boost.
But it’s introducing this weird and easy to miss bleed-through effect that’s leaking their details out to everyone.
The workaround using the existing install would be to add “comment_author_” to the list of “Rejected Cookies” within Powered Cache settings. This resolve this issue with the existing codebase (after clearing the cache), but it’s back to the hammer-like approach that most other caching plugins use.
FYI, here’s an example of how the Cache Enabler plugin takes an unforgivable approach to cookie exclusion:
$cookies_regex = '/^(wp-postpass|wordpress_logged_in|comment_author)_/';
Thanks.
]]>First, thanks for this great plugin.
When Powered Cache settings are saved (specifically page cache enabled or disabled), the wp-config.php
file is updated where you add
define( 'WP_CACHE', true ); // Powered Cache
to the top of the file. But all line breaks are removed from the file as well.
For instance, this:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
Becomes this:
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
It doesn’t break anything, but the file is now harder to read.
I’m using nginx, WordPress 6.4.1, Powered Cache 3.3.1, PHP 8.1, on an a localhost test environment.
Thanks.
]]>When installed in subdirectory I get 404 on all minified assets and MIME type issue stylesheets are recognized as text/html.
The htaccess rule when using _static/??/ require to be more dynamic if you changed content folder name via WP_CONTENT_DIR
and WP_CONTENT_URL
. I did test changing it from wp-content/ in the rewrite rule to just content/ to match without success.RewriteRule ^_static/.* wp-content/plugins/powered-cache/includes/file-optimizer.php [L]
RewriteRule ^_static/.* content/plugins/powered-cache/includes/file-optimizer.php [L]
But somehow must be that _static/??/ path does exist but feels it doesn’t exist which is why the MIME rules not working even I added into the htaccess.
Hello, Powered Cache Support Team,
I��m developing a performance improving plugin and have a specific caching requirement.
I need pages and posts not to be cached on first open, after they are created or edited.
I need to examine the page with all the JS and CSS implemented, then edit the HTML before it can be cached. So, the page should be cached on the second visit.
Is there a built-in feature or specific hook in Powered Cache that supports this functionality, and can be controlled through PHP?
I am considering a custom implementation using WordPress hooks. Here’s a brief overview of my approach:
// Function to update a custom field when a post or page is saved
function update_last_modified_meta($post_id) {
update_post_meta($post_id, '_last_modified_time', current_time('mysql'));
}
add_action('save_post', 'update_last_modified_meta');
// Function to control caching based on the last modified time
function custom_per_page_cache_control() {
if (is_single() || is_page()) {
global $post;
$stored_last_modified = get_post_meta($post->ID, '_last_modified_time', true);
if ($post->post_modified !== $stored_last_modified) {
// Send headers to prevent caching
header("Cache-Control: no-cache, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Wed, 11 Jan 1984 05:00:00 GMT");
update_post_meta($post->ID, '_last_modified_time', $post->post_modified);
}
}
}
add_action('template_redirect', 'custom_per_page_cache_control');
Is this approach is compatible with your plugin? Is there a solution specific to your plugin?
Any recommendations or best practices for implementing this would be greatly appreciated.
Thank you,
Jovan
]]>Hi, I’m having issues with lazy load, is converting quotes from additional image attributes to html entities, like this:
<img width="150" height="100" src="https://local.com/app/uploads/140520-150x150.jpg" class="w-full h-full object-cover" alt="Owen Pallett In Conflict" decoding="async" srcset="https://local.com/app/uploads/140520-150x100.jpg 150w, https://local.com/app/uploads/140520-300x199.jpg 300w, https://local.com/app/uploads/140520-620x413.jpg 620w, https://local.com/app/uploads/140520-218x145.jpg 218w, https://local.com/app/uploads/140520-640x426.jpg 640w, https://local.com/app/uploads/140520-320x213.jpg 320w, https://local.com/app/uploads/140520-298x198.jpg 298w, https://local.com/app/uploads/140520-313x209.jpg 313w, https://local.com/app/uploads/140520-191x127.jpg 191w, https://local.com/app/uploads/140520-158x105.jpg 158w, https://local.com/app/uploads/140520-414x276.jpg 414w, https://local.com/app/uploads/140520.jpg 940w" sizes="(max-width: 150px) 100vw, 150px" onerror="this.onerror=null; this.src='https://local.com/app/themes/a-theme/public/images/svg/logo.svg'; this.srcset='https://local.com/app/themes/a-theme/public/images/svg/logo.svg'; this.className='h-9 mx-auto top-[calc(50%-16px)] relative opacity-10';" />
I have been trying to figure out a way to prevent this, but the only way I figure it out that works is by adding html_entity_decode on the file
plugins/powered-cache/includes/classes/LazyLoad.php
At lines 335 and 336
array_push( $search, html_entity_decode( $img_html ) );
array_push( $replace, html_entity_decode( $replace_html ) )
Is there a better workaround for this issue?
]]>Cache being stored for Checkout page.
I’m using the FunnelKit plugin.
Even adding the “Checkout” page to “No cache”
Even disabling the cache on the Checkout page.
Currently, CSS and Java optimization are disabled because of this.
Please help me!
]]>Failed to load resource: the server responded with a status of 400 () … file-optimizer.php
Any guess as to what this is about? Maybe my CDN (bunny.net) doesn’t like this php file?
]]>Thanks for the plugin, very useful and simple.
I’m using the plugin:
https://br.www.ads-software.com/plugins/permalink-manager-for-woocommerce/
��to optimize URLs for products and product categories.
However, cache preload is not created for products, only for categories. Only when you enter the product URL is the cache loaded.
Is there any solution?
]]>Hi sir, I have been using the plugin for long time and everything is cool, but recently I have a problem entering my admin panel.
I use wp hide login and define a new login URL mysite.com/87uajhsd and I add this /87uajhsd in powered cache settings Never cache the pages..
However, it turns out the page is still be cached, I had to delete the cached page to be able to login to my admin panel.
I also downloaded your nginx configuration file and added cache rules in my nginx site configuration file, but the page is still be cached.
Could you please help?
thank you in advance.
mario
]]>The cache clear no works when save changes in a elementor template, requires a manual clear cach��.
]]>Hello,
we are thinking about switching from current caching plugin to your plugin. How does Powered Cache handle requests from Facebook bots?
We currently have issues with caching plugin blocking the Facebook bots and because of that images are not reaching the posts on Facebook page.
Thanks,
Veljko
]]>Hi, awesome cache plugin. However, I need your help lazy loading BG images on Elementor please?
]]>Hello, thanks for the constant work on the plugin!
Deprecated feature appears when enabling Memcache php 8.2.x
]]>View post on imgur.com
]]>
Dear Powered Cache Team
There seems to be an incompatibility between your plugin’s Minify HTML setting and the Retainful plugin’s “Add-To-Cart Email Collection Popup” feature. When Minify HTML is set in Powered Cache and the Retainful popup is activated, then the following code appears at the top of the website:
<
script type="text/template" id="tmpl-unavailable-variation-template">
Sorry, this product is unavailable. Please choose a different combination.
When Minify HTML is turned off, then everything on the website works as expected.
The site is using the Astra theme with WooCommerce.
Thank you in advance for your assistance.
]]>