Index: composer.json =================================================================== --- composer.json (nonexistent) +++ composer.json (working copy) @@ -0,0 +1,47 @@ +{ + "name": "wordpress/wordpress", + "description": "WordPress is web software you can use to create a beautiful website or blog.", + "keywords": [ + "blog", + "cms" + ], + "type": "wordpress-core", + "homepage": "http://wordpress.org/", + "license": "GPL-2.0+", + "authors": [ + { + "name": "WordPress Community", + "homepage": "http://wordpress.org/about/" + } + ], + "support": { + "issues": "http://core.trac.wordpress.org/", + "forum": "http://wordpress.org/support/", + "wiki": "http://codex.wordpress.org/", + "irc": "irc://irc.freenode.net/wordpress", + "source": "http://core.trac.wordpress.org/browser" + }, + "require": { + "xrstf/composer-php52": "1.*" + }, + "scripts": { + "post-install-cmd": [ + "xrstf\\Composer52\\Generator::onPostInstallCmd" + ], + "post-update-cmd": [ + "xrstf\\Composer52\\Generator::onPostInstallCmd" + ], + "post-autoload-dump": [ + "xrstf\\Composer52\\Generator::onPostInstallCmd" + ] + }, + "autoload": { + "classmap": [ + "src/wp-includes/", + "src/wp-admin/" + ] + }, + "config": { + "vendor-dir": "src/vendor" + } +} \ No newline at end of file Index: src/wp-admin/includes/admin.php =================================================================== --- src/wp-admin/includes/admin.php (revision 38348) +++ src/wp-admin/includes/admin.php (working copy) @@ -50,7 +50,6 @@ require_once(ABSPATH . 'wp-admin/includes/post.php'); /** WordPress Administration Screen API */ -require_once(ABSPATH . 'wp-admin/includes/class-wp-screen.php'); require_once(ABSPATH . 'wp-admin/includes/screen.php'); /** WordPress Taxonomy Administration API */ @@ -60,7 +59,6 @@ require_once(ABSPATH . 'wp-admin/includes/template.php'); /** WordPress List Table Administration API and base class */ -require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); require_once(ABSPATH . 'wp-admin/includes/list-table.php'); /** WordPress Theme Administration API */ @@ -69,9 +67,6 @@ /** WordPress User Administration API */ require_once(ABSPATH . 'wp-admin/includes/user.php'); -/** WordPress Site Icon API */ -require_once(ABSPATH . 'wp-admin/includes/class-wp-site-icon.php'); - /** WordPress Update Administration API */ require_once(ABSPATH . 'wp-admin/includes/update.php'); Index: src/wp-admin/includes/ajax-actions.php =================================================================== --- src/wp-admin/includes/ajax-actions.php (revision 38348) +++ src/wp-admin/includes/ajax-actions.php (working copy) @@ -1507,7 +1507,6 @@ $args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1; - require(ABSPATH . WPINC . '/class-wp-editor.php'); $results = _WP_Editors::wp_link_query( $args ); if ( ! isset( $results ) ) @@ -3137,7 +3136,7 @@ */ function wp_ajax_press_this_save_post() { if ( empty( $GLOBALS['wp_press_this'] ) ) { - include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' ); + $GLOBALS['wp_press_this'] = new WP_Press_This(); } $GLOBALS['wp_press_this']->save_post(); @@ -3152,7 +3151,7 @@ */ function wp_ajax_press_this_add_category() { if ( empty( $GLOBALS['wp_press_this'] ) ) { - include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' ); + $GLOBALS['wp_press_this'] = new WP_Press_This(); } $GLOBALS['wp_press_this']->add_category(); @@ -3183,8 +3182,7 @@ switch ( $context ) { case 'site-icon': - require_once ABSPATH . '/wp-admin/includes/class-wp-site-icon.php'; - global $wp_site_icon; + $wp_site_icon = new WP_Site_Icon; // Skip creating a new attachment if the attachment is a Site Icon. if ( get_post_meta( $attachment_id, '_wp_attachment_context', true ) == $context ) { @@ -3332,7 +3330,6 @@ wp_send_json_error( $status ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); include_once( ABSPATH . 'wp-admin/includes/theme.php' ); $api = themes_api( 'theme_information', array( @@ -3439,8 +3436,6 @@ wp_send_json_error( $status ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - $current = get_site_transient( 'update_themes' ); if ( empty( $current ) ) { wp_update_themes(); @@ -3590,7 +3585,6 @@ wp_send_json_error( $status ); } - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); $api = plugins_api( 'plugin_information', array( @@ -3698,8 +3692,6 @@ $status['oldVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); } - include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - wp_update_plugins(); $skin = new WP_Ajax_Upgrader_Skin(); Index: src/wp-admin/includes/class-wp-press-this.php =================================================================== --- src/wp-admin/includes/class-wp-press-this.php (revision 38348) +++ src/wp-admin/includes/class-wp-press-this.php (working copy) @@ -479,7 +479,6 @@ // Embedded Daily Motion videos $src = 'https://www.dailymotion.com/video/' . $src_matches[2]; } else { - require_once( ABSPATH . WPINC . '/class-oembed.php' ); $oembed = _wp_oembed_get_object(); if ( ! $oembed->get_provider( $src, array( 'discover' => false ) ) ) { Index: src/wp-admin/includes/class-wp-site-icon.php =================================================================== --- src/wp-admin/includes/class-wp-site-icon.php (revision 38348) +++ src/wp-admin/includes/class-wp-site-icon.php (working copy) @@ -240,8 +240,3 @@ return $value; } } - -/** - * @global WP_Site_Icon $wp_site_icon - */ -$GLOBALS['wp_site_icon'] = new WP_Site_Icon; Index: src/wp-admin/includes/class-wp-upgrader-skins.php =================================================================== --- src/wp-admin/includes/class-wp-upgrader-skins.php (revision 38348) +++ src/wp-admin/includes/class-wp-upgrader-skins.php (working copy) @@ -6,36 +6,3 @@ * @subpackage Upgrader * @since 2.8.0 */ - -/** WP_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php'; - -/** Plugin_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php'; - -/** Theme_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php'; - -/** Bulk_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php'; - -/** Bulk_Plugin_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php'; - -/** Bulk_Theme_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php'; - -/** Plugin_Installer_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php'; - -/** Theme_Installer_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php'; - -/** Language_Pack_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php'; - -/** Automatic_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php'; - -/** WP_Ajax_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php'; Index: src/wp-admin/includes/class-wp-upgrader.php =================================================================== --- src/wp-admin/includes/class-wp-upgrader.php (revision 38348) +++ src/wp-admin/includes/class-wp-upgrader.php (working copy) @@ -9,39 +9,6 @@ * @since 2.8.0 */ -/** WP_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader-skin.php'; - -/** Plugin_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader-skin.php'; - -/** Theme_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader-skin.php'; - -/** Bulk_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-bulk-upgrader-skin.php'; - -/** Bulk_Plugin_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-bulk-plugin-upgrader-skin.php'; - -/** Bulk_Theme_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-bulk-theme-upgrader-skin.php'; - -/** Plugin_Installer_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-plugin-installer-skin.php'; - -/** Theme_Installer_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-theme-installer-skin.php'; - -/** Language_Pack_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader-skin.php'; - -/** Automatic_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-automatic-upgrader-skin.php'; - -/** WP_Ajax_Upgrader_Skin class */ -require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php'; - /** * Core class used for upgrading/installing a local set of files via * the Filesystem Abstraction classes from a Zip file. @@ -888,20 +855,3 @@ } -/** Plugin_Upgrader class */ -require_once ABSPATH . 'wp-admin/includes/class-plugin-upgrader.php'; - -/** Theme_Upgrader class */ -require_once ABSPATH . 'wp-admin/includes/class-theme-upgrader.php'; - -/** Language_Pack_Upgrader class */ -require_once ABSPATH . 'wp-admin/includes/class-language-pack-upgrader.php'; - -/** Core_Upgrader class */ -require_once ABSPATH . 'wp-admin/includes/class-core-upgrader.php'; - -/** File_Upload_Upgrader class */ -require_once ABSPATH . 'wp-admin/includes/class-file-upload-upgrader.php'; - -/** WP_Automatic_Updater class */ -require_once ABSPATH . 'wp-admin/includes/class-wp-automatic-updater.php'; Index: src/wp-admin/includes/deprecated.php =================================================================== --- src/wp-admin/includes/deprecated.php (revision 38348) +++ src/wp-admin/includes/deprecated.php (working copy) @@ -749,9 +749,6 @@ static $num = 1; - if ( ! class_exists( '_WP_Editors', false ) ) - require_once( ABSPATH . WPINC . '/class-wp-editor.php' ); - $editor_id = 'content' . $num++; $set = array( @@ -1144,7 +1141,6 @@ if ( !empty($feedback) ) add_filter('update_feedback', $feedback); - include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new Core_Upgrader(); return $upgrader->upgrade($current); @@ -1167,7 +1163,6 @@ if ( !empty($feedback) ) add_filter('update_feedback', $feedback); - include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new Plugin_Upgrader(); return $upgrader->upgrade($plugin); } @@ -1189,7 +1184,6 @@ if ( !empty($feedback) ) add_filter('update_feedback', $feedback); - include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new Theme_Upgrader(); return $upgrader->upgrade($theme); } Index: src/wp-admin/includes/file.php =================================================================== --- src/wp-admin/includes/file.php (revision 38348) +++ src/wp-admin/includes/file.php (working copy) @@ -737,8 +737,6 @@ mbstring_binary_safe_encoding(); - require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php'); - $archive = new PclZip($file); $archive_files = $archive->extract(PCLZIP_OPT_EXTRACT_AS_STRING); @@ -886,8 +884,6 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { global $wp_filesystem; - require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); - $method = get_filesystem_method( $args, $context, $allow_relaxed_file_ownership ); if ( ! $method ) Index: src/wp-admin/includes/list-table.php =================================================================== --- src/wp-admin/includes/list-table.php (revision 38348) +++ src/wp-admin/includes/list-table.php (working copy) @@ -40,9 +40,6 @@ ); if ( isset( $core_classes[ $class ] ) ) { - foreach ( (array) $core_classes[ $class ] as $required ) - require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' ); - if ( isset( $args['screen'] ) ) $args['screen'] = convert_to_screen( $args['screen'] ); elseif ( isset( $GLOBALS['hook_suffix'] ) ) Index: src/wp-admin/includes/media.php =================================================================== --- src/wp-admin/includes/media.php (revision 38348) +++ src/wp-admin/includes/media.php (working copy) @@ -3013,9 +3013,6 @@ define( 'GETID3_TEMP_DIR', get_temp_dir() ); } - if ( ! class_exists( 'getID3', false ) ) { - require( ABSPATH . WPINC . '/ID3/getid3.php' ); - } $id3 = new getID3(); $data = $id3->analyze( $file ); @@ -3074,9 +3071,6 @@ define( 'GETID3_TEMP_DIR', get_temp_dir() ); } - if ( ! class_exists( 'getID3', false ) ) { - require( ABSPATH . WPINC . '/ID3/getid3.php' ); - } $id3 = new getID3(); $data = $id3->analyze( $file ); Index: src/wp-admin/includes/nav-menu.php =================================================================== --- src/wp-admin/includes/nav-menu.php (revision 38348) +++ src/wp-admin/includes/nav-menu.php (working copy) @@ -7,12 +7,6 @@ * @since 3.0.0 */ -/** Walker_Nav_Menu_Edit class */ -require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php' ); - -/** Walker_Nav_Menu_Checklist class */ -require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-checklist.php' ); - /** * Prints the appropriate response to a menu quick search. * Index: src/wp-admin/includes/template.php =================================================================== --- src/wp-admin/includes/template.php (revision 38348) +++ src/wp-admin/includes/template.php (working copy) @@ -8,12 +8,6 @@ * @subpackage Administration */ -/** Walker_Category_Checklist class */ -require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' ); - -/** WP_Internal_Pointers class */ -require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' ); - // // Category Checklists // Index: src/wp-admin/includes/translation-install.php =================================================================== --- src/wp-admin/includes/translation-install.php (revision 38348) +++ src/wp-admin/includes/translation-install.php (working copy) @@ -202,7 +202,6 @@ } $translation = (object) $translation; - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $skin = new Automatic_Upgrader_Skin; $upgrader = new Language_Pack_Upgrader( $skin ); $translation->type = 'core'; @@ -228,7 +227,6 @@ return false; } - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $skin = new Automatic_Upgrader_Skin; $upgrader = new Language_Pack_Upgrader( $skin ); $upgrader->init(); Index: src/wp-admin/includes/update.php =================================================================== --- src/wp-admin/includes/update.php (revision 38348) +++ src/wp-admin/includes/update.php (working copy) @@ -74,8 +74,6 @@ if ( ! $updates || empty( $updates->updates ) ) return false; - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - $auto_update = false; $upgrader = new WP_Automatic_Updater; foreach ( $updates->updates as $update ) { Index: src/wp-admin/press-this.php =================================================================== --- src/wp-admin/press-this.php (revision 38348) +++ src/wp-admin/press-this.php (working copy) @@ -23,7 +23,7 @@ * @global WP_Press_This $wp_press_this */ if ( empty( $GLOBALS['wp_press_this'] ) ) { - include( ABSPATH . 'wp-admin/includes/class-wp-press-this.php' ); + $GLOBALS['wp_press_this'] = new WP_Press_This(); } $GLOBALS['wp_press_this']->html(); Index: src/wp-admin/update-core.php =================================================================== --- src/wp-admin/update-core.php (revision 38348) +++ src/wp-admin/update-core.php (working copy) @@ -163,7 +163,6 @@ _e('You have the latest version of WordPress.'); if ( wp_http_supports( array( 'ssl' ) ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $upgrader = new WP_Automatic_Updater; $future_minor_update = (object) array( 'current' => $wp_version . '.1.next.minor', @@ -187,7 +186,6 @@ } if ( isset( $updates[0] ) && $updates[0]->response == 'development' ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $upgrader = new WP_Automatic_Updater; if ( wp_http_supports( 'ssl' ) && $upgrader->should_update( 'core', $updates[0], ABSPATH ) ) { echo '
'; @@ -438,8 +436,6 @@ function do_core_upgrade( $reinstall = false ) { global $wp_filesystem; - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - if ( $reinstall ) $url = 'update-core.php?action=do-core-reinstall'; else @@ -710,7 +706,6 @@ check_admin_referer( 'upgrade-translations' ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $url = 'update-core.php?action=do-translation-upgrade'; $nonce = 'upgrade-translations'; Index: src/wp-admin/update.php =================================================================== --- src/wp-admin/update.php (revision 38348) +++ src/wp-admin/update.php (working copy) @@ -12,8 +12,6 @@ /** WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); -include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); - if ( isset($_GET['action']) ) { $plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : ''; $theme = isset($_REQUEST['theme']) ? urldecode($_REQUEST['theme']) : ''; @@ -218,8 +216,6 @@ if ( ! current_user_can('install_themes') ) wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); - include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); //for themes_api.. - check_admin_referer( 'install-theme_' . $theme ); $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth. Index: src/wp-includes/admin-bar.php =================================================================== --- src/wp-includes/admin-bar.php (revision 38348) +++ src/wp-includes/admin-bar.php (working copy) @@ -26,9 +26,6 @@ if ( ! is_admin_bar_showing() ) return false; - /* Load the admin bar class code ready for instantiation */ - require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' ); - /* Instantiate the admin bar */ /** @@ -294,10 +291,10 @@ } if ( is_network_admin() ) { - /* translators: %s: site name */ + /* translators: %s: site name */ $blogname = sprintf( __( 'Network Admin: %s' ), esc_html( get_current_site()->site_name ) ); } elseif ( is_user_admin() ) { - /* translators: %s: site name */ + /* translators: %s: site name */ $blogname = sprintf( __( 'User Dashboard: %s' ), esc_html( get_current_site()->site_name ) ); } Index: src/wp-includes/class-feed.php =================================================================== --- src/wp-includes/class-feed.php (revision 38348) +++ src/wp-includes/class-feed.php (working copy) @@ -1,8 +1,4 @@ smtp)) { - require_once( 'class-smtp.php' ); $this->smtp = new SMTP; } return $this->smtp; Index: src/wp-includes/class-simplepie.php =================================================================== --- src/wp-includes/class-simplepie.php (revision 38348) +++ src/wp-includes/class-simplepie.php (working copy) @@ -1,21 +1,6 @@ components, $this ); - require_once( ABSPATH . WPINC . '/customize/class-wp-customize-selective-refresh.php' ); $this->selective_refresh = new WP_Customize_Selective_Refresh( $this ); if ( in_array( 'widgets', $components, true ) ) { - require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' ); $this->widgets = new WP_Customize_Widgets( $this ); } if ( in_array( 'nav_menus', $components, true ) ) { - require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' ); $this->nav_menus = new WP_Customize_Nav_Menus( $this ); } Index: src/wp-includes/class-wp-customize-panel.php =================================================================== --- src/wp-includes/class-wp-customize-panel.php (revision 38348) +++ src/wp-includes/class-wp-customize-panel.php (working copy) @@ -384,6 +384,3 @@ error_data[ $code ] ); } } - -/** - * Check whether variable is a WordPress Error. - * - * Returns true if $thing is an object of the WP_Error class. - * - * @since 2.1.0 - * - * @param mixed $thing Check if unknown variable is a WP_Error object. - * @return bool True, if WP_Error. False, if not WP_Error. - */ -function is_wp_error( $thing ) { - return ( $thing instanceof WP_Error ); -} Index: src/wp-includes/comment.php =================================================================== --- src/wp-includes/comment.php (revision 38348) +++ src/wp-includes/comment.php (working copy) @@ -2369,8 +2369,6 @@ */ function pingback($content, $post_ID) { global $wp_version; - include_once(ABSPATH . WPINC . '/class-IXR.php'); - include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php'); // original code by Mort (http://mort.mine.nu:8080) $post_links = array(); @@ -2513,8 +2511,6 @@ */ function weblog_ping($server = '', $path = '') { global $wp_version; - include_once(ABSPATH . WPINC . '/class-IXR.php'); - include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php'); // using a timeout of 3 seconds should be enough to cover slow servers $client = new WP_HTTP_IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path)); Index: src/wp-includes/compat.php =================================================================== --- src/wp-includes/compat.php (revision 38348) +++ src/wp-includes/compat.php (working copy) @@ -280,7 +280,6 @@ global $wp_json; if ( ! ( $wp_json instanceof Services_JSON ) ) { - require_once( ABSPATH . WPINC . '/class-json.php' ); $wp_json = new Services_JSON(); } @@ -299,7 +298,6 @@ global $wp_json; if ( ! ($wp_json instanceof Services_JSON ) ) { - require_once( ABSPATH . WPINC . '/class-json.php' ); $wp_json = new Services_JSON(); } Index: src/wp-includes/default-widgets.php =================================================================== --- src/wp-includes/default-widgets.php (revision 38348) +++ src/wp-includes/default-widgets.php (nonexistent) @@ -1,47 +0,0 @@ -get_html( $url, $args ); } @@ -112,8 +111,6 @@ * @param boolean $regex Optional. Whether the `$format` parameter is in a RegEx format. Default false. */ function wp_oembed_add_provider( $format, $provider, $regex = false ) { - require_once( ABSPATH . WPINC . '/class-oembed.php' ); - if ( did_action( 'plugins_loaded' ) ) { $oembed = _wp_oembed_get_object(); $oembed->providers[$format] = array( $provider, $regex ); @@ -133,8 +130,6 @@ * @return bool Was the provider removed successfully? */ function wp_oembed_remove_provider( $format ) { - require_once( ABSPATH . WPINC . '/class-oembed.php' ); - if ( did_action( 'plugins_loaded' ) ) { $oembed = _wp_oembed_get_object(); @@ -706,7 +701,6 @@ return $result; } - require_once( ABSPATH . WPINC . '/class-oembed.php' ); $wp_oembed = _wp_oembed_get_object(); // Don't modify the HTML for trusted providers. @@ -1072,3 +1066,22 @@ return $data; } + +/** + * Returns the initialized WP_oEmbed object. + * + * @since 2.9.0 + * @access private + * + * @staticvar WP_oEmbed $wp_oembed + * + * @return WP_oEmbed object. + */ +function _wp_oembed_get_object() { + static $wp_oembed = null; + + if ( is_null( $wp_oembed ) ) { + $wp_oembed = new WP_oEmbed(); + } + return $wp_oembed; +} Index: src/wp-includes/feed.php =================================================================== --- src/wp-includes/feed.php (revision 38348) +++ src/wp-includes/feed.php (working copy) @@ -663,8 +663,6 @@ * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success */ function fetch_feed( $url ) { - require_once( ABSPATH . WPINC . '/class-feed.php' ); - $feed = new SimplePie(); $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); Index: src/wp-includes/functions.php =================================================================== --- src/wp-includes/functions.php (revision 38348) +++ src/wp-includes/functions.php (working copy) @@ -563,8 +563,6 @@ global $wpdb; //TODO: Tidy this ghetto code up and make the debug code optional - include_once( ABSPATH . WPINC . '/class-IXR.php' ); - $post_links = array(); $pung = get_enclosed( $post_ID ); @@ -3592,8 +3590,6 @@ return; } - require_once( ABSPATH . WPINC . '/default-widgets.php' ); - add_action( '_admin_menu', 'wp_widgets_add_menu' ); } Index: src/wp-includes/general-template.php =================================================================== --- src/wp-includes/general-template.php (revision 38348) +++ src/wp-includes/general-template.php (working copy) @@ -2980,9 +2980,6 @@ * @param array $settings See _WP_Editors::editor(). */ function wp_editor( $content, $editor_id, $settings = array() ) { - if ( ! class_exists( '_WP_Editors', false ) ) - require( ABSPATH . WPINC . '/class-wp-editor.php' ); - _WP_Editors::editor($content, $editor_id, $settings); } Index: src/wp-includes/load.php =================================================================== --- src/wp-includes/load.php (revision 38348) +++ src/wp-includes/load.php (working copy) @@ -865,7 +865,6 @@ require ABSPATH . WPINC . '/version.php'; // Translation and localization - require_once ABSPATH . WPINC . '/pomo/mo.php'; require_once ABSPATH . WPINC . '/l10n.php'; require_once ABSPATH . WPINC . '/locale.php'; @@ -1045,3 +1044,17 @@ */ return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ); } + +/** + * Check whether variable is a WordPress Error. + * + * Returns true if $thing is an object of the WP_Error class. + * + * @since 2.1.0 + * + * @param mixed $thing Check if unknown variable is a WP_Error object. + * @return bool True, if WP_Error. False, if not WP_Error. + */ +function is_wp_error( $thing ) { + return ( $thing instanceof WP_Error ); +} \ No newline at end of file Index: src/wp-includes/locale.php =================================================================== --- src/wp-includes/locale.php (revision 38348) +++ src/wp-includes/locale.php (working copy) @@ -7,9 +7,6 @@ * @since 1.2.0 */ -/** WP_Locale class */ -require_once ABSPATH . WPINC . '/class-wp-locale.php'; - /** * Checks if current locale is RTL. * Index: src/wp-includes/media.php =================================================================== --- src/wp-includes/media.php (revision 38348) +++ src/wp-includes/media.php (working copy) @@ -2909,10 +2909,6 @@ * editor claims to support the request. */ function _wp_image_editor_choose( $args = array() ) { - require_once ABSPATH . WPINC . '/class-wp-image-editor.php'; - require_once ABSPATH . WPINC . '/class-wp-image-editor-gd.php'; - require_once ABSPATH . WPINC . '/class-wp-image-editor-imagick.php'; - /** * Filters the list of image editing library classes. * Index: src/wp-includes/ms-settings.php =================================================================== --- src/wp-includes/ms-settings.php (revision 38348) +++ src/wp-includes/ms-settings.php (working copy) @@ -22,12 +22,6 @@ */ global $current_site, $current_blog; -/** WP_Network class */ -require_once( ABSPATH . WPINC . '/class-wp-network.php' ); - -/** WP_Site class */ -require_once( ABSPATH . WPINC . '/class-wp-site.php' ); - /** Multisite loader */ require_once( ABSPATH . WPINC . '/ms-load.php' ); Index: src/wp-includes/nav-menu-template.php =================================================================== --- src/wp-includes/nav-menu-template.php (revision 38348) +++ src/wp-includes/nav-menu-template.php (working copy) @@ -7,9 +7,6 @@ * @since 3.0.0 */ -/** Walker_Nav_Menu class */ -require_once ABSPATH . WPINC . '/class-walker-nav-menu.php'; - /** * Displays a navigation menu. * Index: src/wp-includes/pluggable.php =================================================================== --- src/wp-includes/pluggable.php (revision 38348) +++ src/wp-includes/pluggable.php (working copy) @@ -210,8 +210,6 @@ // (Re)create it, if it's gone missing if ( ! ( $phpmailer instanceof PHPMailer ) ) { - require_once ABSPATH . WPINC . '/class-phpmailer.php'; - require_once ABSPATH . WPINC . '/class-smtp.php'; $phpmailer = new PHPMailer( true ); } @@ -1739,7 +1737,6 @@ // Now insert the key, hashed, into the DB. if ( empty( $wp_hasher ) ) { - require_once ABSPATH . WPINC . '/class-phpass.php'; $wp_hasher = new PasswordHash( 8, true ); } $hashed = time() . ':' . $wp_hasher->HashPassword( $key ); @@ -2014,7 +2011,6 @@ global $wp_hasher; if ( empty($wp_hasher) ) { - require_once( ABSPATH . WPINC . '/class-phpass.php'); // By default, use the portable hash from phpass $wp_hasher = new PasswordHash(8, true); } @@ -2074,7 +2070,6 @@ // If the stored hash is longer than an MD5, presume the // new style phpass portable hash. if ( empty($wp_hasher) ) { - require_once( ABSPATH . WPINC . '/class-phpass.php'); // By default, use the portable hash from phpass $wp_hasher = new PasswordHash(8, true); } @@ -2409,9 +2404,6 @@ $defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '' ); $args = wp_parse_args( $args, $defaults ); - if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) - require( ABSPATH . WPINC . '/wp-diff.php' ); - $left_string = normalize_whitespace($left_string); $right_string = normalize_whitespace($right_string); Index: src/wp-includes/pomo/mo.php =================================================================== --- src/wp-includes/pomo/mo.php (revision 38348) +++ src/wp-includes/pomo/mo.php (working copy) @@ -7,9 +7,6 @@ * @subpackage mo */ -require_once dirname(__FILE__) . '/translations.php'; -require_once dirname(__FILE__) . '/streams.php'; - if ( ! class_exists( 'MO', false ) ): class MO extends Gettext_Translations { Index: src/wp-includes/post-template.php =================================================================== --- src/wp-includes/post-template.php (revision 38348) +++ src/wp-includes/post-template.php (working copy) @@ -785,7 +785,6 @@ if ( ! isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) ) return true; - require_once ABSPATH . WPINC . '/class-phpass.php'; $hasher = new PasswordHash( 8, true ); $hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ); Index: src/wp-includes/script-loader.php =================================================================== --- src/wp-includes/script-loader.php (revision 38348) +++ src/wp-includes/script-loader.php (working copy) @@ -16,18 +16,9 @@ * @package WordPress */ -/** WordPress Dependencies Class */ -require( ABSPATH . WPINC . '/class.wp-dependencies.php' ); - -/** WordPress Scripts Class */ -require( ABSPATH . WPINC . '/class.wp-scripts.php' ); - /** WordPress Scripts Functions */ require( ABSPATH . WPINC . '/functions.wp-scripts.php' ); -/** WordPress Styles Class */ -require( ABSPATH . WPINC . '/class.wp-styles.php' ); - /** WordPress Styles Functions */ require( ABSPATH . WPINC . '/functions.wp-styles.php' ); Index: src/wp-includes/theme.php =================================================================== --- src/wp-includes/theme.php (revision 38348) +++ src/wp-includes/theme.php (working copy) @@ -2082,7 +2082,6 @@ return; } - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; $GLOBALS['wp_customize'] = new WP_Customize_Manager(); } Index: src/wp-includes/update.php =================================================================== --- src/wp-includes/update.php (revision 38348) +++ src/wp-includes/update.php (working copy) @@ -505,7 +505,6 @@ */ function wp_maybe_auto_update() { include_once( ABSPATH . '/wp-admin/includes/admin.php' ); - include_once( ABSPATH . '/wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new WP_Automatic_Updater; $upgrader->run(); Index: src/wp-includes/user.php =================================================================== --- src/wp-includes/user.php (revision 38348) +++ src/wp-includes/user.php (working copy) @@ -2095,7 +2095,6 @@ // Now insert the key, hashed, into the DB. if ( empty( $wp_hasher ) ) { - require_once ABSPATH . WPINC . '/class-phpass.php'; $wp_hasher = new PasswordHash( 8, true ); } $hashed = time() . ':' . $wp_hasher->HashPassword( $key ); @@ -2140,7 +2139,6 @@ return new WP_Error('invalid_key', __('Invalid key')); if ( empty( $wp_hasher ) ) { - require_once ABSPATH . WPINC . '/class-phpass.php'; $wp_hasher = new PasswordHash( 8, true ); } Index: src/wp-load.php =================================================================== --- src/wp-load.php (revision 38348) +++ src/wp-load.php (working copy) @@ -25,6 +25,13 @@ error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); +// Load the PHP 5.2 compatible autoloader. +if ( ! file_exists( ABSPATH . '/vendor/autoload_52.php' ) ) { + die( 'Autoloader was not found, aborting.' ); +} + +require_once( ABSPATH . '/vendor/autoload_52.php' ); + /* * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit Index: src/wp-login.php =================================================================== --- src/wp-login.php (revision 38348) +++ src/wp-login.php (working copy) @@ -439,7 +439,6 @@ exit(); } - require_once ABSPATH . WPINC . '/class-phpass.php'; $hasher = new PasswordHash( 8, true ); /** Index: src/wp-mail.php =================================================================== --- src/wp-mail.php (revision 38348) +++ src/wp-mail.php (working copy) @@ -21,9 +21,6 @@ */ do_action( 'wp-mail.php' ); -/** Get the POP3 class with which to access the mailbox. */ -require_once( ABSPATH . WPINC . '/class-pop3.php' ); - /** Only check at this interval for new messages. */ if ( !defined('WP_MAIL_INTERVAL') ) define('WP_MAIL_INTERVAL', 300); // 5 minutes Index: src/wp-settings.php =================================================================== --- src/wp-settings.php (revision 38348) +++ src/wp-settings.php (working copy) @@ -92,9 +92,6 @@ // Load early WordPress files. require( ABSPATH . WPINC . '/compat.php' ); require( ABSPATH . WPINC . '/functions.php' ); -require( ABSPATH . WPINC . '/class-wp.php' ); -require( ABSPATH . WPINC . '/class-wp-error.php' ); -require( ABSPATH . WPINC . '/pomo/mo.php' ); // Include the wpdb class and, if present, a db.php database drop-in. global $wpdb; @@ -112,8 +109,6 @@ // Initialize multisite if enabled. if ( is_multisite() ) { - require( ABSPATH . WPINC . '/class-wp-site-query.php' ); - require( ABSPATH . WPINC . '/class-wp-network-query.php' ); require( ABSPATH . WPINC . '/ms-blogs.php' ); require( ABSPATH . WPINC . '/ms-settings.php' ); } elseif ( ! defined( 'MULTISITE' ) ) { @@ -133,47 +128,28 @@ wp_not_installed(); // Load most of WordPress. -require( ABSPATH . WPINC . '/class-wp-walker.php' ); -require( ABSPATH . WPINC . '/class-wp-ajax-response.php' ); require( ABSPATH . WPINC . '/formatting.php' ); require( ABSPATH . WPINC . '/capabilities.php' ); -require( ABSPATH . WPINC . '/class-wp-roles.php' ); -require( ABSPATH . WPINC . '/class-wp-role.php' ); -require( ABSPATH . WPINC . '/class-wp-user.php' ); require( ABSPATH . WPINC . '/query.php' ); require( ABSPATH . WPINC . '/date.php' ); require( ABSPATH . WPINC . '/theme.php' ); -require( ABSPATH . WPINC . '/class-wp-theme.php' ); require( ABSPATH . WPINC . '/template.php' ); require( ABSPATH . WPINC . '/user.php' ); -require( ABSPATH . WPINC . '/class-wp-user-query.php' ); require( ABSPATH . WPINC . '/session.php' ); require( ABSPATH . WPINC . '/meta.php' ); -require( ABSPATH . WPINC . '/class-wp-meta-query.php' ); -require( ABSPATH . WPINC . '/class-wp-metadata-lazyloader.php' ); require( ABSPATH . WPINC . '/general-template.php' ); require( ABSPATH . WPINC . '/link-template.php' ); require( ABSPATH . WPINC . '/author-template.php' ); require( ABSPATH . WPINC . '/post.php' ); -require( ABSPATH . WPINC . '/class-walker-page.php' ); -require( ABSPATH . WPINC . '/class-walker-page-dropdown.php' ); -require( ABSPATH . WPINC . '/class-wp-post-type.php' ); -require( ABSPATH . WPINC . '/class-wp-post.php' ); require( ABSPATH . WPINC . '/post-template.php' ); require( ABSPATH . WPINC . '/revision.php' ); require( ABSPATH . WPINC . '/post-formats.php' ); require( ABSPATH . WPINC . '/post-thumbnail-template.php' ); require( ABSPATH . WPINC . '/category.php' ); -require( ABSPATH . WPINC . '/class-walker-category.php' ); -require( ABSPATH . WPINC . '/class-walker-category-dropdown.php' ); require( ABSPATH . WPINC . '/category-template.php' ); require( ABSPATH . WPINC . '/comment.php' ); -require( ABSPATH . WPINC . '/class-wp-comment.php' ); -require( ABSPATH . WPINC . '/class-wp-comment-query.php' ); -require( ABSPATH . WPINC . '/class-walker-comment.php' ); require( ABSPATH . WPINC . '/comment-template.php' ); require( ABSPATH . WPINC . '/rewrite.php' ); -require( ABSPATH . WPINC . '/class-wp-rewrite.php' ); require( ABSPATH . WPINC . '/feed.php' ); require( ABSPATH . WPINC . '/bookmark.php' ); require( ABSPATH . WPINC . '/bookmark-template.php' ); @@ -182,36 +158,20 @@ require( ABSPATH . WPINC . '/deprecated.php' ); require( ABSPATH . WPINC . '/script-loader.php' ); require( ABSPATH . WPINC . '/taxonomy.php' ); -require( ABSPATH . WPINC . '/class-wp-term.php' ); -require( ABSPATH . WPINC . '/class-wp-term-query.php' ); -require( ABSPATH . WPINC . '/class-wp-tax-query.php' ); require( ABSPATH . WPINC . '/update.php' ); require( ABSPATH . WPINC . '/canonical.php' ); require( ABSPATH . WPINC . '/shortcodes.php' ); require( ABSPATH . WPINC . '/embed.php' ); -require( ABSPATH . WPINC . '/class-wp-embed.php' ); -require( ABSPATH . WPINC . '/class-wp-oembed-controller.php' ); require( ABSPATH . WPINC . '/media.php' ); require( ABSPATH . WPINC . '/http.php' ); -require( ABSPATH . WPINC . '/class-http.php' ); -require( ABSPATH . WPINC . '/class-wp-http-streams.php' ); -require( ABSPATH . WPINC . '/class-wp-http-curl.php' ); -require( ABSPATH . WPINC . '/class-wp-http-proxy.php' ); -require( ABSPATH . WPINC . '/class-wp-http-cookie.php' ); -require( ABSPATH . WPINC . '/class-wp-http-encoding.php' ); -require( ABSPATH . WPINC . '/class-wp-http-response.php' ); -require( ABSPATH . WPINC . '/class-wp-http-requests-response.php' ); require( ABSPATH . WPINC . '/widgets.php' ); -require( ABSPATH . WPINC . '/class-wp-widget.php' ); -require( ABSPATH . WPINC . '/class-wp-widget-factory.php' ); require( ABSPATH . WPINC . '/nav-menu.php' ); require( ABSPATH . WPINC . '/nav-menu-template.php' ); require( ABSPATH . WPINC . '/admin-bar.php' ); require( ABSPATH . WPINC . '/rest-api.php' ); -require( ABSPATH . WPINC . '/rest-api/class-wp-rest-server.php' ); -require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' ); -require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' ); +$GLOBALS['wp_embed'] = new WP_Embed(); + // Load multisite-specific files. if ( is_multisite() ) { require( ABSPATH . WPINC . '/ms-functions.php' ); Index: src/xmlrpc.php =================================================================== --- src/xmlrpc.php (revision 38348) +++ src/xmlrpc.php (working copy) @@ -60,8 +60,6 @@ } include_once(ABSPATH . 'wp-admin/includes/admin.php'); -include_once(ABSPATH . WPINC . '/class-IXR.php'); -include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php'); /** * Posts submitted via the XML-RPC interface get that title Index: tests/phpunit/includes/bootstrap.php =================================================================== --- tests/phpunit/includes/bootstrap.php (revision 38348) +++ tests/phpunit/includes/bootstrap.php (working copy) @@ -3,7 +3,6 @@ * Installs WordPress for running the tests and loads WordPress and the test libraries */ - $config_file_path = dirname( dirname( __FILE__ ) ); if ( ! file_exists( $config_file_path . '/wp-tests-config.php' ) ) { // Support the config file from the root of the develop repository. @@ -24,6 +23,13 @@ require_once $config_file_path; require_once dirname( __FILE__ ) . '/functions.php'; +// Load the PHP 5.2 compatible autoloader. +if ( ! file_exists( ABSPATH . '/vendor/autoload_52.php' ) ) { + die( 'Autoloader was not found, aborting.' ); +} + +require_once( ABSPATH . '/vendor/autoload_52.php' ); + tests_reset__SERVER(); define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); Index: tests/phpunit/includes/install.php =================================================================== --- tests/phpunit/includes/install.php (revision 38348) +++ tests/phpunit/includes/install.php (working copy) @@ -13,6 +13,13 @@ require_once $config_file_path; require_once dirname( __FILE__ ) . '/functions.php'; +// Load the PHP 5.2 compatible autoloader. +if ( ! file_exists( ABSPATH . '/vendor/autoload_52.php' ) ) { + die( 'Autoloader was not found, aborting.' ); +} + +require_once( ABSPATH . '/vendor/autoload_52.php' ); + tests_reset__SERVER(); $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; Index: tests/phpunit/tests/adminbar.php =================================================================== --- tests/phpunit/tests/adminbar.php (revision 38348) +++ tests/phpunit/tests/adminbar.php (working copy) @@ -14,12 +14,6 @@ protected static $user_ids = array(); - public static function setUpBeforeClass() { - require_once( ABSPATH . WPINC . '/class-wp-admin-bar.php' ); - - parent::setUpBeforeClass(); - } - public static function wpSetUpBeforeClass( $factory ) { self::$user_ids[] = self::$editor_id = $factory->user->create( array( 'role' => 'editor' ) ); self::$user_ids[] = self::$admin_id = $factory->user->create( array( 'role' => 'administrator' ) ); Index: tests/phpunit/tests/ajax/CustomizeMenus.php =================================================================== --- tests/phpunit/tests/ajax/CustomizeMenus.php (revision 38348) +++ tests/phpunit/tests/ajax/CustomizeMenus.php (working copy) @@ -21,7 +21,7 @@ */ public function setUp() { parent::setUp(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); global $wp_customize; $this->wp_customize = new WP_Customize_Manager(); Index: tests/phpunit/tests/auth.php =================================================================== --- tests/phpunit/tests/auth.php (revision 38348) +++ tests/phpunit/tests/auth.php (working copy) @@ -22,7 +22,6 @@ self::$user_id = self::$_user->ID; - require_once( ABSPATH . WPINC . '/class-phpass.php' ); self::$wp_hasher = new PasswordHash( 8, true ); } Index: tests/phpunit/tests/customize/manager.php =================================================================== --- tests/phpunit/tests/customize/manager.php (revision 38348) +++ tests/phpunit/tests/customize/manager.php (working copy) @@ -31,7 +31,7 @@ */ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); + $this->manager = $this->instantiate(); $this->undefined = new stdClass(); } @@ -977,8 +977,6 @@ } } -require_once ABSPATH . WPINC . '/class-wp-customize-setting.php'; - /** * Class Test_Dynamic_Customize_Setting * Index: tests/phpunit/tests/customize/nav-menu-item-setting.php =================================================================== --- tests/phpunit/tests/customize/nav-menu-item-setting.php (revision 38348) +++ tests/phpunit/tests/customize/nav-menu-item-setting.php (working copy) @@ -20,7 +20,7 @@ */ function setUp() { parent::setUp(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); global $wp_customize; Index: tests/phpunit/tests/customize/nav-menu-setting.php =================================================================== --- tests/phpunit/tests/customize/nav-menu-setting.php (revision 38348) +++ tests/phpunit/tests/customize/nav-menu-setting.php (working copy) @@ -21,7 +21,7 @@ */ function setUp() { parent::setUp(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); global $wp_customize; Index: tests/phpunit/tests/customize/nav-menus.php =================================================================== --- tests/phpunit/tests/customize/nav-menus.php (revision 38348) +++ tests/phpunit/tests/customize/nav-menus.php (working copy) @@ -21,7 +21,7 @@ */ function setUp() { parent::setUp(); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; + wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); global $wp_customize; $this->wp_customize = new WP_Customize_Manager(); Index: tests/phpunit/tests/customize/panel.php =================================================================== --- tests/phpunit/tests/customize/panel.php (revision 38348) +++ tests/phpunit/tests/customize/panel.php (working copy) @@ -14,7 +14,7 @@ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); + $GLOBALS['wp_customize'] = new WP_Customize_Manager(); $this->manager = $GLOBALS['wp_customize']; $this->undefined = new stdClass(); @@ -211,7 +211,6 @@ } } -require_once ABSPATH . WPINC . '/class-wp-customize-panel.php'; class Custom_Panel_Test extends WP_Customize_Panel { public $type = 'titleless'; Index: tests/phpunit/tests/customize/partial.php =================================================================== --- tests/phpunit/tests/customize/partial.php (revision 38348) +++ tests/phpunit/tests/customize/partial.php (working copy) @@ -31,7 +31,7 @@ */ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); + // @codingStandardsIgnoreStart $GLOBALS['wp_customize'] = new WP_Customize_Manager(); // @codingStandardsIgnoreEnd Index: tests/phpunit/tests/customize/section.php =================================================================== --- tests/phpunit/tests/customize/section.php (revision 38348) +++ tests/phpunit/tests/customize/section.php (working copy) @@ -26,7 +26,7 @@ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); + $GLOBALS['wp_customize'] = new WP_Customize_Manager(); $this->manager = $GLOBALS['wp_customize']; $this->undefined = new stdClass(); @@ -224,7 +224,6 @@ } } -require_once ABSPATH . WPINC . '/class-wp-customize-section.php'; class Custom_Section_Test extends WP_Customize_Section { public $type = 'titleless'; Index: tests/phpunit/tests/customize/selective-refresh-ajax.php =================================================================== --- tests/phpunit/tests/customize/selective-refresh-ajax.php (revision 38348) +++ tests/phpunit/tests/customize/selective-refresh-ajax.php (working copy) @@ -43,7 +43,6 @@ } add_filter( 'wp_die_ajax_handler', array( $this, 'get_wp_die_handler' ), 1, 1 ); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); // @codingStandardsIgnoreStart $GLOBALS['wp_customize'] = new WP_Customize_Manager(); // @codingStandardsIgnoreEnd Index: tests/phpunit/tests/customize/selective-refresh.php =================================================================== --- tests/phpunit/tests/customize/selective-refresh.php (revision 38348) +++ tests/phpunit/tests/customize/selective-refresh.php (working copy) @@ -31,7 +31,7 @@ */ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); + // @codingStandardsIgnoreStart $GLOBALS['wp_customize'] = new WP_Customize_Manager(); // @codingStandardsIgnoreEnd @@ -256,8 +256,6 @@ } } -require_once ABSPATH . WPINC . '/customize/class-wp-customize-partial.php'; - /** * Class Tested_Custom_Partial */ Index: tests/phpunit/tests/customize/setting.php =================================================================== --- tests/phpunit/tests/customize/setting.php (revision 38348) +++ tests/phpunit/tests/customize/setting.php (working copy) @@ -19,7 +19,7 @@ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); + $GLOBALS['wp_customize'] = new WP_Customize_Manager(); $this->manager = $GLOBALS['wp_customize']; $this->undefined = new stdClass(); Index: tests/phpunit/tests/customize/widgets.php =================================================================== --- tests/phpunit/tests/customize/widgets.php (revision 38348) +++ tests/phpunit/tests/customize/widgets.php (working copy) @@ -22,7 +22,6 @@ function setUp() { parent::setUp(); - require_once( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); add_theme_support( 'customize-selective-refresh-widgets' ); $user_id = self::factory()->user->create( array( 'role' => 'administrator' ) ); Index: tests/phpunit/tests/general/template.php =================================================================== --- tests/phpunit/tests/general/template.php (revision 38348) +++ tests/phpunit/tests/general/template.php (working copy) @@ -17,8 +17,7 @@ function setUp() { parent::setUp(); - require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php'; - $this->wp_site_icon = $GLOBALS['wp_site_icon']; + $this->wp_site_icon = new WP_Site_Icon; } function tearDown() { Index: tests/phpunit/tests/image/editor.php =================================================================== --- tests/phpunit/tests/image/editor.php (revision 38348) +++ tests/phpunit/tests/image/editor.php (working copy) @@ -14,8 +14,6 @@ * Setup test fixture */ public function setup() { - require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); - include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' ); parent::setUp(); Index: tests/phpunit/tests/image/editor_gd.php =================================================================== --- tests/phpunit/tests/image/editor_gd.php (revision 38348) +++ tests/phpunit/tests/image/editor_gd.php (working copy) @@ -12,13 +12,6 @@ public $editor_engine = 'WP_Image_Editor_GD'; - public function setUp() { - require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); - require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' ); - - parent::setUp(); - } - public function tearDown() { $folder = DIR_TESTDATA . '/images/waffles-*.jpg'; Index: tests/phpunit/tests/image/editor_imagick.php =================================================================== --- tests/phpunit/tests/image/editor_imagick.php (revision 38348) +++ tests/phpunit/tests/image/editor_imagick.php (working copy) @@ -12,13 +12,6 @@ public $editor_engine = 'WP_Image_Editor_Imagick'; - public function setUp() { - require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); - require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' ); - - parent::setUp(); - } - public function tearDown() { $folder = DIR_TESTDATA . '/images/waffles-*.jpg'; @@ -465,7 +458,7 @@ $editor = new WP_Image_Editor_Imagick( $file ); $this->assertNotInstanceOf( 'WP_Error', $editor ); - + $editor->load(); $editor->resize( 5, 5 ); $save_to_file = tempnam( get_temp_dir(), '' ) . '.png'; Index: tests/phpunit/tests/image/functions.php =================================================================== --- tests/phpunit/tests/image/functions.php (revision 38348) +++ tests/phpunit/tests/image/functions.php (working copy) @@ -11,12 +11,6 @@ * Setup test fixture */ public function setUp() { - parent::setUp(); - - require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); - require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' ); - require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' ); - include_once( DIR_TESTDATA . '/../includes/mock-image-editor.php' ); } Index: tests/phpunit/tests/image/resize_gd.php =================================================================== --- tests/phpunit/tests/image/resize_gd.php (revision 38348) +++ tests/phpunit/tests/image/resize_gd.php (working copy) @@ -16,13 +16,6 @@ */ public $editor_engine = 'WP_Image_Editor_GD'; - public function setUp() { - require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); - require_once( ABSPATH . WPINC . '/class-wp-image-editor-gd.php' ); - - parent::setUp(); - } - /** * Try resizing a php file (bad image) * @ticket 6821 Index: tests/phpunit/tests/image/resize_imagick.php =================================================================== --- tests/phpunit/tests/image/resize_imagick.php (revision 38348) +++ tests/phpunit/tests/image/resize_imagick.php (working copy) @@ -15,11 +15,4 @@ * @var string */ public $editor_engine = 'WP_Image_Editor_Imagick'; - - public function setUp() { - require_once( ABSPATH . WPINC . '/class-wp-image-editor.php' ); - require_once( ABSPATH . WPINC . '/class-wp-image-editor-imagick.php' ); - - parent::setUp(); - } } \ No newline at end of file Index: tests/phpunit/tests/image/site_icon.php =================================================================== --- tests/phpunit/tests/image/site_icon.php (revision 38348) +++ tests/phpunit/tests/image/site_icon.php (working copy) @@ -12,8 +12,7 @@ function setUp() { parent::setUp(); - require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php'; - $this->wp_site_icon = $GLOBALS['wp_site_icon']; + $this->wp_site_icon = new WP_Site_Icon; } function tearDown() { Index: tests/phpunit/tests/menu/walker-nav-menu-edit.php =================================================================== --- tests/phpunit/tests/menu/walker-nav-menu-edit.php (revision 38348) +++ tests/phpunit/tests/menu/walker-nav-menu-edit.php (working copy) @@ -12,9 +12,6 @@ parent::setUp(); - /** Walker_Nav_Menu_Edit class */ - require_once( ABSPATH . 'wp-admin/includes/class-walker-nav-menu-edit.php' ); - $this->walker = new Walker_Nav_Menu_Edit(); $this->_wp_nav_menu_max_depth = $_wp_nav_menu_max_depth; Index: tests/phpunit/tests/oembed/wpOembed.php =================================================================== --- tests/phpunit/tests/oembed/wpOembed.php (revision 38348) +++ tests/phpunit/tests/oembed/wpOembed.php (working copy) @@ -14,7 +14,6 @@ public function setUp() { parent::setUp(); - require_once ABSPATH . WPINC . '/class-oembed.php'; $this->oembed = _wp_oembed_get_object(); $this->pre_oembed_result_filtered = false; Index: tests/phpunit/tests/widgets.php =================================================================== --- tests/phpunit/tests/widgets.php (revision 38348) +++ tests/phpunit/tests/widgets.php (working copy) @@ -509,7 +509,6 @@ $this->assertFalse( $widget->is_preview() ); wp_set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); - require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; $wp_customize = new WP_Customize_Manager(); $wp_customize->start_previewing_theme(); Index: tests/phpunit/tests/xmlrpc/basic.php =================================================================== --- tests/phpunit/tests/xmlrpc/basic.php (revision 38348) +++ tests/phpunit/tests/xmlrpc/basic.php (working copy) @@ -1,8 +1,5 @@