AMP for WP – Accelerated Mobile Pages - Version 0.7

Version Description

  • Canonical Improved
  • Navigation Validation bug fixed
  • Two more validation bugs fixed ('role' and 'tabindex' attribute)
  • Featured image automatically hides if it is not present
  • Validation issues in the images of the post's the_content
Download this release

Release Info

Developer mohammed_kaludi
Plugin Icon 128x128 AMP for WP – Accelerated Mobile Pages
Version 0.7
Comparing to
See all releases

Code changes from version 0.6 to 0.7

README.md CHANGED
@@ -1,5 +1,114 @@
1
  # Accelerated Mobile Pages
2
- Automatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress. http://theskin.io/amp/
3
  https://wordpress.org/plugins/accelerated-mobile-pages/
4
 
5
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Accelerated Mobile Pages
2
+ Automatically add Accelerated Mobile Pages (AMP Project) functionality on your WordPress.
3
  https://wordpress.org/plugins/accelerated-mobile-pages/
4
 
5
+ === AMP - Accelerated Mobile Pages ===
6
+ Contributors: mohammed_kaludi, ahmedkaludi
7
+ Tags: accelerated mobile pages, amp, mobile, amp project, google amp, amp wp
8
+ Requires at least: 3.0
9
+ Tested up to: 4.5.2
10
+ Stable tag: 0.7
11
+ License: GPLv2 or later
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
+
14
+ Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site.
15
+
16
+ == Description ==
17
+
18
+ Automatically add Accelerated Mobile Pages (Google AMP Project) functionality on your WordPress site. AMP WP is a plugin that needs to no configuration, just activate it and you are done.
19
+
20
+ [View Demo and Screenshot of the plugin](http://ahmedkaludi.com/accelerated-mobile-pages/)
21
+
22
+ **Features:**
23
+
24
+ * Automatically integrate AMP to your website
25
+ * Supports Posts and Pages
26
+ * Proper rel canonical tags which means that Google know the original page.
27
+ * Overlay Navigation Menu bar
28
+ * Social Sharing in the Single
29
+ * Sexy Design
30
+ * Separate WordPress Menu for AMP version
31
+
32
+
33
+ **NOTE: Next Update of this plugin will be released on 4 August 2016.** [Here is the list of things](https://goo.gl/jDTPyg) that will be updated in the next update
34
+
35
+
36
+ **How to test if AMP is working or not?**
37
+
38
+ After you install the plugin, Google will automatically index the amp pages using the amp tag and then show you the updates in the search console.
39
+
40
+
41
+ **How can I view the AMP version of my site**
42
+
43
+ To view the AMP version, add /?amp at the end of your url. An example would be http://Website.com/?amp .... and No, you don't have to worry about duplication of the content because that has been taken care of the canonical tag as suggested by Google.
44
+
45
+
46
+ **How do I Report Bugs and Suggest New Features**
47
+
48
+ <i>You</i> can report the bugs at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues
49
+
50
+
51
+ **Will you Add New features upon my request?**
52
+
53
+ Yes, Absolutely! I would suggest you to send your feature request by creating an issue in Github at https://github.com/ahmedkaludi/Accelerated-Mobile-Pages/issues/new/ . It helps us organize the feedback easily.
54
+
55
+
56
+ **How do I get in touch?**
57
+
58
+ You can contact me using this url: http://ahmedkaludi.com/contact-me/
59
+
60
+
61
+ == Installation ==
62
+
63
+ 1. Upload the folder to the `/wp-content/plugins/` directory
64
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
65
+ 3. You can access your amp enabled website by adding ?amp at the end of the url.
66
+
67
+
68
+ == Frequently Asked Questions ==
69
+
70
+ = How do I know that my site is AMP enabled? =
71
+
72
+ Add /?amp at the end of your website url and you will get amp version of your website.
73
+
74
+ = I have addded /?amp at the end of the url and still I'm not able to see the AMP version of my site? =
75
+
76
+ Please check if you have "Pretty Permalinks" enabled. If not then activate it. For more details about Pretty Permalinks check out this wonderful article https://codex.wordpress.org/Using_Permalinks
77
+
78
+
79
+ == Screenshots ==
80
+ 1. AMP Homepage
81
+ 2. AMP Single Post
82
+ 3. Post Navigation in Single
83
+ 4. Sticky Social sharing icons
84
+ 5. Overlay Navigation menu sidebar.
85
+
86
+
87
+ == Changelog ==
88
+
89
+ = 0.1 =
90
+ * Initial version
91
+
92
+ = 0.2 =
93
+ * White Screen of death issue fixed
94
+ * Plugin URI updated
95
+
96
+ = 0.2.5 =
97
+ * Minor bugs fixed
98
+ * ?mobile & ?nomobile is now ?amp & ?noamp
99
+
100
+ = 0.3 =
101
+ * Support of amp-img added in single posts
102
+ * minor css bug fixed
103
+
104
+ = 0.4 =
105
+ * Support of Custom menu added for AMP enabled sites
106
+
107
+ = 0.5 =
108
+ * Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
109
+
110
+ = 0.6 =
111
+ * Improved Navigation Menu, Search Console errors fixed, Social Sharing option, Pages support, Force redirection for mobile users removed and many other bug fixes
112
+
113
+ = 0.7 =
114
+ * Canonical Improved, Navigation Validation bug fixed, Two more validation bugs fixed ('role' and 'tabindex' attribute), Featured image automatically hides if it is not present, Validation issues in the images of the post's the_content
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: Accelerated Mobile Pages for WordPress
6
- Version: 0.6
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: http://AhmedKaludi.com/
9
  License: GPL2
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: Accelerated Mobile Pages for WordPress
6
+ Version: 0.7
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: http://AhmedKaludi.com/
9
  License: GPL2
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mohammed_kaludi, ahmedkaludi
3
  Tags: accelerated mobile pages, amp, mobile, amp project, google amp, amp wp
4
  Requires at least: 3.0
5
  Tested up to: 4.5.2
6
- Stable tag: 0.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -104,4 +104,15 @@ Please check if you have "Pretty Permalinks" enabled. If not then activate it. F
104
  * Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
105
 
106
  = 0.6 =
107
- * Improved Navigation Menu, Search Console errors fixed, Social Sharing option, Pages support, Force redirection for mobile users removed and many other bug fixes
 
 
 
 
 
 
 
 
 
 
 
3
  Tags: accelerated mobile pages, amp, mobile, amp project, google amp, amp wp
4
  Requires at least: 3.0
5
  Tested up to: 4.5.2
6
+ Stable tag: 0.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
104
  * Added AMP Markup for Google Structured data. This will fix the issues in Webmaster tools.
105
 
106
  = 0.6 =
107
+ * Improved Navigation Menu
108
+ * Search Console errors fixed
109
+ * Social Sharing option
110
+ * Pages support
111
+ * Force redirection for mobile users removed and many other bug fixes
112
+
113
+ = 0.7 =
114
+ * Canonical Improved
115
+ * Navigation Validation bug fixed
116
+ * Two more validation bugs fixed ('role' and 'tabindex' attribute)
117
+ * Featured image automatically hides if it is not present
118
+ * Validation issues in the images of the post's the_content
themes/default/functions.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
  /*
3
  * Added the style through the custom Hook called "amp_custom_style" and not used wp_enqueue, because of the strict rules of AMP.
4
  *
@@ -11,6 +17,7 @@ function amp_custom_style() {
11
  - Remove toggle-navigation style because it was replaced with toggle-navigationv2 */
12
  ?>
13
  <style amp-custom>
 
14
  amp-sidebar {
15
  width: 250px;
16
  }
1
  <?php
2
+ /* turnoff src set for validating images in the post's the_content */
3
+ function amp_disable_srcset( $sources ) {
4
+ return false;
5
+ }
6
+ add_filter( 'wp_calculate_image_srcset', 'amp_disable_srcset' );
7
+
8
  /*
9
  * Added the style through the custom Hook called "amp_custom_style" and not used wp_enqueue, because of the strict rules of AMP.
10
  *
17
  - Remove toggle-navigation style because it was replaced with toggle-navigationv2 */
18
  ?>
19
  <style amp-custom>
20
+
21
  amp-sidebar {
22
  width: 250px;
23
  }
themes/default/header.php CHANGED
@@ -38,7 +38,7 @@
38
  ?>
39
  </title>
40
 
41
- <link rel="canonical" href="<?php the_permalink(); ?>?noamp">
42
  <meta charset="utf-8">
43
  <meta name="viewport" content="width=device-width,minimum-scale=1">
44
 
@@ -62,20 +62,18 @@
62
  </div>
63
  </header>
64
 
65
- <nav>
66
- <div on='tap:sidebar.toggle' class="nav_container"> <a href="#" class="toggle-text">Navigate</a></div>
67
 
68
  <amp-sidebar id='sidebar'
69
  layout="nodisplay"
70
  side="right">
71
  <div class="toggle-navigationv2">
72
- <div on='tap:sidebar.close' class="close-nav">X</div>
73
  <?php wp_nav_menu( array( 'theme_location' => 'amp-menu' ) ); ?>
74
  </div>
75
  </amp-sidebar>
76
-
77
- </nav>
78
-
79
  <?php if ( is_single() ) {
80
  if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. ?>
81
  <?php }
38
  ?>
39
  </title>
40
 
41
+ <link rel="canonical" href="<?php the_permalink(); ?>">
42
  <meta charset="utf-8">
43
  <meta name="viewport" content="width=device-width,minimum-scale=1">
44
 
62
  </div>
63
  </header>
64
 
65
+
66
+ <div on='tap:sidebar.toggle' role="button" tabindex="0" class="nav_container"> <a href="#" class="toggle-text">Navigate</a></div>
67
 
68
  <amp-sidebar id='sidebar'
69
  layout="nodisplay"
70
  side="right">
71
  <div class="toggle-navigationv2">
72
+ <div role="button" tabindex="0" on='tap:sidebar.close' class="close-nav">X</div>
73
  <?php wp_nav_menu( array( 'theme_location' => 'amp-menu' ) ); ?>
74
  </div>
75
  </amp-sidebar>
76
+
 
 
77
  <?php if ( is_single() ) {
78
  if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. ?>
79
  <?php }
themes/default/index.php CHANGED
@@ -24,7 +24,7 @@
24
  $thumb_url = $thumb_url_array[0];
25
  ?>
26
 
27
- <div class="post_image"><a href="<?php the_permalink(); ?>"><amp-img src=<?php echo $thumb_url ?> width=100 height=75></amp-img></a></div>
28
 
29
 
30
  <h2 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" accesskey="<?php echo $access_key; $access_key++; ?>"><?php the_title(); ?></a></h2>
24
  $thumb_url = $thumb_url_array[0];
25
  ?>
26
 
27
+ <?php if ( has_post_thumbnail() ) { ?><div class="post_image"><a href="<?php the_permalink(); ?>"><amp-img src=<?php echo $thumb_url ?> width=100 height=75></amp-img></a></div><?php } ?>
28
 
29
 
30
  <h2 class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" accesskey="<?php echo $access_key; $access_key++; ?>"><?php the_title(); ?></a></h2>