Support » Plugin: KK I Like It » Fatal error in version 1.7.5.2.

  • After updating tho this version, the plugin causes the wp_insert_post to crash when WordPress is creating new posts.

    This is because kkDataBase->getPostVoters attempts to run SQL even though there’s no post id (for content filter on a new post), causing syntax error in SQL:

    Debug information:

    [07-Feb-2014 17:14:28 UTC] WordPress database error
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    ‘ORDER BY wp_kklikeuser.date DESC’ at line 5 for query SELECT * FROM wp_kklikeuser
    LEFT JOIN (wp_users)
    ON (wp_users.ID = wp_kklikeuser.idwpuser)
    WHERE wp_kklikeuser.idlike =
    ORDER BY wp_kklikeuser.date DESC

    made by
    wp_insert_post,
    wp_transition_post_status,
    do_action(‘new_to_publish’),
    call_user_func_array,
    nxs_snapPublishTo,
    nxs_doPublishToFB,
    apply_filters(‘the_content’),
    call_user_func_array,
    addKKLikeVoters,
    kkDataBase->getPostVoters

    https://wordpress.org/plugins/kk-i-like-it/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Correction: not sure if the same bug weren’t present already in the preceing versions of the plugin.

    A bit of further info on this issue.

    The problem is not apparent in native WordPress. However, many plugins make use of do_action(‘new_to_publish’) or do_action(‘draft_to_publish’) in order to push new posts to social media etc. These hooks are fired from within wp_insert_post, causing the trouble.

    In my case, I use NextScripts: Social Networks Auto-Poster which hooks to new_to_publish action hook to relay the content of the new post to facebook. It then renders the post content whereupon WordPress fires the_content action hook, engaging KK I LIke it in the said manner.

    While this is a conflict between different plugins, I believe that you should be checking for valid post id in your function(s), according to this suggestion:

    public function getPostVoters($id){

    // Hack Martin 2014-02-07:
    if ( empty($id) ) {
    return 0;
    }

    … etc.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal error in version 1.7.5.2.’ is closed to new replies.