wpdreams / ajax-search-pro-development

Issues and dev tracking repository for Ajax Search Pro for WordPress plugin
0 stars 0 forks source link

Error with PHP 8.1.27 #101

Closed allinappliadmin closed 3 months ago

allinappliadmin commented 3 months ago

Describe the bug

Trying to upgrade PH version from 7.4 to 8.1 I'm getting a critical error. I've checked every single plugin and Ajax search pro is involved. I disabled all plugins and only tried with ASP and still get the error. Testing with different version of WP (6.1.1/6.4/6.5) didn't change anything.

Output

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/ajax-search-pro/includes/classes/Asset/Script/Manager.php:497 Stack trace: #0 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/ajax-search-pro/includes/classes/Asset/Script/Manager.php(497): count() #1 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/ajax-search-pro/includes/classes/Asset/Script/Manager.php(131): WPDRMS\ASP\Asset\Script\Manager->initialize() #2 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/ajax-search-pro/includes/classes/Asset/Manager.php(24): WPDRMS\ASP\Asset\Script\Manager->enqueue() #3 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/ajax-search-pro/includes/classes/Hooks/Filters/Asset.php(15): WPDRMS\ASP\Asset\Manager->enqueue() #4 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(322): WPDRMS\ASP\Hooks\Filters\Asset->onPluginFrontendHead() #5 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #6 /var/www/vhosts/domain.com/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #7 /var/www/vhosts/domain.com/httpdocs/wp-includes/script-loader.php(2265): do_action() #8 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts() #9 /var/www/vhosts/domain.com/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #10 /var/www/vhosts/domain.com/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #11 /var/www/vhosts/domain.com/httpdocs/wp-includes/general-template.php(3050): do_action() #12 /var/www/vhosts/domain.com/httpdocs/wp-content/themes/hello-elementor/header.php(24): wp_head() #13 /var/www/vhosts/domain.com/httpdocs/wp-includes/template.php(810): require_once('...') #14 /var/www/vhosts/domain.com/httpdocs/wp-includes/template.php(745): load_template() #15 /var/www/vhosts/domain.com/httpdocs/wp-includes/general-template.php(48): locate_template() #16 /var/www/vhosts/domain.com/httpdocs/wp-content/themes/hello-elementor/index.php(15): get_header() #17 /var/www/vhosts/domain.com/httpdocs/wp-includes/template-loader.php(106): include('...') #18 /var/www/vhosts/domain.com/httpdocs/wp-blog-header.php(19): require_once('...') #19 /var/www/vhosts/domain.com/httpdocs/index.php(17): require('...') #20 {main} thrown in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/ajax-search-pro/includes/classes/Asset/Script/Manager.php on line 497

System information (short version)

== Server Environment == Operating System: Linux Software: Apache MySQL version: MariaDB Server v10.11.7-MariaDB PHP Version: 8.1.27 PHP Memory Limit: 1280M PHP Max Input Vars: 1000 PHP Max Post Size: 30M GD Installed: Yes ZIP Installed: Yes Write Permissions: All right Elementor Library: Connected

== WordPress Environment == Version: 6.5 Site URL: Home URL: WP Multisite: No Max Upload Size: 30 Mo Memory limit: 512M Max Memory limit: 1280M Permalink Structure: /%postname%/ Language: fr_FR Timezone: Europe/Paris Admin Email: Debug Mode: Inactive

== Theme == Name: Hello Elementor Version: 3.0.1 Author: Elementor Team Child Theme: No

ernestmarcinko commented 3 months ago

Thank you for the details.

The plugin tries to fetch the instance data options from the wp_options database table, from the option _asp_script_data, but the error reports that it's corrupted or it's tempered with in some way.

Please delete _asp_script_data from the options table, that should do the trick. Let me know.

allinappliadmin commented 3 months ago

that works! Thank you Ernest for your quick and helpful answer. ASP is not always straightforward to set but it's a rocket!

ernestmarcinko commented 3 months ago

Great, thanks for the feedback!

Nevertheless I will keep this open yet, I want to make sure to add an extra line to check for the data integrity so this never reappears.

ernestmarcinko commented 3 months ago

fixed