AMP for WP – Accelerated Mobile Pages - Version 0.9.97.62

Version Description

(3rd July 2019) = * Improvements: Change AddThis controls labels. #3359 * Fixed: Alternative methods to sanitize(sanitize_textarea_field) for users who are using older then 4.7 #3394 * Fixed: amp-addthis script is loading on WooCommerce product pages. #3393 * Fixed: Page titles are changing when Rank math plugin active #3358 * Fixed: Icons added in featured image caption not working properly with font awesome #3288

Download this release

Release Info

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

Code changes from version 0.9.97.61 to 0.9.97.62

README.md CHANGED
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
- Tested up to: 5.2.1
7
- Stable tag: 0.9.97.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -188,6 +188,13 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
188
 
189
  == Changelog ==
190
 
 
 
 
 
 
 
 
191
  = 0.9.97.61 (2nd July 2019) =
192
  * Improvements: AMP option panel for better enhancement #2432
193
  * Improvements: Lighthouse score improved in all designs #3108
@@ -233,7 +240,7 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
233
  * Fixed: Code improvements in loadComponents() #3384
234
  * Fixed: License key is visible in Source code #2528
235
  * Fixed: Fatal error can't use function return value in write context - 2 #3087
236
- * Fixed: Code improvements for security & performance related #3388
237
 
238
  = 0.9.97.60 (22th June 2019) =
239
  * Feature: Need to add template-mode #3252
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
+ Tested up to: 5.2.2
7
+ Stable tag: 0.9.97.62
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
188
 
189
  == Changelog ==
190
 
191
+ = 0.9.97.62 (3rd July 2019) =
192
+ * Improvements: Change AddThis controls labels. #3359
193
+ * Fixed: Alternative methods to sanitize(`sanitize_textarea_field`) for users who are using older then 4.7 #3394
194
+ * Fixed: amp-addthis script is loading on WooCommerce product pages. #3393
195
+ * Fixed: Page titles are changing when Rank math plugin active #3358
196
+ * Fixed: Icons added in featured image caption not working properly with font awesome #3288
197
+
198
  = 0.9.97.61 (2nd July 2019) =
199
  * Improvements: AMP option panel for better enhancement #2432
200
  * Improvements: Lighthouse score improved in all designs #3108
240
  * Fixed: Code improvements in loadComponents() #3384
241
  * Fixed: License key is visible in Source code #2528
242
  * Fixed: Fatal error can't use function return value in write context - 2 #3087
243
+ * Fixed: Code improvements #3388
244
 
245
  = 0.9.97.60 (22th June 2019) =
246
  * Feature: Need to add template-mode #3252
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.61
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.61');
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.62
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.62');
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,12 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
3
  = 0.9.97.61 (2nd July 2019) =
4
  * Improvements: AMP option panel for better enhancement #2432
5
  * Improvements: Lighthouse score improved in all designs #3108
@@ -45,7 +52,7 @@
45
  * Fixed: Code improvements in loadComponents() #3384
46
  * Fixed: License key is visible in Source code #2528
47
  * Fixed: Fatal error can't use function return value in write context - 2 #3087
48
- * Fixed: Code improvements for security & performance related #3388
49
 
50
  = 0.9.97.60 (22th June 2019) =
51
  * Feature: Need to add template-mode #3252
1
  == Changelog ==
2
 
3
+ = 0.9.97.62 (3rd July 2019) =
4
+ * Improvements: Change AddThis controls labels. #3359
5
+ * Fixed: Alternative methods to sanitize(`sanitize_textarea_field`) for users who are using older then 4.7 #3394
6
+ * Fixed: amp-addthis script is loading on WooCommerce product pages. #3393
7
+ * Fixed: Page titles are changing when Rank math plugin active #3358
8
+ * Fixed: Icons added in featured image caption not working properly with font awesome #3288
9
+
10
  = 0.9.97.61 (2nd July 2019) =
11
  * Improvements: AMP option panel for better enhancement #2432
12
  * Improvements: Lighthouse score improved in all designs #3108
52
  * Fixed: Code improvements in loadComponents() #3384
53
  * Fixed: License key is visible in Source code #2528
54
  * Fixed: Fatal error can't use function return value in write context - 2 #3087
55
+ * Fixed: Code improvements #3388
56
 
57
  = 0.9.97.60 (22th June 2019) =
