Skip to content

Instantly share code, notes, and snippets.

@tokkonopapa
tokkonopapa / class-ip-geo-block.php
Created January 26, 2018 14:01
Fix the issue of conflict with Mail Poet 2.
<?php
/**
* IP Geo Block
*
* @package IP_Geo_Block
* @author tokkonopapa <[email protected]>
* @license GPL-2.0+
* @link http://www.ipgeoblock.com/
* @copyright 2013-2018 tokkonopapa
*/
@tokkonopapa
tokkonopapa / ip-geo-block.php
Created September 1, 2017 12:23
Fix a bug of Emergent Functionality
<?php
/**
* IP Geo Block
*
* A WordPress plugin that blocks undesired access based on geolocation of IP address.
*
* @package IP_Geo_Block
* @author tokkonopapa <[email protected]>
* @license GPL-2.0+
* @link http://www.ipgeoblock.com/
@tokkonopapa
tokkonopapa / class-ip-geo-block-cron.php
Last active August 26, 2017 14:11
Fix the issue that an error message would not be shown when download/read/write error happens.
<?php
/**
* IP Geo Block - Cron Class
*
* @package IP_Geo_Block
* @author tokkonopapa <[email protected]>
* @license GPL-2.0+
* @link http://www.ipgeoblock.com/
* @copyright 2013-2017 tokkonopapa
*/
@tokkonopapa
tokkonopapa / class-ip-geo-block.php
Created August 13, 2017 18:46
Debug compatibility with Awesome Support plugin
<?php
/**
* IP Geo Block
*
* @package IP_Geo_Block
* @author tokkonopapa <[email protected]>
* @license GPL-2.0+
* @link http://www.ipgeoblock.com/
* @copyright 2013-2017 tokkonopapa
*/
{
"ip_geo_block_settings[version]": "3.0.2.2",
"ip_geo_block_settings[matching_rule]": "0",
"ip_geo_block_settings[white_list]": "FR",
"ip_geo_block_settings[black_list]": "ZZ",
"ip_geo_block_settings[extra_ips][white_list]": "209.15.20.235",
"ip_geo_block_settings[extra_ips][black_list]": "",
"ip_geo_block_settings[signature]": "../,/wp-config.php,/passwd",
"ip_geo_block_settings[login_fails]": "5",
"ip_geo_block_settings[response_code]": "403",
@tokkonopapa
tokkonopapa / ip-geo-block.php
Created March 23, 2017 09:56
Emergent Functionality
<?php
/**
* IP Geo Block
*
* A WordPress plugin that blocks undesired access based on geolocation of IP address.
*
* @package IP_Geo_Block
* @author tokkonopapa <[email protected]>
* @license GPL-2.0+
* @link http://www.ipgeoblock.com/
@tokkonopapa
tokkonopapa / drop-in.php
Created March 17, 2017 16:54
In case $_SERVER[‘REMOTE_ADDR’] returns 127.0.0.1
<?php
/**
* Example 2: Usage of 'ip-geo-block-ip-addr'
* Use case: Retrieve ip address behind the proxy
*
* @param string $ip original ip address
* @return string $ip replaced ip address
*/
function my_retrieve_ip( $ip ) {
if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
@tokkonopapa
tokkonopapa / uninstall.php
Created March 11, 2017 09:57
Clean uninstall for IP Geo Block
<?php
/**
* Fired when the plugin is uninstalled.
*
* @package IP_Geo_Block
* @author tokkonopapa <[email protected]>
* @license GPL-2.0+
* @link http://www.ipgeoblock.com/
* @copyright 2013-2017 tokkonopapa
*/
@tokkonopapa
tokkonopapa / functions.php
Last active February 18, 2017 19:30
like button for theme belle
<?php
/**
* Add action for like button of theme 'belle' to IP Geo Block whitelist
*
* @link http://themecanon.com/belle/
*/
function my_ip_geo_block_bypass_admins( $list ) {
$whitelist = array(
'like_post',
@tokkonopapa
tokkonopapa / drop-in.php
Created February 11, 2017 17:14
Add GravityView actions to IP Geoblock whitelist
<?php
/**
* Add GravityView actions to IP Geoblock whitelist
*
*/
function gravityview_ip_geoblock_bypass_admins( $queries ) {
$whitelist = array(
'gv_datatables_data',