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
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/ |
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 | |
WP_CLI::addCommand('export', 'ExportCommand'); | |
/** | |
* Implement export command | |
* | |
* @package wp-cli | |
* @subpackage commands/internals | |
*/ |
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 | |
/** | |
* Image shortcode callback | |
* | |
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files | |
* from existing media library entries. Usage: | |
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"] | |
* | |
* @uses image_make_intermediate_size | |
*/ |
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 | |
############################## | |
# DEFAULT WORDPRESS AND PLUGIN INSTALL SCRIPT | |
# | |
# 2012-04-03 | |
# 1.0 | |
# TODO: PUT A YES/NO PROMPT BEFORE RUNNING SCRIPT | |
#!!!!! EXITS UNLESS YOU MANUALLY COMMENT OUT THE LINE BELOW | |
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
# SVN override to prevent commits that try to implicitly commit more than one file. | |
# Has weaned me off of svn ci -m very effectively. I now almost always use svn ci, | |
# which usually results in me writing longer and more helpful commit messages. | |
# Also, it prevents me from committing unrelated code, so there's that. | |
# | |
# Also checks for error_log, var_dump, and console.log, and rejects these commits. | |
function svn() { | |
if [ "$1" == "ci" ] && [ "$2" == "-m" ] && [ -z "$4" ] && [ "$(svn stat --ignore-externals | grep '^[^?X]' | wc -l | awk '{print $1}')" -gt 1 ]; then | |
svn stat --ignore-externals | grep '^[^?X]' |
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 | |
/* | |
Usage: | |
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
if ( !$frag->output() ) { // NOTE, testing for a return of false | |
functions_that_do_stuff_live(); | |
these_should_echo(); | |
// IMPORTANT | |
$frag->store(); | |
// YOU CANNOT FORGET THIS. If you do, the site will break. |
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: Plugin Last Updated | |
Version: 1.0 | |
License: GPL | |
Author: Pete Mall, Range | |
Author URI: http://petemall.com/ | |
Description: Display the last updated date for all plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress.org plugins repo</a>. | |
*/ |
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 | |
error_reporting(-1); | |
require( 'wp-load.php' ); | |
require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); | |
require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' ); | |
/** | |
* Tosses Imagick methods up the chain to WP_Image_Editor_Imagick::image. | |
* WP_Image_Editor_Imagick::image is protected, so you can't act on |
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: Secret Place | |
Plugin URI: http://github.com/getsource | |
Description: Make your dashboard your secret place. | |
Author: Mike Schroder and Jason Cosper | |
Version: 0.1 | |
Author URI: http://www.getsource.net/ | |
*/ |
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/sh | |
# A script that leverages Trac XML-RPC (I know, I know) to upload patches. | |
# | |
# This script is written specifically for the Mac, in that it reads from | |
# your keychain to derive your SVN password. You can change the SVN_PASS | |
# line below if you wanted to pull from ~/.svn/ or what not. | |
# | |
# Basic usage: `trac-attach.sh 12345` uploads a patch to ticket #12345, | |
# using the name 12345.diff. If there exists a 12345.diff, the patch is |
OlderNewer