• Resolved leemon

    (@leemon)


    Hello,

    Your plugin throws some warnings:

    Notice: wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.) in /xxxx/public_html/wp-includes/functions.php on line 4667
    
    Notice: wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.) in /xxxx/public_html/wp-includes/functions.php on line 4667

    I think line 29 in the pie.php file is the culprit:

    $consulta = $wpdb->prepare( $sql , null );

    prepare() cannot have a null value as a second argument. In fact, as your SQL query doesn’t have any placeholders I don’t think it’s necessary to “prepare” it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter leemon

    (@leemon)

    You only see these warnings with the WP_DEBUG constant to TRUE

    Plugin Author ABCdatos

    (@abcdatos)

    Hi leemon,

    You are right, there is no placeholders for this query and no preparation needed.

    I replaced:

    $consulta = $wpdb->prepare( $sql , null );
    $resultado = $wpdb->get_var( $consulta );

    by:

    $resultado = $wpdb->get_var( $sql );

    Next version will have this applied. Trunk version have been updated.

    Thanks for your contribution!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Some warnings’ is closed to new replies.