windhamdavid 10 years ago
parent
commit
2fd63a67a2

+ 44 - 0
app/plugins/debug-bar/compat.php

@@ -0,0 +1,44 @@
+<?php
+//Backcompat for pre this function making it into WordPress
+if ( ! function_exists( 'wp_debug_backtrace_summary' ) ) {
+	/**
+	 * Return a comma separated string of functions that have been called to get to the current point in code.
+	 * @link http://core.trac.wordpress.org/ticket/19589
+	 * @since 3.4
+	 *
+	 * @param string $ignore_class A class to ignore all function calls within - useful when you want to just give info about the callee
+	 * @param string $skip_frames A number of stack frames to skip - useful for unwinding back to the source of the issue
+	 * @param bool $pretty Whether or not you want a comma separated string or raw array returned
+	 * @return string|array Either a string containing a reversed comma separated trace or an array of individual calls.
+	 */
+	function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
+		$trace  = debug_backtrace( false );
+		$caller = array();
+		$check_class = ! is_null( $ignore_class );
+		$skip_frames++; // skip this function
+	
+		foreach ( $trace as $call ) {
+			if ( $skip_frames > 0 ) {
+				$skip_frames--;
+			} elseif ( isset( $call['class'] ) ) {
+				if ( $check_class && $ignore_class == $call['class'] )
+					continue; // Filter out calls
+	
+				$caller[] = "{$call['class']}{$call['type']}{$call['function']}";
+			} else {
+				if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) {
+					$caller[] = "{$call['function']}('{$call['args'][0]}')";
+				} elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) {
+					$caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "')";
+				} else {
+					$caller[] = $call['function'];
+				}
+			}
+		}
+		if ( $pretty )
+			return join( ', ', array_reverse( $caller ) );
+		else
+			return $caller;
+	}
+}
+?>

File diff suppressed because it is too large
+ 0 - 0
app/plugins/debug-bar/css/debug-bar.css


+ 1 - 0
app/plugins/debug-bar/css/debug-bar.dev.css

@@ -194,6 +194,7 @@ body.debug-bar-maximized.debug-bar-visible {
 	overflow: hidden;
 	list-style: none;
 	margin: 0;
+	padding: 0;
 }
 
 #debug-menu-links li {

+ 9 - 5
app/plugins/debug-bar/debug-bar.php

@@ -4,7 +4,7 @@
  Plugin URI: http://wordpress.org/extend/plugins/debug-bar/
  Description: Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
  Author: wordpressdotorg
- Version: 0.8.1
+ Version: 0.8.2
  Author URI: http://wordpress.org/
  */
 
@@ -31,7 +31,8 @@ class Debug_Bar {
 			return;
 
 		add_action( 'admin_bar_menu',               array( &$this, 'admin_bar_menu' ), 1000 );
-		add_action( 'wp_after_admin_bar_render',    array( &$this, 'render' ) );
+		add_action( 'admin_footer',                 array( &$this, 'render' ), 1000 );
+		add_action( 'wp_footer',                    array( &$this, 'render' ), 1000 );
 		add_action( 'wp_head',                      array( &$this, 'ensure_ajaxurl' ), 1 );
 		add_filter( 'body_class',                   array( &$this, 'body_class' ) );
 		add_filter( 'admin_body_class',             array( &$this, 'body_class' ) );
@@ -57,17 +58,19 @@ class Debug_Bar {
 	}
 
 	function requirements() {
+		$path = plugin_dir_path( __FILE__ );
+		require_once( $path . '/compat.php' );
 		$recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated', 'js' );
 		foreach ( $recs as $rec )
-			require_once "panels/class-debug-bar-$rec.php";
+			require_once "$path/panels/class-debug-bar-$rec.php";
 	}
 
 	function enqueue() {
 		$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
 
-		wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '20111209' );
+		wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '20120317' );
 
-		wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '20111209', true );
+		wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '20121228.2', true );
 
 		do_action('debug_bar_enqueue_scripts');
 	}
