ahmedkaludi / accelerated-mobile-pages Goto Github PK
View Code? Open in Web Editor NEWAutomatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress.
Home Page: http://ampforwp.com
License: Other
Automatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress.
Home Page: http://ampforwp.com
License: Other
Some Validation errors reported by User https://wordpress.org/support/topic/few-console-errors?replies=2#post-8770934
Add Favicon / Browser Icon Support
Requested by https://wordpress.org/support/topic/not-compatible-with-schema-and-seo?replies=2#post-8762445
Add support for Adsense with amp compatibility as suggested at https://wordpress.org/support/topic/feedback-48?replies=2
Related Posts below Single
For those of us who use Segment.com would love to see an official implementation with Segment to support more sources.
In my test the home page appears like this screen-1.
Looking at themes/default/index.php it seems the function
<?php
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail', true);
$thumb_url = $thumb_url_array[0];
?>
The function get_post_thumbnail_id(); works only when the post has an featured image. Many themes and website does not use that function. Now in most of my theme or plugin we use a backfill to find first appeared image, and when null return for featured, use that.
Check this documentation here or I use this function below sometime, you could use that too.
function asif_get_first_image($text){
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $text, $matches);
$first_img = isset($matches [1] [0]) ? $matches [1] [0] : '';
return $first_img;
}
Was looking forward to using this instead of official AMP because of home page support but this error causing issue. Quick turnaround will be very helpful.
Hi!
I followed yours instructions by assign AMP menu in the WordPress Menus but the menu doesn't appear on my amp version of my article.
Can you help me ?
Cordialy,
Vincent
Videopress.com Video Embed Issue
This is happening for any site with permalink structure with ending backslash.
So for a page link
http://domain.tld/date/post-title/
The rel link looks like
<link rel="amphtml" href="http://domain.tld/date/post-title//?amp" />
Look at this line.
I know in upcoming version the apm link url is changing to /amp/
, just keep this error in mind, and maybe its best not to put another backslash without checking, even if you dont append a backslash at all it should still be fine, as most site with SEO plugin will most likely have an ending backslash already.
AMP user Notification Support
my theme is using the redux-framework too, after upgrading your plugin my theme isnt working anymore completly .. so i needed to reinstall the redux-framework ..
Reported on https://wordpress.org/support/topic/redux-framework-bug
Hi,
Just recently started to explore amp, and using your plugin in our site, however the search console gives errors about a facebook tag...
Details:
The tag 'fb:like' is disallowed.
The tag 'fb:comments' is disallowed.
AMP URL:
http://www.pfx.nl/maandag-tot-maandag/?amp
Canonical URL:
http://www.pfx.nl/category/geen-categorie/page/2
Is this something that can be stripped by the plugin, it's just a facebook like button.
Regards,
Richard
Option to add / edit footer
Tried the plugin and impressed with how well it works. However, it would be great if there were options available to the user. For example, I don't want post dates or authors displayed, and have those turned off in my regular theme. Unfortunately, post date and author are displaying in the theme served by AMP plugin.
Suggested at https://wordpress.org/support/topic/will-options-be-added?replies=3
Footer Hides in Single if the sharing is enabled
Some images stretch on the Article Page. I guess may be those are either align-left or align-right OR maybe they do not have a square dimension. Do test it out to find the problem and solve it.
If Jetpack is installed, and Sharing buttons are active, as by default it serves at the bottom of the content.
From the amp theme function or in the single we could use this method to remove jetpack sharing filter. Look here
remove_filter( 'the_content', 'sharing_display', 19 );
AMP Form support
Add Version number as the html comment in footer, helps in debugging
Change Log should be Upside down
More refined user controls would be welcome by many, I'm sure. While there is limited "branding" we can maintain in accelerated mobile pages, I'm sure there are some options that could easily (or relatively) be within our control.
As suggested in https://wordpress.org/support/topic/will-options-be-added?replies=3
I used with json-api plugin but give an error
Warning: readdir() expects parameter 1 to be resource, boolean given in /home/xxx/public_html/wp-content/plugins/json-api/singletons/api.php on line 291
If W3TC or other caching plugin is active, it cache the main site, and call does not even reach this plugin.
Issue is even bigger when you do mobile redirection(which is not by default on, but coming in future update, and exist on commit before 0.6.0.
I am using this guide to resolve from caching plugin end.
YouTube videos are not working, video is not playing.
amp-youtube-js is also not added.
My guess is that the '?' can give problems with caching. I still need to do some tests before coming to the conclusion. But if there is any such problems, then we need to change it from ?amp to /amp
Check The Plugin Page description, Faq and Readme.txt for Grammatical mistakes and make it easy to read and understand
Thanks for this plugin, working great. We're using Divi by ElegantThemes.com and when viewing our pages via the Divi Builder, AMP pages are outputting shortcodes used at the top and bottom.
Live here: https://heelthatpain.com/heel-pain/heel-pain-exercises/?amp
Any ideas on how these can be filtered from the content output?
I can't seems to get past the AMP validation error in any of the site I tested this plugin. And error are mostly occurring for share button. I do see those type error
The attribute 'style' may not appear in tag 'div'.
The mandatory attribute 'amp-custom' is missing in tag 'style amp-custom'. (see https://www.ampproject.org/docs/reference/spec.html#stylesheets)
The tag 'script' is disallowed except in specific forms.
The parent tag of tag 'head > style[amp-boilerplate] - old variant' is 'div', but it can only be 'head'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-boilerplate.md)
The error The tag 'script' is disallowed except in specific forms.
appears many times.
Could we solve it in this coming release? Otherwise just add an option to disable sharing option. Maybe its time to add a simple option menu.
The plugin will be mostly unusable if we can't get past the validation error, and will result in a lot of negative review in .org.
RTL Support
If you push the AMP version as the default one for mobile, you need alternate tag to keep Google Mobile Friendliness.
Here is a small approach - link
When you bring that feature to select if anybody want to deploy amp in all their mobile visitor, then add this one in your code.
We must add this in the next update https://wordpress.org/support/topic/feedback-46?replies=9#post-8599939
Option to disable amp versions of some pages
Suggested by https://wordpress.org/support/topic/is-there-a-way-to-disable-amp-versions-of-some-pages?replies=2#post-8730673
Content is cutting after image in the single for some reason.
Issue reported on : https://wordpress.org/support/topic/cut-off-at-more
Working amp page : http://www.draggedy.com/wp-content/uploads/2016/07/Sal-with-AMP-working-ok.png
Not working amp page on the same site : http://www.draggedy.com/wp-content/uploads/2016/07/Anuj-page-cut-off-with-AMP.png
Original page : http://www.draggedy.com/wp-content/uploads/2016/07/anuj-page-working-no-amp.png
On/off option for post dates or authors displayed in Single
User suggested here at https://wordpress.org/support/topic/multisite-support-153?replies=1
I am currently using this plugin on a multisite, so the plugins/accelerated-mobile-pages/themes/default theme is shared between all sites.
Is it possible to create custom themes which can then be assigned to a specific site (like wordpress themes work currently).
This is so that I can change the brand colours for specific sites.
Any advice would be greatly appreciated!
Thank you,
Look at this screen-2. Somehow the Navigation Menu creating this useless junk menu. Not sure what they are. They are not real page or post. And I do about 50 of them in source code, linked like this
https://domain.tld/listings-12/
https://domain.tld/listings-20/
https://domain.tld/listings-30/
.....
It could be caused by some other plugin as well. Let me know how I could help to debug.
I found that onClick events tracking outbound links (via Google Analytics by MonsterInsights) were invalidating the AMP pages. For now, I have disabled outbound link tracking in the Google Analytics plugin.
This is more of a comment than a suggestion since an update is coming out. I'd think there has to be a way to track outbound links. But this is not urgent.
Thanks.
The parent tag of tag 'amp-sidebar' is 'nav', but it can only be 'body'. (see https://github.com/ampproject/amphtml/blob/master/extensions/amp-sidebar/amp-sidebar.md)
Correct use of the_permalink outside of loop for Canonical
If a site has Static Pages setup in "Front page displays", then the index page of amp shows black and the index loop does not work. Here is what I am talking about - Example Setting. This is gotta be a big issue, as many advance themes and site use static front page, to customize look and feel, and go beyond the tradition latest 10 posts.
Regards
Hello sir,
This plugin is awesome. It has a very beautiful looking design. But it leads to some errors. You can check out this errors on my site. Check this url= https://goo.gl/sWneqA as you can see this page is non-amp and the ratings displayed are normal. No check its amp version https://goo.gl/q8SMp9 as you can see the ratings are not displayed and the loading sign is very large. Please fix this, but if you can't then you can bring a new feature where we can exclude some plugins in amp pages.
Some design suggestions
The white header above the navigation is not so attractive but the whole design is good. Is there anyway so that we can display our custom header in the place of that white header present above the navigation. Eg: - the blue header which you can check out on non-amp version of my site techwhack.com
Check out my site non-mobile version page . I want to display the same header. You can check this screen shot http://i.imgur.com/LxNzgJZ.gif . Please bring your next update as soon as possible.
With all schema updates and these custom designs, your plugin would get more active install then automattic amp
Thanks
there needs to be an option to disable it for pages, as I don't want it to load on various pages, like my contact page or homepage for example.
at https://wordpress.org/support/topic/feedback-48?replies=2
I have one YouTube video that was embedded using [youtube ...] shortcode from Jetpack. (I've also tried the [embed ...] shortcode.) They render eventually with an iframe tag.
I'm getting the following message:
The tag 'iframe' is disallowed. DISALLOWED_HTML_WITH_AMP_EQUIVALENT
AMP is asking for <amp-youtube..../> plus the .js snippet.
The routine YouTube embed, without any shortcode, returns the same error.
In addition, both embed methods results in:
The attribute 'style' may not appear in tag 'span'. DISALLOWED_HTML
Thanks.
You had this feature before, codes are just commented out, I know its not for everyone, but could you please bring it back via option page? Or is there a way I could do it as an addon, any hooks I should use? Or do it completely externally?
Would you consider checking for the trailing slash in the URL before appending "/?amp" to the amphtml relationship?
For example, my pretty URL structure is:
https://domain.com/sample-post/
The amphtml rel tag is rendered as:
In the rendered AMP page, the canonical shows up correctly as:
Since both URLs (https://domain.com/sample-post//?amp and https://domain.com/sample-post/?amp) work, it's not a huge concern, but it would be nice for me to keep it consistent.
[Sorry, I didn't see that you preferred GitHub. Didn't intend to duplicate. Thanks!]
The attribute 'style' may not appear in tag 'div'. Debug.
The tag 'script' is disallowed except in specific forms. Debug.
Found on: http://buzaupress.ro/2016/buzaul-reclasificat-printr-un-proiect-propus-de-guvern/?amp
Visual Composer default data: https://wordpress.org/support/topic/pages-not-validate-with-the-plugin?replies=10#post-8739730
Show featured image on Single
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.