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 | |
/** | |
* This changes logging to only log fatal errors. This file should go in your mu-plugins directory. | |
*/ | |
// Set the error logging to only log fatal errors | |
error_reporting( E_ERROR ); | |
// Optional: change the location of your error log, it might be wise to put it outside your WP content dir. | |
// If you don't change it, the default place for this log is debug.log in your WP_CONTENT_DIR. |
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 | |
//Inspiration: https://gist.github.com/florianbrinkmann/a879099f3d28c5e1d64f2aeea042becf | |
add_action( 'do_faviconico', function() { | |
//Check for icon with no default value | |
if ( $icon = get_site_icon_url( 32 ) ) { | |
//Show the icon | |
wp_redirect( $icon ); | |
} else { | |
//Show nothing | |
header( 'Content-Type: image/vnd.microsoft.icon' ); |
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 | |
/* | |
* Disable WP REST API JSON endpoints if user not logged in | |
*/ | |
function chuck_disable_rest_endpoints( $access ) { | |
if( ! is_user_logged_in() ) { | |
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'disable-json-api' ), array( 'status' => rest_authorization_required_code() ) ); | |
} | |
return $access; | |
} |
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
( function( $, plugin ) { | |
"use strict"; | |
// Working with promises to bubble event later than core. | |
$.when( someObjectWithEvents ).done( function() { | |
console.log( 'AJAX request done.' ); | |
} ) | |
.then( function() { | |
setTimeout( function() { | |
console.log( 'AJAX requests resolved.' ); |
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/env python | |
# -*- coding: iso-8859-1 -*- | |
# -*- coding: utf-8 -*- | |
# | |
# Wordpress Watcher | |
# Automating WPscan to scan and report vulnerable Wordpress sites | |
# Florian Roth | |
# v0.1 | |
# March 2015 | |
# |
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 | |
DATABASE_PATH="data/plugins.json" | |
SYMBOL="[!]" | |
TMPFILE="output.tmp" | |
declare -A WEBSITES | |
# List your WordPress websites here | |
WEBSITES['www.website1.dom']='address1@server1.com,address2@server2.com' | |
WEBSITES['www.website2.dom']='address2@server1.com,address3@server2.com' |
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: RT Autoautoptimize | |
* Plugin URI: http://www.this-play.nl | |
* Description: Automatically configures default settings for the Autoptimize plugin across a WordPress network | |
* Version: 0.9 | |
* Author: Roy Tanck | |
* Author URI: http://www.this-play.nl | |
* License: GPL2 | |
*/ |
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 namespace GM\WWWPostThumbnail; | |
/** | |
* Plugin Name: WWW Post Thumbnail | |
* Description: Allow to use an external image url as featured image. | |
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c | |
* Author: Giuseppe Mazzapica | |
* Author URI: https://github.com/Giuseppe-Mazzapica | |
* License: MIT | |
* Version: 0.1.0 | |
* |
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 | |
# http://kovshenin.com/2012/the-wordpress-settings-api/ | |
# http://codex.wordpress.org/Settings_API | |
add_action( 'admin_menu', 'my_admin_menu' ); | |
function my_admin_menu() { | |
add_options_page( __('My Plugin Options', 'textdomain' ), __('My Plugin Options', 'textdomain' ), 'manage_options', 'my-plugin', 'my_options_page' ); | |
} | |
add_action( 'admin_init', 'my_admin_init' ); |