Spider Blocker - Version 1.0.19

Version Description

Download this release

Release Info

Developer niteoweb
Plugin Icon 128x128 Spider Blocker
Version 1.0.19
Comparing to
See all releases

Code changes from version 1.0.18 to 1.0.19

Files changed (2) hide show
  1. index.php +9 -10
  2. readme.txt +2 -2
index.php CHANGED
@@ -5,7 +5,7 @@ namespace Niteoweb\SpiderBlocker;
5
  /**
6
  * Plugin Name: Spider Blocker
7
  * Description: Spider Blocker will block most common bots that consume bandwidth and slow down your server.
8
- * Version: 1.0.18
9
  * Runtime: 5.3+
10
  * Author: Easy Blog Networks
11
  * Text Domain: spiderblocker
@@ -592,16 +592,15 @@ class SpiderBlocker {
592
  * @param bool $public Blog's public status fetched from the database.
593
  */
594
  public function robots_file( $output, $public ) {
595
- // Get bots list.
596
- $data = $this->get_bots();
 
 
597
 
598
- if ( $data ) {
599
- foreach ( $data as $entry ) {
600
- if ( ! empty( $entry['state'] ) ) {
601
- $output .= sprintf( "User-agent: %s\n", $entry['re'] );
602
- $output .= "Disallow: /\n";
603
- $output .= "\n";
604
- }
605
  }
606
  }
607
 
5
  /**
6
  * Plugin Name: Spider Blocker
7
  * Description: Spider Blocker will block most common bots that consume bandwidth and slow down your server.
8
+ * Version: 1.0.19
9
  * Runtime: 5.3+
10
  * Author: Easy Blog Networks
11
  * Text Domain: spiderblocker
592
  * @param bool $public Blog's public status fetched from the database.
593
  */
594
  public function robots_file( $output, $public ) {
595
+ foreach ( $this->get_bots() as $bot ) {
596
+ if ( is_array( $bot ) ) {
597
+ $bot = (object) $bot;
598
+ }
599
 
600
+ if ( ! empty( $bot->state ) ) {
601
+ $output .= sprintf( "User-agent: %s\n", $bot->re );
602
+ $output .= "Disallow: /\n";
603
+ $output .= "\n";
 
 
 
604
  }
605
  }
606
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: niteoweb
3
  Tags: seo, block, bots, htaccess, apache, secure
4
  Requires at least: 4.0
5
- Tested up to: 4.9.7
6
- Stable tag: 1.0.18
7
 
8
  SpiderBlocker will block most common bots that consume bandwidth and slow down your server.
9
 
2
  Contributors: niteoweb
3
  Tags: seo, block, bots, htaccess, apache, secure
4
  Requires at least: 4.0
5
+ Tested up to: 4.9.8
6
+ Stable tag: 1.0.19
7
 
8
  SpiderBlocker will block most common bots that consume bandwidth and slow down your server.
9