AMP for WP – Accelerated Mobile Pages - Version 1.0.77.29

Version Description

Download this release

Release Info

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

Code changes from version 1.0.77.28 to 1.0.77.29

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.8
7
- Stable tag: 1.0.77.28
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -197,6 +197,11 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
197
 
198
  == Changelog ==
199
 
 
 
 
 
 
200
  1.0.77.28 (28TH October 2021) =
201
  Improvements: License code improved #5151
202
  Fixed: Default Gravatar not appearing with FV Gravatar Cache #5149
@@ -208,8 +213,4 @@ Fixed: Video is not loading when created by slider revolution with divi #5159
208
  1.0.77.27 (21TH October 2021) =
209
  Improvements: Added AdPushup Support in AMP #5144
210
 
211
- 1.0.77.26 (20TH October 2021) =
212
- Improvements: Added FV Gravatar Cache Compatibility in AMP #5149
213
- Fixed: Images not loading when destination structure is document root in WebP Express #5150
214
-
215
  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.8
7
+ Stable tag: 1.0.77.29
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
197
 
198
  == Changelog ==
199
 
200
+ 1.0.77.29 (28TH October 2021) =
201
+ Improvements: Search results opens directly in Google search in AMP #5161
202
+ Fixed: Undefined variable - pathExploded debug notice #5160
203
+ Fixed: ID has been getting removed from the amp-img tag #5163
204
+
205
  1.0.77.28 (28TH October 2021) =
206
  Improvements: License code improved #5151
207
  Fixed: Default Gravatar not appearing with FV Gravatar Cache #5149
213
  1.0.77.27 (21TH October 2021) =
214
  Improvements: Added AdPushup Support in AMP #5144
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.77.28
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.77.28');
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.77.29
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.77.29');
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,10 @@
1
  == Changelog ==
2
 
 
 
 
 
 
3
  1.0.77.28 (28TH October 2021) =
4
  Improvements: License code improved #5151
5
  Fixed: Default Gravatar not appearing with FV Gravatar Cache #5149
1
  == Changelog ==
2
 
3
+ 1.0.77.29 (28TH October 2021) =
4
+ Improvements: Search results opens directly in Google search in AMP #5161
5
+ Fixed: Undefined variable - pathExploded debug notice #5160
6
+ Fixed: ID has been getting removed from the amp-img tag #5163
7
+
8
  1.0.77.28 (28TH October 2021) =
9
  Improvements: License code improved #5151
10
  Fixed: Default Gravatar not appearing with FV Gravatar Cache #5149
components/search/search.php CHANGED
@@ -16,6 +16,8 @@ function ampforwp_framework_get_search_form() {
16
  $placeholder = pll__(esc_html__( ampforwp_get_setting('ampforwp-search-placeholder'), 'accelerated-mobile-pages'));
17
  }
18
  $rand = rand(10,100);
 
 
19
  $mob_pres_link = false;
20
  if(function_exists('ampforwp_mobile_redirect_preseve_link')){
21
  $mob_pres_link = ampforwp_mobile_redirect_preseve_link();
@@ -24,12 +26,18 @@ function ampforwp_framework_get_search_form() {
24
  $amp_query_variable = 'amp';
25
  $amp_query_variable_val = '1';
26
  }
 
 
 
 
 
 
27
  $form = '<form role="search" method="get" class="amp-search" target="_top" action="' . esc_url($action_url) .'">
28
  <div class="amp-search-wrapper">
29
  <label aria-label="Type your query" class="screen-reader-text" for="s">' . esc_html__($label,'accelerated-mobile-pages') . '</label>
30
  <input type="text" placeholder="AMP" value="'.esc_attr($amp_query_variable_val).'" name="'.esc_attr($amp_query_variable).'" class="hidden"/>
31
  <label aria-label="search text" for="search-text-'.esc_attr($rand).'"></label>
32
- <input id="search-text-'.esc_attr($rand).'" type="text" placeholder="'.esc_attr($placeholder).'" value="' . esc_attr(get_search_query()) . '" name="s" class="s" />
33
  <label aria-label="Submit amp search" for="amp-search-submit" >
34
  <input type="submit" class="icon-search" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
35
  </label>
16
  $placeholder = pll__(esc_html__( ampforwp_get_setting('ampforwp-search-placeholder'), 'accelerated-mobile-pages'));
17
  }
18
  $rand = rand(10,100);
19
+ $value = get_search_query();
20
+ $name = 's';
21
  $mob_pres_link = false;
