Quantcast
Channel: WordPress.org Forums » [Wordfence Security - Firewall, Malware Scan, and Login Security] Support
Viewing all articles
Browse latest Browse all 33292

wfBlock->allBlocks wpdb query gets wrong table rows

$
0
0

Replies: 2

Hi, I have a few persistent PHP errors and warnings with Wordfence. Here is the error message:

[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined property: stdClass::$option_value in wp-cron.php on line 72
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: type in wp-content/plugins/wordfence/models/block/wfBlock.php on line 722
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: type in wp-content/plugins/wordfence/models/block/wfBlock.php on line 722
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: IP in wp-content/plugins/wordfence/models/block/wfBlock.php on line 726
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: type in wp-content/plugins/wordfence/models/block/wfBlock.php on line 730
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: type in wp-content/plugins/wordfence/models/block/wfBlock.php on line 730
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: id in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: type in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: blockedTime in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: reason in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: lastAttempt in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: blockedHits in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Notice:  Undefined index: expiration in wp-content/plugins/wordfence/models/block/wfBlock.php on line 734
[30-Mar-2021 09:41:40 UTC] PHP Fatal error:  Uncaught OutOfBoundsException: ipRange is not a valid property for this block type in wp-content/plugins/wordfence/models/block/wfBlock.php:1160
Stack trace:
#0 wp-content/plugins/wordfence/waf/wfWAFIPBlocksController.php(63): wfBlock->__get('ipRange')
#1 [internal function]: wfWAFIPBlocksController::synchronizeConfigSettings()
#2 {main}[31-Mar-2021 15:30:12 UTC] PHP Warning:  An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. 
If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. 
Please contact your server administrator.) in wp-includes/update.php on line 175

After adding my own error logging to this plugin I’ve determined that this happens because when wfBlock->allBlocks is called the DB query *somehow* is retrieving some of my post meta rows along with the Wordfence block table’s rows.

Here is the db query which is somehow retrieving my post meta rows:

SELECT *, CASE 
WHEN <code>type</code> = 3 THEN 0
WHEN <code>type</code> = 4 THEN 1
WHEN <code>type</code> = 7 THEN 2
WHEN <code>type</code> = 6 THEN 3
WHEN <code>type</code> = 5 THEN 4
WHEN <code>type</code> = 9 THEN 5
WHEN <code>type</code> = 8 THEN 6
WHEN <code>type</code> = 2 THEN 7
WHEN <code>type</code> = 1 THEN 8
ELSE 9999
END AS <code>typeSort</code>, CASE 
WHEN <code>type</code> = 3 THEN <code>parameters</code>
WHEN <code>type</code> = 4 THEN <code>parameters</code>
WHEN <code>type</code> = 1 THEN <code>IP</code>
WHEN <code>type</code> = 9 THEN <code>IP</code>
WHEN <code>type</code> = 5 THEN <code>IP</code>
WHEN <code>type</code> = 6 THEN <code>IP</code>
WHEN <code>type</code> = 7 THEN <code>IP</code>
WHEN <code>type</code> = 2 THEN <code>IP</code>
WHEN <code>type</code> = 8 THEN <code>IP</code>
ELSE 9999
END AS <code>detailSort</code>
 FROM <code>wp_wfblocks7</code> WHERE <code>type</code> IN (4) AND (<code>expiration</code> = 0 OR <code>expiration</code> > UNIX_TIMESTAMP()) ORDER BY <code>typeSort</code> ASC, <code>id</code> DESC

We are using version Wordfence 7.4.12 and WordPress 5.7.


Viewing all articles
Browse latest Browse all 33292

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>