AMP for WP – Accelerated Mobile Pages - Version 1.0.76.3

Version Description

(19th February 2021) = * Improvement: Added the Smart Mag Theme review schema #4898 * Improvement: Added disable right click for copy protection #4877 * Improvement: Added an option to hide the title on pages #4929 * Fixed: AMP Browser caching policy #4876 * Fixed: p tags getting stripped with Change Pagination Links to /amp option #4892 * Fixed: Missing URL for attribute error for SVG images #4911 * Fixed: Debug warnings #4924

Download this release

Release Info

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

Code changes from version 1.0.76.2 to 1.0.76.3

README.md CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.6
7
- Stable tag: 1.0.76.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -193,6 +193,15 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
 
 
 
196
  = 1.0.76.2 (17th February 2021) =
197
  * Fixed: Removed The SEO Checklist Banner #4912
198
 
@@ -202,25 +211,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
202
  * Fixed: Fatal error on bbpress profile page #4922
203
  * Fixed: Comments not showing on AMP front page #4921
204
 
205
- = 1.0.76 (9th February 2021) =
206
- * Improvement: The SEO Checklist Banner #4912
207
- * Fixed: Telegram icon not visible in menu #4919
208
- * Fixed: Validation error in amp-img with transposh plugin #4918
209
- * Fixed: Fatal error when FIFU plugin is activate #4920
210
- * Fixed: AMP admin option panel is showing blank on user end #4914
211
- * Fixed: Tag base remove in AMP not working after 1.0.60 #4908
212
- * Fixed: data-playlist gets removed automatically in amp-brid-player #4906
213
- * Fixed: View Non-Amp Version link does not link to proper canonical url #4901
214
- * Fixed: Srcset not loading in category module of AMP page builder #4900
215
- * Fixed: Debug warnings #4917
216
-
217
- = 1.0.75 (23rd January 2021) =
218
- * Fixed: Imgur embed code not working in AMP #4899
219
- * Fixed: Srcset not loading in category module of AMP page builder #4900
220
- * Fixed: Advertising section displaying blank when AdsforWP plugin is active #4889
221
- * Fixed: AMP Page Builder not working on the pages and posts except the homepage #4890
222
- * Fixed: Swift 2nd header menu aligned towards right with polylang plugin #4893
223
- * Fixed: Post Pagination not working after 1.0.69 version #4902
224
- * Fixed: Debug warnings #4896
225
-
226
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.6
7
+ Stable tag: 1.0.76.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
193
 
194
  == Changelog ==
195
 
196
+ = 1.0.76.3 (19th February 2021) =
197
+ * Improvement: Added the Smart Mag Theme review schema #4898
198
+ * Improvement: Added disable right click for copy protection #4877
199
+ * Improvement: Added an option to hide the title on pages #4929
200
+ * Fixed: AMP Browser caching policy #4876
201
+ * Fixed: p tags getting stripped with Change Pagination Links to /amp option #4892
202
+ * Fixed: Missing URL for attribute error for SVG images #4911
203
+ * Fixed: Debug warnings #4924
204
+
205
  = 1.0.76.2 (17th February 2021) =
206
  * Fixed: Removed The SEO Checklist Banner #4912
207
 
211
  * Fixed: Fatal error on bbpress profile page #4922
212
  * Fixed: Comments not showing on AMP front page #4921
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
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: 1.0.76.2
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
- define('AMPFORWP_VERSION','1.0.76.2');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
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: 1.0.76.3
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','1.0.76.3');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
changelog.txt CHANGED
@@ -1,5 +1,14 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
3
  = 1.0.76.2 (17th February 2021) =
4
  * Fixed: Removed The SEO Checklist Banner #4912
5
 
1
  == Changelog ==
2
 
