AMP for WP – Accelerated Mobile Pages - Version 1.0.34

Version Description

(19th March 2020) = * Improvement: Matomo (Piwik) analytics improvements #4271 #4280 * Improvement: Custom page template improvements #4244 * Improvement: Option to add/remove "nofollow" in the comment button #4266 * Fixed: Spaces issue fixed in image carousel #4141 * Fixed: Reusable blocks not working in the Custom AMP Editor #4187 * Fixed: Comments pagination was not working in amp takeover beta #4251 * Fixed: lightbox issue fixed #4222 * Fixed: When AMP Dev mode and Mobile redirection both kept on then the website displays AMP on the mobile device #4276 * Fixed: debug warnings on Fresh WP installation #4270 * Fixed: Treeshaking was not working with "Product Review Lite Plugin" #4256 * Fixed: Tables was not responsive in Mobile view design one #4278 * Fixed: Have to make compatible with wordpress4.4.2 version #4262 * Fixed: Click here link not working in mobile view of Subscribe to Comments Reloaded plugin #4225 * Fixed: Post pagination not working in custom AMP Editor #4255 * Fixed: Depreciated categories widget #4274 * Fixed: Weekday removed from parameter 'published at' in the analytice code #4281

Download this release

Release Info

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

Code changes from version 1.0.33 to 1.0.34

README.md CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
- Stable tag: 1.0.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,24 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  = 1.0.33 (11th March 2020) =
198
  * Fixed: Categories not Hiding in Instant Articles #4254
199
  * Fixed: Error when activating imagify plugin #4260
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.34
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.34 (19th March 2020) =
198
+ * Improvement: Matomo (Piwik) analytics improvements #4271 #4280
199
+ * Improvement: Custom page template improvements #4244
200
+ * Improvement: Option to add/remove "nofollow" in the comment button #4266
201
+ * Fixed: Spaces issue fixed in image carousel #4141
202
+ * Fixed: Reusable blocks not working in the Custom AMP Editor #4187
203
+ * Fixed: Comments pagination was not working in amp takeover beta #4251
204
+ * Fixed: lightbox issue fixed #4222
205
+ * Fixed: When AMP Dev mode and Mobile redirection both kept on then the website displays AMP on the mobile device #4276
206
+ * Fixed: debug warnings on Fresh WP installation #4270
207
+ * Fixed: Treeshaking was not working with "Product Review Lite Plugin" #4256
208
+ * Fixed: Tables was not responsive in Mobile view design one #4278
209
+ * Fixed: Have to make compatible with wordpress4.4.2 version #4262
210
+ * Fixed: Click here link not working in mobile view of Subscribe to Comments Reloaded plugin #4225
211
+ * Fixed: Post pagination not working in custom AMP Editor #4255
212
+ * Fixed: Depreciated categories widget #4274
213
+ * Fixed: Weekday removed from parameter 'published at' in the analytice code #4281
214
+
215
  = 1.0.33 (11th March 2020) =
216
  * Fixed: Categories not Hiding in Instant Articles #4254
217
  * Fixed: Error when activating imagify plugin #4260
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.33
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
- define('AMPFORWP_VERSION','1.0.33');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
@@ -635,7 +635,6 @@ add_action('init','ampforwp_plugin_init', 9);
635
  * customized output widget
636
  * to be used be used in before or after Loop
637
  */
638
- ampforwp_require_file( AMPFORWP_PLUGIN_DIR.'/templates/category-widget.php' );
639
  ampforwp_require_file( AMPFORWP_PLUGIN_DIR.'/templates/woo-widget.php' );
640
 
641
 
