Fatal error in debug log

I have the latest version of Defender installed. Defender is saving a fatal error on the debug.log:

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function wpdb::prepare(), 1 passed and exactly 2 expected in /home/***/domains/***/public_html/wp-includes/wp-db.php:1291 Stack trace: #0 [internal function]: wpdb->prepare('t1.meta_value I...') #1 /home/***/domains/***/public_html/wp-content/plugins/wp-defender/vendor/hammer/wp/model.php(344): call_user_func_array(Array, Array) #2 /home/***/domains/***/public_html/wp-content/plugins/wp-defender/vendor/hammer/wp/model.php(324): Hammer\WP\Model::_buildWhere(1, 'meta_value', Array) #3 /home/***/domains/***/public_html/wp-content/plugins/wp-defender/vendor/hammer/wp/model.php(226): Hammer\WP\Model::buildWhere(Array) #4 /home/***/domains/***/public_html/wp-content/plugins/wp-defender/app/module/scan/model/scan.php(141): Hammer\WP\Model::count(Array) #5 /home/***/domains/***/public_html/wp-content/plugins/wp-defender/app/controller/dashboard.php(170): WP_Defender\M in /home/***/domains/***/public_html/wp-includes/wp-db.php on line 1291

WordPress version - 4.7.5 and PHP version - 7.0.19

  • Ash

    Hello Julian

    I have just tested in my test site and it worked without any fatal error, maybe our scenarios are different.

    It seems some other codes are altering the prepare query using any hook, though it's not guaranteed. But to make sure, would you please run a conflict test? Please deactivate all plugins except this one and check if the problem gone. If so, then enable all plugins one by one and find which one is having conflict. You need to do the same with themes as well.

    You can find the flowchart here: https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-1

    Please let us know how it goes.

    Have a nice day!

    Cheers,
    Ash

  • Julian

    Hey Ash,

    I had cleared the debug log and the fatal error hasn't appeared again. Instead I'm getting the following:

    PHP Warning: Missing argument 2 for wpdb::prepare() in /home/******/domains/******/public_html/wp-includes/wp-db.php on line 1291 [16-Jun-2017 09:06:24 UTC] PHP Notice: wpdb::prepare werd verkeerd aangeroepen. Het query-argument wpdb::prepare() moet een waarde bevatten. Lees alles over foutopsporing in WordPress voor meer informatie. (Dit bericht is toegevoegd in versie 3.9.0.) in /home/******/domains/******/public_html/wp-includes/functions.php on line 4139 [16-Jun-2017 09:06:24 UTC] WordPress databasefout 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 ')' at line 1 bij query SELECT count(ID) FROM ******_posts AS t0 INNER JOIN ******_postmeta as t1 ON t1.post_id=ID AND t1.meta_key='type' INNER JOIN ******_postmeta as t2 ON t2.post_id=ID AND t2.meta_key='dateFixed' INNER JOIN ******_postmeta as t3 ON t3.post_id=ID AND t3.meta_key='dateIgnored' INNER JOIN ******_postmeta as t4 ON t4.post_id=ID AND t4.meta_key='raw' WHERE t0.post_type='wdf_scan_item' AND t0.post_status = 'issue' AND t0.post_parent = '2000' AND t1.meta_value IN () gemaakt door require_once('wp-admin/admin.php'), require('wp-admin/menu.php'), require_once('wp-admin/includes/menu.php'), apply_filters('menu_order'), WP_Hook->apply_filters, WP_Defender\Controller\Dashboard->menuOrder, WP_Defender\Controller\Dashboard->countTotalIssues, WP_Defender\Module\Scan\Model\Scan->countAll, Hammer\WP\Model::count [16-Jun-2017 09:07:02 UTC] PHP Warning: Missing argument 2 for wpdb::prepare() in /home/******/domains/******/public_html/wp-includes/wp-db.php on line 1291 [16-Jun-2017 09:07:02 UTC] PHP Notice: wpdb::prepare werd verkeerd aangeroepen. Het query-argument wpdb::prepare() moet een waarde bevatten. Lees alles over foutopsporing in WordPress voor meer informatie. (Dit bericht is toegevoegd in versie 3.9.0.) in /home/******/domains/******/public_html/wp-includes/functions.php on line 4139 [16-Jun-2017 09:07:02 UTC] WordPress databasefout 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 ')' at line 1 bij query SELECT count(ID) FROM ******_posts AS t0 INNER JOIN ******_postmeta as t1 ON t1.post_id=ID AND t1.meta_key='type' INNER JOIN ******_postmeta as t2 ON t2.post_id=ID AND t2.meta_key='dateFixed' INNER JOIN ******_postmeta as t3 ON t3.post_id=ID AND t3.meta_key='dateIgnored' INNER JOIN ******_postmeta as t4 ON t4.post_id=ID AND t4.meta_key='raw' WHERE t0.post_type='wdf_scan_item' AND t0.post_status = 'issue' AND t0.post_parent = '2000' AND t1.meta_value IN () gemaakt door require('wp-admin/menu.php'), require_once('wp-admin/includes/menu.php'), apply_filters('menu_order'), WP_Hook->apply_filters, WP_Defender\Controller\Dashboard->menuOrder, WP_Defender\Controller\Dashboard->countTotalIssues, WP_Defender\Module\Scan\Model\Scan->countAll, Hammer\WP\Model::count

  • Ash

    Hello Julian

    We could not replicate the issue yet, so would you please send your admin and ftp login so that we can try on your site?

    You can send us privately in the following format:
    1. Please go to https://premium.wpmudev.org/contact/
    2. Select "I have a different question"
    3. In subject line put "Attn-Hoang NGO" (this will ensure that the email is assigned to him)
    4. Provide the wanted details.
    5. Add the thread link in the message so that I can track.

    Have a nice day!

    Cheers,
    Ash