22
  if(function_exists('ampforwp_mobile_redirect_preseve_link')){
23
  $mob_pres_link = ampforwp_mobile_redirect_preseve_link();
26
  $amp_query_variable = 'amp';
27
  $amp_query_variable_val = '1';
28
  }
29
+ if (ampforwp_get_setting('ampforwp-search-google')) {
30
+ $action_url = 'https://www.google.com/search';
31
+ $amp_query_variable = '';
32
+ $value = 'site:'.get_bloginfo('url').$value;
33
+ $name = 'q';
34
+ }
35
  $form = '<form role="search" method="get" class="amp-search" target="_top" action="' . esc_url($action_url) .'">
36
  <div class="amp-search-wrapper">
37
  <label aria-label="Type your query" class="screen-reader-text" for="s">' . esc_html__($label,'accelerated-mobile-pages') . '</label>
38
  <input type="text" placeholder="AMP" value="'.esc_attr($amp_query_variable_val).'" name="'.esc_attr($amp_query_variable).'" class="hidden"/>
39
  <label aria-label="search text" for="search-text-'.esc_attr($rand).'"></label>
40
+ <input id="search-text-'.esc_attr($rand).'" type="text" placeholder="'.esc_attr($placeholder).'" value="' . esc_attr($value).'" name="'.esc_attr($name).'" class="s" />
41
  <label aria-label="Submit amp search" for="amp-search-submit" >
42
  <input type="submit" class="icon-search" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
43
  </label>
includes/options/admin-config.php CHANGED
@@ -1500,7 +1500,8 @@ if($ampforwp_nameOfUser!=""){
1500
  'customer_name'=> '',
1501
  'customer_email'=> '',
1502
  );
1503
- $allResponseData = $selectedOption['amp-license'][$pathExploded]['all_data'];
 
1504
  $selectedOption = (array) get_option('redux_builder_amp',true);
1505
  $expiredLicensedata[$pathExploded] = $selectedOption['amp-license'][$pathExploded]['status'] == 'expired' ? 1 : 0 ;
1506
  $remainingExpiresDays = date('Y-m-d', strtotime($allResponseData['expires'])) ;
@@ -1523,7 +1524,9 @@ if($ampforwp_nameOfUser!=""){
1523
  }
1524
 
1525
  $license_status = '';
1526
- if(isset($selectedOption['amp-license'][$pathExploded]['status']) && $selectedOption['amp-license'][$pathExploded]['status']==='valid'){
 
 
1527
  $license_status = $selectedOption['amp-license'][$pathExploded]['status'];
1528
  $license_user_name = substr($ampforwp_nameOfUser, 0, strpos($ampforwp_nameOfUser, ' '));
1529
  $check_for_Caps = ctype_upper($license_user_name);
@@ -1560,9 +1563,8 @@ if($ampforwp_nameOfUser!=""){
1560
  $days = -$days;
1561
  }
1562
  }
1563
- }
1564
- }
1565
- if(isset($selectedOption['amp-license'][$pathExploded])){
1566
  while ( strlen($selectedOption['amp-license'][$pathExploded]['license']) > 32 ) {
1567
  $selectedOption['amp-license'][$pathExploded]['license'] = base64_decode($selectedOption['amp-license'][$pathExploded]['license']);
1568
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];}
@@ -1690,6 +1692,10 @@ if($ampforwp_nameOfUser!=""){
1690
  }
1691
  }
1692
  }
 
 
 
 
1693
  }