3
+ = 1.0.76.3 (19th February 2021) =
4
+ * Improvement: Added the Smart Mag Theme review schema #4898
5
+ * Improvement: Added disable right click for copy protection #4877
6
+ * Improvement: Added an option to hide the title on pages #4929
7
+ * Fixed: AMP Browser caching policy #4876
8
+ * Fixed: p tags getting stripped with Change Pagination Links to /amp option #4892
9
+ * Fixed: Missing URL for attribute error for SVG images #4911
10
+ * Fixed: Debug warnings #4924
11
+
12
  = 1.0.76.2 (17th February 2021) =
13
  * Fixed: Removed The SEO Checklist Banner #4912
14
 
components/components-core.php CHANGED
@@ -366,13 +366,10 @@ function amp_header_core(){
366
  if( true == ampforwp_get_setting('amp-rtl-select-option') ){
367
  $bodyClass .= ' rtl ';
368
  }
369
- $lightbox = $right_click = '';
370
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
371
  $lightbox = 'data-amp-auto-lightbox-disable';
372
  }
373
- if( true == ampforwp_get_setting('ampforwp-right-click-disable') ){
374
- $right_click = 'oncontextmenu="return false"';
375
- }
376
  ?><!doctype html>
377
  <html <?php echo esc_attr(ampforwp_amp_nonamp_convert('amp ')); ?><?php echo AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) ); ?>>
378
  <head>
@@ -402,7 +399,7 @@ function amp_header_core(){
402
  </style>
403
  <?php do_action('ampforwp_before_head', $thisTemplate); ?>
404
  </head>
405
- <body <?php echo sanitize_text_field($right_click); ?><?php echo esc_attr($lightbox); ?> <?php ampforwp_body_class($bodyClass); ?>>
406
  <?php do_action('amp_start', $thisTemplate); ?>
407
  <?php do_action('ampforwp_admin_menu_bar_front'); ?>
408
  <?php do_action('ampforwp_body_beginning', $thisTemplate);
@@ -734,7 +731,23 @@ function ampforwp_backtotop_global_css(){?>
734
  .wp-pagenavi a.last , .amp-archive a.first {
735
  margin-left: 10px;
736
  }
737
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
  <?php if (class_exists('UAGB_Admin')) {?>
739
  .wp-block-uagb-faq svg {display: none;}
740
  <?php } ?>
366
  if( true == ampforwp_get_setting('amp-rtl-select-option') ){
367
  $bodyClass .= ' rtl ';
368
  }
369
+ $lightbox = '';
370
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
371
  $lightbox = 'data-amp-auto-lightbox-disable';
372
  }
 
 
 
373
  ?><!doctype html>
374
  <html <?php echo esc_attr(ampforwp_amp_nonamp_convert('amp ')); ?><?php echo AMP_HTML_Utils::build_attributes_string( $thisTemplate->get( 'html_tag_attributes' ) ); ?>>
375
  <head>
399
  </style>
400
  <?php do_action('ampforwp_before_head', $thisTemplate); ?>
401
  </head>
402
+ <body <?php echo esc_attr($lightbox); ?> <?php ampforwp_body_class($bodyClass); ?>>
403
  <?php do_action('amp_start', $thisTemplate); ?>
404
  <?php do_action('ampforwp_admin_menu_bar_front'); ?>
405
  <?php do_action('ampforwp_body_beginning', $thisTemplate);
731
  .wp-pagenavi a.last , .amp-archive a.first {
732
  margin-left: 10px;
733
  }
734
+ <?php } ?>
735
+ <?php if (true == ampforwp_get_setting('ampforwp-right-click-disable')) {?>
736
+ .*{
737
+ -moz-user-select:none;
738
+ -webkit-user-select:none;
739
+ cursor: default;
740
+ }
741
+ html{
742
+ -webkit-touch-callout: none;
743
+ -webkit-user-select: none;
744
+ -khtml-user-select: none;
745
+ -moz-user-select: none;
746
+ -ms-user-select: none;
747
+ user-select: none;
748
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
749
+ }
750
+ <?php } ?>
751
  <?php if (class_exists('UAGB_Admin')) {?>
752
  .wp-block-uagb-faq svg {display: none;}
753
  <?php } ?>
