PS I forgot to add the followig info from a WordPress email that was sent when the site crashed.
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 5.9.2
Current theme: Twenty Twelve (version 3.6)
Current plugin: RSS Feed Checker (version 1.1)
PHP version 8.0.16
Error Details
=============
An error of type E_ERROR was caused in line 15 of the file /home3/oleannac/public_html/wp-content/plugins/rssfeedchecker/RSSFeedCheckerWidget.php. Error message: Uncaught Error: Call to undefined function create_function() in /home3/oleannac/public_html/wp-content/plugins/rssfeedchecker/RSSFeedCheckerWidget.php:15
Stack trace:
#0 /home3/oleannac/public_html/wp-content/plugins/rssfeedchecker/RSSFeedChecker.php(42): RSSCheckWidget::init()
#1 /home3/oleannac/public_html/wp-content/plugins/rssfeedchecker/RSSFeedChecker.php(115): RSSChecker::init()
#2 /home3/oleannac/public_html/wp-settings.php(418): include_once('/home3/oleannac...')
#3 /home3/oleannac/public_html/wp-config.php(95): require_once('/home3/oleannac...')
#4 /home3/oleannac/public_html/wp-load.php(50): require_once('/home3/oleannac...')
#5 /home3/oleannac/public_html/wp-admin/admin.php(34): require_once('/home3/oleannac...')
#6 /home3/oleannac/public_html/wp-admin/index.php(10): require_once('/home3/oleannac...')
#7 {main}
thrown
It seems this is something to do with a PHP upgrade. My hosting site automatically upgraded me from PHP 7.4 to 8.0. and this caused RSS Feed Checker to crash the site. I have subsequenty dowgraded back to 7.4 and the site and the plugin now work ok.
The problem code seems to be the “add_action” one.
class RSSCheckWidget extends WP_Widget {
static function init(){
add_action('widgets_init', create_function('', 'return register_widget("RSSCheckWidget");'));
add_shortcode('LinksRSSEnhanced', array('RSSCheckWidget','RenderShortcode' ));
}
It should be possible to replace that with an anonymous function or an explicitly named one. Was a long time back so not sure why create function was used.
An example fix is shown here.
https://ehikioya.com/fix-for-function-create_function-is-deprecated-in-php-7-2/
-
This reply was modified 3 years, 8 months ago by
Workshopshed.