Changes between Initial Version and Version 1 of Ticket #40931, comment 7
- Timestamp:
- 09/13/2017 10:40:39 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #40931, comment 7
initial v1 1 I saw no pattern and have seen this error on multiple sites. It seems to be something that is triggered by bots that are spidering sites -- that is, when I have been able to trace the error in site logs, it often is triggered by a bot such as baidu. It d oesseem to help to add this line to the robots.txt for the site:1 I saw no pattern and have seen this error on multiple sites. It seems to be something that is triggered by bots that are spidering sites -- that is, when I have been able to trace the error in site logs, it often is triggered by a bot such as baidu. It did seem to help to add this line to the robots.txt for the site: 2 2 3 3 User-agent: * 4 4 Disallow: */embed/ 5 5 6 Though that is simply taking a step to discourage the triggering event, rather than actually addressing the underlying problem.6 Though that was simply taking a step to discourage the triggering event, rather than actually addressing the underlying problem. 7 7 8 And the reason that I amonly seeing this with bots may simply reflect that my site content is not commonly embedded elsewhere, so real human users wouldn't ordinarily be viewing the embeds.8 And the reason that I was only seeing this with bots may simply reflect that my site content is not commonly embedded elsewhere, so real human users wouldn't ordinarily be viewing the embeds. 9 9 10 But the better solution for me was simply to follow the recommendation of @aegis123 and put the modified/corrected embed-content.php file in my theme's directory. 11 12 I actually am using this code on line 33: 13 14 15 {{{ 16 if ( ($data['height'] > 0) && $data['width'] / $data['height'] > $aspect_ratio ) { 17 }}} 18 19 (Since it is only the missing height value that causes the divide by 0 error, I didn't see a need to validate the width value. If width is 0, but height is an integer, then width / height would simply produce a 0 value, which would always be < $aspect_ratio. But that's just my personal coding preference for simplicity - nothing wrong with checking both values.) 20 21 22 23 24 25