Mohammad Jangda
Forum Replies Created
-
Forum: Plugins
In reply to: [AMP] New ad requirementsSomething like this should work:
add_action( 'amp_post_template_data', 'loano1_add_amp_ad_script' ); function loano1_add_amp_ad_script( $data ) { if ( ! isset( $data['amp_component_scripts']['amp-ad'] ) ) { $data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js'; } return $data; }
Forum: Plugins
In reply to: [AMP] With Google AMP update will the plugin update too?Yes, we’re working on pushing out a new version very soon. If you find errors that aren’t already tracked on our Issues List (https://github.com/Automattic/amp-wp/issues), feel free to open up a new one.
Forum: Plugins
In reply to: [AMP] amp pages not working after 0.3.3 updateDo you see any errors in your PHP log?
Forum: Plugins
In reply to: [Co-Authors Plus] FYI – v3.2 typo in class-coauthors-guest-authors.phpThanks @js Morisset. We pushed this fix in 3.2.1.
That’s super cool! ??
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Custom Endpoint for Plugin DataI’d start with the existing JSON feeds to see if those can work for you.
There’s still some testing that needs to be done on the REST API endpoints, but we’d love any feedback if you want to test them them out.
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] Custom Endpoint for Plugin DataZoninator generates JSON feeds for each zone:
/zones/{zone-slug}/feed.json
We also have some PRs in progress to add REST API endpoints for zones: https://github.com/Automattic/zoninator/pull/43
However, it sounds like you want the standard posts endpoint(s) to include zone information instead of accessing a separate endpoint to fetch posts in a zone?
Forum: Plugins
In reply to: [AMP] Can't change Schema.org (JSON) Metadata Publisher LogoTrying bumping the priority from
10
to something higher. Chances are another plugin is adding the metadata (maybe Yoast Glue, if you’re using that)Forum: Plugins
In reply to: [AMP] how to add asyn src toOrder shouldn’t matter for those attributes.
Forum: Plugins
In reply to: [AMP] Huge error_log due to plugin PHP warningsSorry that you ran into these issues.
Two thoughts:
– I’d suggest doing size-based log rotation as well to prevent issues when the log file gets too big.
– The errors are happening when an image included in a post doesn’t have an explicit size available (usually a hotlinked image), in which case we remotely fetch it and attempt to guess it’s size. The errors are being generated from the class we use to do this (although, technically, the lower-level PHP APIs are throwing the errors), most likely because it failed to properly fetch or read the image. It’s possible the resource where the images are hosted is having issues? Or maybe remote connections are blocked on the server? Or maybe there’s a bug in the plugin ??If you want to disable this remote image lookup, you can use the following code:
add_action( 'amp_extract_image_dimensions_callbacks_registered', 'xyz_amp_extract_image_dimensions_disable_remote_lookup' ); function xyz_amp_extract_image_dimensions_disable_remote_lookup() { remove_filter( 'amp_extract_image_dimensions', array( 'AMP_Image_Dimension_Extractor', 'extract_by_downloading_image' ), 999, 2 ); }
Forum: Plugins
In reply to: [AMP] AMP pages since a determinated dateYou can do something like this:
add_filter( 'amp_skip_post', 'xyz_amp_skip_old_posts' ); function xyz_amp_skip_old_posts( $skip, $post_id, $post ) { if ( date( 'Y', strtotime( $post->post_date_gmt ) ) < 2015 ) { $skip = true; } return $skip; }
This would skip all posts published earlier than 2015. Warning: code is untested ??
Forum: Plugins
In reply to: [AMP] Blank pages since updating from 0.2This should be fixed in 0.3.2
Forum: Plugins
In reply to: [AMP] amp plugin installed but posts with /amp/ are blankThis is fixed in 0.3.2. Thanks for everyone’s reports and patience while we fixed the issue!
Forum: Plugins
In reply to: [AMP] Unknown syntax errors> understood, but the plugin – I assume – would follow the AMP rules (put in place by the AMP project and that Google would draw from) to render the AMP pages.
We’re trying! ?? There are a lot of rules so it’s not super easy to achieve 100% validation (it’s possible but it is a significant amount of work and there are many trade-offs we need to consider as well).
Forum: Plugins
In reply to: [AMP] amp-iframe0.3.2 should fix this.