58
  * Feature: Need to add template-mode #3252
components/components-core.php CHANGED
@@ -707,7 +707,7 @@ if ( !function_exists('amp_call_now') ) {
707
  function ampforwp_addThis_support(){
708
  $data_pub_id = ampforwp_get_setting('add-this-pub-id');
709
  $data_widget_id = ampforwp_get_setting('add-this-widget-id');
710
- if ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social')) ) {
711
  if( ampforwp_get_setting('enable-add-this-option') ) {
712
  if( 4 == ampforwp_get_setting('amp-design-selector') && 'default' == ampforwp_get_setting('swift-add-this-position') ){
713
  $amp_addthis = '<amp-addthis width="290" height="92" data-pub-id="'.esc_html($data_pub_id).'" data-widget-id="'. esc_html($data_widget_id).'"></amp-addthis>';
707
  function ampforwp_addThis_support(){
708
  $data_pub_id = ampforwp_get_setting('add-this-pub-id');
709
  $data_widget_id = ampforwp_get_setting('add-this-widget-id');
710
+ if ( ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social')) ) && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) {
711
  if( ampforwp_get_setting('enable-add-this-option') ) {
712
  if( 4 == ampforwp_get_setting('amp-design-selector') && 'default' == ampforwp_get_setting('swift-add-this-position') ){
713
  $amp_addthis = '<amp-addthis width="290" height="92" data-pub-id="'.esc_html($data_pub_id).'" data-widget-id="'. esc_html($data_widget_id).'"></amp-addthis>';
includes/options/admin-config.php CHANGED
@@ -5559,7 +5559,7 @@ else{
5559
  array(
5560
  'id' => 'add-this-support',
5561
  'type' => 'section',
5562
- 'title' => esc_html__('AddThis Support', 'accelerated-mobile-pages'),
5563
  'indent' => true,
5564
  'layout_type' => 'accordion',
5565
  'accordion-open'=> 1,
@@ -5568,7 +5568,7 @@ else{
5568
  array(
5569
  'id' => 'enable-add-this-option',
5570
  'type' => 'switch',
5571
- 'title' => esc_html__('AddThis Sharing', 'accelerated-mobile-pages'),
5572
  'tooltip-subtitle' => sprintf('%s <a href="https://www.addthis.com/register" target="_blank">%s</a>, %s <a href="https://www.addthis.com/academy/how-to-customize-your-share-buttons-on-the-amp-for-wp-plugin" target="_blank">%s</a>',esc_html__('You are using the default AddThis share buttons. To customize your share buttons, create a free account at','accelerated-mobile-pages'),esc_html__('AddThis.com','accelerated-mobile-pages'),esc_html__('then activate the Inline Share Buttons. Once your buttons are activated, replace the default Pub ID and Tool ID with your personalized IDs. For instructions, visit','accelerated-mobile-pages'),esc_html__('here','accelerated-mobile-pages')),
5573
  'default' => true,
5574
  ),
5559
  array(
5560
  'id' => 'add-this-support',
5561
  'type' => 'section',
5562
+ 'title' => esc_html__('AddThis Share Buttons', 'accelerated-mobile-pages'),
5563
  'indent' => true,
5564
  'layout_type' => 'accordion',
5565
  'accordion-open'=> 1,
5568
  array(
5569
  'id' => 'enable-add-this-option',
5570
  'type' => 'switch',
5571
+ 'title' => esc_html__('Smart Sorting Share Buttons', 'accelerated-mobile-pages'),
5572
  'tooltip-subtitle' => sprintf('%s <a href="https://www.addthis.com/register" target="_blank">%s</a>, %s <a href="https://www.addthis.com/academy/how-to-customize-your-share-buttons-on-the-amp-for-wp-plugin" target="_blank">%s</a>',esc_html__('You are using the default AddThis share buttons. To customize your share buttons, create a free account at','accelerated-mobile-pages'),esc_html__('AddThis.com','accelerated-mobile-pages'),esc_html__('then activate the Inline Share Buttons. Once your buttons are activated, replace the default Pub ID and Tool ID with your personalized IDs. For instructions, visit','accelerated-mobile-pages'),esc_html__('here','accelerated-mobile-pages')),
5573
  'default' => true,
5574
  ),
includes/options/redux-core/inc/extensions/customizer/extension_customizer.php CHANGED
@@ -168,7 +168,13 @@ namespace ReduxCore\ReduxFramework;
168
 
169
  protected static function get_post_values() {
170
  if ( empty( self::$post_values ) && isset( $_POST['customized'] ) && ! empty( $_POST['customized'] ) ) {
171
- self::$post_values = sanitize_textarea_field(json_decode( stripslashes_deep( $_POST['customized'] ), true ));
 
 
 
 
 
 
172
  }
173
  }
174
 
@@ -636,7 +642,14 @@ namespace ReduxCore\ReduxFramework;
636
  $this->orig_options = $this->parent->options;
637
  }
638
 
639
- $options = sanitize_textarea_field(json_decode( stripslashes_deep( $_POST['customized'] ), true ));
 
 
 
 
 
 
 
640
  $compiler = false;
641
  $changed = false;
642
 
168
 
169
  protected static function get_post_values() {
170
  if ( empty( self::$post_values ) && isset( $_POST['customized'] ) && ! empty( $_POST['customized'] ) ) {
171
+ if ( function_exists('sanitize_textarea_field') ) {
172
+ self::$post_values = sanitize_textarea_field(json_decode( stripslashes_deep( $_POST['customized'] ), true ));
173
+ }
174
+ else{
175
+ $post_values = json_decode( stripslashes_deep( $_POST['customized'] ), true );
176
+ self::$post_values = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $post_values ) ) );
177
+ }
178
  }
179
  }
180
 
642
  $this->orig_options = $this->parent->options;
643
  }
644
 
645
+ if ( function_exists('sanitize_textarea_field') ) {
646
+ $options = sanitize_textarea_field(json_decode( stripslashes_deep( $_POST['customized'] ), true ));
647
+ }
648
+ else{
649
+ $unsanitized_options = json_decode( stripslashes_deep( $_POST['customized'] ), true );
650
+ $options = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $unsanitized_options ) ));
651
+ }
652
+
653
  $compiler = false;
654
  $changed = false;
655
 
includes/thirdparty-compatibility.php CHANGED
@@ -1006,4 +1006,24 @@ function ampforwp_http_remover_support(){
1006
  ), 99, 1);
1007
  }
1008
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1009
  }
1006
  ), 99, 1);
