AMP for WP – Accelerated Mobile Pages - Version 0.9.97.30

Version Description

(2nd February 2019) = * Fixed: Wrong title on the archive pages #2864 * Fixed: data-loading-strategy attribute is double quoted #2863

Download this release

Release Info

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

Code changes from version 0.9.97.29 to 0.9.97.30

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.0.3
7
- Stable tag: 0.9.97.29
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -184,6 +184,10 @@ You can contact us from [here](https://ampforwp.com/contact/)
184
 
185
  == Changelog ==
186
 
 
 
 
 
187
  = 0.9.97.29 (31st January 2019) =
188
  * Fixed: Validation error due to Search Widget #2858
189
  * Fixed: Issue after upgrading analytics code #2859
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.0.3
7
+ Stable tag: 0.9.97.30
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.30 (2nd February 2019) =
188
+ * Fixed: Wrong title on the archive pages #2864
189
+ * Fixed: data-loading-strategy attribute is double quoted #2863
190
+
191
  = 0.9.97.29 (31st January 2019) =
192
  * Fixed: Validation error due to Search Widget #2858
193
  * Fixed: Issue after upgrading analytics code #2859
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.29
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.29');
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
26
  $ampforwp_slug = '';
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.30
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.30');
24
  // any changes to AMP_QUERY_VAR should be refelected here
25
  function ampforwp_generate_endpoint(){
26
  $ampforwp_slug = '';
changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  == Changelog ==
2
 
 
 
 
 
3
  = 0.9.97.29 (31st January 2019) =
4
  * Fixed: Validation error due to Search Widget #2858
5
  * Fixed: Issue after upgrading analytics code #2859
1
  == Changelog ==
2
 
3
+ = 0.9.97.30 (2nd February 2019) =
4
+ * Fixed: Wrong title on the archive pages #2864
5
+ * Fixed: data-loading-strategy attribute is double quoted #2863
6
+
7
  = 0.9.97.29 (31st January 2019) =
8
  * Fixed: Validation error due to Search Widget #2858
9
  * Fixed: Issue after upgrading analytics code #2859
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.0.3
7
- Stable tag: 0.9.97.29
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -185,6 +185,10 @@ You can contact us from [here](https://ampforwp.com/contact/)
185
 
186
  == Changelog ==
187
 
 
 
 
 
188
  = 0.9.97.29 (31st January 2019) =
189
  * Fixed: Validation error due to Search Widget #2858
190
  * Fixed: Issue after upgrading analytics code #2859
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.0.3
7
+ Stable tag: 0.9.97.30
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
185
 
186
  == Changelog ==
187
 
188
+ = 0.9.97.30 (2nd February 2019) =
189
+ * Fixed: Wrong title on the archive pages #2864
190
+ * Fixed: data-loading-strategy attribute is double quoted #2863
191
+
192
  = 0.9.97.29 (31st January 2019) =
193
  * Fixed: Validation error due to Search Widget #2858
194
  * Fixed: Issue after upgrading analytics code #2859
templates/features.php CHANGED
@@ -1140,8 +1140,8 @@ function ampforwp_new_dir( $dir ) {
1140
  function ampforwp_ad_optimize(){
1141
  global $redux_builder_amp;
1142
  $optimized_code = '';
1143
- if( isset( $redux_builder_amp['ampforwp-ads-data-loading-strategy'] ) && true == $redux_builder_amp['ampforwp-ads-data-loading-strategy']){
1144
- $optimized_code = 'data-loading-strategy="prefer-viewability-over-views"';
1145
  }
1146
  return $optimized_code;
1147
  }
@@ -2423,12 +2423,13 @@ function ampforwp_replace_title_tags() {
2423
 
2424
  //* We can filter this later if needed:
2425
  $sep = ' | ';
 
2426
 
2427
  if ( is_singular() ) {
2428
  $title = ! empty( $post->post_title ) ? $post->post_title : $title;
2429
  $site_title = $title . $sep . get_option( 'blogname' );
2430
  } elseif ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
2431
- $site_title = strip_tags( get_the_archive_title( '' ) . $sep . get_the_archive_description( '' ) );
2432
  }
2433
 
2434
  if ( is_home() ) {
@@ -2532,7 +2533,24 @@ function ampforwp_replace_title_tags() {
2532
  return esc_html( convert_chars( wptexturize( trim( $site_title ) ) ) );
2533
  }
2534
  }
2535
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2536
  // 27. Clean the Defer issue
2537
  // TODO : Get back to this issue. #407
2538
  function ampforwp_the_content_filter_full( $content_buffer ) {
1140
  function ampforwp_ad_optimize(){
1141
  global $redux_builder_amp;
1142
  $optimized_code = '';
1143
+ if( true == ampforwp_get_setting('ampforwp-ads-data-loading-strategy')){
1144
+ $optimized_code = 'data-loading-strategy=prefer-viewability-over-views';
1145
  }
1146
  return $optimized_code;
1147
  }
2423
 
2424
  //* We can filter this later if needed:
2425
  $sep = ' | ';
2426
+ $sep = apply_filters('ampforwp_title_seperator_type', $sep);
2427
 
2428
  if ( is_singular() ) {
2429
  $title = ! empty( $post->post_title ) ? $post->post_title : $title;
2430
  $site_title = $title . $sep . get_option( 'blogname' );
2431
  } elseif ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
2432
+ $site_title = strip_tags( get_the_archive_title( '' ) . $sep . get_bloginfo( 'name' ) );
2433
  }
2434
 
2435
  if ( is_home() ) {
2533
  return esc_html( convert_chars( wptexturize( trim( $site_title ) ) ) );
2534
  }
2535
  }
2536
+ function ampforwp_modify_archive_title( $title ) {
2537
+ if ( is_category() ) {
2538
+ $title = single_cat_title( '', false );
2539
+ } elseif ( is_tag() ) {
2540
+ $title = single_tag_title( '', false );
2541
+ } elseif ( is_author() ) {
2542
+ $title = '<span class="vcard">' . get_the_author() . '</span>';
2543
+ } elseif ( is_post_type_archive() ) {
2544
+ $title = post_type_archive_title( '', false );
2545
+ } elseif ( is_tax() ) {
2546
+ $title = single_term_title( '', false );
2547
+ }
2548
+ return $title;
2549
+ }
2550
+ add_action( 'pre_amp_render_post', 'ampforwp_modify_archive_title_in_amp');
2551
+ function ampforwp_modify_archive_title_in_amp() {
2552
+ add_filter( 'get_the_archive_title', 'ampforwp_modify_archive_title' );
2553
+ }
2554
  // 27. Clean the Defer issue
2555
  // TODO : Get back to this issue. #407
2556
  function ampforwp_the_content_filter_full( $content_buffer ) {