AMP for WP – Accelerated Mobile Pages - Version 0.9.85.6

Version Description

Download this release

Release Info

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

Code changes from version 0.9.85.5 to 0.9.85.6

README.md CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
- Stable tag: 0.9.85.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 0.9.85.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 0.9.85.5
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -19,7 +19,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
20
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
- define('AMPFORWP_VERSION','0.9.85.5');
23
 
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
@@ -95,7 +95,9 @@ function ampforwp_add_custom_rewrite_rules() {
95
  'index.php?amp&paged=$matches[1]',
96
  'top'
97
  );
 
98
  // For /Blog page with Pagination
 
99
  add_rewrite_rule(
100
  ampforwp_name_blog_page(). '/amp/page/([0-9]{1,})/?$',
101
  'index.php?amp&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
@@ -107,6 +109,7 @@ function ampforwp_add_custom_rewrite_rules() {
107
  'index.php?amp&paged=$matches[2]&page_id=' .ampforwp_get_the_page_id_blog_page(),
108
  'top'
109
  );
 
110
 
111
  // For Author pages
112
  add_rewrite_rule(
@@ -114,7 +117,6 @@ function ampforwp_add_custom_rewrite_rules() {
114
  'index.php?amp&author_name=$matches[1]',
115
  'top'
116
  );
117
-
118
  add_rewrite_rule(
119
  'author\/([^/]+)\/amp\/page\/?([0-9]{1,})\/?$',
120
  'index.php?amp=1&author_name=$matches[1]&paged=$matches[2]',
@@ -245,6 +247,20 @@ function ampforwp_rewrite_activation() {
245
 
246
  }
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  add_action('init', 'ampforwp_flush_rewrite_by_option', 20);
249
 
250
  function ampforwp_flush_rewrite_by_option(){
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
+ Version: 0.9.85.6
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
19
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
20
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
21
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
22
+ define('AMPFORWP_VERSION','0.9.85.6');
23
 
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
95
  'index.php?amp&paged=$matches[1]',
96
  'top'
97
  );
98
+
99
  // For /Blog page with Pagination
100
+ if( ampforwp_name_blog_page() ) {
101
  add_rewrite_rule(
102
  ampforwp_name_blog_page(). '/amp/page/([0-9]{1,})/?$',
103
  'index.php?amp&paged=$matches[1]&page_id=' .ampforwp_get_the_page_id_blog_page(),
109
  'index.php?amp&paged=$matches[2]&page_id=' .ampforwp_get_the_page_id_blog_page(),
110
  'top'
111
  );
112
+ }
113
 
114
  // For Author pages
115
  add_rewrite_rule(
117
  'index.php?amp&author_name=$matches[1]',
118
  'top'
119
  );
 
120
  add_rewrite_rule(
121
  'author\/([^/]+)\/amp\/page\/?([0-9]{1,})\/?$',
122
  'index.php?amp=1&author_name=$matches[1]&paged=$matches[2]',
247
 
248
  }
249
 
250
+ add_action( 'admin_init', 'ampforwp_flush_after_update');
251
+ function ampforwp_flush_after_update() {
252
+ // Flushing rewrite urls ONLY on after Update is installed
253
+ $older_version = "";
254
+ $older_version = get_transient('ampforwp_current_version_check');
255
+ if ( empty($older_version) || ( $older_version < AMPFORWP_VERSION ) ) {
256
+ flush_rewrite_rules();
257
+ global $wp_rewrite;
258
+ $wp_rewrite->flush_rules();
259
+ set_transient('ampforwp_current_version_check', AMPFORWP_VERSION);
260
+ }
261
+ }
262
+
263
+
264
  add_action('init', 'ampforwp_flush_rewrite_by_option', 20);
265
 
266
  function ampforwp_flush_rewrite_by_option(){
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
- Stable tag: 0.9.85.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 4.9.5
7
+ Stable tag: 0.9.85.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
templates/design-manager/design-1/header-bar.php CHANGED
@@ -48,6 +48,7 @@
48
  echo $sanitized_menu;
49
  ?>
50
  </nav>
 
51
  </div>
52
  </amp-sidebar>
53
  <?php }
48
  echo $sanitized_menu;
49
  ?>
50
  </nav>
51
+ <?php do_action('ampforwp_after_amp_menu'); ?>
52
  </div>
53
  </amp-sidebar>
54
  <?php }
templates/design-manager/design-2/header-bar.php CHANGED
@@ -37,6 +37,7 @@
37
  $sanitized_menu = $sanitizer_obj->get_amp_content();
38
  echo $sanitized_menu; ?>
39
  </nav>
 
40
  </div>
41
  </amp-sidebar>
42
  <?php } ?>
37
  $sanitized_menu = $sanitizer_obj->get_amp_content();
38
  echo $sanitized_menu; ?>
39
  </nav>
40
+ <?php do_action('ampforwp_after_amp_menu'); ?>
41
  </div>
42
  </amp-sidebar>
43
  <?php } ?>
templates/design-manager/design-3/header-bar.php CHANGED
@@ -12,8 +12,7 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
12
 
