wp-calypso
wp-calypso copied to clipboard
[Bug]: Blogger Importer not compatible with PHP 8.0
Quick summary
When try to import using Blogger Importer and site on PHP 8.0 you get an automatic fatal when you try to get to the file upload screen or the general importer screen. I tested other available importers and they seem fine.
I think this is high impact because PHP 7.4 is nearing end of life and all newly transferred Atomic sites are automatically getting put on 8.0. This makes for a bad experience for users setting up new sites from blogger as they will need HE help to identify issue and won't know how to workaround on their own
Steps to reproduce
- On a wpcom Atomic site make sure PHP version is set to 8.0 (Settings > Hosting Config)
- Install Blogger importer from Tools > Import
- Go to import page (/wp-admin/import.php?import=blogger)
- see fatal message on front end:
There has been a critical error on this website. Please check your site admin email inbox for instructions. - if you try to get to the general import page it also fatals there
What you expected to happen
Should be able to import, same as with 7.4
What actually happened
fatals as soon as try to access importer
PHP Fatal error: Declaration of WP_SimplePie_Blog_Item::get_id($hash = false) must be compatible with SimplePie_Item::get_id($hash = false, $fn = 'md5') in /srv/htdocs/wp-content/plugins/blogger-importer/blogger-importer-blogitem.php on line 111
Also some noisy deprecation notices:
[09-Aug-2022 12:06:25 UTC] PHP Deprecated: File class-feed.php is <strong>deprecated</strong> since version 4.7.0! Use fetch_feed() instead. in /wordpress/core/6.0.1/wp-includes/functions.php on line 5569 [09-Aug-2022 12:06:25 UTC] PHP Deprecated: File class-wp-feed-cache.php is <strong>deprecated</strong> since version 5.6.0 with no alternative available. This file is only loaded for backward compatibility with SimplePie 1.2.x. Please consider switching to a recent SimplePie version. in /wordpress/core/6.0.1/wp-includes/functions.php on line 5579 [09-Aug-2022 12:06:26 UTC] PHP Notice: Function is_embed was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /wordpress/core/6.0.1/wp-includes/functions.php on line 5831 [09-Aug-2022 12:06:26 UTC] PHP Notice: Function is_search was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Beforethen, they always return false. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 3.1.0.) in /wordpress/core/6.0.1/wp-includes/functions.php on line 5831
No real errors in console but request 500s

Browser
Android Chrome
Context
user report followed by testing
Platform (Simple, Atomic, or both?)
No response
Other notes
No response
Reproducibility
Consistent
Severity
Some (< 50%)
Available workarounds?
Yes, difficult to implement
Workaround details
This is just a bandaid as EOL for PHP 7.4 is coming in Nov. Also, the error isn't clearly tied to PHP version for the user so they have no way to know.
Found a Solution here
open xampp\htdocs\yourprojectfolder\wp-content\plugins\blogger-importer and open blogger-importer-blogitem.php and edit 111 with following
$hash = false, $fn = 'md5'
another instance here: 5530927-zd-woothemes
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 5530927-zen
This is fixed upstream in https://github.com/WordPress/blogger-importer/pull/3
@zaerl We just need to test to ensure that this is fixed in a release.
@zaerl We just need to test to ensure that this is fixed in a release.
The PHP 8 error is fixed here, once released. In PHP 8 LSP violations are fatal errors.
Fixed in https://github.com/WordPress/blogger-importer/pull/2.