Skip to content

Instantly share code, notes, and snippets.

@wycks
wycks / Remove-Stuff.php
Last active November 17, 2021 23:45
Remove WordPress Admin Stuff
<?php
/**
* @package WordPress
* @subpackage WP-Skeleton
*/
// REMOVE SOME HEADER OUTPUT
function Wps_remove_header_info() {
remove_action('wp_head', 'rsd_link');
WordPress block botnet brute force with Mod_security
SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000134
<Locationmatch "/wp-login.php">
# Setup brute force detection.
# React if block flag has been set.
SecRule user:bf_block "@gt 0" "deny,status:401,log,id:5000135,msg:'ip address blocked for 5 minutes, more than 10 login attempts in 3 minutes.'"
# Setup Tracking. On a successful login, a 302 redirect is performed, a 200 indicates login failed.
SecRule RESPONSE_STATUS "^302" "phase:5,t:none,nolog,pass,setvar:ip.bf_counter=0,id:5000136"
SecRule RESPONSE_STATUS "^200" "phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000137"
@wycks
wycks / fuckstrap.css
Last active December 17, 2015 06:29
FuckStrap.css - A framework so terse it shits diamonds.
/*Pixel straps start here*/
/*Scroll hard for % straps*/
.0{ width: 0px;}
.1{ width: 1px;}
.2{ width: 2px;}
.3{ width: 3px;}
.4{ width: 4px;}
.5{ width: 5px;}
.6{ width: 6px;}
@wycks
wycks / meta-box-snip.php
Created July 3, 2013 20:05
Adds meta box to posts, pages and custom post types (including default ones ..attachment, menu and revisions).
<?php
$post_types= get_post_types('','names');
$posts_separated = implode(",", $post_types);
$screens = array( 'post', 'page', $posts_separated);
foreach ($screens as $screen) {
add_meta_box( 'styles', 'hello', 'callback_func', $screen, 'advanced', 'high');
}
@wycks
wycks / wp-parse-functions.php
Last active December 21, 2015 05:39
Parse all WP functions
<?php
//just load it the way WP does
include dirname(__FILE__) . '/wp-blog-header.php';
require_once(ABSPATH . 'wp-admin/includes/admin.php');
$functions = get_defined_functions();
$i = 0; //count them
// set to user, we don't want internal functions
@wycks
wycks / wp-link-form.html
Created September 1, 2013 05:42
wp-link-form
@wycks
wycks / Preferances.sublime-settings.json
Last active December 22, 2015 05:48
Sublime User Settings
{
"auto_complete_selector": "source, text",
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"drag_text": false,
"font_face": "Consolas",
"font_size": 13,
"highlight_line": true,
"highlight_modified_tabs": true,
@wycks
wycks / remove-stuff.php
Created October 16, 2013 19:53
Remove stuff is removed from https://github.com/wycks/WP-Skeleton-Theme and is now here.
<?php
/**
* @package WordPress
* @subpackage WP-Skeleton
*/
// REMOVE SOME HEADER OUTPUT
function Wps_remove_header_info() {
remove_action('wp_head', 'rsd_link');
<?php
//get all ze hooks
$Directory = new RecursiveDirectoryIterator( 'WordPress\3.7' );
$Iterator = new RecursiveIteratorIterator( $Directory );
$regex = new RegexIterator( $Iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH );
foreach ( $regex as $filename=>$file ) {
@wycks
wycks / GhettoPress.php
Last active October 8, 2015 05:01
WordPress Ghetto Loader - stop doing this, you
<?php
//Load WorsPress quick and dirty into something not WordPress. This is horrible I know,
//But the database queries they are so low, and it's just so dirty
//install WordPress in a dir like /lib or something and stick classPageLoader.php in there, ha!
//Example use for a index.php or whatever, no autoloading here!
#######################################################
require('lib/classPageLoader.php');
$content = new LoadWpContent();