@@ -80,6 +83,7 @@ class Debug_Bar {
 			'Debug_Bar_Deprecated',
 			'Debug_Bar_Request',
 			'Debug_Bar_Object_Cache',
+			'Debug_Bar_JS',
 		);
 
 		foreach ( $classes as $class ) {

+ 16 - 6
app/plugins/debug-bar/js/debug-bar-js.dev.js

@@ -1,7 +1,22 @@
 (function() {
-	var count, list, rawCount = 0;
+	var count, list, dbjsError,
+		rawCount = 0,
+		errors = [];
 
 	window.onerror = function( errorMsg, url, lineNumber ) {
+		if ( ! document.getElementById( 'debug-bar-js-error-count' ) )
+			errors[ errors.length ] = [errorMsg, url, lineNumber];
+		else
+			dbjsError(errorMsg, url, lineNumber);
+	}
+
+	jQuery(document).ready( function(){
+		for ( err in errors )
+			dbjsError( errors[err][0], errors[err][1], errors[err][2] );
+
+	});
+
+	dbjsError = function( errorMsg, url, lineNumber ) {
 
 		var errorLine, place, button, tab;
 
@@ -36,11 +51,6 @@
 		errorLine.appendChild( place );
 		list.appendChild( errorLine );
 
-		return false;
 	};
 
-	// suppress error handling
-	window.addEventListener( 'error', function( e ) {
-		e.preventDefault();
-	}, true );
 })();

+ 1 - 1
app/plugins/debug-bar/js/debug-bar-js.js

@@ -1 +1 @@
-(function(){var b,c,a=0;window.onerror=function(j,g,d){var f,e,h,i;a++;if(!b){b=document.getElementById("debug-bar-js-error-count")}if(!c){c=document.getElementById("debug-bar-js-errors")}if(!b||!c){return}if(1==a){h=document.getElementById("wp-admin-bar-debug-bar");if(!h){return}if(h.className.indexOf("debug-bar-php-warning-summary")===-1){h.className=h.className+" debug-bar-php-warning-summary"}i=document.getElementById("debug-menu-link-Debug_Bar_JS");if(i){i.style.display="block"}}b.textContent=a;f=document.createElement("li");f.className="debug-bar-js-error";f.textContent=j;e=document.createElement("span");e.textContent=g+" line "+d;f.appendChild(e);c.appendChild(f);return false};window.addEventListener("error",function(d){d.preventDefault()},true)})();
+(function(){var count,list,dbjsError,rawCount=0,errors=[];window.onerror=function(errorMsg,url,lineNumber){if(!document.getElementById("debug-bar-js-error-count")){errors[errors.length]=[errorMsg,url,lineNumber]}else{dbjsError(errorMsg,url,lineNumber)}};jQuery(document).ready(function(){for(err in errors){dbjsError(errors[err][0],errors[err][1],errors[err][2])}});dbjsError=function(errorMsg,url,lineNumber){var errorLine,place,button,tab;rawCount++;if(!count){count=document.getElementById("debug-bar-js-error-count")}if(!list){list=document.getElementById("debug-bar-js-errors")}if(!count||!list){return}if(1==rawCount){button=document.getElementById("wp-admin-bar-debug-bar");if(!button){return}if(button.className.indexOf("debug-bar-php-warning-summary")===-1){button.className=button.className+" debug-bar-php-warning-summary"}tab=document.getElementById("debug-menu-link-Debug_Bar_JS");if(tab){tab.style.display="block"}}count.textContent=rawCount;errorLine=document.createElement("li");errorLine.className="debug-bar-js-error";errorLine.textContent=errorMsg;place=document.createElement("span");place.textContent=url+" line "+lineNumber;errorLine.appendChild(place);list.appendChild(errorLine)}})();

+ 16 - 1
app/plugins/debug-bar/js/debug-bar.dev.js

@@ -18,6 +18,10 @@ wpDebugBar = api = {
 		api.actions.init();
 	},
 
+	isVisible: function() {
+		return api.body.hasClass( 'debug-bar-visible' );
+	},
+
 	toggle: {
 		init: function() {
 			$('#wp-admin-bar-debug-bar').click( function(e) {
@@ -26,7 +30,7 @@ wpDebugBar = api = {
 			});
 		},
 		visibility: function( show ) {
-			show = typeof show == 'undefined' ? ! api.body.hasClass( 'debug-bar-visible' ) : show;
+			show = typeof show == 'undefined' ? ! api.isVisible() : show;
 
 			// Show/hide the debug bar.
 			api.body.toggleClass( 'debug-bar-visible', show );
@@ -63,6 +67,17 @@ wpDebugBar = api = {
 		init: function() {
 			var actions = $('#debug-bar-actions');
 
+			// Close the panel with the esc key if it's open
+			// 27 = esc
+			$(document).keydown( function( e ) {
+				var key = e.key || e.which || e.keyCode;
+				if ( 27 != key || ! api.isVisible() )
+					return;
+
+				e.preventDefault();
+				return api.actions.close();
+			});
+
 			$('.maximize', actions).click( api.actions.maximize );
 			$('.restore',  actions).click( api.actions.restore );
 			$('.close',    actions).click( api.actions.close );

+ 1 - 1
app/plugins/debug-bar/js/debug-bar.js

@@ -1 +1 @@
-var wpDebugBar;(function(b){var a;wpDebugBar=a={body:undefined,init:function(){a.body=b(document.body);a.toggle.init();a.tabs();a.actions.init()},toggle:{init:function(){b("#wp-admin-bar-debug-bar").click(function(c){c.preventDefault();a.toggle.visibility()})},visibility:function(c){c=typeof c=="undefined"?!a.body.hasClass("debug-bar-visible"):c;a.body.toggleClass("debug-bar-visible",c);b(this).toggleClass("active",c)}},tabs:function(){var d=b(".debug-menu-link"),c=b(".debug-menu-target");d.click(function(g){var f=b(this);g.preventDefault();if(f.hasClass("current")){return}c.hide().trigger("debug-bar-hide");d.removeClass("current");f.addClass("current");b("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show")})},actions:{init:function(){var c=b("#debug-bar-actions");b(".maximize",c).click(a.actions.maximize);b(".restore",c).click(a.actions.restore);b(".close",c).click(a.actions.close)},maximize:function(){a.body.removeClass("debug-bar-partial");a.body.addClass("debug-bar-maximized")},restore:function(){a.body.removeClass("debug-bar-maximized");a.body.addClass("debug-bar-partial")},close:function(){a.toggle.visibility(false);console.log("boo")}}};wpDebugBar.Panel=function(){};b(document).ready(wpDebugBar.init)})(jQuery);
+var wpDebugBar;(function(i){var e;wpDebugBar=e={body:void 0,init:function(){e.body=i(document.body),e.toggle.init(),e.tabs(),e.actions.init()},isVisible:function(){return e.body.hasClass("debug-bar-visible")},toggle:{init:function(){i("#wp-admin-bar-debug-bar").click(function(i){i.preventDefault(),e.toggle.visibility()})},visibility:function(t){t=t===void 0?!e.isVisible():t,e.body.toggleClass("debug-bar-visible",t),i(this).toggleClass("active",t)}},tabs:function(){var e=i(".debug-menu-link"),t=i(".debug-menu-target");e.click(function(a){var n=i(this);a.preventDefault(),n.hasClass("current")||(t.hide().trigger("debug-bar-hide"),e.removeClass("current"),n.addClass("current"),i("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show"))})},actions:{init:function(){var t=i("#debug-bar-actions");i(document).keydown(function(i){var t=i.key||i.which||i.keyCode;if(27==t&&e.isVisible())return i.preventDefault(),e.actions.close()}),i(".maximize",t).click(e.actions.maximize),i(".restore",t).click(e.actions.restore),i(".close",t).click(e.actions.close)},maximize:function(){e.body.removeClass("debug-bar-partial"),e.body.addClass("debug-bar-maximized")},restore:function(){e.body.removeClass("debug-bar-maximized"),e.body.addClass("debug-bar-partial")},close:function(){e.toggle.visibility(!1),console.log("boo")}}},wpDebugBar.Panel=function(){},i(document).ready(wpDebugBar.init)})(jQuery);

+ 35 - 12
app/plugins/debug-bar/panels/class-debug-bar-deprecated.php

@@ -33,27 +33,45 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
 		echo '<h2><span>Total Files:</span>' . number_format( count( $this->deprecated_files ) ) . "</h2>\n";
 		if ( count( $this->deprecated_functions ) ) {
 			echo '<ol class="debug-bar-deprecated-list">';
-			foreach ( $this->deprecated_functions as $location => $message)
-				echo "<li class='debug-bar-deprecated-function'>".str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message). "</li>";
+			foreach ( $this->deprecated_functions as $location => $message_stack) {
+				list( $message, $stack) = $message_stack;
+				echo "<li class='debug-bar-deprecated-function'>";
+				echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
+				echo "<br/>";
+				echo $stack;
+				echo "</li>";
+			}
 			echo '</ol>';
 		}
 		if ( count( $this->deprecated_files ) ) {
 			echo '<ol class="debug-bar-deprecated-list">';
-			foreach ( $this->deprecated_files as $location => $message)
-				echo "<li class='debug-bar-deprecated-function'>".str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message). "</li>";
+			foreach ( $this->deprecated_files as $location => $message_stack) {
+				list( $message, $stack) = $message_stack;
+				echo "<li class='debug-bar-deprecated-file'>";
+				echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
+				echo "<br/>";
+				echo $stack;
+				echo "</li>";
+			}
 			echo '</ol>';
 		}
 		if ( count( $this->deprecated_arguments ) ) {
 			echo '<ol class="debug-bar-deprecated-list">';
-			foreach ( $this->deprecated_arguments as $location => $message)
-				echo "<li class='debug-bar-deprecated-function'>".str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message). "</li>";
+			foreach ( $this->deprecated_arguments as $location => $message_stack) {
+				list( $message, $stack) = $message_stack;
+				echo "<li class='debug-bar-deprecated-argument'>";
+				echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
+				echo "<br/>";
+				echo $stack;
+				echo "</li>";
+			}
 			echo '</ol>';
 		}
 		echo "</div>";
 	}
 
 	function deprecated_function_run($function, $replacement, $version) {
-		$backtrace = debug_backtrace();
+		$backtrace = debug_backtrace( false );
 		$bt = 4;
 		// Check if we're a hook callback.
 		if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
@@ -66,11 +84,11 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
 		else
 			$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $function, $version );
 
-		$this->deprecated_functions[$file.':'.$line] = $message;
+		$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
 	}
 
 	function deprecated_file_included( $old_file, $replacement, $version, $message ) {
-		$backtrace = debug_backtrace();
+		$backtrace = debug_backtrace( false );
 		$file = $backtrace[4]['file'];
 		$file_abs = str_replace(ABSPATH, '', $file);
 		$line = $backtrace[4]['line'];
@@ -80,11 +98,16 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
 		else
 			$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $file_abs, $version ) . $message;
 
-		$this->deprecated_files[$file.':'.$line] = $message;
+		$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, 4 ) );
 	}
 
 	function deprecated_argument_run( $function, $message, $version) {
-		$backtrace = debug_backtrace();
+		$backtrace = debug_backtrace( false );
+		if ( $function === 'define()' ) {
+			$this->deprecated_functions[] = array( $message, '' );
+			return;
+		}
+
 		$bt = 4;
 		if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
 			$bt = 6;
@@ -92,6 +115,6 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
 		$file = $backtrace[ $bt ]['file'];
 		$line = $backtrace[ $bt ]['line'];
 
-		$this->deprecated_arguments[$file.':'.$line] = $message;
+		$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
 	}
 }