@@ -1113,6 +1112,18 @@ function ampforwp_add_plugin_meta_links($meta_fields, $file) {
1113
  // AMPforWP Global Data variable
1114
  $ampforwp_data = array();
1115
 
 
 
 
 
 
 
 
 
 
 
 
 
1116
  // color sanitizer
1117
  function ampforwp_sanitize_color( $color ) {
1118
  if ( empty( $color ) || is_array( $color ) )
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.34
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
+ define('AMPFORWP_VERSION','1.0.34');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  if(!defined('AMPFROWP_HOST_NAME')){
26
  $urlinfo = get_bloginfo('url');
635
  * customized output widget
636
  * to be used be used in before or after Loop
637
  */
 
638
  ampforwp_require_file( AMPFORWP_PLUGIN_DIR.'/templates/woo-widget.php' );
639
 
640
 
1112
  // AMPforWP Global Data variable
1113
  $ampforwp_data = array();
1114
 
1115
+ if(!function_exists('sanitize_hex_color')){
1116
+ function sanitize_hex_color( $color ) {
1117
+ if ( '' === $color ) {
1118
+ return '';
1119
+ }
1120
+
1121
+ // 3 or 6 hex digits, or the empty string.
1122
+ if ( preg_match( '|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
1123
+ return $color;
1124
+ }
1125
+ }
1126
+ }
1127
  // color sanitizer
1128
  function ampforwp_sanitize_color( $color ) {
1129
  if ( empty( $color ) || is_array( $color ) )
changelog.txt CHANGED
@@ -1,5 +1,23 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.0.33 (11th March 2020) =
4
  * Fixed: Categories not Hiding in Instant Articles #4254
5
  * Fixed: Error when activating imagify plugin #4260
1
  == Changelog ==
2
 
3
+ = 1.0.34 (19th March 2020) =
4
+ * Improvement: Matomo (Piwik) analytics improvements #4271 #4280
5
+ * Improvement: Custom page template improvements #4244
6
+ * Improvement: Option to add/remove "nofollow" in the comment button #4266
7
+ * Fixed: Spaces issue fixed in image carousel #4141
8
+ * Fixed: Reusable blocks not working in the Custom AMP Editor #4187
9
+ * Fixed: Comments pagination was not working in amp takeover beta #4251
10
+ * Fixed: lightbox issue fixed #4222
11
+ * Fixed: When AMP Dev mode and Mobile redirection both kept on then the website displays AMP on the mobile device #4276
12
+ * Fixed: debug warnings on Fresh WP installation #4270
13
+ * Fixed: Treeshaking was not working with "Product Review Lite Plugin" #4256
14
+ * Fixed: Tables was not responsive in Mobile view design one #4278
15
+ * Fixed: Have to make compatible with wordpress4.4.2 version #4262
16
+ * Fixed: Click here link not working in mobile view of Subscribe to Comments Reloaded plugin #4225
17
+ * Fixed: Post pagination not working in custom AMP Editor #4255
18
+ * Fixed: Depreciated categories widget #4274
19
+ * Fixed: Weekday removed from parameter 'published at' in the analytice code #4281
20
+
21
  = 1.0.33 (11th March 2020) =
22
  * Fixed: Categories not Hiding in Instant Articles #4254
23
  * Fixed: Error when activating imagify plugin #4260
components/comments/comments.php CHANGED
@@ -107,6 +107,9 @@ function ampforwp_framework_get_comments(){
107
  'echo' => false,
108
  'add_fragment' => '#comments',
109
  );
 
 
 
110
  if ( paginate_comments_links($args) ) { ?>
111
  <div class="cmts-wrap">
112
  <?php echo paginate_comments_links( $args ); ?>
@@ -117,11 +120,15 @@ function ampforwp_framework_get_comments(){
117
  } // if ( $comments )
118
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
119
  <div class="amp-comment-button">
120
- <?php if ( comments_open($postID) ) { ?>
121
- <a href="<?php echo ampforwp_comment_button_url(); ?>" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text')?>" rel="nofollow"><?php echo esc_html(ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ) ); ?></a> <?php
122
- }?>
123
- </div> <?php
124
- }?>
 
 
 
 
125
  </div>
126
  <?php do_action('ampforwp_after_comment_hook');
127
  }
107
  'echo' => false,
108
  'add_fragment' => '#comments',
109
  );
110
+ if(true == ampforwp_get_setting('ampforwp-amp-takeover')){
111
+ $args['base'] = get_the_permalink().'comment-page-%#%';
112
+ }
113
  if ( paginate_comments_links($args) ) { ?>
114
  <div class="cmts-wrap">
115
  <?php echo paginate_comments_links( $args ); ?>
120
  } // if ( $comments )
121
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
122
  <div class="amp-comment-button">
123
+ <?php if ( comments_open($postID) ) {
124
+ $nofollow = '';
125
+ if(true ==ampforwp_get_setting('ampforwp-nofollow-comment-btn')){
126
+ $nofollow = 'rel=nofollow';
127
+ }
128
+ ?>
129
+ <a href="<?php echo ampforwp_comment_button_url(); ?>" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text')?>" <?php echo esc_html($nofollow) ?> ><?php echo esc_html(ampforwp_translation( ampforwp_get_setting('amp-translator-leave-a-comment-text'), 'Leave a Comment' ) ); ?></a> <?php } ?>
130
+ </div>
131
+ <?php } ?>
132
  </div>
133
  <?php do_action('ampforwp_after_comment_hook');
134
  }
includes/features/analytics/analytics-functions.php CHANGED
@@ -99,7 +99,6 @@ function ampforwp_analytics() {
99
  $url = get_the_permalink();
100
  $url = ampforwp_remove_protocol(ampforwp_url_controller($url));
101
  $rand = rand(1111,9999);
102
- $pview = ampforwp_remove_protocol(site_url());
103
  $referer = $url;
104
  if(isset($_SERVER['HTTP_REFERER'])) {
105
  $referer = $_SERVER['HTTP_REFERER'];
@@ -107,7 +106,7 @@ function ampforwp_analytics() {
107
  $piwik_api = str_replace("YOUR_SITE_ID", '1', $idsite);
108
  $piwik_api = str_replace("TITLE", esc_attr($title), $piwik_api);
109
  $piwik_api = str_replace("DOCUMENT_REFERRER", esc_url($referer), $piwik_api);
110
- $piwik_api = str_replace("CANONICAL_URL", esc_url($pview), $piwik_api);
111
  $piwik_api = str_replace("RANDOM", intval($rand), $piwik_api);
112
  ?>
113
  <amp-pixel src="<?php echo $piwik_api; // XXS ok, escaped above?>"></amp-pixel>
@@ -412,7 +411,7 @@ function ampforwp_add_advance_ga_fields($ga_fields){
412
  }
413
  $author_id = get_post_field( 'post_author', $id );
414
  $author_name = get_the_author_meta( 'display_name' , $author_id );
415
- $published_at = get_the_date( 'l F j, Y' , $id );
416
  $ampforwp_adv_ga_fields = array();
417
  $ampforwp_adv_ga_fields = ampforwp_get_setting('ampforwp-ga-field-advance');
418
  if($ampforwp_adv_ga_fields) {
99
  $url = get_the_permalink();
100
  $url = ampforwp_remove_protocol(ampforwp_url_controller($url));
101
  $rand = rand(1111,9999);
 
102
  $referer = $url;
103
  if(isset($_SERVER['HTTP_REFERER'])) {
104
  $referer = $_SERVER['HTTP_REFERER'];
106
  $piwik_api = str_replace("YOUR_SITE_ID", '1', $idsite);
107
  $piwik_api = str_replace("TITLE", esc_attr($title), $piwik_api);
108
  $piwik_api = str_replace("DOCUMENT_REFERRER", esc_url($referer), $piwik_api);
109
+ $piwik_api = str_replace("CANONICAL_URL", esc_url($url), $piwik_api);
110
  $piwik_api = str_replace("RANDOM", intval($rand), $piwik_api);
111
  ?>
112
  <amp-pixel src="<?php echo $piwik_api; // XXS ok, escaped above?>"></amp-pixel>
411
  }
412
  $author_id = get_post_field( 'post_author', $id );
413
  $author_name = get_the_author_meta( 'display_name' , $author_id );
414
+ $published_at = get_the_date( 'F j, Y' , $id );
415
  $ampforwp_adv_ga_fields = array();
416
  $ampforwp_adv_ga_fields = ampforwp_get_setting('ampforwp-ga-field-advance');
417
  if($ampforwp_adv_ga_fields) {
includes/features/analytics/analytics-options.php CHANGED
@@ -278,12 +278,16 @@ function ampforwp_analytics_options($opt_name){
278
  'id' => 'pa-feild',
279
  'class' => 'child_opt',
280
  'type' => 'text',
281
- 'title' => esc_html__( ' Matomo (Piwik) Analytics', 'accelerated-mobile-pages' ),
 
 
 
 
282
  'required' => array(
283
  array('ampforwp-Piwik-switch', '=' , '1')
284
  ),
285
  'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/'), esc_html__( 'How to add Matomo Piwik Analytics in AMP?','accelerated-mobile-pages') ),
286
- 'default' => '#',
287
  ),
288
  // Quantcast
289
  array(
278
  'id' => 'pa-feild',
279
  'class' => 'child_opt',
280
  'type' => 'text',
281
+ 'title' => esc_html__( ' Enter Your Piwik Analytics URL', 'accelerated-mobile-pages' ),
282
+ 'desc'=>sprintf( 'Example -
283
+ https://YOUR_PIWIK_BASE_INSTALLATION_URL/piwik.php?idsite=1&amp;rec=1&amp;
284
+ action_name=TITLE&amp;urlref=DOCUMENT_REFERRER&amp;url=CANONICAL_URL&amp;
285
+ rand=RANDOM <a href="https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/" target="_blank">%s</a>',esc_html__('View integration tutorial','accelerated-mobile-pages' )),
286
  'required' => array(
287
  array('ampforwp-Piwik-switch', '=' , '1')
288
  ),
289
  'tooltip-subtitle' => sprintf('%s<a href="%s" target="_blank">%s</a>', esc_html__( 'Tutorial: ','accelerated-mobile-pages' ), esc_url('https://ampforwp.com/tutorials/article/how-to-add-matomo-piwik-analytics-in-amp/'), esc_html__( 'How to add Matomo Piwik Analytics in AMP?','accelerated-mobile-pages') ),
290
+ 'default' => '',
291
  ),
292
  // Quantcast
293
  array(
includes/features/functions.php CHANGED
@@ -1164,7 +1164,7 @@ if( ! function_exists( 'ampforwp_additional_style_carousel_caption' ) ){
1164
  box-sizing: border-box;
1165
  }
1166
  .collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
1167
- .collapsible-captions amp-img img {object-fit: contain; }
1168
  .collapsible-captions figure { margin: 0; padding: 0; }
1169
  .collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
1170
  max-height: var(--caption-height);margin-bottom:0;
1164
  box-sizing: border-box;
1165
  }
1166
  .collapsible-captions .amp-carousel-container {position: relative; width: 100%;}
1167
+ .collapsible-captions amp-img img {object-fit: fill; }
1168
  .collapsible-captions figure { margin: 0; padding: 0; }
1169
  .collapsible-captions figcaption { position: absolute; bottom: 0;width: 100%;
1170
  max-height: var(--caption-height);margin-bottom:0;
includes/options/admin-config.php CHANGED
@@ -2228,6 +2228,15 @@ function ampforwp_get_all_tags($id){
2228
  'required' => array('wordpress-comments-support' , '=' , 1
2229
  ),
2230
  ),
 
 
 
 
 
 
 
 
 
2231
  array(
2232
  'id' => 'ampforwp-disqus-comments-support',
2233
  'type' => 'switch',
@@ -6060,6 +6069,7 @@ $single_page_options = array(
6060
  'id' => 'ampforwp-amp-img-lightbox',
6061
  'type' => 'switch',
6062
  'default' => '0',
 
6063
  'title' => esc_html__('Lightbox for Images', 'accelerated-mobile-pages'),
6064
  'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
6065
  esc_html__('Enable this option to show lightbox for images in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-enable-lightbox-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
2228
  'required' => array('wordpress-comments-support' , '=' , 1
2229
  ),
2230
  ),
2231
+ array(
2232
+ 'class' => 'child_opt child_opt_arrow',
2233
+ 'id' => 'ampforwp-nofollow-comment-btn',
2234
+ 'type' => 'switch',
2235
+ 'title' => esc_html__('No follow button', 'accelerated-mobile-pages'),
2236
+ 'tooltip-subtitle' => esc_html__('Add or remove No follow in comment button', 'accelerated-mobile-pages'),
2237
+ 'default' => 1,
2238
+ 'required' => array('wordpress-comments-support' , '=' , 1 ),
2239
+ ),
2240
  array(
2241
  'id' => 'ampforwp-disqus-comments-support',
2242
  'type' => 'switch',
6069
  'id' => 'ampforwp-amp-img-lightbox',
6070
  'type' => 'switch',
6071
  'default' => '0',
6072
+ 'class' => 'hide',
6073
  'title' => esc_html__('Lightbox for Images', 'accelerated-mobile-pages'),
6074
  'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
6075
  esc_html__('Enable this option to show lightbox for images in AMP and', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-enable-lightbox-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
includes/options/redux-core/assets/css/redux-admin.css CHANGED
@@ -37,7 +37,7 @@
37
  margin: 0px;
38
  padding: 0px;} .redux-main .form-table tr:last-child{border-bottom:none !important}.redux-main .form-table tr th,.redux-main .form-table tr td{color:#333}.redux-main .form-table tr td table.mceLayout,.redux-main .form-table tr td table.mceLayout tr,.redux-main .form-table tr td table.mceLayout tr td{padding:0;border-width:0}.redux-main .form-table tr td .redux-th-warning{font-size:1em;color:#C09853;font-weight:normal;display:block;margin-top:10px}.redux-main .form-table tr td .redux-field-warning{border-color:#C09853;margin-top:10px}.redux-main .form-table tr td .redux-th-error{font-size:1em;color:#B94A48;font-weight:normal;display:block;margin-top:10px}.redux-main input.large-text{ max-width: 400px;
39
  float: left;}.redux-main .hide{display:none }.redux-main .redux-field-container{ padding: 18px 50px 18px 0;}.redux-main .mini,.redux-main input[type=text].mini{width:60px;text-align:center}.redux-main input{line-height:19px}.redux-main img{max-width:100%;height:auto;width:auto !important}.redux-main .select2-default{width:auto !important}.redux-main .showDefaults{display:block;font-weight:normal;font-size:.8em;color:#888}.redux-main span.description{font-style: normal;
40
- left: 18px;}.redux-main #redux-system-info textarea{min-height:730px;width:100%}.redux-main .field-desc{clear:both;font-size:13px}.redux-main .data-full li{width:100%}.redux-main .data-half li{width:50%;float:left}.redux-main .data-third li{width:33.3%;float:left}.redux-main .data-quarter li{width:25%;float:left}.redux-main .ui-helper-hidden-accessible{top:inherit}.redux-main .form-table{clear:none;margin-top:0px !important}.redux-main .form-table tr:first-child th,.redux-main .form-table tr:first-child td{padding-top:0}.redux-main .input-append input{border-right:0;margin-bottom:0;border-top-right-radius:0;border-bottom-right-radius:0;margin-right:0;float:left;margin-top:0;display:block}.redux-main .input-append .add-on{border-top-right-radius:3px;border-bottom-right-radius:3px;margin-left:-2px;padding-top:4px !important;padding-bottom:2px !important}.redux-main .input-prepend input{border-left:0;margin-bottom:0;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0;padding-top:2px;padding-bottom:5px;float:left;margin-top:0;display:block}.redux-main .input-prepend .add-on{border-top-left-radius:3px;border-bottom-left-radius:3px;float:left}.redux-main .input-append{margin-right:10px;font-size:0;white-space:nowrap;float:left;display:inline-block;margin-bottom:6px}.redux-main .input-append .add-on,.redux-main .input-prepend .add-on{width:auto;display:inline-block;min-width:16px;padding:3px 4px;font-size:12px;font-weight:400;line-height:20px;text-align:center;text-shadow:0 1px 0 #ffffff;background-color:#eeeeee;border:1px solid #cccccc}.redux-main .input-prepend{font-size:0;white-space:nowrap;float:left;display:inline-block;margin-bottom:6px}.redux-sidebar{width:202px;float:left}.redux-sidebar .redux-group-menu{margin-top:0 !important}
41
 
42
  .redux-sidebar .redux-group-menu li{margin-top:0}.redux-sidebar .redux-group-menu li.active a,.redux-sidebar .redux-group-menu li.active a:hover,.redux-sidebar .redux-group-menu li.activeChild a,.redux-sidebar .redux-group-menu li.activeChild a:hover{background:#FCFCFC;color:#269ad6;width:184px;opacity:1}.redux-sidebar .redux-group-menu li.active a li a{background:#333;padding-left:5px}.redux-sidebar .redux-group-menu li.divide{padding:0;border-width:1px 0;border-style:solid;border-bottom-color:#E7E7E7;border-top-color:#F9F9F9}.redux-sidebar .redux-group-menu li a:first-child{border-top:none}.redux-sidebar .redux-group-menu li a{display:block;padding:14px 4px 14px 10px;background:#e0e0e0;background:transparent;border-width:1px 0;border-style:solid;border-bottom-color:#E7E7E7;border-top-color:#F9F9F9;opacity:0.7;color:#555;font-weight:600;text-decoration:none;-webkit-transition:none;transition:none}.redux-sidebar .redux-group-menu li a.custom-tab{background:#f6f6f6}.redux-sidebar .redux-group-menu li a img{width:16px;height:16px;position:absolute;left:15px}.redux-sidebar .redux-group-menu li a:hover{color:#fff;background: #f45c43;background: linear-gradient(to right,#eb3349,#f45c43);opacity:1}.redux-sidebar .redux-menu-warning,.redux-sidebar .redux-menu-error,.redux-sidebar .hasSubSections .extraIconSubsections{display:inline-block;float:right;padding:6px 7px 4px 7px;margin-left:4px;font-family:sans-serif;font-size:9px;font-weight:600;line-height:9px;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;border:0 solid transparent}.redux-sidebar .redux-menu-warning i,.redux-sidebar .redux-menu-error i,.redux-sidebar .hasSubSections .extraIconSubsections i{display: none}.redux-sidebar .redux-menu-error{background-color:#b94a48;color:#f2dede}.redux-sidebar .redux-menu-warning{background-color:#C09853;color:#FCF8E3}.redux-sidebar ul .subsection{display:none}.redux-sidebar .redux-group-tab-link-a{position:relative;outline:0}
43
  .redux-sidebar .redux-group-tab-link-a i{
37
  margin: 0px;
38
  padding: 0px;} .redux-main .form-table tr:last-child{border-bottom:none !important}.redux-main .form-table tr th,.redux-main .form-table tr td{color:#333}.redux-main .form-table tr td table.mceLayout,.redux-main .form-table tr td table.mceLayout tr,.redux-main .form-table tr td table.mceLayout tr td{padding:0;border-width:0}.redux-main .form-table tr td .redux-th-warning{font-size:1em;color:#C09853;font-weight:normal;display:block;margin-top:10px}.redux-main .form-table tr td .redux-field-warning{border-color:#C09853;margin-top:10px}.redux-main .form-table tr td .redux-th-error{font-size:1em;color:#B94A48;font-weight:normal;display:block;margin-top:10px}.redux-main input.large-text{ max-width: 400px;
39
  float: left;}.redux-main .hide{display:none }.redux-main .redux-field-container{ padding: 18px 50px 18px 0;}.redux-main .mini,.redux-main input[type=text].mini{width:60px;text-align:center}.redux-main input{line-height:19px}.redux-main img{max-width:100%;height:auto;width:auto !important}.redux-main .select2-default{width:auto !important}.redux-main .showDefaults{display:block;font-weight:normal;font-size:.8em;color:#888}.redux-main span.description{font-style: normal;
40
+ left: 18px;}.redux-main #redux-system-info textarea{min-height:730px;width:100%}.redux-main .field-desc{clear:both;font-size:13px;line-height: 20px;}.redux-main .data-full li{width:100%}.redux-main .data-half li{width:50%;float:left}.redux-main .data-third li{width:33.3%;float:left}.redux-main .data-quarter li{width:25%;float:left}.redux-main .ui-helper-hidden-accessible{top:inherit}.redux-main .form-table{clear:none;margin-top:0px !important}.redux-main .form-table tr:first-child th,.redux-main .form-table tr:first-child td{padding-top:0}.redux-main .input-append input{border-right:0;margin-bottom:0;border-top-right-radius:0;border-bottom-right-radius:0;margin-right:0;float:left;margin-top:0;display:block}.redux-main .input-append .add-on{border-top-right-radius:3px;border-bottom-right-radius:3px;margin-left:-2px;padding-top:4px !important;padding-bottom:2px !important}.redux-main .input-prepend input{border-left:0;margin-bottom:0;border-top-left-radius:0;border-bottom-left-radius:0;margin-left:0;padding-top:2px;padding-bottom:5px;float:left;margin-top:0;display:block}.redux-main .input-prepend .add-on{border-top-left-radius:3px;border-bottom-left-radius:3px;float:left}.redux-main .input-append{margin-right:10px;font-size:0;white-space:nowrap;float:left;display:inline-block;margin-bottom:6px}.redux-main .input-append .add-on,.redux-main .input-prepend .add-on{width:auto;display:inline-block;min-width:16px;padding:3px 4px;font-size:12px;font-weight:400;line-height:20px;text-align:center;text-shadow:0 1px 0 #ffffff;background-color:#eeeeee;border:1px solid #cccccc}.redux-main .input-prepend{font-size:0;white-space:nowrap;float:left;display:inline-block;margin-bottom:6px}.redux-sidebar{width:202px;float:left}.redux-sidebar .redux-group-menu{margin-top:0 !important}
41
 
42
  .redux-sidebar .redux-group-menu li{margin-top:0}.redux-sidebar .redux-group-menu li.active a,.redux-sidebar .redux-group-menu li.active a:hover,.redux-sidebar .redux-group-menu li.activeChild a,.redux-sidebar .redux-group-menu li.activeChild a:hover{background:#FCFCFC;color:#269ad6;width:184px;opacity:1}.redux-sidebar .redux-group-menu li.active a li a{background:#333;padding-left:5px}.redux-sidebar .redux-group-menu li.divide{padding:0;border-width:1px 0;border-style:solid;border-bottom-color:#E7E7E7;border-top-color:#F9F9F9}.redux-sidebar .redux-group-menu li a:first-child{border-top:none}.redux-sidebar .redux-group-menu li a{display:block;padding:14px 4px 14px 10px;background:#e0e0e0;background:transparent;border-width:1px 0;border-style:solid;border-bottom-color:#E7E7E7;border-top-color:#F9F9F9;opacity:0.7;color:#555;font-weight:600;text-decoration:none;-webkit-transition:none;transition:none}.redux-sidebar .redux-group-menu li a.custom-tab{background:#f6f6f6}.redux-sidebar .redux-group-menu li a img{width:16px;height:16px;position:absolute;left:15px}.redux-sidebar .redux-group-menu li a:hover{color:#fff;background: #f45c43;background: linear-gradient(to right,#eb3349,#f45c43);opacity:1}.redux-sidebar .redux-menu-warning,.redux-sidebar .redux-menu-error,.redux-sidebar .hasSubSections .extraIconSubsections{display:inline-block;float:right;padding:6px 7px 4px 7px;margin-left:4px;font-family:sans-serif;font-size:9px;font-weight:600;line-height:9px;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;border:0 solid transparent}.redux-sidebar .redux-menu-warning i,.redux-sidebar .redux-menu-error i,.redux-sidebar .hasSubSections .extraIconSubsections i{display: none}.redux-sidebar .redux-menu-error{background-color:#b94a48;color:#f2dede}.redux-sidebar .redux-menu-warning{background-color:#C09853;color:#FCF8E3}.redux-sidebar ul .subsection{display:none}.redux-sidebar .redux-group-tab-link-a{position:relative;outline:0}
43
  .redux-sidebar .redux-group-tab-link-a i{
includes/redirect.php CHANGED
@@ -184,7 +184,7 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
184
  }
185
 
186
  // Mobile redirection
187
- if ( ampforwp_get_setting('amp-mobile-redirection') ) {
188
  require_once AMPFORWP_PLUGIN_DIR.'/includes/vendor/Mobile_Detect.php';
189
  $post_type = '';
190
  $supported_types = '';
@@ -283,6 +283,12 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
283
  }
284
  // Check if we are on Mobile phones then start redirection process
285
  if ( $redirectToAMP ) {
 
 
 
 
 
 
286
  if(!isset($_GET['nonamphead']) && isset($_SESSION['nonamphead']) && in_array($url_to_redirect, $_SESSION['nonamphead'])){
287
  return;
288
  }
@@ -298,6 +304,12 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
298
  return;
299
  }
300
  }
 
 
 
 
 
 
301
  // #1947 when nonamp=1 it should redirect to original link
302
  $go_to_url = "";
303
  $url = "";
184
  }
185
 
186
  // Mobile redirection
187
+ if ( ampforwp_get_setting('amp-mobile-redirection') && false == ampforwp_get_setting('ampforwp-development-mode')) {
188
  require_once AMPFORWP_PLUGIN_DIR.'/includes/vendor/Mobile_Detect.php';
189
  $post_type = '';
190
  $supported_types = '';
283
  }
284
  // Check if we are on Mobile phones then start redirection process
285
  if ( $redirectToAMP ) {
286
+ if(class_exists('stcr\\stcr_manage') ){
287
+ $check_url = implode(', ', $current_url);
288
+ if(in_array('comment-subscriptions', $current_url) && strpos($check_url,'srp')!=false && strpos($check_url,'srk')!=false){
289
+ return true;
290
+ }
291
+ }
292
  if(!isset($_GET['nonamphead']) && isset($_SESSION['nonamphead']) && in_array($url_to_redirect, $_SESSION['nonamphead'])){
293
  return;
294
  }
304
  return;
305
  }
306
  }
307
+ if(class_exists('stcr\\stcr_manage') ){
308
+ $check_url = implode(', ', $current_url);
309
+ if(in_array('comment-subscriptions', $current_url) && strpos($check_url,'srp')!=false && strpos($check_url,'srk')!=false){
310
+ return true;
311
+ }
312
+ }
313
  // #1947 when nonamp=1 it should redirect to original link
314
  $go_to_url = "";
315
  $url = "";
includes/thirdparty-compatibility.php CHANGED
@@ -83,7 +83,10 @@ require_once AMPFORWP_PLUGIN_DIR . '/includes/updater/update.php';
83
  }
84
 
85
  // Custom Template Files
86
- function ampforwp_child_designing_custom_template( $file, $type, $post ) {
 
 
 
87
  global $redux_builder_amp;
88
  $currentFile = $file;
89
  $filePath = ampforwp_theme_template_directry();
83
  }
84
 
85
  // Custom Template Files
86
+ function ampforwp_child_designing_custom_template( $file, $type, $post ) {
87
+ if(!is_page_template()){
88
+ return $file;
89
+ }
90
  global $redux_builder_amp;
91
  $currentFile = $file;
92
  $filePath = ampforwp_theme_template_directry();
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.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,24 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  = 1.0.33 (11th March 2020) =
195
  * Fixed: Categories not Hiding in Instant Articles #4254
196
  * Fixed: Error when activating imagify plugin #4260
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.34
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.34 (19th March 2020) =
195
+ * Improvement: Matomo (Piwik) analytics improvements #4271 #4280
196
+ * Improvement: Custom page template improvements #4244
197
+ * Improvement: Option to add/remove "nofollow" in the comment button #4266
198
+ * Fixed: Spaces issue fixed in image carousel #4141
199
+ * Fixed: Reusable blocks not working in the Custom AMP Editor #4187
200
+ * Fixed: Comments pagination was not working in amp takeover beta #4251
201
+ * Fixed: lightbox issue fixed #4222
202
+ * Fixed: When AMP Dev mode and Mobile redirection both kept on then the website displays AMP on the mobile device #4276
203
+ * Fixed: debug warnings on Fresh WP installation #4270
204
+ * Fixed: Treeshaking was not working with "Product Review Lite Plugin" #4256
205
+ * Fixed: Tables was not responsive in Mobile view design one #4278
206
+ * Fixed: Have to make compatible with wordpress4.4.2 version #4262
207
+ * Fixed: Click here link not working in mobile view of Subscribe to Comments Reloaded plugin #4225
208
+ * Fixed: Post pagination not working in custom AMP Editor #4255
209
+ * Fixed: Depreciated categories widget #4274
210
+ * Fixed: Weekday removed from parameter 'published at' in the analytice code #4281
211
+
212
  = 1.0.33 (11th March 2020) =
213
  * Fixed: Categories not Hiding in Instant Articles #4254
214
  * Fixed: Error when activating imagify plugin #4260
templates/category-widget.php DELETED
@@ -1,216 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
- class AMPFORWP_Categories_Widget extends WP_Widget {
7
-
8
- // Set up the widget name and description.
9
- public function __construct() {
10
- $widget_options = array(
11
- 'classname' => 'ampforwp_categories_widget',
12
- 'description' => esc_html__('This Widget adds categories where necessary in AMP Pages','accelerated-mobile-pages')
13
- );
14
- parent::__construct( 'ampforwp_categories_widget', esc_html__('AMP Categories Module','accelerated-mobile-pages'), $widget_options );
15
- }
16
-
17
-
18
- // args for the output of the form
19
- public $args = array(
20
- 'id' => 'uniqueid',
21
- 'before_title' => '<h4 class="widgettitle">',
22
- 'after_title' => '</h4>',
23
- 'before_widget' => '<div class="widget-wrap">',
24
- 'after_widget' => '</div>'
25
- );
26
-
27
- // Create the widget output.
28
- public function widget( $args, $instance ) {
29
- $ampforwp_title = apply_filters( 'widget_title', $instance[ 'title' ] );
30
- $ampforwp_category_count = $instance[ 'count' ];
31
- $ampforwp_category_id = $instance[ 'category' ];
32
- $ampforwp_category_link = $instance[ 'showButton' ];
33
- $ampforwp_show_excerpt = $instance[ 'showExcerpt' ];
34
-
35
- global $redux_builder_amp;
36
-
37
- // echo . $args['before_title'] . . $args['after_title']; ?>
38
-
39
- <?php
40
- $exclude_ids = ampforwp_exclude_posts();
41
-
42
- $args = array(
43
- 'cat' => $ampforwp_category_id,
44
- 'posts_per_page' => $ampforwp_category_count,
45
- 'post__not_in' => $exclude_ids,
46
- 'has_password' => false,
47
- 'post_status'=> 'publish'
48
- );
49
- // The Query
50
- $the_query = new WP_Query( $args );
51
- $thumb_url = "";
52
-
53
- // The Loop
54
-
55
- if ( $the_query->have_posts() ) {
56
- echo '<div class="amp-wp-content amp_cb_module amp-category-block"><ul>';
57
- echo '<li class="amp_module_title"><span>'.esc_attr($ampforwp_title) .'</span></li>';
58
- while ( $the_query->have_posts() ) {
59
- $the_query->the_post();
60
- $ampforwp_post_url = get_permalink(); ?>
61
- <li class="amp-category-post">
62
- <?php if ( ampforwp_has_post_thumbnail() ) {
63
- $thumb_url = ampforwp_get_post_thumbnail('url');
64
- ?>
65
- <a href="<?php echo esc_url(ampforwp_url_controller($ampforwp_post_url));?>"><amp-img class="ampforwp_wc_shortcode_img" src=<?php echo esc_url($thumb_url) ?> width=150 height=150 layout="responsive"></amp-img></a>
66
- <?php } ?>
67
-
68
- <a class="ampforwp_wc_shortcode_title" href="<?php echo ampforwp_url_controller($ampforwp_post_url) ;?>">
69
- <?php echo get_the_title(); ?>
70
- </a> <?php
71
-
72
- if( $ampforwp_show_excerpt == 'yes' ) { ?>
73
- <div class="ampforwp_wc_shortcode_excerpt"> <?php
74
- if( has_excerpt() ) {
75
- $content = get_the_excerpt();
76
- } else {
77
- $content = get_the_content();
78
- } ?>
79
- <span class="ampforwp_cat_wdgt_excerpt_text"><?php echo wp_trim_words( strip_tags( strip_shortcodes( $content ) ) , 15 ); ?></span>
80
- </div> <?php
81
- } ?>
82
-
83
- </li> <?php
84
- } ?>
85
- <div class="cb"></div>
86
- <?php
87
-
88
- //show more link
89
- if( $ampforwp_category_link === 'yes' && ! empty( $ampforwp_category_id ) ) {
90
-
91
- $category_link = '<a class="amp-category-block-btn" href="'.ampforwp_url_controller(get_category_link( $ampforwp_category_id) ).'">'. esc_html(ampforwp_translation($redux_builder_amp['amp-translator-show-more-text'], 'View More Posts (Widget Button)')).'</a>';
92
- } else {
93
- $category_link = '<a class="amp-category-block-btn" href="'.ampforwp_url_controller( home_url() ).'">'. esc_html(ampforwp_translation($redux_builder_amp['amp-translator-show-more-text'], 'View More Posts (Widget Button)')).'</a>';
94
- }
95
- if( $ampforwp_category_link === 'no' ) {
96
- $category_link = '';
97
- }
98
-
99
- echo $category_link;
100
-
101
- echo '</ul> <div class="cb"></div> </div>';
102
-
103
- } else {
104
- // no posts found
105
- }
106
- /* Restore original Post Data */
107
- wp_reset_postdata();
108
- // echo $args['after_widget'];
109
- }
110
-
111
-
112
- // Create the admin area widget settings form.
113
- public function form( $instance ) {
114
-
115
- // Declarations for all the values to be stored
116
- $ampforwp_title = ! empty( $instance['title'] ) ? $instance['title'] : 'Category Title';
117
- $selected_category = ! empty( $instance['category'] ) ? $instance['category'] : '';
118
- $ampforwp_category_count = ! empty( $instance['count'] ) ? $instance['count'] : 3 ;
119
- $radio_buttons = ! empty( $instance['showButton'] ) ? $instance['showButton'] : 'yes';
120
- $excerpt_buttons = ! empty( $instance['showExcerpt'] ) ? $instance['showExcerpt'] : 'yes';
121
-
122
- ?>
123
- <!-- Form Ends Here -->
124
- <p>
125
- <!-- text Start Here -->
126
- <label for="<?php echo esc_attr($this->get_field_id( 'title' )); ?>"><?php esc_attr_e('Title:','accelerated-mobile-pages') ?>
127
- <input class="widefat" type="text" id="<?php echo esc_attr($this->get_field_id( 'title' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'title' )); ?>" value="<?php echo esc_attr( $ampforwp_title ); ?>" />
128
- </label><br>
129
- <!-- text End Here -->
130
- </p>
131
- <!-- select Start Here -->
132
- <p>
133
- <label for="<?php echo esc_attr( $this->get_field_id( 'category' ) ); ?>"><?php esc_attr_e('Category:','accelerated-mobile-pages') ?>
134
- <select id="<?php echo esc_attr($this->get_field_id('category')); ?>" name="<?php echo esc_attr($this->get_field_name('category')); ?>" class="widefat" value>
135
- <?php
136
-
137
- $categories = get_categories( array(
138
- 'orderby' => 'name',
139
- 'order' => 'ASC',
140
- 'number' => 500
141
- ) );
142
-
143
- echo '<option selected value="none">Recent Posts </option>';
144
- foreach( $categories as $category ) {
145
- echo '<option '. selected( $selected_category, $category->term_id) . ' value="'. esc_attr($category->term_id) . '">' . esc_attr($category->name) . '</option>';
146
- } ?>
147
- </select>
148
- </label>
149
- </p>
150
- <!-- select End Here -->
151
-
152
- <p>
153
- <!-- text starts Here -->
154
- <label for="<?php echo esc_attr($this->get_field_id( 'count' )); ?>"><?php esc_attr_e('Number of Posts:','accelerated-mobile-pages') ?>
155
- <input class="widefat" type="number" id="<?php echo esc_attr($this->get_field_id( 'count' )); ?>" name="<?php echo esc_attr($this->get_field_name( 'count' )); ?>" value="<?php echo esc_attr( $ampforwp_category_count ); ?>" />
156
- </label>
157
- </p>
158
- <!-- text End Here -->
159
- <p>
160
- <!-- radio buttons starts Here -->
161
- <label for="<?php echo esc_attr($this->get_field_id( 'showButton' )); ?>" value="<?php echo esc_attr( $ampforwp_title );?>"><?php esc_attr_e('Show View more Button:','accelerated-mobile-pages') ?></label><br>
162
- <label for="<?php echo esc_attr($this->get_field_id('show_button_1')); ?>">
163
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('show_button_1')); ?>" name="<?php echo esc_attr($this->get_field_name('showButton')); ?>" type="radio" value="yes" <?php if($radio_buttons === 'yes'){ echo 'checked="checked"'; } ?> /><?php esc_attr_e('Yes ','accelerated-mobile-pages'); ?>
164
- </label>
165
- <label for="<?php echo esc_attr($this->get_field_id('show_button_2')); ?>">
166
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('show_button_2')); ?>" name="<?php echo esc_attr($this->get_field_name('showButton')); ?>" type="radio" value="no" <?php if($radio_buttons === 'no'){ echo 'checked="checked"'; } ?> /><?php esc_attr_e(' No','accelerated-mobile-pages'); ?>
167
- </label>
168
- <!-- radio buttons Ends Here -->
169
- </p>
170
-
171
- <p>
172
- <!-- Excerpt related code starts Here -->
173
- <label for="<?php echo esc_attr($this->get_field_id( 'showExcerpt' )); ?>" value="<?php echo esc_attr( $ampforwp_title );?>"> <?php esc_attr_e('Show Excerpt:','accelerated-mobile-pages') ?></label><br>
174
- <label for="<?php echo esc_attr($this->get_field_id('show_button_3')); ?>">
175
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('show_button_3')); ?>" name="<?php echo esc_attr($this->get_field_name('showExcerpt')); ?>" type="radio" value="yes" <?php if($excerpt_buttons === 'yes'){ echo 'checked="checked"'; } ?> /><?php esc_attr_e('Yes ','accelerated-mobile-pages'); ?>
176
- </label>
177
- <label for="<?php echo esc_attr($this->get_field_id('show_button_4')); ?>">
178
- <input class="widefat" id="<?php echo esc_attr($this->get_field_id('show_button_4')); ?>" name="<?php echo esc_attr($this->get_field_name('showExcerpt')); ?>" type="radio" value="no" <?php if($excerpt_buttons === 'no'){ echo 'checked="checked"'; } ?> /><?php esc_attr_e(' No','accelerated-mobile-pages'); ?>
179
- </label>
180
- <!-- Excerpt related code Ends Here -->
181
- </p>
182
- <!-- Form Ends Here -->
183
-
184
- <?php
185
- }
186
-
187
-
188
-
189
- // Apply settings to the widget instance.
190
- public function update( $new_instance, $old_instance ) {
191
- $instance = $old_instance;
192
- $instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
193
- $instance[ 'count' ] = strip_tags( $new_instance[ 'count' ] );
194
-
195
- if( strip_tags( $new_instance[ 'category' ] ) !== 'none' ) {
196
- $instance[ 'category' ] = strip_tags( $new_instance[ 'category' ] );
197
- } else {
198
- $instance[ 'category' ] = '';
199
- }
200
- $instance['showButton'] = strip_tags($new_instance['showButton']);
201
- $instance['showExcerpt'] = strip_tags($new_instance['showExcerpt']);
202
- return $instance;
203
- }
204
-
205
- }
206
-
207
- // Register the widget.
208
- function ampforwp_register_categories_widget() {
209
- global $redux_builder_amp;
210
- if ( isset($redux_builder_amp['amp-design-selector']) && 4 != $redux_builder_amp['amp-design-selector'] ) {
211
- register_widget( 'AMPFORWP_Categories_Widget' );
212
- }
213
- }
214
- add_action( 'widgets_init', 'ampforwp_register_categories_widget' );
215
-
216
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/custom-amp-content-button.js CHANGED
@@ -14,7 +14,21 @@
14
  }
15
  }else if(wp.data){
16
  if ( wp.data.select( "core/editor" ) != undefined && typeof wp.data.select( "core/editor" ).getEditedPostContent() != undefined ) {
17
- var editedContent = wp.data.select( "core/editor" ).getEditedPostContent();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  editor.insertContent(editedContent);
19
  }
20
  else if( tinymce.editors.content && typeof tinymce.editors.content.getContent()!= undefined){
14
  }
15
  }else if(wp.data){
16
  if ( wp.data.select( "core/editor" ) != undefined && typeof wp.data.select( "core/editor" ).getEditedPostContent() != undefined ) {
17
+ var wp_blocks = wp.data.select( "core/block-editor" ).getBlocks();
18
+ var editedContent = '';
19
+ for(var i=0;i<wp_blocks.length;i++){
20
+ var client_id = wp_blocks[i].clientId;
21
+ var name = wp_blocks[i].name;
22
+ if((wp_blocks[i].originalContent=='' || wp_blocks[i].originalContent==undefined)){
23
+ var con = jQuery("#block-"+client_id).find("div[data-block]:last").html();
24
+ if(con==undefined){
25
+ con = jQuery("div[data-block="+client_id+"]").html();
26
+ }
27
+ editedContent += con;
28
+ }else{
29
+ editedContent += wp_blocks[i].originalContent;
30
+ }
31
+ }
32
  editor.insertContent(editedContent);
33
  }
34
  else if( tinymce.editors.content && typeof tinymce.editors.content.getContent()!= undefined){
templates/design-manager/design-1/elements/comments.php CHANGED
@@ -100,6 +100,9 @@ if ( ! defined( 'ABSPATH' ) ) {
100
  'echo' => true,
101
  'add_fragment' => '#comments',
102
  );
 
 
 
103
  paginate_comments_links( $args ); ?>
104
  </div> <?php
105
  } // end if ( $comments )
@@ -107,8 +110,13 @@ if ( ! defined( 'ABSPATH' ) ) {
107
  // if amp-comments extension is enabled then hide this button
108
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
109
  <div class="cmt-button-wrapper">
110
- <?php if ( comments_open() ) { ?>
111
- <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>" ><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
 
 
 
 
 
112
  }?>
113
  </div> <?php
114
  } ?>
100
  'echo' => true,
101
  'add_fragment' => '#comments',
102
  );
103
+ if(true == ampforwp_get_setting('ampforwp-amp-takeover')){
104
+ $args['base'] = get_the_permalink().'comment-page-%#%';
105
+ }
106
  paginate_comments_links( $args ); ?>
107
  </div> <?php
108
  } // end if ( $comments )
110
  // if amp-comments extension is enabled then hide this button
111
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
112
  <div class="cmt-button-wrapper">
113
+ <?php if ( comments_open() ) {
114
+ $nofollow = '';
115
+ if(true ==ampforwp_get_setting('ampforwp-nofollow-comment-btn')){
116
+ $nofollow = 'rel=nofollow';
117
+ }
118
+ ?>
119
+ <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" <?php echo esc_html($nofollow) ?> title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>" ><?php echo ampforwp_translation( ampforwp_get_setting('amp-translator-leave-a-comment-text'), 'Leave a Comment' ); ?></a> <?php
120
  }?>
121
  </div> <?php
122
  } ?>
templates/design-manager/design-1/style.php CHANGED
@@ -379,6 +379,7 @@ table tr:last-child td {border-bottom: 0;}
379
  table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
380
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
381
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
 
382
  <?php } ?>
383
  .amp-facebook-comments{margin: 0 0}
384
 
379
  table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
380
  table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
381
  table tr:hover td { background: #f2f2f2; background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); }
382
+ .amp-wp-content table {word-break: break-word;}
383
  <?php } ?>
384
  .amp-facebook-comments{margin: 0 0}
385
 
templates/design-manager/design-2/elements/comments.php CHANGED
@@ -100,6 +100,9 @@ if ( ! defined( 'ABSPATH' ) ) {
100
  'echo' => true,
101
  'add_fragment' => '#comments',
102
  );
 
 
 
103
  paginate_comments_links( $args ); ?>
104
  </div> <?php
105
  } // end if ( $comments )
