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
<?php | |
/** | |
* @package active-plugins | |
* @version 1.0 | |
* | |
* Plugin Name: Active Plugins | |
* Plugin URI: http://wordpress.org/extend/plugins/# | |
* Description: This is a development plugin | |
* Author: Carlo Daniele | |
* Version: 1.0 |
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
<?php | |
$file = 'filetosend.zip'; | |
$remote_file = 'destinationfilename.zip'; | |
$ftp_server = '127.0.0.1'; | |
$ftp_user_name = 'ftp@domain.com'; | |
$ftp_user_pass = 'ftpPASSWORD'; | |
$conn_id = ftp_connect($ftp_server); | |
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); |
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
/** | |
* Add security headers for Nginx based sites | |
* | |
* @param [type] $headers add security headers as array. | |
* | |
* @return array | |
*/ | |
function additional_securityheaders( $headers ) { | |
if ( ! is_admin() ) { | |
$headers['Referrer-Policy'] = 'no-referrer-when-downgrade'; |
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']) : ''; | |
NewerOlder