This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# usage sh listdomains.sh ORGUUID | |
# Exit on error | |
set -e | |
# Stash org UUID | |
#ORG_UUID="99da9da0-46f1-4346-8bef-03325d645b5c" | |
VARNAME=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (defined('PANTHEON_ENVIRONMENT')) { | |
// Turns on WordPress debug settings in development and multidev environments, and disables in test and live. | |
if (!in_array(PANTHEON_ENVIRONMENT, array('test', 'live'))) { | |
// Debugging enabled. | |
if (!defined('WP_DEBUG')) { | |
ini_set( 'log_errors','On' ); | |
ini_set( 'display_errors','On' ); | |
ini_set( 'error_reporting', E_ALL ); | |
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bot_detected() { | |
$u_agent = $_SERVER['HTTP_USER_AGENT']; | |
if(strlen(strstr($u_agent,"Lighthouse")) > 0 ){ | |
return false; | |
} elseif(strlen(strstr($u_agent,"GTmetrix")) > 0 ){ | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bot_detected() { | |
$u_agent = $_SERVER['HTTP_USER_AGENT']; | |
if(strlen(strstr($u_agent,"Lighthouse")) > 0 ){ | |
return false; | |
} else { | |
return true; | |
} | |
} | |
add_action( 'init', 'my_deregister_init', 9999999999999999 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function additional_securityheaders( $headers ) { | |
if ( ! is_admin() ) { | |
$headers['Access-Control-Allow-Origin'] = '*'; | |
} | |
return $headers; | |
} | |
add_filter( 'wp_headers', 'additional_securityheaders' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WPCFM Helper | |
Plugin URI: https://pantheon.io | |
Description: Helper for WP CFM | |
Version: 0.1 | |
Author: Pantheon / Carl Alberto | |
Author URI: https://carlalberto.code.blog | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( !file_exists('blocked_ips.txt') ) { | |
$deny_ips = array( | |
'127.0.0.1', | |
); | |
} else { | |
$deny_ips = file('blocked_ips.txt'); | |
} | |
// read user ip adress: | |
$ip = isset($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR']) : ''; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$blockAgents = array('AhrefsBot','AspiegelBot', 'MJ12bot'); | |
foreach ($blockAgents as $agent) { | |
if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) { | |
exit(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Replace badcookiename with the cookie that you are trying to override | |
// Add in a custom plugin or theme's functions.php | |
add_action( | |
'init', | |
function() { | |
if ( isset( $COOKIE['wp-goodcookiename'] ) ) { | |
$COOKIE['badcookiename'] = $COOKIE['wp-goodcookiename']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Block WordPress xmlrpc.php requests | |
<Files xmlrpc.php> | |
order deny,allow | |
deny from all | |
allow from 123.123.123.123 | |
</Files> |
NewerOlder