13
  <?php // Grand child support AND amp-accordion non critical error in Design 3 due to nav #1152
14
  // schema.org/SiteNavigationElement missing from menus #1229 ?>
15
- <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement">
16
- <?php
17
  $menu_html_content = wp_nav_menu( array(
18
  'theme_location' => 'amp-menu',
19
  'link_before' => '<span itemprop="name">',
@@ -25,11 +24,11 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
25
  $menu_html_content = apply_filters('ampforwp_menu_content', $menu_html_content);
26
  $sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(), 'AMP_Style_Sanitizer' => array(), ) ) );
27
  $sanitized_menu = $sanitizer_obj->get_amp_content();
28
- echo $sanitized_menu;
29
- }
30
- ?>
31
 
32
- </nav>
 
 
33
  <div class="social_icons">
34
  <ul>
35
 
12
 
13
  <?php // Grand child support AND amp-accordion non critical error in Design 3 due to nav #1152
14
  // schema.org/SiteNavigationElement missing from menus #1229 ?>
15
+ <nav id ="primary-amp-menu" itemscope="" itemtype="https://schema.org/SiteNavigationElement"> <?php
 
16
  $menu_html_content = wp_nav_menu( array(
17
  'theme_location' => 'amp-menu',
18
  'link_before' => '<span itemprop="name">',
24
  $menu_html_content = apply_filters('ampforwp_menu_content', $menu_html_content);
25
  $sanitizer_obj = new AMPFORWP_Content( $menu_html_content, array(), apply_filters( 'ampforwp_content_sanitizers', array( 'AMP_Img_Sanitizer' => array(), 'AMP_Style_Sanitizer' => array(), ) ) );
26
  $sanitized_menu = $sanitizer_obj->get_amp_content();
27
+ echo $sanitized_menu; ?>
 
 
28
 
29
+ </nav>
30
+ <?php }
31
+ do_action('ampforwp_after_amp_menu'); ?>
32
  <div class="social_icons">
33
  <ul>
34
 
templates/design-manager/swift/header.php CHANGED
@@ -10,7 +10,8 @@
10
  <label for="offcanvas-menu" class="c-btn"></label>
11
  </div><!--end menu-heading-->
12
  <nav class="m-menu">
13
- <?php amp_menu(); ?>
 
14
  </nav><!--end slide-menu -->
15
  <?php if ($redux_builder_amp['menu-search'] ) { ?>
16
  <div class="m-srch">
@@ -129,7 +130,8 @@
129
  <label for="offcanvas-menu" class="c-btn"></label>
130
  </div><!--end menu-heading-->
131
  <nav class="m-menu">
132
- <?php amp_menu(); ?>
 
133
  </nav><!--end slide-menu -->
134
  <?php if ( $redux_builder_amp['menu-search'] ) { ?>
135
  <div class="m-srch">
@@ -241,7 +243,8 @@
241
  <label for="offcanvas-menu" class="c-btn"></label>
242
  </div><!--end menu-heading-->
243
  <nav class="m-menu">
244
- <?php amp_menu(); ?>
 
245
  </nav><!--end slide-menu -->
246
  <?php if ( $redux_builder_amp['menu-search'] ) { ?>
247
  <div class="m-srch">
@@ -355,7 +358,8 @@ do_action("ampforwp_advance_header_layout_options");
355
  <?php if($redux_builder_amp['primary-menu']){?>
356
  <div class="p-m-fl">
357
  <div class="p-menu">
358
- <?php amp_menu(); ?>
 
359
  </div>
360
  </div>
361
  <?php } ?>
10
  <label for="offcanvas-menu" class="c-btn"></label>
11
  </div><!--end menu-heading-->
12
  <nav class="m-menu">
13
+ <?php amp_menu();
14
+ do_action('ampforwp_after_amp_menu'); ?>
15
  </nav><!--end slide-menu -->
16
  <?php if ($redux_builder_amp['menu-search'] ) { ?>
17
  <div class="m-srch">
130
  <label for="offcanvas-menu" class="c-btn"></label>
131
  </div><!--end menu-heading-->
132
  <nav class="m-menu">
133
+ <?php amp_menu();
134
+ do_action('ampforwp_after_amp_menu'); ?>
135
  </nav><!--end slide-menu -->
136
  <?php if ( $redux_builder_amp['menu-search'] ) { ?>
137
  <div class="m-srch">
243
  <label for="offcanvas-menu" class="c-btn"></label>
244
  </div><!--end menu-heading-->
245
  <nav class="m-menu">
246
+ <?php amp_menu();
247
+ do_action('ampforwp_after_amp_menu'); ?>
248
  </nav><!--end slide-menu -->
249
  <?php if ( $redux_builder_amp['menu-search'] ) { ?>
250
  <div class="m-srch">
358
  <?php if($redux_builder_amp['primary-menu']){?>
359
  <div class="p-m-fl">
360
  <div class="p-menu">
361
+ <?php amp_menu();
362
+ do_action('ampforwp_after_amp_menu'); ?>
363
  </div>
364
  </div>
365
  <?php } ?>