1007
  }
1008
  }
1009
+ }
1010
+ //AMP Woocommerce function
1011
+ function ampforwp_woocommerce_conditional_check(){
1012
+ $showSingleCss = false;
1013
+ if(!defined('AMP_WOOCOMMERCE_PLUGIN_URI')){
1014
+ $showSingleCss = false;
1015
+ }else{
1016
+ if(function_exists('is_product') && is_product()){
1017
+ $showSingleCss = true;
1018
+ }elseif(function_exists('is_cart') && is_cart()){
1019
+ $showSingleCss = true;
1020
+ }elseif(function_exists('is_shop') && is_shop()){
1021
+ $showSingleCss = true;
1022
+ }elseif(function_exists('is_checkout') && is_checkout()){
1023
+ $showSingleCss = true;
1024
+ }elseif(function_exists('is_account_page') && is_account_page()){
1025
+ $showSingleCss = true;
1026
+ }
1027
+ }
1028
+ return apply_filters('ampforwp_woocommerce_conditional_check', $showSingleCss);
1029
  }
pagebuilder/inc/adminAjaxContents.php CHANGED
@@ -69,7 +69,13 @@ function amppb_export_layout_data(){
69
  header( 'content-type: application/json' );
70
  header( 'Content-Disposition: attachment; filename=layout-' . date( 'dmY' ) . '.json' );
71
 
72
- $export_data = sanitize_textarea_field(wp_unslash( $_POST['export_layout_data'] ));
 
 
 
 
 
 
73
  echo $export_data;
74
 
75
  wp_die();
69
  header( 'content-type: application/json' );
70
  header( 'Content-Disposition: attachment; filename=layout-' . date( 'dmY' ) . '.json' );
71
 
72
+ if ( function_exists('sanitize_textarea_field') ) {
73
+ $export_data = sanitize_textarea_field(wp_unslash( $_POST['export_layout_data'] ));
74
+ }
75
+ else{
76
+ $unsan_export_data = wp_unslash( $_POST['export_layout_data'] );
77
+ $export_data = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $unsan_export_data ) ));
78
+ }
79
  echo $export_data;
