WidgetOptions / widget-options

Additional Widget options for better widget control. Available on
https://widget-options.com/
GNU General Public License v3.0
35 stars 16 forks source link

PHP 7.1 warnings #13

Closed laxbobber closed 7 years ago

laxbobber commented 7 years ago

Widget Options Version 3.1 running on PHP 7.1 will generate an error_log with the following:

PHP Warning: Illegal string offset 'pages' in /home/example/public_html/wp-content/plugins/widget-options/core/functions.widget.display.php on line 241

PHP Warning: Illegal string offset 'pages' in /home/example/public_html/wp-content/plugins/widget-options/core/functions.widget.display.php on line 243

PHP Warning: array_key_exists() expects parameter 2 to be array, string given in /home/example/public_html/wp-content/plugins/widget-options/core/functions.widget.display.php on line 243

phpbits commented 7 years ago

Hi,

Thank you very much for choosing Widget Options. Regarding your concern, are you using the latest version? Checked the lines with errors : https://github.com/phpbits/widget-options/blob/master/core/functions.widget.display.php and it seems not the issue. Also, can you go to Settings > Widget Options and enable the Page Visibility option. Let me know how it goes. Thanks!

Cheers, Jeffrey

laxbobber commented 7 years ago

Set WP_DEBUG to true in your wp-config.php and use Version 3.1 with PHP 7.1.0 and you'll see it.

It looks like it is because you are initially setting $visibility to an empty string but then later treating it as an array ( with isset( $visibility['pages'] ).

phpbits commented 7 years ago

Hi,

Does enabling the page visibility on the settings page fixes the issue? This will do for the meantime while I'm updating the plugin. I hope this is fine with you. Thanks!

Cheers, Jeffrey

phpbits commented 7 years ago

Hi,

Please update to the latest version and let me know when you encounter any issues. Thanks!

Cheers, Jeffrey

laxbobber commented 7 years ago

Did a quick test just now and it is looking good so far! Thank you!

phpbits commented 7 years ago

Sounds perfect :) Thanks!