@@ -107,8 +110,13 @@ if ( ! defined( 'ABSPATH' ) ) {
107
  // if amp-comments extension is enabled then hide this button
108
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
109
  <div class="cmt-button-wrapper">
110
- <?php if ( comments_open() ) { ?>
111
- <a href="<?php echo ampforwp_comment_button_url(); ?>" rel="nofollow" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
 
 
 
 
 
112
 
113
  }?>
114
  </div> <?php
100
  'echo' => true,
101
  'add_fragment' => '#comments',
102
  );
103
+ if(true == ampforwp_get_setting('ampforwp-amp-takeover')){
104
+ $args['base'] = get_the_permalink().'comment-page-%#%';
105
+ }
106
  paginate_comments_links( $args ); ?>
107
  </div> <?php
108
  } // end if ( $comments )
110
  // if amp-comments extension is enabled then hide this button
111
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
112
  <div class="cmt-button-wrapper">
113
+ <?php if ( comments_open() ) {
114
+ $nofollow = '';
115
+ if(true ==ampforwp_get_setting('ampforwp-nofollow-comment-btn')){
116
+ $nofollow = 'rel=nofollow';
117
+ }
118
+ ?>
119
+ <a href="<?php echo ampforwp_comment_button_url(); ?>" <?php echo esc_html($nofollow) ?> title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>"><?php echo ampforwp_translation( ampforwp_get_setting('amp-translator-leave-a-comment-text'), 'Leave a Comment' ); ?></a> <?php
120
 
121
  }?>