80
 
81
  wp_die();
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
- Tested up to: 5.2.1
7
- Stable tag: 0.9.97.61
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,6 +190,13 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
 
 
 
 
 
 
 
193
  = 0.9.97.61 (2nd July 2019) =
194
  * Improvements: AMP option panel for better enhancement #2432
195
  * Improvements: Lighthouse score improved in all designs #3108
@@ -235,6 +242,6 @@ You can contact us from [here](https://ampforwp.com/contact/)
235
  * Fixed: Code improvements in loadComponents() #3384
236
  * Fixed: License key is visible in Source code #2528
237
  * Fixed: Fatal error can't use function return value in write context - 2 #3087
238
- * Fixed: Code improvements for security & performance related #3388
239
 
240
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
3
  Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, google, plugin, SEO
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
+ Tested up to: 5.2.2
7
+ Stable tag: 0.9.97.62
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 0.9.97.62 (3rd July 2019) =
194
+ * Improvements: Change AddThis controls labels. #3359
195
+ * Fixed: Alternative methods to sanitize(`sanitize_textarea_field`) for users who are using older then 4.7 #3394
196
+ * Fixed: amp-addthis script is loading on WooCommerce product pages. #3393
197
+ * Fixed: Page titles are changing when Rank math plugin active #3358
198
+ * Fixed: Icons added in featured image caption not working properly with font awesome #3288
199
+
200
  = 0.9.97.61 (2nd July 2019) =
201
  * Improvements: AMP option panel for better enhancement #2432
202
  * Improvements: Lighthouse score improved in all designs #3108
242
  * Fixed: Code improvements in loadComponents() #3384
243
  * Fixed: License key is visible in Source code #2528
244
  * Fixed: Fatal error can't use function return value in write context - 2 #3087
245
+ * Fixed: Code improvements #3388
246
 
247
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/custom-amp-content.php CHANGED
@@ -180,8 +180,14 @@ function amp_content_editor_meta_save( $post_id ) {
180
  //if there is data to be saved to DB
181
  // Save data of Custom AMP Editor
182
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
183
- $ampforwp_custom_content_editor = sanitize_textarea_field( htmlentities($_POST[ 'ampforwp_custom_content_editor' ]));
184
- update_post_meta($post_id, 'ampforwp_custom_content_editor', $ampforwp_custom_content_editor);
 
 
 
 
 
 
185
  }
186
  // Save data of Custom AMP Editor CheckBox
187
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
180
  //if there is data to be saved to DB
181
  // Save data of Custom AMP Editor
182
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
183
+ $unsan_ampforwp_custom_content_editor = htmlentities($_POST[ 'ampforwp_custom_content_editor' ]);
184
+ if ( function_exists('sanitize_textarea_field') ) {
185
+ $ampforwp_custom_content_editor = sanitize_textarea_field( $unsan_ampforwp_custom_content_editor );
186
+ }
187
+ else{
188
+ $ampforwp_custom_content_editor = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $unsan_ampforwp_custom_content_editor ) ));
189
+ }
190
+ update_post_meta($post_id, 'ampforwp_custom_content_editor', $ampforwp_custom_content_editor );
191
  }
192
  // Save data of Custom AMP Editor CheckBox