+ 2 - 5
app/plugins/debug-bar/panels/class-debug-bar-js.php

@@ -4,15 +4,12 @@ class Debug_Bar_JS extends Debug_Bar_Panel {
 	var $real_error_handler = array();
 
 	function init() {
-		if ( !defined( 'SCRIPT_DEBUG' ) || !SCRIPT_DEBUG )
-			return false;
-
 		$this->title( __('JavaScript', 'debug-bar') );
 
 		// attach here instead of debug_bar_enqueue_scripts
 		// because we want to be as early as possible!
-		$wcsf2011 = '20110813';
-		wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js.dev.js", dirname(__FILE__) ), array(), $wcsf2011 );
+		$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
+		wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js$suffix.js", dirname(__FILE__) ), array(), '20111216' );
 	}
 
 	function render() {

+ 17 - 8
app/plugins/debug-bar/panels/class-debug-bar-php.php

@@ -32,11 +32,11 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
 		switch ( $type ) {
 			case E_WARNING :
 			case E_USER_WARNING :
-				$this->warnings[$_key] = array( $file.':'.$line, $message );
+				$this->warnings[$_key] = array( $file.':'.$line, $message, wp_debug_backtrace_summary( __CLASS__ ) );
 				break;
 			case E_NOTICE :
 			case E_USER_NOTICE :
-				$this->notices[$_key] = array( $file.':'.$line, $message );
+				$this->notices[$_key] = array( $file.':'.$line, $message, wp_debug_backtrace_summary( __CLASS__ ) );
 				break;
 			case E_STRICT :
 				// TODO
@@ -62,17 +62,25 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
 		echo '<h2><span>Total Notices:</span>' . number_format( count( $this->notices ) ) . "</h2>\n";
 		if ( count( $this->warnings ) ) {
 			echo '<ol class="debug-bar-php-list">';
-			foreach ( $this->warnings as $location_message) {
-				list( $location, $message) = $location_message;
-				echo "<li class='debug-bar-php-warning'>WARNING: ".str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message). "</li>";
+			foreach ( $this->warnings as $location_message_stack ) {
+				list( $location, $message, $stack) = $location_message_stack;
+				echo '<li class="debug-bar-php-warning">WARNING: ';
+				echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
+				echo '<br/>';
+				echo $stack;
+				echo '</li>';
 			}
 			echo '</ol>';
 		}
 		if ( count( $this->notices ) ) {
 			echo '<ol class="debug-bar-php-list">';
-			foreach ( $this->notices as $location_message) {
-				list( $location, $message) = $location_message;
-				echo "<li  class='debug-bar-php-notice'>NOTICE: ".str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message). "</li>";
+			foreach ( $this->notices as $location_message_stack) {
+				list( $location, $message, $stack) = $location_message_stack;
+				echo '<li class="debug-bar-php-notice">NOTICE: ';
+				echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
+				echo '<br/>';
+				echo $stack;
+				echo '</li>';
 			}
 			echo '</ol>';
 		}
@@ -80,3 +88,4 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
 
 	}
 }
+

+ 13 - 12
app/plugins/debug-bar/panels/class-debug-bar-wp-query.php

@@ -86,20 +86,21 @@ class Debug_Bar_WP_Query extends Debug_Bar_Panel {
 		if ( ! is_null( $queried_object ) ) {
 			echo '<h3>Queried Object:</h3>';
 			echo '<ol class="debug-bar-wp-query-list">';
-			foreach ($queried_object as $key => $value) {
-				// See: http://wordpress.org/support/topic/plugin-debug-bar-custom-post-type-archive-catchable-fatal-error
-				// TODO: Fix better
-				if ( is_object( $value ) ) {
-					echo '<li>' . $key . ' => <ol>';
-					foreach ( $value as $_key => $_value )
-						echo '<li>' . $_key . ' => ' . $_value . '</li>';
-					echo '</ol></li>';
-				} else {
-					echo '<li>' . $key . ' => ' . $value . '</li>';
-				}
-			}
+			$this->_recursive_print_kv($queried_object);
 			echo '</ol>';
 		}
 		echo '</div>';
 	}
+        
+        protected function _recursive_print_kv( $kv_array ) {
+            foreach ( $kv_array as $key => $value ) {
+                    if( is_object( $value ) || is_array( $value ) ) {
+                            printf( '<li>%s => <ol>', $key );
+                            $this->_recursive_print_kv( $value );
+                            echo '</ol></li>';
+                    } else {
+                            echo "<li>{$key} => {$value}</li>";
+                    }
+            }
+        }
 }