1694
  else if( $ampforwp_nameOfUser!="" && !class_exists('AMPExtensionManager') ){
1695
  $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
@@ -3359,6 +3365,13 @@ Redux::setSection( $opt_name, array(
3359
  'style' => 'info',
3360
  'desc' => esc_html__('Enabling this causes a 300-350ms tap delay which can decrease FID ( First Input Delay ). Please use this with caution.', 'accelerated-mobile-pages'),
3361
  'required' => array('ampforwp-meta-viewport', '=', 1)
 
 
 
 
 
 
 
3362
  ),
3363
  array(
3364
  'id' => 'amp-header-text-area-for-html',
1500
  'customer_name'=> '',
1501
  'customer_email'=> '',
1502
  );
1503
+ $allResponseData = isset($selectedOption['amp-license'][$pathExploded]['all_data']) ? $selectedOption['amp-license'][$pathExploded]['all_data'] : NULL ;
1504
+ if ($allResponseData!=NULL) {
1505
  $selectedOption = (array) get_option('redux_builder_amp',true);
1506
  $expiredLicensedata[$pathExploded] = $selectedOption['amp-license'][$pathExploded]['status'] == 'expired' ? 1 : 0 ;
1507
  $remainingExpiresDays = date('Y-m-d', strtotime($allResponseData['expires'])) ;
1524
  }
1525
 
1526
  $license_status = '';
1527
+ $isset_Checker = isset($selectedOption['amp-license'][$pathExploded]['status']) ? $selectedOption['amp-license'][$pathExploded]['status'] : NULL;
1528
+ if ($isset_Checker != NULL) {
1529
+ if(isset($selectedOption['amp-license'][$pathExploded]['status']) && $selectedOption['amp-license'][$pathExploded]['status']==='valid' || $selectedOption['amp-license'][$pathExploded]['status']==='expired'){
1530
  $license_status = $selectedOption['amp-license'][$pathExploded]['status'];
1531
  $license_user_name = substr($ampforwp_nameOfUser, 0, strpos($ampforwp_nameOfUser, ' '));
1532
  $check_for_Caps = ctype_upper($license_user_name);
1563
  $days = -$days;
1564
  }
1565
  }
1566
+
1567
+ if(isset($selectedOption['amp-license'][$pathExploded])){
 
1568
  while ( strlen($selectedOption['amp-license'][$pathExploded]['license']) > 32 ) {
1569
  $selectedOption['amp-license'][$pathExploded]['license'] = base64_decode($selectedOption['amp-license'][$pathExploded]['license']);
1570
  $amplicense = $selectedOption['amp-license'][$pathExploded]['license'];}
1692
  }
1693
  }
1694
  }
1695
+ }
1696
+ }
1697
+ }
1698
+ }
1699
  }
1700
  else if( $ampforwp_nameOfUser!="" && !class_exists('AMPExtensionManager') ){
1701
  $proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
3365
  'style' => 'info',
3366
  'desc' => esc_html__('Enabling this causes a 300-350ms tap delay which can decrease FID ( First Input Delay ). Please use this with caution.', 'accelerated-mobile-pages'),
3367
  'required' => array('ampforwp-meta-viewport', '=', 1)
3368
+ ),
3369
+ array(
3370
+ 'id' => 'ampforwp-search-google',
3371
+ 'type' => 'switch',
3372
+ 'title' => esc_html__('Search Results in Google', 'accelerated-mobile-pages'),
3373
+ 'tooltip-subtitle' => esc_html__('Enable this option if you want the search results as Google search','accelerated-mobile-pages'),
3374
+ 'default' => 0,
3375
  ),
