AMP for WP – Accelerated Mobile Pages - Version 0.9.97.65

Version Description

(16th July 2019) = * Fixed: PHP Warning at the top of the site: array_merge(): Expected parameter 1 to be an array #3434 * Fixed: Disqus comment is not working after version 0.9.97.63 #3446 * Fixed: Uncaught Error: Call to undefined method WPSEO_Options::get() for Yoast Premium #3447 * Fixed: Message: when Leverage Browser Caching is not supported #3449 * Fixed: Added the missing parameter $depth in filter 'nav_menu_item_id' #3454

Download this release

Release Info

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

Code changes from version 0.9.97.64 to 0.9.97.65

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.2.2
7
- Stable tag: 0.9.97.64
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -188,6 +188,13 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
188
 
189
  == Changelog ==
190
 
 
 
 
 
 
 
 
191
  = 0.9.97.64 (15th July 2019) =
192
  * Improvements: Performance improvement -- Meta Value Queries #3392
193
  * Improvements: h1 tag on the archive, search and author pages #3323
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.2
7
+ Stable tag: 0.9.97.65
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
188
 
189
  == Changelog ==
190
 
191
+ = 0.9.97.65 (16th July 2019) =
192
+ * Fixed: PHP Warning at the top of the site: array_merge(): Expected parameter 1 to be an array #3434
193
+ * Fixed: Disqus comment is not working after version 0.9.97.63 #3446
194
+ * Fixed: Uncaught Error: Call to undefined method WPSEO_Options::get() for Yoast Premium #3447
195
+ * Fixed: Message: when Leverage Browser Caching is not supported #3449
196
+ * Fixed: Added the missing parameter $depth in filter 'nav_menu_item_id' #3454
197
+
198
  = 0.9.97.64 (15th July 2019) =
199
  * Improvements: Performance improvement -- Meta Value Queries #3392
200
  * Improvements: h1 tag on the archive, search and author pages #3323
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 0.9.97.64
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
- define('AMPFORWP_VERSION','0.9.97.64');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
@@ -221,7 +221,7 @@ function ampforwp_add_custom_rewrite_rules() {
221
  $wc_permalinks = get_option( 'woocommerce_permalinks' );
222
  set_transient('ampforwp_woocommerce_permalinks', $wc_permalinks);
223
  }
224
- if ( $wc_permalinks ) {
225
  $taxonomies = array_merge($taxonomies, $wc_permalinks);
226
  }
227
  }
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
+ Version: 0.9.97.65
7
  Author: Ahmed Kaludi, Mohammed Kaludi
8
  Author URI: https://ampforwp.com/
9
  Donate link: https://www.paypal.me/Kaludi/25
20
  define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
21
  define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
22
  define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
23
+ define('AMPFORWP_VERSION','0.9.97.65');
24
  define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
25
  // any changes to AMP_QUERY_VAR should be refelected here
26
  function ampforwp_generate_endpoint(){
221
  $wc_permalinks = get_option( 'woocommerce_permalinks' );
222
  set_transient('ampforwp_woocommerce_permalinks', $wc_permalinks);
223
  }
224
+ if ( $wc_permalinks && !empty( $taxonomies) ) {
225
  $taxonomies = array_merge($taxonomies, $wc_permalinks);
226
  }
227
  }
changelog.txt CHANGED
@@ -1,5 +1,12 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
3
  = 0.9.97.64 (15th July 2019) =
4
  * Improvements: Performance improvement -- Meta Value Queries #3392
5
  * Improvements: h1 tag on the archive, search and author pages #3323
1
  == Changelog ==
2
 
3
+ = 0.9.97.65 (16th July 2019) =
4
+ * Fixed: PHP Warning at the top of the site: array_merge(): Expected parameter 1 to be an array #3434
5
+ * Fixed: Disqus comment is not working after version 0.9.97.63 #3446
6
+ * Fixed: Uncaught Error: Call to undefined method WPSEO_Options::get() for Yoast Premium #3447
7
+ * Fixed: Message: when Leverage Browser Caching is not supported #3449
8
+ * Fixed: Added the missing parameter $depth in filter 'nav_menu_item_id' #3454
9
+
10
  = 0.9.97.64 (15th July 2019) =
11
  * Improvements: Performance improvement -- Meta Value Queries #3392
12
  * Improvements: h1 tag on the archive, search and author pages #3323
