Edgars
Forum Replies Created
-
Forum: Plugins
In reply to: [Redis Object Cache] Redis Cache plugin causing unnecessary redirectsThanks! I will wait for the new version then!
Best wishes,
EdgarsAlso one more bug in 404 Monitor, when using it with WPML:
When capturing 404 errors it does not save the language slug in the path which was not found. The reason behing this and also the solution is quite simple actually.On the file: /includes/modules/404-monitor/class-monitor.php on the method “capture_404” you use a simple “str_replace” function to get rid of the domain from the URL path / query string:
$uri = str_replace( home_url( '/' ), '', $uri );
This however is not the correct solution at all, because it can generate a lot of incorrect 404 paths:
- home_url() function returns the site domain along with the language code (e.g. https://sitedomain.tld/de/) which means with this approach we can’t see on which language the error happened when WPML or some other multi-language plugin is enabled.
- str_replace() function in this case replaces all the instances of the domain name in the url, e.g. if the url is https://sitedomain.tld/https://sitedomain.tld or https://sitedomain.tld/?https://sitedomain.tld it will result in a incorrect path registered on your “404 monitor”
I’d advise you to rewrite this line to something more stable, like:
$uri = parse_url($uri);
$uri = (isset($uri['path']) ? $uri['path'] : '').(isset($uri['query']) ? '?'.$uri['query'] : '');
$uri = isset($uri[0]) && $uri[0] === '/' ? mb_substr($uri, 1) : $uri;Or similar solution.
- This reply was modified 2 years, 1 month ago by Edgars.
This is actually a bug in WooCommerce’s Action Scheduler package.
No, this is not, we’re facing a similar issue with our sites and they do not have WooCommerce installed at all. Please fix the warnings with the fix mentioned above.
Thanks!