sendsmaily / sendsmaily-wordpress-plugin

Sendsmaily newsletter subscription plugin for Wordpress
GNU General Public License v3.0
3 stars 0 forks source link

Plugin errors on php8 #125

Open randohinn opened 2 years ago

randohinn commented 2 years ago

Bug description I have a site I tried updating to PHP 8 from 7.4, (veebimajutus.ee's install of WP, if that matters). On php8, attempts to access the admin panel, result in

Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, bool given in /home/vagrant/wordpress/wp-content/plugins/smaily-for-wp/includes/class-smaily-for-wp-options.php:89 Stack trace: #0 /home/vagrant/wordpress/wp-content/plugins/smaily-for-wp/includes/class-smaily-for-wp-options.php(89): array_merge() #1 /home/vagrant/wordpress/wp-content/plugins/smaily-for-wp/includes/class-smaily-for-wp-options.php(51): Smaily_For_WP_Options->get_form_options_from_db() #2 /home/vagrant/wordpress/wp-content/plugins/smaily-for-wp/admin/class-smaily-for-wp-admin.php(81): Smaily_For_WP_Options->get_form_options() #3 /home/vagrant/wordpress/wp-includes/class-wp-hook.php(307): Smaily_For_WP_Admin->smaily_admin_render() #4 /home/vagrant/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #5 /home/vagrant/wordpress/wp-includes/plugin.php(474): WP_Hook->do_action() #6 /home/vagrant/wordpress/wp-admin/includes/menu.php(155): do_action() #7 /home/vagrant/wordpress/wp-admin/menu.php(394): require_once('...') #8 /home/vagrant/wordpress/wp-admin/admin.php(158): require('...') #9 /home/vagrant/wordpress/wp-admin/index.php(10): require_once('...') #10 {main} thrown in /home/vagrant/wordpress/wp-content/plugins/smaily-for-wp/includes/class-smaily-for-wp-options.php on line 89

Steps for reproducing Steps to reproduce the behavior:

  1. Update to php8 on veebimajutus's install (options for the plugin stored in wp_options table)
  2. Try accessing the admin

Expected behavior I can still access the admin panel

Actual behavior Recieve aforementioned error.

WordPress version 5.8

Module version 3.0.7

Additional context Weirdly enough, another site that has php 8 but a different db structure (options seem to be held in smaily specific tables), works fine.

kaittodesk commented 2 years ago

Thank you taking the time to report the issue.

Unfortunately we are not able to reproduce the issue within our development environment on a fresh install of Smaily for WP 3.0.7 on WordPress 5.8 on PHP7.4, where latter is updated to PHP8.0.

Was the plugin initially installed with version prior to 3.0.0, and later updated to 3.0.7? Can you share the raw database value of smailyforwp_form_option (with sensitive information redacted)?

Weirdly enough, another site that has php 8 but a different db structure (options seem to be held in smaily specific tables), works fine.

Versions prior to 3.0.0 used custom database tables to store configuration options of the plugin. This was changed in version 3.0.0 of the plugin which started to use Options API. Is the another site using the latest version of the plugin?