ClassicPress/classicpress-seo

Fatal error in php8

Closed this issue · 7 comments

Pross commented
Fatal error: Uncaught Error: filter_input(): Argument #4 ($options) must be of type array|int, string given
in /home/pross/public_html/wp-content/plugins/classicpress-seo/includes/helpers/class-param.php on line 28

Call stack:

filter_input()
wp-content/plugins/classicpress-seo/includes/helpers/class-param.php:28
Classic_SEO\H\Param::get()
wp-content/plugins/classicpress-seo/includes/admin/helpers/class-page.php:268
Classic_SEO\A\Page::is_current_page()
wp-content/plugins/classicpress-seo/includes/module/class-base.php:36
Classic_SEO\M\Base::__construct()
wp-content/plugins/classicpress-seo/includes/modules/status/class-status.php:48
Classic_SEO\S\Status::__construct()
wp-content/plugins/classicpress-seo/includes/module/class-manager.php:314
Classic_SEO\M\Manager::load_module()
wp-content/plugins/classicpress-seo/includes/module/class-manager.php:294
Classic_SEO\M\Manager::load_modules()
wp-includes/class-wp-hook.php:286
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:310
WP_Hook::do_action()
wp-includes/plugin.php:453
do_action()
wp-settings.php:330
require_once()
wp-config.php:158
require_once()
wp-load.php:37
require_once()
wp-admin/admin.php:31

Thanks @Pross. I haven't got as far as testing on PHP 8 yet so this is useful. I'll add a fix to the next release.

ozws commented

That fatal error was showing up for me when activating or deactivating the plugin. Fixed for me by setting the $flag param to 0 (int) instead of an empty string. See PHP manual https://www.php.net/manual/en/function.filter-var.php - last parameter for filter_input() function should be array|int.

Hallo ... here are similar problems with php 8.0 ...

Thanks for help and a fix in the next release :-)

Hello ... same issue here
#147

Hi, I had to downgrade my website to PHP 7.4.33 because this plugin does not work correctly in php 8. In the meantime PHP 7.4 is end of life. Until when can a fix be provided? https://endoflife.date/php

This issue has been mentioned on ClassicPress Forums. There might be relevant details there:

https://forums.classicpress.net/t/classic-seo-is-not-compatible-with-php-8/4501/1

We're working on fixing PHP 8.0 compatibility. Hopefully, we can release an update soon.