Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Bots are Blocked by Default

Status Resolved
Add-on / Version Speedy 1.8.0
Severity
EE Version 6.3.5

Patmos Inc

Jan 17, 2023

Contrary to the docs which state that the bots are not blocked by default, the logic for blocking bots does the opposite. In mod.speedy.php on line 974 there is this code. This line is the same in version 1.7.0.

// Block bot traffic
 if (ee()->config->item('speedy_block_bots') !== 'no' && $this->isBot()) {
     return false;
}

If there is not a config item for ‘speedy_block_bots’, then it will return false resulting in the statement “false !== ‘no’‘’ which reads as true. I noticed this error because I loaded the addon onto production without this tag and I was consistently getting slow page loads but randomly. After some digging I realized they were all search bots, so I added in $config[‘speedy_block_bots’] = “no”; and this fixed the issue.

The above code should be rewritten to:

$speedy_block_bots = ee()->config->item('speedy_block_bots');
 if ($speedy_block_bots  && $speedy_block_bots !== 'no' && $this->isBot()) {
     return false;
}

 

#1

BoldMinded (Brian)

Comment has been marked private.

#2

Patmos Inc

Comment has been marked private.

#3

BoldMinded (Brian)

Yeah I thought about that and I guess err’d on the side of what if the config item isn’t set at all. I’ll double check it to make sure it doesn’t throw an error if the config key speedy_block_bots isn’t even present.

Login to reply