• I went to check something on my company webpage today and came across a few errors.

    After several hours of extremely frustrating searching, trying, searching, etc I am posting for some help.

    IF you go to webstie “www.shopstarboard.com you will see right away at the top of the page that I have the following error:
    Warning: Missing argument 2 for wpdb::prepare(), called in /home3/starboar/public_html/wp-content/plugins/wp-post-thumbnail/wppt.php on line 372 and defined in /home3/starboar/public_html/wp-includes/wp-db.php on line 1285

    So, I attempted to login to update a plugin and I get the following errors on the login page –

    Warning: Missing argument 2 for wpdb::prepare(), called in /home3/starboar/public_html/wp-content/plugins/wp-post-thumbnail/wppt.php on line 372 and defined in /home3/starboar/public_html/wp-includes/wp-db.php on line 1285
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-login.php on line 402
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-login.php on line 415

    Directly above the login input I get – ERROR: Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums.

    Then I input my username and password and I get more errors at the top –

    Warning: Missing argument 2 for wpdb::prepare(), called in /home3/starboar/public_html/wp-content/plugins/wp-post-thumbnail/wppt.php on line 372 and defined in /home3/starboar/public_html/wp-includes/wp-db.php on line 1285
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-login.php on line 402
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-login.php on line 415
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-includes/pluggable.php on line 892
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-includes/pluggable.php on line 893
    
    Warning: Cannot modify header information - headers already sent by (output started at /home3/starboar/public_html/wp-includes/wp-db.php:1285) in /home3/starboar/public_html/wp-includes/pluggable.php on line 894

    I have fillezilla, and I found the file – wp-post-thumbnail/wppt.php. I then went to line 372 and this is what I have –

    
    
    		/**
    		* Get presets from "wppt_preset" database table
    		*
    		* @return array
    		*/
    		function getPreset() {
    			global $wpdb;
    			return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->wppt_preset_db" ) );
    		}

    Im stuck. I can’t find the actual source code to see how it needs to be changed. I looked up similar errors but they were for other plugins and so the code is different.

    Any help is greatly appreciated!

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you turn off WordPress debugging “Warnings” will not be displayed.
    https://codex.wordpress.org/WP_DEBUG
    This wont fix your problem but it will stop showing these messages to visitors while you try and resolve.

    And then, you should contact the plugin author (WP Post Thumbnail) for assistance with this – I am sure they will be able to provide more insight into the specific issue

    Here’s an explanation for why you see that message: https://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/

    WP Post Thumbnail appears to be abandoned. It hasn’t had any development in over 2 years. It may be time to look for a replacement option – or, as @whitsey mentions, turn off displaying of PHP errors and continue using it if it’s still functioning to your satisfaction.

    Thread Starter shopstarboard

    (@shopstarboard)

    Thank you all for the help. I followed that link, and still couldn’t get it to turn off. I ended up following the instructions on THIS WEBSITE

    If you don’t have the time, or want to take the time, the instructions are –

    Find WP-config.php file through FTP site.

    Find the line –

    define(‘WP_DEBUG’, false);

    and replace it with –

    ini_set(‘log_errors’,’On’);
    ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL );
    define(‘WP_DEBUG’, false);
    define(‘WP_DEBUG_LOG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);

    Im now able to log in to the site. Thank you very much. Lastly, any recommendations for a plugin replacement for WP Post Thumbnail? Maybe the better question first would be – how can I tell if Im even using that plugin? I don’t want to disable it but how do I know if Im actually using it in someway Im unsure of? lol!

    thanks again

    • This reply was modified 7 years, 7 months ago by shopstarboard.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing Argument 2 and can’t login’ is closed to new replies.