• Resolved raphaelw

    (@raphaelw)


    Hi,

    i recently got to know this php error:

    Got error ‘PHP message: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near
    ‘} AND postid = 2581’ at line 1 for query SELECT SUM(pageviews) AS pageviews FROM wp_popularpostssummary WHERE {$views_time_range} AND postid = 2581;
    made by require(‘wp-blog-header.php’), wp, WP->main, WP->parse_request, do_action_ref_array(‘parse_request’), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WordPressPopularPosts\Rest\ViewLoggerEndpoint->update_views_count, do_action(‘wpp_post_update_views’), WP_Hook->do_action, WP_Hook->apply_filters, custom_wpp_update_postviews, wpp_get_views’

    i may have an outdated dabase version, i’m not sure.
    Could you help?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi @raphaelw,

    I was able to reproduce the problem thanks to your detailed report, I appreciate it! I’ll release a fix for this soon.

    For the time being, please find this code in your theme’s functions.php file:

    function custom_wpp_update_postviews($postid) {
    $accuracy = 30;
    if ( function_exists('wpp_get_views') && (mt_rand(0,100) < $accuracy) ) {
    update_post_meta(
    $postid,
    'views_weekly',
    wpp_get_views($postid, 'weekly', false)
    );
    }
    }
    add_action('wpp_post_update_views', 'custom_wpp_update_postviews');

    And comment it out, like so:

    function custom_wpp_update_postviews($postid) {
    $accuracy = 30;
    if ( function_exists('wpp_get_views') && (mt_rand(0,100) < $accuracy) ) {
    update_post_meta(
    $postid,
    'views_weekly',
    wpp_get_views($postid, 'weekly', false)
    );
    }
    }
    // add_action('wpp_post_update_views', 'custom_wpp_update_postviews');

    Once version 7.3.5 is out you can revert that change.

    Thread Starter raphaelw

    (@raphaelw)

    Thank you so much!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @raphaelw,

    Version 7.3.5 is out. It should fix the issue that you reported so please update as soon as you can, then undo the changes from my previous comment and you should be good to go.

    If you have any other comments / questions please let me know.

    Thread Starter raphaelw

    (@raphaelw)

    Thanks a million Hector!

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

You must be logged in to reply to this topic.