193
  if ( isset( $_POST['ampforwp_custom_content_editor'] ) ) {
templates/design-manager/swift/style.php CHANGED
@@ -542,7 +542,14 @@ p.nocomments {padding: 10px;color: #fff;}
542
  .sf-img {width: 100%;display: inline-block;height: auto;margin-top: 33px;}
543
  .sf-img figure{margin:0;}
544
  .sf-img .wp-caption-text{width: 1100px;text-align: left;margin: 0 auto;color: #a1a1a1;font-size: 14px;line-height:20px;font-weight: 500;border-bottom: 1px solid #ccc;padding: 15px 0px;}
545
- .sf-img .wp-caption-text:before{content:"\e412";font-family: 'icomoon';position: relative;top: 4px;opacity: 0.4;font-size:24pxmargin-right: 5px;}
 
 
 
 
 
 
 
546
  <?php if (!checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ){ ?>
547
  .sp-cnt{margin-top: 40px;clear: both;width: 100%;display: inline-block; }
548
  .sp-rl{display:inline-flex;width:100%;}
542
  .sf-img {width: 100%;display: inline-block;height: auto;margin-top: 33px;}
543
  .sf-img figure{margin:0;}
544
  .sf-img .wp-caption-text{width: 1100px;text-align: left;margin: 0 auto;color: #a1a1a1;font-size: 14px;line-height:20px;font-weight: 500;border-bottom: 1px solid #ccc;padding: 15px 0px;}
545
+ .sf-img .wp-caption-text:before{
546
+ <?php if ( ampforwp_get_setting('ampforwp_font_icon') == 'swift-icons' ){ ?>
547
+ content:"\e412";font-family: 'icomoon';font-size:24px;
548
+ <?php }
549
+ if ( ampforwp_get_setting('ampforwp_font_icon') == 'fontawesome-icons' ){ ?>
550
+ content:"\f030";font-family: "Font Awesome 5 Free";font-weight:600;font-size: 20px;
551
+ <?php } ?>
552
+ position: relative;top: 4px;opacity: 0.4;margin-right: 5px;}
553
  <?php if (!checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ){ ?>
554
  .sp-cnt{margin-top: 40px;clear: both;width: 100%;display: inline-block; }
555
  .sp-rl{display:inline-flex;width:100%;}
templates/features.php CHANGED
@@ -1713,9 +1713,26 @@ function ampforwp_replace_title_tags() {
1713
  }
1714
  add_filter('aioseop_title', '__return_false');
1715
  }
1716
- // Custom Front Page Title From Rank Math SEO #2701
1717
  if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1718
- $site_title = RankMath\Post::get_meta( 'title', $post_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1719
  }
1720
  //Bridge Qode SEO Compatibility #2538
1721
  if ( function_exists('qode_wp_title') && 'bridge' == ampforwp_get_setting('ampforwp-seo-selection')){
@@ -6325,7 +6342,7 @@ function ampforwp_add_global_scripts($data){
6325
  }
6326
  }
6327
  // AddThis Support #3068
6328
- if ( ampforwp_get_setting('enable-add-this-option') && ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social') ) ) ) {
6329
  if ( empty( $data['amp_component_scripts']['amp-addthis'] ) ) {
6330
  $data['amp_component_scripts']['amp-addthis'] = 'https://cdn.ampproject.org/v0/amp-addthis-0.1.js';
6331
  }
1713
  }
1714
  add_filter('aioseop_title', '__return_false');
1715
  }
1716
+ // Title From Rank Math SEO #2701 & #3358
1717
  if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1718
+ $rank_math_title = '';
1719
+ $post_id = ampforwp_get_the_ID();
1720
+ if( ampforwp_is_home() || ampforwp_is_blog() ) {
1721
+ $rank_math_title = RankMath\Paper\Paper::get_from_options( 'homepage_title' );
1722
+ }
1723
+ if ( ampforwp_is_front_page() || is_singular() || ampforwp_is_blog() ) {
1724
+ $rank_math_title = RankMath\Post::get_meta( 'title', $post_id );
1725
+ }
1726
+ if ( is_archive() ) {
1727
+ $object = get_queried_object();
1728
+ $rank_math_title = RankMath\Term::get_meta( 'title', $object, $object->taxonomy );
1729
+ if ( '' == $rank_math_title ) {
1730
+ $rank_math_title = RankMath\Paper\Paper::get_from_options( "tax_{$object->taxonomy}_title", $object );
1731
+ }
1732
+ }
1733
+ if ( $rank_math_title ) {
1734
+ $site_title = $rank_math_title;
1735
+ }
1736
  }
1737
  //Bridge Qode SEO Compatibility #2538
1738
  if ( function_exists('qode_wp_title') && 'bridge' == ampforwp_get_setting('ampforwp-seo-selection')){
6342
  }
6343
  }
6344
  // AddThis Support #3068
6345
+ if ( ampforwp_get_setting('enable-add-this-option') && ( is_single() || (is_page() && ampforwp_get_setting('ampforwp-page-social') ) ) && !ampforwp_woocommerce_conditional_check() && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) ) {
6346
  if ( empty( $data['amp_component_scripts']['amp-addthis'] ) ) {
6347
  $data['amp_component_scripts']['amp-addthis'] = 'https://cdn.ampproject.org/v0/amp-addthis-0.1.js';
6348
  }