wordfence_created_ip_pattern_block

wordfence_created_ip_pattern_block

Appears in:
Hook Type: action

See hook in core

Displaying hooks found in version: wordfence.8.0.1

do_action('wordfence_created_ip_pattern_block') is found 4 times:

  • /models/block/wfBlock.php line 296
    			 * @param string $type The type of block.
    			 * @param string $reason The reason for the block.
    			 * @param string|array $parameters The IP address being blocked for IP blocks or the pattern for pattern blocks.
    			 */
    			do_action('wordfence_created_ip_pattern_block', $type, $reason, $ip);
    		}
    
    		if (!WFWAF_SUBDIRECTORY_INSTALL && class_exists('wfWAFIPBlocksController')) {
    			wfWAFIPBlocksController::setNeedsSynchronizeConfigSettings();
    		}
    	}
    
  • /models/block/wfBlock.php line 546
     
    		/**
    		 * @see wfBlock::createIP()
    		 */
    		do_action('wordfence_created_ip_pattern_block', self::TYPE_PATTERN, $reason, $parameters);
    
    		if (!WFWAF_SUBDIRECTORY_INSTALL && class_exists('wfWAFIPBlocksController')) {
    			wfWAFIPBlocksController::setNeedsSynchronizeConfigSettings();
    		}
    	}
    
    
  • /models/block/wfBlock.php line 616
    				if ($b['type'] == self::TYPE_IP_MANUAL || $b['type'] == self::TYPE_IP_AUTOMATIC_PERMANENT) {
    					/**
    					 * @see wfBlock::createIP()
    					 */
    					do_action('wordfence_created_ip_pattern_block', $b['type'], $b['reason'], $ip);
    				}
    
    				$ipHex = wfDB::binaryValueToSQLHex(wfUtils::inet_pton($ip));
    				return $wpdb->query($wpdb->prepare("INSERT INTO `{$blocksTable}` (`type`, `IP`, `blockedTime`, `reason`, `lastAttempt`, `blockedHits`, `expiration`, `parameters`) VALUES (%d, {$ipHex}, %d, %s, %d, %d, %d, NULL)", (int) $b['type'], (int) $b['blockedTime'], $b['reason'], (int) $b['lastAttempt'], (int) $b['blockedHits'], self::DURATION_FOREVER)) !== false;
    			case self::TYPE_COUNTRY:
    				if (!isset($b['parameters'])) { return false; }
    
  • /models/block/wfBlock.php line 706
     
    				/**
    				 * @see wfBlock::createIP()
    				 */
    				do_action('wordfence_created_ip_pattern_block', $b['type'], $b['reason'], $parameters);
    
    				$ipHex = wfDB::binaryValueToSQLHex(self::MARKER_PATTERN);
    				return $wpdb->query($wpdb->prepare("INSERT INTO `{$blocksTable}` (`type`, `IP`, `blockedTime`, `reason`, `lastAttempt`, `blockedHits`, `expiration`, `parameters`) VALUES (%d, {$ipHex}, %d, %s, %d, %d, %d, %s)", self::TYPE_PATTERN, (int) $b['blockedTime'], $b['reason'], (int) $b['lastAttempt'], (int) $b['blockedHits'], self::DURATION_FOREVER, json_encode($parameters))) !== false;
    		}
    
    		return false;