Skip to content

Instantly share code, notes, and snippets.

@getsource
getsource / WP_Bag_of_Tricks.txt
Created October 26, 2011 21:07 — forked from boogah/WP_Bag_of_Tricks.txt
Things I've learned by being DreamHost's resident WordPress nerd.
WP Bag of Tricks
1. Helpful Scripts/Plugins:
Hacks:
http://wordpress.org/extend/plugins/tac/
http://wordpress.org/extend/plugins/exploit-scanner/ (Can be extremely resource intensive.)
http://wordpress.org/extend/plugins/wp-malwatch/
@luckydev
luckydev / devs.rb
Created December 1, 2011 04:58
Types of Developers
# SeniorDev, AwesomeDev, NoviceDev
class SeniorDev
def do_some_old_stuff
puts "This is a piece of cake"
end
def method_missing(name, *args)
puts "Err.. What? #{name}??.. THAT IS IMPOSSIBLE! Leave me alone."
end
@Coopeh
Coopeh / wpmu-power-tools.php
Created November 24, 2012 16:31
WPMU Power Tools
<?php
/*
* Plugin Name: WPMU Power Tools
* Plugin URI: http://plugins.paidtoblog.com/wpmu-power-tools/
* Description: A few powerfull tools that every WPMU Admin should have.
* Author: Brian Freeman (aka MrBrian)
* Version: 0.7
*/
/* Some sample snippet codes for PHP Executor (feel free to send in yours)
@webaware
webaware / force-ssl-url-scheme.php
Last active September 5, 2024 01:35
For WordPress, force the protocol scheme to be HTTPS when is_ssl() doesn't work, e.g. on a load-balanced server where _SERVER['HTTPS'] and _SERVER['SERVER_PORT'] don't indicate that SSL is being used. NB: may not be needed now, see SSL Insecure Content Fixer and HTTP Detection: https://ssl.webaware.net.au/https-detection/
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility
@ramons03
ramons03 / Notepad++AdvancedSearch.txt
Last active September 27, 2024 21:12
Notepad++ Advanced search and replace. Null, Enter char, Tab, Regular Expressions, Etc.
Open the find/replace dialog.
At the bottom will be some Search mode options. Select "Extended (\n \r \t \0 \x...)"
In either the Find what or the Replace with field entries, you can use the following escapes:
\n new line (LF)
\r carriage return (CR)
\t tab character
\0 null character
\xddd special character with code ddd
@irazasyed
irazasyed / common-cPanel-WHM-paths.md
Last active November 21, 2024 02:34
Common paths in cPanel and WHM, Useful for regular use. Source: http://www.webhostingbuzz.com/wiki/common-paths-cpanel-and-whm/ Note: I don't take any credits for this article (All credits go to the author who published it), I've just converted into markdown format for regular reference (Personal preference).

Common paths in cPanel and WHM


For those users who use cPanel/WHM on their virtual or dedicated servers the following article describes common system paths and utilities.

Paths of Base Modules


PHP /usr/bin/php

@webaware
webaware / debug-log-not-strict.php
Last active December 23, 2024 02:31
Turn on WordPress' WP_DEBUG_LOG but without E_STRICT. Accompanying blog post: http://snippets.webaware.com.au/snippets/wordpress-wp_debug_log-without-e_strict/
<?php
/*
Plugin Name: Debug Log Not Strict
Plugin URI: https://gist.github.com/webaware/6520892
Description: Turn on WP_DEBUG_LOG but without E_STRICT
Version: 1.4.0
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
@webaware
webaware / wp-migrate-db-fix-options.php
Last active November 7, 2018 00:25
Preserve some WordPress test/dev environment settings when pulling data from a production server with WP Migrate DB Pro
<?php
/*
Plugin Name: WP Migrate DB Fix Options
Plugin URI: https://gist.github.com/webaware/6959279
Description: Fix some options after a WP Migrate DB Pro migration, back to dev/test mode
Version: 1.0.0
Author: WebAware
Author URI: http://www.webaware.com.au/
@ref: http://snippets.webaware.com.au/snippets/use-wp-migrate-db-pro-and-keep-your-development-environment-settings
@dejanmarkovic
dejanmarkovic / NOBLOGREDIRECT explained and fix
Created January 8, 2014 20:15
NOBLOGREDIRECT explained and fix
A little explanation for those who have no idea what NOBLOGREDIRECT is.
The define(‘NOBLOGREDIRECT’, ‘%siteurl%’); inside of the wp-config.php makes it so that when someone enters a subdomain that does not exist on your site to redirect to whatever url you wish it to. You can use this to have it either go to a specific FAQ page or directly back to the main root installation, anywhere you want to direct it. the %siteurl% can be replaced for example define(‘NOBLOGREDIRECT’, ‘http://frumph.net/FAQ/site-create’);
When someone in their browser tries to go to (for example) http://badsubdomain.frumph.net/ a subomain which doesn’t exist, it will go to what is defined in NOBLOGREDIRECT.
Without using NOBLOGREDIRECT the (for example) http://badsubdomain.frumph.net/ – which is a subdomain that doesn’t exist would direct to the signup page asking which reports whether or not the user can create the bad subdomain in question. This is fine, there’s nothing wrong with it redirecting to the signup page if someone put
@centminmod
centminmod / gist:9034414
Created February 16, 2014 13:43
Wordpress Multi Site Nginx configuration template for CentminMod.com Nginx - based on Sam Smith's configuration at https://plus.google.com/b/104831941868856035845/106999818358907937014/posts/YN2sCBjxg2A
server {
server_name domain1.com www.domain1.com domain2.com www.domain2.com;
# ngx_pagespeed & ngx_pagespeed handler
include /usr/local/nginx/conf/pagespeed.conf;
include /usr/local/nginx/conf/pagespeedhandler.conf;
include /usr/local/nginx/conf/pagespeedstatslog.conf;
access_log /home/nginx/domains/domain1.com/log/access.log combined buffer=32k;
error_log /home/nginx/domains/domain1.com/log/error.log;