Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter ubcsecurity

    (@ubcsecurity)

    Hi @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!

    Thread Starter ubcsecurity

    (@ubcsecurity)

    Hi @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.

    Thread Starter ubcsecurity

    (@ubcsecurity)

    @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

    Thread Starter ubcsecurity

    (@ubcsecurity)

    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 5 years, 8 months ago by ubcsecurity.
    • This reply was modified 5 years, 8 months ago by ubcsecurity.
    • This reply was modified 5 years, 8 months ago by ubcsecurity.
    Thread Starter ubcsecurity

    (@ubcsecurity)

    @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
    Stack trace:, referer: https:///wp-admin/index.php
    1. {main}() /wp-admin/admin-ajax.php:0, referer: https:///wp-admin/index.php
    2. require_once() /wp-admin/admin-ajax.php:22, referer: https:///wp-admin/index.php
    3. require_once() /wp-load.php:37, referer: https:///wp-admin/index.php
    4. require_once() /wp-config.php:113, referer: https:///wp-admin/index.php
    5. do_action() /wp-settings.php:394, referer: https:///wp-admin/index.php
    6. WP_Hook->do_action() /wp-includes/plugin.php:465, referer: https:///wp-admin/index.php
    7. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310, referer: https:///wp-admin/index.php
    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
    9. {closure:/wp-content/plugins/helpful/core/autoload.php:62-64}() /wp-includes/class-wp-hook.php:286, referer: https:///wp-admin/index.php
    10. Helpful_Table::get_instance() /wp-content/plugins/helpful/core/autoload.php:63, referer: https:///wp-admin/index.php
    11. Helpful_Table->__construct() /wp-content/plugins/helpful/core/classes/class-helpful-table.php:25, referer: https:///wp-admin/index.php
    12. Helpful_Table->registerColumns() /wp-content/plugins/helpful/core/classes/class-helpful-table.php:11, referer: https:///wp-admin/index.php
    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
    Stack trace:, referer: https:///wp-admin/index.php
    1. {main}() /wp-admin/admin-ajax.php:0, referer: https:///wp-admin/index.php
    2. require_once() /wp-admin/admin-ajax.php:22, referer: https:///wp-admin/index.php
    3. require_once() /wp-load.php:37, referer: https:///wp-admin/index.php
    4. require_once() /wp-config.php:113, referer: https:///wp-admin/index.php
    5. do_action() /wp-settings.php:394, referer: https:///wp-admin/index.php
    6. WP_Hook->do_action() /wp-includes/plugin.php:465, referer: https:///wp-admin/index.php
    7. WP_Hook->apply_filters() /wp-includes/class-wp-hook.php:310, referer: https:///wp-admin/index.php
    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
    9. {closure:/wp-content/plugins/helpful/core/autoload.php:62-64}() /wp-includes/class-wp-hook.php:286, referer: https:///wp-admin/index.php
    10. Helpful_Table::get_instance() /wp-content/plugins/helpful/core/autoload.php:63, referer: https:///wp-admin/index.php
    11. Helpful_Table->__construct() /wp-content/plugins/helpful/core/classes/class-helpful-table.php:25, referer: https:///wp-admin/index.php
    12. Helpful_Table->registerColumnsContent() /wp-content/plugins/helpful/core/classes/class-helpful-table.php:12, referer: https:///wp-admin/index.php

    Thread Starter ubcsecurity

    (@ubcsecurity)

    I will check out 4.0.3 and let you know.

    Running PHP 5.4.16

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