AMP for WP – Accelerated Mobile Pages - Version 1.0.45

Version Description

(30th April 2020) = * Fixed: Updated the code as per yoast latest version to fixed the canonical, title separator, meta tag errors #4415 * Fixed: Content links unclickable with GDPR #4392

Download this release

Release Info

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

Code changes from version 1.0.44 to 1.0.45

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.4
7
- Stable tag: 1.0.44
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,10 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
194
 
195
  == Changelog ==
196
 
 
 
 
 
197
  = 1.0.44 (29th April 2020) =
198
  * Fixed: Multiple issues created after the latest update of Yoast (14.0 and above) #4412
199
 
@@ -209,19 +213,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
209
  * Fixed: Shortcodes displaying in meta descrption #4385
210
  * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
211
 
212
- = 1.0.42 (21st April 2020) =
213
- * Improvement: Added Comments module in our AMP page builder #4106
214
- * Improvement: Added CSS icons option #4268
215
- * Improvement: Added Support for Call Rail analytics #4331
216
- * Improvement: Added Pinterest embeded images in AMP #4361
217
- * Improvement: Added Video docking feature in AMP #4352
218
- * Improvement: Added option for one signal notificaion on the pages #4349
219
- * Fixed: Mobile redirection issue on robots.txt page #4369
220
- * Fixed: 404 error when we click on the comment section with Google Sitekit #4360
221
- * Fixed: Fixed width not working in 2 coloum in AMP pagebuilder #4379
222
- * Fixed: Label markup was visible even after set to empty in content module in AMP pagebuilder #4379
223
-
224
- = 1.0.41 (14th April 2020) =
225
- * Improvement: Video docking issue #4352
226
-
227
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4
7
+ Stable tag: 1.0.45
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.45 (30th April 2020) =
198
+ * Fixed: Updated the code as per yoast latest version to fixed the canonical, title separator, meta tag errors #4415
199
+ * Fixed: Content links unclickable with GDPR #4392
200
+
201
  = 1.0.44 (29th April 2020) =
202
  * Fixed: Multiple issues created after the latest update of Yoast (14.0 and above) #4412
203
 
213
  * Fixed: Shortcodes displaying in meta descrption #4385
214
  * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
215
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
accelerated-moblie-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Accelerated Mobile Pages
4
  Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
5
  Description: AMP for WP - Accelerated Mobile Pages for WordPress
6
- Version: 1.0.44
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.44');
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.45
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.45');
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,9 @@
1
  == Changelog ==
2
 
 
 
 
 
3
  = 1.0.44 (29th April 2020) =
4
  * Fixed: Multiple issues created after the latest update of Yoast (14.0 and above) #4412
5
 
1
  == Changelog ==
2
 
3
+ = 1.0.45 (30th April 2020) =
4
+ * Fixed: Updated the code as per yoast latest version to fixed the canonical, title separator, meta tag errors #4415
5
+ * Fixed: Content links unclickable with GDPR #4392
6
+
7
  = 1.0.44 (29th April 2020) =
8
  * Fixed: Multiple issues created after the latest update of Yoast (14.0 and above) #4412
9
 
components/gdpr/gdpr.php CHANGED
@@ -128,13 +128,7 @@ function ampforwp_gdpr_css(){
128
  #footer .gdpr_fmi a{
129
  color: <?php echo ampforwp_sanitize_color( ampforwp_get_setting('swift-color-scheme','color') ); ?>;
130
  }
131
- amp-consent.amp-active {
132
- top: 0;
133
- bottom: 0;
134
- left: 0;
135
- right: 0;
136
- position: relative;
137
- }
138
  @media(max-width:768px){
139
  .gdpr_w{width: 85%;margin:0 auto;padding:1.5rem;}
140
  }
128
  #footer .gdpr_fmi a{
129
  color: <?php echo ampforwp_sanitize_color( ampforwp_get_setting('swift-color-scheme','color') ); ?>;
130
  }
131
+
 
 
 
 
 
 
132
  @media(max-width:768px){
133
  .gdpr_w{width: 85%;margin:0 auto;padding:1.5rem;}
134
  }
includes/features/functions.php CHANGED
@@ -273,7 +273,7 @@ function ampforwp_generate_meta_desc($json=""){
273
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
274
  }
275
  // Yoast
276
- if ( class_exists('WPSEO_Frontend') && ('yoast' == ampforwp_get_setting('ampforwp-seo-selection') || 1 == ampforwp_get_setting('ampforwp-seo-selection'))) {
277
  $front = $yoast_desc = '';
278
  $front = WPSEO_Frontend::get_instance();
279
  $yoast_desc = addslashes( strip_tags( $front->metadesc( false ) ) );
273
  $desc = addslashes( ampforwp_translation($redux_builder_amp['amp-translator-search-text'], 'You searched for:') . ' ' . get_search_query() );
274
  }
275
  // Yoast