122
  </div> <?php
templates/design-manager/design-3/elements/comments.php CHANGED
@@ -100,6 +100,9 @@ do_action('ampforwp_before_comment_hook',$this);
100
  'echo' => true,
101
  'add_fragment' => '#comments',
102
  );
 
 
 
103
  paginate_comments_links( $args ); ?>
104
  </div> <?php
105
  } // end if ( $comments )
@@ -107,8 +110,13 @@ do_action('ampforwp_before_comment_hook',$this);
107
  // if amp-comments extension is enabled then hide this button
108
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
109
  <div class="cmt-button-wrapper">
110
- <?php if ( comments_open() ) { ?>
111
- <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" rel="nofollow" title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>"><?php echo ampforwp_translation( $redux_builder_amp['amp-translator-leave-a-comment-text'], 'Leave a Comment' ); ?></a> <?php
 
 
 
 
 
112
  }?>
113
  </div> <?php
114
  } ?>
100
  'echo' => true,
101
  'add_fragment' => '#comments',
102
  );
103
+ if(true == ampforwp_get_setting('ampforwp-amp-takeover')){
104
+ $args['base'] = get_the_permalink().'comment-page-%#%';
105
+ }
106
  paginate_comments_links( $args ); ?>
107
  </div> <?php
108
  } // end if ( $comments )
