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

Cleanup amp support #9570

Merged
merged 4 commits into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
1 change: 1 addition & 0 deletions 3rd-party/3rd-party.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
// We can't load this conditionally since polldaddy add the call in class constuctor.
require_once( JETPACK__PLUGIN_DIR . '3rd-party/polldaddy.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/woocommerce-services.php' );
require_once( JETPACK__PLUGIN_DIR . '3rd-party/class.jetpack-amp-support.php' );
24 changes: 12 additions & 12 deletions 3rd-party/class.jetpack-amp-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static function filter_available_widgets( $widgets ) {
}

static function is_supported_widget( $widget_path ) {
return substr($widget_path, -14) !== '/milestone.php';
return substr( $widget_path, -14 ) !== '/milestone.php';
}

static function amp_disable_the_content_filters() {
Expand All @@ -102,9 +102,9 @@ static function amp_disable_the_content_filters() {
}

/**
* Add publisher and image metadata.
* Add publisher and image metadata to legacy AMP post.
*
* @since 0.3
* @since 6.2
*
* @param array $metadata Metadata array.
* @param WP_Post $post Post.
Expand All @@ -123,9 +123,9 @@ static function amp_post_template_metadata( $metadata, $post ) {
}

/**
* Add blavatar to metadata.
* Add blavatar to legacy AMP post metadata.
*
* @since 0.3
* @since 6.2
*
* @param array $metadata Metadata.
* @return array Metadata.
Expand Down Expand Up @@ -153,9 +153,9 @@ static function add_site_icon_to_metadata( $metadata ) {
}

/**
* Add image to metadata.
* Add image to legacy AMP post metadata.
*
* @since 0.3.2
* @since 6.2
*
* @param array $metadata Metadata.
* @param WP_Post $post Post.
Expand Down Expand Up @@ -196,9 +196,9 @@ static function add_image_to_metadata( $metadata, $post ) {
}

/**
* Add fallback image to metadata.
* Add fallback image to legacy AMP post metadata.
*
* @since 0.3.2
* @since 6.2
*
* @param array $metadata Metadata.
* @return array Metadata.
Expand Down Expand Up @@ -227,9 +227,9 @@ static function staticize_subdomain( $domain ) {
}

/**
* Extract image dimensions via wpcom/imagesize.
* Extract image dimensions via wpcom/imagesize, only on WPCOM
*
* @since 0.5
* @since 6.2
*
* @param array $dimensions Dimensions.
* @return array Dimensions.
Expand Down Expand Up @@ -317,4 +317,4 @@ static function render_sharing_html( $markup, $sharing_enabled ) {
// this is necessary since for better or worse Jetpack modules and widget files are loaded during plugins_loaded, which means we must
// take the opportunity to intercept initialisation before that point, either by adding explicit detection into the module,
// or preventing it from loading in the first place (better for performance)
add_action( 'plugins_loaded', array( 'Jetpack_AMP_Support', 'init_filter_jetpack_widgets' ), 1 );
add_action( 'plugins_loaded', array( 'Jetpack_AMP_Support', 'init_filter_jetpack_widgets' ), 1 );
3 changes: 0 additions & 3 deletions class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,6 @@ private function __construct() {
Jetpack_Search_Performance_Logger::init();
}

// detect amp-wp and modify output as appropriate
require_once JETPACK__PLUGIN_DIR . '3rd-party/class.jetpack-amp-support.php';

add_filter( 'determine_current_user', array( $this, 'wp_rest_authenticate' ) );
add_filter( 'rest_authentication_errors', array( $this, 'wp_rest_authentication_errors' ) );

Expand Down