AMP for WP – Accelerated Mobile Pages - Version 1.0.37

Version Description

(28th March 2020) = * Improvement: Added filter to change Author name #4238 * Improvement: Added option to show/hide jetpack related post in AMP #4272 * Improvement: Added option to show/hide sassy social share in AMP #4273 * Improvement: Added iZooto Push Notification Option #4286 * Improvement: Code Improvements in #4288 #4300 * Fixed: Fatal Error - Class QM_Dispatchers not found. #4322 * Fixed: Header shifting to left in swift 404 page #4316 * Fixed: Fatal error on activation on old php versions #4320 * Fixed: Design breaks in 2 column layout pagebuilder in Design 2 #4313 * Fixed: Hide AMP Bulk Tools option isn't working with WPML #4249 * Fixed: Transparent header background color not working #4315

Download this release

Release Info

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

Code changes from version 1.0.36 to 1.0.37

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.3.2
7
- Stable tag: 1.0.36
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,19 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  = 1.0.36 (26th March 2020) =
198
  * Improvement: Added filter to modify role based access #4303
199
  * Improvement: Added "srcset" on featured images #4257
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.0.37
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
194
 
195
  == Changelog ==
196
 
197
+ = 1.0.37 (28th March 2020) =
198
+ * Improvement: Added filter to change Author name #4238
199
+ * Improvement: Added option to show/hide jetpack related post in AMP #4272
200
+ * Improvement: Added option to show/hide sassy social share in AMP #4273
201
+ * Improvement: Added iZooto Push Notification Option #4286
202
+ * Improvement: Code Improvements in #4288 #4300
203
+ * Fixed: Fatal Error - Class ‘QM_Dispatchers’ not found. #4322
204
+ * Fixed: Header shifting to left in swift 404 page #4316
205
+ * Fixed: Fatal error on activation on old php versions #4320
206
+ * Fixed: Design breaks in 2 column layout pagebuilder in Design 2 #4313
207
+ * Fixed: Hide AMP Bulk Tools option isn't working with WPML #4249
208
+ * Fixed: Transparent header background color not working #4315
209
+
210
  = 1.0.36 (26th March 2020) =
211
  * Improvement: Added filter to modify role based access #4303
212
  * Improvement: Added "srcset" on featured images #4257
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.36
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.36');
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.37
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.37');
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,18 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.0.36 (26th March 2020) =
4
  * Improvement: Added filter to modify role based access #4303
5
  * Improvement: Added "srcset" on featured images #4257
1
  == Changelog ==
2
 
3
+ = 1.0.37 (28th March 2020) =
4
+ * Improvement: Added filter to change Author name #4238
5
+ * Improvement: Added option to show/hide jetpack related post in AMP #4272
6
+ * Improvement: Added option to show/hide sassy social share in AMP #4273
7
+ * Improvement: Added iZooto Push Notification Option #4286
8
+ * Improvement: Code Improvements in #4288 #4300
9
+ * Fixed: Fatal Error - Class ‘QM_Dispatchers’ not found. #4322
10
+ * Fixed: Header shifting to left in swift 404 page #4316
11
+ * Fixed: Fatal error on activation on old php versions #4320
12
+ * Fixed: Design breaks in 2 column layout pagebuilder in Design 2 #4313
13
+ * Fixed: Hide AMP Bulk Tools option isn't working with WPML #4249
14
+ * Fixed: Transparent header background color not working #4315
15
+
16
  = 1.0.36 (26th March 2020) =
17
  * Improvement: Added filter to modify role based access #4303
18
  * Improvement: Added "srcset" on featured images #4257
classes/class-ampforwp-infinite-scroll.php CHANGED
@@ -125,6 +125,7 @@ if( ! class_exists('AMPforWP_Infinite_Scroll') ) {
125
  'posts_per_page' => 2,
126
  'no_found_rows' => true
127
  );
 
128
  $query = new WP_Query( $query_args );
129
  while ($query->have_posts()) {
130
  $query->the_post();
125
  'posts_per_page' => 2,
126
  'no_found_rows' => true
127
  );
128
+ $query_args = apply_filters('ampforwp_infinite_scroll_query_args', $query_args);
129
  $query = new WP_Query( $query_args );