110
  // if amp-comments extension is enabled then hide this button
111
  if ( ! defined( 'AMP_COMMENTS_VERSION' ) ) { ?>
112
  <div class="cmt-button-wrapper">
113
+ <?php if ( comments_open() ) {
114
+ $nofollow = '';
115
+ if(true ==ampforwp_get_setting('ampforwp-nofollow-comment-btn')){
116
+ $nofollow = 'rel=nofollow';
117
+ }
118
+ ?>
119
+ <a href="<?php echo esc_url(ampforwp_comment_button_url()); ?>" <?php echo esc_html($nofollow) ?> title="<?php echo ampforwp_get_setting('amp-translator-leave-a-comment-text') ?>"><?php echo ampforwp_translation( ampforwp_get_setting('amp-translator-leave-a-comment-text'), 'Leave a Comment' ); ?></a> <?php
120
  }?>
121
  </div> <?php
122
  } ?>
templates/features.php CHANGED
@@ -1073,6 +1073,10 @@ function ampforwp_remove_schema_data() {
1073
  ampforwp_remove_filters_for_class( 'the_content', 'SiteOrigin_Panels', 'generate_post_content', 10 );
1074
  ampforwp_remove_filters_for_class( 'the_content', 'Elementor\Frontend', 'apply_builder_in_content', 9 );
1075
  }
 
 
 
 