classes/class-ampforwp-walker-nav-menu.php CHANGED
@@ -37,7 +37,7 @@ if ( ! defined( 'ABSPATH' ) ) {
37
  $class_names = join( ' ', apply_filters( 'ampforwp_nav_menu_css_class', array_filter( $classes ), $item, $args ) );
38
  $class_names = ' class="' . esc_attr( $class_names ) . '"';
39
 
40
- $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
41
  $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
42
 
43
  $has_children = 1;
37
  $class_names = join( ' ', apply_filters( 'ampforwp_nav_menu_css_class', array_filter( $classes ), $item, $args ) );
38
  $class_names = ' class="' . esc_attr( $class_names ) . '"';
39
 
40
+ $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args, $depth );
41
  $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';
42
 
43
  $has_children = 1;
includes/features/performance/performance-functions.php CHANGED
@@ -108,6 +108,7 @@ function ampforwp_leverage_browser_caching_remove(){
108
  }
109
  }
110
  function ampforwp_leverage_browser_caching(){
 
111
  $htaccess_file = wp_normalize_path( ABSPATH . '.htaccess' );
112
  if ( file_exists( $htaccess_file ) ) {
113
  if ( is_readable( $htaccess_file ) && is_writable( $htaccess_file ) ) {
@@ -122,10 +123,14 @@ function ampforwp_leverage_browser_caching(){
122
  file_put_contents( $htaccess_file, $htaccess_cntn );
123
  }
124
  } else {
125
- add_action( 'admin_notices', 'ampforwp_no_htaccess_access_notice' );
 
 
126
  }
127
  }else {
128
- add_action( 'admin_notices', 'ampforwp_no_htaccess_notice');
 
 
129
  }
130
  }
131
 
@@ -137,7 +142,7 @@ function ampforwp_no_htaccess_access_notice(){
137
  }
138
  function ampforwp_no_htaccess_notice(){
139
  $message = '<div class="error"><p>';
140
- $message .= esc_html__( 'Accelerated Mobile Pages: htaccess file not found. This plugin works only for Apache server. If you are using Apace server, please create it.', 'accelerated-mobile-pages' );
141
  $message .= '</p></div>';
142
  echo wp_kses_post( $message );
143
  }
108
  }
109
  }
110
  function ampforwp_leverage_browser_caching(){
111
+ global $pagenow;
112
  $htaccess_file = wp_normalize_path( ABSPATH . '.htaccess' );
113
  if ( file_exists( $htaccess_file ) ) {
114
  if ( is_readable( $htaccess_file ) && is_writable( $htaccess_file ) ) {
123
  file_put_contents( $htaccess_file, $htaccess_cntn );
124
  }
125
  } else {
126
+ if( $pagenow == 'admin.php' && isset($_GET['page']) && esc_attr($_GET['page']) == 'amp_options'){
127
+ add_action( 'admin_notices', 'ampforwp_no_htaccess_access_notice' );
128
+ }
129
  }
130
  }else {
131
+ if( $pagenow == 'admin.php' && isset($_GET['page']) && esc_attr($_GET['page']) == 'amp_options'){
132
+ add_action( 'admin_notices', 'ampforwp_no_htaccess_notice');
133
+ }
134
  }
135
  }
136
 
142
  }
143
  function ampforwp_no_htaccess_notice(){
144
  $message = '<div class="error"><p>';
145
+ $message .= esc_html__( 'Accelerated Mobile Pages: htaccess file not found. Please create htaccess in your root folder. Leverage Browser Caching works only for Apache server at this moment. If you are using NginX then please disable Leverage Browser Caching from AMP options panel -> Performance -> Leverage Browser Caching', 'accelerated-mobile-pages' );
146
  $message .= '</p></div>';
147
  echo wp_kses_post( $message );
148
  }
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.2.2
7
- Stable tag: 0.9.97.64
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,6 +190,13 @@ You can contact us from [here](https://ampforwp.com/contact/)
190
 
191
  == Changelog ==
192
 
 
 
 
 
 
 
 
193
  = 0.9.97.64 (15th July 2019) =
194
  * Improvements: Performance improvement -- Meta Value Queries #3392
195
  * Improvements: h1 tag on the archive, search and author pages #3323
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.2.2
7
+ Stable tag: 0.9.97.65
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 0.9.97.65 (16th July 2019) =
194
+ * Fixed: PHP Warning at the top of the site: array_merge(): Expected parameter 1 to be an array #3434
195
+ * Fixed: Disqus comment is not working after version 0.9.97.63 #3446
196
+ * Fixed: Uncaught Error: Call to undefined method WPSEO_Options::get() for Yoast Premium #3447
197
+ * Fixed: Message: when Leverage Browser Caching is not supported #3449
198
+ * Fixed: Added the missing parameter $depth in filter 'nav_menu_item_id' #3454
199
+
200
  = 0.9.97.64 (15th July 2019) =
201
  * Improvements: Performance improvement -- Meta Value Queries #3392
202
  * Improvements: h1 tag on the archive, search and author pages #3323
templates/design-manager/swift/single.php CHANGED
@@ -55,12 +55,12 @@
55
  amp_author_box( $author_box ); ?>
56
  <?php } ?>
