Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block WPsites

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View remove-update-nag.php
Plugin Name: Remove Update Nag
Description: Remove WordPress update nag as not needed
function remove_core_updates()
if(! current_user_can('update_core')){return;}
WPsites / wp-config.php
Created Sep 4, 2014
wp config file for symlinked installs
View wp-config.php
WPsites / gist:6100723
Created Jul 28, 2013
Elasticsearch index mapping confirmation for debug..
View gist:6100723
curl -XGET ''
"logstash-2013.07.29" : {
"syslog" : {
"_all" : {
"enabled" : false
"properties" : {
"@fields" : {
WPsites / gist:6083397
Last active Dec 20, 2015
Function to inspect WordPress filters/actions that match a regular expression
View gist:6083397
//hook into the 'shutdown' action and debug some filters... but not on the admin this time
if (! is_admin() )
add_action('shutdown', 'use_debug_filters',10);
function use_debug_filters(){
echo "<h3>Output hooks and filters that contain the string 'init'</h3>";
WPsites / gist:5783087
Created Jun 14, 2013
Example restore code added to a backup file created automatically with the WPide plugin
View gist:5783087
<?php /* start WPide restore code */
if ($_POST["restorewpnonce"] === "d859796ed783fd60ae9fc9db3a5e32a585e948a587"){
if ( file_put_contents ( "/var/www/sites/" , preg_replace("#<\?php /\* start WPide(.*)end WPide restore code \*/ \?>#s", "", file_get_contents("/var/www/sites/") ) ) ){
echo "Your file has been restored, overwritting the recently edited file! \n\n The active editor still contains the broken or unwanted code. If you no longer need that content then close the tab and start fresh with the restored file.";
echo "-1";
WPsites / logstash.index.json
Last active Sep 17, 2017
Elasticsearch index template for logstash that contains additional NGINX fields
View logstash.index.json
"template" : "logstash*",
"settings" : {
"number_of_shards" : 5,
"index.cache.field.type" : "soft",
"index.refresh_interval" : "5s",
"" : true,
"index.query.default_field" : "message",
"index.routing.allocation.total_shards_per_node" : 5
WPsites / time-stack.php
Created Jan 23, 2013
WordPress TimeStack plugin modified to write data to disk if a persistant object cache doesn't look like it's available
View time-stack.php
Plugin Name: WordPress TimeStack
Description: WordPress Profiling
Author: Human Made Limited
Version: 0.9
class HM_Time_Stack {
WPsites / gist:4563990
Created Jan 18, 2013
The WordPress Category Icons plugin had problems with incorrect paths when used on a non standard WordPress setup, which I've fixed in this code
View gist:4563990
Plugin Name: Category Icons
Plugin URI:
Description: Easily assign icons to your categories. (Minimum WP version : 2.8)
Version: 2.2.3
Author: Brahim Machkouri
Author URI:
Text Domain: category_icons
Domain Path: /languages/
WPsites / gist:4232931
Created Dec 7, 2012
Logstash config test - failing!
View gist:4232931
input {
<% if node['logstash']['server']['inputs'].empty? -%>
tcp {
type => "tcp-input"
port => "5959"
format => "json_event"
<% else -%>
<%= LogstashConf.section_to_str(node['logstash']['server']['inputs']) %>
<% end -%>
WPsites / gist:4193981
Created Dec 3, 2012
Opscode Chef logstash cookbook - filters.json - WIP
View gist:4193981
"filters": [
"grok": {
"type": "syslog",
"pattern": [
"<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{PROG:syslog_program}(?:[%{POSINT:syslog_pid}])?: %{GREEDY$
"add_field": {
You can’t perform that action at this time.