Git Product home page Git Product logo

ahmedkaludi / accelerated-mobile-pages Goto Github PK

View Code? Open in Web Editor NEW
176.0 17.0 96.0 49.46 MB

Automatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress.

Home Page: http://ampforwp.com

License: Other

PHP 78.30% CSS 4.15% JavaScript 14.83% HTML 0.73% Hack 0.04% SCSS 1.92% Less 0.03%
wordpress wordpress-plugin accelerated-mobile-pages amp amp-html google-amp seo wordpress-amp

accelerated-mobile-pages's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accelerated-mobile-pages's Issues

If "Front page displays" has Static Pages, AMP Index does not work

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

Change the ?amp to /amp

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 for Existence of Trailing Slash

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!]

json-api plugin error

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

Navigation Menu doesn't appear

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

MultiSite support

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,

Blank Image on index if no featured image

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.

Embedded YouTube Fails Validation for "iframe" Tag Use

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.

Some images stretches on the Article Page

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.

Alternate Mobile Tag for AMP Pages

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.

Double Backslash in site with ending Backslash!

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 validation error because of share button

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.

onClick Events in anchor tags invalidate AMP pages

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.

Wp post ratings error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.