Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added autoloader to reduce complexity; fix phpcs issues #828

Merged
merged 49 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8346524
Added classmap autoloader, removed all require_once(), deprecated amp…
mikeschinkel Dec 8, 2017
5c1fa20
Remove duplicated array index.
mikeschinkel Dec 8, 2017
33c0ebf
Initialize array that is used by may not have been initialized.
mikeschinkel Dec 8, 2017
08bac6b
Removed unused variables.
mikeschinkel Dec 8, 2017
e5c1a8c
Removed 2nd parameter to remove_shortcode() because remove_shortcode(…
mikeschinkel Dec 8, 2017
8b267ef
Added some PHPDoc for methods.
mikeschinkel Dec 8, 2017
8b34e24
Added PHPDoc so PhpStorm will not flag as an error.
mikeschinkel Dec 8, 2017
b54243b
Add dev-lib
westonruter Nov 5, 2017
38cccab
Remove partial PHPDoc header.
mikeschinkel Dec 9, 2017
f13c385
Restructure autoloader to use static methods.
mikeschinkel Dec 9, 2017
03c126b
Document the sanitizers
mikeschinkel Dec 9, 2017
fdd1c74
Documented AMP DOM Utils.
mikeschinkel Dec 9, 2017
48c492e
Updating reference to dev-lib
mikeschinkel Dec 9, 2017
1a0b53c
Documented PHPDoc header for amp_get_permalink()
mikeschinkel Dec 9, 2017
fb10624
Renamed _build_placeholder() back to build_placeholder() since no whe…
mikeschinkel Dec 9, 2017
19b6f04
Remove errant tick mark.
mikeschinkel Dec 9, 2017
b1ee243
Revert string concatenation style change.
mikeschinkel Dec 9, 2017
010dad4
Revert regex syntax style change.
mikeschinkel Dec 9, 2017
8fad986
Add class AMP_Rule_Spec in its own file.
mikeschinkel Dec 9, 2017
241e866
Merge branch 'develop' of https://github.com/Automattic/amp-wp into n…
westonruter Dec 10, 2017
38992ed
Fix autoloader file refs and PHP 5.2 compat
westonruter Dec 10, 2017
5fcbc2b
Fix phpcs
westonruter Dec 10, 2017
2105af0
Stop <amg-audio> sanitizer from including a contained "\n" (and thus …
mikeschinkel Dec 11, 2017
f85c366
Revert the unfortunate change that broke placeholders in iframes.
mikeschinkel Dec 11, 2017
564a9d9
Ensure that no errant whitespace text nodes are added to output. Thi…
mikeschinkel Dec 11, 2017
f90c16d
Exclude includes/lib from linting; temporarily disable phpcs
westonruter Dec 11, 2017
b62132a
Change self::class to hardcode the class to support earlier versions …
mikeschinkel Dec 11, 2017
5417aeb
Fix improperly added filepath for the FastImage class in the autoloader.
mikeschinkel Dec 11, 2017
19658c9
Merge branch 'develop' of github.com:newclarity/amp-wp into develop
mikeschinkel Dec 11, 2017
a66c992
Merge branch 'develop' of github.com:newclarity/amp-wp into develop
mikeschinkel Dec 11, 2017
23bf64f
Fixed autoloader for PHP 5.2, e.g. __DIR__ ==> dirname( __FILE__ )
mikeschinkel Dec 11, 2017
bfa54bc
PHP5.2: Remove '\' from on front of ReflectionClass() because PHP 5.2…
mikeschinkel Dec 11, 2017
129bda7
Added PHPDoc explaining relative filepaths not having leading slash o…
mikeschinkel Dec 11, 2017
b1feee0
Added logic in AMP_DOM_Utils::get_content_from_dom() to replace <br><…
mikeschinkel Dec 11, 2017
00bea9b
Another attempt to fix unit test.
mikeschinkel Dec 11, 2017
b74ee8f
Another attempt to fix unit test, take two.
mikeschinkel Dec 11, 2017
6000b50
Ensure that content if retrieved via get_content_from_dom() and not v…
mikeschinkel Dec 11, 2017
6e0c13b
Added a composer.json.
mikeschinkel Dec 11, 2017
bd97046
Handle "no body" in AMP_DOM_Utils::get_content_from_dom()
mikeschinkel Dec 11, 2017
215a27b
Split get_content_from_dom() in to by adding get_content_from_dom_nod…
mikeschinkel Dec 11, 2017
85a46ba
Use the new AMP_DOM_Utils::get_content_from_dom_node() to make failin…
mikeschinkel Dec 11, 2017
de7f617
Remove "repositories" from composer.json because it is not merged in …
mikeschinkel Dec 11, 2017
5d1157f
Had to remove require: php>=5.2 because it appears to be breaking the…
mikeschinkel Dec 11, 2017
42c0600
Ugh. Have to go with minimal composer.json because it is breaking the…
mikeschinkel Dec 11, 2017
47edc2f
Need a commit to trigger a rebuild given that one of them timed out...
mikeschinkel Dec 11, 2017
3e15941
Merge branch 'develop' of github.com:Automattic/amp-wp into develop
ThierryA Dec 11, 2017
f5b2d2f
Include test/stubs in autoloader; remove unused absolute path support…
westonruter Dec 11, 2017
8b416f9
Fix phpcs issues in modified files
westonruter Dec 11, 2017
575ac66
Fix phpcs issues in AMP_Post_Template
westonruter Dec 11, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .dev-lib
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
SYNC_README_MD=0
SYNC_README_MD=0
PATH_EXCLUDES_PATTERN=includes/lib/*

# Temporary to avoid having to fix all phpcs issues for touched files in <https://github.com/Automattic/amp-wp/pull/828>.
DEV_LIB_SKIP=phpcs
13 changes: 2 additions & 11 deletions amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@
define( 'AMP__DIR__', dirname( __FILE__ ) );
define( 'AMP__VERSION', '0.6.0-alpha' );

require_once AMP__DIR__ . '/autoloader.php';
require_once AMP__DIR__ . '/back-compat/back-compat.php';
require_once AMP__DIR__ . '/includes/amp-helper-functions.php';
require_once AMP__DIR__ . '/includes/class-amp-post-type-support.php';
require_once AMP__DIR__ . '/includes/admin/functions.php';
require_once AMP__DIR__ . '/includes/admin/class-amp-customizer.php';
require_once AMP__DIR__ . '/includes/admin/class-amp-post-meta-box.php';
require_once AMP__DIR__ . '/includes/settings/class-amp-customizer-settings.php';
require_once AMP__DIR__ . '/includes/settings/class-amp-customizer-design-settings.php';
require_once AMP__DIR__ . '/includes/actions/class-amp-frontend-actions.php';
require_once AMP__DIR__ . '/includes/actions/class-amp-paired-post-actions.php';

register_activation_hook( __FILE__, 'amp_activate' );
function amp_activate() {
Expand Down Expand Up @@ -150,7 +144,7 @@ function amp_maybe_add_actions() {
}

function amp_load_classes() {
require_once( AMP__DIR__ . '/includes/class-amp-post-template.php' ); // this loads everything else
_deprecated_function( __FUNCTION__, '0.6.0' );
}

function amp_add_frontend_actions() {
Expand Down Expand Up @@ -196,8 +190,6 @@ function amp_render_post( $post ) {
}
$post_id = $post->ID;

amp_load_classes();

/**
* Fires before rendering a post in AMP.
*
Expand Down Expand Up @@ -249,6 +241,5 @@ function amp_redirect_old_slug_to_new_url( $link ) {

// Unconditionally load code required when running unit tests.
if ( function_exists( 'tests_add_filter' ) ) {
amp_load_classes();
require_once dirname( __FILE__ ) . '/tests/stubs.php';
}
141 changes: 141 additions & 0 deletions autoloader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?php

/**
* Autoload the classes used by the AMP plugin.
*
* Class AMP_Autoloader
*/
class AMP_Autoloader {

/**
* Map of Classname to relative filepath sans extension.
*
* @note We omitted the leading slash and the .php extension from each
* relative filepath because they are redundant and to include
* them would take up unnecessary bytes of memory at runtime.
*
* @example Format (note no leading / and no .php extension):
*
* array(
* 'Class_Name1' => 'subdir-of-includes/filename1',
* 'Class_Name2' => '2nd-subdir-of-includes/filename2',
* 'Class_Name3' => '!/full/path/to/filename3.php',
* );
*
* @var string[]
*/
private static $_classmap = array(
'AMP_Actions' => 'actions/class-amp-actions',
'AMP_Frontend_Actions' => 'actions/class-amp-frontend-actions',
'AMP_Paired_Post_Actions' => 'actions/class-amp-paired-post-actions',
'AMP_Template_Customizer' => 'admin/class-amp-customizer',
'AMP_Post_Meta_Box' => 'admin/class-amp-post-meta-box',
'AMP_Post_Type_Support' => 'class-amp-post-type-support',
'AMP_Base_Embed_Handler' => 'embeds/class-amp-base-embed-handler',
'AMP_DailyMotion_Embed_Handler' => 'embeds/class-amp-dailymotion-embed',
'AMP_Facebook_Embed_Handler' => 'embeds/class-amp-facebook-embed',
'AMP_Gallery_Embed_Handler' => 'embeds/class-amp-gallery-embed',
'AMP_Instagram_Embed_Handler' => 'embeds/class-amp-instagram-embed',
'AMP_Pinterest_Embed_Handler' => 'embeds/class-amp-pinterest-embed',
'AMP_SoundCloud_Embed_Handler' => 'embeds/class-amp-soundcloud-embed',
'AMP_Twitter_Embed_Handler' => 'embeds/class-amp-twitter-embed',
'AMP_Vimeo_Embed_Handler' => 'embeds/class-amp-vimeo-embed',
'AMP_Vine_Embed_Handler' => 'embeds/class-amp-vine-embed',
'AMP_YouTube_Embed_Handler' => 'embeds/class-amp-youtube-embed',
'FastImage' => 'lib/fastimage/class-fastimage',
'WillWashburn\\Stream\\Exception\\StreamBufferTooSmallException' => 'lib/fasterimage/Stream/Exception/StreamBufferTooSmallException',
'WillWashburn\\Stream\\StreamableInterface' => 'lib/fasterimage/Stream/StreamableInterface',
'WillWashburn\\Stream\\Stream' => 'lib/fasterimage/Stream/Stream',
'FasterImage\\Exception\\InvalidImageException' => 'lib/fasterimage/Exception/InvalidImageException',
'FasterImage\\ExifParser' => 'lib/fasterimage/ExifParser',
'FasterImage\\ImageParser' => 'lib/fasterimage/ImageParser',
'FasterImage\\FasterImage' => 'lib/fasterimage/FasterImage',
'AMP_Analytics_Options_Submenu' => 'options/class-amp-analytics-options-submenu',
'AMP_Options_Menu' => 'options/class-amp-options-menu',
'AMP_Options_Manager' => 'options/class-amp-options-manager',
'AMP_Analytics_Options_Submenu_Page' => 'options/views/class-amp-analytics-options-submenu-page',
'AMP_Options_Menu_Page' => 'options/views/class-amp-options-menu-page',
'AMP_Rule_Spec' => 'sanitizers/class-amp-rule-spec',
'AMP_Allowed_Tags_Generated' => 'sanitizers/class-amp-allowed-tags-generated',
'AMP_Audio_Sanitizer' => 'sanitizers/class-amp-audio-sanitizer',
'AMP_Base_Sanitizer' => 'sanitizers/class-amp-base-sanitizer',
'AMP_Blacklist_Sanitizer' => 'sanitizers/class-amp-blacklist-sanitizer',
'AMP_Iframe_Sanitizer' => 'sanitizers/class-amp-iframe-sanitizer',
'AMP_Img_Sanitizer' => 'sanitizers/class-amp-img-sanitizer',
'AMP_Playbuzz_Sanitizer' => 'sanitizers/class-amp-playbuzz-sanitizer',
'AMP_Style_Sanitizer' => 'sanitizers/class-amp-style-sanitizer',
'AMP_Tag_And_Attribute_Sanitizer' => 'sanitizers/class-amp-tag-and-attribute-sanitizer',
'AMP_Video_Sanitizer' => 'sanitizers/class-amp-video-sanitizer',
'AMP_Customizer_Design_Settings' => 'settings/class-amp-customizer-design-settings',
'AMP_Customizer_Settings' => 'settings/class-amp-customizer-settings',
'AMP_Content' => 'templates/class-amp-content',
'AMP_Content_Sanitizer' => 'templates/class-amp-content-sanitizer',
'AMP_Post_Template' => 'templates/class-amp-post-template',
'AMP_DOM_Utils' => 'utils/class-amp-dom-utils',
'AMP_HTML_Utils' => 'utils/class-amp-html-utils',
'AMP_Image_Dimension_Extractor' => 'utils/class-amp-image-dimension-extractor',
'AMP_String_Utils' => 'utils/class-amp-string-utils',
'AMP_WP_Utils' => 'utils/class-amp-wp-utils',
'WPCOM_AMP_Polldaddy_Embed' => 'wpcom/class-amp-polldaddy-embed',
);

/**
* Is registered.
*
* @var bool
*/
public static $is_registered = false;

/**
* Perform the autoload on demand when requested by PHP runtime.
*
* Design Goal: Execute as few lines of code as possible each call.
*
* @since 0.6.0
*
* @note If $class_name has first char as '!' strip it and assume
* a full path with extension otherwise assume a subdir of
* /includes/ that does not contain an extension.
*
* @param string $class_name Class name.
*/
protected static function autoload( $class_name ) {
if ( ! isset( self::$_classmap[ $class_name ] ) ) {
return;
}
$filepath = self::$_classmap[ $class_name ];
require '!' !== $filepath[0] ? dirname( __FILE__ ) . "/includes/{$filepath}.php" : substr( $filepath, 1 );
}

/**
* Registers this autoloader to PHP.
*
* @since 0.6.0
*
* Called at the end of this file; calling a second time has no effect.
*/
public static function register() {
if ( ! self::$is_registered ) {
spl_autoload_register( array( __CLASS__, 'autoload' ) );
self::$is_registered = true;
}
}

/**
* Allows an extensions plugin to register a class and its file for autoloading
*
* @since 0.6.0
*
* @param string $class_name Full classname (include namespace if applicable).
* @param string $filepath Absolute filepath to class file, including .php extension.
*/
public static function register_autoload_class( $class_name, $filepath ) {
self::$_classmap[ $class_name ] = '!' . $filepath;
}

}

/**
* Call method to register this autoloader with PHP.
*/
AMP_Autoloader::register();
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "automattic/amp-wp",
"description": "WordPress plugin for adding AMP support.",
"homepage": "https://github.com/Automattic/amp-wp",
"type": "wordpress-plugin",
"license": "GPL-2.0"
}
2 changes: 1 addition & 1 deletion dev-lib
1 change: 0 additions & 1 deletion includes/actions/class-amp-frontend-actions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php
// Callbacks for adding AMP-related things to the main theme

require_once( AMP__DIR__ . '/includes/actions/class-amp-actions.php' );

class AMP_Frontend_Actions {

Expand Down
2 changes: 0 additions & 2 deletions includes/actions/class-amp-paired-post-actions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/actions/class-amp-actions.php' );

class AMP_Paired_Post_Actions extends AMP_Actions {

public static function register_hooks() {
Expand Down
10 changes: 6 additions & 4 deletions includes/admin/functions.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php
// Callbacks for adding AMP-related things to the admin.

require_once AMP__DIR__ . '/includes/options/class-amp-options-menu.php';
require_once AMP__DIR__ . '/includes/options/views/class-amp-options-manager.php';

define( 'AMP_CUSTOMIZER_QUERY_VAR', 'customize_amp' );

/**
Expand Down Expand Up @@ -31,6 +28,11 @@ function amp_maybe_init_customizer() {
add_action( 'admin_menu', 'amp_add_customizer_link' );
}

/**
* Get permalink for the first AMP-eligible post.
*
* @return string|null
*/
function amp_admin_get_preview_permalink() {
/**
* Filter the post type to retrieve the latest for use in the AMP template customizer.
Expand All @@ -40,7 +42,7 @@ function amp_admin_get_preview_permalink() {
$post_type = (string) apply_filters( 'amp_customizer_post_type', 'post' );

if ( ! post_type_supports( $post_type, 'amp' ) ) {
return;
return null;
}

$post_ids = get_posts( array(
Expand Down
3 changes: 2 additions & 1 deletion includes/amp-helper-functions.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function description, param description, and return description. We've also been adding @since tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your requests to document this caused me to go down the rabbit hole for the past (far too many) hours. Every time I would document something it would cause PhpStorm to flag something else as being "off", so I ended up documented all of the sanitizers.

Note I found a few places that would throw errors, e.g. DOMNode $nodes using methods that are only on DOMElement so I added a variable of logic to ensure errors are not thrown during the normal course of usage when WP_DEBUG is set to true. One such example is I added the following in several places:

if ( ! $node instanceof DOMElement ) {
    return;
}

I hope that was okay...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The node type checks are probably a good idea, as I can see that clearly some of the situations would result in text nodes being used as elements. It looks like some of the instances you added would never result in a non-element being iterated (e.g. $this->dom->getElementsByTagName( self::$tag );) but it doesn't hurt.

* Get AMP permalink.
* Retrieves the full AMP-specific permalink for the given post ID.
*
* @since 0.1
*
* @param int $post_id Post ID.
*
* @return string AMP permalink.
*/
function amp_get_permalink( $post_id ) {
Expand Down
13 changes: 10 additions & 3 deletions includes/embeds/class-amp-base-embed-handler.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
<?php
/**
* Class AMP_Base_Embed_Handler
*
* Used by some children.
*
* @package AMP
*/

// Used by some children
require_once( AMP__DIR__ . '/includes/utils/class-amp-html-utils.php' );

/**
* Class AMP_Base_Embed_Handler
*/
abstract class AMP_Base_Embed_Handler {
protected $DEFAULT_WIDTH = 600;
protected $DEFAULT_HEIGHT = 480;
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-dailymotion-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

// Much of this class is borrowed from Jetpack embeds
class AMP_DailyMotion_Embed_Handler extends AMP_Base_Embed_Handler {
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-facebook-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

class AMP_Facebook_Embed_Handler extends AMP_Base_Embed_Handler {
const URL_PATTERN = '#https?://(www\.)?facebook\.com/.*#i';
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-gallery-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

class AMP_Gallery_Embed_Handler extends AMP_Base_Embed_Handler {
private static $script_slug = 'amp-carousel';
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-instagram-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

// Much of this class is borrowed from Jetpack embeds
class AMP_Instagram_Embed_Handler extends AMP_Base_Embed_Handler {
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-pinterest-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php');

class AMP_Pinterest_Embed_Handler extends AMP_Base_Embed_Handler {

Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-soundcloud-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

class AMP_SoundCloud_Embed_Handler extends AMP_Base_Embed_Handler {
const URL_PATTERN = '#https?://api\.soundcloud\.com/tracks/.*#i';
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-twitter-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

// Much of this class is borrowed from Jetpack embeds
class AMP_Twitter_Embed_Handler extends AMP_Base_Embed_Handler {
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-vimeo-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

// Much of this class is borrowed from Jetpack embeds
class AMP_Vimeo_Embed_Handler extends AMP_Base_Embed_Handler {
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-vine-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

class AMP_Vine_Embed_Handler extends AMP_Base_Embed_Handler {
const URL_PATTERN = '#https?://vine\.co/v/([^/?]+)#i';
Expand Down
1 change: 0 additions & 1 deletion includes/embeds/class-amp-youtube-embed.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

// Much of this class is borrowed from Jetpack embeds
class AMP_YouTube_Embed_Handler extends AMP_Base_Embed_Handler {
Expand Down
18 changes: 1 addition & 17 deletions includes/lib/fasterimage/amp-fasterimage.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
<?php

function amp_load_fasterimage_classes() {
// We're not using composer to pull in FasterImage so we need to load the files manually
$fasterimage__DIR__ = dirname( __FILE__ );

// Stream files
require_once( $fasterimage__DIR__ . '/Stream/Exception/StreamBufferTooSmallException.php' );
require_once( $fasterimage__DIR__ . '/Stream/StreamableInterface.php' );
require_once( $fasterimage__DIR__ . '/Stream/Stream.php' );

// FasterImage files
require_once( $fasterimage__DIR__ . '/Exception/InvalidImageException.php' );
require_once( $fasterimage__DIR__ . '/ExifParser.php' );
require_once( $fasterimage__DIR__ . '/ImageParser.php' );
require_once( $fasterimage__DIR__ . '/FasterImage.php' );
_deprecated_function( __FUNCTION__, '0.6.0' );
}

function amp_get_fasterimage_client( $user_agent ) {
if ( ! class_exists( 'FasterImage\FasterImage' ) ) {
amp_load_fasterimage_classes();
}

return new FasterImage\FasterImage( $user_agent );
}
2 changes: 0 additions & 2 deletions includes/options/class-amp-analytics-options-submenu.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require_once( AMP__DIR__ . '/includes/options/views/class-amp-analytics-options-submenu-page.php' );
require_once( AMP__DIR__ . '/includes/utils/class-amp-html-utils.php' );

class AMP_Analytics_Options_Submenu {

Expand Down
Loading