AMP for WP – Accelerated Mobile Pages - Version 0.9.97.46.1

Version Description

(10th April 2019) = * Fixed: Theme framework templates loading multiple times #2977

Full changelog available in changelog.txt

Download this release

Release Info

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

Code changes from version 0.9.97.46 to 0.9.97.46.1

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: 5.1.1
7
- Stable tag: 0.9.97.46
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,6 +183,9 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
183
 
184
  == Changelog ==
185
 
 
 
 
186
  = 0.9.97.46 (9th April 2019) =
187
  * Added: WP Subtitle compatibility integrated #2831
188
  * Added: New filter in page builder for Enable/disabled check #2998
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.1.1
7
+ Stable tag: 0.9.97.46.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
183
 
184
  == Changelog ==
185
 
186
+ = 0.9.97.46.1 (10th April 2019) =
187
+ * Fixed: Theme framework templates loading multiple times #2977
188
+
189
  = 0.9.97.46 (9th April 2019) =
190
  * Added: WP Subtitle compatibility integrated #2831
191
  * Added: New filter in page builder for Enable/disabled check #2998
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.97.46
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
- define('AMPFORWP_VERSION','0.9.97.46');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
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.97.46.1
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
+ define('AMPFORWP_VERSION','0.9.97.46.1');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 0.9.97.46 (9th April 2019) =
4
  * Added: WP Subtitle compatibility integrated #2831
5
  * Added: New filter in page builder for Enable/disabled check #2998
1
  == Changelog ==
2
 
3
+ = 0.9.97.46.1 (10th April 2019) =
4
+ * Fixed: Theme framework templates loading multiple times #2977
5
+
6
  = 0.9.97.46 (9th April 2019) =
7
  * Added: WP Subtitle compatibility integrated #2831
8
  * Added: New filter in page builder for Enable/disabled check #2998
components/components-core.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  global $redux_builder_amp;
 
3
  $loadComponent = array();
4
  $scriptComponent = array();
5
  $supportComponent = array('AMP-search','AMP-menu','AMP-logo','AMP-social-icons','AMP-sidebar','AMP-featured-image','AMP-author-box','AMP-loop','AMP-categories-tags','AMP-comments','AMP-post-navigation','AMP-related-posts','AMP-post-pagination','AMP-call-now', 'AMP-breadcrumb','AMP-gdpr');
@@ -263,11 +264,12 @@ function amp_gdpr(){
263
 
264
  //Get Core of AMP HTML
265
  function amp_header_core(){
 
266
  $post_id = get_queried_object_id();
267
  if ( ampforwp_polylang_front_page() ) {
268
  $post_id = pll_get_post(get_option('page_on_front'));
269
  }
270
- $thisTemplate = new AMP_Post_Template($post_id);
271
  global $redux_builder_amp;
272
  $html_tag_attributes = AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) );
273
 
@@ -365,11 +367,12 @@ function amp_header_core(){
365
  }
366
 
367
  function amp_header(){
 
368
  $post_id = get_queried_object_id();
369
  if ( ampforwp_polylang_front_page() ) {
370
  $post_id = pll_get_post(get_option('page_on_front'));
371
  }
372
- $thisTemplate = new AMP_Post_Template($post_id);
373
  $thisTemplate->load_parts( array( 'header' ) );
374
  do_action( 'amp_after_header', $thisTemplate );
375
  do_action( 'ampforwp_after_header', $thisTemplate );
@@ -377,11 +380,12 @@ function amp_header(){
377
  <?php }
378
 
379
  function amp_footer(){
 
380
  $post_id = get_queried_object_id();
381
  if ( ampforwp_polylang_front_page() ) {
382
  $post_id = pll_get_post(get_option('page_on_front'));
383
  }
384
- $thisTemplate = new AMP_Post_Template($post_id);
385
  do_action( 'amp_before_footer', $thisTemplate );
386
  do_action( 'amp_post_template_above_footer', $thisTemplate );
387
 
@@ -390,11 +394,12 @@ function amp_footer(){
390
  }
391
 
392
  function amp_footer_core(){
 
393
  $post_id = get_queried_object_id();
394
  if ( ampforwp_polylang_front_page() ) {
395
  $post_id = pll_get_post(get_option('page_on_front'));
396
  }
397
- $thisTemplate = new AMP_Post_Template($post_id);
398
  if(ampforwp_amp_nonamp_convert("", "check")){
399
  wp_footer();
400
  }
@@ -461,8 +466,9 @@ function amp_back_to_top_link(){
461
  }
462
 
463
  function amp_loop_template(){
 
464
  $post_id = get_queried_object_id();
465
- $thisTemplate = new AMP_Post_Template($post_id);
466
  do_action('amp_before_loop',$thisTemplate);
467
  $thisTemplate->load_parts( array( 'loop' ) );
468
  do_action('amp_after_loop',$thisTemplate);
@@ -470,7 +476,7 @@ function amp_loop_template(){
470
 
471
  // The Content
472
  function amp_content($post_id= ''){
473
- global $redux_builder_amp, $post;
474
 
475
  if ( empty( $post_id )) {
476
  $post_id = get_queried_object_id();
@@ -482,7 +488,7 @@ function amp_content($post_id= ''){
482
  }
483
  }
484
 
485
- $thisTemplate = new AMP_Post_Template($post_id);
486
  do_action('ampforwp_before_post_content',$thisTemplate);
487
  $amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
488
  // Normal Content
1
  <?php
2
  global $redux_builder_amp;
3
+ $ampforwpTemplate = '';
4
  $loadComponent = array();
5
  $scriptComponent = array();
6
  $supportComponent = array('AMP-search','AMP-menu','AMP-logo','AMP-social-icons','AMP-sidebar','AMP-featured-image','AMP-author-box','AMP-loop','AMP-categories-tags','AMP-comments','AMP-post-navigation','AMP-related-posts','AMP-post-pagination','AMP-call-now', 'AMP-breadcrumb','AMP-gdpr');
264
 
265
  //Get Core of AMP HTML
266
  function amp_header_core(){
267
+ global $ampforwpTemplate;
268
  $post_id = get_queried_object_id();
269
  if ( ampforwp_polylang_front_page() ) {
270
  $post_id = pll_get_post(get_option('page_on_front'));
271
  }
272
+ $thisTemplate = $ampforwpTemplate;
273
  global $redux_builder_amp;
274
  $html_tag_attributes = AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) );
275
 
367
  }
368
 
369
  function amp_header(){
370
+ global $ampforwpTemplate;
371
  $post_id = get_queried_object_id();
372
  if ( ampforwp_polylang_front_page() ) {
373
  $post_id = pll_get_post(get_option('page_on_front'));
374
  }
375
+ $thisTemplate = $ampforwpTemplate;
376
  $thisTemplate->load_parts( array( 'header' ) );
377
  do_action( 'amp_after_header', $thisTemplate );
378
  do_action( 'ampforwp_after_header', $thisTemplate );
380
  <?php }
381
 
382
  function amp_footer(){
383
+ global $ampforwpTemplate;
384
  $post_id = get_queried_object_id();
385
  if ( ampforwp_polylang_front_page() ) {
386
  $post_id = pll_get_post(get_option('page_on_front'));
387
  }
388
+ $thisTemplate = $ampforwpTemplate;
389
  do_action( 'amp_before_footer', $thisTemplate );
390
  do_action( 'amp_post_template_above_footer', $thisTemplate );
391
 
394
  }
395
 
396
  function amp_footer_core(){
397
+ global $ampforwpTemplate;
398
  $post_id = get_queried_object_id();
399
  if ( ampforwp_polylang_front_page() ) {
400
  $post_id = pll_get_post(get_option('page_on_front'));
401
  }
402
+ $thisTemplate = $ampforwpTemplate;
403
  if(ampforwp_amp_nonamp_convert("", "check")){
404
  wp_footer();
405
  }
466
  }
467
 
468
  function amp_loop_template(){
469
+ global $ampforwpTemplate;
470
  $post_id = get_queried_object_id();
471
+ $thisTemplate = $ampforwpTemplate;
472
  do_action('amp_before_loop',$thisTemplate);
473
  $thisTemplate->load_parts( array( 'loop' ) );
474
  do_action('amp_after_loop',$thisTemplate);
476
 
477
  // The Content
478
  function amp_content($post_id= ''){
479
+ global $redux_builder_amp, $post, $ampforwpTemplate;
480
 
481
  if ( empty( $post_id )) {
482
  $post_id = get_queried_object_id();
488
  }
489
  }
490
 
491
+ $thisTemplate = $ampforwpTemplate;
492
  do_action('ampforwp_before_post_content',$thisTemplate);
493
  $amp_custom_content_enable = get_post_meta( $thisTemplate->get( 'post_id' ) , 'ampforwp_custom_content_editor_checkbox', true);
494
  // Normal Content
includes/vendor/amp/amp.php CHANGED
@@ -83,13 +83,14 @@ if ( ! function_exists('amp_prepare_render') ) {
83
  }
84
  if ( ! function_exists('amp_render') ) {
85
  function amp_render() {
 
86
  amp_load_classes();
87
 
88
  $post_id = get_queried_object_id();
89
  do_action( 'pre_amp_render_post', $post_id );
90
 
91
  amp_add_post_template_actions();
92
- $template = new AMP_Post_Template( $post_id );
93
  $template->load();
94
  exit;
95
  }
83
  }
84
  if ( ! function_exists('amp_render') ) {
85
  function amp_render() {
86
+ global $ampforwpTemplate;
87
  amp_load_classes();
88
 
89
  $post_id = get_queried_object_id();
90
  do_action( 'pre_amp_render_post', $post_id );
91
 
92
  amp_add_post_template_actions();
93
+ $template = $ampforwpTemplate = new AMP_Post_Template( $post_id );
94
  $template->load();
95
  exit;
96
  }
includes/vendor/vendor-changelog.txt CHANGED
@@ -64,4 +64,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder
64
  37. Class AMP_Img_Sanitizer Updated #2893
65
  38. Updated check_attr_spec_rule_valid_url function and also added two more functions parse_protocol and extract_attribute_urls #2862
66
  39. AMP Image Sanitizer Updated #2925
67
- 40. Added itemprop attribute in amp-img #2585
 
64
  37. Class AMP_Img_Sanitizer Updated #2893
65
  38. Updated check_attr_spec_rule_valid_url function and also added two more functions parse_protocol and extract_attribute_urls #2862
66
  39. AMP Image Sanitizer Updated #2925
67
+ 40. Added itemprop attribute in amp-img #2585
68
+ 41. Added $ampforwpTemplate in amp.php #2977
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: 5.1.1
7
- Stable tag: 0.9.97.46
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -184,22 +184,7 @@ You can contact us from [here](https://ampforwp.com/contact/)
184
 
185
  == Changelog ==
186
 
187
- = 0.9.97.46 (9th April 2019) =
188
- * Added: WP Subtitle compatibility integrated #2831
189
- * Added: New filter in page builder for Enable/disabled check #2998
190
- * Added: Additional Page Builder compatibility added #2643
191
- * Fixed: The tag 'p' is disallowed & auto added as child of tag 'amp-accordion' #2498
192
- * Fixed: Histats Not working #2909
193
- * Fixed: itemprop="image" is being removed from the AMP Pages #2585
194
- * Fixed: CSS pseudo-element not working when minify option is enabled #2907
195
- * Fixed: Directories path code improved, if the plugin is installed outside (/wp-content/plugins) #1531
196
- * Fixed: WP_debug warnings and notices #2958
197
- * Fixed: More than one canonical issue with Rank Math SEO Plugin #2975
198
- * Fixed: Background image or color in the 1st row of page builder is applied to all below row #2994
199
- * Fixed: Rare Distorted image aspect ratio issue with Gutenberg editor #2931
200
- * Fixed: Font family for Content in Single page code improved #2122
201
- * Fixed: Fatal Error due to SEO press plugin #3003
202
- * Fixed: Rare issue with Mobile redirection on Homepage after v0.9.97.32 #2972
203
- * Fixed: PageSpeed Score Improvement for all Designs #2979
204
 
205
  Full changelog available in changelog.txt
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.1.1
7
+ Stable tag: 0.9.97.46.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
184
 
185
  == Changelog ==
186
 
187
+ = 0.9.97.46.1 (10th April 2019) =
188
+ * Fixed: Theme framework templates loading multiple times #2977
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
 
190
  Full changelog available in changelog.txt