includes/features/performance/performance-functions.php CHANGED
@@ -251,13 +251,11 @@ function ampforwp_code_to_add_in_htaccess(){
251
  $htaccess_cntn .= 'ExpiresByType image/x-icon "access 1 year"' . "\n";
252
  $htaccess_cntn .= 'ExpiresByType text/css "access '.esc_html($expires).'"' . "\n";
253
  $htaccess_cntn .= 'ExpiresByType text/javascript "access '.esc_html($expires).'"' . "\n";
254
- $htaccess_cntn .= 'ExpiresByType text/html "access '.esc_html($expires).'"' . "\n";
255
  $htaccess_cntn .= 'ExpiresByType application/javascript "access '.esc_html($expires).'"' . "\n";
256
  $htaccess_cntn .= 'ExpiresByType application/x-javascript "access '.esc_html($expires).'"' . "\n";
257
  $htaccess_cntn .= 'ExpiresByType application/xhtml-xml "access '.esc_html($expires).'"' . "\n";
258
  $htaccess_cntn .= 'ExpiresByType application/pdf "access '.esc_html($expires).'"' . "\n";
259
  $htaccess_cntn .= 'ExpiresByType application/x-shockwave-flash "access '.esc_html($expires).'"' . "\n";
260
- $htaccess_cntn .= 'ExpiresDefault "access '.esc_html($expires).'"' . "\n";
261
  $htaccess_cntn .= '</IfModule>' . "\n";
262
  $htaccess_cntn .= '# END Caching AMPFORWPLBROWSERCEND' . "\n";
263
  return $htaccess_cntn;
251
  $htaccess_cntn .= 'ExpiresByType image/x-icon "access 1 year"' . "\n";
252
  $htaccess_cntn .= 'ExpiresByType text/css "access '.esc_html($expires).'"' . "\n";
253
  $htaccess_cntn .= 'ExpiresByType text/javascript "access '.esc_html($expires).'"' . "\n";
 
254
  $htaccess_cntn .= 'ExpiresByType application/javascript "access '.esc_html($expires).'"' . "\n";
255
  $htaccess_cntn .= 'ExpiresByType application/x-javascript "access '.esc_html($expires).'"' . "\n";
256
  $htaccess_cntn .= 'ExpiresByType application/xhtml-xml "access '.esc_html($expires).'"' . "\n";
257
  $htaccess_cntn .= 'ExpiresByType application/pdf "access '.esc_html($expires).'"' . "\n";
258
  $htaccess_cntn .= 'ExpiresByType application/x-shockwave-flash "access '.esc_html($expires).'"' . "\n";
 
259
  $htaccess_cntn .= '</IfModule>' . "\n";
260
  $htaccess_cntn .= '# END Caching AMPFORWPLBROWSERCEND' . "\n";
261
  return $htaccess_cntn;
includes/features/structure-data/structured-data-functions.php CHANGED
@@ -412,6 +412,86 @@ if ( ! function_exists('ampforwp_sd_multiple_images') ) {
412
  // schema.org/SiteNavigationElement missing from menus #1229 & #2952
413
  add_action('amp_post_template_footer','ampforwp_sd_sitenavigation');
414
  function ampforwp_sd_sitenavigation(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  if ( ! class_exists('saswp_fields_generator') ) {
416
  $input = array();
417
  $navObj = array();
412
  // schema.org/SiteNavigationElement missing from menus #1229 & #2952
413
  add_action('amp_post_template_footer','ampforwp_sd_sitenavigation');
414
  function ampforwp_sd_sitenavigation(){
415
+ if (class_exists('Bunyad_Theme_SmartMag')) {
416
+ if (!is_single() || !Bunyad::posts()->meta('reviews')) {
417
+ return;
418
+ }
419
+ $schema_type = Bunyad::posts()->meta('review_schema') ? Bunyad::posts()->meta('review_schema') : 'Product';
420
+ $item_author = Bunyad::posts()->meta('review_item_author') ? Bunyad::posts()->meta('review_item_author') : get_the_author();
421
+ $item_name = Bunyad::posts()->meta('review_item_name') ? Bunyad::posts()->meta('review_item_name') : get_the_title();
422
+ $item_author_type = Bunyad::posts()->meta('review_item_author_type');
423
+ $image_url = ampforwp_get_post_thumbnail('url','full');
424
+ $image_width = ampforwp_get_post_thumbnail('width');
425
+ $image_height = ampforwp_get_post_thumbnail('height');
426
+ $post_image_meta = false;
427
+ if (!empty($image_url)) {
428
+ $post_image_meta = array(
429
+ '@type' => 'ImageObject',
430
+ 'url' => $image_url,
431
+ 'width' => $image_width,
432
+ 'height' => $image_height,
433
+ );
434
+ }
435
+ $publisher = array(
436
+ '@type' => 'Organization',
437
+ 'name' => get_bloginfo('name'),
438
+ 'sameAs' => get_bloginfo('url')
439
+ );
440
+ $description = (
441
+ Bunyad::posts()->meta('review_verdict_text')
442
+ ? Bunyad::posts()->meta('review_verdict_text')
443
+ : strip_tags(Bunyad::posts()->excerpt(null, 180, ['add_more' => false]))
444
+ );
445
+ $author_data = [
446
+ '@type' => $item_author_type ? ucfirst($item_author_type) : 'Person',
447
+ 'name' => $item_author
448
+ ];
449
+ $have_author = [
450
+ 'CreativeWorkSeason', 'CreativeWorkSeries', 'Game', 'MediaObject', 'MusicPlaylist', 'MusicRecording'
451
+ ];
452
+ // Final schema.
453
+ $schema = array(
454
+ '@context' => 'http://schema.org',
455
+ '@type' => 'Review',
456
+
457
+ 'itemReviewed' => array(
458
+ '@type' => $schema_type,
459
+ 'name' => $item_name,
460
+ 'image' => $post_image_meta,
461
+ ),
462
+ 'author' => array(
463
+ '@type' => 'Person',
464
+ 'name' => get_the_author(),
465
+ ),
466
+ 'publisher' => $publisher,
467
+ 'reviewRating' => array(
468
+ '@type' => 'Rating',
469
+ 'ratingValue' => Bunyad::posts()->meta('review_overall'),
470
+ 'bestRating' => Bunyad::options()->review_scale,
471
+ ),
472
+ 'description' => substr($description, 0, 200),
473
+ 'datePublished' => get_the_date(DATE_W3C),
474
+ );
475
+ if ($link = Bunyad::posts()->meta('review_item_link')) {
476
+ $schema['itemReviewed']['sameAs'] = esc_url($link);
477
+ }
478
+ $schema_id = esc_url(get_permalink()) . '#review';
479
+ $schema['@id'] = $schema_id;
480
+ $schema['itemReviewed']['review'] = ['@id' => $schema_id];
481
+ if (in_array($schema_type, $have_author)) {
482
+ $schema['itemReviewed']['author'] = $author_data;
483
+ }
484
+ if ($schema_type == 'Product' ) {
485
+ if (Bunyad::posts()->meta('review_item_author')) {
486
+ $author_data['@type'] = 'Brand';
487
+ $schema['itemReviewed']['brand'] = $author_data;
488
+ }
489
+ $schema['itemReviewed']['description'] = $description;
490
+ }else{
491
+ return;
492
+ }
493
+ echo '<script type="application/ld+json">' . json_encode($schema) . "</script>";
494
+ }
495
  if ( ! class_exists('saswp_fields_generator') ) {
496
  $input = array();
497
  $navObj = array();
includes/options/admin-config.php CHANGED
@@ -7270,7 +7270,14 @@ else{
7270
  'layout_type' => 'accordion',
7271
  'accordion-open'=> 1,
7272
  ),
7273
-
 
 
 
 
 
 
 
7274
  // Meta ON/OFF Pages
7275
  array(
7276
  'id' => 'featured_image_swift_page',
7270
  'layout_type' => 'accordion',
7271
  'accordion-open'=> 1,
7272
  ),
7273
+ array(
7274
+ 'id' => 'ampforwp_pages_title',
7275
+ 'type' => 'switch',
7276
+ 'default' => '1',
7277
+ 'title' => esc_html__('Title', 'accelerated-mobile-pages'),
7278
+ 'tooltip-subtitle' => esc_html__('Enable Title on Pages.','accelerated-mobile-pages'),
7279
+ 'required' => array('amp-design-selector','=','4'),
7280
+ ),
7281
  // Meta ON/OFF Pages
7282
  array(
7283
  'id' => 'featured_image_swift_page',
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.6
7
- Stable tag: 1.0.76.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,6 +190,15 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
 
 
 
 
 
 
 
 
 
193
  = 1.0.76.2 (17th February 2021) =
194
  * Fixed: Removed The SEO Checklist Banner #4912
195
 
@@ -199,25 +208,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
199
  * Fixed: Fatal error on bbpress profile page #4922
200
  * Fixed: Comments not showing on AMP front page #4921
201
 
202
- = 1.0.76 (9th February 2021) =
203
- * Improvement: The SEO Checklist Banner #4912
204
- * Fixed: Telegram icon not visible in menu #4919
205
- * Fixed: Validation error in amp-img with transposh plugin #4918
206
- * Fixed: Fatal error when FIFU plugin is activate #4920
207
- * Fixed: AMP admin option panel is showing blank on user end #4914
208
- * Fixed: Tag base remove in AMP not working after 1.0.60 #4908
209
- * Fixed: data-playlist gets removed automatically in amp-brid-player #4906
210
- * Fixed: View Non-Amp Version link does not link to proper canonical url #4901
211
- * Fixed: Srcset not loading in category module of AMP page builder #4900
212
- * Fixed: Debug warnings #4917
213
-
214
- = 1.0.75 (23rd January 2021) =
215
- * Fixed: Imgur embed code not working in AMP #4899
216
- * Fixed: Srcset not loading in category module of AMP page builder #4900
217
- * Fixed: Advertising section displaying blank when AdsforWP plugin is active #4889
218
- * Fixed: AMP Page Builder not working on the pages and posts except the homepage #4890
219
- * Fixed: Swift 2nd header menu aligned towards right with polylang plugin #4893
220
- * Fixed: Post Pagination not working after 1.0.69 version #4902
221
- * Fixed: Debug warnings #4896
222
-
223
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.6
7
+ Stable tag: 1.0.76.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 1.0.76.3 (19th February 2021) =
194
+ * Improvement: Added the Smart Mag Theme review schema #4898
195
+ * Improvement: Added disable right click for copy protection #4877
196
+ * Improvement: Added an option to hide the title on pages #4929
197
+ * Fixed: AMP Browser caching policy #4876
198
+ * Fixed: p tags getting stripped with Change Pagination Links to /amp option #4892
199
+ * Fixed: Missing URL for attribute error for SVG images #4911
200
+ * Fixed: Debug warnings #4924
201
+
202
  = 1.0.76.2 (17th February 2021) =
203
  * Fixed: Removed The SEO Checklist Banner #4912
204
 
208
  * Fixed: Fatal error on bbpress profile page #4922
209
  * Fixed: Comments not showing on AMP front page #4921
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/design-manager/design-1/single.php CHANGED
@@ -16,14 +16,11 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  </style>
17
  </head>
18
  <?php
19
- $lightbox = $right_click = '';
20
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
21
  $lightbox = 'data-amp-auto-lightbox-disable ';
22
- }
23
- if( true == ampforwp_get_setting('ampforwp-right-click-disable') ){
24
- $right_click = 'oncontextmenu="return false"';
25
- }?>
26
- <body <?php echo sanitize_text_field($right_click); ?> <?php echo esc_attr($lightbox); ?><?php ampforwp_body_class('single-post design_1_wrapper');?>>
27
  <?php do_action('ampforwp_body_beginning', $this); ?>
28
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
29
  <?php do_action( 'below_the_header_design_1', $this ); ?>
16
  </style>
17
  </head>
18
  <?php
19
+ $lightbox = '';
20
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
21
  $lightbox = 'data-amp-auto-lightbox-disable ';
22
+ }?>
23
+ <body <?php echo esc_attr($lightbox); ?><?php ampforwp_body_class('single-post design_1_wrapper');?>>
 
 
 
24
  <?php do_action('ampforwp_body_beginning', $this); ?>
25
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
26
  <?php do_action( 'below_the_header_design_1', $this ); ?>
templates/design-manager/design-2/single.php CHANGED
@@ -17,14 +17,11 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  </style>
18
  </head>
19
  <?php
20
- $lightbox = $right_click = '';
21
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
22
  $lightbox = 'data-amp-auto-lightbox-disable ';
23
- }
24
- if( true == ampforwp_get_setting('ampforwp-right-click-disable') ){
25
- $right_click = 'oncontextmenu="return false"';
26
- }?>
27
- <body <?php echo sanitize_text_field($right_click); ?> <?php echo esc_attr($lightbox); ?><?php ampforwp_body_class('single-post design_2_wrapper');?> >
28
  <?php do_action('ampforwp_body_beginning', $this); ?>
29
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
30
 
17
  </style>
18
  </head>
19
  <?php
20
+ $lightbox = '';
21
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
22
  $lightbox = 'data-amp-auto-lightbox-disable ';
23
+ }?>
24
+ <body <?php echo esc_attr($lightbox); ?><?php ampforwp_body_class('single-post design_2_wrapper');?> >
 
 
 
25
  <?php do_action('ampforwp_body_beginning', $this); ?>
26
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
27
 
templates/design-manager/design-3/single.php CHANGED
@@ -17,14 +17,11 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  </style>
18
  </head>
19
  <?php
20
- $lightbox = $right_click = '';
21
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
22
  $lightbox = 'data-amp-auto-lightbox-disable ';
23
- }
24
- if( true == ampforwp_get_setting('ampforwp-right-click-disable') ){
25
- $right_click = 'oncontextmenu="return false"';
26
- }?>
27
- <body <?php echo sanitize_text_field($right_click); ?><?php echo esc_attr($lightbox); ?><?php ampforwp_body_class('design_3_wrapper');?> >
28
  <?php do_action('ampforwp_body_beginning', $this); ?>
29
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
30
 
17
  </style>
18
  </head>
19
  <?php
20
+ $lightbox = '';
21
  if( false == ampforwp_get_setting('ampforwp-amp-img-lightbox') ){
22
  $lightbox = 'data-amp-auto-lightbox-disable ';
23
+ }?>
24
+ <body <?php echo esc_attr($lightbox); ?><?php ampforwp_body_class('design_3_wrapper');?> >
 
 
 
25
  <?php do_action('ampforwp_body_beginning', $this); ?>
26
  <?php $this->load_parts( array( 'header-bar' ) ); ?>
27
 
templates/design-manager/swift/page.php CHANGED
@@ -11,7 +11,9 @@ amp_header(); ?>
11
  <?php if ( is_page() && true == ampforwp_get_setting('ampforwp_pages_breadcrumbs') ) {
12
  amp_breadcrumb();
13
  }?>
14
- <?php amp_title(); ?>
 
 
15
  <?php } ?>
16
  <?php } // Level up Condition ends here?>
