View cli-media-fix.php
1 2 3 4 5 6 7 8 9 10
<?php
if ( ! defined( 'WP_CLI' ) ) return;
/**
* Media Fix
*/
class Media_Fix extends WP_CLI_Command {
/**
View db-config.php
1 2 3 4 5 6 7 8 9 10
<?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
View media-fix.php
1 2 3 4 5 6 7 8 9 10
<?php
if ( ! defined( 'WP_CLI' ) ) return;
/**
* Media Fix
*/
class Media_Fix extends WP_CLI_Command {
/**
View getopt-example.sh
1 2 3 4 5 6 7 8 9 10
#!/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
View robots-crawl-delay.php
1 2 3 4 5 6 7 8 9 10
<?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 );
View purge.sh
1 2 3 4 5 6 7 8 9 10
#!/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`
View blog-home.php
1 2 3 4 5 6 7 8 9 10
<?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' ) );
View find-new-files.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
#
# ./find-new-files [path(.)] [minutes(360)]
#
 
if [ -z $1 ]
then
dir='.'
else
dir=$1
View verify-checksums.sh
1 2 3 4 5 6 7 8 9
#!/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'
Something went wrong with that request. Please try again.