57
  <?php amp_post_navigation();?>
58
- <?php if ( true == ampforwp_get_setting('wordpress-comments-support')){ ?>
59
  <div class="cmts">
60
  <?php amp_comments();?>
61
- <?php do_action('ampforwp_post_after_design_elements'); ?>
62
  </div>
63
  <?php } ?>
 
64
  <?php } ?>
65
  </div>
66
  <?php if(!checkAMPforPageBuilderStatus(get_the_ID()) && (true == ampforwp_get_setting('enable-single-post-social-icons') || true == ampforwp_get_setting('amp-author-name') || true == ampforwp_get_setting('swift-date') || true == ampforwp_get_setting('ampforwp-single-related-posts-switch'))){ ?>
55
  amp_author_box( $author_box ); ?>
56
  <?php } ?>
57
  <?php amp_post_navigation();?>
58
+ <?php if ( true == ampforwp_get_setting('wordpress-comments-support') || true == ampforwp_get_setting('ampforwp-disqus-comments-support') || true == ampforwp_get_setting('ampforwp-facebook-comments-support') ||true == ampforwp_get_setting('ampforwp-vuukle-comments-support') ||true == ampforwp_get_setting('ampforwp-spotim-comments-support') ){ ?>
59
  <div class="cmts">
60
  <?php amp_comments();?>
 
61
  </div>
62
  <?php } ?>
63
+ <?php do_action('ampforwp_post_after_design_elements'); ?>
64
  <?php } ?>
65
  </div>
66
  <?php if(!checkAMPforPageBuilderStatus(get_the_ID()) && (true == ampforwp_get_setting('enable-single-post-social-icons') || true == ampforwp_get_setting('amp-author-name') || true == ampforwp_get_setting('swift-date') || true == ampforwp_get_setting('ampforwp-single-related-posts-switch'))){ ?>
templates/features.php CHANGED
@@ -1604,7 +1604,7 @@ function ampforwp_replace_title_tags() {
1604
 
1605
  //* We can filter this later if needed:
1606
  $sep = ' | ';
1607
- if( class_exists('WPSEO_Options') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1608
  $sep = WPSEO_Options::get( 'separator' );
1609
  }
1610
  if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
@@ -2377,7 +2377,7 @@ function ampforwp_talking_to_robots() {
2377
  }
2378
  }
2379
  // Meta Robots Tag From Yoast #1563
2380
- if ( class_exists('WPSEO_Frontend') && false == ampforwp_get_setting('amp-inspection-tool') ) {
2381
  $class_instance = '';
2382
  $class_instance = WPSEO_Frontend::get_instance();
2383
  // robots() will return and print the meta robots tag
@@ -6666,7 +6666,7 @@ if ( ! function_exists('ampforwp_yoast_breadcrumbs') ) {
6666
  }
6667
  }
6668
  function ampforwp_yoast_breadcrumbs_output(){
6669
- if ( class_exists('WPSEO_Options') ){
6670
  $breadcrumb = '';
6671
  if ( true == ampforwp_get_setting('ampforwp-yoast-bread-crumb') && true === WPSEO_Options::get( 'breadcrumbs-enable' ) && function_exists('yoast_breadcrumb')) {
6672
  $breadcrumb = yoast_breadcrumb('','', false);
1604
 
1605
  //* We can filter this later if needed:
1606
  $sep = ' | ';
1607
+ if( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1608
  $sep = WPSEO_Options::get( 'separator' );
1609
  }
1610
  if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
2377
  }
2378
  }
2379
  // Meta Robots Tag From Yoast #1563
2380
+ if ( class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selections') && false == ampforwp_get_setting('amp-inspection-tool') ) {
2381
  $class_instance = '';
2382
  $class_instance = WPSEO_Frontend::get_instance();
2383
  // robots() will return and print the meta robots tag
6666
  }
6667
  }
6668
  function ampforwp_yoast_breadcrumbs_output(){
6669
+ if ( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') ){
6670
  $breadcrumb = '';
6671
  if ( true == ampforwp_get_setting('ampforwp-yoast-bread-crumb') && true === WPSEO_Options::get( 'breadcrumbs-enable' ) && function_exists('yoast_breadcrumb')) {
6672
  $breadcrumb = yoast_breadcrumb('','', false);