130
  while ($query->have_posts()) {
131
  $query->the_post();
components/author-box/author-box.php CHANGED
@@ -21,6 +21,7 @@ $class = $author_prefix = $author_wrapper_class = '';
21
  $show_date = false;
22
  $show_time = false;
23
  $author_name = $post_author->display_name;
 
24
  $and_text = '';
25
  $avatar_size_weight = $avatar_size_height = '';
26
  $and_text = ampforwp_translation($redux_builder_amp['amp-translator-and-text'], 'and' );
21
  $show_date = false;
22
  $show_time = false;
23
  $author_name = $post_author->display_name;
24
+ $author_name = apply_filters('ampforwp_modify_author_name',$author_name);
25
  $and_text = '';
26
  $avatar_size_weight = $avatar_size_height = '';
27
  $and_text = ampforwp_translation($redux_builder_amp['amp-translator-and-text'], 'and' );
components/components-core.php CHANGED
@@ -118,7 +118,7 @@ function amp_title(){
118
  do_action('ampforwp_above_the_title');
119
  $ampforwp_title = get_the_title($ID);
120
  $ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title);
121
- if(!empty($ampforwp_title) && (ampforwp_default_logo() || !empty(ampforwp_get_setting('opt-media','url')))){
122
  ?>
123
  <h1 class="amp-post-title"><?php echo wp_kses_data( $ampforwp_title ); ?></h1>
124
  <?php
118
  do_action('ampforwp_above_the_title');
119
  $ampforwp_title = get_the_title($ID);
120
  $ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title);
121
+ if(!empty($ampforwp_title) && (ampforwp_default_logo() || ampforwp_get_setting('opt-media','url')!='')){
122
  ?>
123
  <h1 class="amp-post-title"><?php echo wp_kses_data( $ampforwp_title ); ?></h1>
124
  <?php
components/related-posts/related-posts.php CHANGED
@@ -18,9 +18,12 @@ function ampforwp_framework_get_related_posts($argsdata=array()){
18
  <ul class="clearfix">
19
  <?php ampforwp_related_post(); ?>
20
  <?php
 
21
  while( $my_query->have_posts() ) {
22
  $my_query->the_post();
23
-
 
 
24
  ?>
25
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
26
  <?php
@@ -56,24 +59,19 @@ function ampforwp_related_post_loop_query(){
56
  $orderby = 'rand';
57
  }
58
  $args=array(
59
- 'post_type' => get_post_type($post),
60
- 'post__not_in' => array($post->ID),
61
- 'posts_per_page'=> $int_number_of_related_posts,
62
- 'orderby' => $orderby,
63
- 'ignore_sticky_posts'=>1,
64
- 'has_password' => false ,
65
- 'post_status'=> 'publish',
66
- 'no_found_rows' => true,
67
- 'meta_query' => array(
68
- 'relation' => 'OR',
69
- array(
70
- 'key' => 'ampforwp-amp-on-off',
71
- 'value' => 'default',
72
- ),
73
- array(
74
- 'key' => 'ampforwp-amp-on-off',
75
- 'compare' => 'NOT EXISTS',
76
- ))
77
  );
78
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2 && 'post' == $post->post_type ){
79
  $categories = get_the_category($post->ID);
18
  <ul class="clearfix">
19
  <?php ampforwp_related_post(); ?>
20
  <?php
21
+ $current_id = ampforwp_get_the_ID();
22
  while( $my_query->have_posts() ) {
23
  $my_query->the_post();
24
+ if(ampforwp_get_the_ID()==$current_id){
25
+ continue;
26
+ }
27
  ?>
28
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
29
  <?php
59
  $orderby = 'rand';
60
  }
61
  $args=array(
62
+ 'post_type' => get_post_type($post),
63
+ 'posts_per_page'=> $int_number_of_related_posts,
64
+ 'orderby' => $orderby,
65
+ 'ignore_sticky_posts'=>1,
66
+ 'has_password' => false ,
67
+ 'post_status'=> 'publish',
68
+ 'no_found_rows' => true,
69
+ 'meta_query' => array(
70
+ array(
71
+ 'value' => 'hide-amp',
72
+ 'compare' => '!='
73
+ )
74
+ )
 
 
 
 
 
75
  );
76
  if($redux_builder_amp['ampforwp-single-select-type-of-related']==2 && 'post' == $post->post_type ){
77
  $categories = get_the_category($post->ID);
feeds/instant-article-feed.php CHANGED
@@ -31,6 +31,7 @@ header('Content-Type: ' . esc_attr(feed_content_type('rss2')) . '; charset=' . e
31
  'post_status' => 'publish',
32
  'ignore_sticky_posts' => true,
33
  'posts_per_page' => esc_attr($number_of_articles),
 
34
  'meta_query' => array(
35
  'relation' => 'OR',
36
  array(
@@ -61,6 +62,7 @@ header('Content-Type: ' . esc_attr(feed_content_type('rss2')) . '; charset=' . e
61
  $ia_args['tax_query']['field'] = 'id';
62
  $ia_args['tax_query']['terms'] = esc_attr($tax_object->term_id);
63
  }
 
64
  $ia_query = new WP_Query( $ia_args );
65
  while( $ia_query->have_posts() ) :
66
  $ia_query->the_post(); ?>
31
  'post_status' => 'publish',
32
  'ignore_sticky_posts' => true,
33
  'posts_per_page' => esc_attr($number_of_articles),
34
+ 'no_found_rows' => true,
35
  'meta_query' => array(
36
  'relation' => 'OR',
37
  array(
62
  $ia_args['tax_query']['field'] = 'id';
63
  $ia_args['tax_query']['terms'] = esc_attr($tax_object->term_id);
64
  }
65
+ $ia_args = apply_filters('ampforwp_ia_query_args' , $ia_args );
66
  $ia_query = new WP_Query( $ia_args );
67
  while( $ia_query->have_posts() ) :
68
  $ia_query->the_post(); ?>
includes/admin-style.css CHANGED
@@ -2067,4 +2067,7 @@ i.dashicons.dashicons-before.dashicons-update {
2067
  text-decoration: none;
2068
  padding: 1px 7px 3px;
2069
  border-radius: 13px;
 
 
 
2070
  }
2067
  text-decoration: none;
2068
  padding: 1px 7px 3px;
2069
  border-radius: 13px;
2070
+ }
2071
+ fieldset#redux_builder_amp-ampforwp-onesignal-positioning {
2072
+ padding: 0;
2073
  }
includes/features/push-notification/push-notification-functions.php CHANGED
@@ -11,7 +11,7 @@ if( ! function_exists( ' ampforwp_onesignal_notifications ' ) ){
11
  if ( (!checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ) || true == ampforwp_get_setting('ampforwp-web-push-onesignal-header') || true == ampforwp_get_setting('ampforwp-web-push-onesignal-sticky') ){
12
  $checker = true;
13
  }
14
- if(isset($redux_builder_amp['ampforwp-web-push-onesignal']) && $redux_builder_amp['ampforwp-web-push-onesignal'] && $checker ){
15
  $onesignal_domain = '';
16
  $onesignal_domain_sw = '';
17
  $onesignal_subdomain = '';
@@ -100,7 +100,8 @@ if(function_exists('amp_activate')){
100
  if( ! function_exists('ampforwp_onesignal_notifications_widget') ){
101
  function ampforwp_onesignal_notifications_widget(){
102
  global $redux_builder_amp;
103
- if(is_single() && ampforwp_get_setting('ampforwp-web-push-onesignal') && !checkAMPforPageBuilderStatus(get_the_ID()) ){ ?>
 
104
  <!-- A subscription widget -->
105
  <div class="amp-web-push-container">
106
  <amp-web-push-widget visibility="unsubscribed" layout="fixed" width="245" height="45">
@@ -134,7 +135,7 @@ if(!function_exists('ampforwp_onesignal_notifications_script')){
134
  if ( (!checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ) || true == ampforwp_get_setting('ampforwp-web-push-onesignal-header') || true == ampforwp_get_setting('ampforwp-web-push-onesignal-sticky') ){
135
  $checker = true;
136
  }
137
- if(ampforwp_get_setting('ampforwp-web-push-onesignal') && $checker ){
138
  if ( empty( $data['amp_component_scripts']['amp-web-push'] ) ) {
139
  $data['amp_component_scripts']['amp-web-push'] = 'https://cdn.ampproject.org/v0/amp-web-push-0.1.js';
140
  }
@@ -147,7 +148,7 @@ add_action('amp_post_template_css' , 'ampforwp_onesignal_notifications_styling'
147
  if(!function_exists('ampforwp_onesignal_notifications_styling')){
148
  function ampforwp_onesignal_notifications_styling(){
149
  global $redux_builder_amp;
150
- if(ampforwp_get_setting('ampforwp-web-push-onesignal') && !checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ){ ?>
151
  amp-web-push-widget button.subscribe { display: inline-flex; align-items: center; border-radius: 2px; border: 0; box-sizing: border-box; margin: 0; padding: 10px 15px; cursor: pointer; outline: none; font-size: 15px; font-weight: 400; background: #4A90E2; color: white; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
152
  amp-web-push-widget button.subscribe .subscribe-icon {margin-right: 10px;}
153
  amp-web-push-widget button.subscribe:active {transform: scale(0.99);}
11
  if ( (!checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ) || true == ampforwp_get_setting('ampforwp-web-push-onesignal-header') || true == ampforwp_get_setting('ampforwp-web-push-onesignal-sticky') ){
12
  $checker = true;
13
  }
14
+ if('1' == ampforwp_get_setting('ampforwp-web-push') && $checker ){
15
  $onesignal_domain = '';
16
  $onesignal_domain_sw = '';
17
  $onesignal_subdomain = '';
100
  if( ! function_exists('ampforwp_onesignal_notifications_widget') ){
101
  function ampforwp_onesignal_notifications_widget(){
102
  global $redux_builder_amp;
103
+
104
+ if(is_single() && '1' == ampforwp_get_setting('ampforwp-web-push') && !checkAMPforPageBuilderStatus(get_the_ID()) ){ ?>
105
  <!-- A subscription widget -->
106
  <div class="amp-web-push-container">
107
  <amp-web-push-widget visibility="unsubscribed" layout="fixed" width="245" height="45">
135
  if ( (!checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ) || true == ampforwp_get_setting('ampforwp-web-push-onesignal-header') || true == ampforwp_get_setting('ampforwp-web-push-onesignal-sticky') ){
136
  $checker = true;
137
  }
138
+ if('1' == ampforwp_get_setting('ampforwp-web-push') && $checker ){
139
  if ( empty( $data['amp_component_scripts']['amp-web-push'] ) ) {
140
  $data['amp_component_scripts']['amp-web-push'] = 'https://cdn.ampproject.org/v0/amp-web-push-0.1.js';
141
  }
148
  if(!function_exists('ampforwp_onesignal_notifications_styling')){
149
  function ampforwp_onesignal_notifications_styling(){
150
  global $redux_builder_amp;
151
+ if('1' == ampforwp_get_setting('ampforwp-web-push') && !checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ){ ?>
152
  amp-web-push-widget button.subscribe { display: inline-flex; align-items: center; border-radius: 2px; border: 0; box-sizing: border-box; margin: 0; padding: 10px 15px; cursor: pointer; outline: none; font-size: 15px; font-weight: 400; background: #4A90E2; color: white; box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.5); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
153
  amp-web-push-widget button.subscribe .subscribe-icon {margin-right: 10px;}
154
  amp-web-push-widget button.subscribe:active {transform: scale(0.99);}
includes/features/push-notification/push-notification-options.php CHANGED
@@ -3,9 +3,79 @@ use ReduxCore\ReduxFramework\Redux;
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
 
 
 
 
 
 
 
 
 
 
 
6
  function ampforwp_push_notification_options($opt_name){
7
  // Push Notifications section
8
- Redux::setSection( $opt_name, array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  'title' => esc_html__( 'Push Notifications', 'accelerated-mobile-pages' ),
10
  // 'icon' => 'el el-podcast',
11
  'id' => 'ampforwp-push-notifications',
@@ -21,30 +91,54 @@ function ampforwp_push_notification_options($opt_name){
21
  'layout_type' => 'accordion',
22
  'accordion-open'=> 1,
23
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  array(
25
  'id' => 'ampforwp-web-push-onesignal',
26
- 'type' => 'switch',
27
- 'title' => esc_html__('OneSignal','accelerated-mobile-pages'),
 
28
  'tooltip-subtitle' => '<a href="https://ampforwp.com/tutorials/one-signal-in-amp/" target="_blank">View Integration Tutorial</a> (HTTPS is required)',
29
  'true' => 'true',
30
  'false' => 'false',
31
- 'default' => 0,
 
 
 
 
 
32
  ),
33
  array(
34
  'required' => array(
35
- array( 'ampforwp-web-push-onesignal', '=' , 1 ),
36
  ),
37
  'id' => 'ampforwp-one-signal-app-id',
38
  'type' => 'text',
39
  'title' => 'APP ID',
40
  'class' => 'child_opt child_opt_arrow',
 
41
  ),
 
 
42
  array(
43
  'id' => 'ampforwp-onesignal-positioning',
44
  'type' => 'section',
45
  'title' => esc_html__('Positioning', 'accelerated-mobile-pages'),
46
  'required' => array(
47
- array( 'ampforwp-web-push-onesignal', '=' , 1 ),
48
  array( 'amp-use-pot', '=' , 0 )
49
  ),
50
  'indent' => true,
@@ -59,7 +153,7 @@ function ampforwp_push_notification_options($opt_name){
59
  'false' => 'false',
60
  'default' => 1,
61
  'tooltip-subtitle' => 'Show Subscribe Button Below the Content',
62
- 'required' => array('ampforwp-web-push-onesignal', '=' , '1'),
63
  ),
64
  array(
65
  'id' => 'ampforwp-web-push-onesignal-above-content',
@@ -69,8 +163,10 @@ function ampforwp_push_notification_options($opt_name){
69
  'false' => 'false',
70
  'default' => 0,
71
  'tooltip-subtitle' => 'Show Subscribe Button Above the Content',
72
- 'required' => array('ampforwp-web-push-onesignal', '=' , '1'),
73
  ),
 
 
74
  array(
75
  'id' => 'translation',
76
  'type' => 'section',
@@ -89,16 +185,17 @@ function ampforwp_push_notification_options($opt_name){
89
  array(
90
  'id' => 'ampforwp-onesignal-translator-unsubscribe',
91
  'type' => 'text',
92
- 'title' => esc_html__('Unsubsribe', 'accelerated-mobile-pages'),
93
  'default' => esc_html__('Unsubscribe from updates','accelerated-mobile-pages'),
94
  'placeholder'=>esc_html__('Add some text','accelerated-mobile-pages'),
 
95
  ),
96
  array(
97
  'id' => 'ampforwp-onesignal-exper',
98
  'type' => 'section',
99
  'title' => esc_html__('Experimental', 'accelerated-mobile-pages'),
100
  'required' => array(
101
- array( 'ampforwp-web-push-onesignal', '=' , 1 ),
102
  array( 'amp-use-pot', '=' , 0 )
103
  ),
104
  'indent' => true,
@@ -110,7 +207,7 @@ function ampforwp_push_notification_options($opt_name){
110
  'type' => 'switch',
111
  'title' => 'HTTP Site',
112
  'tooltip-subtitle' => 'For HTTP Sites Only',
113
- 'required' => array('ampforwp-web-push-onesignal', '=' , '1'),
114
  'true' => 'true',
115
  'false' => 'false',
116
  'default' => 0
@@ -121,7 +218,7 @@ function ampforwp_push_notification_options($opt_name){
121
  'title' => 'Subdomain',
122
  'desc' => esc_html__('Example: ampforwp', 'accelerated-mobile-pages'),
123
  'required' => array(
124
- array('ampforwp-web-push-onesignal', '=' , '1'),
125
  array('ampforwp-onesignal-http-site', '=','1')),
126
  ),
127
  )
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
+ function ampforwp_push_notification_default() {
7
+ $default = '';
8
+ if(true == ampforwp_get_setting('ampforwp-web-push-onesignal')){
9
+ $default = '1';
10
+ }else{
11
+ $default = '0';
12
+ }
13
+ return $default;
14
+ }
15
+
16
+ $izt_opt1 = $izt_opt2 = $izt_opt3 = $izt_opt4 = '';
17
  function ampforwp_push_notification_options($opt_name){
18
  // Push Notifications section
19
+
20
+ if( function_exists('izoto_html')) {
21
+ $izt_opt1 = array(
22
+ 'id' => 'ampforwp-izooto-for-amp-below-content',
23
+ 'type' => 'switch',
24
+ 'title' => 'Below the Content',
25
+ 'true' => 'true',
26
+ 'false' => 'false',
27
+ 'default' => 1,
28
+ 'tooltip-subtitle' => 'Show Subscribe Button Below the Content',
29
+ 'required' => array('ampforwp-web-push', '=' , '2'),
30
+ );
31
+ $izt_opt2 = array(
32
+ 'id' => 'ampforwp-izooto-for-amp-above-content',
33
+ 'type' => 'switch',
34
+ 'title' => 'Above the Content',
35
+ 'true' => 'true',
36
+ 'false' => 'false',
37
+ 'default' => 0,
38
+ 'tooltip-subtitle' => 'Show Subscribe Button Above the Content',
39
+ 'required' => array('ampforwp-web-push', '=' , '2'),
40
+ );
41
+ $izt_opt3 = array(
42
+ 'id' => 'ampforwp-izooto-for-amp-positioning',
43
+ 'type' => 'section',
44
+ 'title' => esc_html__('Positioning', 'accelerated-mobile-pages'),
45
+ 'required' => array(
46
+ array( 'ampforwp-web-push', '=' , '2' ),
47
+ array( 'amp-use-pot', '=' , 0 )
48
+ ),
49
+ 'indent' => true,
50
+ 'layout_type' => 'accordion',
51
+ 'accordion-open'=> 1,
52
+ );
53
+ $izt_opt4 = array(
54
+ 'required' => array(
55
+ array( 'ampforwp-web-push', '=' , '2' ),
56
+ ),
57
+ 'id' => 'ampforwp-izooto-for-amp-app-id',
58
+ 'type' => 'text',
59
+ 'title' => 'Script ID',
60
+ 'class' => 'child_opt child_opt_arrow',
61
+ 'tooltip-subtitle' => '<a href="https://ampforwp.com/tutorials/article/how-to-setup-izooto-in-amp/" target="_blank">View Integration Tutorial</a> (HTTPS is required)',
62
+ );
63
+
64
+ }
65
+ $izooto_notice = '';
66
+ if(!function_exists('izoto_html')){
67
+ $izooto_notice = array(
68
+ 'id' => 'izooto-for-amp',
69
+ 'type' => 'info',
70
+ 'style' => 'success',
71
+ 'desc' => 'This feature requires <a href="https://ampforwp.com/addons/iZooto-for-amp/" target="_blank"> iZooto for AMP Extension</a>',
72
+ 'required' => array('ampforwp-web-push', '=' , '2'),
73
+ );
74
+ }
75
+
76
+
77
+ Redux::setSection( $opt_name, array(
78
+
79
  'title' => esc_html__( 'Push Notifications', 'accelerated-mobile-pages' ),
80
  // 'icon' => 'el el-podcast',
81
  'id' => 'ampforwp-push-notifications',
91
  'layout_type' => 'accordion',
92
  'accordion-open'=> 1,
93
  ),
94
+
95
+ array(
96
+ 'id' => 'ampforwp-web-push',
97
+ 'type' => 'select',
98
+ 'title' => esc_html__('Push Notification','accelerated-mobile-pages'),
99
+ 'true' => 'true',
100
+ 'false' => 'false',
101
+ 'options' => array(
102
+ '0' => esc_html__('Select Integration Service', 'accelerated-mobile-pages' ),
103
+ '1' => esc_html__('OneSignal', 'accelerated-mobile-pages' ),
104
+ '2' => esc_html__('iZooto', 'accelerated-mobile-pages' ),
105
+
106
+ ),
107
+ 'default' => ampforwp_push_notification_default(),
108
+ ),
109
  array(
110
  'id' => 'ampforwp-web-push-onesignal',
111
+ 'type' => 'select',
112
+ 'class' => 'hide',
113
+ 'title' => esc_html__('Push Notification','accelerated-mobile-pages'),
114
  'tooltip-subtitle' => '<a href="https://ampforwp.com/tutorials/one-signal-in-amp/" target="_blank">View Integration Tutorial</a> (HTTPS is required)',
115
  'true' => 'true',
116
  'false' => 'false',
117
+ 'options' => array(
118
+ '0' => esc_html__('Select Integration Service', 'accelerated-mobile-pages' ),
119
+ '1' => esc_html__('OneSignal', 'accelerated-mobile-pages' ),
120
+ '2' => esc_html__('iZooto', 'accelerated-mobile-pages' ),
121
+ ),
122
+ 'default' => '1',
123
  ),
124
  array(
125
  'required' => array(
126
+ array( 'ampforwp-web-push', '=' , '1' ),
127
  ),
128
  'id' => 'ampforwp-one-signal-app-id',
129
  'type' => 'text',
130
  'title' => 'APP ID',
131
  'class' => 'child_opt child_opt_arrow',
132
+ 'tooltip-subtitle' => '<a href="https://ampforwp.com/tutorials/one-signal-in-amp/" target="_blank">View Integration Tutorial</a> (HTTPS is required)',
133
  ),
134
+ $izooto_notice,
135
+ $izt_opt4,
136
  array(
137
  'id' => 'ampforwp-onesignal-positioning',
138
  'type' => 'section',
139
  'title' => esc_html__('Positioning', 'accelerated-mobile-pages'),
140
  'required' => array(
141
+ array( 'ampforwp-web-push', '=' , '1' ),
142
  array( 'amp-use-pot', '=' , 0 )
143
  ),
144
  'indent' => true,
153
  'false' => 'false',
154
  'default' => 1,
155
  'tooltip-subtitle' => 'Show Subscribe Button Below the Content',
156
+ 'required' => array('ampforwp-web-push', '=' , '1'),
157
  ),
158
  array(
159
  'id' => 'ampforwp-web-push-onesignal-above-content',
163
  'false' => 'false',
164
  'default' => 0,
165
  'tooltip-subtitle' => 'Show Subscribe Button Above the Content',
166
+ 'required' => array('ampforwp-web-push', '=' , '1'),
167
  ),
168
+ $izt_opt3,
169
+ $izt_opt1,$izt_opt2,
170
  array(
171
  'id' => 'translation',
172
  'type' => 'section',
185
  array(
186
  'id' => 'ampforwp-onesignal-translator-unsubscribe',
187
  'type' => 'text',
188
+ 'title' => esc_html__('Unsubscribe', 'accelerated-mobile-pages'),
189
  'default' => esc_html__('Unsubscribe from updates','accelerated-mobile-pages'),
190
  'placeholder'=>esc_html__('Add some text','accelerated-mobile-pages'),
191
+ 'required'=> array( array( 'ampforwp-web-push', '=' , '1' )),
192
  ),
193
  array(
194
  'id' => 'ampforwp-onesignal-exper',
195
  'type' => 'section',
196
  'title' => esc_html__('Experimental', 'accelerated-mobile-pages'),
197
  'required' => array(
198
+ array( 'ampforwp-web-push', '=' , '1' ),
199
  array( 'amp-use-pot', '=' , 0 )
200
  ),
201
  'indent' => true,
207
  'type' => 'switch',
208
  'title' => 'HTTP Site',
209
  'tooltip-subtitle' => 'For HTTP Sites Only',
210
+ 'required' => array('ampforwp-web-push', '=' , '1'),
211
  'true' => 'true',
212
  'false' => 'false',
213
  'default' => 0
218
  'title' => 'Subdomain',
219
  'desc' => esc_html__('Example: ampforwp', 'accelerated-mobile-pages'),
220
  'required' => array(
221
+ array('ampforwp-web-push', '=' , '1'),
222
  array('ampforwp-onesignal-http-site', '=','1')),
223
  ),
224
  )
includes/features/structure-data/structured-data-functions.php CHANGED
@@ -13,8 +13,8 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  $ampforwp_sd_height = ampforwp_get_setting('ampforwp-sd-logo-height');
14
  $ampforwp_sd_width = ampforwp_get_setting('ampforwp-sd-logo-width');
15
  $ampforwp_sd_logo = ampforwp_get_setting('amp-structured-data-logo','url');
16
- if (! empty( $redux_builder_amp['opt-media']['url'] ) ) {
17
- $structured_data_main_logo = $redux_builder_amp['opt-media']['url'];
18
  }
19
  if (! empty( $ampforwp_sd_logo ) ) {
20
  $structured_data_logo = esc_url( __(ampforwp_get_setting('amp-structured-data-logo','url'), 'accelerated-mobile-pages') );
@@ -268,10 +268,10 @@ function ampforwp_structured_data_type( $metadata ) {
268
  }
269
 
270
  if ( isset( $post->post_type ) && $post->post_type == $post_type ) {
271
- if( empty( ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type)) ) ){
272
  return;
273
  }
274
- if ( empty( ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type)) ) && ampforwp_get_setting('ampforwp-seo-yoast-description') == 0 ) {
275
  return;
276
  }
277
  if(isset($metadata['@type']) && $metadata['@type']){
13
  $ampforwp_sd_height = ampforwp_get_setting('ampforwp-sd-logo-height');
14
  $ampforwp_sd_width = ampforwp_get_setting('ampforwp-sd-logo-width');
15
  $ampforwp_sd_logo = ampforwp_get_setting('amp-structured-data-logo','url');
16
+ if (ampforwp_get_setting('opt-media','url')!='') {
17
+ $structured_data_main_logo = ampforwp_get_setting('opt-media','url');
18
  }
19
  if (! empty( $ampforwp_sd_logo ) ) {
20
  $structured_data_logo = esc_url( __(ampforwp_get_setting('amp-structured-data-logo','url'), 'accelerated-mobile-pages') );
268
  }
269
 
270
  if ( isset( $post->post_type ) && $post->post_type == $post_type ) {
271
+ if(ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type))==''){
272
  return;
273
  }
274
+ if ( ampforwp_get_setting('ampforwp-sd-type-'.esc_attr($post_type))=='' && ampforwp_get_setting('ampforwp-seo-yoast-description') == 0 ) {
275
  return;
276
  }
277
  if(isset($metadata['@type']) && $metadata['@type']){
includes/options/admin-config.php CHANGED
@@ -119,7 +119,23 @@ if(!is_plugin_active( 'amp-pagebuilder-compatibility/amp-pagebuilder-compatibili
119
  );
120
  $pb_for_amp[] = $elemntr_pb_for_ampchecker;*/
121
 
122
- $all_extensions_data = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  global $all_extensions_data;
124
  $extension_listing_array = array(
125
  array(
@@ -6100,6 +6116,7 @@ $single_page_options = array(
6100
  'default' => '7',
6101
  'required' => array('ampforwp-in-content-related-posts-days-switch', '=' , '1'),
6102
  ),
 
6103
  array(
6104
  'id' => 'single-tab-2',
6105
  'type' => 'section',
@@ -7029,6 +7046,7 @@ else{
7029
  'default' => 0,
7030
  'required' => array(array('ampforwp-social-share', '=', '1'))
7031
  ),
 
7032
  // AddThis Support
7033
  array(
7034
  'id' => 'add-this-support',
119
  );
120
  $pb_for_amp[] = $elemntr_pb_for_ampchecker;*/
121
 
122
+ $all_extensions_data = $jetpack_rp = $sassy_ss = array();
123
+ if(class_exists( 'Jetpack_RelatedPosts' )){
124
+ $jetpack_rp = array(
125
+ 'id' => 'ampforwp-jetpack-related-posts',
126
+ 'type' => 'switch',
127
+ 'title' => esc_html__('Jetpack Related Post', 'accelerated-mobile-pages'),
128
+ 'default' => '1',
129
+ );
130
+ }
131
+ if(function_exists('heateor_sss_save_default_options')){
132
+ $sassy_ss = array(
133
+ 'id' => 'ampforwp-sassy_social-switch',
134
+ 'type' => 'switch',
135
+ 'title' => esc_html__('Sassy Social Share', 'accelerated-mobile-pages'),
136
+ 'default' => '1',
137
+ );
138
+ }
139
  global $all_extensions_data;
140
  $extension_listing_array = array(
141
  array(
6116
  'default' => '7',
6117
  'required' => array('ampforwp-in-content-related-posts-days-switch', '=' , '1'),
6118
  ),
6119
+ $jetpack_rp,
6120
  array(
6121
  'id' => 'single-tab-2',
6122
  'type' => 'section',
7046
  'default' => 0,
7047
  'required' => array(array('ampforwp-social-share', '=', '1'))
7048
  ),
7049
+ $sassy_ss,
7050
  // AddThis Support
7051
  array(
7052
  'id' => 'add-this-support',
includes/thirdparty-compatibility.php CHANGED
@@ -52,6 +52,16 @@ function ampforwp_thirdparty_compatibility(){
52
  if (function_exists('gpress_switch_theme')) {
53
  remove_filter('the_content', 'add_data_atts');
54
  }
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  //Updater to check license
52
  if (function_exists('gpress_switch_theme')) {
53
  remove_filter('the_content', 'add_data_atts');
54
  }
55
+ if(class_exists( 'Jetpack_RelatedPosts' ) && false == ampforwp_get_setting('ampforwp-jetpack-related-posts')){
56
+ $jprp = Jetpack_RelatedPosts::init();
57
+ remove_filter( 'the_content', array( $jprp, 'filter_add_target_to_dom' ), 40 );
58
+ }
59
+ if(function_exists('heateor_sss_save_default_options') && false == ampforwp_get_setting('ampforwp-sassy_social-switch') ){
60
+ add_filter('heateor_sss_disable_sharing','ampforwp_removing_sassy_social_share');
61
+ }
62
+ }
63
+ function ampforwp_removing_sassy_social_share(){
64
+ return 1;
65
  }
66
 
67
  //Updater to check license
pagebuilder/inc/viewShowFrontData.php CHANGED
@@ -139,7 +139,7 @@ function amp_pagebuilder_content_styles(){
139
 
140
  $completeCssOfPB .= '.amp_pb{display: inline-block;width: 100%;}
141
  .row{display: inline-flex;width: 100%;}
142
- .col-2{width:50%;float:left;}
143
  .col-2-wrap .col-2:nth-child(1){
144
  padding-right:5px;
145
  }
@@ -865,6 +865,9 @@ function ampforwp_rowData($container,$col,$moduleTemplate){
865
  'post_status'=> 'publish',
866
  'post_type' => $fieldValues['post_type_selection']
867
  );
 
 
 
868
  if ( (isset($fieldValues['taxonomy_selection']) && 'recent_option' !== $fieldValues['taxonomy_selection']) && (isset($fieldValues['category_selection']) && 'recent_option' !== $fieldValues['category_selection'])) {
869
  $args['tax_query'] = array(
870
  array(
@@ -1100,6 +1103,7 @@ function ampforwp_get_attachment_id( $url , $imagetype='full') {
1100
  'post_type' => 'attachment',
1101
  'post_status' => 'inherit',
1102
  'fields' => 'ids',
 
1103
  'meta_query' => array(
1104
  array(
1105
  'value' => $file,
@@ -1108,6 +1112,7 @@ function ampforwp_get_attachment_id( $url , $imagetype='full') {
1108
  ),
1109
  )
1110
  );
 
1111
  $query = new WP_Query( $query_args );
1112
  if ( $query->have_posts() ) {
1113
  foreach ( $query->posts as $post_id ) {
139
 
140
  $completeCssOfPB .= '.amp_pb{display: inline-block;width: 100%;}
141
  .row{display: inline-flex;width: 100%;}
142
+ .col-2{ width: calc(50% - 5px);float:left;}
143
  .col-2-wrap .col-2:nth-child(1){
144
  padding-right:5px;
145
  }
865
  'post_status'=> 'publish',
866
  'post_type' => $fieldValues['post_type_selection']
867
  );
868
+ if($fieldValues['pagination'] == 0){
869
+ array_push($args, "no_found_rows", true);
870
+ }
871
  if ( (isset($fieldValues['taxonomy_selection']) && 'recent_option' !== $fieldValues['taxonomy_selection']) && (isset($fieldValues['category_selection']) && 'recent_option' !== $fieldValues['category_selection'])) {
872
  $args['tax_query'] = array(
873
  array(
1103
  'post_type' => 'attachment',
1104
  'post_status' => 'inherit',
1105
  'fields' => 'ids',
1106
+ 'no_found_rows' => true,
1107
  'meta_query' => array(
1108
  array(
1109
  'value' => $file,
1112
  ),
1113
  )
1114
  );
1115
+ $query_args = apply_filters('ampforwp_attachment_id_query_args' , $query_args );
1116
  $query = new WP_Query( $query_args );
1117
  if ( $query->have_posts() ) {
1118
  foreach ( $query->posts as $post_id ) {
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.3.2
7
- Stable tag: 1.0.36
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,19 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  = 1.0.36 (26th March 2020) =
195
  * Improvement: Added filter to modify role based access #4303
196
  * Improvement: Added "srcset" on featured images #4257
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
+ Stable tag: 1.0.37
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
191
 
192
  == Changelog ==
193
 
194
+ = 1.0.37 (28th March 2020) =
195
+ * Improvement: Added filter to change Author name #4238
196
+ * Improvement: Added option to show/hide jetpack related post in AMP #4272
197
+ * Improvement: Added option to show/hide sassy social share in AMP #4273
198
+ * Improvement: Added iZooto Push Notification Option #4286
199
+ * Improvement: Code Improvements in #4288 #4300
200
+ * Fixed: Fatal Error - Class ‘QM_Dispatchers’ not found. #4322
201
+ * Fixed: Header shifting to left in swift 404 page #4316
202
+ * Fixed: Fatal error on activation on old php versions #4320
203
+ * Fixed: Design breaks in 2 column layout pagebuilder in Design 2 #4313
204
+ * Fixed: Hide AMP Bulk Tools option isn't working with WPML #4249
205
+ * Fixed: Transparent header background color not working #4315
206
+
207
  = 1.0.36 (26th March 2020) =
208
  * Improvement: Added filter to modify role based access #4303
209
  * Improvement: Added "srcset" on featured images #4257
templates/design-manager/design-1/elements/related-posts.php CHANGED
@@ -25,13 +25,13 @@ if( $current_post_type = get_post_type( $post )) {
25
  'order' => 'DESC',
26
  'orderby' => $orderby,
27
  'post_type' => $current_post_type,
28
- 'post__not_in' => array( $post->ID ),
29
  'no_found_rows' => true,
30
  'meta_query' => array(
31
- array(
32
- 'key' => 'ampforwp-amp-on-off',
33
- 'value' => 'default',
34
- ))
 
35
  );
36
  }
37
  }//end of block for custom Post types
@@ -43,7 +43,6 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2) {
43
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
44
  $args=array(
45
  'category__in' => $category_ids,
46
- 'post__not_in' => array($post->ID),
47
  'posts_per_page' => $int_number_of_related_posts,
48
  'ignore_sticky_posts'=> 1,
49
  'has_password' => false ,
@@ -51,15 +50,11 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2) {
51
  'orderby' => $orderby,
52
  'no_found_rows' => true,
53
  'meta_query' => array(
54
- 'relation' => 'OR',
55
  array(
56
- 'key' => 'ampforwp-amp-on-off',
57
- 'value' => 'default',
58
- ),
59
- array(
60
- 'key' => 'ampforwp-amp-on-off',
61
- 'compare' => 'NOT EXISTS',
62
- ))
63
  );
64
  }
65
  } //end of block for categories
@@ -72,7 +67,6 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
72
  foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
73
  $args=array(
74
  'tag__in' => $tag_ids,
75
- 'post__not_in' => array($post->ID),
76
  'posts_per_page' => $int_number_of_related_posts,
77
  'ignore_sticky_posts'=> 1,
78
  'has_password' => false ,
@@ -80,10 +74,11 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
80
  'orderby' => $orderby,
81
  'no_found_rows' => true,
82
  'meta_query' => array(
83
- array(
84
- 'key' => 'ampforwp-amp-on-off',
85
- 'value' => 'default',
86
- ))
 
87
  );
88
  }
89
  }//end of block for tags
@@ -109,13 +104,17 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
109
  <span><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' )); ?></span>
110
  <ol class="clearfix">
111
  <?php
 
112
  while( $my_query->have_posts() ) {
113
- $my_query->the_post();
 
 
 
114
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
115
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
116
  $related_post_permalink = get_permalink();
117
  }
118
- ?>
119
  <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
120
  <?php if ( ampforwp_has_post_thumbnail() ) {
121
  if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
25
  'order' => 'DESC',
26
  'orderby' => $orderby,
27
  'post_type' => $current_post_type,
 
28
  'no_found_rows' => true,
29
  'meta_query' => array(
30
+ array(
31
+ 'value' => 'hide-amp',
32
+ 'compare' => '!='
33
+ )
34
+ )
35
  );
36
  }
37
  }//end of block for custom Post types
43
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
44
  $args=array(
45
  'category__in' => $category_ids,
 
46
  'posts_per_page' => $int_number_of_related_posts,
47
  'ignore_sticky_posts'=> 1,
48
  'has_password' => false ,
50
  'orderby' => $orderby,
51
  'no_found_rows' => true,
52
  'meta_query' => array(
 
53
  array(
54
+ 'value' => 'hide-amp',
55
+ 'compare' => '!='
56
+ )
57
+ )
 
 
 
58
  );
59
  }
60
  } //end of block for categories
67
  foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
68
  $args=array(
69
  'tag__in' => $tag_ids,
 
70
  'posts_per_page' => $int_number_of_related_posts,
71
  'ignore_sticky_posts'=> 1,
72
  'has_password' => false ,
74
  'orderby' => $orderby,
75
  'no_found_rows' => true,
76
  'meta_query' => array(
77
+ array(
78
+ 'value' => 'hide-amp',
79
+ 'compare' => '!='
80
+ )
81
+ )
82
  );
83
  }
84
  }//end of block for tags
104
  <span><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' )); ?></span>
105
  <ol class="clearfix">
106
  <?php
107
+ $current_id = ampforwp_get_the_ID();
108
  while( $my_query->have_posts() ) {
109
+ $my_query->the_post();
110
+ if(ampforwp_get_the_ID()==$current_id){
111
+ continue;
112
+ }
113
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
114
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
115
  $related_post_permalink = get_permalink();
116
  }
117
+ ?>
118
  <li class="<?php if ( ampforwp_has_post_thumbnail() ) { echo'has_related_thumbnail'; } else { echo 'no_related_thumbnail'; } ?>">
119
  <?php if ( ampforwp_has_post_thumbnail() ) {
120
  if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) {
templates/design-manager/design-1/style.php CHANGED
@@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
20
  $header_color = $get_customizer->get_customizer_setting( 'header_color' );
21
  ?>
22
  <?php // Design 1 Menu elemensts colors
23
- $header_bg_clr = ampforwp_get_setting('amp-d1-background-color','color');
24
  $header_elements_clr = ampforwp_get_setting('amp-d1-elements-color','color');
25
  $menu_sidebar_clr = ampforwp_get_setting('amp-d1-sidebar-color','color');
26
  $menu_bg_clr = ampforwp_get_setting('amp-d1-menu-bg-color','color');
20
  $header_color = $get_customizer->get_customizer_setting( 'header_color' );
21
  ?>
22
  <?php // Design 1 Menu elemensts colors
23
+ $header_bg_clr = ampforwp_get_setting('amp-d1-background-color','rgba');
24
  $header_elements_clr = ampforwp_get_setting('amp-d1-elements-color','color');
25
  $menu_sidebar_clr = ampforwp_get_setting('amp-d1-sidebar-color','color');
26
  $menu_bg_clr = ampforwp_get_setting('amp-d1-menu-bg-color','color');
templates/design-manager/design-2/elements/related-posts.php CHANGED
@@ -25,13 +25,13 @@ if( $current_post_type = get_post_type( $post )) {
25
  'order' => 'DESC',
26
  'orderby' => $orderby,
27
  'post_type' => $current_post_type,
28
- 'post__not_in' => array( $post->ID ),
29
  'no_found_rows' => true,
30
  'meta_query' => array(
31
- array(
32
- 'key' => 'ampforwp-amp-on-off',
33
- 'value' => 'default',
34
- ))
 
35
  );
36
  }
37
  }//end of block for custom Post types
@@ -43,7 +43,6 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
43
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
44
  $args=array(
45
  'category__in' => $category_ids,
46
- 'post__not_in' => array($post->ID),
47
  'posts_per_page' => $int_number_of_related_posts,
48
  'ignore_sticky_posts'=> 1,
49
  'has_password' => false ,
@@ -51,15 +50,11 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
51
  'orderby' => $orderby,
52
  'no_found_rows' => true,
53
  'meta_query' => array(
54
- 'relation' => 'OR',
55
- array(
56
- 'key' => 'ampforwp-amp-on-off',
57
- 'value' => 'default',
58
- ),
59
- array(
60
- 'key' => 'ampforwp-amp-on-off',
61
- 'compare' => 'NOT EXISTS',
62
- ))
63
  );
64
  }
65
  } //end of block for categories
@@ -71,7 +66,6 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
71
  foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
72
  $args=array(
73
  'tag__in' => $tag_ids,
74
- 'post__not_in' => array($post->ID),
75
  'posts_per_page' => $int_number_of_related_posts,
76
  'ignore_sticky_posts'=> 1,
77
  'has_password' => false ,
@@ -79,10 +73,11 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
79
  'orderby' => $orderby,
80
  'no_found_rows' => true,
81
  'meta_query' => array(
82
- array(
83
- 'key' => 'ampforwp-amp-on-off',
84
- 'value' => 'default',
85
- ))
 
86
  );
87
  }
88
  }//end of block for tags
@@ -109,8 +104,12 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
109
  <span class="related-title"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' )); ?></span>
110
  <ol class="clearfix">
111
  <?php
 
112
  while( $my_query->have_posts() ) {
113
  $my_query->the_post();
 
 
 
114
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
115
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
116
  $related_post_permalink = get_permalink();
25
  'order' => 'DESC',
26
  'orderby' => $orderby,
27
  'post_type' => $current_post_type,
 
28
  'no_found_rows' => true,
29
  'meta_query' => array(
30
+ array(
31
+ 'value' => 'hide-amp',
32
+ 'compare' => '!='
33
+ )
34
+ )
35
  );
36
  }
37
  }//end of block for custom Post types
43
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
44
  $args=array(
45
  'category__in' => $category_ids,
 
46
  'posts_per_page' => $int_number_of_related_posts,
47
  'ignore_sticky_posts'=> 1,
48
  'has_password' => false ,
50
  'orderby' => $orderby,
51
  'no_found_rows' => true,
52
  'meta_query' => array(
53
+ array(
54
+ 'value' => 'hide-amp',
55
+ 'compare' => '!='
56
+ )
57
+ )
 
 
 
 
58
  );
59
  }
60
  } //end of block for categories
66
  foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
67
  $args=array(
68
  'tag__in' => $tag_ids,
 
69
  'posts_per_page' => $int_number_of_related_posts,
70
  'ignore_sticky_posts'=> 1,
71
  'has_password' => false ,
73
  'orderby' => $orderby,
74
  'no_found_rows' => true,
75
  'meta_query' => array(
76
+ array(
77
+ 'value' => 'hide-amp',
78
+ 'compare' => '!='
79
+ )
80
+ )
81
  );
82
  }
83
  }//end of block for tags
104
  <span class="related-title"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' )); ?></span>
105
  <ol class="clearfix">
106
  <?php
107
+ $current_id = ampforwp_get_the_ID();
108
  while( $my_query->have_posts() ) {
109
  $my_query->the_post();
110
+ if(ampforwp_get_the_ID()==$current_id){
111
+ continue;
112
+ }
113
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
114
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
115
  $related_post_permalink = get_permalink();
templates/design-manager/design-2/style.php CHANGED
@@ -28,7 +28,7 @@ global $redux_builder_amp;
28
  ?>
29
 
30
  <?php // Menu elemensts colors
31
- $header_bg_clr = ampforwp_get_setting('amp-d2-background-color','color');
32
  $header_elements_clr = ampforwp_get_setting('amp-d2-elements-color','color');
33
  $menu_sidebar_clr = ampforwp_get_setting('amp-d2-sidebar-color','color');
34
  $menu_bg_clr = ampforwp_get_setting('amp-d2-menu-bg-color','color');
28
  ?>
29
 
30
  <?php // Menu elemensts colors
31
+ $header_bg_clr = ampforwp_get_setting('amp-d2-background-color','rgba');
32
  $header_elements_clr = ampforwp_get_setting('amp-d2-elements-color','color');
33
  $menu_sidebar_clr = ampforwp_get_setting('amp-d2-sidebar-color','color');
34
  $menu_bg_clr = ampforwp_get_setting('amp-d2-menu-bg-color','color');
templates/design-manager/design-3/elements/related-posts.php CHANGED
@@ -25,13 +25,13 @@ if( $current_post_type = get_post_type( $post )) {
25
  'order' => 'DESC',
26
  'orderby' => $orderby,
27
  'post_type' => $current_post_type,
28
- 'post__not_in' => array( $post->ID ),
29
  'no_found_rows' => true,
30
  'meta_query' => array(
31
- array(
32
- 'key' => 'ampforwp-amp-on-off',
33
- 'value' => 'default',
34
- ))
 
35
 
36
  );
37
  }
@@ -44,23 +44,18 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==2){
44
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
45
  $args=array(
46
  'category__in' => $category_ids,
47
- 'post__not_in' => array($post->ID),
48
  'posts_per_page' => $int_number_of_related_posts,
49
  'ignore_sticky_posts'=> 1,
50
  'has_password' => false ,
51
  'post_status' => 'publish',
52
  'no_found_rows' => true,
53
  'orderby' => $orderby,
54
- 'meta_query' => array(
55
- 'relation' => 'OR',
56
- array(
57
- 'key' => 'ampforwp-amp-on-off',
58
- 'value' => 'default',
59
- ),
60
- array(
61
- 'key' => 'ampforwp-amp-on-off',
62
- 'compare' => 'NOT EXISTS',
63
- ))
64
  );
65
  }
66
  } //end of block for categories
@@ -72,18 +67,19 @@ if($redux_builder_amp['ampforwp-single-select-type-of-related']==1) {
72
  foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
73
  $args=array(
74
  'tag__in' => $tag_ids,
75
- 'post__not_in' => array($post->ID),
76
  'posts_per_page' => $int_number_of_related_posts,
77
  'ignore_sticky_posts'=> 1,
78
  'has_password' => false ,
79
  'post_status' => 'publish',
80
  'no_found_rows' => true,
81
  'orderby' => $orderby,
82
- 'meta_query' => array(
83
- array(
84
- 'key' => 'ampforwp-amp-on-off',
85
- 'value' => 'default',
86
- ))
 
87
  );
88
  }
89
  }//end of block for tags
@@ -110,8 +106,12 @@ if( isset($redux_builder_amp['ampforwp-single-related-posts-switch']) && $redux_
110
  <span class="related-title"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' )); ?></span>
111
  <ol class="clearfix">
112
  <?php
 
113
  while( $my_query->have_posts() ) {
114
  $my_query->the_post();
 
 
 
115
  $related_post_permalink = "";
116
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
117
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
25
  'order' => 'DESC',
26
  'orderby' => $orderby,
27
  'post_type' => $current_post_type,
 
28
  'no_found_rows' => true,
29
  'meta_query' => array(
30
+ array(
31
+ 'value' => 'hide-amp',
32
+ 'compare' => '!='
33
+ )
34
+ )
35
 
36
  );
37
  }
44
  foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
45
  $args=array(
46
  'category__in' => $category_ids,
 
47
  'posts_per_page' => $int_number_of_related_posts,
48
  'ignore_sticky_posts'=> 1,
49
  'has_password' => false ,
50
  'post_status' => 'publish',
51
  'no_found_rows' => true,
52
  'orderby' => $orderby,
53
+ 'meta_query' => array(
54
+ array(
55
+ 'value' => 'hide-amp',
56
+ 'compare' => '!='
57
+ )
58
+ )
 
 
 
 
59
  );
60
  }
61
  } //end of block for categories
67
  foreach($ampforwp_tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
68
  $args=array(
69
  'tag__in' => $tag_ids,
70
+
71
  'posts_per_page' => $int_number_of_related_posts,
72
  'ignore_sticky_posts'=> 1,
73
  'has_password' => false ,
74
  'post_status' => 'publish',
75
  'no_found_rows' => true,
76
  'orderby' => $orderby,
77
+ 'meta_query' => array(
78
+ array(
79
+ 'value' => 'hide-amp',
80
+ 'compare' => '!='
81
+ )
82
+ )
83
  );
84
  }
85
  }//end of block for tags
106
  <span class="related-title"><?php echo esc_attr(ampforwp_translation( $redux_builder_amp['amp-translator-related-text'], 'Related Post' )); ?></span>
107
  <ol class="clearfix">
108
  <?php
109
+ $current_id = ampforwp_get_the_ID();
110
  while( $my_query->have_posts() ) {
111
  $my_query->the_post();
112
+ if(ampforwp_get_the_ID()==$current_id){
113
+ continue;
114
+ }
115
  $related_post_permalink = "";
116
  $related_post_permalink = ampforwp_url_controller( get_permalink() );
117
  if ( ampforwp_get_setting('ampforwp-single-related-posts-link') ) {
templates/design-manager/design-3/style.php CHANGED
@@ -122,7 +122,7 @@ figure.aligncenter amp-img {
122
  }
123
  /* Slide Navigation code */
124
  <?php
125
- $headercolor = ampforwp_get_setting('amp-opt-color-rgba-headercolor','color');
126
  $headerelements = ampforwp_get_setting('amp-opt-color-rgba-headerelements','color');
127
  $menubgcolor = ampforwp_get_setting('amp-opt-color-rgba-menu-bg-color','color');
128
  $navmenucolor = ampforwp_get_setting('amp-opt-color-rgba-menu-elements-color','color');
122
  }
123
  /* Slide Navigation code */
124
  <?php
125
+ $headercolor = ampforwp_get_setting('amp-opt-color-rgba-headercolor','rgba');
126
  $headerelements = ampforwp_get_setting('amp-opt-color-rgba-headerelements','color');
127
  $menubgcolor = ampforwp_get_setting('amp-opt-color-rgba-menu-bg-color','color');
128
  $navmenucolor = ampforwp_get_setting('amp-opt-color-rgba-menu-elements-color','color');
templates/design-manager/swift/single.php CHANGED
@@ -111,8 +111,12 @@ global $redux_builder_amp; ?>
111
  <ul class="clearfix">
112
  <?php ampforwp_related_post(); ?>
113
  <?php
 
114
  while( $my_query->have_posts() ) {
115
  $my_query->the_post();
 
 
 
116
  ?>
117
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
118
  <?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { if(ampforwp_has_post_thumbnail()){?>
@@ -163,8 +167,12 @@ do_action("ampforwp_single_design_type_handle_d1");
163
  <?php ampforwp_related_post(); ?>
164
  <ul class="clearfix">
165
  <?php
 
166
  while( $my_query->have_posts() ) {
167
  $my_query->the_post();
 
 
 
168
  ?>
169
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
170
  <?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { if(ampforwp_has_post_thumbnail()){?>
@@ -207,8 +215,12 @@ do_action("ampforwp_single_design_type_handle_d1");
207
  <?php ampforwp_related_post(); ?>
208
  <amp-carousel height="310" layout="fixed-height" type="carousel">
209
  <?php
 
210
  while( $my_query->have_posts() ) {
211
  $my_query->the_post();
 
 
 
212
  ?>
213
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
214
  <div class="rp-slide">
@@ -383,8 +395,12 @@ do_action("ampforwp_single_design_type_handle_d1");
383
  <?php ampforwp_related_post(); ?>
384
  <ul class="clearfix">
385
  <?php
 
386
  while( $my_query->have_posts() ) {
387
  $my_query->the_post();
 
 
 
388
  ?>
389
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
390
  <?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { ?>
111
  <ul class="clearfix">
112
  <?php ampforwp_related_post(); ?>
113
  <?php
114
+ $current_id = ampforwp_get_the_ID();
115
  while( $my_query->have_posts() ) {
116
  $my_query->the_post();
117
+ if(ampforwp_get_the_ID()==$current_id){
118
+ continue;
119
+ }
120
  ?>
121
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
122
  <?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { if(ampforwp_has_post_thumbnail()){?>
167
  <?php ampforwp_related_post(); ?>
168
  <ul class="clearfix">
169
  <?php
170
+ $current_id = ampforwp_get_the_ID();
171
  while( $my_query->have_posts() ) {
172
  $my_query->the_post();
173
+ if(ampforwp_get_the_ID()==$current_id){
174
+ continue;
175
+ }
176
  ?>
177
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
178
  <?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { if(ampforwp_has_post_thumbnail()){?>
215
  <?php ampforwp_related_post(); ?>
216
  <amp-carousel height="310" layout="fixed-height" type="carousel">
217
  <?php
218
+ $current_id = ampforwp_get_the_ID();
219
  while( $my_query->have_posts() ) {
220
  $my_query->the_post();
221
+ if(ampforwp_get_the_ID()==$current_id){
222
+ continue;
223
+ }
224
  ?>
225
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
226
  <div class="rp-slide">
395
  <?php ampforwp_related_post(); ?>
396
  <ul class="clearfix">
397
  <?php
398
+ $current_id = ampforwp_get_the_ID();
399
  while( $my_query->have_posts() ) {
400
  $my_query->the_post();
401
+ if(ampforwp_get_the_ID()==$current_id){
402
+ continue;
403
+ }
404
  ?>
405
  <li class="<?php if ( has_post_thumbnail() ) { echo'has_thumbnail'; } else { echo 'no_thumbnail'; } ?>">
406
  <?php if ( true == $redux_builder_amp['ampforwp-single-related-posts-image'] ) { ?>
templates/design-manager/swift/style.php CHANGED
@@ -17,7 +17,7 @@ $icon_url = ampforwp_font_url($icon_url);
17
  $font_content = '';
18
  $font_content = ampforwp_get_setting('amp_font_selector_content_single');
19
  $header_type = ampforwp_get_setting('header-type');
20
- $header_bg_color = ampforwp_get_setting('swift-background-scheme','color');
21
  if(!defined('AMPFORWP_LAYOUTS_FILE')){
22
  if( !in_array($header_type, array(1,2,3,10)) ){
23
  $header_type = 1;
@@ -104,6 +104,7 @@ if ( $ampforwp_font_icon == 'swift-icons' || ( $ampforwp_font_icon == 'fontawes
104
  header .cntr{
105
  <?php if( ampforwp_get_setting('swift-width-control') ){?>
106
  max-width:<?php echo esc_html(ampforwp_get_setting('swift-width-control'));?>;
 
107
  <?php }?>
108
  }
109
  <?php if($redux_builder_amp['amp-sticky-header'] == '1'){?>
17
  $font_content = '';
18
  $font_content = ampforwp_get_setting('amp_font_selector_content_single');
19
  $header_type = ampforwp_get_setting('header-type');
20
+ $header_bg_color = ampforwp_get_setting('swift-background-scheme','rgba');
21
  if(!defined('AMPFORWP_LAYOUTS_FILE')){
22
  if( !in_array($header_type, array(1,2,3,10)) ){
23
  $header_type = 1;
104
  header .cntr{
105
  <?php if( ampforwp_get_setting('swift-width-control') ){?>
106
  max-width:<?php echo esc_html(ampforwp_get_setting('swift-width-control'));?>;
107
+ margin: 0 auto;
108
  <?php }?>
109
  }
110
  <?php if($redux_builder_amp['amp-sticky-header'] == '1'){?>
templates/features.php CHANGED
@@ -6595,7 +6595,7 @@ function ampforwp_ajax_cats(){
6595
  die;
6596
  }
6597
  $return = array();
6598
- $categories = get_categories(array('search'=> esc_html($_GET['q']),'number'=>500));
6599
  $categories_array = array();
6600
  if ( $categories ) :
6601
  foreach ($categories as $cat ) {
@@ -7348,7 +7348,7 @@ function ampforwp_front_admin_menu_bar(){
7348
  if( is_user_logged_in() ){
7349
  $pref = get_user_option( "show_admin_bar_front", get_current_user_id() );
7350
  if($pref==="true"){
7351
- if(class_exists('QM_Plugin') && ampforwp_get_setting('ampforwp-query-monitor')){
7352
  $dis = QM_Dispatchers::get( 'html' );
7353
  if($dis->did_footer==false){
7354
  $dis->did_footer = true;
6595
  die;
6596
  }
6597
  $return = array();
6598
+ $categories = get_categories(array('search'=> esc_html($_GET['q']),'number'=>500,'hide_empty' => 0));
6599
  $categories_array = array();
6600
  if ( $categories ) :
6601
  foreach ($categories as $cat ) {
7348
  if( is_user_logged_in() ){
7349
  $pref = get_user_option( "show_admin_bar_front", get_current_user_id() );
7350
  if($pref==="true"){
7351
+ if(class_exists('QM_Plugin') && class_exists('QM_Dispatchers') && ampforwp_get_setting('ampforwp-query-monitor')){
7352
  $dis = QM_Dispatchers::get( 'html' );
7353
  if($dis->did_footer==false){
7354
  $dis->did_footer = true;
templates/instant-articles/instant-article.php CHANGED
@@ -125,6 +125,7 @@
125
  'post_status' => 'publish',
126
  );
127
  }
 
128
  $related_articles_loop = new WP_Query( $query_args );
129
  $related_articles = $related_articles_loop->get_posts();
130
  if ( $related_articles_loop->have_posts() ) :?>
125
  'post_status' => 'publish',
126
  );
127
  }
128
+ $query_args = apply_filters('ampforwp_ia_related_articles_query_args', $query_args);
129
  $related_articles_loop = new WP_Query( $query_args );
130
  $related_articles = $related_articles_loop->get_posts();
131
  if ( $related_articles_loop->have_posts() ) :?>
templates/woo-widget.php CHANGED
@@ -46,6 +46,7 @@ class AMPFORWP_Woo_Widget extends WP_Widget {
46
  'orderby' => 'date',
47
  'post__not_in' => $exclude_ids,
48
  'has_password' => false,
 
49
  'post_status' => 'publish',
50
  'posts_per_page' => esc_attr( $ampforwp_number_of_products )
51
  ) );
46
  'orderby' => 'date',
47
  'post__not_in' => $exclude_ids,
48
  'has_password' => false,
49
+ 'no_found_rows' => true,
50
  'post_status' => 'publish',
51
  'posts_per_page' => esc_attr( $ampforwp_number_of_products )
52
  ) );