AMP for WP – Accelerated Mobile Pages - Version 0.9.97.46

Version Description

(9th April 2019) = * Added: WP Subtitle compatibility integrated #2831 * Added: New filter in page builder for Enable/disabled check #2998 * Added: Additional Page Builder compatibility added #2643 * Fixed: The tag 'p' is disallowed & auto added as child of tag 'amp-accordion' #2498 * Fixed: Histats Not working #2909 * Fixed: itemprop="image" is being removed from the AMP Pages #2585 * Fixed: CSS pseudo-element not working when minify option is enabled #2907 * Fixed: Directories path code improved, if the plugin is installed outside (/wp-content/plugins) #1531 * Fixed: WP_debug warnings and notices #2958 * Fixed: More than one canonical issue with Rank Math SEO Plugin #2975 * Fixed: Background image or color in the 1st row of page builder is applied to all below row #2994 * Fixed: Rare Distorted image aspect ratio issue with Gutenberg editor #2931 * Fixed: Font family for Content in Single page code improved #2122 * Fixed: Fatal Error due to SEO press plugin #3003 * Fixed: Rare issue with Mobile redirection on Homepage after v0.9.97.32 #2972 * Fixed: PageSpeed Score Improvement for all Designs #2979

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
Comparing to
See all releases

Code changes from version 0.9.97.45 to 0.9.97.46

Files changed (28) hide show
  1. README.md +20 -2
  2. accelerated-moblie-pages.php +3 -2
  3. changelog.txt +18 -0
  4. components/components-core.php +1 -1
  5. components/social-icons/social-icons.php +1 -1
  6. includes/options/admin-config.php +91 -35
  7. includes/options/extensions/amp_slider/extension_amp_slider.php +1 -1
  8. includes/options/extensions/checkbox_hierarchy/checkbox_hierarchy/field_checkbox_hierarchy.php +1 -1
  9. includes/options/extensions/checkbox_hierarchy/extension_checkbox_hierarchy.php +1 -1
  10. includes/options/extensions/demolink_image_select/demolink_image_select/field_demolink_image_select.php +1 -1
  11. includes/options/extensions/demolink_image_select/extension_demolink_image_select.php +1 -1
  12. includes/options/extensions/vendor_support/vendor_support/extension_vendor_support.php +1 -1
  13. includes/options/redux-core/framework.php +1 -1
  14. includes/thirdparty-compatibility.php +20 -19
  15. includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php +1 -0
  16. includes/vendor/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php +3 -0
  17. includes/vendor/amp/includes/utils/class-amp-image-dimension-extractor.php +10 -0
  18. includes/vendor/vendor-changelog.txt +2 -1
  19. install/index.php +13 -14
  20. pagebuilder/functions.php +11 -8
  21. pagebuilder/inc/admin-amp-page-builder.css +1 -1
  22. pagebuilder/modules/slider-mod-module.php +2 -1
  23. readme.txt +19 -13
  24. templates/design-manager/design-1/style.php +4 -4
  25. templates/design-manager/design-3/style.php +5 -5
  26. templates/design-manager/swift/style.php +30 -14
  27. templates/features.php +136 -18
  28. templates/structured-data.php +3 -3
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.1
7
- Stable tag: 0.9.97.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -183,6 +183,24 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
183
 
184
  == Changelog ==
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  = 0.9.97.45 (4th April 2019) =
187
  * Added: SeoPress compatibility integrated #1589
188
  * Added: WP Appbox compatibility integrated #2791
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.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
 
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
189
+ * Added: Additional Page Builder compatibility added #2643
190
+ * Fixed: The tag 'p' is disallowed & auto added as child of tag 'amp-accordion' #2498
191
+ * Fixed: Histats Not working #2909
192
+ * Fixed: itemprop="image" is being removed from the AMP Pages #2585
193
+ * Fixed: CSS pseudo-element not working when minify option is enabled #2907
194
+ * Fixed: Directories path code improved, if the plugin is installed outside (/wp-content/plugins) #1531
195
+ * Fixed: WP_debug warnings and notices #2958
196
+ * Fixed: More than one canonical issue with Rank Math SEO Plugin #2975
197
+ * Fixed: Background image or color in the 1st row of page builder is applied to all below row #2994
198
+ * Fixed: Rare Distorted image aspect ratio issue with Gutenberg editor #2931
199
+ * Fixed: Font family for Content in Single page code improved #2122
200
+ * Fixed: Fatal Error due to SEO press plugin #3003
201
+ * Fixed: Rare issue with Mobile redirection on Homepage after v0.9.97.32 #2972
202
+ * Fixed: PageSpeed Score Improvement for all Designs #2979
203
+
204
  = 0.9.97.45 (4th April 2019) =
205
  * Added: SeoPress compatibility integrated #1589
