• Resolved koolpal007

    (@koolpal007)


    Hi,

    This is seen during a fresh install

    When installing this plugin with debug.log enabled, it triggers a notice
    [05-Mar-2024 14:40:42 UTC] PHP Notice: Function 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 [path]\wp-includes\functions.php on line 6031

    Additional digging seems to point to

    [path]\wp-content\plugins\classified-listing\app\Database\Migrations\Forms.php

    Line 39 onwards

    		// Create new form if table is empty
    		if ( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) ) {
    			$row = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) from $table" ) );
    			if ( ! $row ) {
    				$formData = FormPreDefined::sample();
    				Form::query()->insert( $formData );
    			}
    		}
    	}
    }

    Please check and guide.

    Thanks

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

The topic ‘PHP Notice: Function wpdb::prepare was called incorrectly.’ is closed to new replies.