Skip to content

Instantly share code, notes, and snippets.

ksolomon /
Created December 21, 2022 13:00 — forked from DomPizzie/
A simple template

Project Title

Simple overview of use/purpose.


An in-depth paragraph about your project and overview of use.

Getting Started

ksolomon / xmlrpc-brute-protection.php
Created October 9, 2015 17:41
Block XMLRPC Brute Force Amplification Attacks on WordPress
Plugin Name: XML-RPC Brute Protection
Description: Disable XML-RPC methods used in brute-force amplification attacks
Author: Keith Solomon
Version: 1.0
License: GPL2
function mmx_remove_xmlrpc_methods($methods) {
ksolomon / wpfuncs.php
Last active October 8, 2019 12:29
Collection of WordPress helper functions I use constantly.
// addFirstLastClass() - Add first and last classes to list items returned from wp_list_pages.
function addFirstLastClass($pageList) {
// pattern to focus on just li's
$allLisPattern = '/<li class="page_item(.*)<\/li>/s';
$liClassPattern = "/<li[^>]+class=\"([^\"]+)/i";
// first let's break out each li
$liArray = explode("\n",$allLis[0]);