206
  * Added: WP Appbox compatibility integrated #2791
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.45
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,8 @@ 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.45');
 
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.46
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');
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(){
27
  $ampforwp_slug = '';
changelog.txt CHANGED
@@ -1,5 +1,23 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 0.9.97.45 (4th April 2019) =
4
  * Added: SeoPress compatibility integrated #1589
5
  * Added: WP Appbox compatibility integrated #2791
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
6
+ * Added: Additional Page Builder compatibility added #2643
7
+ * Fixed: The tag 'p' is disallowed & auto added as child of tag 'amp-accordion' #2498
8
+ * Fixed: Histats Not working #2909
9
+ * Fixed: itemprop="image" is being removed from the AMP Pages #2585
10
+ * Fixed: CSS pseudo-element not working when minify option is enabled #2907
11
+ * Fixed: Directories path code improved, if the plugin is installed outside (/wp-content/plugins) #1531
12
+ * Fixed: WP_debug warnings and notices #2958
13
+ * Fixed: More than one canonical issue with Rank Math SEO Plugin #2975
14
+ * Fixed: Background image or color in the 1st row of page builder is applied to all below row #2994
15
+ * Fixed: Rare Distorted image aspect ratio issue with Gutenberg editor #2931
16
+ * Fixed: Font family for Content in Single page code improved #2122
17
+ * Fixed: Fatal Error due to SEO press plugin #3003
18
+ * Fixed: Rare issue with Mobile redirection on Homepage after v0.9.97.32 #2972
19
+ * Fixed: PageSpeed Score Improvement for all Designs #2979
20
+
21
  = 0.9.97.45 (4th April 2019) =
22
  * Added: SeoPress compatibility integrated #1589
23
  * Added: WP Appbox compatibility integrated #2791
components/components-core.php CHANGED
@@ -71,7 +71,7 @@ function amp_icon_css(){
71
 
72
  // Add @font-face for Design-1,2,3
73
  if ( 1 == $redux_builder_amp['amp-design-selector'] || 2 == $redux_builder_amp['amp-design-selector'] || 3 == $redux_builder_amp['amp-design-selector'] ) { ?>
74
- @font-face {font-family: 'icomoon';font-style: normal;font-weight: normal;font-display: auto;src: local('icomoon'), local('icomoon'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>icomoon/icomoon.ttf');}
75
  [class^="icon-"], [class*=" icon-"] {font-family: 'icomoon';speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
76
  <?php }
77
  }
71
 
72
  // Add @font-face for Design-1,2,3
73
  if ( 1 == $redux_builder_amp['amp-design-selector'] || 2 == $redux_builder_amp['amp-design-selector'] || 3 == $redux_builder_amp['amp-design-selector'] ) { ?>
74
+ @font-face {font-family: 'icomoon';font-style: normal;font-weight: normal;font-display: swap;src: local('icomoon'), local('icomoon'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>icomoon/icomoon.ttf');}
75
  [class^="icon-"], [class*=" icon-"] {font-family: 'icomoon';speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
76
  <?php }
77
  }
components/social-icons/social-icons.php CHANGED
@@ -195,7 +195,7 @@ add_action('amp_post_template_css','amp_social_styles',11);
195
  function amp_social_styles(){ ?>
196
  @font-face {
197
  font-family: 'icomoon';
198
- font-display: auto;
199
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/icomoon.eot');
200
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/icomoon.eot') format('embedded-opentype'),
201
  url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/icomoon.ttf') format('truetype'),
195
  function amp_social_styles(){ ?>
196
  @font-face {
197
  font-family: 'icomoon';
198
+ font-display: swap;
199
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/icomoon.eot');
200
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/icomoon.eot') format('embedded-opentype'),
201
  url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/icomoon.ttf') format('truetype'),
includes/options/admin-config.php CHANGED
@@ -14,6 +14,81 @@ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
14
  $comment_AD_URL = "http://ampforwp.com/amp-comments/#utm_source=options-panel&utm_medium=comments-tab&utm_campaign=AMP%20Plugin";
15
  $comment_desc = '<a href="'.$comment_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/comments-banner.png" width="560" height="85" /></a>';
16
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  // Display only If AMP Cache is Not Installed
18
  $cache_desc ="";
19
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
@@ -161,15 +236,16 @@ $extension_listing_array = array(
161
  'is_activated'=>(is_plugin_active('amp-popup/amp-popup.php')? 1 : 2),
162
  ),
163
  array(
164
- 'name'=>'Page Builder For AMP',
165
  'desc'=>'Page Builder Functionality for AMP in WordPress. Most easiest and the best way to include Page Builder in AMP.',
166
  'img_src'=>AMPFORWP_IMAGE_DIR . '/pwa-icon.png',
167
- 'price'=>'Free',
168
  'url_link'=>'http://ampforwp.com/page-builder-compatibility-for-amp/#utm_source=options-panel&utm_medium=extension-tab_pagebuilder-for-amp&utm_campaign=AMP%20Plugin',
169
- 'plugin_active_path'=> 'pagebuilder-for-amp/pagebuilder-for-amp.php',
170
- 'item_name'=>'Page Builder for AMP',
171
  'store_url'=>'https://accounts.ampforwp.com',
172
- 'is_activated'=>(is_plugin_active('pagebuilder-for-amp/pagebuilder-for-amp.php')? 1 : 2),
 
173
  ),
174
  array(
175
  'name'=>'Call To Action (CTA)',
@@ -428,7 +504,7 @@ foreach ($extension_listing_array as $key => $extension) {
428
  'customer_name'=> '',
429
  'customer_email'=> '',
430
  );
431
- $selectedOption = get_option('redux_builder_amp',true);
432
  if(isset($selectedOption['amp-license'][$pathExploded])){
433
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
434
  }
@@ -1140,7 +1216,7 @@ Redux::setArgs( "redux_builder_amp", $args );
1140
  return $value;
1141
  }
1142
  function ampforwp_custom_logo_dimensions_options(){
1143
- $selectedOption = get_option('redux_builder_amp',true);
1144
  $opCheck = $selectedOption['ampforwp-custom-logo-dimensions'];
1145
  if($opCheck==1){
1146
  return 'prescribed';
@@ -1343,30 +1419,10 @@ Redux::setArgs( "redux_builder_amp", $args );
1343
  // AMP Content Page Builder SECTION
1344
  Redux::setSection( $opt_name, array(
1345
  'title' => esc_html__( 'Page Builder', 'accelerated-mobile-pages' ),
1346
- 'class' =>'',
1347
  'id' => 'amp-content-builder',
1348
- 'class' => 'ampforwp-new-element',
1349
  'subsection' => true,
1350
- 'fields' => array(
1351
- array(
1352
- 'id' => 'ampforwp-page-builder-info',
1353
- 'type' => 'raw',
1354
- 'desc' => '<div style="background: #FFF9C4;
1355
- display: inline-block;
1356
- padding: 10px 20px;
1357
- margin-top: 0px;
1358
- left: 0;
1359
- line-height: 1.6;
1360
- position: absolute;
1361
- left: 0px;
1362
- top: 15px;
1363
- font-size: 15px;"><b>'.esc_html__('Introducing AMP Page Builder 3.0', 'accelerated-mobile-pages').'</b>,'.esc_html__('Re-Engineered in Vue.js!', 'accelerated-mobile-pages').'<br /> <a href="https://ampforwp.com/tutorials/article/amp-page-builder-installation/" target="_blank">'.esc_html__('Learn how to use this Feature','accelerated-mobile-pages').'</a></div>
1364
-
1365
- <iframe style="position: absolute;left: 0px;margin-top: 67px;" width="600" height="400" src="https://www.youtube.com/embed/QTbkn2rHyqM" frameborder="0" allowfullscreen></iframe>
1366
-
1367
- ',
1368
- ),
1369
- )
1370
  )
1371
 
1372
  ) ;
@@ -2110,7 +2166,7 @@ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
2110
 
2111
  function ampforwp_get_default_analytics($param=""){
2112
  $options = $default = '';
2113
- $options = get_option('redux_builder_amp', true);
2114
  $default = $options['amp-analytics-select-option'];
2115
  if($param == $default){
2116
  return true;
@@ -2439,7 +2495,7 @@ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
2439
  'default' => ampforwp_get_default_analytics('8'),
2440
  ),
2441
  array(
2442
- 'id' => 'histats-feild',
2443
  'type' => 'text',
2444
  'title' => esc_html__( 'Histats Analytics', 'accelerated-mobile-pages' ),
2445
  'required' => array(
@@ -2447,7 +2503,7 @@ if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
2447
  ),
2448
  'tooltip-subtitle' => esc_html__( 'Enter your Histats Analytics ID.', 'accelerated-mobile-pages' ),
2449
  'desc' => 'Tutorial: <a href="https://ampforwp.com/tutorials/how-to-get-histats-analytics-id/">How to get Histats Analytics ID for AMP?</a>',
2450
- 'default' => '',
2451
  ),
2452
  // Yandex Metrika
2453
  array(
@@ -4578,7 +4634,7 @@ Redux::setSection( $opt_name, array(
4578
  $amp_fontparts = array_merge($amp_fontparts ,$fonts_settings);
4579
 
4580
  }else{
4581
- $selectedOption = get_option('redux_builder_amp',true);
4582
  if(!isset($selectedOption['amp-design-selector'])){
4583
  $selectedOption['amp-design-selector'] = '4';
4584
  }
@@ -4823,7 +4879,7 @@ Redux::setSection( $opt_name, array(
4823
 
4824
  // Header Elements default Color
4825
  function ampforwp_get_element_default_color() {
4826
- $default_value = get_option('redux_builder_amp', true);
4827
  $default_value = $default_value['amp-opt-color-rgba-colorscheme']['color'];
4828
  if ( empty( $default_value ) ) {
4829
  $default_value = '#333';
@@ -7438,7 +7494,7 @@ else{
7438
  )
7439
 
7440
  ) );
7441
- $redux_option = get_option('redux_builder_amp',true);
7442
  if ( 4 == $redux_option['amp-design-selector'] ) {
7443
  $post_builder = '';
7444
  }
14
  $comment_AD_URL = "http://ampforwp.com/amp-comments/#utm_source=options-panel&utm_medium=comments-tab&utm_campaign=AMP%20Plugin";
15
  $comment_desc = '<a href="'.$comment_AD_URL.'" target="_blank"><img class="ampforwp-ad-img-banner" src="'.AMPFORWP_IMAGE_DIR . '/comments-banner.png" width="560" height="85" /></a>';
16
  }
17
+ $wpbakery_for_ampchecker = $divi_pb_for_ampchecker = $elemntr_pb_for_ampchecker = array();
18
+ if(!is_plugin_active( 'amp-pagebuilder-compatibility/amp-pagebuilder-compatibility.php' )){
19
+ $wpbakery_for_ampchecker = array(
20
+ 'id' => 'wpbakery_pb_for_amp_info_normal',
21
+ 'type' => 'info',
22
+ 'required' => array(
23
+ array('ampforwp-wpbakery-pb-for-amp', '=' , true),
24
+ ),
25
+ 'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
26
+ );
27
+ $divi_pb_for_ampchecker = array(
28
+ 'id' => 'divi_pb_for_amp_info_normal',
29
+ 'type' => 'info',
30
+ 'required' => array(
31
+ array('ampforwp-divi-pb-for-amp', '=' , true),
32
+ ),
33
+ 'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
34
+ );
35
+ $elemntr_pb_for_ampchecker = array(
36
+ 'id' => 'elemntr_pb_for_amp_info_normal',
37
+ 'type' => 'info',
38
+ 'required' => array(
39
+ array('ampforwp-elementor-pb-for-amp', '=' , true),
40
+ ),
41
+ 'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
42
+ );
43
+ }
44
+ $pb_for_amp[] = array(
45
+ 'id' => 'ampforwp-wpbakery-pb-for-amp-accor',
46
+ 'type' => 'section',
47
+ 'title' => esc_html__('WPBakery Page Builder Compatibility', 'accelerated-mobile-pages'),
48
+ 'indent' => true,
49
+ 'layout_type' => 'accordion',
50
+ 'accordion-open'=> 1,
51
+ );
52
+ $pb_for_amp[] = array(
53
+ 'id' => 'ampforwp-wpbakery-pb-for-amp',
54
+ 'type' => 'switch',
55
+ 'title' => esc_html__('WPBakery Page Builder Support','accelerated-mobile-pages'),
56
+ 'tooltip-subtitle' => esc_html__('Enable or Disable the WPBakery Page Builder support for AMP', 'accelerated-mobile-pages'),
57
+ 'default' => false
58
+ );
59
+ $pb_for_amp[] = $wpbakery_for_ampchecker;
60
+ $pb_for_amp[] = array(
61
+ 'id' => 'ampforwp-divi-pb-for-amp-accor',
62
+ 'type' => 'section',
63
+ 'title' => esc_html__('Divi Builder Compatibility', 'accelerated-mobile-pages'),
64
+ 'indent' => true,
65
+ 'layout_type' => 'accordion',
66
+ 'accordion-open'=> 1,
67
+ );
68
+ $pb_for_amp[] = array(
69
+ 'id' => 'ampforwp-divi-pb-for-amp',
70
+ 'type' => 'switch',
71
+ 'title' => esc_html__('Divi Builder Support','accelerated-mobile-pages'),
72
+ 'tooltip-subtitle' => esc_html__('Enable or Disable the Divi Builder support for AMP', 'accelerated-mobile-pages'),
73
+ 'default' => false
74
+ );
75
+ $pb_for_amp[] = $divi_pb_for_ampchecker;
76
+ $pb_for_amp[] = array(
77
+ 'id' => 'ampforwp-elementor-pb-for-amp-accor',
78
+ 'type' => 'section',
79
+ 'title' => esc_html__('Elementor Compatibility', 'accelerated-mobile-pages'),
80
+ 'indent' => true,
81
+ 'layout_type' => 'accordion',
82
+ 'accordion-open'=> 1,
83
+ );
84
+ $pb_for_amp[] = array(
85
+ 'id' => 'ampforwp-elementor-pb-for-amp',
86
+ 'type' => 'switch',
87
+ 'title' => esc_html__('Elementor Support','accelerated-mobile-pages'),
88
+ 'tooltip-subtitle' => esc_html__('Enable or Disable the Elementor support for AMP', 'accelerated-mobile-pages'),
89
+ 'default' => false
90
+ );
91
+ $pb_for_amp[] = $elemntr_pb_for_ampchecker;
92
  // Display only If AMP Cache is Not Installed
93
  $cache_desc ="";
94
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
236
  'is_activated'=>(is_plugin_active('amp-popup/amp-popup.php')? 1 : 2),
237
  ),
238
  array(
239
+ 'name'=>'AMP Pagebuilder Compatibility',
240
  'desc'=>'Page Builder Functionality for AMP in WordPress. Most easiest and the best way to include Page Builder in AMP.',
241
  'img_src'=>AMPFORWP_IMAGE_DIR . '/pwa-icon.png',
242
+ 'price'=>'$89',
243
  'url_link'=>'http://ampforwp.com/page-builder-compatibility-for-amp/#utm_source=options-panel&utm_medium=extension-tab_pagebuilder-for-amp&utm_campaign=AMP%20Plugin',
244
+ 'plugin_active_path'=> 'amp-pagebuilder-compatibility/amp-pagebuilder-compatibility.php',
245
+ 'item_name'=>'AMP Pagebuilder Compatibility',
246
  'store_url'=>'https://accounts.ampforwp.com',
247
+ 'is_activated'=>(is_plugin_active('amp-pagebuilder-compatibility/amp-pagebuilder-compatibility.php')? 1 : 2),
248
+ 'settingUrl'=>'{amp-content-builder}',
249
  ),
250
  array(
251
  'name'=>'Call To Action (CTA)',
504
  'customer_name'=> '',
505
  'customer_email'=> '',
506
  );
507
+ $selectedOption = (array) get_option('redux_builder_amp',true);
508
  if(isset($selectedOption['amp-license'][$pathExploded])){
509
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];
510
  }
1216
  return $value;
1217
  }
1218
  function ampforwp_custom_logo_dimensions_options(){
1219
+ $selectedOption = (array) get_option('redux_builder_amp',true);
1220
  $opCheck = $selectedOption['ampforwp-custom-logo-dimensions'];
1221
  if($opCheck==1){
1222
  return 'prescribed';
1419
  // AMP Content Page Builder SECTION
1420
  Redux::setSection( $opt_name, array(
1421
  'title' => esc_html__( 'Page Builder', 'accelerated-mobile-pages' ),
 
1422
  'id' => 'amp-content-builder',
1423
+ 'class' => 'ampforwp_new_features ',
1424
  'subsection' => true,
1425
+ 'fields' => $pb_for_amp,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1426
  )
1427
 
1428
  ) ;
2166
 
2167
  function ampforwp_get_default_analytics($param=""){
2168
  $options = $default = '';
2169
+ $options = (array) get_option('redux_builder_amp', true);
2170
  $default = $options['amp-analytics-select-option'];
2171
  if($param == $default){
2172
  return true;
2495
  'default' => ampforwp_get_default_analytics('8'),
2496
  ),
2497
  array(
2498
+ 'id' => 'histats-field',
2499
  'type' => 'text',
2500
  'title' => esc_html__( 'Histats Analytics', 'accelerated-mobile-pages' ),
2501
  'required' => array(
2503
  ),
2504
  'tooltip-subtitle' => esc_html__( 'Enter your Histats Analytics ID.', 'accelerated-mobile-pages' ),
2505
  'desc' => 'Tutorial: <a href="https://ampforwp.com/tutorials/how-to-get-histats-analytics-id/">How to get Histats Analytics ID for AMP?</a>',
2506
+ 'default' => ampforwp_get_setting('histats-feild'),
2507
  ),
2508
  // Yandex Metrika
2509
  array(
4634
  $amp_fontparts = array_merge($amp_fontparts ,$fonts_settings);
4635
 
4636
  }else{
4637
+ $selectedOption = (array) get_option('redux_builder_amp',true);
4638
  if(!isset($selectedOption['amp-design-selector'])){
4639
  $selectedOption['amp-design-selector'] = '4';
4640
  }
4879
 
4880
  // Header Elements default Color
4881
  function ampforwp_get_element_default_color() {
4882
+ $default_value = (array) get_option('redux_builder_amp', true);
4883
  $default_value = $default_value['amp-opt-color-rgba-colorscheme']['color'];
4884
  if ( empty( $default_value ) ) {
4885
  $default_value = '#333';
7494
  )
7495
 
7496
  ) );
7497
+ $redux_option = (array) get_option('redux_builder_amp',true);
7498
  if ( 4 == $redux_option['amp-design-selector'] ) {
7499
  $post_builder = '';
7500
  }
includes/options/extensions/amp_slider/extension_amp_slider.php CHANGED
@@ -64,7 +64,7 @@ if( !class_exists( 'ReduxCore\\ReduxFramework\\ReduxFramework_extension_amp_slid
64
 
65
  $this->field_name = 'amp_slider';
66
  if ( empty( $this->extension_dir ) ) {
67
- $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
68
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
69
  }
70
 
64
 
65
  $this->field_name = 'amp_slider';
66
  if ( empty( $this->extension_dir ) ) {
67
+ $this->extension_dir = trailingslashit( str_replace( '\\', '/', AMPFORWP_EXTENSION_DIR.'/'.$this->field_name ));
68
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
69
  }
70
 
includes/options/extensions/checkbox_hierarchy/checkbox_hierarchy/field_checkbox_hierarchy.php CHANGED
@@ -46,7 +46,7 @@ if ( !class_exists ( 'ReduxCore\\ReduxFramework\\ReduxFramework_checkbox_hierarc
46
  $this->time = AMPFORWP_VERSION;
47
  }
48
  if ( empty( $this->extension_dir ) ) {
49
- $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
50
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
51
  }
52
  }
46
  $this->time = AMPFORWP_VERSION;
47
  }
48
  if ( empty( $this->extension_dir ) ) {
49
+ $this->extension_dir = trailingslashit( str_replace( '\\', '/', AMPFORWP_EXTENSION_DIR.'/checkbox_hierarchy/checkbox_hierarchy' ) );
50
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
51
  }
52
  }
includes/options/extensions/checkbox_hierarchy/extension_checkbox_hierarchy.php CHANGED
@@ -63,7 +63,7 @@ if( !class_exists( 'ReduxCore\\ReduxFramework\\ReduxFramework_extension_checkbox
63
  }
64
 
65
  if ( empty( $this->extension_dir ) ) {
66
- $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
67
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
68
  }
69
 
63
  }
64
 
65
  if ( empty( $this->extension_dir ) ) {
66
+ $this->extension_dir = trailingslashit( str_replace( '\\', '/', AMPFORWP_EXTENSION_DIR.'/'.$this->field_name ) );
67
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
68
  }
69
 
includes/options/extensions/demolink_image_select/demolink_image_select/field_demolink_image_select.php CHANGED
@@ -32,7 +32,7 @@ if ( ! class_exists( 'ReduxCore\\ReduxFramework\\ReduxFramework_demolink_image_s
32
  $this->time = AMPFORWP_VERSION;
33
  }
34
  if ( empty( $this->extension_dir ) ) {
35
- $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
36
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
37
  }
38
  // Set default args for this field to avoid bad indexes. Change this to anything you use.
32
  $this->time = AMPFORWP_VERSION;
33
  }
34
  if ( empty( $this->extension_dir ) ) {
35
+ $this->extension_dir = trailingslashit( str_replace( '\\', '/', AMPFORWP_EXTENSION_DIR.'/demolink_image_select/demolink_image_select' ) );
36
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
37
  }
38
  // Set default args for this field to avoid bad indexes. Change this to anything you use.
includes/options/extensions/demolink_image_select/extension_demolink_image_select.php CHANGED
@@ -63,7 +63,7 @@ if( !class_exists( 'ReduxFramework_extension_demolink_image_select' ) ) {
63
  }
64
 
65
  if ( empty( $this->extension_dir ) ) {
66
- $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
67
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
68
  }
69
 
63
  }
64
 
65
  if ( empty( $this->extension_dir ) ) {
66
+ $this->extension_dir = trailingslashit( str_replace( '\\', '/', AMPFORWP_EXTENSION_DIR.'/'.$this->field_name ) );
67
  $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
68
  }
69
 
includes/options/extensions/vendor_support/vendor_support/extension_vendor_support.php CHANGED
@@ -48,7 +48,7 @@ namespace ReduxCore\ReduxFramework;
48
  */
49
  public function __construct( $parent = null ) {
50
  if ( empty( $this->extension_dir ) ) {
51
- $this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
52
  //$this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
53
  $this->extension_url = AMPFORWP_PLUGIN_DIR_URI.'includes/options/extensions/vendor_support/vendor_support/';
54
  }
48
  */
49
  public function __construct( $parent = null ) {
50
  if ( empty( $this->extension_dir ) ) {
51
+ $this->extension_dir = trailingslashit( str_replace( '\\', '/', AMPFORWP_EXTENSION_DIR.'/vendor_support/vendor_support' ) );
52
  //$this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );
53
  $this->extension_url = AMPFORWP_PLUGIN_DIR_URI.'includes/options/extensions/vendor_support/vendor_support/';
54
  }
includes/options/redux-core/framework.php CHANGED
@@ -735,7 +735,7 @@
735
  *
736
  * @param array $value option value to set global_variable with
737
  */
738
- $GLOBALS[ $this->args['global_variable'] ] = apply_filters( "redux/options/{$this->args['opt_name']}/global_variable", $this->options );
739
  if ( isset ( $this->transients['last_save'] ) ) {
740
  // Deprecated
741
  $GLOBALS[ $this->args['global_variable'] ]['REDUX_last_saved'] = $this->transients['last_save'];
735
  *
736
  * @param array $value option value to set global_variable with
737
  */
738
+ $GLOBALS[ $this->args['global_variable'] ] = (array) apply_filters( "redux/options/{$this->args['opt_name']}/global_variable", $this->options );
739
  if ( isset ( $this->transients['last_save'] ) ) {
740
  // Deprecated
741
  $GLOBALS[ $this->args['global_variable'] ]['REDUX_last_saved'] = $this->transients['last_save'];
includes/thirdparty-compatibility.php CHANGED
@@ -801,9 +801,9 @@ function ampforwp_seopress_social(){
801
  if (!empty($seopress_video[0][0]['url']) && $seopress_video_disabled =='') {
802
  //do nothing
803
  } else {
804
- $seopress_social_og_author = '<meta property="article:author" content="'.seopress_social_accounts_facebook_option().'" />';
805
  $seopress_social_og_author .= "\n";
806
- $seopress_social_og_author .= '<meta property="article:publisher" content="'.seopress_social_accounts_facebook_option().'" />';
807
  }
808
  }
809
  if (isset($seopress_social_og_author)) {
@@ -851,7 +851,7 @@ function ampforwp_seopress_social(){
851
  if ( '' != get_post_meta($post_id,'_seopress_social_fb_desc',true) ) {
852
  $description = get_post_meta($post_id,'_seopress_social_fb_desc',true);
853
  }
854
- $seopress_social_og_desc .= '<meta property="og:description" content="'.$description.'" />';
855
  $seopress_social_og_desc .= "\n";
856
  //Hook on post OG description - 'seopress_social_og_desc'
857
  if (has_filter('seopress_social_og_desc')) {
@@ -896,9 +896,9 @@ function ampforwp_seopress_social(){
896
 
897
  //OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
898
  if (!empty($image_src)) {
899
- $seopress_social_og_img .= '<meta property="og:image:width" content="'.$image_src[1].'" />';
900
  $seopress_social_og_img .= "\n";
901
- $seopress_social_og_img .= '<meta property="og:image:height" content="'.$image_src[2].'" />';
902
  $seopress_social_og_img .= "\n";
903
  }
904
 
@@ -917,19 +917,19 @@ function ampforwp_seopress_social(){
917
  }
918
  }
919
  if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id'])) {
920
- $seopress_social_link_ownership_id = '<meta property="fb:pages" content="'.$options['seopress_social_facebook_link_ownership_id'].'" />';
921
  echo $seopress_social_link_ownership_id."\n";
922
  }
923
  if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id']) ) {
924
- $seopress_social_admin_id = '<meta property="fb:admins" content="'.$options['seopress_social_facebook_admin_id'].'" />';
925
  echo $seopress_social_admin_id."\n";
926
  }
927
  if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id']) ) {
928
- $seopress_social_app_id = '<meta property="fb:app_id" content="'.$options['seopress_social_facebook_app_id'].'" />';
929
  echo $seopress_social_app_id."\n";
930
  }
931
  if (isset($options['seopress_social_twitter_card'])) {
932
- if ($options['seopress_social_twitter_card_img_size'] =='large') {
933
  $seopress_social_twitter_card_summary = '<meta name="twitter:card" content="summary_large_image">';
934
  } else {
935
  $seopress_social_twitter_card_summary = '<meta name="twitter:card" content="summary" />';
@@ -941,7 +941,7 @@ function ampforwp_seopress_social(){
941
  echo $seopress_social_twitter_card_summary."\n";
942
  }
943
  if (isset($options['seopress_social_twitter_card']) && isset($options['seopress_social_accounts_twitter']) ) {
944
- $seopress_social_twitter_card_site = '<meta name="twitter:site" content="'.$options['seopress_social_accounts_twitter'].'" />';
945
  //Hook on post Twitter card site - 'seopress_social_twitter_card_site'
946
  if (has_filter('seopress_social_twitter_card_site')) {
947
  $seopress_social_twitter_card_site = apply_filters('seopress_social_twitter_card_site', $seopress_social_twitter_card_site);
@@ -953,10 +953,10 @@ function ampforwp_seopress_social(){
953
  $seopress_social_twitter_card_creator ='';
954
  if ($options['seopress_social_twitter_card'] =='1' && get_the_author_meta('twitter') ) {
955
 
956
- $seopress_social_twitter_card_creator .= '<meta name="twitter:creator" content="@'.get_the_author_meta('twitter').'" />';
957
 
958
- } elseif ($options['seopress_social_twitter_card'] =='1' && $options['seopress_social_accounts_twitter'] !='' ) {
959
- $seopress_social_twitter_card_creator .= '<meta name="twitter:creator" content="'.$options['seopress_social_accounts_twitter'].'" />';
960
  }
961
  //Hook on post Twitter card creator - 'seopress_social_twitter_card_creator'
962
  if (has_filter('seopress_social_twitter_card_creator')) {
@@ -967,7 +967,7 @@ function ampforwp_seopress_social(){
967
  }
968
  }
969
  if (isset($options['seopress_social_twitter_card'])) {
970
- $title = '';
971
  $title = ampforwp_get_seopress_title();
972
  if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_title',true) ){
973
  $title = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_title',true);
@@ -997,6 +997,7 @@ function ampforwp_seopress_social(){
997
  }
998
  }
999
  if (isset($options['seopress_social_twitter_card'])) {
 
1000
  $description = ampforwp_generate_meta_desc();
1001
  if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_desc',true) ) {
1002
  $description = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_desc',true);
@@ -1014,7 +1015,7 @@ function ampforwp_seopress_social(){
1014
  }elseif ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_desc',true) ) {
1015
  $description = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_desc',true);
1016
  }
1017
- $seopress_social_twitter_card_desc .= '<meta name="twitter:description" content="'.$description.'" />';
1018
  //Hook on post Twitter card description - 'seopress_social_twitter_card_desc'
1019
  if (has_filter('seopress_social_twitter_card_desc')) {
1020
  $seopress_social_twitter_card_desc = apply_filters('seopress_social_twitter_card_desc', $seopress_social_twitter_card_desc);
@@ -1053,20 +1054,20 @@ function ampforwp_seopress_social(){
1053
 
1054
  //OG:IMAGE
1055
  $seopress_twitter_img = '';
1056
- $seopress_twitter_img .= '<meta property="twitter:image" content="'.$url.'" />';
1057
  $seopress_twitter_img .= "\n";
1058
 
1059
  //OG:IMAGE:SECURE_URL IF SSL
1060
  if (is_ssl()) {
1061
- $seopress_twitter_img .= '<meta property="twitter:image:secure_url" content="'.$url.'" />';
1062
  $seopress_twitter_img .= "\n";
1063
  }
1064
 
1065
  //OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
1066
  if (!empty($image_src)) {
1067
- $seopress_twitter_img .= '<meta property="twitter:image:width" content="'.$image_src[1].'" />';
1068
  $seopress_twitter_img .= "\n";
1069
- $seopress_twitter_img .= '<meta property="twitter:image:height" content="'.$image_src[2].'" />';
1070
  $seopress_twitter_img .= "\n";
1071
  }
1072
 
801
  if (!empty($seopress_video[0][0]['url']) && $seopress_video_disabled =='') {
802
  //do nothing
803
  } else {
804
+ $seopress_social_og_author = '<meta property="article:author" content="'.esc_url($options['seopress_social_accounts_facebook']).'" />';
805
  $seopress_social_og_author .= "\n";
806
+ $seopress_social_og_author .= '<meta property="article:publisher" content="'.esc_url($options['seopress_social_accounts_facebook']).'" />';
807
  }
808
  }
809
  if (isset($seopress_social_og_author)) {
851
  if ( '' != get_post_meta($post_id,'_seopress_social_fb_desc',true) ) {
852
  $description = get_post_meta($post_id,'_seopress_social_fb_desc',true);
853
  }
854
+ $seopress_social_og_desc .= '<meta property="og:description" content="'.esc_html($description).'" />';
855
  $seopress_social_og_desc .= "\n";
856
  //Hook on post OG description - 'seopress_social_og_desc'
857
  if (has_filter('seopress_social_og_desc')) {
896
 
897
  //OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
898
  if (!empty($image_src)) {
899
+ $seopress_social_og_img .= '<meta property="og:image:width" content="'.esc_attr($image_src[1]).'" />';
900
  $seopress_social_og_img .= "\n";
901
+ $seopress_social_og_img .= '<meta property="og:image:height" content="'.esc_attr($image_src[2]).'" />';
902
  $seopress_social_og_img .= "\n";
903
  }
904
 
917
  }
918
  }
919
  if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id'])) {
920
+ $seopress_social_link_ownership_id = '<meta property="fb:pages" content="'.esc_attr($options['seopress_social_facebook_link_ownership_id']).'" />';
921
  echo $seopress_social_link_ownership_id."\n";
922
  }
923
  if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id']) ) {
924
+ $seopress_social_admin_id = '<meta property="fb:admins" content="'.esc_attr($options['seopress_social_facebook_admin_id']).'" />';
925
  echo $seopress_social_admin_id."\n";
926
  }
927
  if (isset($options['seopress_social_facebook_og']) && isset($options['seopress_social_facebook_link_ownership_id']) ) {
928
+ $seopress_social_app_id = '<meta property="fb:app_id" content="'.esc_attr($options['seopress_social_facebook_app_id']).'" />';
929
  echo $seopress_social_app_id."\n";
930
  }
931
  if (isset($options['seopress_social_twitter_card'])) {
932
+ if ( isset($options['seopress_social_twitter_card_img_size']) && $options['seopress_social_twitter_card_img_size'] =='large') {
933
  $seopress_social_twitter_card_summary = '<meta name="twitter:card" content="summary_large_image">';
934
  } else {
935
  $seopress_social_twitter_card_summary = '<meta name="twitter:card" content="summary" />';
941
  echo $seopress_social_twitter_card_summary."\n";
942
  }
943
  if (isset($options['seopress_social_twitter_card']) && isset($options['seopress_social_accounts_twitter']) ) {
944
+ $seopress_social_twitter_card_site = '<meta name="twitter:site" content="'.esc_attr($options['seopress_social_accounts_twitter']).'" />';
945
  //Hook on post Twitter card site - 'seopress_social_twitter_card_site'
946
  if (has_filter('seopress_social_twitter_card_site')) {
947
  $seopress_social_twitter_card_site = apply_filters('seopress_social_twitter_card_site', $seopress_social_twitter_card_site);
953
  $seopress_social_twitter_card_creator ='';
954
  if ($options['seopress_social_twitter_card'] =='1' && get_the_author_meta('twitter') ) {
955
 
956
+ $seopress_social_twitter_card_creator .= '<meta name="twitter:creator" content="@'.esc_attr(get_the_author_meta('twitter')).'" />';
957
 
958
+ } elseif ($options['seopress_social_twitter_card'] =='1' && isset($options['seopress_social_accounts_twitter']) && $options['seopress_social_accounts_twitter'] !='' ) {
959
+ $seopress_social_twitter_card_creator .= '<meta name="twitter:creator" content="'.esc_attr($options['seopress_social_accounts_twitter']).'" />';
960
  }
961
  //Hook on post Twitter card creator - 'seopress_social_twitter_card_creator'
962
  if (has_filter('seopress_social_twitter_card_creator')) {
967
  }
968
  }
969
  if (isset($options['seopress_social_twitter_card'])) {
970
+ $title = $seopress_social_twitter_card_title = '';
971
  $title = ampforwp_get_seopress_title();
972
  if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_title',true) ){
973
  $title = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_title',true);
997
  }
998
  }
999
  if (isset($options['seopress_social_twitter_card'])) {
1000
+ $seopress_social_twitter_card_desc = $description = '';
1001
  $description = ampforwp_generate_meta_desc();
1002
  if ( is_home() && '' != get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_desc',true) ) {
1003
  $description = get_post_meta(get_option( 'page_for_posts' ),'_seopress_social_twitter_desc',true);
1015
  }elseif ( '' != get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_desc',true) ) {
1016
  $description = get_post_meta(ampforwp_get_the_ID(),'_seopress_social_fb_desc',true);
1017
  }
1018
+ $seopress_social_twitter_card_desc .= '<meta name="twitter:description" content="'.esc_html($description).'" />';
1019
  //Hook on post Twitter card description - 'seopress_social_twitter_card_desc'
1020
  if (has_filter('seopress_social_twitter_card_desc')) {
1021
  $seopress_social_twitter_card_desc = apply_filters('seopress_social_twitter_card_desc', $seopress_social_twitter_card_desc);
1054
 
1055
  //OG:IMAGE
1056
  $seopress_twitter_img = '';
1057
+ $seopress_twitter_img .= '<meta property="twitter:image" content="'.esc_url($url).'" />';
1058
  $seopress_twitter_img .= "\n";
1059
 
1060
  //OG:IMAGE:SECURE_URL IF SSL
1061
  if (is_ssl()) {
1062
+ $seopress_twitter_img .= '<meta property="twitter:image:secure_url" content="'.esc_url($url).'" />';
1063
  $seopress_twitter_img .= "\n";
1064
  }
1065
 
1066
  //OG:IMAGE:WIDTH + OG:IMAGE:HEIGHT
1067
  if (!empty($image_src)) {
1068
+ $seopress_twitter_img .= '<meta property="twitter:image:width" content="'.esc_attr($image_src[1]).'" />';
1069
  $seopress_twitter_img .= "\n";
1070
+ $seopress_twitter_img .= '<meta property="twitter:image:height" content="'.esc_attr($image_src[2]).'" />';
1071
  $seopress_twitter_img .= "\n";
1072
  }
1073
 
includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php CHANGED
@@ -178,6 +178,7 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
178
  case 'class':
179
  case 'srcset':
180
  case 'sizes':
 
181
  case 'on':
182
  case 'role':
183
  case 'tabindex':
178
  case 'class':
179
  case 'srcset':
180
  case 'sizes':
181
+ case 'itemprop':
182
  case 'on':
183
  case 'role':
184
  case 'tabindex':
includes/vendor/amp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php CHANGED
@@ -213,6 +213,9 @@ class AMP_Tag_And_Attribute_Sanitizer extends AMP_Base_Sanitizer {
213
  $version
214
  );
215
  }
 
 
 
216
  return $scriptArray;
217
  }
218
 
213
  $version
214
  );
215
  }
216
+ if(count($scriptArray)>0){
217
+ remove_filter('the_content', 'wpautop');
218
+ }
219
  return $scriptArray;
220
  }
221
 
includes/vendor/amp/includes/utils/class-amp-image-dimension-extractor.php CHANGED
@@ -221,7 +221,17 @@ class AMP_Image_Dimension_Extractor {
221
  */
222
  private static function process_fetched_images( $urls_to_fetch, $images, &$dimensions, $transient_expiration ) {
223
  foreach ( $urls_to_fetch as $url_data ) {
 
 
224
  $image_data = $images[ $url_data['url'] ];
 
 
 
 
 
 
 
 
225
  if ( self::STATUS_IMAGE_EXTRACTION_FAILED === $image_data['size'] ) {
226
  $dimensions[ $url_data['url'] ] = false;
227
  set_transient( $url_data['transient_name'], self::STATUS_FAILED_LAST_ATTEMPT, $transient_expiration );
221
  */
222
  private static function process_fetched_images( $urls_to_fetch, $images, &$dimensions, $transient_expiration ) {
223
  foreach ( $urls_to_fetch as $url_data ) {
224
+ $image = array();
225
+ $attachment_id = '';
226
  $image_data = $images[ $url_data['url'] ];
227
+ // Fallback #2931
228
+ if ( self::STATUS_IMAGE_EXTRACTION_FAILED === $image_data['size'] ) {
229
+ $attachment_id = attachment_url_to_postid($url_data['url']);
230
+ $image = wp_get_attachment_image_src($attachment_id, 'full');
231
+ if ( $image ) {
232
+ $image_data['size'] = array($image[1],$image[2]);
233
+ }
234
+ }
235
  if ( self::STATUS_IMAGE_EXTRACTION_FAILED === $image_data['size'] ) {
236
  $dimensions[ $url_data['url'] ] = false;
237
  set_transient( $url_data['transient_name'], self::STATUS_FAILED_LAST_ATTEMPT, $transient_expiration );
includes/vendor/vendor-changelog.txt CHANGED
@@ -63,4 +63,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder
63
  36. Mobile detect library added from https://github.com/serbanghita/Mobile-Detect
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
 
63
  36. Mobile detect library added from https://github.com/serbanghita/Mobile-Detect
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
install/index.php CHANGED
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
28
  * @copyright Copyright (c) 2017, Merlin WP of Inventionn LLC
29
  * @license Licensed GPLv3 for open source use
30
  */
31
- $redux_builder_amp = get_option('redux_builder_amp');
32
  $ampLogo="";
33
  if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-media']['url']!=""){
34
  $ampLogo = '<br/><br/><img src="'.esc_url($redux_builder_amp['opt-media']['url']).'" class="amp_install_logo_preview" />';
@@ -61,7 +61,7 @@ if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-medi
61
  'title'=>esc_html__('Select Pages','accelerated-mobile-pages'),
62
  'description'=>esc_html__('Where you would like to enable AMP.','accelerated-mobile-pages'),
63
  'fields'=>'<li class="merlin__drawer--import-content__list-item status status--pending">
64
- <input type="checkbox" class="checkbox" name="amp-on-off-for-all-posts" id="amp-on-posts" '.($redux_builder_amp['amp-on-off-for-all-posts']? 'checked': '').'>
65
  <label for="amp-on-posts">
66
  <i></i><span>Posts</span></label>
67
  </li>
@@ -77,7 +77,7 @@ if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-medi
77
  </li>
78
 
79
  <li class="merlin__drawer--import-content__list-item status">
80
- <input type="checkbox" name="ampforwp-archive-support" class="checkbox" id="ampforwp-archive-support" value="1" '.($redux_builder_amp['ampforwp-archive-support']? 'checked': '').'>
81
  <label for="ampforwp-archive-support">
82
  <i></i><span>Category & Tags</span></label>
83
  </li>
@@ -89,7 +89,7 @@ if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-medi
89
  'description'=>esc_html__('Enter your Google Analytics Tracking code','accelerated-mobile-pages'),
90
  'fields'=>'<li class="amp_install_center">
91
  <input type="hidden" name="amp-analytics-select-option" value="1">
92
- <input type="text" name="ga-feild" id="ga-feild" value="'.($redux_builder_amp['ga-feild']? $redux_builder_amp['ga-feild'] : '').'">
93
  <label for="ga-feild"></label>
94
  </li>',
95
  ),
@@ -97,20 +97,19 @@ if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-medi
97
  'title'=>esc_html__('Select Design','accelerated-mobile-pages'),
98
  'description'=>'',
99
  'fields'=>'<li class="amp_install_center"><select name="amp-design-selector" id="ampforwp-design-select">
100
- <option value="1" '.($redux_builder_amp['amp-design-selector']==1? 'selected' : '').'>Design One</option>
101
- <option value="2" '.($redux_builder_amp['amp-design-selector']==2? 'selected' : '').'>Design Two</option>
102
- <option value="3" '.($redux_builder_amp['amp-design-selector']==3? 'selected' : '').'>Design Three</option>
103
- <option value="4" '.($redux_builder_amp['amp-design-selector']==4? 'selected' : '').'>Swift</option>
104
  </select>
105
 
106
  <div>
107
- <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png" width="150" height="200" class="amp_install_theme_preview" id="design-1" style="'.($redux_builder_amp['amp-design-selector']==1 ? '': 'display:none' ).'">
108
- <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png" width="150" height="200" class="amp_install_theme_preview" id="design-2" style="'.($redux_builder_amp['amp-design-selector']==2 ? '': 'display:none' ).'">
109
- <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-3.png" width="150" height="200" class="amp_install_theme_preview" id="design-3" style="'.($redux_builder_amp['amp-design-selector']==3 ? '': 'display:none' ).'">
110
- <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/swift.png" width="150" height="200" class="amp_install_theme_preview" id="design-4" style="'.($redux_builder_amp['amp-design-selector']==4 ? '': 'display:none' ).'">s
111
  </div>
112
- </li>
113
- ',
114
  ),
115
  6=>array(
116
  'title'=>esc_html__('Enjoy','accelerated-mobile-pages'),
28
  * @copyright Copyright (c) 2017, Merlin WP of Inventionn LLC
29
  * @license Licensed GPLv3 for open source use
30
  */
31
+ $redux_builder_amp = (array) get_option('redux_builder_amp');
32
  $ampLogo="";
33
  if(isset($redux_builder_amp['opt-media']['url']) && $redux_builder_amp['opt-media']['url']!=""){
34
  $ampLogo = '<br/><br/><img src="'.esc_url($redux_builder_amp['opt-media']['url']).'" class="amp_install_logo_preview" />';
61
  'title'=>esc_html__('Select Pages','accelerated-mobile-pages'),
62
  'description'=>esc_html__('Where you would like to enable AMP.','accelerated-mobile-pages'),
63
  'fields'=>'<li class="merlin__drawer--import-content__list-item status status--pending">
64
+ <input type="checkbox" class="checkbox" name="amp-on-off-for-all-posts" id="amp-on-posts" '.(ampforwp_get_setting('amp-on-off-for-all-posts')? 'checked': '').'>
65
  <label for="amp-on-posts">
66
  <i></i><span>Posts</span></label>
67
  </li>
77
  </li>
78
 
79
  <li class="merlin__drawer--import-content__list-item status">
80
+ <input type="checkbox" name="ampforwp-archive-support" class="checkbox" id="ampforwp-archive-support" value="1" '.(ampforwp_get_setting('ampforwp-archive-support')? 'checked': '').'>
81
  <label for="ampforwp-archive-support">
82
  <i></i><span>Category & Tags</span></label>
83
  </li>
89
  'description'=>esc_html__('Enter your Google Analytics Tracking code','accelerated-mobile-pages'),
90
  'fields'=>'<li class="amp_install_center">
91
  <input type="hidden" name="amp-analytics-select-option" value="1">
92
+ <input type="text" name="ga-feild" id="ga-feild" value="'.(ampforwp_get_setting('ga-feild')? $redux_builder_amp['ga-feild'] : '').'">
93
  <label for="ga-feild"></label>
94
  </li>',
95
  ),
97
  'title'=>esc_html__('Select Design','accelerated-mobile-pages'),
98
  'description'=>'',
99
  'fields'=>'<li class="amp_install_center"><select name="amp-design-selector" id="ampforwp-design-select">
100
+ <option value="1" '.(ampforwp_get_setting('amp-design-selector')==1? 'selected' : '').'>Design One</option>
101
+ <option value="2" '.(ampforwp_get_setting('amp-design-selector')==2? 'selected' : '').'>Design Two</option>
102
+ <option value="3" '.(ampforwp_get_setting('amp-design-selector')==3? 'selected' : '').'>Design Three</option>
103
+ <option value="4" '.(ampforwp_get_setting('amp-design-selector')==4? 'selected' : '').'>Swift</option>
104
  </select>
105
 
106
  <div>
107
+ <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-1.png" width="150" height="200" class="amp_install_theme_preview" id="design-1" style="'.(ampforwp_get_setting('amp-design-selector')==1 ? '': 'display:none' ).'">
108
+ <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-2.png" width="150" height="200" class="amp_install_theme_preview" id="design-2" style="'.(ampforwp_get_setting('amp-design-selector')==2 ? '': 'display:none' ).'">
109
+ <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/design-3.png" width="150" height="200" class="amp_install_theme_preview" id="design-3" style="'.(ampforwp_get_setting('amp-design-selector')==3 ? '': 'display:none' ).'">
110
+ <img src="'.AMPFORWP_PLUGIN_DIR_URI.'/images/swift.png" width="150" height="200" class="amp_install_theme_preview" id="design-4" style="'.(ampforwp_get_setting('amp-design-selector')==4 ? '': 'display:none' ).'">
111
  </div>
112
+ </li>',
 
113
  ),
114
  6=>array(
115
  'title'=>esc_html__('Enjoy','accelerated-mobile-pages'),
pagebuilder/functions.php CHANGED
@@ -129,16 +129,19 @@ function checkAMPforPageBuilderStatus($postId){
129
  $postId = ampforwp_get_frontpage_id();
130
  }
131
  if ( empty( $postId ) ) {
132
- return false;
133
- }
134
 
135
- $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
136
-
137
- if( $ampforwp_pagebuilder_enable=='yes'){
138
- return true;
139
- }else{
140
- return false;
 
 
141
  }
 
142
  }
143
 
144
  require_once AMP_PAGE_BUILDER.'inc/amppb_save_data.php';
129
  $postId = ampforwp_get_frontpage_id();
130
  }
131
  if ( empty( $postId ) ) {
132
+ $response = false;
133
+ }else{
134
 
135
+ $ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
136
+
137
+ if( $ampforwp_pagebuilder_enable=='yes'){
138
+ $response = true;
139
+ }else{
140
+ $response = false;
141
+ }
142
+ $response = apply_filters( 'ampforwp_pagebuilder_status_modify', $response, $postId );
143
  }
144
+ return $response;
145
  }
146
 
147
  require_once AMP_PAGE_BUILDER.'inc/amppb_save_data.php';
pagebuilder/inc/admin-amp-page-builder.css CHANGED
@@ -1212,7 +1212,7 @@ Layout css
1212
  /**** Font-Icons ****/
1213
  @font-face {
1214
  font-family: 'icomoon';
1215
- font-display: auto;
1216
  src:
1217
  url('../../templates/design-manager/swift/fonts/icomoon.ttf?wtrpmf') format('truetype'),
1218
  url('../../templates/design-manager/swift/fonts/icomoon.woff?wtrpmf') format('woff'),
1212
  /**** Font-Icons ****/
1213
  @font-face {
1214
  font-family: 'icomoon';
1215
+ font-display: swap;
1216
  src:
1217
  url('../../templates/design-manager/swift/fonts/icomoon.ttf?wtrpmf') format('truetype'),
1218
  url('../../templates/design-manager/swift/fonts/icomoon.woff?wtrpmf') format('woff'),
pagebuilder/modules/slider-mod-module.php CHANGED
@@ -16,7 +16,8 @@ $output = '
16
  {{repeater_button}}
17
  </div>
18
  {{ifend_condition_carousel_layout_type_2}}
19
- </div> ';
 
20
  $css = '
21
  {{if_condition_carousel_layout_type==1}}
22
  .amp-img{
16
  {{repeater_button}}
17
  </div>
18
  {{ifend_condition_carousel_layout_type_2}}
19
+ </div>
20
+ ';
21
  $css = '
22
  {{if_condition_carousel_layout_type==1}}
23
  .amp-img{
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.1
7
- Stable tag: 0.9.97.45
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -184,16 +184,22 @@ You can contact us from [here](https://ampforwp.com/contact/)
184
 
185
  == Changelog ==
186
 
187
- = 0.9.97.45 (4th April 2019) =
188
- * Added: SeoPress compatibility integrated #1589
189
- * Added: WP Appbox compatibility integrated #2791
190
- * Added: Infinite Scroll feature integrated. #2682
191
- * Added: Facebook like button added in Sticky Social Share #2186
192
- * Added: Font family for Content in Single page #2122
193
- * Fixed: Custom post type categories not showing in amp pagebuilder #1993
194
- * Fixed: Duplicate SiteNavigationElement issue #2952
195
- * Fixed: AMP Theme Framework Multisite issue #2936
196
- * Fixed: Custom AMP Editor Content is Not rendering when Elementor is activated #2901
197
- * Fixed: Title issue on Homepage with Yoast if we select custom front page #2962
 
 
 
 
 
 
198
 
199
  Full changelog available in 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.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
 
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
templates/design-manager/design-1/style.php CHANGED
@@ -20,28 +20,28 @@
20
  <?php if ( true == ampforwp_get_setting('ampforwp-d1-font') ): ?>
21
  @font-face {
22
  font-family: 'Merriweather';
23
- font-display: auto;
24
  font-style: normal;
25
  font-weight: 400;
26
  src: local('Merriweather'), local('Merriweather-Regular'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-Regular.ttf');
27
  }
28
  @font-face {
29
  font-family: 'Merriweather';
30
- font-display: auto;
31
  font-style: normal;
32
  font-weight: 700;
33
  src: local('Merriweather Bold'), local('Merriweather-Bold'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-Bold.ttf');
34
  }
35
  @font-face {
36
  font-family: 'Merriweather';
37
- font-display: auto;
38
  font-style: italic;
39
  font-weight: 400;
40
  src: local('Merriweather Italic'), local('Merriweather-Italic'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-Italic.ttf');
41
  }
42
  @font-face {
43
  font-family: 'Merriweather';
44
- font-display: auto;
45
  font-style: italic;
46
  font-weight: 700;
47
  src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-BoldItalic.ttf');
20
  <?php if ( true == ampforwp_get_setting('ampforwp-d1-font') ): ?>
21
  @font-face {
22
  font-family: 'Merriweather';
23
+ font-display: swap;
24
  font-style: normal;
25
  font-weight: 400;
26
  src: local('Merriweather'), local('Merriweather-Regular'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-Regular.ttf');
27
  }
28
  @font-face {
29
  font-family: 'Merriweather';
30
+ font-display: swap;
31
  font-style: normal;
32
  font-weight: 700;
33
  src: local('Merriweather Bold'), local('Merriweather-Bold'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-Bold.ttf');
34
  }
35
  @font-face {
36
  font-family: 'Merriweather';
37
+ font-display: swap;
38
  font-style: italic;
39
  font-weight: 400;
40
  src: local('Merriweather Italic'), local('Merriweather-Italic'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-Italic.ttf');
41
  }
42
  @font-face {
43
  font-family: 'Merriweather';
44
+ font-display: swap;
45
  font-style: italic;
46
  font-weight: 700;
47
  src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url('<?php echo esc_url(plugin_dir_url(__FILE__)) ?>fonts/Merriweather-BoldItalic.ttf');
templates/design-manager/design-3/style.php CHANGED
@@ -34,14 +34,14 @@ amp-wistia-player {margin:5px 0px;}
34
  .hide{display:none}
35
  @font-face {
36
  font-family: 'Roboto Slab';
37
- font-display: auto;
38
  font-style: normal;
39
  font-weight: 400;
40
  src: local('Roboto Slab Regular'), local('RobotoSlab-Regular'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/robotoslab/RobotoSlab-Regular.ttf'); ?>');
41
  }
42
  @font-face {
43
  font-family: 'Roboto Slab';
44
- font-display: auto;
45
  font-style: normal;
46
  font-weight: 700;
47
  src: local('Roboto Slab Bold'), local('RobotoSlab-Bold'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/robotoslab/RobotoSlab-Bold.ttf'); ?>');
@@ -49,14 +49,14 @@ amp-wistia-player {margin:5px 0px;}
49
 
50
  @font-face {
51
  font-family: 'PT Serif';
52
- font-display: auto;
53
  font-style: normal;
54
  font-weight: 400;
55
  src: local('PT Serif'), local('PTSerif-Regular'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/ptserif/PT_Serif-Web-Regular.ttf'); ?>');
56
  }
57
  @font-face {
58
  font-family: 'PT Serif';
59
- font-display: auto;
60
  font-style: normal;
61
  font-weight: 700;
62
  src: local('PT Serif Bold'), local('PTSerif-Bold'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/ptserif/PT_Serif-Web-Bold.ttf'); ?>');
@@ -500,7 +500,7 @@ amp-user-notification button { background-color: <?php echo ampforwp_sanitize_c
500
  .amp-wp-article-content img { max-width: 100%;}
501
  @font-face {
502
  font-family: 'icomoon';
503
- font-display: auto;
504
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__) .'fonts/icomoon.eot'); ?>');
505
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__) .'fonts/icomoon.eot'); ?>') format('embedded-opentype'),
506
  url('<?php echo esc_url(plugin_dir_url(__FILE__) .'fonts/icomoon.ttf'); ?>') format('truetype'),
34
  .hide{display:none}
35
  @font-face {
36
  font-family: 'Roboto Slab';
37
+ font-display: swap;
38
  font-style: normal;
39
  font-weight: 400;
40
  src: local('Roboto Slab Regular'), local('RobotoSlab-Regular'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/robotoslab/RobotoSlab-Regular.ttf'); ?>');
41
  }
42
  @font-face {
43
  font-family: 'Roboto Slab';
44
+ font-display: swap;
45
  font-style: normal;
46
  font-weight: 700;
47
  src: local('Roboto Slab Bold'), local('RobotoSlab-Bold'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/robotoslab/RobotoSlab-Bold.ttf'); ?>');
49
 
50
  @font-face {
51
  font-family: 'PT Serif';
52
+ font-display: swap;
53
  font-style: normal;
54
  font-weight: 400;
55
  src: local('PT Serif'), local('PTSerif-Regular'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/ptserif/PT_Serif-Web-Regular.ttf'); ?>');
56
  }
57
  @font-face {
58
  font-family: 'PT Serif';
59
+ font-display: swap;
60
  font-style: normal;
61
  font-weight: 700;
62
  src: local('PT Serif Bold'), local('PTSerif-Bold'), url('<?php echo esc_url(plugin_dir_url(__FILE__).'fonts/ptserif/PT_Serif-Web-Bold.ttf'); ?>');
500
  .amp-wp-article-content img { max-width: 100%;}
501
  @font-face {
502
  font-family: 'icomoon';
503
+ font-display: swap;
504
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__) .'fonts/icomoon.eot'); ?>');
505
  src: url('<?php echo esc_url(plugin_dir_url(__FILE__) .'fonts/icomoon.eot'); ?>') format('embedded-opentype'),
506
  url('<?php echo esc_url(plugin_dir_url(__FILE__) .'fonts/icomoon.ttf'); ?>') format('truetype'),
templates/design-manager/swift/style.php CHANGED
@@ -1,20 +1,25 @@
1
  <?php global $redux_builder_amp; ?>
2
  <?php if(!isset($redux_builder_amp['amp_font_selector']) || $redux_builder_amp['amp_font_selector'] == 1 || empty($redux_builder_amp['amp_font_selector'])){
3
  if(!ampforwp_levelup_compatibility('levelup_theme_and_elementor')){ // Level up Condition starts ?>
4
- @font-face {font-family: 'Poppins';font-display: auto;font-style: normal;font-weight: 300;src: local('Poppins Light'), local('Poppins-Light'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Light.ttf');}
5
- @font-face {font-family: 'Poppins';font-display: auto;font-style: normal;font-weight: 400;src: local('Poppins Regular'), local('Poppins-Regular'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Regular.ttf');}
6
- @font-face {font-family: 'Poppins';font-display: auto;font-style: normal;font-weight: 500;src: local('Poppins Medium'), local('Poppins-Medium'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Medium.ttf');}
7
- @font-face {font-family: 'Poppins';font-display: auto;font-style: normal;font-weight: 600;src: local('Poppins SemiBold'), local('Poppins-SemiBold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-SemiBold.ttf'); }
8
- @font-face {font-family: 'Poppins';font-display: auto;font-style: normal;font-weight: 700;src: local('Poppins Bold'), local('Poppins-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Bold.ttf'); }
9
  <?php } // Level up Condition ends
10
  } ?>
11
- body{<?php $fontFamily = "font-family: 'Poppins', sans-serif;";
12
  $hovercolor = '';
13
  $hovercolor = ampforwp_get_setting('swift-hover-color-scheme');
14
  $hovercolor = $hovercolor['color'];
15
- if(isset($redux_builder_amp['amp_font_selector']) && $redux_builder_amp['amp_font_selector'] != 1 && !empty($redux_builder_amp['amp_font_selector'])){
16
- $fontFamily = "font-family: '".$redux_builder_amp['amp_font_selector']."';"; }
17
- echo $fontFamily;?>
 
 
 
 
 
18
  <?php $swift_cs_color = '#005be2';
19
  $swift_cs = ampforwp_get_setting('swift-color-scheme');
20
  if( !empty($swift_cs['color']) ) {
@@ -55,7 +60,7 @@ amp-instagram{box-sizing: initial;}
55
  if( class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->db->is_built_with_elementor($post->ID) && (is_page() || ampforwp_is_front_page() ) ) {}
56
  else{ ?>.cntr {max-width: 1100px;margin: 0 auto;width:100%;padding:0px 20px} <?php } ?>
57
  <?php if(!ampforwp_levelup_compatibility('levelup_elementor') ){ // Level up Condition starts ?>
58
- @font-face {font-family: 'icomoon';font-display: auto;font-style: normal;font-weight: normal;src: local('icomoon'), local('icomoon'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.ttf');}
59
  header .cntr{
60
  <?php if( ampforwp_get_setting('swift-width-control') ){?>
61
  max-width:<?php echo esc_html(ampforwp_get_setting('swift-width-control'));?>;
@@ -280,7 +285,18 @@ if( ampforwp_is_home() || is_archive() || is_search() || (function_exists('is_sh
280
  .right a, .left a{background: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;padding: 8px 22px 12px 25px;color: #fff;line-height: 1;border-radius: 46px;font-size: 14px;display: inline-block;}
281
  .right a:after{content:"»";display: inline-block;padding-left: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: 1px;}
282
  .left a:before{content:"«";display: inline-block;padding-right: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: -1px;}
283
-
 
 
 
 
 
 
 
 
 
 
 
284
  @media(max-width:1110px){
285
  .amppb-fluid .col{max-width:95%}
286
  .sf-img .wp-caption-text{width:100%;padding:10px 40px;}
@@ -391,9 +407,9 @@ if( is_page() || ampforwp_is_front_page() || ampforwp_polylang_front_page() ){?>
391
  pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
392
  .cntn-wrp{
393
  <?php
394
- $fontFamily = "font-family: 'Arial, Helvetica, sans-serif'";
395
- if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
396
- $fontFamily = "font-family: 'Poppins', sans-serif;";
397
  if( ampforwp_get_setting('amp_font_selector_content_single') != 1 && !empty(ampforwp_get_setting('amp_font_selector_content_single')) ){
398
  $fontFamily = "font-family: '".esc_attr(ampforwp_get_setting('amp_font_selector_content_single'))."';";
399
  }
1
  <?php global $redux_builder_amp; ?>
2
  <?php if(!isset($redux_builder_amp['amp_font_selector']) || $redux_builder_amp['amp_font_selector'] == 1 || empty($redux_builder_amp['amp_font_selector'])){
3
  if(!ampforwp_levelup_compatibility('levelup_theme_and_elementor')){ // Level up Condition starts ?>
4
+ @font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 300;src: local('Poppins Light'), local('Poppins-Light'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Light.ttf');}
5
+ @font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 400;src: local('Poppins Regular'), local('Poppins-Regular'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Regular.ttf');}
6
+ @font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 500;src: local('Poppins Medium'), local('Poppins-Medium'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Medium.ttf');}
7
+ @font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 600;src: local('Poppins SemiBold'), local('Poppins-SemiBold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-SemiBold.ttf'); }
8
+ @font-face {font-family: 'Poppins';font-display: swap;font-style: normal;font-weight: 700;src: local('Poppins Bold'), local('Poppins-Bold'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/Poppins-Bold.ttf'); }
9
  <?php } // Level up Condition ends
10
  } ?>
11
+ body{<?php
12
  $hovercolor = '';
13
  $hovercolor = ampforwp_get_setting('swift-hover-color-scheme');
14
  $hovercolor = $hovercolor['color'];
15
+ $fontFamily = "font-family: 'Arial', 'Helvetica', 'sans-serif';";
16
+ if( !ampforwp_levelup_compatibility('levelup_theme') && 1==ampforwp_get_setting('ampforwp-google-font-switch') ){
17
+ $fontFamily = "font-family: 'Poppins', sans-serif;";
18
+ if(ampforwp_get_setting('amp_font_selector') != 1 && !empty($redux_builder_amp['amp_font_selector'])){
19
+ $fontFamily = "font-family: '".$redux_builder_amp['amp_font_selector']."';";
20
+ }
21
+ }
22
+ echo $fontFamily; ?>
23
  <?php $swift_cs_color = '#005be2';
24
  $swift_cs = ampforwp_get_setting('swift-color-scheme');
25
  if( !empty($swift_cs['color']) ) {
60
  if( class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->db->is_built_with_elementor($post->ID) && (is_page() || ampforwp_is_front_page() ) ) {}
61
  else{ ?>.cntr {max-width: 1100px;margin: 0 auto;width:100%;padding:0px 20px} <?php } ?>
62
  <?php if(!ampforwp_levelup_compatibility('levelup_elementor') ){ // Level up Condition starts ?>
63
+ @font-face {font-family: 'icomoon';font-display: swap;font-style: normal;font-weight: normal;src: local('icomoon'), local('icomoon'), url('<?php echo plugin_dir_url(__FILE__) ?>fonts/icomoon.ttf');}
64
  header .cntr{
65
  <?php if( ampforwp_get_setting('swift-width-control') ){?>
66
  max-width:<?php echo esc_html(ampforwp_get_setting('swift-width-control'));?>;
285
  .right a, .left a{background: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;padding: 8px 22px 12px 25px;color: #fff;line-height: 1;border-radius: 46px;font-size: 14px;display: inline-block;}
286
  .right a:after{content:"»";display: inline-block;padding-left: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: 1px;}
287
  .left a:before{content:"«";display: inline-block;padding-right: 6px;font-size: 20px;line-height: 20px;height: 20px;position: relative;top: -1px;}
288
+ .cntn-wrp.srch p { margin: 30px 0px 30px 0px; }
289
+ .cntn-wrp.srch{
290
+ font-size:18px;color:#000;line-height:1.7;word-wrap: break-word;
291
+ <?php
292
+ if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
293
+ if(ampforwp_get_setting('amp_font_selector_content_single') != 1 && !empty(ampforwp_get_setting('amp_font_selector_content_single')) ){
294
+ $fontFamily = "font-family: '".ampforwp_get_setting('amp_font_selector_content_single')."';";
295
+ }
296
+ }
297
+ echo $fontFamily;
298
+ ?>
299
+ }
300
  @media(max-width:1110px){
301
  .amppb-fluid .col{max-width:95%}
302
  .sf-img .wp-caption-text{width:100%;padding:10px 40px;}
407
  pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
408
  .cntn-wrp{
409
  <?php
410
+
411
+ if(1==ampforwp_get_setting('ampforwp-google-font-switch') && 1 == ampforwp_get_setting('content-font-family-enable')){
412
+
413
  if( ampforwp_get_setting('amp_font_selector_content_single') != 1 && !empty(ampforwp_get_setting('amp_font_selector_content_single')) ){
414
  $fontFamily = "font-family: '".esc_attr(ampforwp_get_setting('amp_font_selector_content_single'))."';";
415
  }
templates/features.php CHANGED
@@ -1286,11 +1286,13 @@ function ampforwp_new_dir( $dir ) {
1286
  <?php }
1287
 
1288
  // 10.8 Analytics Support added for Histats Analytics
1289
- if( true == ampforwp_get_setting('ampforwp-Histats-switch')) { ?>
 
 
1290
  <!-- BEGIN Histats CODE -->
1291
  <div id="histats">
1292
- <amp-pixel <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="//sstatic1.histats.com/0.gif?<?php echo esc_url(ampforwp_get_setting('histats-feild')); ?>&101" >
1293
- </amp-pixel>
1294
  </div>
1295
  <!--END Histats CODE -->
1296
  <?php }
@@ -1560,8 +1562,8 @@ function ampforwp_new_dir( $dir ) {
1560
  $structured_data_main_logo = '';
1561
  $ampforwp_sd_height = '';
1562
  $ampforwp_sd_width = '';
1563
- $ampforwp_sd_height = $redux_builder_amp['ampforwp-sd-logo-height'];
1564
- $ampforwp_sd_width = $redux_builder_amp['ampforwp-sd-logo-width'];
1565
  if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
1566
  $structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
1567
  }
@@ -1631,8 +1633,8 @@ function ampforwp_new_dir( $dir ) {
1631
  $structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
1632
  }
1633
  $structured_data_image = $structured_data_image_url;
1634
- $structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']);
1635
- $structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']);
1636
  $metadata['image'] = array(
1637
  '@type' => 'ImageObject',
1638
  'url' => $structured_data_image ,
@@ -1644,8 +1646,8 @@ function ampforwp_new_dir( $dir ) {
1644
  // Custom Structured Data information for Archive, Categories and tag pages.
1645
  if ( is_archive() ) {
1646
  $structured_data_image = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
1647
- $structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']);
1648
- $structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']);
1649
 
1650
  $structured_data_archive_title = "Archived Posts";
1651
  $structured_data_author = get_userdata( 1 );
@@ -2059,7 +2061,7 @@ function ampforwp_remove_schema_data() {
2059
  add_filter( 'do_rocket_lazyload', '__return_false' );
2060
 
2061
  // Remove Popups and other elements added by Slider-in Plugin
2062
- define('WDSI_BOX_RENDERED', true, true);
2063
 
2064
  // Remove Filters added by third party plugin through class
2065
  if ( function_exists('ampforwp_remove_filters_for_class')) {
@@ -2694,6 +2696,7 @@ function ampforwp_get_seopress_title(){
2694
  }
2695
  // Sanitize SEOPress Title #1589
2696
  function ampforwp_seopress_title_sanitize($title){
 
2697
  $seopress_titles_template_variables_array = array(
2698
  '%%sep%%',
2699
  '%%sitetitle%%',
@@ -2732,12 +2735,109 @@ function ampforwp_seopress_title_sanitize($title){
2732
  '%%currenttime%%',
2733
  );
2734
  $sep = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2735
  $seopress_titles_sep_option = get_option("seopress_titles_option_name");
2736
  if (isset($seopress_titles_sep_option['seopress_titles_sep']) ) {
2737
  $sep = $seopress_titles_sep_option['seopress_titles_sep'];
2738
  } else {
2739
  $sep = '-';
2740
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2741
  $seopress_titles_template_replace_array = array(
2742
  $sep,
2743
  get_bloginfo('name'),
@@ -3835,8 +3935,8 @@ function ampforwp_search_or_homepage_or_staticpage_metadata( $metadata, $post )
3835
  $structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
3836
  }
3837
  $structured_data_image = $structured_data_image_url; // Placeholder Image URL
3838
- $structured_data_height = intval($redux_builder_amp['amp-structured-data-placeholder-image-height']); // Placeholder Image width
3839
- $structured_data_width = intval($redux_builder_amp['amp-structured-data-placeholder-image-width']); // Placeholder Image height
3840
  $current_url_in_pieces = explode( '/', $current_url );
3841
  if( ampforwp_is_front_page() ) {
3842
  // ID of slected front page
@@ -5086,9 +5186,16 @@ function ampforwp_rel_canonical_home_archive(){
5086
  $remove = '';
5087
  $query_arg_array = '';
5088
  $page = '' ;
 
5089
 
5090
-
5091
- if ( is_home() || is_front_page() || is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
 
 
 
 
 
 
5092
  $current_archive_url = home_url( $wp->request );
5093
  $amp_url = trailingslashit($current_archive_url);
5094
  $remove = '/'. AMPFORWP_AMP_QUERY_VAR;
@@ -6109,7 +6216,7 @@ function ampforwp_minify_html_output($content_buffer){
6109
  $asis = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/(\s)+' . $mod), array('>', '<', '\\1'), $asis);
6110
  if ( $minify_html_comments != 'no' )
6111
  $asis = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $asis);
6112
- $asis = str_replace(array (chr(10), ' {', '{ ', ' }', '} ', '( ', ' )', ' :', ': ', ' ;', '; ', ' ,', ',', ';}'), array('', '{', '{', '}', '}', '(', ')', ':', ':', ';', ';', ',', ', ', '}'), $asis);
6113
  }
6114
  } else {
6115
  $process = $split[$i];
@@ -6437,7 +6544,7 @@ function ampforwp_url_purifier($url){
6437
  if ( true == $checker && false == strpos($url, $endpointq) )
6438
  $url = trailingslashit($url) . $endpointq;
6439
  else {
6440
- if ( false == strpos($url, $endpoint) )
6441
  $url = user_trailingslashit( trailingslashit($url) . $endpoint );
6442
  }
6443
  }
@@ -7074,7 +7181,7 @@ if ( ! function_exists( 'ampforwp_google_fonts_generator' ) ) {
7074
 
7075
  $font_output .= "@font-face { ";
7076
  $font_output .= "font-family: " . $redux_builder_amp['amp_font_selector']. ';' ;
7077
- $font_output .= "font-display: auto;";
7078
  $font_output .= "font-style: " . $font_style . ';';
7079
  $font_output .= "font-weight: " . $font_weight . ';' ;
7080
  $font_output .= "src: local('". $redux_builder_amp['amp_font_selector']." ".$font_local_weight." ".$font_local_type."'), local('". $redux_builder_amp['amp_font_selector']."-".$font_local_weight.$font_local_type."'), url(" .str_replace("http://", "https://", $font_data->files->$value) . ');' ;
@@ -8392,4 +8499,15 @@ function ampforwp_sd_sitenavigation(){
8392
  <?php }
8393
  }
8394
  }
8395
- }
 
 
 
 
 
 
 
 
 
 
 
1286
  <?php }
1287
 
1288
  // 10.8 Analytics Support added for Histats Analytics
1289
+ if( true == ampforwp_get_setting('ampforwp-Histats-switch')) {
1290
+ $url = add_query_arg(esc_attr(ampforwp_get_setting('histats-field')), '', '//sstatic1.histats.com/0.gif');
1291
+ $url = add_query_arg('101', '', $url); ?>
1292
  <!-- BEGIN Histats CODE -->
1293
  <div id="histats">
1294
+ <amp-pixel <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?> src="<?php echo esc_url_raw($url); ?>" >
1295
+ </amp-pixel>
1296
  </div>
1297
  <!--END Histats CODE -->
1298
  <?php }
1562
  $structured_data_main_logo = '';
1563
  $ampforwp_sd_height = '';
1564
  $ampforwp_sd_width = '';
1565
+ $ampforwp_sd_height = ampforwp_get_setting('ampforwp-sd-logo-height');
1566
+ $ampforwp_sd_width = ampforwp_get_setting('ampforwp-sd-logo-width');
1567
  if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
1568
  $structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
1569
  }
1633
  $structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
1634
  }
1635
  $structured_data_image = $structured_data_image_url;
1636
+ $structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height'));
1637
+ $structured_data_width = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-width'));
1638
  $metadata['image'] = array(
1639
  '@type' => 'ImageObject',
1640
  'url' => $structured_data_image ,
1646
  // Custom Structured Data information for Archive, Categories and tag pages.
1647
  if ( is_archive() ) {
1648
  $structured_data_image = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
1649
+ $structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height'));
1650
+ $structured_data_width = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-width'));
1651
 
1652
  $structured_data_archive_title = "Archived Posts";
1653
  $structured_data_author = get_userdata( 1 );
2061
  add_filter( 'do_rocket_lazyload', '__return_false' );
2062
 
2063
  // Remove Popups and other elements added by Slider-in Plugin
2064
+ define('WDSI_BOX_RENDERED', true, false); // when third argument is true, getting Deprecated debug warning in php 7.3.2
2065
 
2066
  // Remove Filters added by third party plugin through class
2067
  if ( function_exists('ampforwp_remove_filters_for_class')) {
2696
  }
2697
  // Sanitize SEOPress Title #1589
2698
  function ampforwp_seopress_title_sanitize($title){
2699
+ global $post;
2700
  $seopress_titles_template_variables_array = array(
2701
  '%%sep%%',
2702
  '%%sitetitle%%',
2735
  '%%currenttime%%',
2736
  );
2737
  $sep = '';
2738
+ $seopress_excerpt ='';
2739
+ $seopress_excerpt_length = 50;
2740
+ $seopress_excerpt_length = apply_filters('seopress_excerpt_length',$seopress_excerpt_length);
2741
+ if ($seopress_excerpt !='') {
2742
+ $seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes($seopress_excerpt)))), $seopress_excerpt_length);
2743
+ } elseif ($post !='') {
2744
+ if (get_post_field('post_content', $post->ID) !='') {
2745
+ $seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes(get_post_field('post_content', $post->ID))))), $seopress_excerpt_length);
2746
+ } else {
2747
+ $seopress_get_the_excerpt = null;
2748
+ }
2749
+ } else {
2750
+ $seopress_get_the_excerpt = null;
2751
+ }
2752
+ $seopress_paged = '';
2753
+ if (get_query_var('paged') >='1') {
2754
+ $seopress_paged = get_query_var('paged');
2755
+ }
2756
  $seopress_titles_sep_option = get_option("seopress_titles_option_name");
2757
  if (isset($seopress_titles_sep_option['seopress_titles_sep']) ) {
2758
  $sep = $seopress_titles_sep_option['seopress_titles_sep'];
2759
  } else {
2760
  $sep = '-';
2761
  }
2762
+ $the_author_meta ='';
2763
+ if(is_single() || is_author()){
2764
+ $the_author_meta = get_the_author_meta('display_name', $post->post_author);
2765
+ }
2766
+
2767
+ $post_category ='';
2768
+ if (is_single() && has_category()) {
2769
+ $post_category_array = get_the_terms(get_the_id(), 'category');
2770
+ $post_category = $post_category_array[0]->name;
2771
+ }
2772
+
2773
+ $post_tag ='';
2774
+ if (is_single() && has_tag()) {
2775
+ $post_tag_array = get_the_terms(get_the_id(), 'post_tag');
2776
+ $post_tag = $post_tag_array[0]->name;
2777
+ }
2778
+
2779
+ $get_search_query ='';
2780
+ if (get_search_query() !='') {
2781
+ $get_search_query = '"'.get_search_query().'"';
2782
+ }
2783
+
2784
+ $get_search_query = apply_filters('seopress_get_search_query', $get_search_query);
2785
+
2786
+ if ($seopress_excerpt !='') {
2787
+ $seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes($seopress_excerpt)))), $seopress_excerpt_length);
2788
+ } elseif ($post !='') {
2789
+ if (get_post_field('post_content', $post->ID) !='') {
2790
+ $seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes(get_post_field('post_content', $post->ID))))), $seopress_excerpt_length);
2791
+ } else {
2792
+ $seopress_get_the_excerpt = null;
2793
+ }
2794
+ } else {
2795
+ $seopress_get_the_excerpt = null;
2796
+ }
2797
+
2798
+ $woo_single_cat_html ='';
2799
+ $woo_single_tag_html ='';
2800
+ $woo_single_price ='';
2801
+ $woo_single_price_exc_tax ='';
2802
+ if ( class_exists('WooCommerce') ) {
2803
+ if (is_product()) {
2804
+ //Woo Cat product
2805
+ $woo_single_cats = get_the_terms( $post->ID, 'product_cat' );
2806
+
2807
+ if ( $woo_single_cats && ! is_wp_error( $woo_single_cats ) ) {
2808
+
2809
+ $woo_single_cat = array();
2810
+
2811
+ foreach ( $woo_single_cats as $term ) {
2812
+ $woo_single_cat[] = $term->name;
2813
+ }
2814
+
2815
+ $woo_single_cat_html = stripslashes_deep(wp_filter_nohtml_kses(join( ", ", $woo_single_cat )));
2816
+ }
2817
+
2818
+ //Woo Tag product
2819
+ $woo_single_tags = get_the_terms( $post->ID, 'product_tag' );
2820
+
2821
+ if ( $woo_single_tags && ! is_wp_error( $woo_single_tags ) ) {
2822
+
2823
+ $woo_single_tag = array();
2824
+
2825
+ foreach ( $woo_single_tags as $term ) {
2826
+ $woo_single_tag[] = $term->name;
2827
+ }
2828
+
2829
+ $woo_single_tag_html = stripslashes_deep(wp_filter_nohtml_kses(join( ", ", $woo_single_tag )));
2830
+ }
2831
+
2832
+ //Woo Price
2833
+ $product = wc_get_product($post->ID);
2834
+ $woo_single_price = wc_get_price_including_tax( $product );
2835
+
2836
+ //Woo Price tax excluded
2837
+ $product = wc_get_product($post->ID);
2838
+ $woo_single_price_exc_tax = wc_get_price_excluding_tax( $product );
2839
+ }
2840
+ }
2841
  $seopress_titles_template_replace_array = array(
2842
  $sep,
2843
  get_bloginfo('name'),
3935
  $structured_data_image_url = $redux_builder_amp['amp-structured-data-placeholder-image']['url'];
3936
  }
3937
  $structured_data_image = $structured_data_image_url; // Placeholder Image URL
3938
+ $structured_data_height = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-height')); // Placeholder Image width
3939
+ $structured_data_width = intval(ampforwp_get_setting('amp-structured-data-placeholder-image-width')); // Placeholder Image height
3940
  $current_url_in_pieces = explode( '/', $current_url );
3941
  if( ampforwp_is_front_page() ) {
3942
  // ID of slected front page
5186
  $remove = '';
5187
  $query_arg_array = '';
5188
  $page = '' ;
5189
+ $show_canonical = true ;
5190
 
5191
+ // RankMath canonical copatibility #2975
5192
+ if ( defined('RANK_MATH_FILE') ) {
5193
+ $show_canonical = false;
5194
+ if( $_SERVER['SERVER_NAME'] === '127.0.0.1' || $_SERVER['SERVER_NAME'] === 'localhost' ) {
5195
+ $show_canonical = true;
5196
+ }
5197
+ }
5198
+ if ( (is_home() || is_front_page() || (is_archive() && $redux_builder_amp['ampforwp-archive-support']) ) && $show_canonical ) {
5199
  $current_archive_url = home_url( $wp->request );
5200
  $amp_url = trailingslashit($current_archive_url);
5201
  $remove = '/'. AMPFORWP_AMP_QUERY_VAR;
6216
  $asis = preg_replace(array ('/\>[^\S ]+' . $mod, '/[^\S ]+\<' . $mod, '/(\s)+' . $mod), array('>', '<', '\\1'), $asis);
6217
  if ( $minify_html_comments != 'no' )
6218
  $asis = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $asis);
6219
+ $asis = str_replace(array (chr(10), ' {', '{ ', ' }', '} ', '( ', ' )', ' :', ': ', ' ;', '; ', ' ,', ',', ';}', '::-' ), array('', '{', '{', '}', '}', '(', ')', ':', ':', ';', ';', ',', ', ', '}', ' ::-'), $asis);
6220
  }
6221
  } else {
6222
  $process = $split[$i];
6544
  if ( true == $checker && false == strpos($url, $endpointq) )
6545
  $url = trailingslashit($url) . $endpointq;
6546
  else {
6547
+ if ( false == strpos($url, '/'.$endpoint) )
6548
  $url = user_trailingslashit( trailingslashit($url) . $endpoint );
6549
  }
6550
  }
7181
 
7182
  $font_output .= "@font-face { ";
7183
  $font_output .= "font-family: " . $redux_builder_amp['amp_font_selector']. ';' ;
7184
+ $font_output .= "font-display: swap;";
7185
  $font_output .= "font-style: " . $font_style . ';';
7186
  $font_output .= "font-weight: " . $font_weight . ';' ;
7187
  $font_output .= "src: local('". $redux_builder_amp['amp_font_selector']." ".$font_local_weight." ".$font_local_type."'), local('". $redux_builder_amp['amp_font_selector']."-".$font_local_weight.$font_local_type."'), url(" .str_replace("http://", "https://", $font_data->files->$value) . ');' ;
8499
  <?php }
8500
  }
8501
  }
8502
+ }
8503
+
8504
+ // WP Subtitle Support #2831
8505
+ add_action('ampforwp_below_the_title','ampforwp_wpsubtitle_support');
8506
+ if (! function_exists('ampforwp_wpsubtitle_support') ) {
8507
+ function ampforwp_wpsubtitle_support(){
8508
+ if(class_exists('WPSubtitle')){?>
8509
+ <h4 class="amp-wp-content"><?php the_subtitle(); ?></h4>
8510
+ <?php
8511
+ }
8512
+ }
8513
+ }
templates/structured-data.php CHANGED
@@ -14,9 +14,9 @@ function ampforwp_structured_data_type( $metadata ) {
14
  $set_sd_post = '';
15
  $set_sd_page = '';
16
 
17
- $set_sd_post = $redux_builder_amp['ampforwp-sd-type-posts'];
18
- $set_sd_page = $redux_builder_amp['ampforwp-sd-type-pages'];
19
- $post_types = ampforwp_get_all_post_types();
20
 
21
  if ( $post_types ) { // If there are any custom public post types.
22
  foreach ( $post_types as $post_type ) {
14
  $set_sd_post = '';
15
  $set_sd_page = '';
16
 
17
+ $set_sd_post = ampforwp_get_setting('ampforwp-sd-type-posts');
18
+ $set_sd_page = ampforwp_get_setting('ampforwp-sd-type-pages');
19
+ $post_types = ampforwp_get_all_post_types();
20
 
21
  if ( $post_types ) { // If there are any custom public post types.
22
  foreach ( $post_types as $post_type ) {