Title: achbed's Replies | WordPress.org

---

# achbed

  [  ](https://wordpress.org/support/users/achbed/)

 *   [Profile](https://wordpress.org/support/users/achbed/)
 *   [Topics Started](https://wordpress.org/support/users/achbed/topics/)
 *   [Replies Created](https://wordpress.org/support/users/achbed/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/achbed/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/achbed/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/achbed/engagements/)
 *   [Favorites](https://wordpress.org/support/users/achbed/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Botnet Blocker] Blocker Stat](https://wordpress.org/support/topic/blocker-stat/)
 *  Plugin Author [achbed](https://wordpress.org/support/users/achbed/)
 * (@achbed)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/blocker-stat/#post-8790201)
 *     ```
       	global $wp_plugin_bnblocker;
       	if ( method_exists( $wp_plugin_bnblocker, 'is_botnet' ) ) {
       		if ( $wp_plugin_bnblocker->is_botnet() ) {
       			status_header( 203 );
       			// Do other changes here
       		}
       	}
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[GatherContent Plugin] Import: Don’t Change WP Post Status](https://wordpress.org/support/topic/import-dont-change-wp-post-status/)
 *  Thread Starter [achbed](https://wordpress.org/support/users/achbed/)
 * (@achbed)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/import-dont-change-wp-post-status/#post-8670491)
 * General note: this mas merged to the master branch of the github repository today.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[GatherContent Plugin] Import: Don’t Change WP Post Status](https://wordpress.org/support/topic/import-dont-change-wp-post-status/)
 *  Thread Starter [achbed](https://wordpress.org/support/users/achbed/)
 * (@achbed)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/import-dont-change-wp-post-status/#post-8665483)
 * Patch to add this behavior:
 *     ```
       Index: includes/classes/admin/mapping/base.php
       ===================================================================
       --- includes/classes/admin/mapping/base.php	(revision 1576743)
       +++ includes/classes/admin/mapping/base.php	(working copy)
       @@ -174,10 +174,11 @@
        				break;
        			case 'post_status':
        				$select_options = array(
       -					'publish' => __( 'Published', 'gathercontent-import' ),
       -					'draft'   => __( 'Draft', 'gathercontent-import' ),
       -					'pending' => __( 'Pending', 'gathercontent-import' ),
       -					'private' => __( 'Private', 'gathercontent-import' ),
       +					'publish'  => __( 'Published', 'gathercontent-import' ),
       +					'draft'    => __( 'Draft', 'gathercontent-import' ),
       +					'pending'  => __( 'Pending', 'gathercontent-import' ),
       +					'private'  => __( 'Private', 'gathercontent-import' ),
       +					'nochange' => __( 'Do not change', 'gathercontent-import' ),
        				);
        				break;
        			case 'post_type':
       Index: includes/classes/sync/pull.php
       ===================================================================
       --- includes/classes/sync/pull.php	(revision 1576743)
       +++ includes/classes/sync/pull.php	(working copy)
       @@ -223,7 +223,9 @@
        		}
   
        		if ( $status = $this->mapping->get_wp_status_for_item( $this->item ) ) {
       -			$post_data['post_status'] = $status;
       +			if ( $status != 'nochange' ) {
       +				$post_data['post_status'] = $status;
       +			}
        		}
   
        		$backup = array();
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Botnet Blocker] Blocker Stat](https://wordpress.org/support/topic/blocker-stat/)
 *  Plugin Author [achbed](https://wordpress.org/support/users/achbed/)
 * (@achbed)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/blocker-stat/#post-6621295)
 * All blocks still get reported as an Apache-level return value (404 if you use
   the built-in blocking mechanism). You can track things from there. The one thing
   you won’t see is that the 404 was caused by this plugin.
 * On one of my sites I’m using the plugin to cause a 203 result instead of a 404,
   and returning alternate (less server taxing) set of data to the visitor/bot. 
   I can then check my Apache logs to see the portion of results returned this way(
   since I had almost no 203 results before, this makes the most sense and least
   effort on the plugin).
 * Adding an internal logging mechanism could be handy, but presents all sorts of
   log rotation/clearing, external log, and reporting/analysis issues. Not something
   I can dive into right now.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Botnet Blocker] PHP Fatal error: Call to a member function set_404()](https://wordpress.org/support/topic/php-fatal-error-call-to-a-member-function-set_404/)
 *  Plugin Author [achbed](https://wordpress.org/support/users/achbed/)
 * (@achbed)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-call-to-a-member-function-set_404/#post-6621294)
 * Marking resolved.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Botnet Blocker] PHP Fatal error: Call to a member function set_404()](https://wordpress.org/support/topic/php-fatal-error-call-to-a-member-function-set_404/)
 *  Plugin Author [achbed](https://wordpress.org/support/users/achbed/)
 * (@achbed)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-call-to-a-member-function-set_404/#post-6621293)
 * This should be fixed in v1.2.3.
 * The issue was that we were blocking during an action that was before the global`
   wp_query` object was set up. We now check for bots in the `pre_get_posts` action,
   and set the query to a 404 at that point instead.

Viewing 6 replies - 1 through 6 (of 6 total)