+ 5 - 2
app/plugins/debug-bar/readme.txt

@@ -1,8 +1,8 @@
 === Debug Bar ===
 Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_, mitchoyoshitaka
 Tags: debug
-Tested up to: 3.6
-Stable tag: 0.8
+Tested up to: 4.1-alpha
+Stable tag: 0.8.2
 Requires at least: 3.1
 
 Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
@@ -21,6 +21,9 @@ Add a PHP/MySQL console with the [Debug Bar Console plugin](http://wordpress.org
 
 == Upgrade Notice ==
 
+= 0.8.2 =
+Updated to handle a new deprecated message in WordPress 4.0.
+
 = 0.8.1 =
 Minor security fix.
 

+ 87 - 0
app/plugins/keyring/includes/services/extended/eventbrite.php

@@ -0,0 +1,87 @@
+<?php
+
+/**
+ * Eventbrite service definition for Keyring.
+ * https://developer.eventbrite.com/docs/
+ */
+
+class Keyring_Service_Eventbrite extends Keyring_Service_OAuth2 {
+	const NAME = 'eventbrite';
+	const LABEL = 'Eventbrite';
+	const API_BASE = 'https://www.eventbriteapi.com/v3/';
+	const OAUTH_BASE = 'https://www.eventbrite.com/oauth/';
+
+	function __construct() {
+		parent::__construct();
+
+		// Enable "basic" UI for entering key/secret
+		if ( !KEYRING__HEADLESS_MODE ) {
+			add_action( 'keyring_eventbrite_manage_ui', array( $this, 'basic_ui' ) );
+			add_filter( 'keyring_eventbrite_basic_ui_intro', array( $this, 'basic_ui_intro' ) );
+		}
+
+		$creds        = $this->get_credentials();
+		$this->key    = $creds['key'];
+		$this->secret = $creds['secret'];
+
+		$this->consumer         = new OAuthConsumer( $this->key, $this->secret, $this->callback_url );
+		$this->signature_method = new OAuthSignatureMethod_HMAC_SHA1;
+
+		$this->authorization_header    = 'Bearer'; // Oh, you
+		$this->authorization_parameter = false;
+
+		$this->set_endpoint( 'authorize', self::OAUTH_BASE . 'authorize', 'GET' );
+		$this->set_endpoint( 'access_token', self::OAUTH_BASE . 'token', 'POST' );
+		$this->set_endpoint( 'self', self::API_BASE . 'users/me/', 'GET' );
+	}
+
+	function basic_ui_intro() {
+		echo '<p>' . sprintf( __( 'To get started, <a href="%1$s">register an OAuth client on Evenbrite</a>. The most important setting is the <strong>OAuth Redirect URI</strong>, which should be set to <code>%2$s</code>. You can set the other values to whatever you like.', 'keyring' ), 'https://www.eventbrite.com/myaccount/apps/', Keyring_Util::admin_url( 'eventbrite', array( 'action' => 'verify' ) ) ) . '</p>';
+		echo '<p>' . __( "Once you've saved those changes, copy the <strong>CLIENT/APPLICATION KEY</strong> value into the <strong>API Key</strong> field, and the <strong>CLIENT SECRET</strong> value into the <strong>API Secret</strong> field and click save.", 'keyring' ) . '</p>';
+	}
+
+	function build_token_meta( $token ) {
+		$meta = array();
+
+		if ( empty( $token['access_token'] ) ) {
+			return $meta;
+		}
+
+		$this->set_token(
+			new Keyring_Access_Token(
+				$this->get_name(),
+				$token['access_token'],
+				array()
+			)
+		);
+
+		$response = $this->request( $this->self_url, array( 'method' => $this->self_method ) );
+		if ( !Keyring_Util::is_error( $response ) ) {
+			$meta = array(
+				'user_id' => $response->id,
+				'name'    => $response->name,
+			);
+		}
+
+		return apply_filters( 'keyring_access_token_meta', $meta, 'eventbrite', $token, $response, $this );
+	}
+
+	function get_display( Keyring_Access_Token $token ) {
+		return $token->get_meta( 'name' );
+	}
+
+	function parse_response( $response ) {
+		return json_decode( $response );
+	}
+
+	function test_connection() {
+		$res = $this->request( $this->self_url, array( 'method' => $this->self_method ) );
+		if ( !Keyring_Util::is_error( $res ) ) {
+			return true;
+		}
+
+		return $res;
+	}
+}
+
+add_action( 'keyring_load_services', array( 'Keyring_Service_Eventbrite', 'init' ) );

+ 4 - 4
app/plugins/keyring/includes/services/extended/flickr.php

@@ -17,9 +17,9 @@ class Keyring_Service_Flickr extends Keyring_Service_OAuth1 {
 			add_filter( 'keyring_flickr_basic_ui_intro', array( $this, 'basic_ui_intro' ) );
 		}
 
-		$this->set_endpoint( 'request_token', 'http://www.flickr.com/services/oauth/request_token', 'GET' );
-		$this->set_endpoint( 'authorize',     'http://www.flickr.com/services/oauth/authorize',     'GET' );
-		$this->set_endpoint( 'access_token',  'http://www.flickr.com/services/oauth/access_token',  'GET' );
+		$this->set_endpoint( 'request_token', 'https://www.flickr.com/services/oauth/request_token', 'GET' );
+		$this->set_endpoint( 'authorize',     'https://www.flickr.com/services/oauth/authorize',     'GET' );
+		$this->set_endpoint( 'access_token',  'https://www.flickr.com/services/oauth/access_token',  'GET' );
 
 		$creds = $this->get_credentials();
 		$this->app_id  = $creds['app_id'];
@@ -48,7 +48,7 @@ class Keyring_Service_Flickr extends Keyring_Service_OAuth1 {
 				)
 			)
 		);
