Version Description
Download this release
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 1.0.77.27 |
Comparing to | |
See all releases |
Code changes from version 1.0.77.26 to 1.0.77.27
- README.md +7 -14
- accelerated-moblie-pages.php +3 -2
- changelog.txt +6 -3
- includes/admin-script.js +8 -0
- includes/admin-style.css +21 -0
- includes/features/advertisement/adpushup-ads-functions.php +258 -0
- includes/features/advertisement/ads-options.php +241 -1
- includes/features/functions.php +32 -0
- includes/features/pagebuilders-support/pagebuilders_support.php +0 -1
- includes/options/redux-core/assets/css/redux-admin.css +14 -0
- readme.txt +7 -14
- templates/features.php +7 -7
- uninstall.php +1 -0
README.md
CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.8
|
7 |
-
Stable tag: 1.0.77.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -197,9 +197,12 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
197 |
|
198 |
== Changelog ==
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
203 |
|
204 |
= 1.0.77.25 (1st October 2021) =
|
205 |
* Improvements: Added Plausible analytics compatible in AMP #5142
|
@@ -208,14 +211,4 @@ Device testing done through [BrowserStack](https://www.browserstack.com)
|
|
208 |
* Fixed: AMP Page builder content not rendering with Muffin builder #5147
|
209 |
* Fixed: Debug log Errors #5145
|
210 |
|
211 |
-
= 1.0.77.24 (23rd September 2021) =
|
212 |
-
* Improvements: Added Filter to disable AMP for all categories except one #5139
|
213 |
-
* Improvements: Added Ninja Form in the description of contact form module #5138
|
214 |
-
* Fixed: Basic/Advance popup shows everytime when visiting option panel #5143
|
215 |
-
* Fixed: Renewal link redirecting to 404 from options panel #5140
|
216 |
-
* Fixed: Incorrect URL while using Matomo analytics #5136
|
217 |
-
* Fixed: Validation error in the alt tag with Transposh plugin #5135
|
218 |
-
* Fixed: Some design issues on one specific users #5134
|
219 |
-
* Fixed: Debug Warnings - Use of undefined constant AUTH_KEY and SECURE_AUTH_KEY #5035
|
220 |
-
|
221 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.8
|
7 |
+
Stable tag: 1.0.77.27
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
197 |
|
198 |
== Changelog ==
|
199 |
|
200 |
+
1.0.77.26 (21TH October 2021) =
|
201 |
+
Improvements: Added AdPushup Support in AMP #5144
|
202 |
+
|
203 |
+
1.0.77.26 (20TH October 2021) =
|
204 |
+
Improvements: Added FV Gravatar Cache Compatibility in AMP #5149
|
205 |
+
Fixed: Images not loading when destination structure is document root in WebP Express #5150
|
206 |
|
207 |
= 1.0.77.25 (1st October 2021) =
|
208 |
* Improvements: Added Plausible analytics compatible in AMP #5142
|
211 |
* Fixed: AMP Page builder content not rendering with Muffin builder #5147
|
212 |
* Fixed: Debug log Errors #5145
|
213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
accelerated-moblie-pages.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
-
Version: 1.0.77.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
-
define('AMPFORWP_VERSION','1.0.77.
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
if(!defined('AMPFROWP_HOST_NAME')){
|
26 |
$urlinfo = get_bloginfo('url');
|
@@ -634,6 +634,7 @@ if ( ! class_exists( 'Ampforwp_Init', false ) ) {
|
|
634 |
//Other Features
|
635 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/advertisement/ads-functions.php";
|
636 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/advertisement/mgid-ads-functions.php";
|
|
|
637 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/performance/performance-functions.php";
|
638 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/analytics/analytics-functions.php";
|
639 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/structure-data/structured-data-functions.php";
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
+
Version: 1.0.77.27
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
+
define('AMPFORWP_VERSION','1.0.77.27');
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
if(!defined('AMPFROWP_HOST_NAME')){
|
26 |
$urlinfo = get_bloginfo('url');
|
634 |
//Other Features
|
635 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/advertisement/ads-functions.php";
|
636 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/advertisement/mgid-ads-functions.php";
|
637 |
+
require_once AMPFORWP_PLUGIN_DIR."includes/features/advertisement/adpushup-ads-functions.php";
|
638 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/performance/performance-functions.php";
|
639 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/analytics/analytics-functions.php";
|
640 |
require_once AMPFORWP_PLUGIN_DIR."includes/features/structure-data/structured-data-functions.php";
|
changelog.txt
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
== Changelog ==
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
= 1.0.77.25 (1st October 2021) =
|
8 |
* Improvements: Added Plausible analytics compatible in AMP #5142
|
1 |
== Changelog ==
|
2 |
|
3 |
+
1.0.77.26 (21TH October 2021) =
|
4 |
+
Improvements: Added AdPushup Support in AMP #5144
|
5 |
+
|
6 |
+
1.0.77.26 (20TH October 2021) =
|
7 |
+
Improvements: Added FV Gravatar Cache Compatibility in AMP #5149
|
8 |
+
Fixed: Images not loading when destination structure is document root in WebP Express #5150
|
9 |
|
10 |
= 1.0.77.25 (1st October 2021) =
|
11 |
* Improvements: Added Plausible analytics compatible in AMP #5142
|
includes/admin-script.js
CHANGED
@@ -2644,4 +2644,12 @@ $("#subscribe-newsletter-form").on('submit',function(e){
|
|
2644 |
$(".ampforwp_remove_notice").remove();
|
2645 |
});
|
2646 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2647 |
});
|
2644 |
$(".ampforwp_remove_notice").remove();
|
2645 |
});
|
2646 |
});
|
2647 |
+
$("#ampforwp-close-ad-notice").on("click", function(){
|
2648 |
+
var data = {
|
2649 |
+
action: 'ampforwp_adpushup_remove_notice',
|
2650 |
+
};
|
2651 |
+
$.post(ajaxurl, data, function(response) {
|
2652 |
+
$(".ampforwp_remove_notice").remove();
|
2653 |
+
});
|
2654 |
+
});
|
2655 |
});
|
includes/admin-style.css
CHANGED
@@ -2176,4 +2176,25 @@ span#amp-close {
|
|
2176 |
text-align: center;
|
2177 |
color: white;
|
2178 |
border-radius: 5px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2179 |
}
|
2176 |
text-align: center;
|
2177 |
color: white;
|
2178 |
border-radius: 5px;
|
2179 |
+
}
|
2180 |
+
|
2181 |
+
.ampforwp_new_features .redux-group-tab-link-a span:after {
|
2182 |
+
content: "NEW";
|
2183 |
+
color: #fff;
|
2184 |
+
font-size: 10px;
|
2185 |
+
background: #4452a7;
|
2186 |
+
padding: 5px 10px;
|
2187 |
+
border-radius: 30px;
|
2188 |
+
font-weight: normal;
|
2189 |
+
position: relative;
|
2190 |
+
top: -1px;
|
2191 |
+
left: 15px;
|
2192 |
+
}
|
2193 |
+
.updated.notice p {
|
2194 |
+
font-size: 15px;
|
2195 |
+
}
|
2196 |
+
a#ampforwp-close-ad-notice {
|
2197 |
+
background: #fff;
|
2198 |
+
color: #2271b1;
|
2199 |
+
border: none;
|
2200 |
}
|
includes/features/advertisement/adpushup-ads-functions.php
ADDED
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
add_filter('ampforwp_modify_ad_1','ampforwp_adpushup_ad_1');
|
7 |
+
add_filter('ampforwp_modify_ad_2','ampforwp_adpushup_ad_2',10,1);
|
8 |
+
add_filter('ampforwp_modify_ad_3','ampforwp_adpushup_ad_3',10,1);
|
9 |
+
add_filter('ampforwp_modify_ad_4','ampforwp_adpushup_ad_4',10,1);
|
10 |
+
add_filter('ampforwp_modify_ad_5','ampforwp_adpushup_ad_5',10,1);
|
11 |
+
add_filter('ampforwp_modify_ad_6','ampforwp_adpushup_ad_6',10,1);
|
12 |
+
|
13 |
+
function ampforwp_adpushup_ad_1($output){
|
14 |
+
if( ampforwp_get_setting('enable-amp-ads-1') && 'adpushup' == ampforwp_get_setting('enable-amp-ads-type-1') ) {
|
15 |
+
$site_id = ampforwp_get_setting('ampforwp-adpushup-site-id');
|
16 |
+
$slotpath = ampforwp_get_setting('ampforwp-adpushup-slotpath-1');
|
17 |
+
if(ampforwp_get_setting('ampforwp-adpushup-select-1') == 1) {
|
18 |
+
$width = '300';
|
19 |
+
$height = '250';
|
20 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-1') == 2) {
|
21 |
+
$width = '336';
|
22 |
+
$height = '280';
|
23 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-1') == 3) {
|
24 |
+
$width = '728';
|
25 |
+
$height = '90';
|
26 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-1') == 4) {
|
27 |
+
$width = '300';
|
28 |
+
$height = '600';
|
29 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-1') == 5) {
|
30 |
+
$width = '320';
|
31 |
+
$height = '100';
|
32 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-1') == 6) {
|
33 |
+
$width = '200';
|
34 |
+
$height = '50';
|
35 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-1') == 7) {
|
36 |
+
$width = '320';
|
37 |
+
$height = '50';
|
38 |
+
}
|
39 |
+
if (!empty($site_id) && !empty($slotpath)) {
|
40 |
+
$output = '<div class="amp-ad-wrapper amp_ad_1">
|
41 |
+
<amp-ad class="amp-ad-1"
|
42 |
+
width="'.esc_attr( $width ).'"
|
43 |
+
height="'.esc_attr( $height ).'"
|
44 |
+
type="adpushup"
|
45 |
+
data-siteid="'.esc_attr( $site_id ).'"
|
46 |
+
data-slotpath="'.esc_attr( $slotpath ).'" >
|
47 |
+
</amp-ad>
|
48 |
+
'.ampforwp_ads_sponsorship().'
|
49 |
+
</div>';
|
50 |
+
}
|
51 |
+
}
|
52 |
+
return $output;
|
53 |
+
}
|
54 |
+
function ampforwp_adpushup_ad_2($output){
|
55 |
+
if( ampforwp_get_setting('enable-amp-ads-2') && 'adpushup' == ampforwp_get_setting('enable-amp-ads-type-2') ) {
|
56 |
+
$site_id = ampforwp_get_setting('ampforwp-adpushup-site-id');
|
57 |
+
$slotpath = ampforwp_get_setting('ampforwp-adpushup-slotpath-2');
|
58 |
+
if(ampforwp_get_setting('ampforwp-adpushup-select-2') == 1) {
|
59 |
+
$width = '300';
|
60 |
+
$height = '250';
|
61 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-2') == 2) {
|
62 |
+
$width = '336';
|
63 |
+
$height = '280';
|
64 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-2') == 3) {
|
65 |
+
$width = '728';
|
66 |
+
$height = '90';
|
67 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-2') == 4) {
|
68 |
+
$width = '300';
|
69 |
+
$height = '600';
|
70 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-2') == 5) {
|
71 |
+
$width = '320';
|
72 |
+
$height = '100';
|
73 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-2') == 6) {
|
74 |
+
$width = '200';
|
75 |
+
$height = '50';
|
76 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-2') == 7) {
|
77 |
+
$width = '320';
|
78 |
+
$height = '50';
|
79 |
+
}
|
80 |
+
if (!empty($site_id) && !empty($slotpath)) {
|
81 |
+
$output = '<div class="amp-ad-wrapper amp_ad_2">
|
82 |
+
<amp-ad class="amp-ad-2"
|
83 |
+
width="'.esc_attr( $width ).'"
|
84 |
+
height="'.esc_attr( $height ).'"
|
85 |
+
type="adpushup"
|
86 |
+
data-siteid="'.esc_attr( $site_id ).'"
|
87 |
+
data-slotpath="'.esc_attr( $slotpath ).'" >
|
88 |
+
</amp-ad>
|
89 |
+
'.ampforwp_ads_sponsorship().'
|
90 |
+
</div>';
|
91 |
+
}
|
92 |
+
}
|
93 |
+
return $output;
|
94 |
+
}
|
95 |
+
function ampforwp_adpushup_ad_3($output){
|
96 |
+
if( ampforwp_get_setting('enable-amp-ads-3') && 'adpushup' == ampforwp_get_setting('enable-amp-ads-type-3') ) {
|
97 |
+
$site_id = ampforwp_get_setting('ampforwp-adpushup-site-id');
|
98 |
+
$slotpath = ampforwp_get_setting('ampforwp-adpushup-slotpath-3');
|
99 |
+
if(ampforwp_get_setting('ampforwp-adpushup-select-3') == 1) {
|
100 |
+
$width = '300';
|
101 |
+
$height = '250';
|
102 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-3') == 2) {
|
103 |
+
$width = '336';
|
104 |
+
$height = '280';
|
105 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-3') == 3) {
|
106 |
+
$width = '728';
|
107 |
+
$height = '90';
|
108 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-3') == 4) {
|
109 |
+
$width = '300';
|
110 |
+
$height = '600';
|
111 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-3') == 5) {
|
112 |
+
$width = '320';
|
113 |
+
$height = '100';
|
114 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-3') == 6) {
|
115 |
+
$width = '200';
|
116 |
+
$height = '50';
|
117 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-3') == 7) {
|
118 |
+
$width = '320';
|
119 |
+
$height = '50';
|
120 |
+
}
|
121 |
+
if (!empty($site_id) && !empty($slotpath)) {
|
122 |
+
$output = '<div class="amp-ad-wrapper amp_ad_3">
|
123 |
+
<amp-ad class="amp-ad-3"
|
124 |
+
width="'.esc_attr( $width ).'"
|
125 |
+
height="'.esc_attr( $height ).'"
|
126 |
+
type="adpushup"
|
127 |
+
data-siteid="'.esc_attr( $site_id ).'"
|
128 |
+
data-slotpath="'.esc_attr( $slotpath ).'" >
|
129 |
+
</amp-ad>
|
130 |
+
'.ampforwp_ads_sponsorship().'
|
131 |
+
</div>';
|
132 |
+
}
|
133 |
+
}
|
134 |
+
return $output;
|
135 |
+
}
|
136 |
+
function ampforwp_adpushup_ad_4($output){
|
137 |
+
if( ampforwp_get_setting('enable-amp-ads-4') && 'adpushup' == ampforwp_get_setting('enable-amp-ads-type-4') ) {
|
138 |
+
$site_id = ampforwp_get_setting('ampforwp-adpushup-site-id');
|
139 |
+
$slotpath = ampforwp_get_setting('ampforwp-adpushup-slotpath-4');
|
140 |
+
if(ampforwp_get_setting('ampforwp-adpushup-select-4') == 1) {
|
141 |
+
$width = '300';
|
142 |
+
$height = '250';
|
143 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-4') == 2) {
|
144 |
+
$width = '336';
|
145 |
+
$height = '280';
|
146 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-4') == 3) {
|
147 |
+
$width = '728';
|
148 |
+
$height = '90';
|
149 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-4') == 4) {
|
150 |
+
$width = '300';
|
151 |
+
$height = '600';
|
152 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-4') == 5) {
|
153 |
+
$width = '320';
|
154 |
+
$height = '100';
|
155 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-4') == 6) {
|
156 |
+
$width = '200';
|
157 |
+
$height = '50';
|
158 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-4') == 7) {
|
159 |
+
$width = '320';
|
160 |
+
$height = '50';
|
161 |
+
}
|
162 |
+
if (!empty($site_id) && !empty($slotpath)) {
|
163 |
+
$output = '<div class="amp-ad-wrapper amp_ad_4">
|
164 |
+
<amp-ad class="amp-ad-4"
|
165 |
+
width="'.esc_attr( $width ).'"
|
166 |
+
height="'.esc_attr( $height ).'"
|
167 |
+
type="adpushup"
|
168 |
+
data-siteid="'.esc_attr( $site_id ).'"
|
169 |
+
data-slotpath="'.esc_attr( $slotpath ).'" >
|
170 |
+
</amp-ad>
|
171 |
+
'.ampforwp_ads_sponsorship().'
|
172 |
+
</div>';
|
173 |
+
}
|
174 |
+
}
|
175 |
+
return $output;
|
176 |
+
}
|
177 |
+
function ampforwp_adpushup_ad_5($output){
|
178 |
+
if( ampforwp_get_setting('enable-amp-ads-5') && 'adpushup' == ampforwp_get_setting('enable-amp-ads-type-5') ) {
|
179 |
+
$site_id = ampforwp_get_setting('ampforwp-adpushup-site-id');
|
180 |
+
$slotpath = ampforwp_get_setting('ampforwp-adpushup-slotpath-5');
|
181 |
+
if(ampforwp_get_setting('ampforwp-adpushup-select-5') == 1) {
|
182 |
+
$width = '300';
|
183 |
+
$height = '250';
|
184 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-5') == 2) {
|
185 |
+
$width = '336';
|
186 |
+
$height = '280';
|
187 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-5') == 3) {
|
188 |
+
$width = '728';
|
189 |
+
$height = '90';
|
190 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-5') == 4) {
|
191 |
+
$width = '300';
|
192 |
+
$height = '600';
|
193 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-5') == 5) {
|
194 |
+
$width = '320';
|
195 |
+
$height = '100';
|
196 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-5') == 6) {
|
197 |
+
$width = '200';
|
198 |
+
$height = '50';
|
199 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-5') == 7) {
|
200 |
+
$width = '320';
|
201 |
+
$height = '50';
|
202 |
+
}
|
203 |
+
if (!empty($site_id) && !empty($slotpath)) {
|
204 |
+
$output = '<div class="amp-ad-wrapper amp_ad_5">
|
205 |
+
<amp-ad class="amp-ad-5"
|
206 |
+
width="'.esc_attr( $width ).'"
|
207 |
+
height="'.esc_attr( $height ).'"
|
208 |
+
type="adpushup"
|
209 |
+
data-siteid="'.esc_attr( $site_id ).'"
|
210 |
+
data-slotpath="'.esc_attr( $slotpath ).'" >
|
211 |
+
</amp-ad>
|
212 |
+
'.ampforwp_ads_sponsorship().'
|
213 |
+
</div>';
|
214 |
+
}
|
215 |
+
}
|
216 |
+
return $output;
|
217 |
+
}
|
218 |
+
function ampforwp_adpushup_ad_6($output){
|
219 |
+
if( ampforwp_get_setting('enable-amp-ads-6') && 'adpushup' == ampforwp_get_setting('enable-amp-ads-type-6') ) {
|
220 |
+
$site_id = ampforwp_get_setting('ampforwp-adpushup-site-id');
|
221 |
+
$slotpath = ampforwp_get_setting('ampforwp-adpushup-slotpath-6');
|
222 |
+
if(ampforwp_get_setting('ampforwp-adpushup-select-6') == 1) {
|
223 |
+
$width = '300';
|
224 |
+
$height = '250';
|
225 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-6') == 2) {
|
226 |
+
$width = '336';
|
227 |
+
$height = '280';
|
228 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-6') == 3) {
|
229 |
+
$width = '728';
|
230 |
+
$height = '90';
|
231 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-6') == 4) {
|
232 |
+
$width = '300';
|
233 |
+
$height = '600';
|
234 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-6') == 5) {
|
235 |
+
$width = '320';
|
236 |
+
$height = '100';
|
237 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-6') == 6) {
|
238 |
+
$width = '200';
|
239 |
+
$height = '50';
|
240 |
+
} elseif (ampforwp_get_setting('ampforwp-adpushup-select-6') == 7) {
|
241 |
+
$width = '320';
|
242 |
+
$height = '50';
|
243 |
+
}
|
244 |
+
if (!empty($site_id) && !empty($slotpath)) {
|
245 |
+
$output = '<div class="amp-ad-wrapper amp_ad_6">
|
246 |
+
<amp-ad class="amp-ad-6"
|
247 |
+
width="'.esc_attr( $width ).'"
|
248 |
+
height="'.esc_attr( $height ).'"
|
249 |
+
type="adpushup"
|
250 |
+
data-siteid="'.esc_attr( $site_id ).'"
|
251 |
+
data-slotpath="'.esc_attr( $slotpath ).'" >
|
252 |
+
</amp-ad>
|
253 |
+
'.ampforwp_ads_sponsorship().'
|
254 |
+
</div>';
|
255 |
+
}
|
256 |
+
}
|
257 |
+
return $output;
|
258 |
+
}
|
includes/features/advertisement/ads-options.php
CHANGED
@@ -83,10 +83,11 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
83 |
'desc' => $advertisementdesc,
|
84 |
'class' => '',
|
85 |
'id' => 'amp-ads',
|
|
|
86 |
'subsection' => true,
|
87 |
'fields' => apply_filters('ampforwp_ads_option_fields', $fields = array() ),
|
88 |
) );
|
89 |
-
}
|
90 |
}
|
91 |
|
92 |
//
|
@@ -94,6 +95,35 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
94 |
function ampforwp_add_ads_fields($fields){
|
95 |
if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
$fields[] = array(
|
98 |
'id' => 'amp-ads_1',
|
99 |
'type' => 'section',
|
@@ -121,6 +151,7 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
121 |
// Must provide key => value pairs for select options
|
122 |
'options' => array(
|
123 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
|
|
124 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
125 |
),
|
126 |
'default' => 'adsense',
|
@@ -182,6 +213,40 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
182 |
array('enable-amp-ads-type-1', '=' , 'adsense'),
|
183 |
),
|
184 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
// MGID fields
|
186 |
$fields[] = array(
|
187 |
'class' => 'child_opt',
|
@@ -281,6 +346,7 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
281 |
// Must provide key => value pairs for select options
|
282 |
'options' => array(
|
283 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
|
|
284 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
285 |
),
|
286 |
'default' => 'adsense',
|
@@ -343,6 +409,40 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
343 |
array('enable-amp-ads-type-2', '=' , 'adsense'),
|
344 |
),
|
345 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
// MGID fields
|
347 |
$fields[] = array(
|
348 |
'class' => 'child_opt',
|
@@ -442,6 +542,7 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
442 |
// Must provide key => value pairs for select options
|
443 |
'options' => array(
|
444 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
|
|
445 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
446 |
),
|
447 |
'default' => 'adsense',
|
@@ -520,6 +621,40 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
520 |
array('enable-amp-ads-type-3', '=' , 'adsense'),
|
521 |
),
|
522 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
// MGID fields
|
524 |
$fields[] = array(
|
525 |
'class' => 'child_opt',
|
@@ -619,6 +754,7 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
619 |
// Must provide key => value pairs for select options
|
620 |
'options' => array(
|
621 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
|
|
622 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
623 |
),
|
624 |
'default' => 'adsense',
|
@@ -681,6 +817,40 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
681 |
array('enable-amp-ads-type-4', '=' , 'adsense'),
|
682 |
),
|
683 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
// MGID fields
|
685 |
$fields[] = array(
|
686 |
'class' => 'child_opt',
|
@@ -780,6 +950,7 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
780 |
// Must provide key => value pairs for select options
|
781 |
'options' => array(
|
782 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
|
|
783 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
784 |
),
|
785 |
'default' => 'adsense',
|
@@ -842,6 +1013,40 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
842 |
array('enable-amp-ads-type-5', '=' , 'adsense'),
|
843 |
),
|
844 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
845 |
// MGID fields
|
846 |
$fields[] = array(
|
847 |
'class' => 'child_opt',
|
@@ -940,6 +1145,7 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
940 |
// Must provide key => value pairs for select options
|
941 |
'options' => array(
|
942 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
|
|
943 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
944 |
),
|
945 |
'default' => 'adsense',
|
@@ -1002,6 +1208,40 @@ if (!function_exists('adsforwp_admin_notice')) {
|
|
1002 |
array('enable-amp-ads-type-6', '=' , 'adsense'),
|
1003 |
),
|
1004 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1005 |
// MGID fields
|
1006 |
$fields[] = array(
|
1007 |
'class' => 'child_opt',
|
83 |
'desc' => $advertisementdesc,
|
84 |
'class' => '',
|
85 |
'id' => 'amp-ads',
|
86 |
+
'class'=>'ampforwp_new_features ',
|
87 |
'subsection' => true,
|
88 |
'fields' => apply_filters('ampforwp_ads_option_fields', $fields = array() ),
|
89 |
) );
|
90 |
+
}
|
91 |
}
|
92 |
|
93 |
//
|
95 |
function ampforwp_add_ads_fields($fields){
|
96 |
if ( !is_plugin_active('ads-for-wp/ads-for-wp.php') ) {
|
97 |
|
98 |
+
$fields[] = array(
|
99 |
+
'id' => 'amp-ads_0',
|
100 |
+
'type' => 'section',
|
101 |
+
'title' => esc_html__('Optimize Your Revenue with AdPushup', 'accelerated-mobile-pages'),
|
102 |
+
'indent' => true,
|
103 |
+
'layout_type' => 'accordion',
|
104 |
+
'accordion-open'=> 1,
|
105 |
+
);
|
106 |
+
|
107 |
+
$fields[] = array(
|
108 |
+
'id' =>'ampforwp-ads-adpushup',
|
109 |
+
'type' => 'switch',
|
110 |
+
'title' => esc_html__('Ad Revenue Optimization', 'accelerated-mobile-pages'),
|
111 |
+
'desc' => sprintf('%s <a href="%s" target="_blank">%s</a>',
|
112 |
+
esc_html__('Get upto 2x revenue and all the benefits of Header Bidding now on AMP inventory with AdPushup', 'accelerated-mobile-pages'), esc_url('https://www.adpushup.com/publisher/amp-for-wp/'),esc_html__('Learn more','accelerated-mobile-pages')),
|
113 |
+
'default' => 0,
|
114 |
+
);
|
115 |
+
$fields[] = array(
|
116 |
+
'class' => 'child_opt',
|
117 |
+
'id' =>'ampforwp-adpushup-site-id',
|
118 |
+
'type' => 'text',
|
119 |
+
'required' => array('ampforwp-ads-adpushup', '=' , '1'),
|
120 |
+
'title' => esc_html__('Site ID', 'accelerated-mobile-pages'),
|
121 |
+
'desc' => sprintf('%s <a href="%s" target="_blank">%s</a>',
|
122 |
+
esc_html__('Get the site ID from', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-add-adpushup-ads-in-amp'), esc_html__('here','accelerated-mobile-pages')),
|
123 |
+
'default' => '',
|
124 |
+
'placeholder'=> '40827'
|
125 |
+
);
|
126 |
+
|
127 |
$fields[] = array(
|
128 |
'id' => 'amp-ads_1',
|
129 |
'type' => 'section',
|
151 |
// Must provide key => value pairs for select options
|
152 |
'options' => array(
|
153 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
154 |
+
'adpushup' => esc_html__('AdPushup', 'accelerated-mobile-pages'),
|
155 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
156 |
),
|
157 |
'default' => 'adsense',
|
213 |
array('enable-amp-ads-type-1', '=' , 'adsense'),
|
214 |
),
|
215 |
);
|
216 |
+
// AdPushup fields
|
217 |
+
$fields[] = array(
|
218 |
+
'class' => 'child_opt child_opt_arrow',
|
219 |
+
'id' => 'ampforwp-adpushup-select-1',
|
220 |
+
'type' => 'select',
|
221 |
+
'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
|
222 |
+
'required' => array(
|
223 |
+
array('enable-amp-ads-1', '=' , '1'),
|
224 |
+
array('enable-amp-ads-type-1', '=' , 'adpushup'),
|
225 |
+
),
|
226 |
+
// Must provide key => value pairs for select options
|
227 |
+
'options' => array(
|
228 |
+
'1' => esc_html__('300x250','accelerated-mobile-pages'),
|
229 |
+
'2' => esc_html__('336x280','accelerated-mobile-pages'),
|
230 |
+
'3' => esc_html__('728x90','accelerated-mobile-pages'),
|
231 |
+
'4' => esc_html__('300x600','accelerated-mobile-pages'),
|
232 |
+
'5' => esc_html__('320x100','accelerated-mobile-pages'),
|
233 |
+
'6' => esc_html__('200x50','accelerated-mobile-pages'),
|
234 |
+
'7' => esc_html__('320x50','accelerated-mobile-pages'), ),
|
235 |
+
'default' => '1',
|
236 |
+
);
|
237 |
+
|
238 |
+
$fields[] = array(
|
239 |
+
'class' => 'child_opt',
|
240 |
+
'id' =>'ampforwp-adpushup-slotpath-1',
|
241 |
+
'type' => 'text',
|
242 |
+
'required' => array(
|
243 |
+
array('enable-amp-ads-1', '=' , '1'),
|
244 |
+
array('enable-amp-ads-type-1', '=' , 'adpushup'),
|
245 |
+
),
|
246 |
+
'title' => esc_html__('Slotpath', 'accelerated-mobile-pages'),
|
247 |
+
'default' => '',
|
248 |
+
'placeholder'=> '/103512698/AMP_COMPONENT_TEST_1'
|
249 |
+
);
|
250 |
// MGID fields
|
251 |
$fields[] = array(
|
252 |
'class' => 'child_opt',
|
346 |
// Must provide key => value pairs for select options
|
347 |
'options' => array(
|
348 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
349 |
+
'adpushup' => esc_html__('AdPushup', 'accelerated-mobile-pages'),
|
350 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
351 |
),
|
352 |
'default' => 'adsense',
|
409 |
array('enable-amp-ads-type-2', '=' , 'adsense'),
|
410 |
),
|
411 |
);
|
412 |
+
// AdPushup fields
|
413 |
+
$fields[] = array(
|
414 |
+
'class' => 'child_opt child_opt_arrow',
|
415 |
+
'id' => 'ampforwp-adpushup-select-2',
|
416 |
+
'type' => 'select',
|
417 |
+
'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
|
418 |
+
'required' => array(
|
419 |
+
array('enable-amp-ads-2', '=' , '1'),
|
420 |
+
array('enable-amp-ads-type-2', '=' , 'adpushup'),
|
421 |
+
),
|
422 |
+
// Must provide key => value pairs for select options
|
423 |
+
'options' => array(
|
424 |
+
'1' => esc_html__('300x250','accelerated-mobile-pages'),
|
425 |
+
'2' => esc_html__('336x280','accelerated-mobile-pages'),
|
426 |
+
'3' => esc_html__('728x90','accelerated-mobile-pages'),
|
427 |
+
'4' => esc_html__('300x600','accelerated-mobile-pages'),
|
428 |
+
'5' => esc_html__('320x100','accelerated-mobile-pages'),
|
429 |
+
'6' => esc_html__('200x50','accelerated-mobile-pages'),
|
430 |
+
'7' => esc_html__('320x50','accelerated-mobile-pages'), ),
|
431 |
+
'default' => '1',
|
432 |
+
);
|
433 |
+
|
434 |
+
$fields[] = array(
|
435 |
+
'class' => 'child_opt',
|
436 |
+
'id' =>'ampforwp-adpushup-slotpath-2',
|
437 |
+
'type' => 'text',
|
438 |
+
'required' => array(
|
439 |
+
array('enable-amp-ads-2', '=' , '1'),
|
440 |
+
array('enable-amp-ads-type-2', '=' , 'adpushup'),
|
441 |
+
),
|
442 |
+
'title' => esc_html__('Slotpath', 'accelerated-mobile-pages'),
|
443 |
+
'default' => '',
|
444 |
+
'placeholder'=> '/103512698/AMP_COMPONENT_TEST_1'
|
445 |
+
);
|
446 |
// MGID fields
|
447 |
$fields[] = array(
|
448 |
'class' => 'child_opt',
|
542 |
// Must provide key => value pairs for select options
|
543 |
'options' => array(
|
544 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
545 |
+
'adpushup' => esc_html__('AdPushup', 'accelerated-mobile-pages'),
|
546 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
547 |
),
|
548 |
'default' => 'adsense',
|
621 |
array('enable-amp-ads-type-3', '=' , 'adsense'),
|
622 |
),
|
623 |
);
|
624 |
+
// AdPushup fields
|
625 |
+
$fields[] = array(
|
626 |
+
'class' => 'child_opt child_opt_arrow',
|
627 |
+
'id' => 'ampforwp-adpushup-select-3',
|
628 |
+
'type' => 'select',
|
629 |
+
'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
|
630 |
+
'required' => array(
|
631 |
+
array('enable-amp-ads-3', '=' , '1'),
|
632 |
+
array('enable-amp-ads-type-3', '=' , 'adpushup'),
|
633 |
+
),
|
634 |
+
// Must provide key => value pairs for select options
|
635 |
+
'options' => array(
|
636 |
+
'1' => esc_html__('300x250','accelerated-mobile-pages'),
|
637 |
+
'2' => esc_html__('336x280','accelerated-mobile-pages'),
|
638 |
+
'3' => esc_html__('728x90','accelerated-mobile-pages'),
|
639 |
+
'4' => esc_html__('300x600','accelerated-mobile-pages'),
|
640 |
+
'5' => esc_html__('320x100','accelerated-mobile-pages'),
|
641 |
+
'6' => esc_html__('200x50','accelerated-mobile-pages'),
|
642 |
+
'7' => esc_html__('320x50','accelerated-mobile-pages'), ),
|
643 |
+
'default' => '1',
|
644 |
+
);
|
645 |
+
|
646 |
+
$fields[] = array(
|
647 |
+
'class' => 'child_opt',
|
648 |
+
'id' =>'ampforwp-adpushup-slotpath-3',
|
649 |
+
'type' => 'text',
|
650 |
+
'required' => array(
|
651 |
+
array('enable-amp-ads-3', '=' , '1'),
|
652 |
+
array('enable-amp-ads-type-3', '=' , 'adpushup'),
|
653 |
+
),
|
654 |
+
'title' => esc_html__('Slotpath', 'accelerated-mobile-pages'),
|
655 |
+
'default' => '',
|
656 |
+
'placeholder'=> '/103512698/AMP_COMPONENT_TEST_1'
|
657 |
+
);
|
658 |
// MGID fields
|
659 |
$fields[] = array(
|
660 |
'class' => 'child_opt',
|
754 |
// Must provide key => value pairs for select options
|
755 |
'options' => array(
|
756 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
757 |
+
'adpushup' => esc_html__('AdPushup', 'accelerated-mobile-pages'),
|
758 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
759 |
),
|
760 |
'default' => 'adsense',
|
817 |
array('enable-amp-ads-type-4', '=' , 'adsense'),
|
818 |
),
|
819 |
);
|
820 |
+
// AdPushup fields
|
821 |
+
$fields[] = array(
|
822 |
+
'class' => 'child_opt child_opt_arrow',
|
823 |
+
'id' => 'ampforwp-adpushup-select-4',
|
824 |
+
'type' => 'select',
|
825 |
+
'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
|
826 |
+
'required' => array(
|
827 |
+
array('enable-amp-ads-4', '=' , '1'),
|
828 |
+
array('enable-amp-ads-type-4', '=' , 'adpushup'),
|
829 |
+
),
|
830 |
+
// Must provide key => value pairs for select options
|
831 |
+
'options' => array(
|
832 |
+
'1' => esc_html__('300x250','accelerated-mobile-pages'),
|
833 |
+
'2' => esc_html__('336x280','accelerated-mobile-pages'),
|
834 |
+
'3' => esc_html__('728x90','accelerated-mobile-pages'),
|
835 |
+
'4' => esc_html__('300x600','accelerated-mobile-pages'),
|
836 |
+
'5' => esc_html__('320x100','accelerated-mobile-pages'),
|
837 |
+
'6' => esc_html__('200x50','accelerated-mobile-pages'),
|
838 |
+
'7' => esc_html__('320x50','accelerated-mobile-pages'), ),
|
839 |
+
'default' => '1',
|
840 |
+
);
|
841 |
+
|
842 |
+
$fields[] = array(
|
843 |
+
'class' => 'child_opt',
|
844 |
+
'id' =>'ampforwp-adpushup-slotpath-4',
|
845 |
+
'type' => 'text',
|
846 |
+
'required' => array(
|
847 |
+
array('enable-amp-ads-4', '=' , '1'),
|
848 |
+
array('enable-amp-ads-type-4', '=' , 'adpushup'),
|
849 |
+
),
|
850 |
+
'title' => esc_html__('Slotpath', 'accelerated-mobile-pages'),
|
851 |
+
'default' => '',
|
852 |
+
'placeholder'=> '/103512698/AMP_COMPONENT_TEST_1'
|
853 |
+
);
|
854 |
// MGID fields
|
855 |
$fields[] = array(
|
856 |
'class' => 'child_opt',
|
950 |
// Must provide key => value pairs for select options
|
951 |
'options' => array(
|
952 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
953 |
+
'adpushup' => esc_html__('AdPushup', 'accelerated-mobile-pages'),
|
954 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
955 |
),
|
956 |
'default' => 'adsense',
|
1013 |
array('enable-amp-ads-type-5', '=' , 'adsense'),
|
1014 |
),
|
1015 |
);
|
1016 |
+
// AdPushup fields
|
1017 |
+
$fields[] = array(
|
1018 |
+
'class' => 'child_opt child_opt_arrow',
|
1019 |
+
'id' => 'ampforwp-adpushup-select-5',
|
1020 |
+
'type' => 'select',
|
1021 |
+
'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
|
1022 |
+
'required' => array(
|
1023 |
+
array('enable-amp-ads-5', '=' , '1'),
|
1024 |
+
array('enable-amp-ads-type-5', '=' , 'adpushup'),
|
1025 |
+
),
|
1026 |
+
// Must provide key => value pairs for select options
|
1027 |
+
'options' => array(
|
1028 |
+
'1' => esc_html__('300x250','accelerated-mobile-pages'),
|
1029 |
+
'2' => esc_html__('336x280','accelerated-mobile-pages'),
|
1030 |
+
'3' => esc_html__('728x90','accelerated-mobile-pages'),
|
1031 |
+
'4' => esc_html__('300x600','accelerated-mobile-pages'),
|
1032 |
+
'5' => esc_html__('320x100','accelerated-mobile-pages'),
|
1033 |
+
'6' => esc_html__('200x50','accelerated-mobile-pages'),
|
1034 |
+
'7' => esc_html__('320x50','accelerated-mobile-pages'), ),
|
1035 |
+
'default' => '1',
|
1036 |
+
);
|
1037 |
+
|
1038 |
+
$fields[] = array(
|
1039 |
+
'class' => 'child_opt',
|
1040 |
+
'id' =>'ampforwp-adpushup-slotpath-5',
|
1041 |
+
'type' => 'text',
|
1042 |
+
'required' => array(
|
1043 |
+
array('enable-amp-ads-5', '=' , '1'),
|
1044 |
+
array('enable-amp-ads-type-5', '=' , 'adpushup'),
|
1045 |
+
),
|
1046 |
+
'title' => esc_html__('Slotpath', 'accelerated-mobile-pages'),
|
1047 |
+
'default' => '',
|
1048 |
+
'placeholder'=> '/103512698/AMP_COMPONENT_TEST_1'
|
1049 |
+
);
|
1050 |
// MGID fields
|
1051 |
$fields[] = array(
|
1052 |
'class' => 'child_opt',
|
1145 |
// Must provide key => value pairs for select options
|
1146 |
'options' => array(
|
1147 |
'adsense' => esc_html__('Adsense', 'accelerated-mobile-pages'),
|
1148 |
+
'adpushup' => esc_html__('AdPushup', 'accelerated-mobile-pages'),
|
1149 |
'mgid' => esc_html__('MGID','accelerated-mobile-pages'),
|
1150 |
),
|
1151 |
'default' => 'adsense',
|
1208 |
array('enable-amp-ads-type-6', '=' , 'adsense'),
|
1209 |
),
|
1210 |
);
|
1211 |
+
// AdPushup fields
|
1212 |
+
$fields[] = array(
|
1213 |
+
'class' => 'child_opt child_opt_arrow',
|
1214 |
+
'id' => 'ampforwp-adpushup-select-6',
|
1215 |
+
'type' => 'select',
|
1216 |
+
'title' => esc_html__('AD Size', 'accelerated-mobile-pages'),
|
1217 |
+
'required' => array(
|
1218 |
+
array('enable-amp-ads-6', '=' , '1'),
|
1219 |
+
array('enable-amp-ads-type-6', '=' , 'adpushup'),
|
1220 |
+
),
|
1221 |
+
// Must provide key => value pairs for select options
|
1222 |
+
'options' => array(
|
1223 |
+
'1' => esc_html__('300x250','accelerated-mobile-pages'),
|
1224 |
+
'2' => esc_html__('336x280','accelerated-mobile-pages'),
|
1225 |
+
'3' => esc_html__('728x90','accelerated-mobile-pages'),
|
1226 |
+
'4' => esc_html__('300x600','accelerated-mobile-pages'),
|
1227 |
+
'5' => esc_html__('320x100','accelerated-mobile-pages'),
|
1228 |
+
'6' => esc_html__('200x50','accelerated-mobile-pages'),
|
1229 |
+
'7' => esc_html__('320x50','accelerated-mobile-pages'), ),
|
1230 |
+
'default' => '1',
|
1231 |
+
);
|
1232 |
+
|
1233 |
+
$fields[] = array(
|
1234 |
+
'class' => 'child_opt',
|
1235 |
+
'id' =>'ampforwp-adpushup-slotpath-6',
|
1236 |
+
'type' => 'text',
|
1237 |
+
'required' => array(
|
1238 |
+
array('enable-amp-ads-6', '=' , '1'),
|
1239 |
+
array('enable-amp-ads-type-6', '=' , 'adpushup'),
|
1240 |
+
),
|
1241 |
+
'title' => esc_html__('Slotpath', 'accelerated-mobile-pages'),
|
1242 |
+
'default' => '',
|
1243 |
+
'placeholder'=> '/103512698/AMP_COMPONENT_TEST_1'
|
1244 |
+
);
|
1245 |
// MGID fields
|
1246 |
$fields[] = array(
|
1247 |
'class' => 'child_opt',
|
includes/features/functions.php
CHANGED
@@ -37,6 +37,10 @@ function ampforwp_add_admin_styling($hook_suffix){
|
|
37 |
|
38 |
// Localize the script with new data
|
39 |
$redux_data = array();
|
|
|
|
|
|
|
|
|
40 |
if( current_user_can("manage_options") && $hook_suffix=='toplevel_page_amp_options' ){
|
41 |
$redux_data = $redux_builder_amp;
|
42 |
wp_dequeue_script( 'insert-post-adschart-admin' );
|
@@ -70,6 +74,7 @@ function ampforwp_add_admin_styling($hook_suffix){
|
|
70 |
add_action('admin_notices', 'ampforwp_mobile_redirection_notice' );
|
71 |
add_action('admin_notices', 'ampforwp_category_base_remove_notice' );
|
72 |
add_action('admin_notices', 'ampforwp_internal_feedback_notice' );
|
|
|
73 |
if ( defined('AMPFORWPPRO_PLUGIN_DIR') ) {
|
74 |
$license_info = get_option( 'ampforwppro_license_info');
|
75 |
if (!$license_info) {
|
@@ -1517,6 +1522,33 @@ function ampforwp_feedback_remove_notice(){
|
|
1517 |
}
|
1518 |
add_action('wp_ajax_ampforwp_feedback_remove_notice', 'ampforwp_feedback_remove_notice');
|
1519 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1520 |
function ampforwp_pro_extension_manager_notice(){?>
|
1521 |
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
|
1522 |
<p>
|
37 |
|
38 |
// Localize the script with new data
|
39 |
$redux_data = array();
|
40 |
+
global $pagenow;
|
41 |
+
if ('plugins.php' == $pagenow) {
|
42 |
+
add_action('admin_notices', 'ampforwp_adpushup_notice' );
|
43 |
+
}
|
44 |
if( current_user_can("manage_options") && $hook_suffix=='toplevel_page_amp_options' ){
|
45 |
$redux_data = $redux_builder_amp;
|
46 |
wp_dequeue_script( 'insert-post-adschart-admin' );
|
74 |
add_action('admin_notices', 'ampforwp_mobile_redirection_notice' );
|
75 |
add_action('admin_notices', 'ampforwp_category_base_remove_notice' );
|
76 |
add_action('admin_notices', 'ampforwp_internal_feedback_notice' );
|
77 |
+
add_action('admin_notices', 'ampforwp_adpushup_notice' );
|
78 |
if ( defined('AMPFORWPPRO_PLUGIN_DIR') ) {
|
79 |
$license_info = get_option( 'ampforwppro_license_info');
|
80 |
if (!$license_info) {
|
1522 |
}
|
1523 |
add_action('wp_ajax_ampforwp_feedback_remove_notice', 'ampforwp_feedback_remove_notice');
|
1524 |
|
1525 |
+
function ampforwp_adpushup_notice(){
|
1526 |
+
$remove_notice = get_option("ampforwp_adpushup_remove_notice");
|
1527 |
+
if ($remove_notice !='remove' && !ampforwp_get_setting('ampforwp-ads-adpushup')) {?>
|
1528 |
+
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
|
1529 |
+
<p>
|
1530 |
+
<?php echo sprintf( 'We have integrated <a href="https://ampforwp.com/tutorials/article/how-to-add-adpushup-ads-in-amp" target="_blank">%s</a> in our AMP plugin, it is a revenue optimization platform that helps publishers increase their ad revenue with fast fetch ad delivery and publishers can get upto 2x of the revenue compared to non-optimized pages',esc_html__('AdPushup ads','accelerated-mobile-pages' ));?></p>
|
1531 |
+
<a href="<?php echo esc_url('admin.php?page=amp_options&tab=4') ?>" class="button-primary" target="_self" style="font-weight:bold;" title="Ok, you deserved it"> <?php echo esc_html__('Setup AdPushup in AMP', 'accelerated-mobile-pages') ?></a>
|
1532 |
+
<a class="button-primary" id="ampforwp-close-ad-notice" style="font-weight:bold;"><?php echo esc_html__('Dismiss', 'accelerated-mobile-pages') ?></a>
|
1533 |
+
</p>
|
1534 |
+
</div>
|
1535 |
+
<?php }
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
function ampforwp_adpushup_remove_notice(){
|
1539 |
+
$result = '';
|
1540 |
+
if(current_user_can( 'manage_options' )){
|
1541 |
+
$result = update_option( "ampforwp_adpushup_remove_notice", 'remove');
|
1542 |
+
}
|
1543 |
+
if($result){
|
1544 |
+
echo json_encode(array('status'=>'t'));
|
1545 |
+
}else{
|
1546 |
+
echo json_encode(array('status'=>'f'));
|
1547 |
+
}
|
1548 |
+
wp_die();
|
1549 |
+
}
|
1550 |
+
add_action('wp_ajax_ampforwp_adpushup_remove_notice', 'ampforwp_adpushup_remove_notice');
|
1551 |
+
|
1552 |
function ampforwp_pro_extension_manager_notice(){?>
|
1553 |
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
|
1554 |
<p>
|
includes/features/pagebuilders-support/pagebuilders_support.php
CHANGED
@@ -262,7 +262,6 @@ if(!function_exists('amp_pagebuilder_compatibility_init')){
|
|
262 |
Redux::setSection( $opt_name, array(
|
263 |
'title' => esc_html__( $pb_title, 'accelerated-mobile-pages' ),
|
264 |
'id' => 'amp-content-builder',
|
265 |
-
'class' => 'ampforwp_new_features ',
|
266 |
'subsection' => true,
|
267 |
'fields' => $pb_for_amp,
|
268 |
)
|
262 |
Redux::setSection( $opt_name, array(
|
263 |
'title' => esc_html__( $pb_title, 'accelerated-mobile-pages' ),
|
264 |
'id' => 'amp-content-builder',
|
|
|
265 |
'subsection' => true,
|
266 |
'fields' => $pb_for_amp,
|
267 |
)
|
includes/options/redux-core/assets/css/redux-admin.css
CHANGED
@@ -1560,4 +1560,18 @@ doc-cnt h1 , .doc-cnt p{
|
|
1560 |
/** Discount Offer CSS Ends **/
|
1561 |
ul#\32 _section_group_li_subsections .redux-group-tab-link-li.active {
|
1562 |
background: linear-gradient(to right,#eb3349,#f45c43);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1563 |
}
|
1560 |
/** Discount Offer CSS Ends **/
|
1561 |
ul#\32 _section_group_li_subsections .redux-group-tab-link-li.active {
|
1562 |
background: linear-gradient(to right,#eb3349,#f45c43);
|
1563 |
+
}
|
1564 |
+
|
1565 |
+
/**Removed WP Quads Banner**/
|
1566 |
+
div#\34_section_group.amp-ads .redux-section-desc {
|
1567 |
+
display: none!important;
|
1568 |
+
}
|
1569 |
+
|
1570 |
+
#section-amp-ads_0.afw-accordion-header > h3 {
|
1571 |
+
background: #ff4954 !important;
|
1572 |
+
border-color: #ff4954 !important;
|
1573 |
+
color: #fff;
|
1574 |
+
}
|
1575 |
+
table#section-table-amp-ads_0 {
|
1576 |
+
border-color: #ff4954;
|
1577 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.8
|
7 |
-
Stable tag: 1.0.77.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -194,9 +194,12 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
194 |
|
195 |
== Changelog ==
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
200 |
|
201 |
= 1.0.77.25 (1st October 2021) =
|
202 |
* Improvements: Added Plausible analytics compatible in AMP #5142
|
@@ -205,14 +208,4 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
205 |
* Fixed: AMP Page builder content not rendering with Muffin builder #5147
|
206 |
* Fixed: Debug log Errors #5145
|
207 |
|
208 |
-
= 1.0.77.24 (23rd September 2021) =
|
209 |
-
* Improvements: Added Filter to disable AMP for all categories except one #5139
|
210 |
-
* Improvements: Added Ninja Form in the description of contact form module #5138
|
211 |
-
* Fixed: Basic/Advance popup shows everytime when visiting option panel #5143
|
212 |
-
* Fixed: Renewal link redirecting to 404 from options panel #5140
|
213 |
-
* Fixed: Incorrect URL while using Matomo analytics #5136
|
214 |
-
* Fixed: Validation error in the alt tag with Transposh plugin #5135
|
215 |
-
* Fixed: Some design issues on one specific users #5134
|
216 |
-
* Fixed: Debug Warnings - Use of undefined constant AUTH_KEY and SECURE_AUTH_KEY #5035
|
217 |
-
|
218 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.8
|
7 |
+
Stable tag: 1.0.77.27
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
194 |
|
195 |
== Changelog ==
|
196 |
|
197 |
+
1.0.77.26 (21TH October 2021) =
|
198 |
+
Improvements: Added AdPushup Support in AMP #5144
|
199 |
+
|
200 |
+
1.0.77.26 (20TH October 2021) =
|
201 |
+
Improvements: Added FV Gravatar Cache Compatibility in AMP #5149
|
202 |
+
Fixed: Images not loading when destination structure is document root in WebP Express #5150
|
203 |
|
204 |
= 1.0.77.25 (1st October 2021) =
|
205 |
* Improvements: Added Plausible analytics compatible in AMP #5142
|
208 |
* Fixed: AMP Page builder content not rendering with Muffin builder #5147
|
209 |
* Fixed: Debug log Errors #5145
|
210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
Full changelog available [ at changelog.txt](https://plugins.svn.wordpress.org/accelerated-mobile-pages/trunk/changelog.txt)
|
templates/features.php
CHANGED
@@ -5459,13 +5459,13 @@ if( ! function_exists('ampforwp_get_comments_gravatar') ){
|
|
5459 |
if(isset($redux_builder_amp['ampforwp-display-avatar']) && $redux_builder_amp['ampforwp-display-avatar']==0){
|
5460 |
return '';
|
5461 |
}
|
5462 |
-
|
5463 |
-
|
5464 |
-
|
5465 |
-
|
5466 |
-
|
5467 |
-
|
5468 |
-
|
5469 |
$gravatar_exists = '';
|
5470 |
$gravatar_exists = ampforwp_gravatar_checker($comment->comment_author_email);
|
5471 |
if ( null !== ampforwp_get_wp_user_avatar($comment, 'comment') ) {
|
5459 |
if(isset($redux_builder_amp['ampforwp-display-avatar']) && $redux_builder_amp['ampforwp-display-avatar']==0){
|
5460 |
return '';
|
5461 |
}
|
5462 |
+
if (class_exists('FV_Gravatar_Cache')) {
|
5463 |
+
$avatar_url = get_avatar_url($comment);
|
5464 |
+
$upload_dir = wp_upload_dir();
|
5465 |
+
$upload_dir = $upload_dir['baseurl'] . '/fv-gravatar-cache/';
|
5466 |
+
$avatar_url = preg_replace('/(.*?)avatar\/(.*?)\?s=(.*?)&(.*?)g/', ''.$upload_dir.'$2x$3.png', $avatar_url);
|
5467 |
+
return $avatar_url;
|
5468 |
+
}
|
5469 |
$gravatar_exists = '';
|
5470 |
$gravatar_exists = ampforwp_gravatar_checker($comment->comment_author_email);
|
5471 |
if ( null !== ampforwp_get_wp_user_avatar($comment, 'comment') ) {
|
uninstall.php
CHANGED
@@ -74,5 +74,6 @@ if(isset($redux_builder_amp['ampforwp-delete-on-uninstall']) && $redux_builder_a
|
|
74 |
delete_option('ampforwp_option_panel_view_type');
|
75 |
delete_option("ampforwp_feedback_remove_notice");
|
76 |
delete_option("ampforwp_dismiss_discount_btn");
|
|
|
77 |
}
|
78 |
}
|
74 |
delete_option('ampforwp_option_panel_view_type');
|
75 |
delete_option("ampforwp_feedback_remove_notice");
|
76 |
delete_option("ampforwp_dismiss_discount_btn");
|
77 |
+
delete_option("ampforwp_adpushup_remove_notice");
|
78 |
}
|
79 |
}
|