• Resolved SooBahkDo

    (@soobahkdo)


    Hello,

    I really like your plugin and use it on several sites.
    In the admin pages listing page, Query Monitor reports the following.
    Do the following notices need attention?

    Notice Undefined index: in-progress 1
    +
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: in-progress 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: failed 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: failed 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-pending 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-pending 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-processing 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-processing 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-on-hold 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-on-hold 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-completed 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-completed 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-cancelled 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-cancelled 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-refunded 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-refunded 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: wc-failed 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: wc-failed 1
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: spam 1
    +
    wp-content/plugins/post-state-tags/post-state-tags.php:745
    Plugin: post-state-tags
    Notice Undefined index: spam 1
    +
    wp-content/plugins/post-state-tags/post-state-tags.php:748
    Plugin: post-state-tags
    Notice Undefined index: in-progress 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: failed 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-pending 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-processing 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-on-hold 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-completed 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-cancelled 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-refunded 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: wc-failed 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags
    Notice Undefined index: spam 47
    + Toggle button
    wp-content/plugins/post-state-tags/post-state-tags.php:847
    Plugin: post-state-tags

    Thanks,
    Phil D

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Brand

    (@brandbrilliance)

    This was happening, because my function doesn’t have a pre-check if the status already exists. I’ve added in some code to check if a default already exists for this status (e.g. those from WooCommerce are new statuses). This then avoids the index warning you are getting. Although you should set your wordpress to ignore NOTICES as these are not errors or warnings. NOTICES are merely the compiler saying that it couldn’t find something, but it knows how to continue.

    NOTICE, WARNING, ERROR levels are settable in your PHP.INI or even in WordPress itself.

    Install 2.0.4. Hope this fixes the notices you are getting.

    Thread Starter SooBahkDo

    (@soobahkdo)

    Perfect!

    Thanks for the update.

    I like the plugin too…but I too am getting notices that make no sense to me. The code is running perfectly and it is complaining about an array label.

    Like: Undefined index: Required

    
    if($Field['Required'] == 1)
    

    Why?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Query Monitor Indicating Many Notices’ is closed to new replies.