<?php
/*
Plugin Name: Doing It Wrong
Version: 0.1
Plugin URI: http://core.trac.wordpress.org/ticket/14024
Description: Sample plugin to test the issues brought up in #14024 and #11526
Author: Sergey Biryukov
Author URI: http://profiles.wordpress.org/sergeybiryukov/
*/

/**
 * Call wp_get_current_user() too early
 *
 * Current user information is only available on init action or later.
 *
 * @link http://core.trac.wordpress.org/ticket/14024
 */
function diw_get_current_user_too_early() {
	wp_get_current_user();
}
add_action('plugins_loaded', 'diw_get_current_user_too_early');

/**
 * Call wp_register_script() too early
 *
 * Scripts and styles should not be registered or enqueued until
 * the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.
 *
 * @link http://core.trac.wordpress.org/ticket/11526
 */
function diw_register_script_too_early() {
	wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js' );
}
add_action('plugins_loaded', 'diw_register_script_too_early');
?>