New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecated: class-wp-feed-cache.php is deprecated since version 5.6.0 with no alternative available. #127
Comments
I can't tell if its related, but since making this change I also get: Warning: ./cache is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. in /Applications/MAMP/htdocs/website/wp-includes/class-simplepie.php on line 1510 |
Hello @ThatStevensGuy |
I'm interested in this ticket too, as support for PHP 8 requires WP>=5.6 |
In wordpress5.6, PHP 8 https://github.com/radgeek/feedwordpress/blob/master/feedwordpress.php#L99-L100 This will keep up until WP_Feed_Cache is supported. |
@kuniiskywalker with your suggested change I'm seeing:
whereas, without the change the deprecation doesn't break functionality, I think - it just gives those deprecation errors (however, I've not had a chance to properly look at this yet) |
...that said the error can be put out in some very annoying places |
@oppiansteve However, since WP_Feed_Cache is depricated, I think that the dependency should be eliminated. It is necessary to create a new class that maintains the responsibility of WP_Feed_Cache. Even in the cache save destination, the default is ./cache directory, and it seems that an error occurs with write permission in a specific environment. .. .. |
Yes, sorry, I wasn't clear the error is that you've removed the caching mechanism and so the save will always fail. My current thinking is to just move the one file into FWP, as the file is trivial (1 class with 1 method that has 1 line) and solves all the problems, I think. A better solution would be to replace the caching with some other mechanism perhaps, but that's potentially a lot more work. |
… WP_Feed_Cache with replacement FeedWordPie_Cache class. (Should resolve PHP warnings: 'Deprecated: class-wp-feed-cache.php is <strong>deprecated</strong> since version 5.6.0', 'Message: ./cache is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.')
Hey all, thanks for flagging and commenting on this issue. This one took a little while to figure out. The apparent solution is not very complicated (I replaced the deprecated WP_Feed_Cache wrapper class with my own class, using code more or less copy-pasted from the WordPress Core and SimplePie caching classes). But the way that replacement cache handler classes hook in to SimplePie has gotten somewhat more complicated, so several other seemingly attractive solutions turned out to be dead ends and it took a lot of stepping through WordPress Core code to figure out why intended replacements weren't successfully taking over. (E.G.: Why not just replace WP_Feed_Cache with the still-supported WP_Feed_Cache_Transient? Well, it turns out SimplePie won't accept that as a replacement for SimplePie_Cache because it's not a subclass of SimplePie_Cache. OK, why not just copy over WP_Feed_Cache's methods over into FeedWordPie_Cache, make that a subclass, and then change all the class names in feedwordpress.php? Well, it turns out you need to re-implement the get_handler() and create() factory methods to force them to create an object using your new sub-class instead of just creating a SimplePie_Cache object. Etc. etc.) Anyway, I just pushed a commit (see above) which I believe should resolve the issue with the Deprecated notice, without producing the warning about un-writeable cache directories (for those who do not have a cache directory with write permissions), and (also important) without breaking caching of feed contents (which is what the latter notice is really warning you about). Pull it down and give it a test, see if it resolves the issue for you; if so, great, and if not, let me know what you're seeing. After a bit more testing if all goes well, I will include this in the next public release of FeedWordPress both here and on the WordPress Plugins SVN repository. Hope this helps! |
Thank you for looking into this issue. I have tested it finally and it looks like the issues are corrected. |
Thanks for fixing this. So shall we use the code from github? On Wordpress there is still the old version |
@radgeek - could you please update the feedwordpress version on wordpress.org? The current version only supports up to WP 5.5.5. (if you need help, please add other contributors to this repo / the wordpress account - so that they could help out) Thanks upfront! |
This plugin has an issue with WordPress 5.6. Commenting out line 99 feedwordpress.php seems to fix it. If someone could verify if this is the only issue with WP 5.6 and update the plugin that would be nice.
The error is suppressed with WP_DEBUG set to false, but this should still be fixed.
The text was updated successfully, but these errors were encountered: