Comments (3)
Reproduce the issue
Yes I can reproduce it by having the following snippet:
add_filter( 'the_posts', function( $posts ) {
ob_start();
echo 'wordpressfan';
$final = ob_get_clean();
return $posts;
} );
Root cause
With this PR: #6218 we created a new function rocket_url_to_postid
to get the post ID from url to be able to detect the private urls to be excluded from preload.
We use WP_Query class there to get that post ID, and we have a case that inside our buffer with the hook rocket_after_process_buffer
we use this function to check preload exclusions and this fatal error happens because inside the main buffer we are using another buffer.
Provided solution
As mentioned in the issue, we can suppress filters inside this function when using WP_Query class or at least add a new filter to filter the args being passed to WP_Query here:
wp-rocket/inc/functions/posts.php
Line 243 in 87aead4
so without affecting any other user we can provide a helper to suppress filters there.
Estimation
[XS]
What do u think @wp-media/php-team ?
from wp-rocket.
Seems okay to me
from wp-rocket.
For testing we need to:
- Validate the problem here with the mentioned snippet is fixed
- rerun this for regression https://wpmediaqa.testrail.io/index.php?/runs/view/779&group_by=cases:section_id&group_order=asc
from wp-rocket.
Related Issues (20)
- Beacon is picking `mp4` as an LCP element in `video`
- As a OCI user, I want control over the accuracy/quick triggering trade-off of the beacon so that I can reduce wrong detection on pages with large images or users with slow internet connections HOT 1
- FetchPriority should ignore inline images (e.g. encoded SVgs) HOT 1
- Largest element with a background-image that is not kept (such as linear-gradient) makes the OCI optimization have no LCP HOT 2
- Truncate OCI table on update to 3.16.1
- 404 file mini file CSS & JS (When using Nginx Cache + Wp Rocket)
- Not compatible with Complianz Premium plugin (Cookie consent) HOT 1
- Not compatible with PHP 8.1
- PHP Warning: Undefined array key "returnvalue"
- Clear Used CSS button in Divi notice does not work
- Rebrand `Remove Unused CSS` to `Reduce Unused CSS` to reflect what the feature does HOT 1
- Wrong CSS/JS link in subdomain HOT 1
- PHP Fatal error: Uncaught TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, null given in /www/mysite_815/public/wp-content/plugins/wp-rocket/inc/Engine/Optimization/RegexTrait.php:151 HOT 1
- Adjust lcp-beacon.min.js timeout to be relative to `rocket_lcp_data.delay`
- Preconnect One.com CDN domain when their CDN is enabled
- Uncaught TypeError JobProcessor::send_api()
- As a user, I want the homepage preloaded with accurate OCI data upon fresh activation. HOT 1
- Conflict with Yoast SEO and ATF feature
- On fresh installs, OCI warm-up for not-homepages might be missing mobile requests if the task is triggered before options are set
- Increase PHPStan level to 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wp-rocket.