Skip to content

Instantly share code, notes, and snippets.

View simonwheatley's full-sized avatar

Simon Wheatley simonwheatley

View GitHub Profile
@simonwheatley
simonwheatley / patch-1.diff
Created June 24, 2013 15:41
Google Analytics Dashboard patches… Fix unused `$gauth` notice cause by trying to pass it when it's not been set, two possible options: `patch-1.diff` – Creates the `$gauth` object within the method using it `patch-2.diff` – Removes the conditional check re CAPTCHA completely, as it's not currently ever entered because `$gauth` is never set
diff --git a/gad-admin-options-ui.php b/gad-admin-options-ui.php
index 4ceae90..dc91950 100644
--- a/gad-admin-options-ui.php
+++ b/gad-admin-options-ui.php
@@ -191,8 +191,9 @@ class GADAdminOptionsUI
<?php
}
- function display_admin_handle_login_options($gauth)
+ function display_admin_handle_login_options()
@simonwheatley
simonwheatley / patch.diff
Created June 24, 2013 15:16
Google Analytics Dashboard patch… Fix: Notice: has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /srv/www/wordpress-default/wp-includes/functions.php on line 2923
diff --git a/gad-admin-options.php b/gad-admin-options.php
index 09c3f2f..e6afefb 100644
--- a/gad-admin-options.php
+++ b/gad-admin-options.php
@@ -67,7 +67,7 @@ class GADAdminOptions
function admin_plugin_menu()
{
- add_options_page(__('Google Analytics Dashboard Options'), __('Google Analytics Dashboard'), 8, __FILE__, array(&$this, 'admin_plugin_options'));
+ add_options_page(__('Google Analytics Dashboard Options'), __('Google Analytics Dashboard'), 'manage_options', __FILE__, array(&$this, 'admin_plugin_options'));
@simonwheatley
simonwheatley / para.txt
Last active December 18, 2015 08:59
Marketing para for WordCamp Lancaster sponsorship
Code For The People are firm believers, and enthusiastic participants in the Open Source movement
generally and WordPress in particular. We build WordPress sites which are as easy to manage as a
blog, but can handle the kind of traffic burst you get when you tweet a link to two million
fans. One of only two WordPress.com VIP Featured Partners outside the US, our clients span the
length and breadth of UK society, from Stephen Fry to the Rolling Stones, via Oxford University
and the UK Government.
@simonwheatley
simonwheatley / gist:5459162
Created April 25, 2013 11:47
Quick alias to convert readme.txt to Github ready readme.md, uses https://github.com/r8/wp2github.py.
# Nice command to convert the readme.txt in the current
# directory to a readme.md
alias wp2ghreadme='python /Users/simon/Scripts/wp2github/wp2github.py --source ./readme.txt --target ./readme.md; echo "readme.md created"; subl ./readme.md;'
@simonwheatley
simonwheatley / cftp-wpcp-notice.php
Last active December 15, 2015 04:39
WP Cycling Project Notices
<?php
/*
Plugin Name: WP Cycling Project Notices
Plugin URI: https://gist.github.com/simonwheatley/5202993
Description: Adds notices above the WooCommerce cart and checkout for WP Cycling Project
Version: 1.0
Author: Code for the People
Author URI: http://www.codeforthepeople.com/
*/
// for debug : trace every event
// var originalTrigger = wp.media.view.MediaFrame.Post.prototype.trigger;
// wp.media.view.MediaFrame.Post.prototype.trigger = function(){
// console.log('Event Triggered:', arguments);
// originalTrigger.apply(this, Array.prototype.slice.call(arguments));
// }
// custom state : this controller contains your application logic
wp.media.controller.Custom = wp.media.controller.State.extend({
@simonwheatley
simonwheatley / media-experiments.php
Created March 6, 2013 07:36
WP 3.5 Media Experiments – Learning by prodding things.
<?php
/*
Plugin Name: WP 3.5 Media Experiments
Description: Learning by prodding things.
Version: 0.1
Author: Simon Wheatley
Author URI: codeforthepeople.com
*/
@simonwheatley
simonwheatley / .gitignore
Created August 14, 2012 14:06
Applescript to register a URL protocol to open Netbeans
nbopen.app
<snippet>
<content><![CDATA[
<div class='${1:updated}${2:error}'><p>$3</p></div>
]]></content>
<tabTrigger>adminnotice</tabTrigger>
</snippet>
<?php
/*
Plugin Name: Ordered Post Tags – Template Tags & API
Plugin URI: https://gist.github.com/3217544
Description: Proof of concept plugin, not for production use. Provides template tags and an API for those functions. Won't work without Ordered Post Tags POC plugin.
Version: 0.1
Author: Simon Wheatley @ Code for the People Ltd
Author URI: http://codeforthepeople.com
*/