1076
  }
1077
  //Removing the WPTouch Pro social share links from AMP
1078
  remove_filter( 'the_content', 'foundation_handle_share_links_bottom', 100 );
@@ -3804,6 +3808,23 @@ function ampforwp_post_pagination( $args = '' ) {
3804
  }
3805
  $numpages = count($ampforwp_new_content);
3806
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3807
  }
3808
  $defaults = array(
3809
  'before' => '<div class="ampforwp_post_pagination" ><p>' . '<span>' . ampforwp_translation($redux_builder_amp['amp-translator-page-text'], 'Page') . ':</span>',
@@ -5340,27 +5361,33 @@ function ampforwp_default_logo($param=""){
5340
  $value = $data['logo_url'];
5341
  break;
5342
  case 'width':
5343
- if (true == $redux_builder_amp['ampforwp-custom-logo-dimensions'] && 'prescribed' == $redux_builder_amp['ampforwp-custom-logo-dimensions-options']) {
5344
  $value = trim(ampforwp_get_setting('opt-media-width'));
5345
  if($value==""){
5346
  $value = 190;
5347
  }
5348
  }
5349
  else
5350
- $value = $data['logo_size'][0];
 
 
 
5351
  if($value==""){
5352
  $value = 190;
5353
  }
5354
  break;
5355
  case 'height':
5356
- if (true == $redux_builder_amp['ampforwp-custom-logo-dimensions'] && 'prescribed' == $redux_builder_amp['ampforwp-custom-logo-dimensions-options']) {
5357
  $value = trim(ampforwp_get_setting('opt-media-height'));
5358
  if($value==""){
5359
  $value = 36;
5360
  }
5361
  }
5362
  else
5363
- $value = $data['logo_size'][1];
 
 
 
5364
  if($value==""){
5365
  $value = 36;
5366
  }
1073
  ampforwp_remove_filters_for_class( 'the_content', 'SiteOrigin_Panels', 'generate_post_content', 10 );
1074
  ampforwp_remove_filters_for_class( 'the_content', 'Elementor\Frontend', 'apply_builder_in_content', 9 );
1075
  }
1076
+ if(class_exists('Wppr_Public')){
1077
+ remove_action('amp_post_template_css', array('Wppr_Public', 'amp_styles'));
1078
+ remove_action('wppr_review_option_rating_css', array('Wppr_Public', 'amp_width_support'));
1079
+ }
1080
  }
