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 | |
if ( ! defined( 'WP_CLI' ) ) return; | |
/** | |
* Media Fix | |
*/ | |
class Media_Fix extends WP_CLI_Command { | |
/** |
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 | |
/** | |
* HyperDB configuration file | |
* | |
* This file should be installed at ABSPATH/db-config.php | |
* | |
* $wpdb is an instance of the hyperdb class which extends the wpdb class. | |
* | |
* Fully documented config file: | |
* http://plugins.svn.wordpress.org/hyperdb/trunk/db-config.php |
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 | |
if ( ! defined( 'WP_CLI' ) ) return; | |
/** | |
* Media Fix | |
*/ | |
class Media_Fix extends WP_CLI_Command { | |
/** |
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 | |
ARGS=$(getopt -o a:b -l "ay:,bee:,dry-run" -n "cli.sh" -- "$@"); | |
eval set -- "$ARGS"; | |
while (("$#")); do | |
case "$1" in | |
-a|--ay) | |
shift; | |
if [ -n "$1" ]; then |
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: Robots Crawl Delay | |
*/ | |
function prefix_robots_crawl_delay( $output, $public ) { | |
$output .= "Crawl-delay: 8\n"; | |
return $output; | |
} | |
add_filter( 'robots_txt', 'prefix_robots_crawl_delay', 10, 2 ); |
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
#!/usr/bin/php | |
<?php | |
/** | |
* This works for the following nginx configuration: | |
* | |
* fastcgi_cache_path [..] levels=1:2 [..]; | |
* fastcgi_cache_key "$scheme://$host$request_uri"; | |
* | |
* Make this file executable | |
* `chmod +x /path/to/this/file` |
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 | |
$basic_rewrite = new Basic_Rewrite(); | |
class Basic_Rewrite { | |
function __construct() { | |
add_action( 'wp_loaded', array( $this, 'wp_loaded' ) ); | |
add_filter( 'rewrite_rules_array', array( $this, 'rewrite_rules_array' ) ); | |
add_filter( 'query_vars', array( $this, 'query_vars' ) ); | |
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) ); |
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 | |
# | |
# ./find-new-files [path(.)] [minutes(360)] | |
# | |
if [ -z $1 ] | |
then | |
dir='.' | |
else | |
dir=$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
#!/bin/sh | |
# | |
# cron ex: | |
# */15 * * * * cd /var/www/html/wordpress; verify-checksums | |
# | |
from='Alert' | |
room_id='HipChat Room Name/ID' | |
api_key='HipChat API Key' |