276
+ if ( class_exists('WPSEO_Frontend') && ('yoast' == ampforwp_get_setting('ampforwp-seo-selection') || 1 == ampforwp_get_setting('ampforwp-seo-selection')) && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
277
  $front = $yoast_desc = '';
278
  $front = WPSEO_Frontend::get_instance();
279
  $yoast_desc = addslashes( strip_tags( $front->metadesc( false ) ) );
includes/features/structure-data/structured-data-functions.php CHANGED
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
 
34
  //code for adding 'description' meta from Yoast SEO
35
 
36
- if('yoast' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting('ampforwp-seo-yoast-description')){
37
  if ( class_exists('WPSEO_Frontend') ) {
38
  $front = WPSEO_Frontend::get_instance();
39
  $desc = $front->metadesc( false );
33
 
34
  //code for adding 'description' meta from Yoast SEO
35
 
36
+ if('yoast' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting('ampforwp-seo-yoast-description') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')){
37
  if ( class_exists('WPSEO_Frontend') ) {
38
  $front = WPSEO_Frontend::get_instance();
39
  $desc = $front->metadesc( false );
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.4
7
- Stable tag: 1.0.44
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -191,6 +191,10 @@ You can contact us from [here](https://ampforwp.com/contact/)
191
 
192
  == Changelog ==
193
 
 
 
 
 
194
  = 1.0.44 (29th April 2020) =
195
  * Fixed: Multiple issues created after the latest update of Yoast (14.0 and above) #4412
196
 
@@ -206,19 +210,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
206
  * Fixed: Shortcodes displaying in meta descrption #4385
207
  * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
208
 
209
- = 1.0.42 (21st April 2020) =
210
- * Improvement: Added Comments module in our AMP page builder #4106
211
- * Improvement: Added CSS icons option #4268
212
- * Improvement: Added Support for Call Rail analytics #4331
213
- * Improvement: Added Pinterest embeded images in AMP #4361
214
- * Improvement: Added Video docking feature in AMP #4352
215
- * Improvement: Added option for one signal notificaion on the pages #4349
216
- * Fixed: Mobile redirection issue on robots.txt page #4369
217
- * Fixed: 404 error when we click on the comment section with Google Sitekit #4360
218
- * Fixed: Fixed width not working in 2 coloum in AMP pagebuilder #4379
219
- * Fixed: Label markup was visible even after set to empty in content module in AMP pagebuilder #4379
220
-
221
- = 1.0.41 (14th April 2020) =
222
- * Improvement: Video docking issue #4352
223
-
224
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
4
  Donate link: https://www.paypal.me/Kaludi/25
5
  Requires at least: 3.0
6
  Tested up to: 5.4
7
+ Stable tag: 1.0.45
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.45 (30th April 2020) =
195
+ * Fixed: Updated the code as per yoast latest version to fixed the canonical, title separator, meta tag errors #4415
196
+ * Fixed: Content links unclickable with GDPR #4392
197
+
198
  = 1.0.44 (29th April 2020) =
199
  * Fixed: Multiple issues created after the latest update of Yoast (14.0 and above) #4412
200
 
210
  * Fixed: Shortcodes displaying in meta descrption #4385
211
  * Fixed: Debug Warnings: count(): Parameter must be an array or an object that implements Countable. #4387
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/features.php CHANGED
@@ -1411,7 +1411,7 @@ function ampforwp_yoast_excerpt($desc){
1411
  return $desc;
1412
  }
1413
  function ampforwp_custom_yoast_meta_homepage(){
1414
- if ( 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting('ampforwp-seo-yoast-meta') ) {
1415
  if ( class_exists('WPSEO_Options')) {
1416
  if( method_exists('WPSEO_Options', 'get_option')){
1417
  $options = WPSEO_Options::get_option( 'wpseo_social' );
@@ -1607,7 +1607,7 @@ function ampforwp_replace_title_tags() {
1607
 
1608
  //* We can filter this later if needed:
1609
  $sep = ' | ';
1610
- if( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1611
  $sep = WPSEO_Options::get( 'separator' );
1612
  }
1613
  if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
@@ -1650,7 +1650,7 @@ function ampforwp_replace_title_tags() {
1650
  }
1651
 
1652
  // Yoast SEO Title compatibility #2871
1653
- if( class_exists('WPSEO_Frontend') && ('yoast' || 1) == ampforwp_get_setting('ampforwp-seo-selection') ) {
1654
  $yoast_title = $WPSEO_Frontend = $yoast_instance = '';
1655
 
1656
  if ( class_exists('Yoast\WP\SEO\Presentations\Indexable_Presentation') ) {
@@ -2473,7 +2473,7 @@ function ampforwp_talking_to_robots() {
2473
  }
2474
  }
2475
  // Meta Robots Tag From Yoast #1563
2476
- if ( class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && is_singular()) {
2477
  $class_instance = '';
2478
  $class_instance = WPSEO_Frontend::get_instance();
2479
  // robots() will return and print the meta robots tag
@@ -4042,7 +4042,7 @@ function ampforwp_modify_rel_canonical_paginated_post(){
4042
  if(is_single()){
4043
  $post_paginated_page='';
4044
  $post_paginated_page = get_query_var('page');
4045
- if($post_paginated_page){
4046
  remove_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
4047
  add_action('amp_post_template_head','ampforwp_rel_canonical_paginated_post');
4048
  }
@@ -4149,9 +4149,15 @@ function ampforwp_home_archive_canonical_setter(){
4149
  // Except for the homepage
4150
  if( class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') ) {
4151
 
4152
- if ( ampforwp_is_home() && 'page' == get_option( 'show_on_front') ) {
 
 
 
4153
  return ;
4154
  }
 
 
 
4155
  remove_action('amp_post_template_head','ampforwp_rel_canonical_home_archive');
4156
  }
4157
  }
@@ -6182,7 +6188,7 @@ function ampforwp_generate_canonical(){
6182
  global $redux_builder_amp;
6183
  $canonical = '';
6184
  $canonical = $WPSEO_Frontend = $All_in_One_SEO_Pack = $opts = '';
6185
- if ( 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-yoast-canonical') && class_exists('WPSEO_Frontend') ) {
6186
  $WPSEO_Frontend = WPSEO_Frontend::get_instance();
6187
  $canonical = $WPSEO_Frontend->canonical(false);
6188
  }
@@ -6205,7 +6211,7 @@ function ampforwp_modified_canonical( $data ) {
6205
  }
6206
  return $data;
6207
  }
6208
- if(class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-yoast-canonical') ){
6209
  add_filter('ampforwp_modify_rel_url','ampforwp_yoast_canonical');
6210
  }
6211
  function ampforwp_yoast_canonical($canonical){
1411
  return $desc;
1412
  }
1413
  function ampforwp_custom_yoast_meta_homepage(){
1414
+ if ( 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting('ampforwp-seo-yoast-meta') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1415
  if ( class_exists('WPSEO_Options')) {
1416
  if( method_exists('WPSEO_Options', 'get_option')){
1417
  $options = WPSEO_Options::get_option( 'wpseo_social' );
1607
 
1608
  //* We can filter this later if needed:
1609
  $sep = ' | ';
1610
+ if( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1611
  $sep = WPSEO_Options::get( 'separator' );
1612
  }
1613
  if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
1650
  }
1651
 
1652
  // Yoast SEO Title compatibility #2871
1653
+ if( class_exists('WPSEO_Frontend') && ('yoast' || 1) == ampforwp_get_setting('ampforwp-seo-selection') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
1654
  $yoast_title = $WPSEO_Frontend = $yoast_instance = '';
1655
 
1656
  if ( class_exists('Yoast\WP\SEO\Presentations\Indexable_Presentation') ) {
2473
  }
2474
  }
2475
  // Meta Robots Tag From Yoast #1563
2476
+ if ( class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && is_singular() && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
2477
  $class_instance = '';
2478
  $class_instance = WPSEO_Frontend::get_instance();
2479
  // robots() will return and print the meta robots tag
4042
  if(is_single()){
4043
  $post_paginated_page='';
4044
  $post_paginated_page = get_query_var('page');
4045
+ if($post_paginated_page && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')){
4046
  remove_action( 'amp_post_template_head', 'AMPforWP\\AMPVendor\\amp_post_template_add_canonical' );
4047
  add_action('amp_post_template_head','ampforwp_rel_canonical_paginated_post');
4048
  }
4149
  // Except for the homepage
4150
  if( class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') ) {
4151
 
4152
+ if ( ampforwp_is_home() && 'page' == get_option( 'show_on_front') && empty(get_option( 'page_for_posts')) ) {
4153
+ return ;
4154
+ }
4155
+ if(ampforwp_is_front_page() && 'page' == get_option( 'show_on_front') && empty(get_option( 'page_for_posts'))){
4156
  return ;
4157
  }
4158
+ if(is_search()){
4159
+ return;
4160
+ }
4161
  remove_action('amp_post_template_head','ampforwp_rel_canonical_home_archive');
4162
  }
4163
  }
6188
  global $redux_builder_amp;
6189
  $canonical = '';
6190
  $canonical = $WPSEO_Frontend = $All_in_One_SEO_Pack = $opts = '';
6191
+ if ( 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-yoast-canonical') && class_exists('WPSEO_Frontend') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
6192
  $WPSEO_Frontend = WPSEO_Frontend::get_instance();
6193
  $canonical = $WPSEO_Frontend->canonical(false);
6194
  }
6211
  }
6212
  return $data;
6213
  }
6214
+ if(class_exists('WPSEO_Frontend') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && true == ampforwp_get_setting('ampforwp-seo-yoast-canonical') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') ){
6215
  add_filter('ampforwp_modify_rel_url','ampforwp_yoast_canonical');
6216
  }
6217
  function ampforwp_yoast_canonical($canonical){