Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lot of undefined indexes #9

Open
melvinkoopmans opened this issue Sep 8, 2017 · 0 comments
Open

A lot of undefined indexes #9

melvinkoopmans opened this issue Sep 8, 2017 · 0 comments

Comments

@melvinkoopmans
Copy link

There are a lot of array offsets not being checked for existence / not given a default value throughout the plugin. This results in a significant amount of unwanted PHP notices.

Me and my development team use the Whoops library for errors and we get a lot of error screens.

For instance in admin/partial/general.php:

<td colspan="2">
    <h2>
        <?php _e("Ginger is currently", "ginger"); ?>: 
        <b><?php if(is_array($options) && $options["enable_ginger"]) _e("enabled", "ginger"); else _e("disabled", "ginger");  ?></b> 
     </h2>
</td>

Here the offset enable_ginger is not always present. Resulting in an Undefined index: enable_ginger

Could you either check or provide a default variable so these notices will disappear?
Maybe use something like XDebug, Whoops, Symfony Console etc. to walk through the notices.

There are several notices on:

  • Every tab in the WP Admin
  • On the site itself when the cookie banner is being shown and certain offsets are not present.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant