AMP for WP – Accelerated Mobile Pages - Version 0.9.97.34

Version Description

(14th February 2019) = * Fixed: Backward Compatibility for Yoast and All in One SEO options #2894

Full changelog available in changelog.txt

Download this release

Release Info

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

Code changes from version 0.9.97.33 to 0.9.97.34

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.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -184,6 +184,9 @@ You can contact us from [here](https://ampforwp.com/contact/)
184
 
185
  == Changelog ==
186
 
 
 
 
187
  = 0.9.97.33 (13th February 2019) =
188
  * Fixed: Style sanitizer code updated #2387
189
  * Fixed: UTM Parameters when Mobile Redirection is enabled #2854
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.34
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.34 (14th February 2019) =
188
+ * Fixed: Backward Compatibility for Yoast and All in One SEO options #2894
189
+
190
  = 0.9.97.33 (13th February 2019) =
191
  * Fixed: Style sanitizer code updated #2387
192
  * Fixed: UTM Parameters when Mobile Redirection is enabled #2854
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.33
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.33');
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.34
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.34');
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,8 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 0.9.97.33 (13th February 2019) =
4
  * Fixed: Style sanitizer code updated #2387
5
  * Fixed: UTM Parameters when Mobile Redirection is enabled #2854
1
  == Changelog ==
2
 
3
+ = 0.9.97.34 (14th February 2019) =
4
+ * Fixed: Backward Compatibility for Yoast and All in One SEO options #2894
5
+
6
  = 0.9.97.33 (13th February 2019) =
7
  * Fixed: Style sanitizer code updated #2387
8
  * Fixed: UTM Parameters when Mobile Redirection is enabled #2854
includes/options/admin-config.php CHANGED
@@ -1837,7 +1837,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1837
  $default = 'yoast';
1838
  }
1839
  elseif ( is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') ) {
1840
- $default = 2;
1841
  }
1842
  elseif ( defined( 'RANK_MATH_FILE' ) ) {
1843
  $default = 'rank_math';
@@ -1888,7 +1888,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1888
  'title' => esc_html__('Select SEO Plugin', 'accelerated-mobile-pages'),
1889
  'options' => array(
1890
  'yoast' => 'Yoast',
1891
- '2' => 'All in One SEO',
1892
  'rank_math' => 'Rank Math SEO'
1893
  ),
1894
  'default' => ampforwp_seo_default(),
@@ -1925,7 +1925,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1925
  'type' => 'info',
1926
  'style' => 'success',
1927
  'desc' => esc_html__("All in One SEO works out of the Box with our plugin. It deosn't requires any extra config except Canonicals.", 'accelerated-mobile-pages'),
1928
- 'required' => array('ampforwp-seo-selection', '=', '2')
1929
  ),
1930
  array(
1931
  'class' => 'child_opt',
@@ -1934,7 +1934,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1934
  'tooltip-subtitle' => esc_html__('Pull Canonical from All In One SEO for AMP pages', 'accelerated-mobile-pages'),
1935
  'title' =>esc_html__( 'Canonical from All In One SEO', 'accelerated-mobile-pages' ),
1936
  'default' => 0,
1937
- 'required' => array('ampforwp-seo-selection', '=' , '2'),
1938
  ),
1939
  array(
1940
  'id' => 'ampforwp-seo-index-noindex-sub-section',
1837
  $default = 'yoast';
1838
  }
1839
  elseif ( is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php') ) {
1840
+ $default = 'aioseo';
1841
  }
1842
  elseif ( defined( 'RANK_MATH_FILE' ) ) {
1843
  $default = 'rank_math';
1888
  'title' => esc_html__('Select SEO Plugin', 'accelerated-mobile-pages'),
1889
  'options' => array(
1890
  'yoast' => 'Yoast',
1891
+ 'aioseo' => 'All in One SEO',
1892
  'rank_math' => 'Rank Math SEO'
1893
  ),
1894
  'default' => ampforwp_seo_default(),
1925
  'type' => 'info',
1926
  'style' => 'success',
1927
  'desc' => esc_html__("All in One SEO works out of the Box with our plugin. It deosn't requires any extra config except Canonicals.", 'accelerated-mobile-pages'),
1928
+ 'required' => array('ampforwp-seo-selection', '=', 'aioseo')
1929
  ),
1930
  array(
1931
  'class' => 'child_opt',
1934
  'tooltip-subtitle' => esc_html__('Pull Canonical from All In One SEO for AMP pages', 'accelerated-mobile-pages'),
1935
  'title' =>esc_html__( 'Canonical from All In One SEO', 'accelerated-mobile-pages' ),
1936
  'default' => 0,
1937
+ 'required' => array('ampforwp-seo-selection', '=' , 'aioseo'),
1938
  ),
1939
  array(
1940
  'id' => 'ampforwp-seo-index-noindex-sub-section',
includes/thirdparty-compatibility.php CHANGED
@@ -555,4 +555,22 @@ function ampforwp_deactivate_update_transient($plugin){
555
  $selectedOption['amp-design-selector'] = 4;
556
  update_option('redux_builder_amp',$selectedOption);
557
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
558
  }
555
  $selectedOption['amp-design-selector'] = 4;
556
  update_option('redux_builder_amp',$selectedOption);
557
  }
558
+ }
559
+ // #2894 Backward compatibility for SEO Options
560
+ add_action( 'upgrader_process_complete', 'ampforwp_update_seo_options');
561
+ function ampforwp_update_seo_options(){
562
+ $current_seo = ampforwp_get_setting('ampforwp-seo-selection');
563
+ if ( $current_seo != (1 || 2) ) {
564
+ return;
565
+ }
566
+ if ( 1 == $current_seo || 2 == $current_seo ) {
567
+ $selectedOption = get_option('redux_builder_amp',true);
568
+ if ( 1 == $current_seo ) {
569
+ $selectedOption['ampforwp-seo-selection'] = 'yoast';
570
+ }
571
+ if ( 2 == $current_seo ) {
572
+ $selectedOption['ampforwp-seo-selection'] = 'aiseo';
573
+ }
574
+ update_option('redux_builder_amp',$selectedOption);
575
+ }
576
  }
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.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -185,15 +185,7 @@ You can contact us from [here](https://ampforwp.com/contact/)
185
 
186
  == Changelog ==
187
 
188
- = 0.9.97.33 (13th February 2019) =
189
- * Fixed: Style sanitizer code updated #2387
190
- * Fixed: UTM Parameters when Mobile Redirection is enabled #2854
191
- * Fixed: ?nonamp=1 is not working properly #1947 & #2537
192
- * Fixed: All media queries load in single media query only #2711
193
- * Fixed: 'Hide AMP option' is not working when AMP take over is enabled #2880
194
- * Fixed: Swift Hover Color Changes #2751
195
- * Fixed: Google Font is not getting saved #2839
196
- * Fixed: Sidebar CSS condition code fixed #2757
197
- * Fixed: Performance improvement for ampforwp_stylesheet_file_insertion #2873
198
 
199
  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.0.3
7
+ Stable tag: 0.9.97.34
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.34 (14th February 2019) =
189
+ * Fixed: Backward Compatibility for Yoast and All in One SEO options #2894
 
 
 
 
 
 
 
 
190
 
191
  Full changelog available in changelog.txt
templates/features.php CHANGED
@@ -2464,7 +2464,7 @@ function ampforwp_replace_title_tags() {
2464
  }
2465
 
2466
  // Yoast SEO Title compatibility #2871
2467
- if( class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') ) {
2468
  $yoast_title = $WPSEO_Frontend = '';
2469
  $WPSEO_Frontend = WPSEO_Frontend::get_instance();
2470
  $yoast_title = $WPSEO_Frontend->title($site_title);
@@ -4937,7 +4937,7 @@ function ampforwp_generate_meta_desc($json=""){
4937
  }
4938
 
4939
  // Yoast
4940
- if ( class_exists('WPSEO_Frontend') && 'yoast' == $redux_builder_amp['ampforwp-seo-selection'] ) {
4941
  $front = $yoast_desc = '';
4942
  $front = WPSEO_Frontend::get_instance();
4943
  $yoast_desc = addslashes( strip_tags( $front->metadesc( false ) ) );
@@ -4961,7 +4961,7 @@ function ampforwp_generate_meta_desc($json=""){
4961
  }
4962
 
4963
  // All in One SEO
4964
- if ( class_exists('All_in_One_SEO_Pack') && 2 == $redux_builder_amp['ampforwp-seo-selection'] ) {
4965
  $aisop_class = $aisop_desc = $opts = '';
4966
  $aisop_class = new All_in_One_SEO_Pack();
4967
  if ( ampforwp_is_home() ) {
2464
  }
2465
 
2466
  // Yoast SEO Title compatibility #2871
2467
+ if( class_exists('WPSEO_Frontend') && ('yoast' || 1) == ampforwp_get_setting('ampforwp-seo-selection') ) {
2468
  $yoast_title = $WPSEO_Frontend = '';
2469
  $WPSEO_Frontend = WPSEO_Frontend::get_instance();
2470
  $yoast_title = $WPSEO_Frontend->title($site_title);
4937
  }
4938
 
4939
  // Yoast
4940
+ if ( class_exists('WPSEO_Frontend') && ('yoast' || 1) == $redux_builder_amp['ampforwp-seo-selection'] ) {
4941
  $front = $yoast_desc = '';
4942
  $front = WPSEO_Frontend::get_instance();
4943
  $yoast_desc = addslashes( strip_tags( $front->metadesc( false ) ) );
4961
  }
4962
 
4963
  // All in One SEO
4964
+ if ( class_exists('All_in_One_SEO_Pack') && (2 || 'aioseo') == $redux_builder_amp['ampforwp-seo-selection'] ) {
4965
  $aisop_class = $aisop_desc = $opts = '';
4966
  $aisop_class = new All_in_One_SEO_Pack();
4967
  if ( ampforwp_is_home() ) {