Version Description
(24th January 2020) = * Improvement: Need to built compatibility with "Mistape" plugin. #3974 * Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895 * Fixed: A Table is created trough Gutenberg then CSS of that Table is failing to load in AMP. #3902 * Fixed: When user search from the AMP site then results page should be in non-AMP. #3977 * Fixed: Add 'wp-color-picker' as dependency while registering the script #4061 * Fixed: The "for" attribute is removing in AMP #4054 * Fixed: Table heading style is not working properly #4050 * Fixed: Need to change the description of AMP page builder compatibility options when plugin is activated. #3899 * Fixed: Thumbnail image of homepage should show properly after changing the image size #3882 * Fixed: Need to remove the default AMP functionality from the User's theme as it is breaking the layout. #4068 * Fixed: YOAST SEO Analysis is not working properly with AMP Page Builder. #4030 * Fixed: When AMP is disabled on pages,give an option of hide/unhide AMP on Blog page when in edit mode. #4066 * Fixed: The tag 'template' requires including the 'amp-mustache' extension JavaScript. #4079
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 1.0.16 |
Comparing to | |
See all releases |
Code changes from version 1.0.15 to 1.0.16
- README.md +16 -15
- accelerated-moblie-pages.php +2 -2
- changelog.txt +15 -0
- components/components-core.php +32 -1
- components/related-posts/related-posts.php +6 -0
- includes/features/functions.php +4 -2
- includes/features/pagebuilders-support/pagebuilders_support.php +102 -95
- includes/features/performance/performance-functions.php +33 -0
- includes/options/admin-config.php +2 -4
- includes/redirect.php +14 -14
- includes/thirdparty-compatibility.php +23 -0
- includes/vendor/amp/includes/class-amp-post-template.php +3 -0
- includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +0 -2
- includes/vendor/vendor-changelog.txt +2 -1
- pagebuilder/amp-page-builder.php +4 -2
- readme.txt +16 -15
- templates/design-manager/swift/style.php +2 -2
- templates/features.php +22 -4
@@ -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.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -194,6 +194,21 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
194 |
|
195 |
== Changelog ==
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
= 1.0.15 (17th January 2020) =
|
198 |
* Fixed: Sticky Social icons's css not loading correctly on some pages #3980
|
199 |
* Fixed: Need to add option to hide "AMP version" in view source page(generator). #4000
|
@@ -211,18 +226,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
211 |
* Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027
|
212 |
* Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
|
213 |
|
214 |
-
= 1.0.13 (13th January 2020) =
|
215 |
-
* Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
|
216 |
-
* Fixed: New Relic script is getting added in AMP and causing validtion error #4018
|
217 |
-
* Fixed: Icons are not loading when creating theme compatibility #3766
|
218 |
-
* Fixed: Video doesn't work on AMP when inserted from Siteorigin pagebuilder (Video player widget) #3936
|
219 |
-
* Fixed: Minor issues with amp need to fix #3931
|
220 |
-
* Fixed: When from amp page builder adding text module then space is not coming in paragraph #3982
|
221 |
-
* Fixed: Getting error at home page when push notification option is enabled. #4026
|
222 |
-
* Fixed: Please Fix Errors in Google Lighthouse audit in Accessibility (using Swift, Amp Layouts) #3949
|
223 |
-
* Fixed: Remove offers from the panel #4027
|
224 |
-
* Fixed: Detect Component and add or remove script accordingly #4067
|
225 |
-
* Fixed: GTM tags are not working in the updated version 1.0.9 but Google Analytics is working,Also in version 1.0.0 both are working fine #4059
|
226 |
-
* Fixed: Matomo (Piwik) Analytics generating errors in Console. #4042
|
227 |
-
|
228 |
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.3.2
|
7 |
+
Stable tag: 1.0.16
|
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.16 (24th January 2020) =
|
198 |
+
* Improvement: Need to built compatibility with "Mistape" plugin. #3974
|
199 |
+
* Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895
|
200 |
+
* Fixed: A Table is created trough Gutenberg then CSS of that Table is failing to load in AMP. #3902
|
201 |
+
* Fixed: When user search from the AMP site then results page should be in non-AMP. #3977
|
202 |
+
* Fixed: Add 'wp-color-picker' as dependency while registering the script #4061
|
203 |
+
* Fixed: The "for" attribute is removing in AMP #4054
|
204 |
+
* Fixed: Table heading style is not working properly #4050
|
205 |
+
* Fixed: Need to change the description of AMP page builder compatibility options when plugin is activated. #3899
|
206 |
+
* Fixed: Thumbnail image of homepage should show properly after changing the image size #3882
|
207 |
+
* Fixed: Need to remove the default AMP functionality from the User's theme as it is breaking the layout. #4068
|
208 |
+
* Fixed: YOAST SEO Analysis is not working properly with AMP Page Builder. #4030
|
209 |
+
* Fixed: When AMP is disabled on pages,give an option of hide/unhide AMP on Blog page when in edit mode. #4066
|
210 |
+
* Fixed: The tag 'template' requires including the 'amp-mustache' extension JavaScript. #4079
|
211 |
+
|
212 |
= 1.0.15 (17th January 2020) =
|
213 |
* Fixed: Sticky Social icons's css not loading correctly on some pages #3980
|
214 |
* Fixed: Need to add option to hide "AMP version" in view source page(generator). #4000
|
226 |
* Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027
|
227 |
* Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
@@ -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.
|
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.
|
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.16
|
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.16');
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
if(!defined('AMPFROWP_HOST_NAME')){
|
26 |
$urlinfo = get_bloginfo('url');
|
@@ -1,5 +1,20 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 1.0.15 (17th January 2020) =
|
4 |
* Fixed: Sticky Social icons's css not loading correctly on some pages #3980
|
5 |
* Fixed: Need to add option to hide "AMP version" in view source page(generator). #4000
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 1.0.16 (24th January 2020) =
|
4 |
+
* Improvement: Need to built compatibility with "Mistape" plugin. #3974
|
5 |
+
* Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895
|
6 |
+
* Fixed: A Table is created trough Gutenberg then CSS of that Table is failing to load in AMP. #3902
|
7 |
+
* Fixed: When user search from the AMP site then results page should be in non-AMP. #3977
|
8 |
+
* Fixed: Add 'wp-color-picker' as dependency while registering the script #4061
|
9 |
+
* Fixed: The "for" attribute is removing in AMP #4054
|
10 |
+
* Fixed: Table heading style is not working properly #4050
|
11 |
+
* Fixed: Need to change the description of AMP page builder compatibility options when plugin is activated. #3899
|
12 |
+
* Fixed: Thumbnail image of homepage should show properly after changing the image size #3882
|
13 |
+
* Fixed: Need to remove the default AMP functionality from the User's theme as it is breaking the layout. #4068
|
14 |
+
* Fixed: YOAST SEO Analysis is not working properly with AMP Page Builder. #4030
|
15 |
+
* Fixed: When AMP is disabled on pages,give an option of hide/unhide AMP on Blog page when in edit mode. #4066
|
16 |
+
* Fixed: The tag 'template' requires including the 'amp-mustache' extension JavaScript. #4079
|
17 |
+
|
18 |
= 1.0.15 (17th January 2020) =
|
19 |
* Fixed: Sticky Social icons's css not loading correctly on some pages #3980
|
20 |
* Fixed: Need to add option to hide "AMP version" in view source page(generator). #4000
|
@@ -732,8 +732,39 @@ function ampforwp_backtotop_global_css(){?>
|
|
732 |
text-align: center;
|
733 |
line-height: 1.5;
|
734 |
}
|
735 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
736 |
|
|
|
|
|
|
|
|
|
|
|
|
|
737 |
// Fallback for amp_call_now #2782
|
738 |
if ( !function_exists('amp_call_now') ) {
|
739 |
function amp_call_now(){
|
732 |
text-align: center;
|
733 |
line-height: 1.5;
|
734 |
}
|
735 |
+
<?php }
|
736 |
+
if ( ! ampforwp_woocommerce_conditional_check() ) {
|
737 |
+
if ( is_singular() || is_home() && true == ampforwp_get_setting( 'amp-frontpage-select-option' ) && ampforwp_get_blog_details() == false && ! checkAMPforPageBuilderStatus( ampforwp_get_the_ID() ) ) { ?>
|
738 |
+
/* Tables */
|
739 |
+
.wp-block-table{ min-width :240px;}
|
740 |
+
table.wp-block-table.alignright,table.wp-block-table.alignleft,table.wp-block-table.aligncenter{width: auto;}
|
741 |
+
table.wp-block-table.aligncenter{width: 50%;}
|
742 |
+
table.wp-block-table.alignfull,table.wp-block-table.alignwide{display: table;}
|
743 |
+
table { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; overflow-x: auto; }
|
744 |
+
table a:link { font-weight: bold; text-decoration: none; }
|
745 |
+
table a:visited { color: #999999; font-weight: bold; text-decoration: none; }
|
746 |
+
table a:active, table a:hover { color: #bd5a35; text-decoration: underline; }
|
747 |
+
table { font-family: Arial, Helvetica, sans-serif; color: #666; font-size: 12px; text-shadow: 1px 1px 0px #fff; background: #eee; margin: 0px; width: 95%; }
|
748 |
+
table th { padding: 21px 25px 22px 25px; border-top: 1px solid #fafafa; border-bottom: 1px solid #e0e0e0; background: #ededed; background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb)); background: -moz-linear-gradient(top, #ededed, #ebebeb); }
|
749 |
+
table th:first-child { text-align: left; padding-left: 20px; }
|
750 |
+
table tr:first-child th:first-child { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
|
751 |
+
table tr:first-child th:last-child { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
|
752 |
+
table tr { text-align: center; padding-left: 20px; }
|
753 |
+
table td:first-child {padding-left: 20px; border-left: 0; }
|
754 |
+
table td { padding: 18px; border-top: 1px solid #ffffff; border-bottom: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; background: #fafafa; background: -webkit-gradient(linear, left top, left bottom, from(#fbfbfb), to(#fafafa)); background: -moz-linear-gradient(top, #fbfbfb, #fafafa); }
|
755 |
+
table tr.even td { background: #f6f6f6; background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f6f6f6)); background: -moz-linear-gradient(top, #f8f8f8, #f6f6f6); }
|
756 |
+
table tr:last-child td {border-bottom: 0;}
|
757 |
+
table tr:last-child td:first-child { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
|
758 |
+
table tr:last-child td:last-child { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
|
759 |
+
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); }
|
760 |
+
@media screen and (min-width: 650px) { table {display: inline-table;} }
|
761 |
|
762 |
+
<?php }
|
763 |
+
}?>
|
764 |
+
.has-text-align-left { text-align: left;}
|
765 |
+
.has-text-align-right { text-align: right;}
|
766 |
+
.has-text-align-center { text-align: center;}
|
767 |
+
<?php }
|
768 |
// Fallback for amp_call_now #2782
|
769 |
if ( !function_exists('amp_call_now') ) {
|
770 |
function amp_call_now(){
|
@@ -148,6 +148,12 @@ function ampforwp_get_relatedpost_image( $imagetype ='thumbnail', $data=array()
|
|
148 |
$width = $width * $resolution;
|
149 |
$height = $height * $resolution;
|
150 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
$thumb_url_array = ampforwp_aq_resize( $thumb_url, $width, $height, true, false, true ); //resize & crop the image
|
152 |
$thumb_url = $thumb_url_array[0];
|
153 |
$thumb_width = $thumb_url_array[1];
|
148 |
$width = $width * $resolution;
|
149 |
$height = $height * $resolution;
|
150 |
}
|
151 |
+
$image_dimensions = array();
|
152 |
+
$image_dimensions['width'] = $width;
|
153 |
+
$image_dimensions['height'] = $height;
|
154 |
+
$image_dimensions = apply_filters('ampforwp_related_post_image_size', $image_dimensions);
|
155 |
+
$width = $image_dimensions['width'];
|
156 |
+
$height = $image_dimensions['height'];
|
157 |
$thumb_url_array = ampforwp_aq_resize( $thumb_url, $width, $height, true, false, true ); //resize & crop the image
|
158 |
$thumb_url = $thumb_url_array[0];
|
159 |
$thumb_width = $thumb_url_array[1];
|
@@ -31,12 +31,14 @@ function ampforwp_add_admin_styling($hook_suffix){
|
|
31 |
wp_enqueue_style( 'ampforwp_admin_css' );
|
32 |
|
33 |
// Admin area scripts file
|
34 |
-
wp_register_script( 'ampforwp_admin_js', untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . '/includes/admin-script.js',
|
35 |
|
36 |
// Localize the script with new data
|
37 |
$redux_data = array();
|
38 |
if( current_user_can("manage_options") && $hook_suffix=='toplevel_page_amp_options' ){
|
39 |
$redux_data = $redux_builder_amp;
|
|
|
|
|
40 |
}
|
41 |
if( current_user_can("manage_options") && $hook_suffix == 'options-reading.php' && 0 == $redux_builder_amp['amp-frontpage-select-option']) {
|
42 |
$redux_data['frontpage'] = 'false';
|
@@ -60,8 +62,8 @@ function ampforwp_add_admin_styling($hook_suffix){
|
|
60 |
$redux_data = apply_filters("ampforwp_custom_localize_data", $redux_data);
|
61 |
wp_localize_script( 'ampforwp_admin_js', 'redux_data', $redux_data );
|
62 |
wp_localize_script( 'ampforwp_admin_js', 'ampforwp_nonce', wp_create_nonce('ampforwp-verify-request') );
|
63 |
-
wp_enqueue_script( 'ampforwp_admin_js' );
|
64 |
wp_enqueue_script( 'wp-color-picker' );
|
|
|
65 |
}
|
66 |
// 96. ampforwp_is_front_page() ampforwp_is_home() and ampforwp_is_blog is created
|
67 |
function ampforwp_is_front_page(){
|
31 |
wp_enqueue_style( 'ampforwp_admin_css' );
|
32 |
|
33 |
// Admin area scripts file
|
34 |
+
wp_register_script( 'ampforwp_admin_js', untrailingslashit(AMPFORWP_PLUGIN_DIR_URI) . '/includes/admin-script.js', array('wp-color-picker'), AMPFORWP_VERSION );
|
35 |
|
36 |
// Localize the script with new data
|
37 |
$redux_data = array();
|
38 |
if( current_user_can("manage_options") && $hook_suffix=='toplevel_page_amp_options' ){
|
39 |
$redux_data = $redux_builder_amp;
|
40 |
+
}else{
|
41 |
+
$redux_data['ampforwp-amp-takeover'] = ampforwp_get_setting('ampforwp-amp-takeover');
|
42 |
}
|
43 |
if( current_user_can("manage_options") && $hook_suffix == 'options-reading.php' && 0 == $redux_builder_amp['amp-frontpage-select-option']) {
|
44 |
$redux_data['frontpage'] = 'false';
|
62 |
$redux_data = apply_filters("ampforwp_custom_localize_data", $redux_data);
|
63 |
wp_localize_script( 'ampforwp_admin_js', 'redux_data', $redux_data );
|
64 |
wp_localize_script( 'ampforwp_admin_js', 'ampforwp_nonce', wp_create_nonce('ampforwp-verify-request') );
|
|
|
65 |
wp_enqueue_script( 'wp-color-picker' );
|
66 |
+
wp_enqueue_script( 'ampforwp_admin_js' );
|
67 |
}
|
68 |
// 96. ampforwp_is_front_page() ampforwp_is_home() and ampforwp_is_blog is created
|
69 |
function ampforwp_is_front_page(){
|
@@ -4,24 +4,27 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
4 |
exit;
|
5 |
}
|
6 |
function ampforwp_page_builders_support_options($opt_name){
|
7 |
-
$divi_pb_for_ampchecker = $elemntr_pb_for_ampchecker = array();
|
8 |
-
$divi_pb_for_ampchecker = array(
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
'id' => 'avada_pb_for_amp_info_normal',
|
26 |
'type' => 'info',
|
27 |
'required' => array(
|
@@ -29,7 +32,8 @@ $avada_pb_for_ampchecker = array(
|
|
29 |
),
|
30 |
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder compatibility For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
|
31 |
);
|
32 |
-
|
|
|
33 |
'id' => 'avia_pb_for_amp_info_normal',
|
34 |
'type' => 'info',
|
35 |
'required' => array(
|
@@ -37,7 +41,7 @@ $avia_pb_for_ampchecker = array(
|
|
37 |
),
|
38 |
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder compatibility For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
|
39 |
);
|
40 |
-
|
41 |
$pb_for_amp[] = array(
|
42 |
'id' => 'ampforwp-pagebuilder-accor',
|
43 |
'type' => 'section',
|
@@ -46,7 +50,6 @@ $avia_pb_for_ampchecker = array(
|
|
46 |
'layout_type' => 'accordion',
|
47 |
'accordion-open'=> 1,
|
48 |
);
|
49 |
-
|
50 |
$pb_for_amp[] = array(
|
51 |
'id' => 'ampforwp-pagebuilder',
|
52 |
'type' => 'switch',
|
@@ -54,92 +57,96 @@ $avia_pb_for_ampchecker = array(
|
|
54 |
'tooltip-subtitle' => esc_html__('Enable or Disable the AMP PageBuilder', 'accelerated-mobile-pages'),
|
55 |
'default' => true
|
56 |
);
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
73 |
$pb_for_amp[] = $divi_pb_for_ampchecker;
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
89 |
$pb_for_amp[] = $elemntr_pb_for_ampchecker;
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
105 |
$pb_for_amp[] = $avada_pb_for_ampchecker;
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
121 |
$pb_for_amp[] = $avia_pb_for_ampchecker;
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
if(class_exists('Vc_Manager') ){
|
127 |
-
$pb_title = 'WPBakery Page Builder Support';
|
128 |
}
|
129 |
-
|
130 |
-
|
131 |
-
}
|
132 |
-
if(did_action( 'elementor/loaded' ) ){
|
133 |
-
$pb_title = 'Elementor Support';
|
134 |
}
|
135 |
if ( class_exists( 'FusionBuilder' ) ) {
|
136 |
$pb_title = 'Avada Fusion Builder Support';
|
137 |
}
|
138 |
-
|
|
|
|
|
139 |
Redux::setSection( $opt_name, array(
|
140 |
'title' => esc_html__( $pb_title, 'accelerated-mobile-pages' ),
|
141 |
'id' => 'amp-content-builder',
|
142 |
-
'class' => '',
|
143 |
'subsection' => true,
|
144 |
'fields' => $pb_for_amp,
|
145 |
)
|
4 |
exit;
|
5 |
}
|
6 |
function ampforwp_page_builders_support_options($opt_name){
|
7 |
+
$divi_pb_for_ampchecker = $elemntr_pb_for_ampchecker = array();
|
8 |
+
$divi_pb_for_ampchecker = array(
|
9 |
+
'id' => 'divi_pb_for_amp_info_normal',
|
10 |
+
'type' => 'info',
|
11 |
+
'required' => array(
|
12 |
+
array('ampforwp-divi-pb-for-amp', '=' , true),
|
13 |
+
),
|
14 |
+
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
|
15 |
+
);
|
16 |
+
|
17 |
+
$elemntr_pb_for_ampchecker = array(
|
18 |
+
'id' => 'elemntr_pb_for_amp_info_normal',
|
19 |
+
'type' => 'info',
|
20 |
+
'required' => array(
|
21 |
+
array('ampforwp-elementor-pb-for-amp', '=' , true),
|
22 |
+
),
|
23 |
+
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
|
24 |
+
);
|
25 |
+
|
26 |
+
//}
|
27 |
+
$avada_pb_for_ampchecker = array(
|
28 |
'id' => 'avada_pb_for_amp_info_normal',
|
29 |
'type' => 'info',
|
30 |
'required' => array(
|
32 |
),
|
33 |
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder compatibility For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
|
34 |
);
|
35 |
+
|
36 |
+
$avia_pb_for_ampchecker = array(
|
37 |
'id' => 'avia_pb_for_amp_info_normal',
|
38 |
'type' => 'info',
|
39 |
'required' => array(
|
41 |
),
|
42 |
'desc' => sprintf('<div style="background: #FFF9C4;padding: 12px;line-height: 1.6;margin: -45px -14px -18px -17px;"><b>%s</b> %s <a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a> extension.<br /> <div style="margin-top:4px;">(<a href="https://ampforwp.com/page-builder-compatibility-for-amp/" target="_blank">%s</a>)</div></div>',esc_html__( 'ONE LAST STEP REQUIRED:','accelerated-mobile-pages'),esc_html__( 'This feature requires', 'accelerated-mobile-pages' ),esc_html__( 'Page Builder compatibility For AMP', 'accelerated-mobile-pages'),esc_html__( 'Click here for more info', 'accelerated-mobile-pages' )),
|
43 |
);
|
44 |
+
|
45 |
$pb_for_amp[] = array(
|
46 |
'id' => 'ampforwp-pagebuilder-accor',
|
47 |
'type' => 'section',
|
50 |
'layout_type' => 'accordion',
|
51 |
'accordion-open'=> 1,
|
52 |
);
|
|
|
53 |
$pb_for_amp[] = array(
|
54 |
'id' => 'ampforwp-pagebuilder',
|
55 |
'type' => 'switch',
|
57 |
'tooltip-subtitle' => esc_html__('Enable or Disable the AMP PageBuilder', 'accelerated-mobile-pages'),
|
58 |
'default' => true
|
59 |
);
|
60 |
+
if(function_exists('et_setup_theme')){
|
61 |
+
$pb_for_amp[] = array(
|
62 |
+
'id' => 'ampforwp-divi-pb-for-amp-accor',
|
63 |
+
'type' => 'section',
|
64 |
+
'title' => esc_html__('Divi Builder Compatibility', 'accelerated-mobile-pages'),
|
65 |
+
'indent' => true,
|
66 |
+
'layout_type' => 'accordion',
|
67 |
+
'accordion-open'=> 1,
|
68 |
+
);
|
69 |
+
$pb_for_amp[] = array(
|
70 |
+
'id' => 'ampforwp-divi-pb-for-amp',
|
71 |
+
'type' => 'switch',
|
72 |
+
'title' => esc_html__('Divi Builder Support','accelerated-mobile-pages'),
|
73 |
+
'tooltip-subtitle' => esc_html__('Enable or Disable the Divi Builder support for AMP', 'accelerated-mobile-pages'),
|
74 |
+
'default' => true
|
75 |
+
);
|
76 |
+
}
|
77 |
$pb_for_amp[] = $divi_pb_for_ampchecker;
|
78 |
+
if(function_exists('elementor_load_plugin_textdomain')){
|
79 |
+
$pb_for_amp[] = array(
|
80 |
+
'id' => 'ampforwp-elementor-pb-for-amp-accor',
|
81 |
+
'type' => 'section',
|
82 |
+
'title' => esc_html__('Elementor Compatibility', 'accelerated-mobile-pages'),
|
83 |
+
'indent' => true,
|
84 |
+
'layout_type' => 'accordion',
|
85 |
+
'accordion-open'=> 1,
|
86 |
+
);
|
87 |
+
$pb_for_amp[] = array(
|
88 |
+
'id' => 'ampforwp-elementor-pb-for-amp',
|
89 |
+
'type' => 'switch',
|
90 |
+
'title' => esc_html__('Elementor Support','accelerated-mobile-pages'),
|
91 |
+
'tooltip-subtitle' => esc_html__('Enable or Disable the Elementor support for AMP', 'accelerated-mobile-pages'),
|
92 |
+
'default' => false
|
93 |
+
);
|
94 |
+
}
|
95 |
$pb_for_amp[] = $elemntr_pb_for_ampchecker;
|
96 |
+
if(function_exists('Avada')){
|
97 |
+
$pb_for_amp[] = array(
|
98 |
+
'id' => 'ampforwp-avada-pb-for-amp-accor',
|
99 |
+
'type' => 'section',
|
100 |
+
'title' => esc_html__('Avada(Fusion builder) Compatibility', 'accelerated-mobile-pages'),
|
101 |
+
'indent' => true,
|
102 |
+
'layout_type' => 'accordion',
|
103 |
+
'accordion-open'=> 1,
|
104 |
+
);
|
105 |
+
$pb_for_amp[] = array(
|
106 |
+
'id' => 'ampforwp-avada-pb-for-amp',
|
107 |
+
'type' => 'switch',
|
108 |
+
'title' => esc_html__('Avada(Fusion builder) Support','accelerated-mobile-pages'),
|
109 |
+
'tooltip-subtitle' => esc_html__('Enable or Disable the Avada support for AMP', 'accelerated-mobile-pages'),
|
110 |
+
'default' => false
|
111 |
+
);
|
112 |
+
}
|
113 |
$pb_for_amp[] = $avada_pb_for_ampchecker;
|
114 |
+
if(function_exists('avia_lang_setup')){
|
115 |
+
$pb_for_amp[] = array(
|
116 |
+
'id' => 'ampforwp-avia-pb-for-amp-accor',
|
117 |
+
'type' => 'section',
|
118 |
+
'title' => esc_html__('Avia(Enfold) Compatibility', 'accelerated-mobile-pages'),
|
119 |
+
'indent' => true,
|
120 |
+
'layout_type' => 'accordion',
|
121 |
+
'accordion-open'=> 1,
|
122 |
+
);
|
123 |
+
$pb_for_amp[] = array(
|
124 |
+
'id' => 'ampforwp-avia-pb-for-amp',
|
125 |
+
'type' => 'switch',
|
126 |
+
'title' => esc_html__('Avia(Enfold) Support','accelerated-mobile-pages'),
|
127 |
+
'tooltip-subtitle' => esc_html__('Enable or Disable the Avia support for AMP', 'accelerated-mobile-pages'),
|
128 |
+
'default' => false
|
129 |
+
);
|
130 |
+
}
|
131 |
$pb_for_amp[] = $avia_pb_for_ampchecker;
|
132 |
+
$pb_title = 'Page Builder';
|
133 |
+
$theme = wp_get_theme(); // gets the current theme
|
134 |
+
if( class_exists('ET_Builder_Plugin') || 'Divi' == $theme->name || 'Divi' == $theme->parent_theme ){
|
135 |
+
$pb_title = 'Divi Builder Support';
|
|
|
|
|
136 |
}
|
137 |
+
if(function_exists('elementor_load_plugin_textdomain')){
|
138 |
+
$pb_title = 'Elementor Support';
|
|
|
|
|
|
|
139 |
}
|
140 |
if ( class_exists( 'FusionBuilder' ) ) {
|
141 |
$pb_title = 'Avada Fusion Builder Support';
|
142 |
}
|
143 |
+
if(function_exists('avia_lang_setup')){
|
144 |
+
$pb_title = 'Avia Builder Support';
|
145 |
+
}
|
146 |
Redux::setSection( $opt_name, array(
|
147 |
'title' => esc_html__( $pb_title, 'accelerated-mobile-pages' ),
|
148 |
'id' => 'amp-content-builder',
|
149 |
+
'class' => 'ampforwp_new_features ',
|
150 |
'subsection' => true,
|
151 |
'fields' => $pb_for_amp,
|
152 |
)
|
@@ -262,6 +262,10 @@ if( !function_exists("ampforwp_tree_shaking_purify_amphtml") ){
|
|
262 |
if(strpos($sheet, '-keyframes')!==false){
|
263 |
$sheet = preg_replace("/@(-o-|-moz-|-webkit-|-ms-)*keyframes\s(.*?){([0-9%a-zA-Z,\s.]*{(.*?)})*[\s\n]*}/s", "", $sheet);
|
264 |
}
|
|
|
|
|
|
|
|
|
265 |
if(preg_match('/<style\samp-custom>(.*?)<\/style>/s', $completeContent,$matches)){
|
266 |
$completeContent = preg_replace("/<style\samp-custom>(.*?)<\/style>/s", "".$comment."<style amp-custom>".$sheet."</style>", $completeContent);
|
267 |
}else if(preg_match('/<style\samp-custom>(.*)<\/style>/s', $completeContent,$matches)){
|
@@ -359,4 +363,33 @@ if( !function_exists("ampforwp_clear_tree_shaking_post") ) {
|
|
359 |
}
|
360 |
|
361 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
// Tree shaking feature #2949 --- ends here ---
|
262 |
if(strpos($sheet, '-keyframes')!==false){
|
263 |
$sheet = preg_replace("/@(-o-|-moz-|-webkit-|-ms-)*keyframes\s(.*?){([0-9%a-zA-Z,\s.]*{(.*?)})*[\s\n]*}/s", "", $sheet);
|
264 |
}
|
265 |
+
//TRANSPOSH PLUGIN RTL ISSUE FIXED #3895
|
266 |
+
if(class_exists('transposh_plugin')){
|
267 |
+
ampforwp_clear_css_on_transposh_rtl($sheet);
|
268 |
+
}
|
269 |
if(preg_match('/<style\samp-custom>(.*?)<\/style>/s', $completeContent,$matches)){
|
270 |
$completeContent = preg_replace("/<style\samp-custom>(.*?)<\/style>/s", "".$comment."<style amp-custom>".$sheet."</style>", $completeContent);
|
271 |
}else if(preg_match('/<style\samp-custom>(.*)<\/style>/s', $completeContent,$matches)){
|
363 |
}
|
364 |
|
365 |
}
|
366 |
+
|
367 |
+
if(!function_exists('ampforwp_clear_css_on_transposh_rtl')){
|
368 |
+
function ampforwp_clear_css_on_transposh_rtl($css){
|
369 |
+
if(class_exists('transposh_plugin')){
|
370 |
+
$rtl_lang_arr = array('ar', 'he', 'fa', 'ur', 'yi');
|
371 |
+
if(isset($_GET['lang'])){
|
372 |
+
if(in_array(esc_attr($_GET['lang']), $rtl_lang_arr)){
|
373 |
+
if(!preg_match('/m-ctr{margin-right:0%}/', $css)){
|
374 |
+
if(ampforwp_get_setting('ampforwp_css_tree_shaking')){
|
375 |
+
$upload_dir = wp_upload_dir();
|
376 |
+
$user_dirname = $upload_dir['basedir'] . '/' . 'ampforwp-tree-shaking';
|
377 |
+
if ( file_exists( $user_dirname ) ) {
|
378 |
+
$files = glob( $user_dirname . '/*' );
|
379 |
+
//Loop through the file list.
|
380 |
+
foreach ( $files as $file ) {
|
381 |
+
//Make sure that this is a file and not a directory.
|
382 |
+
if ( is_file( $file ) && strpos( $file, '_transient' ) !== false ) {
|
383 |
+
//Use the unlink function to delete the file.
|
384 |
+
unlink( $file );
|
385 |
+
}
|
386 |
+
}
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
}
|
392 |
+
}
|
393 |
+
}
|
394 |
+
}
|
395 |
// Tree shaking feature #2949 --- ends here ---
|
@@ -2634,12 +2634,10 @@ Redux::setSection( $opt_name, array(
|
|
2634 |
),
|
2635 |
array(
|
2636 |
'id' => 'amp-redirection-search',
|
2637 |
-
'class' => 'child_opt child_opt_arrow',
|
2638 |
'type' => 'switch',
|
2639 |
-
'title' => esc_html__('Search
|
2640 |
-
'tooltip-subtitle' => esc_html__('
|
2641 |
'default' => 1,
|
2642 |
-
'required' => array( 'amp-mobile-redirection', '=' , 1 )
|
2643 |
),
|
2644 |
array(
|
2645 |
'id' => 'convert-internal-nonamplinks-to-amp',
|
2634 |
),
|
2635 |
array(
|
2636 |
'id' => 'amp-redirection-search',
|
|
|
2637 |
'type' => 'switch',
|
2638 |
+
'title' => esc_html__('Search Result Page in AMP', 'accelerated-mobile-pages'),
|
2639 |
+
'tooltip-subtitle' => esc_html__('Disable this option if you want your search pages in Non-AMP.','accelerated-mobile-pages'),
|
2640 |
'default' => 1,
|
|
|
2641 |
),
|
2642 |
array(
|
2643 |
'id' => 'convert-internal-nonamplinks-to-amp',
|
@@ -48,22 +48,22 @@ function ampforwp_redirection() {
|
|
48 |
exit;
|
49 |
}
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
// Redirect ?nonamp=1 to normal url #3269
|
52 |
-
$current_url = $check = '';
|
53 |
-
$current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ?
|
54 |
-
"https" : "http") . "://" . AMPFROWP_HOST_NAME .
|
55 |
-
$_SERVER['REQUEST_URI'];
|
56 |
-
$current_url = explode('/', $current_url);
|
57 |
-
$check = '?nonamp=1';
|
58 |
if (( isset($_GET['nonamp']) && 1 == $_GET['nonamp'] ) ){
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
if (in_array( $check , $current_url ) ) {
|
63 |
-
$current_url = array_flip($current_url);
|
64 |
-
unset($current_url['?nonamp=1']);
|
65 |
-
$current_url = array_flip($current_url);
|
66 |
-
$current_url = implode('/', $current_url);
|
67 |
$current_url = user_trailingslashit($current_url);
|
68 |
wp_safe_redirect( $current_url );
|
69 |
exit;
|
48 |
exit;
|
49 |
}
|
50 |
}
|
51 |
+
$current_url = home_url(add_query_arg(array($_GET), $wp->request));
|
52 |
+
//AMP on Search Pages #3977
|
53 |
+
if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
|
54 |
+
if(strpos( $current_url, "amp=1&")!==false){
|
55 |
+
$redirect_search = str_replace("amp=1&", '', $current_url);
|
56 |
+
wp_safe_redirect( $redirect_search, 301 );
|
57 |
+
exit;
|
58 |
+
}else{
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
}
|
62 |
// Redirect ?nonamp=1 to normal url #3269
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
if (( isset($_GET['nonamp']) && 1 == $_GET['nonamp'] ) ){
|
64 |
+
session_start();
|
65 |
+
$_SESSION['ampforwp_mobile'] = 'exit';
|
66 |
+
$current_url = str_replace("?nonamp=1", '',$current_url);
|
|
|
|
|
|
|
|
|
|
|
67 |
$current_url = user_trailingslashit($current_url);
|
68 |
wp_safe_redirect( $current_url );
|
69 |
exit;
|
@@ -38,6 +38,10 @@ function ampforwp_thirdparty_compatibility(){
|
|
38 |
remove_filter( 'post_thumbnail_html', 'shortPixelConvertImgToPictureAddWebp');
|
39 |
//Validation error with Authentic theme #3535
|
40 |
remove_filter( 'amp_post_template_data', 'csco_amp_post_template_data', 10, 2 );
|
|
|
|
|
|
|
|
|
41 |
//Validation errors in amp category page due to HotWP PRO #3455
|
42 |
if(function_exists('hotwp_get_option') && is_category()){
|
43 |
remove_all_filters('get_the_archive_title');
|
@@ -1045,4 +1049,23 @@ function ampforwp_non_amp_gallery($matches){
|
|
1045 |
$imagesHTML = '<ul class="slideshow-container">'.$images. /* $images is already sanitized, XSS OK */'<a class="nonamp-prev" onclick="plusSlides(-1)">❮</a>
|
1046 |
<a class="nonamp-next" onclick="plusSlides(1)">❯</a></ul>';
|
1047 |
return $imagesHTML;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1048 |
}
|
38 |
remove_filter( 'post_thumbnail_html', 'shortPixelConvertImgToPictureAddWebp');
|
39 |
//Validation error with Authentic theme #3535
|
40 |
remove_filter( 'amp_post_template_data', 'csco_amp_post_template_data', 10, 2 );
|
41 |
+
//Breaking the layout with diginex theme #4068
|
42 |
+
if(function_exists('airkit_widgetFileAutoloader')){
|
43 |
+
remove_filter( 'amp_post_template_file', 'airkit_amp_set_custom_style_path', 10, 3 );
|
44 |
+
}
|
45 |
//Validation errors in amp category page due to HotWP PRO #3455
|
46 |
if(function_exists('hotwp_get_option') && is_category()){
|
47 |
remove_all_filters('get_the_archive_title');
|
1049 |
$imagesHTML = '<ul class="slideshow-container">'.$images. /* $images is already sanitized, XSS OK */'<a class="nonamp-prev" onclick="plusSlides(-1)">❮</a>
|
1050 |
<a class="nonamp-next" onclick="plusSlides(1)">❯</a></ul>';
|
1051 |
return $imagesHTML;
|
1052 |
+
}
|
1053 |
+
// MISTAPE PLUGIN COMPATIBILITY #3974
|
1054 |
+
if(function_exists('deco_mistape_init')){
|
1055 |
+
add_action('amp_post_template_css', 'ampforwp_mistape_plugin_style');
|
1056 |
+
}
|
1057 |
+
if(!function_exists('ampforwp_mistape_plugin_style')){
|
1058 |
+
function ampforwp_mistape_plugin_style(){
|
1059 |
+
$css = '.mistape_caption{font-size:80%;opacity:.8}.mistape-logo svg{display:block;height:22px;width:22px;fill:#e42029}.mistape_caption .mistape-link{text-decoration:none;border:none;box-shadow:none}.mistape-link:hover{text-decoration:none;border:none}';
|
1060 |
+
echo ampforwp_css_sanitizer($css);
|
1061 |
+
}
|
1062 |
+
}
|
1063 |
+
if(!function_exists('ampforwp_mistape_plugin_compatibility')){
|
1064 |
+
function ampforwp_mistape_plugin_compatibility($content){
|
1065 |
+
if(function_exists('deco_mistape_init')){
|
1066 |
+
$rep = '<a href="https://mistape.com" target="_blank" rel="nofollow" class="mistape-link mistape-logo"><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="-12 -10 39.9 40" enable-background="new -12 -10 39.9 40" xml:space="preserve">';
|
1067 |
+
$content = preg_replace('/<span\sclass=\"mistape-link-wrap">(.*?)<\/span>/', $rep.'$1</svg></a>', $content);
|
1068 |
+
}
|
1069 |
+
return $content;
|
1070 |
+
}
|
1071 |
}
|
@@ -322,6 +322,9 @@ class AMP_Post_Template {
|
|
322 |
);
|
323 |
|
324 |
$amp_con = $amp_content->get_amp_content();
|
|
|
|
|
|
|
325 |
$amp_con = $this->ampforwp_add_fallback_element($amp_con,'amp-img');
|
326 |
$this->add_data_by_key( 'post_amp_content', $amp_con);
|
327 |
$this->merge_data_for_key( 'amp_component_scripts', $amp_content->get_amp_scripts() );
|
322 |
);
|
323 |
|
324 |
$amp_con = $amp_content->get_amp_content();
|
325 |
+
if(function_exists('ampforwp_mistape_plugin_compatibility')){
|
326 |
+
$amp_con = ampforwp_mistape_plugin_compatibility($amp_con);
|
327 |
+
}
|
328 |
$amp_con = $this->ampforwp_add_fallback_element($amp_con,'amp-img');
|
329 |
$this->add_data_by_key( 'post_amp_content', $amp_con);
|
330 |
$this->merge_data_for_key( 'amp_component_scripts', $amp_content->get_amp_scripts() );
|
@@ -291,8 +291,6 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
291 |
'param',
|
292 |
'applet',
|
293 |
'form',
|
294 |
-
'label',
|
295 |
-
'input',
|
296 |
'textarea',
|
297 |
'select',
|
298 |
'option',
|
291 |
'param',
|
292 |
'applet',
|
293 |
'form',
|
|
|
|
|
294 |
'textarea',
|
295 |
'select',
|
296 |
'option',
|
@@ -92,4 +92,5 @@ Reason: To extend the functionality of sidebars and Pagebuilder
|
|
92 |
62. Warnings fixed of util function to get array component #3778
|
93 |
63. Need to remove width from inline style on amp images #3741
|
94 |
64. Fixed Instagram video (tv) rendering issue #3812
|
95 |
-
65. Needs to redirect to 301, not in 302 #3767
|
|
92 |
62. Warnings fixed of util function to get array component #3778
|
93 |
63. Need to remove width from inline style on amp images #3741
|
94 |
64. Fixed Instagram video (tv) rendering issue #3812
|
95 |
+
65. Needs to redirect to 301, not in 302 #3767
|
96 |
+
66. Whitelisted label and input tags #4054
|
@@ -128,8 +128,10 @@ function ampforwp_call_page_builder(){
|
|
128 |
unset($backendRowSetting['front_common_css']);
|
129 |
wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
|
130 |
|
131 |
-
if(class_exists('WPSEO_Frontend') && true == ampforwp_get_setting('ampforwp-yoast-seo-analysis') && true == ampforwp_get_setting('ampforwp-amp-takeover') ) {
|
132 |
-
|
|
|
|
|
133 |
<?php } ?>
|
134 |
<div id="ampForWpPageBuilder_container">
|
135 |
<div id="start_amp_pb_post" class="start_amp_pb" data-postId="<?php echo esc_attr(get_the_ID()) ?>" v-if="startPagebuilder==0" @click="amppb_startFunction($event)"><?php echo esc_html__('Start the AMP Page Builder','accelerated-mobile-pages'); ?></div>
|
128 |
unset($backendRowSetting['front_common_css']);
|
129 |
wp_nonce_field( basename( __FILE__) , 'amp_content_editor_nonce' );
|
130 |
|
131 |
+
if(class_exists('WPSEO_Frontend') && true == ampforwp_get_setting('ampforwp-yoast-seo-analysis') && true == ampforwp_get_setting('ampforwp-amp-takeover') ) {
|
132 |
+
$pb_content = get_post_field('amp-page-builder',$post->ID);
|
133 |
+
?>
|
134 |
+
<script type="text/template" class="hide" id="amp-page-builder-ready"><?php echo stripcslashes( $pb_content ); ?></script>
|
135 |
<?php } ?>
|
136 |
<div id="ampForWpPageBuilder_container">
|
137 |
<div id="start_amp_pb_post" class="start_amp_pb" data-postId="<?php echo esc_attr(get_the_ID()) ?>" v-if="startPagebuilder==0" @click="amppb_startFunction($event)"><?php echo esc_html__('Start the AMP Page Builder','accelerated-mobile-pages'); ?></div>
|
@@ -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.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -191,6 +191,21 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
191 |
|
192 |
== Changelog ==
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
= 1.0.15 (17th January 2020) =
|
195 |
* Fixed: Sticky Social icons's css not loading correctly on some pages #3980
|
196 |
* Fixed: Need to add option to hide "AMP version" in view source page(generator). #4000
|
@@ -208,18 +223,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
208 |
* Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027
|
209 |
* Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
|
210 |
|
211 |
-
= 1.0.13 (13th January 2020) =
|
212 |
-
* Fixed: Warring in console : [DOM] Found 2 elements with non-unique id #amp-search #3946
|
213 |
-
* Fixed: New Relic script is getting added in AMP and causing validtion error #4018
|
214 |
-
* Fixed: Icons are not loading when creating theme compatibility #3766
|
215 |
-
* Fixed: Video doesn't work on AMP when inserted from Siteorigin pagebuilder (Video player widget) #3936
|
216 |
-
* Fixed: Minor issues with amp need to fix #3931
|
217 |
-
* Fixed: When from amp page builder adding text module then space is not coming in paragraph #3982
|
218 |
-
* Fixed: Getting error at home page when push notification option is enabled. #4026
|
219 |
-
* Fixed: Please Fix Errors in Google Lighthouse audit in Accessibility (using Swift, Amp Layouts) #3949
|
220 |
-
* Fixed: Remove offers from the panel #4027
|
221 |
-
* Fixed: Detect Component and add or remove script accordingly #4067
|
222 |
-
* Fixed: GTM tags are not working in the updated version 1.0.9 but Google Analytics is working,Also in version 1.0.0 both are working fine #4059
|
223 |
-
* Fixed: Matomo (Piwik) Analytics generating errors in Console. #4042
|
224 |
-
|
225 |
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.3.2
|
7 |
+
Stable tag: 1.0.16
|
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.16 (24th January 2020) =
|
195 |
+
* Improvement: Need to built compatibility with "Mistape" plugin. #3974
|
196 |
+
* Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895
|
197 |
+
* Fixed: A Table is created trough Gutenberg then CSS of that Table is failing to load in AMP. #3902
|
198 |
+
* Fixed: When user search from the AMP site then results page should be in non-AMP. #3977
|
199 |
+
* Fixed: Add 'wp-color-picker' as dependency while registering the script #4061
|
200 |
+
* Fixed: The "for" attribute is removing in AMP #4054
|
201 |
+
* Fixed: Table heading style is not working properly #4050
|
202 |
+
* Fixed: Need to change the description of AMP page builder compatibility options when plugin is activated. #3899
|
203 |
+
* Fixed: Thumbnail image of homepage should show properly after changing the image size #3882
|
204 |
+
* Fixed: Need to remove the default AMP functionality from the User's theme as it is breaking the layout. #4068
|
205 |
+
* Fixed: YOAST SEO Analysis is not working properly with AMP Page Builder. #4030
|
206 |
+
* Fixed: When AMP is disabled on pages,give an option of hide/unhide AMP on Blog page when in edit mode. #4066
|
207 |
+
* Fixed: The tag 'template' requires including the 'amp-mustache' extension JavaScript. #4079
|
208 |
+
|
209 |
= 1.0.15 (17th January 2020) =
|
210 |
* Fixed: Sticky Social icons's css not loading correctly on some pages #3980
|
211 |
* Fixed: Need to add option to hide "AMP version" in view source page(generator). #4000
|
223 |
* Fixed: Warning in accelerated-mobile-pages/includes/options/admin-config.php on line 1250 #4027
|
224 |
* Fixed: Code improvement in Detect Component and add or remove script accordingly #4067
|
225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
@@ -670,8 +670,8 @@ if ( ampforwp_get_setting('swift-featued-image-type') == 2) { ?>
|
|
670 |
.amp-tags .amp-tag:after{content: "/";display: inline-block;padding: 0px 10px;position: relative;top: -1px;color: #ccc;font-size: 12px;}
|
671 |
.amp-tags .amp-tag:last-child:after{display:none;}
|
672 |
.ss-ic li:before{border-radius: 2px;text-align:center;padding: 4px 6px;}
|
673 |
-
.sgl table {width: 100%;margin-bottom:25px;}
|
674 |
-
.sgl td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
675 |
.sgl tr:nth-child(odd) td {background: #f7f7f7;}
|
676 |
<?php // Social Sharing Conditional CSS
|
677 |
if($redux_builder_amp['swift-social-position'] == 'above-content'){?>
|
670 |
.amp-tags .amp-tag:after{content: "/";display: inline-block;padding: 0px 10px;position: relative;top: -1px;color: #ccc;font-size: 12px;}
|
671 |
.amp-tags .amp-tag:last-child:after{display:none;}
|
672 |
.ss-ic li:before{border-radius: 2px;text-align:center;padding: 4px 6px;}
|
673 |
+
.sgl table {width: 100%;margin-bottom:25px;border: 1px solid #ddd;}
|
674 |
+
.sgl th , .sgl td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
675 |
.sgl tr:nth-child(odd) td {background: #f7f7f7;}
|
676 |
<?php // Social Sharing Conditional CSS
|
677 |
if($redux_builder_amp['swift-social-position'] == 'above-content'){?>
|
@@ -248,7 +248,7 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
248 |
}
|
249 |
}
|
250 |
// Search results on/off option #3786
|
251 |
-
if(is_search() &&
|
252 |
return;
|
253 |
}
|
254 |
// #872 no-amphtml if selected as hide from settings
|
@@ -262,7 +262,9 @@ define('AMPFORWP_COMMENTS_PER_PAGE', ampforwp_define_comments_number() );
|
|
262 |
return;
|
263 |
}
|
264 |
|
265 |
-
|
|
|
|
|
266 |
return;
|
267 |
}
|
268 |
$query_arg_array = $wp->query_vars;
|
@@ -591,7 +593,6 @@ function ampforwp_new_dir( $dir ) {
|
|
591 |
$content = preg_replace('/non-refundable=[^>]*/', '', $content);
|
592 |
$content = preg_replace('/security=[^>]*/', '', $content);
|
593 |
$content = preg_replace('/deposit=[^>]*/', '', $content);
|
594 |
-
$content = preg_replace('/for=[^>]*/', '', $content);
|
595 |
$content = preg_replace('/nowrap="nowrap"/', '', $content);
|
596 |
$content = preg_replace('#<comments-count.*?>(.*?)</comments-count>#i', '', $content);
|
597 |
$content = preg_replace('#<badge.*?>(.*?)</badge>#i', '', $content);
|
@@ -704,7 +705,8 @@ function ampforwp_title_custom_meta() {
|
|
704 |
}
|
705 |
// Pages
|
706 |
$frontpage_id = ampforwp_get_the_ID();
|
707 |
-
|
|
|
708 |
add_meta_box( 'ampforwp_title_meta', esc_html__( 'Show AMP for Current Page?' ,'accelerated-mobile-pages'), 'ampforwp_title_callback','page','side' );
|
709 |
}
|
710 |
// Custom Post Types
|
@@ -7705,6 +7707,22 @@ function ampforwp_include_required_scripts($content){
|
|
7705 |
}
|
7706 |
}
|
7707 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7708 |
preg_match_all('/<script(\s|\sasync\s)custom-element="(.*?)"(.*?)>(.*?)<\/script>/s', $content, $matches);
|
7709 |
if(isset($matches[0])){
|
7710 |
if(isset($matches[2])){
|
248 |
}
|
249 |
}
|
250 |
// Search results on/off option #3786
|
251 |
+
if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
|
252 |
return;
|
253 |
}
|
254 |
// #872 no-amphtml if selected as hide from settings
|
262 |
return;
|
263 |
}
|
264 |
|
265 |
+
$page_for_posts = intval(get_option( 'page_for_posts' ));
|
266 |
+
$post_id = ampforwp_get_the_ID();
|
267 |
+
if ( ampforwp_is_blog() && ! ampforwp_get_setting('amp-on-off-for-all-pages') && ($page_for_posts != $post_id ) ) {
|
268 |
return;
|
269 |
}
|
270 |
$query_arg_array = $wp->query_vars;
|
593 |
$content = preg_replace('/non-refundable=[^>]*/', '', $content);
|
594 |
$content = preg_replace('/security=[^>]*/', '', $content);
|
595 |
$content = preg_replace('/deposit=[^>]*/', '', $content);
|
|
|
596 |
$content = preg_replace('/nowrap="nowrap"/', '', $content);
|
597 |
$content = preg_replace('#<comments-count.*?>(.*?)</comments-count>#i', '', $content);
|
598 |
$content = preg_replace('#<badge.*?>(.*?)</badge>#i', '', $content);
|
705 |
}
|
706 |
// Pages
|
707 |
$frontpage_id = ampforwp_get_the_ID();
|
708 |
+
$page_for_posts = intval(get_option( 'page_for_posts' ));
|
709 |
+
if( ampforwp_get_setting('amp-on-off-for-all-pages') && $post_type == 'page' || ( true == ampforwp_get_setting('amp-frontpage-select-option') && $post_id == $frontpage_id ) || ($post_id == $page_for_posts)) {
|
710 |
add_meta_box( 'ampforwp_title_meta', esc_html__( 'Show AMP for Current Page?' ,'accelerated-mobile-pages'), 'ampforwp_title_callback','page','side' );
|
711 |
}
|
712 |
// Custom Post Types
|
7707 |
}
|
7708 |
}
|
7709 |
|
7710 |
+
//OTHER COMPONENT CHECK
|
7711 |
+
$other_comp_arr = array('amp-mustache');
|
7712 |
+
for($oc = 0; $oc<count($other_comp_arr); $oc++){
|
7713 |
+
$ocomp = $other_comp_arr[$oc];
|
7714 |
+
$celem = 'element';
|
7715 |
+
if($ocomp=='amp-mustache'){
|
7716 |
+
$celem = 'template';
|
7717 |
+
}
|
7718 |
+
if(preg_match_all('/(type|template)="('.$ocomp.')"/', $content,$oMaches)){
|
7719 |
+
if(!preg_match('/<script(\s|\sasync\s)custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'"(.*?)>(.*?)<\/script>/s', $content)){
|
7720 |
+
$o_comp_url = 'https://cdn.ampproject.org/v0/'.esc_attr($ocomp).'-'.esc_attr($script_ver).'.js';
|
7721 |
+
$script_tag = '<head><script custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'" src="'.esc_url($o_comp_url).'" async></script>';
|
7722 |
+
$content = str_replace('<head>', $script_tag, $content);
|
7723 |
+
}
|
7724 |
+
}
|
7725 |
+
}
|
7726 |
preg_match_all('/<script(\s|\sasync\s)custom-element="(.*?)"(.*?)>(.*?)<\/script>/s', $content, $matches);
|
7727 |
if(isset($matches[0])){
|
7728 |
if(isset($matches[2])){
|