Title: Errors constantly being generated by Helpful
Last modified: June 25, 2019

---

# Errors constantly being generated by Helpful

 *  Resolved [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/)
 * Greetings Pixelbart.
 * I am getting a constant influx of PHP errors and warnings that seem to be generated
   by the Helpful plugin. I have included the error messages below:
 * **************
    PHP Warning: Invalid argument supplied for foreach() in /html.
   ssl/wp-content/plugins/helpful/core/classes/class-helpful-table.php on line 75,
   referer: / PHP Stack trace:, referer: / PHP 1. {main}() /html.ssl/wp-admin/admin-
   ajax.php:0, referer: / PHP 2. require_once() /html.ssl/wp-admin/admin-ajax.php:
   22, referer: / PHP 3. require_once() /html.ssl/wp-load.php:37, referer: / PHP
   4. require_once() /html.ssl/wp-config.php:113, referer: / PHP 5. do_action() /
   html.ssl/wp-settings.php:394, referer: / PHP 6. WP_Hook->do_action() /html.ssl/
   wp-includes/plugin.php:465, referer: / PHP 7. WP_Hook->apply_filters() /html.
   ssl/wp-includes/class-wp-hook.php:310, referer: / PHP 8. call_user_func_array:{/
   html.ssl/wp-includes/class-wp-hook.php:286}() /html.ssl/wp-includes/class-wp-
   hook.php:286, referer: / PHP 9. {closure:/html.ssl/wp-content/plugins/helpful/
   core/autoload.php:61-63}() /html.ssl/wp-includes/class-wp-hook.php:286, referer:/
   PHP 10. Helpful_Table::get_instance() /html.ssl/wp-content/plugins/helpful/core/
   autoload.php:62, referer: / PHP 11. Helpful_Table->__construct() /html.ssl/wp-
   content/plugins/helpful/core/classes/class-helpful-table.php:25, referer: / PHP
   12. Helpful_Table->registerColumnsContent() /html.ssl/wp-content/plugins/helpful/
   core/classes/class-helpful-table.php:12, referer: /
 * PHP Warning: Invalid argument supplied for foreach() in /html.ssl/wp-content/
   plugins/helpful/core/classes/class-helpful-table.php on line 40, referer: /wp-
   admin/post.php?post=****&action=edit
    PHP Stack trace:, referer: /wp-admin/post.
   php?post=****&action=edit PHP 1. {main}() /html.ssl/wp-admin/admin-ajax.php:0,
   referer: /wp-admin/post.php?post=****&action=edit PHP 2. require_once() /html.
   ssl/wp-admin/admin-ajax.php:22, referer: /wp-admin/post.php?post=****&action=
   edit PHP 3. require_once() /html.ssl/wp-load.php:37, referer: /wp-admin/post.
   php?post=****&action=edit PHP 4. require_once() /html.ssl/wp-config.php:113, 
   referer: /wp-admin/post.php?post=****&action=edit PHP 5. do_action() /html.ssl/
   wp-settings.php:394, referer: /wp-admin/post.php?post=****&action=edit PHP 6.
   WP_Hook->do_action() /html.ssl/wp-includes/plugin.php:465, referer: /wp-admin/
   post.php?post=****&action=edit PHP 7. WP_Hook->apply_filters() /html.ssl/wp-includes/
   class-wp-hook.php:310, referer: /wp-admin/post.php?post=****&action=edit PHP 
   8. call_user_func_array:{/html.ssl/wp-includes/class-wp-hook.php:286}() /html.
   ssl/wp-includes/class-wp-hook.php:286, referer: /wp-admin/post.php?post=****&
   action=edit PHP 9. {closure:/html.ssl/wp-content/plugins/helpful/core/autoload.
   php:61-63}() /html.ssl/wp-includes/class-wp-hook.php:286, referer: /wp-admin/
   post.php?post=****&action=edit PHP 10. Helpful_Table::get_instance() /html.ssl/
   wp-content/plugins/helpful/core/autoload.php:62, referer: /wp-admin/post.php?
   post=****&action=edit PHP 11. Helpful_Table->__construct() /html.ssl/wp-content/
   plugins/helpful/core/classes/class-helpful-table.php:25, referer: /wp-admin/post.
   php?post=****&action=edit PHP 12. Helpful_Table->registerColumns() /html.ssl/
   wp-content/plugins/helpful/core/classes/class-helpful-table.php:11, referer: /
   wp-admin/post.php?post=****&action=edit

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11672415)
 * [@ubcsecurity](https://wordpress.org/support/users/ubcsecurity/) I’ll look into
   it later in the day. Thanks for your feedback!
 * Which PHP version do you use?
 * EDIT: Should be fixed with 4.0.3
    -  This reply was modified 6 years, 10 months ago by [Pixelbart](https://wordpress.org/support/users/pixelbart/).
 *  Thread Starter [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11675545)
 * I will check out 4.0.3 and let you know.
 * Running PHP 5.4.16
 *  Thread Starter [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11680686)
 * [@pixelbart](https://wordpress.org/support/users/pixelbart/) I am still getting
   flooded with these errors in my log file.
 * > Warning: Invalid argument supplied for foreach() in /wp-content/plugins/helpful/
   > core/classes/class-helpful-table.php on line 40, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 
   > Stack trace:, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 1. {main}() /wp-admin/admin-ajax.php:0, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 2. require_once() /wp-admin/admin-ajax.php:22, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 3. require_once() /wp-load.php:37, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 4. require_once() /wp-config.php:113, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 5. do_action() /wp-settings.php:394, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 6. WP_Hook->do_action() /wp-includes/plugin.php:465, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 7. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 8. call_user_func_array:{/wp-includes/class-wp-hook.php:286}() /wp-includes/
   > class-wp-hook.php:286, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 9. {closure:/wp-content/plugins/helpful/core/autoload.php:62-64}() /wp-includes/
   > class-wp-hook.php:286, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 10. Helpful_Table::get_instance() /wp-content/plugins/helpful/core/autoload.
   > php:63, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 11. Helpful_Table->__construct() /wp-content/plugins/helpful/core/classes/class-
   > helpful-table.php:25, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 12. Helpful_Table->registerColumns() /wp-content/plugins/helpful/core/classes/
   > class-helpful-table.php:11, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > Warning: Invalid argument supplied for foreach() in /wp-content/plugins/helpful/
   > core/classes/class-helpful-table.php on line 76, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > Stack trace:, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 1. {main}() /wp-admin/admin-ajax.php:0, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 2. require_once() /wp-admin/admin-ajax.php:22, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 3. require_once() /wp-load.php:37, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 4. require_once() /wp-config.php:113, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 5. do_action() /wp-settings.php:394, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 6. WP_Hook->do_action() /wp-includes/plugin.php:465, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 7. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 8. call_user_func_array:{/wp-includes/class-wp-hook.php:286}() /wp-includes/
   > class-wp-hook.php:286, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 9. {closure:/wp-content/plugins/helpful/core/autoload.php:62-64}() /wp-includes/
   > class-wp-hook.php:286, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 10. Helpful_Table::get_instance() /wp-content/plugins/helpful/core/autoload.
   > php:63, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 11. Helpful_Table->__construct() /wp-content/plugins/helpful/core/classes/class-
   > helpful-table.php:25, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
   > 12. Helpful_Table->registerColumnsContent() /wp-content/plugins/helpful/core/
   > classes/class-helpful-table.php:12, referer: [https:///wp-admin/index.php](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/?output_format=md)
 *  Thread Starter [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11683560)
 * Okay so I took a look at your code, and have a number of fixes.
 * 1. /core/classes/class-helpful-shortcodes.php – public function addToContent(
   $content)
 *     ```
       global $post;
   
       $post_types = get_option('helpful_post_types');
   
       $user_id = Helpful_Helper_Values::getUser();
   
       if ( !is_array ( $post_types ) || !in_array ( $post->post_type, $post_types ) ) {
   
           return $content;
   
       }
       ```
   
 * 2. /core/classes/class-helpful-table.php – public function registerColumns()
 *     ```
       $post_types = get_option( 'helpful_post_types' );
   
       if( !isset ( $post_types ) || !is_array ( $post_types ) ) {
   
           return;
   
       }
   
       foreach( $post_types as $post_type ) {
   
           $post_type = esc_attr( $post_type );
   
           add_filter( 'manage_edit-' . $post_type . '_columns', [ $this, 'setColumnsTitle' ], 10 );
   
       }
       ```
   
    -  This reply was modified 6 years, 10 months ago by [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/).
    -  This reply was modified 6 years, 10 months ago by [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/).
    -  This reply was modified 6 years, 10 months ago by [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/).
 *  Thread Starter [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11683581)
 * [@pixelbart](https://wordpress.org/support/users/pixelbart/)
 * Also, getting a lot of errors because the table “helpful_feedback” has not been
   created, and this is throwing errors on the wp-admin dashboard when viewing the
   Helpful widget, as well as when someone tries to submit feedback.
 * > WordPress database error Table ‘wp_helpful_feedback’ doesn’t exist for query
   > SELECT * FROM wp_helpful_feedback ORDER BY time DESC LIMIT 5 made by wp_dashboard,
   > do_meta_boxes, call_user_func, Helpful_Widget->widgetCallback, Helpful_Widget-
   > >renderTemplate, include_once(‘/plugins/helpful/templates/admin-widget.php’),
   > Helpful_Helper_Feedback::getFeedbackItems
 * > WordPress database error Table ‘wp_helpful_feedback’ doesn’t exist for query
   > SHOW FULL COLUMNS FROM `wp_helpful_feedback` made by do_action(‘wp_ajax_helpful_save_feedback’),
   > WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, Helpful_Frontend-
   > >saveFeedback, Helpful_Helper_Feedback::insertFeedback
 *  Plugin Author [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11683668)
 * [@ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * I can’t reproduce these errors and other users don’t seem to have these errors
   either. WordPress itself now needs a higher version.
 * Since I can’t support every PHP version and always try to program safely, I use
   more recent versions.
 * I fixed the error with the table and also the checks of the post type array, 
   as you can see in your example. There it is correctly queried if it is an array.
 * The database table is created automatically when performing maintenance or updating
   the plugin.
 * If you have such problems with the plugin, you are welcome to try other plugins.
   I don’t force anyone to use my plugin here.
 * If you come up with solutions for your case, please feel free to tell me. Personally
   I don’t see any mistakes there.
 * Nevertheless as always: Thank you for your feedback!
 *  Thread Starter [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11694574)
 * Hi [@pixelbart](https://wordpress.org/support/users/pixelbart/).
 * I don’t think this has anything to do with PHP versions. I have updated to the
   latest version, and am still getting flooded with errors.
 * Just to be clear, the examples I included above were my suggestions on how to
   address the errors. In the file core/classes/helpful-class-shortcodes.php, on
   line 51 specifically:
 * I suggest changing the line from:
 * `if (!in_array($post->post_type, $post_types)) {`
 * to:
 * `if (!is_array($post_types) || !in_array($post->post_type, $post_types)) {`
 * the reason being is that because the helpful_post_types object is not always 
   set, and you are not checking it. The function “in_array” expects an array parameter…
 * I saw that you included my second suggestion in the class-helpful-table.php file,
   so no more errors from there.
 * I am still however getting the same errors when viewing the admin dashboard widget,
   or trying to save feedback when someone chooses the contra option for a post:
 * > [Tue Jul 02 16:24:10.573550 2019] [:error] [pid 21248] [client ] WordPress 
   > database error Table ‘wp_helpful_feedback’ doesn’t exist for query SELECT *
   > FROM wp_helpful_feedback ORDER BY time DESC LIMIT 5 made by wp_dashboard, do_meta_boxes,
   > call_user_func, Helpful_Widget->widgetCallback, Helpful_Widget->renderTemplate,
   > include_once(‘/plugins/helpful/templates/admin-widget.php’), Helpful_Helper_Feedback::
   > getFeedbackItems, referer: /
   > [Tue Jul 02 16:30:30.829622 2019] [:error] [pid 20968] [client ] WordPress 
   > database error Table ‘wp_helpful_feedback’ doesn’t exist for query SHOW FULL
   > COLUMNS FROM `wp_helpful_feedback` made by do_action(‘wp_ajax_helpful_save_feedback’),
   > WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, Helpful_Frontend-
   > >saveFeedback, Helpful_Helper_Feedback::insertFeedback, referer: /
 * Cheers.
 *  Plugin Author [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11695289)
 * [@ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * Thanks for the details. That’s right, I have to ask again if the array is set.
   I will still do it!
 * The one with the table is solved in one of the versions. You have to go to Helpful
   Settings -> System and do the maintenance there once. Helpful will do the rest
   for you.
 * **4.0.8**
 * – The maintenance procedure in the Helpful settings, which can be found there
   under System, now also checks whether the database tables exist and creates them
   if they do not exist.
    – FAQ updated
 *  Plugin Author [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11696418)
 * [@ubcsecurity](https://wordpress.org/support/users/ubcsecurity/) This should 
   be fixed with version 4.0.10 for you. If I forgot another array and you notice
   something, feel free to comment again!
 * Many thanks for your help!
 *  Thread Starter [ubcsecurity](https://wordpress.org/support/users/ubcsecurity/)
 * (@ubcsecurity)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11697808)
 * Hi [@pixelbart](https://wordpress.org/support/users/pixelbart/)
 * Everything is working great now. Thanks for pointing me to the maintenance button,
   that cleared up the missing database table. No more errors! Thanks!
 *  Plugin Author [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * (@pixelbart)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11697880)
 * [@ubcsecurity](https://wordpress.org/support/users/ubcsecurity/) That’s great
   to hear! I’m happy that Helpful is running with you now. If there is anything
   else, just let me know again.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Errors constantly being generated by Helpful’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/helpful.svg)
 * [Helpful](https://wordpress.org/plugins/helpful/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/helpful/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/helpful/)
 * [Active Topics](https://wordpress.org/support/plugin/helpful/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/helpful/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/helpful/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Pixelbart](https://wordpress.org/support/users/pixelbart/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/errors-constantly-being-generated-by-helpful/#post-11697880)
 * Status: resolved