Skip to content

Instantly share code, notes, and snippets.

View w33zy's full-sized avatar

Kemory Grubb w33zy

  • 04:42 (UTC -04:00)
View GitHub Profile
@w33zy
w33zy / gist:a4acd04b5cda32716173
Created September 5, 2014 00:03
Add telephone number to Google SERP
<script type="application/ld+json">
{ "@context" : "http://schema.org",
"@type" : "Organization",
"url" : "https://jamaicagetawaytravels.com",
"logo" : "https://jamaicagetawaytravels.com/wp-content/uploads/2014/03/jamaica-get-away-travels-logo1.png",
"contactPoint" : [
{ "@type" : "ContactPoint",
"telephone" : "+1-876-776-0001",
"contactType" : "reservations"
} ] }
@w33zy
w33zy / xmlrpc-brute-protection.php
Created October 9, 2015 22:10 — forked from ksolomon/xmlrpc-brute-protection.php
Block XMLRPC Brute Force Amplification Attacks on WordPress
<?php
/*
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) {
@w33zy
w33zy / zsh.md
Created January 10, 2016 02:34 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Okay, Kids, Here We Go...

"What You Need To Know About Your Next Domain Name"

I highly respect what Fred has done, and continues to do, to help entrepreneurs and for that I'd like to "give back" myself... and I'm posting anonymously as I have nothing to gain in anyway by sharing this information...

I'm a serial Internet entrepreneur since 1990 (pre-Web). I've been involved in hundreds of projects online (have built more than one Top 500 web site) and I've been a very active and successful domain name 'trader' along the way.

I've personally owned over 50,000 domains on and off during the past 15+ years. I've been involved in some million$+ deals, and have owned some domains that you know of (but I won't name). I've also been involved in 1,000s of smaller deals. So this is a topic I know very well.

@w33zy
w33zy / dashboard-activity-cpt.php
Created August 26, 2016 02:23 — forked from Mte90/dashboard-activity-cpt.php
Add your cpts to the Widget Activity of the Dashboard in WordPress
<?php
/*
Plugin Name: Dashboard Widget Activity Custom Post Type
Plugin URI:
Description:
Author: Daniele Mte90 Scasciafratte
Version: 1.0.0
Author URI: http://mte90.net
*/
@w33zy
w33zy / gist:ffb2733ef9f34e8eab4f03d463d0208f
Created February 14, 2017 16:01
WordPress REST API access only to logged in users.
/* ------------------------------------------------------------------------- *
* Returning an authentication error if a user who is not logged in tries to query the REST API
/* ------------------------------------------------------------------------- */
function only_allow_logged_in_rest_access( $access ) {
if( ! is_user_logged_in() ) {
return new WP_Error( 'rest_API_cannot_access', 'Only authenticated users can access the REST API.', array( 'status' => rest_authorization_required_code() ) );
}
return $access;
}
add_filter( 'rest_authentication_errors', 'only_allow_logged_in_rest_access' );
@w33zy
w33zy / git-cheat-list.md
Created February 17, 2017 18:19
Git cheat list

Git cheat list

  • name of the current banch

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
@w33zy
w33zy / plugin.php
Created February 28, 2017 19:48 — forked from joncave/plugin.php
An intentionally vulnerable plugin developed for WordPress plugin author education. http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
<?php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
* Author: Jon Cave
* Author URI: http://joncave.co.uk
* License: GPLv2+
*
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE
@w33zy
w33zy / functions.php
Created March 28, 2017 17:40
This product is currently out of stock and unavailable
Obviously this was frustrating, but after a little investigation, the fact that they were variations was the key to fixing the problem.
Typically WooCommerce allows 60 product variations in total when using ajax to update the variations on the product page, and in most cases the error message is due to the product exceeding this. Fortunately, there’s a relatively simple fix.
Add the following code to your functions.php file and you should be seeing your products back in stock in no time at all.
// Increase WooCommerce Variation Limit
function custom_wc_ajax_variation_threshold( $qty, $product ) {
@w33zy
w33zy / Inflect.php
Created April 18, 2017 01:51 — forked from tbrianjones/Inflect.php
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy