AMP for WP – Accelerated Mobile Pages - Version 0.9.43.6

Version Description

  • View more details at https://ampforwp.com/stability-sprint-3-51st-update/
  • Typo in the is_home() function fixed
  • Option to hide/show AMP on all custom post types #587
  • False detection by Windows defender tool fixed
  • Conditional tags were not compatible with Advanced AMP ads which were causing some conflicts but is now fixed.
Download this release

Release Info

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

Code changes from version 0.9.43.5 to 0.9.43.6

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.43.5
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/5
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
16
  define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
17
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
18
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
19
- define('AMPFORWP_VERSION','0.9.43.5');
20
 
21
  // Rewrite the Endpoints after the plugin is activate, as priority is set to 11
22
  function ampforwp_add_custom_post_support() {
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.43.6
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/5
16
  define('AMPFORWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
17
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.php');
18
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
19
+ define('AMPFORWP_VERSION','0.9.43.6');
20
 
21
  // Rewrite the Endpoints after the plugin is activate, as priority is set to 11
22
  function ampforwp_add_custom_post_support() {
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/5
5
  Requires at least: 3.0
6
  Tested up to: 4.7.2
7
- Stable tag: 0.9.43.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -126,6 +126,13 @@ You can contact me using this url: http://ampforwp.com/contact/
126
 
127
  == Changelog ==
128
 
 
 
 
 
 
 
 
129
  = 0.9.43.5 =
130
  * View more details at https://ampforwp.com/stability-sprint-2-50th-update/
131
  * Fixed shortcodes issue in related posts #543
@@ -162,7 +169,7 @@ You can contact me using this url: http://ampforwp.com/contact/
162
  * Custom header and footer areas
163
  * Sticky posts now come on top #564
164
  * Footer non-amplink added in design 3 #562
165
- * HTML <p> tag is shown in the title in category! #518
166
 
167
  = 0.9.42 =
168
  * View more details at https://ampforwp.com/design-three-update/
@@ -426,7 +433,7 @@ You can contact me using this url: http://ampforwp.com/contact/
426
  * Added Support for Segment.com Analytics(Ticket #50)
427
  * Added a switch for hiding Non-Amp page link from Footer.( Ticket #189)
428
  * Added an Option that strips Users URL from Comments Section(Ticket #180)
429
- * Fixed stripping <date> tags from the content , Since it was preventing validation<amp-img > issues fixed
430
  * UX Improved for every section of AMP Options page
431
  * Added Settings button on plugin page
432
  * Related posts switch added
4
  Donate link: https://www.paypal.me/Kaludi/5
5
  Requires at least: 3.0
6
  Tested up to: 4.7.2
7
+ Stable tag: 0.9.43.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
126
 
127
  == Changelog ==
128
 
129
+ = 0.9.43.6 =
130
+ * View more details at https://ampforwp.com/stability-sprint-3-51st-update/
131
+ * Typo in the is_home() function fixed
132
+ * Option to hide/show AMP on all custom post types #587
133
+ * False detection by Windows defender tool fixed
134
+ * Conditional tags were not compatible with Advanced AMP ads which were causing some conflicts but is now fixed.
135
+
136
  = 0.9.43.5 =
137
  * View more details at https://ampforwp.com/stability-sprint-2-50th-update/
138
  * Fixed shortcodes issue in related posts #543
169
  * Custom header and footer areas
170
  * Sticky posts now come on top #564
171
  * Footer non-amplink added in design 3 #562
172
+ * HTML Paragraph tag is shown in the title in category! #518
173
 
174
  = 0.9.42 =
175
  * View more details at https://ampforwp.com/design-three-update/
433
  * Added Support for Segment.com Analytics(Ticket #50)
434
  * Added a switch for hiding Non-Amp page link from Footer.( Ticket #189)
435
  * Added an Option that strips Users URL from Comments Section(Ticket #180)
436
+ * Fixed stripping <date> tags from the content , Since it was preventing validation – amp-img issues fixed
437
  * UX Improved for every section of AMP Options page
438
  * Added Settings button on plugin page
439
  * Related posts switch added
templates/customizer/assets/customizer-control.js CHANGED
@@ -42,17 +42,4 @@ jQuery( document ).ready( function($) {
42
  $( this ).parents( 'ul.ampforwp-design-multicheck-list' ).find( 'input.ampforwp-design-multicheck' ).val( this_checkboxes_values ).trigger( 'change' );
43
 
44
  });
45
-
46
- var current_active_design = ampforwp_customizer_settings.design_type;
47
- if ( current_active_design == 1 ) {
48
-
49
- $('#customize-control-amp_header_color').show();
50
- $('#customize-control-amp_header_background_color').show();
51
- $('#customize-control-amp_color_scheme').show();
52
-
53
- } else {
54
- $('#customize-control-amp_header_color').hide();
55
- $('#customize-control-amp_header_background_color').hide();
56
- $('#customize-control-amp_color_scheme').hide();
57
- }
58
- });
42
  $( this ).parents( 'ul.ampforwp-design-multicheck-list' ).find( 'input.ampforwp-design-multicheck' ).val( this_checkboxes_values ).trigger( 'change' );
43
 
44
  });
45
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/features.php CHANGED
@@ -288,13 +288,12 @@
288
  <?php }
289
  } ?>
290
  <?php if($redux_builder_amp['amp-frontpage-select-option'] == 1) { ?>
291
- <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { if( is_home() ) { ?>
292
  <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
293
  <?php } }
294
  } ?>
295
- <?php if( $redux_builder_amp['enable-amp-ads-1'] == true || $redux_builder_amp['enable-amp-ads-2'] == true || $redux_builder_amp['enable-amp-ads-3'] == true || $redux_builder_amp['enable-amp-ads-4'] == true ) { ?>
296
  <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
297
- <?php } else { } }
298
  // 6.1 Adding Analytics Scripts
299
  add_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
300
  function ampforwp_register_analytics_script(){ ?>
@@ -733,12 +732,30 @@
733
  * Adds a meta box to the post editing screen for AMP on-off on specific pages
734
  */
735
  function ampforwp_title_custom_meta() {
736
- add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback', 'post','side' );
737
  global $redux_builder_amp;
 
 
 
738
 
739
- if($redux_builder_amp['amp-on-off-for-all-pages']) {
740
- add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback', 'page','side' );
741
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
742
  }
743
  add_action( 'add_meta_boxes', 'ampforwp_title_custom_meta' );
744
 
@@ -1037,7 +1054,7 @@ function ampforwp_add_proper_post_meta(){
1037
  $check_custom_front_page = get_option('show_on_front');
1038
  if ( $check_custom_front_page == 'page' ) {
1039
  add_action( 'amp_post_template_head', 'ampforwp_custom_yoast_meta_homepage' );
1040
-
1041
  add_filter('wpseo_opengraph_title', 'custom_twitter_title_homepage');
1042
  add_filter('wpseo_twitter_title', 'custom_twitter_title_homepage');
1043
 
@@ -1389,7 +1406,7 @@ function ampforwp_talking_to_robots() {
1389
  $talk_to_robots = true;
1390
  }
1391
 
1392
- if( is_archive() || is_home ) {
1393
  if ( get_query_var( 'paged' ) ) {
1394
  $paged = get_query_var('paged');
1395
  } elseif ( get_query_var( 'page' ) ) {
@@ -1408,3 +1425,4 @@ function ampforwp_talking_to_robots() {
1408
  }
1409
 
1410
  }
 
288
  <?php }
289
  } ?>
290
  <?php if($redux_builder_amp['amp-frontpage-select-option'] == 1) { ?>
291
+ <?php if( $redux_builder_amp['enable-single-social-icons'] == true || AMPFORWP_DM_SOCIAL_CHECK === 'true' ) { if( is_home() ) { ?>
292
  <script async custom-element="amp-social-share" src="https://cdn.ampproject.org/v0/amp-social-share-0.1.js"></script>
293
  <?php } }
294
  } ?>
 
295
  <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
296
+ <?php }
297
  // 6.1 Adding Analytics Scripts
298
  add_action('amp_post_template_head','ampforwp_register_analytics_script', 20);
299
  function ampforwp_register_analytics_script(){ ?>
732
  * Adds a meta box to the post editing screen for AMP on-off on specific pages
733
  */
734
  function ampforwp_title_custom_meta() {
 
735
  global $redux_builder_amp;
736
+ $args = array(
737
+ 'public' => true,
738
+ );
739
 
740
+ $output = 'names'; // 'names' or 'objects' (default: 'names')
741
+ $operator = 'and'; // 'and' or 'or' (default: 'and')
742
+
743
+ $post_types = get_post_types( $args, $output, $operator );
744
+
745
+ if ( $post_types ) { // If there are any custom public post types.
746
+
747
+ foreach ( $post_types as $post_type ) {
748
+
749
+ if( $post_type !== 'page' ) {
750
+ add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback', $post_type,'side' );
751
+ }
752
+
753
+ if( $redux_builder_amp['amp-on-off-for-all-pages'] && $post_type == 'page' ) {
754
+ add_meta_box( 'ampforwp_title_meta', __( 'Show AMP for Current Page?' ), 'ampforwp_title_callback','page','side' );
755
+ }
756
+
757
+ }
758
+ }
759
  }
760
  add_action( 'add_meta_boxes', 'ampforwp_title_custom_meta' );
761
 
1054
  $check_custom_front_page = get_option('show_on_front');
1055
  if ( $check_custom_front_page == 'page' ) {
1056
  add_action( 'amp_post_template_head', 'ampforwp_custom_yoast_meta_homepage' );
1057
+
1058
  add_filter('wpseo_opengraph_title', 'custom_twitter_title_homepage');
1059
  add_filter('wpseo_twitter_title', 'custom_twitter_title_homepage');
1060
 
1406
  $talk_to_robots = true;
1407
  }
1408
 
1409
+ if( is_archive() || is_home() ) {
1410
  if ( get_query_var( 'paged' ) ) {
1411
  $paged = get_query_var('paged');
1412
  } elseif ( get_query_var( 'page' ) ) {
1425
  }
1426
 
1427
  }
1428
+