3376
  array(
3377
  'id' => 'amp-header-text-area-for-html',
includes/options/redux-core/framework.php CHANGED
@@ -3234,6 +3234,7 @@
3234
 
3235
  $amp_opt = get_option("ampforwp_option_panel_view_type");
3236
  $opt_visible = "";
 
3237
  $anchor_href = 'javascript:void(0);';
3238
  $opt_visible_class = "amp-full-view-options";
3239
  if(($amp_opt==1 || $amp_opt=="") && !get_theme_support('amp-template-mode')){
3234
 
3235
  $amp_opt = get_option("ampforwp_option_panel_view_type");
3236
  $opt_visible = "";
3237
+ $extmnger_data = "";
3238
  $anchor_href = 'javascript:void(0);';
3239
  $opt_visible_class = "amp-full-view-options";
3240
  if(($amp_opt==1 || $amp_opt=="") && !get_theme_support('amp-template-mode')){
includes/vendor/amp/includes/sanitizers/class-amp-img-sanitizer.php CHANGED
@@ -228,6 +228,7 @@ class AMP_Img_Sanitizer extends AMP_Base_Sanitizer {
228
  switch ( $name ) {
229
  case 'src':
230
  case 'alt':
 
231
  case 'class':
232
  case 'srcset':
233
  case 'sizes':
228
  switch ( $name ) {
229
  case 'src':
230
  case 'alt':
231
+ case 'id':
232
  case 'class':
233
  case 'srcset':
234
  case 'sizes':
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.8
7
- Stable tag: 1.0.77.28
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -194,6 +194,11 @@ You can contact us from [here](https://ampforwp.com/contact/)
194
 
195
  == Changelog ==
196
 
 
 
 
 
 
197
  1.0.77.28 (28TH October 2021) =
198
  Improvements: License code improved #5151
199
  Fixed: Default Gravatar not appearing with FV Gravatar Cache #5149
@@ -205,8 +210,4 @@ Fixed: Video is not loading when created by slider revolution with divi #5159
205
  1.0.77.26 (21TH October 2021) =
206
  Improvements: Added AdPushup Support in AMP #5144
207
 
208
- 1.0.77.26 (20TH October 2021) =
209
- Improvements: Added FV Gravatar Cache Compatibility in AMP #5149
210
- Fixed: Images not loading when destination structure is document root in WebP Express #5150
211
-
212
  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.8
7
+ Stable tag: 1.0.77.29
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.77.29 (28TH October 2021) =
198
+ Improvements: Search results opens directly in Google search in AMP #5161
199
+ Fixed: Undefined variable - pathExploded debug notice #5160
200
+ Fixed: ID has been getting removed from the amp-img tag #5163
201
+
202
  1.0.77.28 (28TH October 2021) =
203
  Improvements: License code improved #5151
204
  Fixed: Default Gravatar not appearing with FV Gravatar Cache #5149
210
  1.0.77.26 (21TH October 2021) =
211
  Improvements: Added AdPushup Support in AMP #5144
212
 
 
 
 
 
213
  Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
templates/search-functions.php CHANGED
@@ -80,6 +80,8 @@ function ampforwp_get_search_form() {
80
  $action_url = esc_url( get_bloginfo('url') );
81
  $action_url = preg_replace('#^http?:#', '', $action_url);
82
  $placeholder = ampforwp_translation($redux_builder_amp['ampforwp-search-placeholder'], 'Type Here' );
 
 
83
  $mob_pres_link = false;
84
  if(function_exists('ampforwp_mobile_redirect_preseve_link')){
85
  $mob_pres_link = ampforwp_mobile_redirect_preseve_link();
@@ -88,11 +90,17 @@ function ampforwp_get_search_form() {
88
  $amp_query_variable = 'amp';
89
  $amp_query_variable_val = '1';
90
  }
 
 
 
 
 
 
91
  $form = '<form role="search" method="get" id="searchform" class="searchform" target="_top" action="' . esc_url($action_url) .'">
92
  <div>
93
  <label aria-label="Type your query" class="screen-reader-text" for="s">' . esc_html__($label,'accelerated-mobile-pages') . '</label>
94
  <input type="text" placeholder="AMP" value="'.esc_attr($amp_query_variable_val).'" name="'.esc_attr($amp_query_variable).'" class="hide" id="ampforwp_search_query_item" />
95
- <input type="text" placeholder="'.esc_attr($placeholder).'" value="' . get_search_query() . '" name="s" id="s" />
96
  <label aria-label="Submit amp search" for="amp-search-submit" >
97
  <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
98
  </label>
80
  $action_url = esc_url( get_bloginfo('url') );
81
  $action_url = preg_replace('#^http?:#', '', $action_url);
82
  $placeholder = ampforwp_translation($redux_builder_amp['ampforwp-search-placeholder'], 'Type Here' );
83
+ $value = get_search_query();
84
+ $name = 's';
85
  $mob_pres_link = false;
86
  if(function_exists('ampforwp_mobile_redirect_preseve_link')){
87
  $mob_pres_link = ampforwp_mobile_redirect_preseve_link();
90
  $amp_query_variable = 'amp';
91
  $amp_query_variable_val = '1';
92
  }
93
+ if (ampforwp_get_setting('ampforwp-search-google')) {
94
+ $action_url = 'https://www.google.com/search';
95
+ $amp_query_variable = '';
96
+ $value = 'site:'.get_bloginfo('url').$value;
97
+ $name = 'q';
98
+ }
99
  $form = '<form role="search" method="get" id="searchform" class="searchform" target="_top" action="' . esc_url($action_url) .'">
100
  <div>
101
  <label aria-label="Type your query" class="screen-reader-text" for="s">' . esc_html__($label,'accelerated-mobile-pages') . '</label>
102
  <input type="text" placeholder="AMP" value="'.esc_attr($amp_query_variable_val).'" name="'.esc_attr($amp_query_variable).'" class="hide" id="ampforwp_search_query_item" />
103
+ <input type="text" placeholder="'.esc_attr($placeholder).'" value="' . esc_attr($value).'" name="'.esc_attr($name).'" id="s" />
104
  <label aria-label="Submit amp search" for="amp-search-submit" >
105
  <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
106
  </label>