1081
  //Removing the WPTouch Pro social share links from AMP
1082
  remove_filter( 'the_content', 'foundation_handle_share_links_bottom', 100 );
3808
  }
3809
  $numpages = count($ampforwp_new_content);
3810
  }
3811
+ }else{
3812
+ $amp_current_post_id =ampforwp_get_the_ID();
3813
+ $amp_custom_content_enable = get_post_meta( $amp_current_post_id , 'ampforwp_custom_content_editor_checkbox', true);
3814
+ if($amp_custom_content_enable=='yes'){
3815
+ $content = get_post_meta ( $amp_current_post_id, 'ampforwp_custom_content_editor', true );
3816
+ $content = html_entity_decode($content);
3817
+ $checker = preg_match('/<!--nextpage-->/', $content);
3818
+ if ( 1 === $checker ) {
3819
+ $multipage = $more = 1;
3820
+ $ampforwp_new_content = explode('<!--nextpage-->', $content);
3821
+ $queried_var = get_query_var('paged');
3822
+ if ( $queried_var > 1 ) {
3823
+ $page = $queried_var;
3824
+ }
3825
+ $numpages = count($ampforwp_new_content);
3826
+ }
3827
+ }
3828
  }
3829
  $defaults = array(
3830
  'before' => '<div class="ampforwp_post_pagination" ><p>' . '<span>' . ampforwp_translation($redux_builder_amp['amp-translator-page-text'], 'Page') . ':</span>',
5361
  $value = $data['logo_url'];
5362
  break;
5363
  case 'width':
5364
+ if (true == ampforwp_get_setting('ampforwp-custom-logo-dimensions') && 'prescribed' ==ampforwp_get_setting('ampforwp-custom-logo-dimensions-options')) {
5365
  $value = trim(ampforwp_get_setting('opt-media-width'));
5366
  if($value==""){
5367
  $value = 190;
5368
  }
5369
  }
5370
  else
5371
+ $value = '';
5372
+ if(isset($data['logo_size'][0])){
5373
+ $value = $data['logo_size'][0];
5374
+ }
5375
  if($value==""){
5376
  $value = 190;
5377
  }
5378
  break;
5379
  case 'height':
5380
+ if (true == ampforwp_get_setting('ampforwp-custom-logo-dimensions') && 'prescribed' == ampforwp_get_setting('ampforwp-custom-logo-dimensions-options')) {
5381
  $value = trim(ampforwp_get_setting('opt-media-height'));
5382
  if($value==""){
5383
  $value = 36;
5384
  }
5385
  }
5386
  else
5387
+ $value = '';
5388
+ if(isset($data['logo_size'][1])){
5389
+ $value = $data['logo_size'][1];
5390
+ }
5391
  if($value==""){
5392
  $value = 36;
5393
  }