-		$url = "http://api.flickr.com/services/rest/?";
+		$url = "https://api.flickr.com/services/rest/?";
 		$params = array(
 			'method'  => 'flickr.people.getInfo',
 			'api_key' => $this->key,

+ 2 - 2
app/plugins/keyring/keyring.php

@@ -3,7 +3,7 @@
 Plugin Name: Keyring
 Plugin URI: http://dentedreality.com.au/projects/wp-keyring/
 Description: Keyring helps you manage your keys. It provides a generic, very hookable framework for connecting to remote systems and managing your access tokens, username/password combos etc for those services. On its own it doesn't do much, but it enables other plugins to do things that require authorization to act on your behalf.
-Version: 1.6
+Version: 1.6.1
 Author: Beau Lebens
 Author URI: http://dentedreality.com.au
 License: GPL v2 or newer <https://www.gnu.org/licenses/gpl.txt>
@@ -26,7 +26,7 @@ define( 'KEYRING__DEBUG_WARN',   2 );
 define( 'KEYRING__DEBUG_ERROR',  3 );
 
 // Indicates Keyring is installed/active so that other plugins can detect it
-define( 'KEYRING__VERSION', '1.6' );
+define( 'KEYRING__VERSION', '1.6.1' );
 
 /**
  * Core Keyring class that handles UI and the general flow of requesting access tokens etc

+ 8 - 4
app/plugins/keyring/readme.txt

@@ -1,10 +1,10 @@
 === Keyring ===
 
-Contributors: beaulebens, mdawaffe, jshreve, automattic
+Contributors: beaulebens, mdawaffe, jshreve, jkudish, automattic
 Tags: authentication, security, oauth, http basic, key, token, authorization, delicious, facebook, flickr, foursquare, google contacts, instagram, instapaper, linkedin, moves, runkeeper, tripit, tumblr, twitter, yahoo, web services
 Requires at least: 3.3
-Tested up to: 3.9
-Stable Tag: 1.6
+Tested up to: 4.0
+Stable Tag: 1.6.1
 
 An authentication framework that handles authorization with external web services.
 
@@ -23,6 +23,7 @@ Out of the box, Keyring currently comes with base Service definitions for webser
 And includes an example service implementation (services/extended/example.php) plus ready-to-use definitions for:
 
 * [Delicious](http://delicious.com/)
+* [Eventbrite](http://eventbrite.com/)
 * [Facebook](http://facebook.com/)
 * [Flickr](http://flickr.com/)
 * [Foursquare](http://foursquare.com/)
@@ -92,6 +93,9 @@ Keyring just provides a framework for handling connections to external services.
 Add files to includes/services/extended/ that either implement one of the includes/services/core/ service foundations, or start from scratch. Follow one of the existing service definitions for a template, and see service.php in the root of Keyring for some detail on methods you need to define, and optional ones that might make your life easier.
 
 == Changelog ==
+= 1.6.1 =
+* Enhancement: Add Eventbrite as a service, props @jkudish
+
 = 1.6 =
 * Enhancement BREAKING: Change the way the keyring_admin_url filter is applied so that it's already got all the parameters etc added to it by the time the filter happens. Makes that filter much more flexible. You probably need to add $params to your filter function, and the add_query_arg() those params onto whatever URL you're returning.
 * Bugfix WARNING: Change the filters in get_credentials() to keyring_service_credentials, since keyring_credentials is in use, and slightly different
@@ -156,4 +160,4 @@ Add files to includes/services/extended/ that either implement one of the includ
 * Switched to using stable-tagging system in the WP.org repo
 
 = 1.1 =
-* First tagged version
+* First tagged version

Some files were not shown because too many files changed in this diff