I hadn’t even thought about Cloudflare being a potential conflict TBH. I’ll have a look into it after the weekend.
Some of those steps I have in place (like excluding the dashboard from cache) but I don’t use the CF plugin as I didn’t see a benefit before. But I can, as part of testing.
Did the Errors Return?
Sadly, yes. I’ll look at this specific URL now, as it’s a particular post type and I can’t afford (traffic-wise) for that content to break.
But this post_type doesn’t include the shortcodes I looked out from other posts. I’ll see what could possibly causing a null in the code now before I break for the weekend.
'PHP message: PHP Fatal error: Uncaught TypeError: WP_HTML_Tag_Processor::get_updated_html(): Return value must be of type string, null returned in /home/site/public_html/wp-includes/html-api/class-wp-html-tag-processor.php:4146\nStack trace:\n#0 /home/site/public_html/wp-content/plugins/jetpack-boost/jetpack_vendor/automattic/jetpack-image-cdn/src/class-image-cdn.php(699): WP_HTML_Tag_Processor->get_updated_html()\n#1 /home/site/public_html/wp-includes/class-wp-hook.php(324): Automattic\\Jetpack\\Image_CDN\\Image_CDN::filter_the_content(NULL)\n#2 /home/site/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array)\n#3 /home/site/public_html/wp-includes/formatting.php(3984): apply_filters('the_content', 'Because there a...')\n#4 /home/site/public_html/wp-includes/class-wp-hook.php(324): wp_trim_excerpt('Because there a...', Object(WP_Post))\n#5 /home/site/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('', Array)\n#6 /home/site/public...', referer: https://fibrojedi.me.uk/ffxiv-enemies/nix/
Edit: Looking at the error log, it’s not just posts or post_types. This error is also being tripped on a category page like – https://fibrojedi.me.uk/category/lotro/.
Excerpt?
I was curious – looking at the error – because it seems to be the wp_trim_excerpt() causing and issue. Why, though, I don’t know.
AFAIK, the only interaction my site has directly with the excerpt is this function
function fibrojedi_remove_shortcode_from_excerpt($content) {
//https://wordpress.stackexchange.com/questions/112010/strip-shortcode-from-excerpt
if(!is_null($content)){
$content = str_replace(“[fj_toc]”,””,$content);
$content = str_replace(“[fj_dfi]”,””,$content);
$content = str_replace(“[menu_anchor]”,””,$content);
$content = str_replace(“Post Sections”,””,$content);
$content = str_replace(“Hide”,””,$content);
$content = str_replace(“Show”,””,$content);
$content = strip_shortcodes( $content );
}
return $content;
}
add_filter(‘the_excerpt’, ‘fibrojedi_remove_shortcode_from_excerpt’);
I had seen, in categories, that if I hadn’t pre-populated an excerpt (ain’t nobody always got time for that) then the system was inserting one but including printing out shortcodes. Odd for WP to do that at all.
So I did my own function to clear out certain shortcodes and phrases on UI elements that had nothing to do with the intro text.
I don’t know if it’s related, but, as you can see, it should not return null provided that $content isn’t null at the start.
Thinking about it, maybe I should force it to return a blank string if it’s null but I might be looking in the wrong rabbit hole here.
XML-RPC
However, I may have manually added my own off-cloudflare rule around xmlrpc.php which, without knowing in advance, may have also caused hiccups. I’ve been hit a few times with…outside forces…trying to do their thing on that PHP file in the past, but I’m not totally blocking it either.
Edit: Using the plugin WP-Hide, I had, in fact, renamed xmlrpc as I don’t use another plugin that requires “outside in” access. I’ve put it back to the default for now. Their setting did allow for a block on the default file but I didn’t enable that, so in theory it shouldn’t have caused the issue. But there’s theory…then there’s reality!
Occasionally in the log there is a reference like the below. But not all the IPs that triggered the original error could be linked to the below error either. In fact, it was the minority where they were linked (by IP and timestamp).
[access_compat:error] [pid 397775:tid 397775] [client 172.70.55.38:56194] AH01797: client denied by server configuration: …/xmlrpc.php
SSL/HTTPS
Re: HTTPS: everything is SSL, but I don’t mind adding the extra wp-config rule. It won’t make a difference to my SSL-everywhere-and-redirects-in-case-of-HTTP approach – but it won’t harm to add them either.
I’ll run the other tests and things next week (it’s late on Saturday and I have Sundays off blog stuff).
I know Jetpack can’t (and shouldn’t) offer customer support for Cloudflare, but if one of your plugins detects it in use, sending a notification to read the articles you just linked might be an idea?
-
This reply was modified 7 months, 2 weeks ago by
Fibro Jedi. Reason: Adding edits to clarify where the error was found on-site and additional info on xmlrpc.php
-
This reply was modified 7 months, 2 weeks ago by
Fibro Jedi. Reason: added a thought about excerpts as they are mentioned in the original error