17
  </div>
11
  <?php if ( is_page() && true == ampforwp_get_setting('ampforwp_pages_breadcrumbs') ) {
12
  amp_breadcrumb();
13
  }?>
14
+ <?php if ( is_page() && true == ampforwp_get_setting('ampforwp_pages_title') ) {
15
+ amp_title();
16
+ }?>
17
  <?php } ?>
18
  <?php } // Level up Condition ends here?>
19
  </div>
templates/features.php CHANGED
@@ -4160,12 +4160,14 @@ function ampforwp_post_paginated_content($content){
4160
  if(preg_match('/<a(.*?)data-pin-do="embedPin"(.*?)href="(.*?)"><\/a>/', $content)){
4161
  $content = preg_replace('/<a(.*?)data-pin-do="embedPin"(.*?)href="(.*?)"><\/a>/', '<amp-pinterest width="250" height="500" data-do="embedPin" data-url="$3"></amp-pinterest>', $content);
4162
  }
 
 
 
 
4163
  if ( is_singular() || ampforwp_is_front_page() ){
4164
  global $redux_builder_amp, $page, $multipage;
4165
  $ampforwp_new_content = $ampforwp_the_content = $checker = '';
4166
  if(ampforwp_get_setting('ampforwp-pagination-link-type')==true && is_singular() && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){
4167
- $id = ampforwp_get_the_ID();
4168
- $content = get_post_field( 'post_content', $id);
4169
  if ($content) {
4170
  $sanitizer_obj = new AMPFORWP_Content( $content,
4171
  apply_filters( 'amp_content_embed_handlers', array(
@@ -5033,7 +5035,7 @@ function ampforwp_inline_related_posts(){
5033
  }
5034
  $thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, $r_width , $r_height , true, false, true );
5035
  $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . esc_attr($thumb_url_2[1]) . '" height="' . esc_attr($thumb_url_2[2]) . '" layout="responsive"></amp-img>';
5036
- if(!isset($thumb_url_2[0]) && is_null($thumb_url_2[0])){
5037
  $thumb_url = ampforwp_get_post_thumbnail('url');
5038
  $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url ).'" width="' . esc_attr(220) . '" height="' . esc_attr(134) . '" layout="responsive"></amp-img>';
5039
  }
@@ -5051,6 +5053,10 @@ function ampforwp_inline_related_posts(){
5051
  $thumb_width = $thumb_url_2[1];
5052
  $thumb_height = $thumb_url_2[2];
5053
  $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url ).'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" layout="responsive" ></amp-img>';
 
 
 
 
5054
  }
5055
  $inline_related_posts_img = apply_filters("ampforwp_modify_inline_rp_loop_image",$inline_related_posts_img);
5056
  $inline_related_posts .= $inline_related_posts_img;
@@ -5418,8 +5424,8 @@ if( ! function_exists( 'ampforwp_view_amp_admin_bar' ) ) {
5418
  }
5419
  // Check for Screen base, user ability to read and visibility
5420
  if ($current_access && (isset($post->ID) && current_user_can('read_post', $post->ID ))
5421
- && ( $wp_post_types[$post->post_type]->public )
5422
- && ( $wp_post_types[$post->post_type]->show_in_admin_bar ) ) {
5423
  // Check if current post type is AMPed or not
5424
  if( $supported_amp_post_types && in_array($post->post_type, $supported_amp_post_types) ){
5425
  // If AMP on Posts or Pages is off then do nothing
@@ -8329,7 +8335,7 @@ function ampforwp_remove_unwanted_code($content){
8329
  }
8330
  add_filter('ampforwp_the_content_last_filter','ampforwp_include_required_scripts',12);
8331
  function ampforwp_include_required_scripts($content){
8332
- $allscripts = '';
8333
  $comp_to_remove_arr = array();
8334
  preg_match_all('/<\/amp-(.*?)>/', $content, $matches);
8335
  if(isset($matches[1][0])){
4160
  if(preg_match('/<a(.*?)data-pin-do="embedPin"(.*?)href="(.*?)"><\/a>/', $content)){
4161
  $content = preg_replace('/<a(.*?)data-pin-do="embedPin"(.*?)href="(.*?)"><\/a>/', '<amp-pinterest width="250" height="500" data-do="embedPin" data-url="$3"></amp-pinterest>', $content);
4162
  }
4163
+ if (ampforwp_is_front_page()) {
4164
+ $id = ampforwp_get_the_ID();
4165
+ $content = get_post_field( 'post_content', $id);
4166
+ }
4167
  if ( is_singular() || ampforwp_is_front_page() ){
4168
  global $redux_builder_amp, $page, $multipage;
4169
  $ampforwp_new_content = $ampforwp_the_content = $checker = '';
4170
  if(ampforwp_get_setting('ampforwp-pagination-link-type')==true && is_singular() && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID())){
 
 
4171
  if ($content) {
4172
  $sanitizer_obj = new AMPFORWP_Content( $content,
4173
  apply_filters( 'amp_content_embed_handlers', array(
5035
  }
5036
  $thumb_url_2 = ampforwp_aq_resize( $thumb_url_2, $r_width , $r_height , true, false, true );
5037
  $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url_2[0] ).'" width="' . esc_attr($thumb_url_2[1]) . '" height="' . esc_attr($thumb_url_2[2]) . '" layout="responsive"></amp-img>';
5038
+ if(!isset($thumb_url_2[0]) && is_null($thumb_url_2[0]) || wp_check_filetype(ampforwp_get_post_thumbnail('url') == 'svg')){
5039
  $thumb_url = ampforwp_get_post_thumbnail('url');
5040
  $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url ).'" width="' . esc_attr(220) . '" height="' . esc_attr(134) . '" layout="responsive"></amp-img>';
5041
  }
5053
  $thumb_width = $thumb_url_2[1];
5054
  $thumb_height = $thumb_url_2[2];
5055
  $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url ).'" width="'.esc_attr($thumb_width).'" height="'.esc_attr($thumb_height).'" layout="responsive" ></amp-img>';
5056
+ if(!isset($thumb_url_2[0]) && is_null($thumb_url_2[0]) || wp_check_filetype(ampforwp_get_post_thumbnail('url') == 'svg')){
5057
+ $thumb_url = ampforwp_get_post_thumbnail('url');
5058
+ $inline_related_posts_img = '<amp-img src="'.esc_url( $thumb_url ).'" width="' . esc_attr(150) . '" height="' . esc_attr(150) . '" layout="responsive"></amp-img>';
5059
+ }
5060
  }
5061
  $inline_related_posts_img = apply_filters("ampforwp_modify_inline_rp_loop_image",$inline_related_posts_img);
5062
  $inline_related_posts .= $inline_related_posts_img;
5424
  }
5425
  // Check for Screen base, user ability to read and visibility
5426
  if ($current_access && (isset($post->ID) && current_user_can('read_post', $post->ID ))
5427
+ && ( isset ( $wp_post_types[ $post->post_type ]->public ) && $wp_post_types[$post->post_type]->public )
5428
+ && ( isset ( $wp_post_types[ $post->post_type ]->show_in_admin_bar ) && $wp_post_types[$post->post_type]->show_in_admin_bar ) ) {
5429
  // Check if current post type is AMPed or not
5430
  if( $supported_amp_post_types && in_array($post->post_type, $supported_amp_post_types) ){
5431
  // If AMP on Posts or Pages is off then do nothing
8335
  }
8336
  add_filter('ampforwp_the_content_last_filter','ampforwp_include_required_scripts',12);
8337
  function ampforwp_include_required_scripts($content){
8338
+ $allscripts = $is_script = '';
8339
  $comp_to_remove_arr = array();
8340
  preg_match_all('/<\/amp-(.*?)>/', $content, $matches);
8341
  if(isset($matches[1][0])){