Wordfence Security
[resolved] Null MySQL error (4 posts)

  1. On the scan page, before scanning

    Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/wordfence/lib/wfLog.php on line 631

    That was the only visible error I found on all the wf pages, however when I clicked scan an error popped up that the tables were missing. That is related to this issue:

    Perhaps in your registration hook you can check to ensure the tables have been created and if not display a message and disable the plugin?


  2. Wordfence
    Plugin Author

    Posted 4 years ago #

    We do check that tables have been created in our activation hook and create the tables if they don't exist. The check is also done every time you upgrade Wordfence through a mechanism outside the activation hook because it's unreliable. Did you manually delete the Wordfence tables? That's the only way I can see that you'd get this error.

  3. WF did NOT create the tables on install/activation. This is because your DB connector code has a bug in it that does not allow valid values for DB authentication. See the following for the code fix http://wordpress.org/support/topic/wordfence-install-error?replies=9 . This is another reason to use the built in database object rather than creating your own ;)

    Later on your code is not verifying that the tables have been successfully created. You should probably add a check to ensure the tables have been created/updated on activation/update and disable the plugin with a message to the user about how to fix it if they are not available.

  4. Wordfence
    Plugin Author

    Posted 4 years ago #

    OK that makes sense. So the connection failed to get set up and the schema was never created. I've upped the priority on this fix.

    Thanks very much for your detailed bug reports!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Wordfence Security
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.