Version Description
(14th April 2020) = * Improvement: Added Filter to change post title tag #4339 * Improvement: Added Rankmath's open external links option feature #4356 * Improvement: Added Themify compatibility #4332 * Improvement: Added AAWP for AMP extension #4337 * Improvement: Added Formidable forms for AMP #4345 * Improvement: Added Reading progress bar for AMP #4364 * Improvement: Added hooks in header for all designs #4359 * Improvement: Added option for one signal notificaion on the pages #4349 * Fixed: Mobile redirection not working in the latest update #4336 * Fixed: AMP option panel not working in Best brokers plugin #4330 * Fixed: AMP option panel not working in custom theme of user #4353 * Fixed: Table not looking good on mobiles #4309 * Fixed: Double quotes in the font-family breaks default Typography #4328 * Fixed: Featured images are getting streched in the amp version #4307 * Fixed: The menu and article links not working after enabling GDPR #4340 * Fixed: Facebook instance article is not working in plain permalink #4354 * Fixed: Video docking is not working in AMP #4352 * Fixed: There is no save button in AMP "Basic setup" #4343 * Fixed: Debug warning #4341
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 1.0.40 |
Comparing to | |
See all releases |
Code changes from version 1.0.39 to 1.0.40
- README.md +22 -1
- accelerated-moblie-pages.php +2 -2
- changelog.txt +21 -0
- components/components-core.php +8 -7
- components/featured-image/featured-image.php +12 -0
- components/gdpr/gdpr.php +1 -0
- components/google-font/google-font.php +2 -2
- images/Formidable-Forms-for-amp.png +0 -0
- images/aawp-for-amp-logo.png +0 -0
- images/reading-progress-bar-for-amp.png +0 -0
- includes/admin-script.js +17 -7
- includes/features/functions.php +7 -0
- includes/features/push-notification/push-notification-functions.php +3 -0
- includes/features/push-notification/push-notification-options.php +8 -0
- includes/options/admin-config.php +39 -0
- includes/options/redux-core/templates/panel/menu_container.tpl.php +2 -2
- includes/redirect.php +14 -3
- readme.txt +22 -1
- templates/design-manager/design-1/header-bar.php +2 -1
- templates/design-manager/design-2/header-bar.php +2 -1
- templates/design-manager/design-3/header-bar.php +2 -1
- templates/design-manager/swift/header.php +6 -3
- templates/design-manager/swift/style.php +2 -2
- templates/features.php +49 -3
@@ -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.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -194,6 +194,27 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
194 |
|
195 |
== Changelog ==
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
= 1.0.39 (3rd April 2020) =
|
198 |
* Improvement: Code improvements in related post #4300
|
199 |
* Fixed: Images are streching in the gallary #4334
|
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.40
|
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.40 (14th April 2020) =
|
198 |
+
* Improvement: Added Filter to change post title tag #4339
|
199 |
+
* Improvement: Added Rankmath's open external links option feature #4356
|
200 |
+
* Improvement: Added Themify compatibility #4332
|
201 |
+
* Improvement: Added AAWP for AMP extension #4337
|
202 |
+
* Improvement: Added Formidable forms for AMP #4345
|
203 |
+
* Improvement: Added Reading progress bar for AMP #4364
|
204 |
+
* Improvement: Added hooks in header for all designs #4359
|
205 |
+
* Improvement: Added option for one signal notificaion on the pages #4349
|
206 |
+
* Fixed: Mobile redirection not working in the latest update #4336
|
207 |
+
* Fixed: AMP option panel not working in Best brokers plugin #4330
|
208 |
+
* Fixed: AMP option panel not working in custom theme of user #4353
|
209 |
+
* Fixed: Table not looking good on mobiles #4309
|
210 |
+
* Fixed: Double quotes in the font-family breaks default Typography #4328
|
211 |
+
* Fixed: Featured images are getting streched in the amp version #4307
|
212 |
+
* Fixed: The menu and article links not working after enabling GDPR #4340
|
213 |
+
* Fixed: Facebook instance article is not working in plain permalink #4354
|
214 |
+
* Fixed: Video docking is not working in AMP #4352
|
215 |
+
* Fixed: There is no save button in AMP "Basic setup" #4343
|
216 |
+
* Fixed: Debug warning #4341
|
217 |
+
|
218 |
= 1.0.39 (3rd April 2020) =
|
219 |
* Improvement: Code improvements in related post #4300
|
220 |
* Fixed: Images are streching in the gallary #4334
|
@@ -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.40
|
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.40');
|
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,26 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 1.0.39 (3rd April 2020) =
|
4 |
* Improvement: Code improvements in related post #4300
|
5 |
* Fixed: Images are streching in the gallary #4334
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 1.0.40 (14th April 2020) =
|
4 |
+
* Improvement: Added Filter to change post title tag #4339
|
5 |
+
* Improvement: Added Rankmath's open external links option feature #4356
|
6 |
+
* Improvement: Added Themify compatibility #4332
|
7 |
+
* Improvement: Added AAWP for AMP extension #4337
|
8 |
+
* Improvement: Added Formidable forms for AMP #4345
|
9 |
+
* Improvement: Added Reading progress bar for AMP #4364
|
10 |
+
* Improvement: Added hooks in header for all designs #4359
|
11 |
+
* Improvement: Added option for one signal notificaion on the pages #4349
|
12 |
+
* Fixed: Mobile redirection not working in the latest update #4336
|
13 |
+
* Fixed: AMP option panel not working in Best brokers plugin #4330
|
14 |
+
* Fixed: AMP option panel not working in custom theme of user #4353
|
15 |
+
* Fixed: Table not looking good on mobiles #4309
|
16 |
+
* Fixed: Double quotes in the font-family breaks default Typography #4328
|
17 |
+
* Fixed: Featured images are getting streched in the amp version #4307
|
18 |
+
* Fixed: The menu and article links not working after enabling GDPR #4340
|
19 |
+
* Fixed: Facebook instance article is not working in plain permalink #4354
|
20 |
+
* Fixed: Video docking is not working in AMP #4352
|
21 |
+
* Fixed: There is no save button in AMP "Basic setup" #4343
|
22 |
+
* Fixed: Debug warning #4341
|
23 |
+
|
24 |
= 1.0.39 (3rd April 2020) =
|
25 |
* Improvement: Code improvements in related post #4300
|
26 |
* Fixed: Images are streching in the gallary #4334
|
@@ -119,12 +119,12 @@ function amp_title(){
|
|
119 |
$ampforwp_title = get_the_title($ID);
|
120 |
$ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title);
|
121 |
if(!empty($ampforwp_title) && (ampforwp_default_logo() || ampforwp_get_setting('opt-media','url')!='')){
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
do_action('ampforwp_below_the_title');
|
129 |
}
|
130 |
}
|
@@ -703,6 +703,7 @@ function amp_author_meta( $args ) {
|
|
703 |
// amp-animation CSS #2819
|
704 |
add_action('amp_post_template_css','ampforwp_backtotop_global_css');
|
705 |
function ampforwp_backtotop_global_css(){?>
|
|
|
706 |
amp-img.amp-wp-enforced-sizes[layout=intrinsic] > img, .amp-wp-unknown-size > img { object-fit: contain; }
|
707 |
.rtl amp-carousel {direction: ltr;}
|
708 |
.rtl .amp-menu .toggle:after{left:0;right:unset;}
|
@@ -743,7 +744,7 @@ function ampforwp_backtotop_global_css(){?>
|
|
743 |
table.wp-block-table.alignright,table.wp-block-table.alignleft,table.wp-block-table.aligncenter{width: auto;}
|
744 |
table.wp-block-table.aligncenter{width: 50%;}
|
745 |
table.wp-block-table.alignfull,table.wp-block-table.alignwide{display: table;}
|
746 |
-
table {
|
747 |
table a:link { font-weight: bold; text-decoration: none; }
|
748 |
table a:visited { color: #999999; font-weight: bold; text-decoration: none; }
|
749 |
table a:active, table a:hover { color: #bd5a35; text-decoration: underline; }
|
119 |
$ampforwp_title = get_the_title($ID);
|
120 |
$ampforwp_title = apply_filters('ampforwp_filter_single_title', $ampforwp_title);
|
121 |
if(!empty($ampforwp_title) && (ampforwp_default_logo() || ampforwp_get_setting('opt-media','url')!='')){
|
122 |
+
$title_tag = '<h1 class="amp-post-title">' . wp_kses_data( $ampforwp_title ) . '</h1>';
|
123 |
+
}else{
|
124 |
+
$title_tag = '<h2 class="amp-post-title">' . wp_kses_data( $ampforwp_title ) . '</h2>';
|
125 |
+
}
|
126 |
+
$title_tag = apply_filters('ampforwp_modify_title_tag',$title_tag,$ampforwp_title);
|
127 |
+
echo $title_tag; // Escaped above
|
128 |
do_action('ampforwp_below_the_title');
|
129 |
}
|
130 |
}
|
703 |
// amp-animation CSS #2819
|
704 |
add_action('amp_post_template_css','ampforwp_backtotop_global_css');
|
705 |
function ampforwp_backtotop_global_css(){?>
|
706 |
+
.amp-wp-content table , .cntn-wrp.artl-cnt table{height: auto;}
|
707 |
amp-img.amp-wp-enforced-sizes[layout=intrinsic] > img, .amp-wp-unknown-size > img { object-fit: contain; }
|
708 |
.rtl amp-carousel {direction: ltr;}
|
709 |
.rtl .amp-menu .toggle:after{left:0;right:unset;}
|
744 |
table.wp-block-table.alignright,table.wp-block-table.alignleft,table.wp-block-table.aligncenter{width: auto;}
|
745 |
table.wp-block-table.aligncenter{width: 50%;}
|
746 |
table.wp-block-table.alignfull,table.wp-block-table.alignwide{display: table;}
|
747 |
+
table { overflow-x: auto; }
|
748 |
table a:link { font-weight: bold; text-decoration: none; }
|
749 |
table a:visited { color: #999999; font-weight: bold; text-decoration: none; }
|
750 |
table a:active, table a:hover { color: #bd5a35; text-decoration: underline; }
|
@@ -49,6 +49,18 @@ function ampforwp_framework_get_featured_image(){
|
|
49 |
$alt = get_the_title( $post_id );
|
50 |
}
|
51 |
$alt = convert_chars( stripslashes( $alt ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
if( $image ){
|
53 |
if(empty($image[1])){
|
54 |
$image[1] = 1000;
|
49 |
$alt = get_the_title( $post_id );
|
50 |
}
|
51 |
$alt = convert_chars( stripslashes( $alt ) );
|
52 |
+
if(function_exists('fifu_show_elements')){
|
53 |
+
$fifu_image_url = get_post_meta($post_id, 'fifu_image_url', true);
|
54 |
+
if($fifu_image_url){
|
55 |
+
$size = getimagesize(get_the_post_thumbnail_url());
|
56 |
+
if(isset($size[0])){
|
57 |
+
$image[1] = $size[0];
|
58 |
+
}
|
59 |
+
if(isset($size[1])){
|
60 |
+
$image[2] = $size[1];
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
if( $image ){
|
65 |
if(empty($image[1])){
|
66 |
$image[1] = 1000;
|
@@ -251,6 +251,7 @@ function ampforwp_gdpr_css(){
|
|
251 |
} ?>
|
252 |
footer amp-consent.amp-active {
|
253 |
z-index:9999;
|
|
|
254 |
position: inherit;
|
255 |
}
|
256 |
<?php }
|
251 |
} ?>
|
252 |
footer amp-consent.amp-active {
|
253 |
z-index:9999;
|
254 |
+
display: initial;
|
255 |
position: inherit;
|
256 |
}
|
257 |
<?php }
|
@@ -15,7 +15,7 @@ if(1==ampforwp_get_setting('ampforwp-google-font-switch') && ( $amp_font_selecto
|
|
15 |
<?php } ?>
|
16 |
|
17 |
body{<?php
|
18 |
-
$fontFamily = "font-family:
|
19 |
if( 1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
20 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
21 |
if( $amp_font_selector != 1 && !empty( $amp_font_selector )){
|
@@ -30,7 +30,7 @@ font-size: 16px; line-height:1.25; }
|
|
30 |
.cntn-wrp{
|
31 |
<?php
|
32 |
$amp_font_selector_content_single = ampforwp_get_setting('amp_font_selector_content_single');
|
33 |
-
$fontFamily = "font-family:
|
34 |
if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
35 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
36 |
if( $amp_font_selector_content_single != 1 && !empty($amp_font_selector_content_single)){
|
15 |
<?php } ?>
|
16 |
|
17 |
body{<?php
|
18 |
+
$fontFamily = "font-family: Arial, Helvetica, sans-serif;";
|
19 |
if( 1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
20 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
21 |
if( $amp_font_selector != 1 && !empty( $amp_font_selector )){
|
30 |
.cntn-wrp{
|
31 |
<?php
|
32 |
$amp_font_selector_content_single = ampforwp_get_setting('amp_font_selector_content_single');
|
33 |
+
$fontFamily = "font-family: Arial, Helvetica, sans-serif";
|
34 |
if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
35 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
36 |
if( $amp_font_selector_content_single != 1 && !empty($amp_font_selector_content_single)){
|
Binary file
|
Binary file
|
Binary file
|
@@ -1068,16 +1068,26 @@ jQuery(document).ready(function($) {
|
|
1068 |
}
|
1069 |
},10);
|
1070 |
$(".redux-group-tab-link-li").click(function(){
|
1071 |
-
|
|
|
1072 |
$('#redux-footer-sticky').hide();
|
1073 |
$('#redux-footer-sticky #redux-footer').addClass("hide");
|
1074 |
}else{
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1081 |
}
|
1082 |
}
|
1083 |
});
|
1068 |
}
|
1069 |
},10);
|
1070 |
$(".redux-group-tab-link-li").click(function(){
|
1071 |
+
var this_c_val = $(this).children('a').children('span.group_title').html();
|
1072 |
+
if($(this).hasClass('ampforwp-new-ux') || $(this).hasClass('opt-go-premium')){
|
1073 |
$('#redux-footer-sticky').hide();
|
1074 |
$('#redux-footer-sticky #redux-footer').addClass("hide");
|
1075 |
}else{
|
1076 |
+
$('#redux-footer-sticky').show();
|
1077 |
+
$('#redux-footer-sticky #redux-footer').removeClass("hide");
|
1078 |
+
|
1079 |
+
}
|
1080 |
+
// There is no save button in AMP "Basic setup" #4343
|
1081 |
+
var selected = $(".amp-opt-change:checked").parent().find('label').attr('id');
|
1082 |
+
if(selected=='basic'){
|
1083 |
+
if(!$(this).hasClass('ampforwp-new-ux') && !$(this).hasClass('opt-go-premium')){
|
1084 |
+
$('#redux-footer-sticky').show();
|
1085 |
+
$('#redux-footer-sticky #redux-footer').removeClass("hide");
|
1086 |
+
|
1087 |
+
|
1088 |
+
}else{
|
1089 |
+
$('#redux-footer-sticky').hide();
|
1090 |
+
$('#redux-footer-sticky #redux-footer').addClass("hide");
|
1091 |
}
|
1092 |
}
|
1093 |
});
|
@@ -38,6 +38,13 @@ function ampforwp_add_admin_styling($hook_suffix){
|
|
38 |
if( current_user_can("manage_options") && $hook_suffix=='toplevel_page_amp_options' ){
|
39 |
$redux_data = $redux_builder_amp;
|
40 |
wp_dequeue_script( 'insert-post-adschart-admin' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
remove_all_actions('admin_notices');
|
42 |
add_action('admin_notices', 'ampforwp_dev_mode_notice');
|
43 |
add_action('admin_notices', 'ampforwp_plugins_manager_notice');
|
38 |
if( current_user_can("manage_options") && $hook_suffix=='toplevel_page_amp_options' ){
|
39 |
$redux_data = $redux_builder_amp;
|
40 |
wp_dequeue_script( 'insert-post-adschart-admin' );
|
41 |
+
if(function_exists('brokers_page_template_redirect')){
|
42 |
+
wp_dequeue_script( 'broker-js' );
|
43 |
+
wp_dequeue_script( 'broker-min-js' );
|
44 |
+
}
|
45 |
+
if(function_exists('html5blank_header_scripts')){
|
46 |
+
wp_dequeue_script( 'jquery-js' );
|
47 |
+
}
|
48 |
remove_all_actions('admin_notices');
|
49 |
add_action('admin_notices', 'ampforwp_dev_mode_notice');
|
50 |
add_action('admin_notices', 'ampforwp_plugins_manager_notice');
|
@@ -11,6 +11,9 @@ if( ! function_exists( ' ampforwp_onesignal_notifications ' ) ){
|
|
11 |
if ( (!checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ) || true == ampforwp_get_setting('ampforwp-web-push-onesignal-header') || true == ampforwp_get_setting('ampforwp-web-push-onesignal-sticky') ){
|
12 |
$checker = true;
|
13 |
}
|
|
|
|
|
|
|
14 |
if('1' == ampforwp_get_setting('ampforwp-web-push') && $checker ){
|
15 |
$onesignal_domain = '';
|
16 |
$onesignal_domain_sw = '';
|
11 |
if ( (!checkAMPforPageBuilderStatus(get_the_ID()) && is_single() ) || true == ampforwp_get_setting('ampforwp-web-push-onesignal-header') || true == ampforwp_get_setting('ampforwp-web-push-onesignal-sticky') ){
|
12 |
$checker = true;
|
13 |
}
|
14 |
+
elseif ( !checkAMPforPageBuilderStatus(ampforwp_get_the_ID()) && (is_page() || ampforwp_is_front_page()) && true == ampforwp_get_setting('ampforwp-one-signal-page')){
|
15 |
+
$checker = true;
|
16 |
+
}
|
17 |
if('1' == ampforwp_get_setting('ampforwp-web-push') && $checker ){
|
18 |
$onesignal_domain = '';
|
19 |
$onesignal_domain_sw = '';
|
@@ -130,6 +130,14 @@ function ampforwp_push_notification_options($opt_name){
|
|
130 |
'class' => 'child_opt child_opt_arrow',
|
131 |
'tooltip-subtitle' => '<a href="https://ampforwp.com/tutorials/one-signal-in-amp/" target="_blank">View Integration Tutorial</a> (HTTPS is required)',
|
132 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
$izooto_notice,
|
134 |
$izt_opt4,
|
135 |
array(
|
130 |
'class' => 'child_opt child_opt_arrow',
|
131 |
'tooltip-subtitle' => '<a href="https://ampforwp.com/tutorials/one-signal-in-amp/" target="_blank">View Integration Tutorial</a> (HTTPS is required)',
|
132 |
),
|
133 |
+
array(
|
134 |
+
'id' => 'ampforwp-one-signal-page',
|
135 |
+
'type' => 'switch',
|
136 |
+
'title' => esc_html__('Pages','accelerated-mobile-pages'),
|
137 |
+
'class' => 'child_opt child_opt_arrow',
|
138 |
+
'tooltip-subtitle' => esc_html__('Enable this option to show one signal notification on your pages', 'accelerated-mobile-pages'),
|
139 |
+
'required' => array( 'ampforwp-web-push', '=' , '1' ),
|
140 |
+
),
|
141 |
$izooto_notice,
|
142 |
$izt_opt4,
|
143 |
array(
|
@@ -627,6 +627,42 @@ $extension_listing_array = array(
|
|
627 |
'store_url'=>'https://accounts.ampforwp.com',
|
628 |
'is_activated'=>(is_plugin_active('izooto-for-amp/izooto-for-amp.php')? 1 : 2)
|
629 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
630 |
);
|
631 |
$viewAllExtensions = array(
|
632 |
'name'=>'View All Extensions',
|
@@ -2436,6 +2472,9 @@ function ampforwp_fb_instant_article() {
|
|
2436 |
$input = '';
|
2437 |
|
2438 |
$feedname = 'instant_articles';
|
|
|
|
|
|
|
2439 |
$fb_instant_article_feed = trailingslashit( site_url() ).$feedname ;
|
2440 |
$input = '<a href=" '. esc_url($fb_instant_article_feed) . '" target="_blank">' . esc_url( $fb_instant_article_feed ). '</a>' ;
|
2441 |
|
627 |
'store_url'=>'https://accounts.ampforwp.com',
|
628 |
'is_activated'=>(is_plugin_active('izooto-for-amp/izooto-for-amp.php')? 1 : 2)
|
629 |
),
|
630 |
+
array(
|
631 |
+
'name'=>'AAWP for AMP',
|
632 |
+
'class'=>'new-ext',
|
633 |
+
'desc'=>'Display Amazon Affiliate links , nice product boxes, bestseller list ,comparison tables and much more! in AMP Pages.',
|
634 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/aawp-for-amp-logo.png',
|
635 |
+
'price'=>'$79',
|
636 |
+
'url_link'=>'https://ampforwp.com/addons/aawp-for-amp/',
|
637 |
+
'plugin_active_path'=> 'aawp-for-amp/aawp-for-amp.php',
|
638 |
+
'item_name'=>'AAWP for AMP',
|
639 |
+
'store_url'=>'https://accounts.ampforwp.com',
|
640 |
+
'is_activated'=>(is_plugin_active('aawp-for-amp/aawp-for-amp.php')? 1 : 2),
|
641 |
+
),
|
642 |
+
array(
|
643 |
+
'name'=>'Formidable forms for AMP',
|
644 |
+
'class'=>'new-ext',
|
645 |
+
'desc'=>'Add Formidable forms Support in AMP',
|
646 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/Formidable-Forms-for-amp.png',
|
647 |
+
'price'=>'$79',
|
648 |
+
'url_link'=>'https://ampforwp.com/addons/formidable-forms-for-amp/',
|
649 |
+
'plugin_active_path'=> 'formidable-forms-for-amp/formidable-forms-for-amp.php',
|
650 |
+
'item_name'=>'Formidable forms for AMP',
|
651 |
+
'store_url'=>'https://accounts.ampforwp.com',
|
652 |
+
'is_activated'=>(is_plugin_active('formidable-forms-for-amp/formidable-forms-for-amp.php')? 1 : 2),
|
653 |
+
),
|
654 |
+
array(
|
655 |
+
'name'=>'Reading Progress Bar for AMP',
|
656 |
+
'class'=>'new-ext',
|
657 |
+
'desc'=>'Allows you to Add Reading Progress Bar support in AMP',
|
658 |
+
'img_src'=>AMPFORWP_IMAGE_DIR . '/reading-progress-bar-for-amp.png',
|
659 |
+
'price'=>'$29',
|
660 |
+
'url_link'=>'https://ampforwp.com/addons/reading-progress-bar-for-amp/',
|
661 |
+
'plugin_active_path'=> 'reading-progress-bar-for-amp/reading-progress-bar-for-amp.php',
|
662 |
+
'item_name'=>'Reading Progress Bar for AMP',
|
663 |
+
'store_url'=>'https://accounts.ampforwp.com',
|
664 |
+
'is_activated'=>(is_plugin_active('reading-progress-bar-for-amp/reading-progress-bar-for-amp.php')? 1 : 2),
|
665 |
+
),
|
666 |
);
|
667 |
$viewAllExtensions = array(
|
668 |
'name'=>'View All Extensions',
|
2472 |
$input = '';
|
2473 |
|
2474 |
$feedname = 'instant_articles';
|
2475 |
+
if(get_option('permalink_structure') == ''){
|
2476 |
+
$feedname = '?feed=instant_articles';
|
2477 |
+
}
|
2478 |
$fb_instant_article_feed = trailingslashit( site_url() ).$feedname ;
|
2479 |
$input = '<a href=" '. esc_url($fb_instant_article_feed) . '" target="_blank">' . esc_url( $fb_instant_article_feed ). '</a>' ;
|
2480 |
|
@@ -80,11 +80,11 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
80 |
<div class="switch-ef-btns">
|
81 |
<div class="e-v <?php echo $opt_easy_active;?>">
|
82 |
<input class="amp-opt-change <?php echo esc_attr($opt_easy);?>" id="radio-c" type="radio" name="second-switch" <?php echo esc_attr($opt_easy_checked);?>>
|
83 |
-
<label for="radio-c">Basic Setup</label>
|
84 |
</div>
|
85 |
<div class="f-v <?php echo $opt_full_active;?>">
|
86 |
<input class="amp-opt-change <?php echo esc_attr($opt_full);?>" id="radio-d" type="radio" name="second-switch" <?php echo esc_attr($opt_full_checked);?>>
|
87 |
-
<label for="radio-d">Advance Setup</label><span class="toggle-outside">
|
88 |
<span class="toggle-inside"></span>
|
89 |
</div>
|
90 |
</div>
|
80 |
<div class="switch-ef-btns">
|
81 |
<div class="e-v <?php echo $opt_easy_active;?>">
|
82 |
<input class="amp-opt-change <?php echo esc_attr($opt_easy);?>" id="radio-c" type="radio" name="second-switch" <?php echo esc_attr($opt_easy_checked);?>>
|
83 |
+
<label for="radio-c" id="basic">Basic Setup</label>
|
84 |
</div>
|
85 |
<div class="f-v <?php echo $opt_full_active;?>">
|
86 |
<input class="amp-opt-change <?php echo esc_attr($opt_full);?>" id="radio-d" type="radio" name="second-switch" <?php echo esc_attr($opt_full_checked);?>>
|
87 |
+
<label for="radio-d" id="advanced">Advance Setup</label><span class="toggle-outside">
|
88 |
<span class="toggle-inside"></span>
|
89 |
</div>
|
90 |
</div>
|
@@ -63,11 +63,22 @@ if(is_search() && 0 == ampforwp_get_setting('amp-redirection-search')){
|
|
63 |
}
|
64 |
}
|
65 |
// Redirect ?nonamp=1 to normal url #3269
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
if (( isset($_GET['nonamp']) && 1 == $_GET['nonamp'] ) && function_exists('session_start') && !isset($_SESSION)){
|
67 |
session_start();
|
68 |
-
$_SESSION['ampforwp_mobile'] = 'exit';
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
71 |
wp_safe_redirect( $current_url );
|
72 |
exit;
|
73 |
}
|
63 |
}
|
64 |
}
|
65 |
// Redirect ?nonamp=1 to normal url #3269
|
66 |
+
$current_url = $check = '';
|
67 |
+
$current_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ?
|
68 |
+
"https" : "http") . "://" . AMPFROWP_HOST_NAME .
|
69 |
+
htmlspecialchars( $_SERVER['REQUEST_URI'] );
|
70 |
+
$current_url = explode('/', $current_url);
|
71 |
+
$check = '?nonamp=1';
|
72 |
if (( isset($_GET['nonamp']) && 1 == $_GET['nonamp'] ) && function_exists('session_start') && !isset($_SESSION)){
|
73 |
session_start();
|
74 |
+
$_SESSION['ampforwp_mobile'] = 'exit';
|
75 |
+
}
|
76 |
+
if (in_array( $check , $current_url ) ) {
|
77 |
+
$current_url = array_flip($current_url);
|
78 |
+
unset($current_url['?nonamp=1']);
|
79 |
+
$current_url = array_flip($current_url);
|
80 |
+
$current_url = implode('/', $current_url);
|
81 |
+
$current_url = user_trailingslashit(esc_url($current_url));
|
82 |
wp_safe_redirect( $current_url );
|
83 |
exit;
|
84 |
}
|
@@ -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.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -191,6 +191,27 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
191 |
|
192 |
== Changelog ==
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
= 1.0.39 (3rd April 2020) =
|
195 |
* Improvement: Code improvements in related post #4300
|
196 |
* Fixed: Images are streching in the gallary #4334
|
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.40
|
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.40 (14th April 2020) =
|
195 |
+
* Improvement: Added Filter to change post title tag #4339
|
196 |
+
* Improvement: Added Rankmath's open external links option feature #4356
|
197 |
+
* Improvement: Added Themify compatibility #4332
|
198 |
+
* Improvement: Added AAWP for AMP extension #4337
|
199 |
+
* Improvement: Added Formidable forms for AMP #4345
|
200 |
+
* Improvement: Added Reading progress bar for AMP #4364
|
201 |
+
* Improvement: Added hooks in header for all designs #4359
|
202 |
+
* Improvement: Added option for one signal notificaion on the pages #4349
|
203 |
+
* Fixed: Mobile redirection not working in the latest update #4336
|
204 |
+
* Fixed: AMP option panel not working in Best brokers plugin #4330
|
205 |
+
* Fixed: AMP option panel not working in custom theme of user #4353
|
206 |
+
* Fixed: Table not looking good on mobiles #4309
|
207 |
+
* Fixed: Double quotes in the font-family breaks default Typography #4328
|
208 |
+
* Fixed: Featured images are getting streched in the amp version #4307
|
209 |
+
* Fixed: The menu and article links not working after enabling GDPR #4340
|
210 |
+
* Fixed: Facebook instance article is not working in plain permalink #4354
|
211 |
+
* Fixed: Video docking is not working in AMP #4352
|
212 |
+
* Fixed: There is no save button in AMP "Basic setup" #4343
|
213 |
+
* Fixed: Debug warning #4341
|
214 |
+
|
215 |
= 1.0.39 (3rd April 2020) =
|
216 |
* Improvement: Code improvements in related post #4300
|
217 |
* Fixed: Images are streching in the gallary #4334
|
@@ -3,7 +3,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
3 |
exit;
|
4 |
}
|
5 |
global $redux_builder_amp; ?>
|
6 |
-
<?php do_action('ampforwp_admin_menu_bar_front');
|
|
|
7 |
<header id="#top" class="amp-wp-header">
|
8 |
<div class="ampforwp-logo-area" >
|
9 |
<?php do_action('ampforwp_header_top_design1'); ?>
|
3 |
exit;
|
4 |
}
|
5 |
global $redux_builder_amp; ?>
|
6 |
+
<?php do_action('ampforwp_admin_menu_bar_front');
|
7 |
+
do_action('ampforwp_reading_progress_bar'); ?>
|
8 |
<header id="#top" class="amp-wp-header">
|
9 |
<div class="ampforwp-logo-area" >
|
10 |
<?php do_action('ampforwp_header_top_design1'); ?>
|
@@ -3,7 +3,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
3 |
exit;
|
4 |
}
|
5 |
global $redux_builder_amp; ?>
|
6 |
-
<?php do_action('ampforwp_admin_menu_bar_front');
|
|
|
7 |
<header class="container design2-header">
|
8 |
<div id="headerwrap">
|
9 |
<div id="header">
|
3 |
exit;
|
4 |
}
|
5 |
global $redux_builder_amp; ?>
|
6 |
+
<?php do_action('ampforwp_admin_menu_bar_front');
|
7 |
+
do_action('ampforwp_reading_progress_bar'); ?>
|
8 |
<header class="container design2-header">
|
9 |
<div id="headerwrap">
|
10 |
<div id="header">
|
@@ -94,7 +94,8 @@ if(isset($redux_builder_amp['ampforwp-amp-menu']) && $redux_builder_amp['ampforw
|
|
94 |
</amp-sidebar>
|
95 |
<?php } ?>
|
96 |
<div id="designthree" class="designthree main_container">
|
97 |
-
<?php do_action('ampforwp_admin_menu_bar_front');
|
|
|
98 |
<header class="container design3-header">
|
99 |
<div id="headerwrap">
|
100 |
<div id="header">
|
94 |
</amp-sidebar>
|
95 |
<?php } ?>
|
96 |
<div id="designthree" class="designthree main_container">
|
97 |
+
<?php do_action('ampforwp_admin_menu_bar_front');
|
98 |
+
do_action('ampforwp_reading_progress_bar'); ?>
|
99 |
<header class="container design3-header">
|
100 |
<div id="headerwrap">
|
101 |
<div id="header">
|
@@ -15,7 +15,8 @@ if( !ampforwp_levelup_compatibility('hf_builder_head') ){
|
|
15 |
}
|
16 |
?>
|
17 |
<?php if($header_type == '1'){?>
|
18 |
-
<?php do_action('ampforwp_admin_menu_bar_front');
|
|
|
19 |
<header class="header h_m h_m_1">
|
20 |
<?php do_action('ampforwp_header_top_design4'); ?>
|
21 |
<input type="checkbox" id="offcanvas-menu" class="tg" />
|
@@ -149,7 +150,8 @@ if( !ampforwp_levelup_compatibility('hf_builder_head') ){
|
|
149 |
<?php do_action('ampforwp_header_bottom_design4'); ?>
|
150 |
</header>
|
151 |
<?php } ?>
|
152 |
-
<?php if($header_type == '2'){
|
|
|
153 |
<header class="header-2 h_m h_m_1">
|
154 |
<?php do_action('ampforwp_header_top_design4'); ?>
|
155 |
<input type="checkbox" id="offcanvas-menu" class="tg" />
|
@@ -280,7 +282,8 @@ if( !ampforwp_levelup_compatibility('hf_builder_head') ){
|
|
280 |
<?php do_action('ampforwp_header_bottom_design4'); ?>
|
281 |
</header>
|
282 |
<?php } ?>
|
283 |
-
<?php if($header_type == '3'){
|
|
|
284 |
<header class="header-3 h_m h_m_1">
|
285 |
<?php do_action('ampforwp_header_top_design4'); ?>
|
286 |
<input type="checkbox" id="offcanvas-menu" class="tg" />
|
15 |
}
|
16 |
?>
|
17 |
<?php if($header_type == '1'){?>
|
18 |
+
<?php do_action('ampforwp_admin_menu_bar_front');
|
19 |
+
do_action('ampforwp_reading_progress_bar'); ?>
|
20 |
<header class="header h_m h_m_1">
|
21 |
<?php do_action('ampforwp_header_top_design4'); ?>
|
22 |
<input type="checkbox" id="offcanvas-menu" class="tg" />
|
150 |
<?php do_action('ampforwp_header_bottom_design4'); ?>
|
151 |
</header>
|
152 |
<?php } ?>
|
153 |
+
<?php if($header_type == '2'){
|
154 |
+
do_action('ampforwp_reading_progress_bar'); ?>
|
155 |
<header class="header-2 h_m h_m_1">
|
156 |
<?php do_action('ampforwp_header_top_design4'); ?>
|
157 |
<input type="checkbox" id="offcanvas-menu" class="tg" />
|
282 |
<?php do_action('ampforwp_header_bottom_design4'); ?>
|
283 |
</header>
|
284 |
<?php } ?>
|
285 |
+
<?php if($header_type == '3'){
|
286 |
+
do_action('ampforwp_reading_progress_bar'); ?>
|
287 |
<header class="header-3 h_m h_m_1">
|
288 |
<?php do_action('ampforwp_header_top_design4'); ?>
|
289 |
<input type="checkbox" id="offcanvas-menu" class="tg" />
|
@@ -598,7 +598,7 @@ if( !ampforwp_woocommerce_conditional_check() ) { ?>
|
|
598 |
pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
|
599 |
.cntn-wrp{
|
600 |
<?php
|
601 |
-
$fontFamily = "font-family:
|
602 |
if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
603 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
604 |
if(isset($redux_builder_amp['amp_font_selector_content_single']) && $redux_builder_amp['amp_font_selector_content_single'] != 1 && !empty($redux_builder_amp['amp_font_selector_content_single'])){
|
@@ -674,7 +674,7 @@ if ( ampforwp_get_setting('swift-featued-image-type') == 2) { ?>
|
|
674 |
.amp-tags .amp-tag:after{content: "/";display: inline-block;padding: 0px 10px;position: relative;top: -1px;color: #ccc;font-size: 12px;}
|
675 |
.amp-tags .amp-tag:last-child:after{display:none;}
|
676 |
.ss-ic li:before{border-radius: 2px;text-align:center;padding: 4px 6px;}
|
677 |
-
.sgl table {width: 100%;margin-bottom:25px;border: 1px solid #ddd;
|
678 |
.sgl th , .sgl td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
679 |
.sgl tr:nth-child(odd) td {background: #f7f7f7;}
|
680 |
<?php // Social Sharing Conditional CSS
|
598 |
pre {padding: 30px 15px;background: #f7f7f7;white-space: pre-wrap;;font-size: 14px;color: #666666;border-left: 3px solid;border-color: <?php echo ampforwp_sanitize_color($swift_cs_color); ?>;margin-bottom: 20px;}
|
599 |
.cntn-wrp{
|
600 |
<?php
|
601 |
+
$fontFamily = "font-family: Arial, Helvetica, sans-serif";
|
602 |
if(1==ampforwp_get_setting('ampforwp-google-font-switch')){
|
603 |
$fontFamily = "font-family: 'Poppins', sans-serif;";
|
604 |
if(isset($redux_builder_amp['amp_font_selector_content_single']) && $redux_builder_amp['amp_font_selector_content_single'] != 1 && !empty($redux_builder_amp['amp_font_selector_content_single'])){
|
674 |
.amp-tags .amp-tag:after{content: "/";display: inline-block;padding: 0px 10px;position: relative;top: -1px;color: #ccc;font-size: 12px;}
|
675 |
.amp-tags .amp-tag:last-child:after{display:none;}
|
676 |
.ss-ic li:before{border-radius: 2px;text-align:center;padding: 4px 6px;}
|
677 |
+
.sgl table {width: 100%;margin-bottom:25px;border: 1px solid #ddd;}
|
678 |
.sgl th , .sgl td {padding: 0.5em 1em;border: 1px solid #ddd;}
|
679 |
.sgl tr:nth-child(odd) td {background: #f7f7f7;}
|
680 |
<?php // Social Sharing Conditional CSS
|
@@ -7484,7 +7484,10 @@ function ampforwp_head_css(){
|
|
7484 |
$title = $user_info->title;
|
7485 |
}
|
7486 |
if($title){
|
|
|
|
|
7487 |
$dom->loadHTML($title);
|
|
|
7488 |
$anchors = $dom -> getElementsByTagName('img');
|
7489 |
$src="";
|
7490 |
foreach($anchors as $im){
|
@@ -7984,14 +7987,14 @@ function ampforwp_include_required_scripts($content){
|
|
7984 |
}
|
7985 |
}
|
7986 |
//OTHER COMPONENT CHECK
|
7987 |
-
$other_comp_arr = array('amp-mustache'=>'amp-mustache','form'=>'amp-form','amp-access'=>'amp-access','amp-fx'=>'amp-fx-collection');
|
7988 |
foreach ($other_comp_arr as $key => $value) {
|
7989 |
$ocomp = $value;
|
7990 |
$celem = 'element';
|
7991 |
if($ocomp=='amp-mustache'){
|
7992 |
$celem = 'template';
|
7993 |
}
|
7994 |
-
if(preg_match('/(type|template|id)="('.$ocomp.')"/', $content) || preg_match("/<\/$key>/", $content) || preg_match("/amp-fx/", $content)){
|
7995 |
if(!preg_match('/<script(\s|\sasync\s)custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'"(.*?)>(.*?)<\/script>/s', $content)){
|
7996 |
$o_comp_url = 'https://cdn.ampproject.org/v0/'.esc_attr($ocomp).'-'.esc_attr($script_ver).'.js';
|
7997 |
$script_tag = '<head><script custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'" src="'.esc_url($o_comp_url).'" async></script>';
|
@@ -8191,4 +8194,47 @@ if(!function_exists('ampforwp_check_image_existance')){
|
|
8191 |
}
|
8192 |
return $image;
|
8193 |
}
|
8194 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7484 |
$title = $user_info->title;
|
7485 |
}
|
7486 |
if($title){
|
7487 |
+
// To Suppress Warnings
|
7488 |
+
libxml_use_internal_errors(true);
|
7489 |
$dom->loadHTML($title);
|
7490 |
+
libxml_use_internal_errors(false);
|
7491 |
$anchors = $dom -> getElementsByTagName('img');
|
7492 |
$src="";
|
7493 |
foreach($anchors as $im){
|
7987 |
}
|
7988 |
}
|
7989 |
//OTHER COMPONENT CHECK
|
7990 |
+
$other_comp_arr = array('amp-mustache'=>'amp-mustache','form'=>'amp-form','amp-access'=>'amp-access','amp-fx'=>'amp-fx-collection','dock'=>'amp-video-docking');
|
7991 |
foreach ($other_comp_arr as $key => $value) {
|
7992 |
$ocomp = $value;
|
7993 |
$celem = 'element';
|
7994 |
if($ocomp=='amp-mustache'){
|
7995 |
$celem = 'template';
|
7996 |
}
|
7997 |
+
if(preg_match('/(type|template|id)="('.$ocomp.')"/', $content) || preg_match("/<\/$key>/", $content) || preg_match("/amp-fx/", $content) || preg_match('/<(amp-(video|brightcove|dailymotion|delight-player|ima-video|video-iframe|youtube)).*?dock(.*?)><\/amp-.*?>/s', $content)){
|
7998 |
if(!preg_match('/<script(\s|\sasync\s)custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'"(.*?)>(.*?)<\/script>/s', $content)){
|
7999 |
$o_comp_url = 'https://cdn.ampproject.org/v0/'.esc_attr($ocomp).'-'.esc_attr($script_ver).'.js';
|
8000 |
$script_tag = '<head><script custom-'.esc_attr($celem).'="'.esc_attr($ocomp).'" src="'.esc_url($o_comp_url).'" async></script>';
|
8194 |
}
|
8195 |
return $image;
|
8196 |
}
|
8197 |
+
}
|
8198 |
+
|
8199 |
+
if (function_exists('themify_builder_activate')) {
|
8200 |
+
add_filter('ampforwp_modify_the_content','ampforwp_themify_compatibility');
|
8201 |
+
}
|
8202 |
+
function ampforwp_themify_compatibility($content){
|
8203 |
+
$get_data = get_post_meta(ampforwp_get_the_ID(),'_themify_builder_settings_json',true);
|
8204 |
+
if($get_data){
|
8205 |
+
$decode = json_decode($get_data,true);
|
8206 |
+
for($i=0;$i<count($decode);$i++){
|
8207 |
+
$cols = $decode[$i]['cols'];
|
8208 |
+
for($j=0;$j<count($cols);$j++){
|
8209 |
+
if (isset($cols[$j]['modules'])) {
|
8210 |
+
$modules = $cols[$j]['modules'];
|
8211 |
+
for($k=0;$k<count($modules);$k++){
|
8212 |
+
foreach ($modules as $key => $value) {
|
8213 |
+
foreach ($value['mod_settings'] as $key => $val) {
|
8214 |
+
$content.=$val;
|
8215 |
+
}
|
8216 |
+
}
|
8217 |
+
}
|
8218 |
+
}
|
8219 |
+
}
|
8220 |
+
}
|
8221 |
+
}
|
8222 |
+
return $content;
|
8223 |
+
}
|
8224 |
+
if(class_exists('RankMath')){
|
8225 |
+
add_filter('ampforwp_modify_the_content','ampforwp_rank_math_external_link_newtab');
|
8226 |
+
}
|
8227 |
+
function ampforwp_rank_math_external_link_newtab($content){
|
8228 |
+
$rank_math_external_link = RankMath\Helper::get_settings( 'general.new_window_external_links' );
|
8229 |
+
if($rank_math_external_link){
|
8230 |
+
preg_match_all('/<a href="(.*?)">(.*?)<\/a>/', $content, $matches);
|
8231 |
+
for($i=0;$i<count($matches[1]);$i++){
|
8232 |
+
$url = $matches[1][$i];
|
8233 |
+
$is_external = ampforwp_isexternal($url);
|
8234 |
+
if($is_external){
|
8235 |
+
$content = preg_replace('/<a href="(.*?)">(.*?)<\/a>/', '<a href="$1" target="_blank">$2</a>', $content);
|
8236 |
+
}
|
8237 |
+
}
|
8238 |
+
}
|
8239 |
+
return $content;
|
8240 |
+
}
|