plausible / wordpress

Plausible Analytics WordPress plugin
https://plausible.io/wordpress-analytics-plugin
MIT License
50 stars 26 forks source link

Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /var/www/xxx/wp-content/plugins/plausible-analytics/src/Includes/Filters.php:96 #180

Closed ThomasTr closed 7 months ago

ThomasTr commented 7 months ago

Tested new Version, but get an Fatal error In Version 2.0.4 on Frontpage (Admin is working):


Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /var/www/xxx/wp-content/plugins/plausible-analytics/src/Includes/Filters.php:96 Stack trace: #0 /var/www/xxx/wp-content/plugins/plausible-analytics/src/Includes/Filters.php(96): in_array() #1 /var/www/xxx/wp-includes/class-wp-hook.php(324): Plausible\Analytics\WP\Includes\Filters->maybe_add_custom_params() #2 /var/www/xxx/wp-includes/plugin.php(205): WP_Hook->apply_filters() #3 /var/www/xxx/wp-content/plugins/plausible-analytics/src/Includes/Filters.php(62): apply_filters() #4 /var/www/xxx/wp-includes/class-wp-hook.php(326): Plausible\Analytics\WP\Includes\Filters->add_plausible_attributes() #5 /var/www/xxx/wp-includes/plugin.php(205): WP_Hook->apply_filters() #6 /var/www/xxx/wp-includes/class-wp-scripts.php(441): apply_filters() #7 /var/www/xxx/wp-includes/class-wp-dependencies.php(137): WP_Scripts->do_item() #8 /var/www/xxx/wp-includes/class-wp-scripts.php(777): WP_Dependencies->do_items() #9 /var/www/xxx/wp-includes/script-loader.php(2101): WP_Scripts->do_head_items() #10 /var/www/xxx/wp-includes/script-loader.php(2221): print_head_scripts() #11 /var/www/xxx/wp-includes/class-wp-hook.php(324): wp_print_head_scripts() #12 /var/www/xxx/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #13 /var/www/xxx/wp-includes/plugin.php(517): WP_Hook->do_action() #14 /var/www/xxx/wp-includes/general-template.php(3052): do_action() #15 /var/www/xxx/wp-content/themes/wpzoom-derive/header.php(106): wp_head() #16 /var/www/xxx/wp-includes/template.php(790): require_once('...') #17 /var/www/xxx/wp-includes/template.php(725): load_template() #18 /var/www/xxx/wp-includes/general-template.php(48): locate_template() #19 /var/www/xxx/wp-content/themes/wpzoom-derive/page-templates/homepage-builder-bb.php(6): get_header() #20 /var/www/xxx/wp-includes/template-loader.php(106): include('...') #21 /var/www/xxx/wp-blog-header.php(19): require_once('...') #22 /var/www/xxx/index.php(17): require('...') #23 {main} thrown in /var/www/xxx/wp-content/plugins/plausible-analytics/src/Includes/Filters.php on line 96

Deactivated the plugin for now

Dan0sz commented 7 months ago

Will fix this ASAP.

Out of curiosity, which PHP and WP version are you running?

Dan0sz commented 7 months ago

This pre-release adresses this issue: https://github.com/plausible/wordpress/releases/tag/2.0.5-beta1

In a minute the tag will contain a plausible-analytics.zip file, which you can use to install it in WordPress.

ThomasTr commented 7 months ago

Again thx for fast fix

WP Verision is: 6.4.3 PHP Version is: 8.2.15

Will try this version soon