Version Description
- new ad health notification logic in WP Admin to show notifications and critical issues at one place
- disable Ad Health in frontend and backend using the existing "Disable Notices" option, now called "Disable Ad Health and other notices"
- prevented ad injection into excerpts
- reordered settings page
Download this release
Release Info
Developer | webzunft |
Plugin | Advanced Ads |
Version | 1.12 |
Comparing to | |
See all releases |
Code changes from version 1.11.2 to 1.12
- admin/assets/css/admin.css +40 -24
- admin/assets/js/admin-global.js +139 -0
- admin/class-advanced-ads-admin.php +34 -8
- admin/includes/ad-health-notices.php +183 -0
- admin/includes/class-menu.php +18 -1
- admin/includes/class-meta-box.php +12 -1
- admin/includes/class-notices.php +0 -28
- admin/includes/class-overview-widgets.php +19 -0
- admin/includes/class-settings.php +306 -241
- admin/includes/notices.php +1 -7
- admin/views/ad-info-bottom.php +8 -0
- admin/views/checks.php +7 -32
- admin/views/overview-notice-row.php +9 -0
- admin/views/overview-notices.php +32 -0
- admin/views/overview-widget.php +2 -0
- admin/views/support-callout.php +7 -0
- advanced-ads.php +2 -2
- classes/ad-ajax.php +26 -0
- classes/ad-health-notices.php +688 -0
- classes/ad.php +5 -1
- classes/ad_ajax_callbacks.php +77 -0
- classes/checks.php +16 -3
- classes/frontend_checks.php +84 -24
- classes/plugin.php +9 -1
- languages/advanced-ads.pot +312 -277
- modules/ad-blocker/admin/admin.php +1 -1
- modules/gadsense/admin/views/mapi-ad-selector.php +5 -5
- public/class-advanced-ads.php +6 -0
- readme.txt +10 -3
- vendor/autoload_52.php +1 -1
- vendor/composer/autoload_classmap.php +1 -0
- vendor/composer/autoload_real_52.php +3 -3
- vendor/composer/autoload_static.php +1 -0
admin/assets/css/admin.css
CHANGED
@@ -25,6 +25,18 @@
|
|
25 |
#advads-overview #advads_overview_addons table tr.recommended th,
|
26 |
#advads-overview #advads_overview_addons table tr.free th { padding-top: 20px; }
|
27 |
#advads_overview_news .button-primary { margin-left: 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
/**
|
30 |
* AD OVERVIEW PAGE
|
@@ -203,6 +215,28 @@ select + .advads-conditions-single { display: inline-block; }
|
|
203 |
#advads-start-wizard.dashicons-before:before,
|
204 |
#advads-stop-wizard.dashicons-before:before { height: 15px; line-height: 0.9em; }
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
/**
|
207 |
AD GROUP LIST
|
208 |
*/
|
@@ -273,11 +307,11 @@ tr:hover .on-hover { display: block; }
|
|
273 |
.advads-spinner { float: none; visibility: visible; }
|
274 |
.advads-wide-input { width: 30em; }
|
275 |
|
276 |
-
/**
|
|
|
277 |
*/
|
278 |
-
|
279 |
-
|
280 |
.advads-admin-notice[data-notice="nl_intro"] { border: 4px solid #0073aa; }
|
|
|
281 |
#aa-welcome-panel h2 { margin: 0; font-size: 21px; font-weight: 400; line-height: 1.2; }
|
282 |
#aa-welcome-panel h3 { margin: 1.33em 0; font-size: 16px; }
|
283 |
#aa-welcome-panel li { font-size: 14px; }
|
@@ -297,33 +331,15 @@ tr:hover .on-hover { display: block; }
|
|
297 |
#adsense-ad-param-error { color: red; font-weight: bold; }
|
298 |
.advads-adsense-content { width: 100%; }
|
299 |
.advads-adsense-show-code a, #mapi-open-selector a { padding: 0 10px; color: inherit; }
|
300 |
-
#mapi-wrap { border: 1px solid #ddd; padding: .5rem; position: relative; display:none; overflow: hidden; }
|
301 |
-
#mapi-wrap .label { font-weight:bold; display:block; margin:.75em auto .25rem; }
|
302 |
#mapi-quota-message{ color: #ef8e00; font-style: italic; font-weight: bold; }
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
#mapi-wrap table, #mapi-wrap table tbody { width: 100%; }
|
307 |
-
#mapi-wrap table { margin-bottom: 10px; }
|
308 |
-
#mapi-wrap tbody .dashicons { font-size: 1.2em; cursor: pointer; }
|
309 |
-
#mapi-wrap thead th { font-weight: 700; }
|
310 |
-
#mapi-wrap tbody .dashicons.disabled { color: #939393; }
|
311 |
-
#mapi-wrap tbody [data-mapiaction="getCode"] { color: #46b450; }
|
312 |
-
#mapi-wrap tbody .disabled[data-mapiaction="getCode"] { color: #a7a7a7; cursor: default; }
|
313 |
-
#mapi-wrap tbody [data-mapiaction="updateCode"] { color: #0085ba; }
|
314 |
-
#mapi-wrap #mapi-update-unit-lists { font-size: 20px; padding: 13px; position: absolute; top: 0; right: 47px; }
|
315 |
#mapi-show-idle, #mapi-hide-idle { font-size: 20px; padding: 9px; position: absolute; top: 0; right: 78px; color: #72777c; cursor: pointer; }
|
316 |
-
#mapi-wrap #mapi-list-header { font-weight: 700; display: inline-block; font-size: 13px; line-height: 1.5em; }
|
317 |
-
#mapi-wrap #mapi-list-header span { display: inline-block; padding: 8px 9px; }
|
318 |
-
#mapi-table-wrap { position: relative; }
|
319 |
-
@media( min-width: 783px ) { #mapi-wrap { padding-top: 38px; } #mapi-wrap #mapi-update-unit-lists { padding: 9px; right: 39px; } }
|
320 |
-
#mapi-table-wrap tr.selected { background-color: #dcdcfb; }
|
321 |
-
#mapi-table-wrap tr.selected td { color: #0073aa; font-weight: bold; }
|
322 |
#remote-ad-unsupported-ad-type { background-color: #f0f0f0; padding: 8px; border: 1px solid #d6d6d6; }
|
323 |
#mapi-table-wrap .unsupported { text-decoration:line-through; color:#555 }
|
324 |
#mapi-table-wrap .unsupported span { text-decoration:none;color:#555 }
|
325 |
#mapi-table-wrap table { border-left:none; border-right: none; }
|
326 |
-
#mapi-table-wrap { margin-left: -.5rem; margin-right: -.5rem; }
|
327 |
.advanced-ads-adsense-support { background-color: #fbfbfb; border: 1px solid #eee; padding: 1em; }
|
328 |
.advanced-ads-adsense-support-text { font-size: 1.4em; font-weight: 400; }
|
329 |
.advanced-ads-adsense-support .dashicons { color: #ffb900; }
|
25 |
#advads-overview #advads_overview_addons table tr.recommended th,
|
26 |
#advads-overview #advads_overview_addons table tr.free th { padding-top: 20px; }
|
27 |
#advads_overview_news .button-primary { margin-left: 0; }
|
28 |
+
#advads_overview_notices .advads-loader { display: block; margin: 0 auto; }
|
29 |
+
#advads_overview_notices #advads-support-callout p { clear: both; margin-bottom: 0; }
|
30 |
+
.advads-ad-health-notices { overflow: hidden; }
|
31 |
+
.advads-ad-health-notices li { padding: 10px; overflow: hidden; box-shadow: 0 1px 2px 0 rgba( 0, 0, 0, 0.2 ); border-left: 4px solid #fff; }
|
32 |
+
.advads-ad-health-notices li > span { float: left; display: block; }
|
33 |
+
.advads-ad-health-notices li > span.date { display: none; float: right; margin: 0 1em; color: #666; font-style: italic; }
|
34 |
+
.advads-ad-health-notices li:hover span.date { display: block; }
|
35 |
+
.advads-ad-health-notices li > button { float: right; }
|
36 |
+
.advads-ad-health-notices li > button + button { margin-right: 10px; }
|
37 |
+
.advads-ad-health-notices li a { color: inherit; }
|
38 |
+
.advads-ad-health-notices-problem li { border-left-color: #dc3232; }
|
39 |
+
.adsvads-ad-health-notices-show-hidden { text-align: right; cursor: pointer; margin-right: 10px; }
|
40 |
|
41 |
/**
|
42 |
* AD OVERVIEW PAGE
|
215 |
#advads-start-wizard.dashicons-before:before,
|
216 |
#advads-stop-wizard.dashicons-before:before { height: 15px; line-height: 0.9em; }
|
217 |
|
218 |
+
/* Ad list (AdSense, DFP, etc)*/
|
219 |
+
.aa-select-list { border: 1px solid #ddd; padding: .5rem; position: relative; display:none; overflow: hidden; }
|
220 |
+
.aa-select-list .label { font-weight:bold; display:block; margin:.75em auto .25rem; }
|
221 |
+
.aa-select-list { padding-top: 46px; }
|
222 |
+
.aa-select-list table, .aa-select-list table tbody { width: 100%; }
|
223 |
+
.aa-select-list table { margin-bottom: 10px; }
|
224 |
+
.aa-select-list tbody .dashicons { font-size: 1.2em; cursor: pointer; }
|
225 |
+
.aa-select-list thead th { font-weight: 700; }
|
226 |
+
.aa-select-list tbody .dashicons.disabled { color: #939393; }
|
227 |
+
.aa-select-list .aa-select-list-update { font-size: 20px; padding: 13px; position: absolute; top: 0; right: 47px; }
|
228 |
+
.aa-select-list .aa-select-list-header { font-weight: 700; display: inline-block; font-size: 13px; line-height: 1.5em; }
|
229 |
+
.aa-select-list .aa-select-list-header span { display: inline-block; padding: 8px 9px; }
|
230 |
+
.aa-select-list-table-wrap { position: relative; }
|
231 |
+
.aa-select-list-table-wrap tr.selected { background-color: #dcdcfb; }
|
232 |
+
.aa-select-list-table-wrap tr.selected td { color: #0073aa; font-weight: bold; }
|
233 |
+
.aa-select-list-table-wrap { margin-left: -.5rem; margin-right: -.5rem; }
|
234 |
+
.aa-select-list-loading-overlay { position:absolute; background-color:rgba(255,255,255,.75); top:0; right:0; bottom:0; left:0; text-align:center; z-index: 1; display:none; }
|
235 |
+
@media( min-width: 783px ) { .aa-select-list { padding-top: 38px; } .aa-select-list .aa-select-list-update { padding: 9px; right: 39px; } }
|
236 |
+
|
237 |
+
#advads-support-callout > p { color: #0073aa; }
|
238 |
+
#advads-support-callout a { text-decoration: none; }
|
239 |
+
|
240 |
/**
|
241 |
AD GROUP LIST
|
242 |
*/
|
307 |
.advads-spinner { float: none; visibility: visible; }
|
308 |
.advads-wide-input { width: 30em; }
|
309 |
|
310 |
+
/**
|
311 |
+
WELCOME PANEL
|
312 |
*/
|
|
|
|
|
313 |
.advads-admin-notice[data-notice="nl_intro"] { border: 4px solid #0073aa; }
|
314 |
+
.advads-admin-notice button.notice-dismiss:before { color: #0073aa !important; } /* needed, because some other CSS seems to override it into white */
|
315 |
#aa-welcome-panel h2 { margin: 0; font-size: 21px; font-weight: 400; line-height: 1.2; }
|
316 |
#aa-welcome-panel h3 { margin: 1.33em 0; font-size: 16px; }
|
317 |
#aa-welcome-panel li { font-size: 14px; }
|
331 |
#adsense-ad-param-error { color: red; font-weight: bold; }
|
332 |
.advads-adsense-content { width: 100%; }
|
333 |
.advads-adsense-show-code a, #mapi-open-selector a { padding: 0 10px; color: inherit; }
|
|
|
|
|
334 |
#mapi-quota-message{ color: #ef8e00; font-style: italic; font-weight: bold; }
|
335 |
+
.aa-select-list tbody [data-mapiaction="getCode"] { color: #46b450; }
|
336 |
+
.aa-select-list tbody .disabled[data-mapiaction="getCode"] { color: #a7a7a7; cursor: default; }
|
337 |
+
.aa-select-list tbody [data-mapiaction="updateCode"] { color: #0085ba; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
#mapi-show-idle, #mapi-hide-idle { font-size: 20px; padding: 9px; position: absolute; top: 0; right: 78px; color: #72777c; cursor: pointer; }
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
#remote-ad-unsupported-ad-type { background-color: #f0f0f0; padding: 8px; border: 1px solid #d6d6d6; }
|
340 |
#mapi-table-wrap .unsupported { text-decoration:line-through; color:#555 }
|
341 |
#mapi-table-wrap .unsupported span { text-decoration:none;color:#555 }
|
342 |
#mapi-table-wrap table { border-left:none; border-right: none; }
|
|
|
343 |
.advanced-ads-adsense-support { background-color: #fbfbfb; border: 1px solid #eee; padding: 1em; }
|
344 |
.advanced-ads-adsense-support-text { font-size: 1.4em; font-weight: 400; }
|
345 |
.advanced-ads-adsense-support .dashicons { color: #ffb900; }
|
admin/assets/js/admin-global.js
CHANGED
@@ -59,6 +59,45 @@ jQuery( document ).ready(function () {
|
|
59 |
});
|
60 |
|
61 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
/**
|
64 |
* DEACTIVATION FEEDBACK FORM
|
@@ -186,4 +225,104 @@ function advads_load_dashboard_rss_widget_content(){
|
|
186 |
|
187 |
}
|
188 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
59 |
});
|
60 |
|
61 |
});
|
62 |
+
/**
|
63 |
+
* Functions for Ad Health Notifications in the backend
|
64 |
+
*/
|
65 |
+
// hide button (adds item to "ignore" list)
|
66 |
+
jQuery(document).on('click', '.advads-ad-health-notice-hide', function(){
|
67 |
+
var notice = jQuery(this).parents('li');
|
68 |
+
if( notice.attr('data-notice') === undefined) return;
|
69 |
+
// var list = notice.parent( 'ul' );
|
70 |
+
var remove = jQuery( this ).hasClass( 'remove' );
|
71 |
+
|
72 |
+
// fix height to prevent the box from going smaller first, then show the "show" link and grow again
|
73 |
+
jQuery( '#advads_overview_notices' ).css( 'height', jQuery( '#advads_overview_notices' ).height() + 'px' );
|
74 |
+
|
75 |
+
var query = {
|
76 |
+
action: 'advads-ad-health-notice-hide',
|
77 |
+
notice: notice.attr('data-notice'),
|
78 |
+
nonce: advadsglobal.ajax_nonce
|
79 |
+
};
|
80 |
+
// fade out first or remove, so users can’t click twice
|
81 |
+
if( remove ){
|
82 |
+
notice.remove();
|
83 |
+
} else {
|
84 |
+
notice.hide();
|
85 |
+
}
|
86 |
+
advads_ad_health_maybe_remove_list();
|
87 |
+
// send query
|
88 |
+
jQuery.post(ajaxurl, query, function (r) {
|
89 |
+
// update number in menu
|
90 |
+
advads_ad_health_reload_number_in_menu();
|
91 |
+
// update show button
|
92 |
+
advads_ad_health_reload_show_link();
|
93 |
+
// remove the fixed height
|
94 |
+
jQuery( '#advads_overview_notices' ).css( 'height', '' );
|
95 |
+
});
|
96 |
+
});
|
97 |
+
// show all hidden notices
|
98 |
+
jQuery(document).on('click', '.adsvads-ad-health-notices-show-hidden', function(){
|
99 |
+
advads_ad_health_show_hidden();
|
100 |
+
});
|
101 |
|
102 |
/**
|
103 |
* DEACTIVATION FEEDBACK FORM
|
225 |
|
226 |
}
|
227 |
});
|
228 |
+
}
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Ad Health Notices in backend
|
232 |
+
*/
|
233 |
+
// display notices list
|
234 |
+
function advads_display_ad_health_notices(){
|
235 |
+
|
236 |
+
var query = {
|
237 |
+
action: 'advads-ad-health-notice-display',
|
238 |
+
nonce: advadsglobal.ajax_nonce
|
239 |
+
};
|
240 |
+
|
241 |
+
var widget = jQuery( '#advads_overview_notices .main' );
|
242 |
+
|
243 |
+
// add loader icon to the widget
|
244 |
+
widget.html( '<span class="advads-loader"></span>' );
|
245 |
+
// send query
|
246 |
+
jQuery.post(ajaxurl, query, function (r) {
|
247 |
+
widget.html( r );
|
248 |
+
|
249 |
+
// update number in menu
|
250 |
+
advads_ad_health_reload_number_in_menu();
|
251 |
+
// update list headlines
|
252 |
+
advads_ad_health_maybe_remove_list();
|
253 |
+
|
254 |
+
// remove widget, if return is empty
|
255 |
+
if( r === '' ){
|
256 |
+
jQuery( '#advads_overview_notices' ).remove();
|
257 |
+
}
|
258 |
+
});
|
259 |
+
}
|
260 |
+
// push a notice to the queue
|
261 |
+
function advads_push_notice( key, attr = '' ){
|
262 |
+
|
263 |
+
var query = {
|
264 |
+
action: 'advads-ad-health-notice-push',
|
265 |
+
key: key,
|
266 |
+
attr: attr,
|
267 |
+
nonce: advadsglobal.ajax_nonce
|
268 |
+
};
|
269 |
+
// send query
|
270 |
+
jQuery.post(ajaxurl, query, function (r) {});
|
271 |
+
}
|
272 |
+
// show notices of a given type again
|
273 |
+
function advads_ad_health_show_hidden(){
|
274 |
+
var query = {
|
275 |
+
action: 'advads-ad-health-notice-unignore',
|
276 |
+
nonce: advadsglobal.ajax_nonce
|
277 |
+
};
|
278 |
+
// show all hidden
|
279 |
+
jQuery( document ).find( '#advads_overview_notices .advads-ad-health-notices > li:hidden' ).show();
|
280 |
+
// update the button
|
281 |
+
advads_ad_health_reload_show_link();
|
282 |
+
advads_ad_health_maybe_remove_list();
|
283 |
+
// send query
|
284 |
+
jQuery.post(ajaxurl, query, function (r) {
|
285 |
+
// update issue count
|
286 |
+
advads_ad_health_reload_number_in_menu();
|
287 |
+
});
|
288 |
+
};
|
289 |
+
// hide list fragments if last item was hidden/removed
|
290 |
+
function advads_ad_health_maybe_remove_list(){
|
291 |
+
// get all lists
|
292 |
+
var lists = jQuery( document ).find( '#advads_overview_notices .advads-ad-health-notices' );
|
293 |
+
|
294 |
+
// check each list separately
|
295 |
+
lists.each( function( index ) {
|
296 |
+
var list = jQuery( this );
|
297 |
+
// check if there are visible items in the list
|
298 |
+
if( list.find( 'li:visible' ).length ){
|
299 |
+
// show parent headline
|
300 |
+
list.prev( 'h3' ).show();
|
301 |
+
} else {
|
302 |
+
// hide parent headline
|
303 |
+
list.prev( 'h3' ).hide();
|
304 |
+
|
305 |
+
}
|
306 |
+
});
|
307 |
+
|
308 |
+
}
|
309 |
+
// reload number of notices shown in the sidebar based on element in the problems list
|
310 |
+
function advads_ad_health_reload_number_in_menu(){
|
311 |
+
// get number of notices
|
312 |
+
var number = jQuery( document ).find( '#advads_overview_notices .advads-ad-health-notices > li:visible' ).length;
|
313 |
+
jQuery( '#toplevel_page_advanced-ads .update-count').html( number );
|
314 |
+
}
|
315 |
+
// update show X issues link – number and visibility
|
316 |
+
function advads_ad_health_reload_show_link(){
|
317 |
+
// get number of invisible elements
|
318 |
+
var number = jQuery( document ).find( '#advads_overview_notices .advads-ad-health-notices > li:hidden' ).length;
|
319 |
+
var show_link = jQuery( '.adsvads-ad-health-notices-show-hidden' );
|
320 |
+
// update number in the link
|
321 |
+
jQuery( '.adsvads-ad-health-notices-show-hidden span.count' ).html( number );
|
322 |
+
// hide of show, depending on number
|
323 |
+
if( 0 === number ){
|
324 |
+
show_link.hide();
|
325 |
+
} else {
|
326 |
+
show_link.show();
|
327 |
+
}
|
328 |
}
|
admin/class-advanced-ads-admin.php
CHANGED
@@ -106,9 +106,11 @@ class Advanced_Ads_Admin {
|
|
106 |
// update placements.
|
107 |
add_action( 'admin_init', array( 'Advanced_Ads_Placements', 'update_placements' ) );
|
108 |
|
109 |
-
//
|
110 |
-
|
111 |
-
|
|
|
|
|
112 |
// add links to plugin page.
|
113 |
add_filter( 'plugin_action_links_' . ADVADS_BASE, array( $this, 'add_plugin_links' ) );
|
114 |
|
@@ -200,7 +202,7 @@ class Advanced_Ads_Admin {
|
|
200 |
'ajax_nonce' => wp_create_nonce( 'advanced-ads-admin-ajax-nonce' ),
|
201 |
);
|
202 |
wp_localize_script( $this->plugin_slug . '-admin-global-script', 'advadsglobal', $params );
|
203 |
-
|
204 |
if ( self::screen_belongs_to_advanced_ads() ) {
|
205 |
wp_register_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-button' ), ADVADS_VERSION, false );
|
206 |
wp_register_script( $this->plugin_slug . '-wizard-script', plugins_url( 'assets/js/wizard.js', __FILE__ ), array( 'jquery' ), ADVADS_VERSION, false );
|
@@ -248,7 +250,7 @@ class Advanced_Ads_Admin {
|
|
248 |
* @return bool true if screen belongs to Advanced Ads
|
249 |
*/
|
250 |
public static function screen_belongs_to_advanced_ads() {
|
251 |
-
|
252 |
if ( ! function_exists( 'get_current_screen' ) ) {
|
253 |
return false;
|
254 |
}
|
@@ -257,7 +259,7 @@ class Advanced_Ads_Admin {
|
|
257 |
if ( ! isset( $screen->id ) ) {
|
258 |
return false;
|
259 |
}
|
260 |
-
|
261 |
$advads_pages = apply_filters(
|
262 |
'advanced-ads-dashboard-screens', array(
|
263 |
'advanced-ads_page_advanced-ads-groups', // ad groups.
|
@@ -337,6 +339,24 @@ class Advanced_Ads_Admin {
|
|
337 |
}
|
338 |
return 'UTC+0';
|
339 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
|
341 |
/**
|
342 |
* Initiate the admin notices class
|
@@ -351,10 +371,16 @@ class Advanced_Ads_Admin {
|
|
351 |
include ADVADS_BASE_PATH . 'admin/views/notices/jqueryui_error.php';
|
352 |
}
|
353 |
}
|
354 |
-
|
355 |
-
|
|
|
|
|
|
|
356 |
$this->notices = Advanced_Ads_Admin_Notices::get_instance()->notices;
|
357 |
Advanced_Ads_Admin_Notices::get_instance()->display_notices();
|
|
|
|
|
|
|
358 |
}
|
359 |
}
|
360 |
|
106 |
// update placements.
|
107 |
add_action( 'admin_init', array( 'Advanced_Ads_Placements', 'update_placements' ) );
|
108 |
|
109 |
+
// add Advanced Ads admin notices
|
110 |
+
// removes admin notices from other plugins
|
111 |
+
// `in_admin_header` is the last hook to run before àdmin_notices` according to https://codex.wordpress.org/Plugin_API/Action_Reference
|
112 |
+
add_action( 'in_admin_header', array( $this, 'register_admin_notices' ) );
|
113 |
+
|
114 |
// add links to plugin page.
|
115 |
add_filter( 'plugin_action_links_' . ADVADS_BASE, array( $this, 'add_plugin_links' ) );
|
116 |
|
202 |
'ajax_nonce' => wp_create_nonce( 'advanced-ads-admin-ajax-nonce' ),
|
203 |
);
|
204 |
wp_localize_script( $this->plugin_slug . '-admin-global-script', 'advadsglobal', $params );
|
205 |
+
|
206 |
if ( self::screen_belongs_to_advanced_ads() ) {
|
207 |
wp_register_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-button' ), ADVADS_VERSION, false );
|
208 |
wp_register_script( $this->plugin_slug . '-wizard-script', plugins_url( 'assets/js/wizard.js', __FILE__ ), array( 'jquery' ), ADVADS_VERSION, false );
|
250 |
* @return bool true if screen belongs to Advanced Ads
|
251 |
*/
|
252 |
public static function screen_belongs_to_advanced_ads() {
|
253 |
+
|
254 |
if ( ! function_exists( 'get_current_screen' ) ) {
|
255 |
return false;
|
256 |
}
|
259 |
if ( ! isset( $screen->id ) ) {
|
260 |
return false;
|
261 |
}
|
262 |
+
|
263 |
$advads_pages = apply_filters(
|
264 |
'advanced-ads-dashboard-screens', array(
|
265 |
'advanced-ads_page_advanced-ads-groups', // ad groups.
|
339 |
}
|
340 |
return 'UTC+0';
|
341 |
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Registers Advanced Ads admin notices
|
345 |
+
* prevents other notices from showing up on our own pages
|
346 |
+
*/
|
347 |
+
public function register_admin_notices(){
|
348 |
+
|
349 |
+
/**
|
350 |
+
* remove all registered admin_notices from AA screens
|
351 |
+
* - we need to use this or some users have half or more of their viewports cluttered with unrelated notices
|
352 |
+
*/
|
353 |
+
if ( $this->screen_belongs_to_advanced_ads() ) {
|
354 |
+
remove_all_actions( 'admin_notices' );
|
355 |
+
}
|
356 |
+
|
357 |
+
// register our own notices
|
358 |
+
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
|
359 |
+
}
|
360 |
|
361 |
/**
|
362 |
* Initiate the admin notices class
|
371 |
include ADVADS_BASE_PATH . 'admin/views/notices/jqueryui_error.php';
|
372 |
}
|
373 |
}
|
374 |
+
|
375 |
+
// register our own notices on Advanced Ads pages, except from the overview page where they should appear in the notices section
|
376 |
+
$screen = get_current_screen();
|
377 |
+
if ( current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) )
|
378 |
+
&& ( ! isset( $screen->id ) || 'toplevel_page_advanced-ads' !== $screen->id ) ) {
|
379 |
$this->notices = Advanced_Ads_Admin_Notices::get_instance()->notices;
|
380 |
Advanced_Ads_Admin_Notices::get_instance()->display_notices();
|
381 |
+
|
382 |
+
// allow other Advanced Ads plugins to show admin notices at this late stage
|
383 |
+
do_action( 'advanced-ads-admin-notices');
|
384 |
}
|
385 |
}
|
386 |
|
admin/includes/ad-health-notices.php
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Array with ad health messages
|
4 |
+
*
|
5 |
+
* attribute: type
|
6 |
+
* - "notice" (default, recommendation, etc.)
|
7 |
+
* - "problem" (critical)
|
8 |
+
*
|
9 |
+
* attribute: can_hide
|
10 |
+
* (user can hide this warning, default: true)
|
11 |
+
*
|
12 |
+
* attribute: hide
|
13 |
+
* (how to handle click on "hide" button)
|
14 |
+
* - true (default, hide the item)
|
15 |
+
* - false (remove the item completely from list of notifications)
|
16 |
+
*/
|
17 |
+
$advanced_ads_ad_health_notices = apply_filters( 'advanced-ads-ad-health-notices', array(
|
18 |
+
// old PHP version
|
19 |
+
// checked using Advanced_Ads_Checks::php_version_minimum().
|
20 |
+
'old_php' => array(
|
21 |
+
'text' => sprintf(
|
22 |
+
// translators: %1$s is a version number.
|
23 |
+
__( 'Your <strong>PHP version (%1$s) is too low</strong>. Advanced Ads is built for PHP %2$s and higher. It might work, but updating PHP is highly recommended. Please ask your hosting provider for more information.', 'advanced-ads' ),
|
24 |
+
phpversion(),
|
25 |
+
Advanced_Ads_Checks::MINIMUM_PHP_VERSION
|
26 |
+
),
|
27 |
+
'type' => 'problem',
|
28 |
+
),
|
29 |
+
// cache enabled, but not Advanced Ads Pro
|
30 |
+
// checked using Advanced_Ads_Checks::cache() && ! defined( 'AAP_VERSION' ).
|
31 |
+
'cache_no_pro' => array(
|
32 |
+
'text' => sprintf(
|
33 |
+
// translators: %s is a target URL.
|
34 |
+
__( 'Your <strong>website uses cache</strong>. Some dynamic features like ad rotation or visitor conditions might not work properly. Use the cache-busting feature of <a href="%s" target="_blank">Advanced Ads Pro</a> to load ads dynamically.', 'advanced-ads' ),
|
35 |
+
ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=error-cache'
|
36 |
+
),
|
37 |
+
'type' => 'problem',
|
38 |
+
),
|
39 |
+
// updates for Advanced Ads plugins are available
|
40 |
+
// checked using Advanced_Ads_Checks::plugin_updates_available().
|
41 |
+
'plugin_updates_available' => array(
|
42 |
+
'text' => __( 'There are <strong>plugin updates available</strong>. Please update.', 'advanced-ads' ),
|
43 |
+
'type' => 'problem',
|
44 |
+
'hide' => false,
|
45 |
+
),
|
46 |
+
// Autoptimize found, but no Advanced Ads Pro
|
47 |
+
// Advanced_Ads_Checks::active_autoptimize() && ! defined( 'AAP_VERSION' ) ).
|
48 |
+
'autoptimize_no_pro' => array(
|
49 |
+
'text' => sprintf(
|
50 |
+
// translators: %s is a target URL.
|
51 |
+
__( '<strong>Autoptimize plugin detected</strong>. While this plugin is great for site performance, it is known to alter code, including scripts from ad networks. <a href="%s" target="_blank">Advanced Ads Pro</a> has a build-in support for Autoptimize.', 'advanced-ads' ),
|
52 |
+
ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=error-autoptimize'
|
53 |
+
),
|
54 |
+
'type' => 'problem',
|
55 |
+
),
|
56 |
+
// conflicting plugins found
|
57 |
+
// Advanced_Ads_Checks::conflicting_plugins().
|
58 |
+
'conflicting_plugins' => array(
|
59 |
+
'text' => sprintf(
|
60 |
+
// translators: %1$s is a list of plugin names; %2$s a target URL.
|
61 |
+
__( 'Plugins that are known to cause (partial) problems: <strong>%1$s</strong>. <a href="%2$s" target="_blank">Learn more</a>.', 'advanced-ads' ),
|
62 |
+
implode( ', ', Advanced_Ads_Checks::conflicting_plugins() ),
|
63 |
+
ADVADS_URL . 'manual/known-plugin-conflicts/#utm_source=advanced-ads&utm_medium=link&utm_campaign=error-plugin-conflicts'
|
64 |
+
),
|
65 |
+
'type' => 'problem',
|
66 |
+
),
|
67 |
+
// PHP extensions missing
|
68 |
+
// Advanced_Ads_Checks::php_extensions().
|
69 |
+
'php_extensions_missing' => array(
|
70 |
+
'text' => sprintf(
|
71 |
+
// translators: %s is a list of PHP extensions.
|
72 |
+
__( 'Missing PHP extensions could cause issues. Please ask your hosting provider to enable them: %s', 'advanced-ads' ),
|
73 |
+
implode( ", ", Advanced_Ads_Checks::php_extensions() )
|
74 |
+
),
|
75 |
+
'type' => 'problem',
|
76 |
+
),
|
77 |
+
// ads are disabled
|
78 |
+
// Advanced_Ads_Checks::ads_disabled().
|
79 |
+
'ads_disabled' => array(
|
80 |
+
'text' => sprintf(
|
81 |
+
// translators: %s is a target URL.
|
82 |
+
__( 'Ads are disabled for all or some pages. See "disabled ads" in <a href="%s">settings</a>.', 'advanced-ads' ),
|
83 |
+
admin_url( 'admin.php?page=advanced-ads-settings#top#general' )
|
84 |
+
),
|
85 |
+
'type' => 'problem',
|
86 |
+
'can_hide' => false,
|
87 |
+
),
|
88 |
+
// user is on wordpress.com
|
89 |
+
// defined( 'IS_WPCOM' ).
|
90 |
+
'wp_com' => array(
|
91 |
+
'text' => __( 'This site is hosted on wordpress.com.', 'advanced-ads' ),
|
92 |
+
'type' => 'problem',
|
93 |
+
),
|
94 |
+
// check if Advanced Ads related constants are enabled
|
95 |
+
// Advanced_Ads_Checks::get_defined_constants().
|
96 |
+
'constants_enabled' => array(
|
97 |
+
'text' => '<a href="' . admin_url( 'admin.php?page=advanced-ads-settings#top#support' ) . '">' . esc_html__( 'Advanced Ads related constants enabled', 'advanced-ads' ) . '</a>',
|
98 |
+
'type' => 'notice',
|
99 |
+
),
|
100 |
+
// possible JavaScript conflicts
|
101 |
+
// Advanced_Ads_Checks::jquery_ui_conflict().
|
102 |
+
'jquery_ui_conflict' => array(
|
103 |
+
'text' => sprintf(
|
104 |
+
// translators: %s is a target URL.
|
105 |
+
__( 'Possible conflict between jQueryUI library, used by Advanced Ads and other libraries (probably <a href="%s">Twitter Bootstrap</a>). This might lead to misfortunate formats in forms, but should not damage features.', 'advanced-ads' ),
|
106 |
+
'http://getbootstrap.com/javascript/#js-noconflict'
|
107 |
+
),
|
108 |
+
'type' => 'problem',
|
109 |
+
),
|
110 |
+
// adblocker assets expired
|
111 |
+
// Advanced_Ads_Checks::assets_expired().
|
112 |
+
'assets_expired' => array(
|
113 |
+
'text' => sprintf(
|
114 |
+
// translators: %s is a target URL.
|
115 |
+
__( 'Some assets were changed. Please <strong>rebuild the asset folder</strong> in the <a href="%s">Advanced Ads settings</a> to update the ad blocker disguise.', 'advanced-ads' ),
|
116 |
+
admin_url( 'admin.php?page=advanced-ads-settings' )
|
117 |
+
),
|
118 |
+
'type' => 'problem',
|
119 |
+
'hide' => true,
|
120 |
+
),
|
121 |
+
// missing license codes
|
122 |
+
// Advanced_Ads_Checks::license_invalid().
|
123 |
+
'license_invalid' => array(
|
124 |
+
'text' => __( 'One or more license keys for <strong>Advanced Ads add-ons are invalid or missing</strong>.', 'advanced-ads' ) . ' '
|
125 |
+
. sprintf(
|
126 |
+
// translators: %s is a target URL.
|
127 |
+
__( 'Please add valid license keys <a href="%s">here</a>.', 'advanced-ads' ),
|
128 |
+
get_admin_url( 1, 'admin.php?page=advanced-ads-settings#top#licenses' )
|
129 |
+
),
|
130 |
+
'type' => 'problem',
|
131 |
+
'can_hide' => false,
|
132 |
+
),
|
133 |
+
// an individual ad expired.
|
134 |
+
'ad_expired' => array(
|
135 |
+
'text' => __( 'Ad expired', 'advanced-ads' ) . ': ',
|
136 |
+
'type' => 'notice',
|
137 |
+
'hide' => false,
|
138 |
+
),
|
139 |
+
// an individual ad expired
|
140 |
+
// is checked in the frontend by Ad Health in Advanced_Ads_Frontend_Checks::can_use_head_placement().
|
141 |
+
'ad_with_output_in_head' => array(
|
142 |
+
// we keep the %s here and replace it with an empty string, because we use it somewhere else and don’t want to create a new string that is basically the same.
|
143 |
+
'text' => sprintf(
|
144 |
+
// translators: %s is empty here, but the string will be followed by a name of an ad unit.
|
145 |
+
__( 'Visible ads should not use the Header placement: %s', 'advanced-ads' ),
|
146 |
+
''
|
147 |
+
),
|
148 |
+
'type' => 'notice',
|
149 |
+
'hide' => false,
|
150 |
+
),
|
151 |
+
// ad AdSense ad was hidden in the frontend using CSS
|
152 |
+
// check in Ad Health in frontend.
|
153 |
+
'adsense_hidden' => array(
|
154 |
+
// we keep the %s here and replace it with an empty string, because we use it somewhere else and don’t want to create a new string that is basically the same.
|
155 |
+
'text' => sprintf(
|
156 |
+
'%s: %s.',
|
157 |
+
__( 'AdSense violation', 'advanced-ads' ),
|
158 |
+
__( 'Ad is hidden', 'advanced-ads' )
|
159 |
+
),
|
160 |
+
'type' => 'problem',
|
161 |
+
'hide' => false,
|
162 |
+
),
|
163 |
+
// Ad has HTTP, but site uses HTTPS
|
164 |
+
// check in Ad Health in frontend.
|
165 |
+
'ad_has_http' => array(
|
166 |
+
'text' => __( 'Your website is using HTTPS, but the ad code contains HTTP and might not work.', 'advanced-ads' ),
|
167 |
+
'type' => 'notice',
|
168 |
+
'hide' => false,
|
169 |
+
),
|
170 |
+
// dummy text for general AdSense issue.
|
171 |
+
'adsense_issue' => array(
|
172 |
+
// we keep the %s here and replace it with an empty string, because we use it somewhere else and don’t want to create a new string that is basically the same.
|
173 |
+
'text' => __( 'AdSense issue' ),
|
174 |
+
'type' => 'problem',
|
175 |
+
),
|
176 |
+
// no ads created, yet.
|
177 |
+
'no_ads' => array(
|
178 |
+
// we keep the %s here and replace it with an empty string, because we use it somewhere else and don’t want to create a new string that is basically the same.
|
179 |
+
'text' => '<a href="' . admin_url( 'post-new.php?post_type=' . Advanced_Ads::POST_TYPE_SLUG ) . '">' . __( 'Create your first ad', 'advanced-ads' ) . '</a>.',
|
180 |
+
'type' => 'notice',
|
181 |
+
),
|
182 |
+
)
|
183 |
+
);
|
admin/includes/class-menu.php
CHANGED
@@ -48,11 +48,17 @@ class Advanced_Ads_Admin_Menu {
|
|
48 |
public function add_plugin_admin_menu() {
|
49 |
|
50 |
$has_ads = Advanced_Ads::get_number_of_ads();
|
|
|
|
|
|
|
51 |
|
52 |
// use the overview page only when there is an ad already
|
53 |
if( $has_ads ){
|
54 |
add_menu_page(
|
55 |
-
__( 'Overview', 'advanced-ads' ),
|
|
|
|
|
|
|
56 |
);
|
57 |
}
|
58 |
// forward Ads link to new-ad page when there is no ad existing yet.
|
@@ -109,7 +115,18 @@ class Advanced_Ads_Admin_Menu {
|
|
109 |
admin_url( 'admin.php?page=advanced-ads-settings#top#support' ),
|
110 |
__('Support', 'advanced-ads' ), // not sure what this is, but it is in the API
|
111 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
|
|
113 |
|
114 |
// allows extensions to insert sub menu pages
|
115 |
do_action( 'advanced-ads-submenu-pages', $this->plugin_slug );
|
48 |
public function add_plugin_admin_menu() {
|
49 |
|
50 |
$has_ads = Advanced_Ads::get_number_of_ads();
|
51 |
+
|
52 |
+
// get number of ad health notices
|
53 |
+
$notices = Advanced_Ads_Ad_Health_Notices::get_number_of_notices();
|
54 |
|
55 |
// use the overview page only when there is an ad already
|
56 |
if( $has_ads ){
|
57 |
add_menu_page(
|
58 |
+
__( 'Overview', 'advanced-ads' ),
|
59 |
+
'Advanced Ads',
|
60 |
+
//sprintf( 'Advanced Ads' . '<span class="update-plugins count-' . $notices. '"><span class="update-count">' . $notices . '</span></span>' ),
|
61 |
+
Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface'), $this->plugin_slug, array($this, 'display_overview_page'), 'dashicons-chart-line', '58.74'
|
62 |
);
|
63 |
}
|
64 |
// forward Ads link to new-ad page when there is no ad existing yet.
|
115 |
admin_url( 'admin.php?page=advanced-ads-settings#top#support' ),
|
116 |
__('Support', 'advanced-ads' ), // not sure what this is, but it is in the API
|
117 |
);
|
118 |
+
global $menu;
|
119 |
+
// manipulate the title of the overview page and add error count
|
120 |
+
if( isset( $menu[ '58.74' ][ 0 ] ) ){
|
121 |
+
$menu[ '58.74' ][ 0 ] .= ' <span class="update-plugins count-' . $notices. '"><span class="update-count">' . $notices . '</span></span>';
|
122 |
+
}
|
123 |
+
/*if( $has_ads ){
|
124 |
+
$submenu['advanced-ads'][0][0] .= ' <span class="update-plugins count-' . $notices. '"><span class="update-count">' . $notices . '</span></span>';
|
125 |
+
} else {
|
126 |
+
$submenu['advanced-ads'][1][0] .= ' <span class="update-plugins count-' . $notices. '"><span class="update-count">' . $notices . '</span></span>';
|
127 |
+
}*/
|
128 |
}
|
129 |
+
|
130 |
|
131 |
// allows extensions to insert sub menu pages
|
132 |
do_action( 'advanced-ads-submenu-pages', $this->plugin_slug );
|
admin/includes/class-meta-box.php
CHANGED
@@ -465,7 +465,18 @@ class Advanced_Ads_Admin_Meta_Boxes {
|
|
465 |
wp_widget_rss_output( $_feed['url'], $_feed );
|
466 |
echo '</div>';
|
467 |
}
|
468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
die();
|
470 |
}
|
471 |
|
465 |
wp_widget_rss_output( $_feed['url'], $_feed );
|
466 |
echo '</div>';
|
467 |
}
|
468 |
+
|
469 |
+
$feed_content = ob_get_clean();
|
470 |
+
$error_string = '<strong>' . __( 'RSS Error:' ) . '</strong> ';
|
471 |
+
|
472 |
+
// empty the widget content, if we find the error string in it
|
473 |
+
if( strpos( $feed_content, $error_string ) ){
|
474 |
+
$feed_content = '';
|
475 |
+
}
|
476 |
+
|
477 |
+
echo $feed_content;
|
478 |
+
|
479 |
+
set_transient( $cache_key, $feed_content, 48 * HOUR_IN_SECONDS ); // Default lifetime in cache of 48 hours
|
480 |
die();
|
481 |
}
|
482 |
|
admin/includes/class-notices.php
CHANGED
@@ -86,8 +86,6 @@ class Advanced_Ads_Admin_Notices {
|
|
86 |
|
87 |
// check license notices
|
88 |
$this->register_license_notices();
|
89 |
-
// notice for Adblocker module
|
90 |
-
$this->check_assets_expired();
|
91 |
|
92 |
// don’t check non-critical notices if they are disabled
|
93 |
if ( ! isset($plugin_options['disable-notices']) ) {
|
@@ -205,32 +203,6 @@ class Advanced_Ads_Admin_Notices {
|
|
205 |
}
|
206 |
}
|
207 |
|
208 |
-
/**
|
209 |
-
* Notice for Adblocker module
|
210 |
-
*/
|
211 |
-
public function check_assets_expired() {
|
212 |
-
$plugin_options = $this->plugin->options();
|
213 |
-
$options = $this->options();
|
214 |
-
|
215 |
-
if ( empty ( $plugin_options['use-adblocker'] ) ) {
|
216 |
-
// check if assets expired, but user disabled Adblocker module
|
217 |
-
$key = array_search( 'assets_expired', $this->notices );
|
218 |
-
if ( $key !== false ) {
|
219 |
-
$this->remove_from_queue( 'assets_expired' );
|
220 |
-
unset( $this->notices[ $key] );
|
221 |
-
}
|
222 |
-
|
223 |
-
return;
|
224 |
-
}
|
225 |
-
|
226 |
-
$adblocker_options = Advanced_Ads_Ad_Blocker::get_instance()->options();
|
227 |
-
|
228 |
-
if ( ! in_array( 'assets_expired', $this->notices ) && ( empty ( $adblocker_options['module_can_work'] ) )
|
229 |
-
) {
|
230 |
-
$this->notices[] = 'assets_expired';
|
231 |
-
}
|
232 |
-
}
|
233 |
-
|
234 |
/**
|
235 |
* add update notices to the queue of all notices that still needs to be closed
|
236 |
*
|
86 |
|
87 |
// check license notices
|
88 |
$this->register_license_notices();
|
|
|
|
|
89 |
|
90 |
// don’t check non-critical notices if they are disabled
|
91 |
if ( ! isset($plugin_options['disable-notices']) ) {
|
203 |
}
|
204 |
}
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
/**
|
207 |
* add update notices to the queue of all notices that still needs to be closed
|
208 |
*
|
admin/includes/class-overview-widgets.php
CHANGED
@@ -23,6 +23,12 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
|
|
23 |
'hook' => 'advanced-ads-overview-below-support',
|
24 |
)
|
25 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
self::add_meta_box('advads_overview_news', __( 'Next steps', 'advanced-ads' ), 'left',
|
28 |
'render_next_steps');
|
@@ -48,6 +54,19 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
|
|
48 |
include( ADVADS_BASE_PATH . 'admin/views/overview-widget.php' );
|
49 |
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
/**
|
53 |
* render next steps widget
|
23 |
'hook' => 'advanced-ads-overview-below-support',
|
24 |
)
|
25 |
);
|
26 |
+
|
27 |
+
// show errors
|
28 |
+
if( Advanced_Ads_Ad_Health_Notices::notices_enabled()
|
29 |
+
&& Advanced_Ads_Ad_Health_Notices::get_instance()->has_notices() ){
|
30 |
+
self::add_meta_box('advads_overview_notices', false, 'full', 'render_notices' );
|
31 |
+
}
|
32 |
|
33 |
self::add_meta_box('advads_overview_news', __( 'Next steps', 'advanced-ads' ), 'left',
|
34 |
'render_next_steps');
|
54 |
include( ADVADS_BASE_PATH . 'admin/views/overview-widget.php' );
|
55 |
|
56 |
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* render Ad Health notices widget
|
60 |
+
*
|
61 |
+
* @since 1.11.x
|
62 |
+
*/
|
63 |
+
public static function render_notices(){
|
64 |
+
|
65 |
+
?><span class="advads-loader"></span>
|
66 |
+
<script>jQuery( document ).ready( function(){ advads_display_ad_health_notices(); });</script><?php
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
|
71 |
/**
|
72 |
* render next steps widget
|
admin/includes/class-settings.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
defined( 'ABSPATH'
|
3 |
|
4 |
class Advanced_Ads_Admin_Settings {
|
5 |
/**
|
@@ -9,8 +9,11 @@ class Advanced_Ads_Admin_Settings {
|
|
9 |
*/
|
10 |
protected static $instance = null;
|
11 |
|
|
|
|
|
|
|
12 |
private function __construct() {
|
13 |
-
// settings handling
|
14 |
add_action( 'admin_init', array( $this, 'settings_init' ) );
|
15 |
}
|
16 |
|
@@ -22,178 +25,202 @@ class Advanced_Ads_Admin_Settings {
|
|
22 |
public static function get_instance() {
|
23 |
// If the single instance hasn't been set, set it now.
|
24 |
if ( null == self::$instance ) {
|
25 |
-
self::$instance = new self;
|
26 |
}
|
27 |
|
28 |
return self::$instance;
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
-
*
|
33 |
*
|
34 |
* @since 1.0.1
|
35 |
*/
|
36 |
-
public function settings_init(){
|
37 |
|
38 |
-
// get settings page hook
|
39 |
$hook = Advanced_Ads_Admin::get_instance()->plugin_screen_hook_suffix;
|
40 |
|
41 |
-
// register settings
|
42 |
-
register_setting( ADVADS_SLUG, ADVADS_SLUG, array($this, 'sanitize_settings') );
|
43 |
|
44 |
-
//
|
45 |
add_settings_section(
|
46 |
'advanced_ads_setting_section',
|
47 |
-
|
48 |
-
array($this, 'render_settings_section_callback'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
$hook
|
50 |
);
|
51 |
-
|
52 |
-
// Pro pitch section
|
53 |
-
if( ! defined( 'AAP_VERSION' ) ){
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
}
|
63 |
-
|
64 |
-
// Tracking pitch section
|
65 |
-
if( ! defined( 'AAT_VERSION' ) ){
|
66 |
-
add_settings_section(
|
67 |
-
'advanced_ads_settings_tracking_pitch_section',
|
68 |
-
'',
|
69 |
-
array($this, 'render_settings_tracking_pitch_section_callback'),
|
70 |
-
'advanced-ads-settings-tracking-pitch-page'
|
71 |
-
);
|
72 |
-
|
73 |
-
add_filter( 'advanced-ads-setting-tabs', array( $this, 'tracking_pitch_tab') );
|
74 |
-
}
|
75 |
-
|
76 |
-
// licenses section only for main blog
|
77 |
-
if( is_main_site( get_current_blog_id() ) ){
|
78 |
-
// register license settings
|
79 |
-
register_setting( ADVADS_SLUG . '-licenses', ADVADS_SLUG . '-licenses' );
|
80 |
-
|
81 |
-
add_settings_section(
|
82 |
-
'advanced_ads_settings_license_section',
|
83 |
-
'', //__( 'Licenses', 'advanced-ads' ),
|
84 |
-
array($this, 'render_settings_licenses_section_callback'),
|
85 |
-
'advanced-ads-settings-license-page'
|
86 |
-
);
|
87 |
-
|
88 |
-
add_filter( 'advanced-ads-setting-tabs', array( $this, 'license_tab') );
|
89 |
-
|
90 |
-
add_settings_section(
|
91 |
-
'advanced_ads_settings_license_pitch_section',
|
92 |
-
'', //__( 'Licenses', 'advanced-ads' ),
|
93 |
-
array($this, 'render_settings_licenses_pitch_section_callback'),
|
94 |
-
'advanced-ads-settings-license-page'
|
95 |
-
);
|
96 |
}
|
97 |
|
98 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
add_settings_field(
|
100 |
'disable-ads',
|
101 |
__( 'Disable ads', 'advanced-ads' ),
|
102 |
-
array($this, 'render_settings_disable_ads'),
|
103 |
$hook,
|
104 |
-
'
|
105 |
);
|
106 |
-
// add setting fields for user role
|
107 |
add_settings_field(
|
108 |
'hide-for-user-role',
|
109 |
__( 'Hide ads for logged in users', 'advanced-ads' ),
|
110 |
-
array($this, 'render_settings_hide_for_users'),
|
111 |
$hook,
|
112 |
-
'
|
113 |
);
|
114 |
-
// add setting fields for
|
115 |
-
add_settings_field(
|
116 |
-
'activate-advanced-js',
|
117 |
-
__( 'Use advanced JavaScript', 'advanced-ads' ),
|
118 |
-
array($this, 'render_settings_advanced_js'),
|
119 |
-
$hook,
|
120 |
-
'advanced_ads_setting_section'
|
121 |
-
);
|
122 |
-
// add setting fields for content injection protection
|
123 |
add_settings_field(
|
124 |
'content-injection-everywhere',
|
125 |
__( 'Unlimited ad injection', 'advanced-ads' ),
|
126 |
-
array($this, 'render_settings_content_injection_everywhere'),
|
127 |
$hook,
|
128 |
-
'
|
129 |
);
|
130 |
-
// add setting fields for content injection priority
|
131 |
add_settings_field(
|
132 |
'content-injection-priority',
|
133 |
__( 'Priority of content injection filter', 'advanced-ads' ),
|
134 |
-
array($this, 'render_settings_content_injection_priority'),
|
135 |
$hook,
|
136 |
-
'
|
137 |
);
|
138 |
-
// add setting fields to remove injection level limitation
|
139 |
add_settings_field(
|
140 |
'content-injection-level-limitation',
|
141 |
__( 'Disable level limitation', 'advanced-ads' ),
|
142 |
-
array($this, 'render_settings_content_injection_level_limitation'),
|
143 |
$hook,
|
144 |
-
'
|
145 |
);
|
146 |
-
// add setting fields for hiding ads from bots
|
147 |
add_settings_field(
|
148 |
'block-bots',
|
149 |
__( 'Hide ads from bots', 'advanced-ads' ),
|
150 |
-
array($this, 'render_settings_block_bots'),
|
151 |
$hook,
|
152 |
-
'
|
153 |
);
|
154 |
-
// opt out from internal notices
|
155 |
add_settings_field(
|
156 |
'disable-notices',
|
157 |
-
__( 'Disable notices', 'advanced-ads' ),
|
158 |
-
array($this, 'render_settings_disabled_notices'),
|
159 |
$hook,
|
160 |
'advanced_ads_setting_section'
|
161 |
);
|
162 |
-
// opt out from internal notices
|
163 |
add_settings_field(
|
164 |
'front-prefix',
|
165 |
__( 'ID prefix', 'advanced-ads' ),
|
166 |
-
array($this, 'render_settings_front_prefix'),
|
167 |
$hook,
|
168 |
-
'
|
169 |
);
|
170 |
-
// allow editors to manage ads
|
171 |
add_settings_field(
|
172 |
'editors-manage-ads',
|
173 |
__( 'Allow editors to manage ads', 'advanced-ads' ),
|
174 |
-
array($this, 'render_settings_editors_manage_ads'),
|
175 |
$hook,
|
176 |
'advanced_ads_setting_section'
|
177 |
);
|
178 |
-
|
179 |
add_settings_field(
|
180 |
'add-custom-label',
|
181 |
__( 'Ad label', 'advanced-ads' ),
|
182 |
array( $this, 'render_settings_add_custom_label' ),
|
183 |
$hook,
|
184 |
-
'
|
185 |
);
|
186 |
-
|
187 |
-
// add setting fields
|
188 |
add_settings_field(
|
189 |
'link-target',
|
190 |
-
__('Open links in a new window', 'advanced-ads'),
|
191 |
-
array($this, 'render_settings_link_target_callback'),
|
192 |
$hook,
|
193 |
-
'
|
194 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
-
// only for main blog
|
197 |
if ( is_main_site( get_current_blog_id() ) ) {
|
198 |
add_settings_field(
|
199 |
'uninstall-delete-data',
|
@@ -204,7 +231,7 @@ class Advanced_Ads_Admin_Settings {
|
|
204 |
);
|
205 |
}
|
206 |
|
207 |
-
// allow to disable shortcode button in TinyMCE
|
208 |
add_settings_field(
|
209 |
'disable-shortcode-button',
|
210 |
__( 'Disable shortcode button', 'advanced-ads' ),
|
@@ -213,67 +240,95 @@ class Advanced_Ads_Admin_Settings {
|
|
213 |
'advanced_ads_setting_section'
|
214 |
);
|
215 |
|
216 |
-
// hook for additional settings from add-ons
|
217 |
do_action( 'advanced-ads-settings-init', $hook );
|
218 |
}
|
219 |
|
220 |
/**
|
221 |
-
*
|
222 |
*
|
223 |
-
*
|
|
|
224 |
*/
|
225 |
-
public function license_tab( array $tabs ){
|
226 |
|
227 |
$tabs['licenses'] = array(
|
228 |
-
'page'
|
229 |
'group' => ADVADS_SLUG . '-licenses',
|
230 |
'tabid' => 'licenses',
|
231 |
-
'title' => __( 'Licenses', 'advanced-ads' )
|
232 |
);
|
233 |
|
234 |
return $tabs;
|
235 |
}
|
236 |
-
|
237 |
/**
|
238 |
-
*
|
239 |
*
|
240 |
-
*
|
241 |
*/
|
242 |
-
public function pro_pitch_tab( array $tabs ){
|
243 |
|
244 |
$tabs['pro_pitch'] = array(
|
245 |
-
'page'
|
246 |
//'group' => ADVADS_SLUG . '-pro-pitch',
|
247 |
'tabid' => 'pro-pitch',
|
248 |
-
'title' => __( 'Pro', 'advanced-ads' )
|
249 |
);
|
250 |
|
251 |
return $tabs;
|
252 |
}
|
253 |
-
|
254 |
/**
|
255 |
-
*
|
256 |
*
|
257 |
-
*
|
258 |
*/
|
259 |
-
public function tracking_pitch_tab( array $tabs ){
|
260 |
|
261 |
$tabs['tracking_pitch'] = array(
|
262 |
-
'page'
|
263 |
'tabid' => 'tracking-pitch',
|
264 |
-
'title' => __( 'Tracking', 'advanced-ads' )
|
265 |
);
|
266 |
|
267 |
return $tabs;
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
-
*
|
272 |
*
|
273 |
* @since 1.1.1
|
274 |
*/
|
275 |
-
public function render_settings_section_callback(){
|
276 |
-
// for whatever purpose there might come
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
}
|
278 |
|
279 |
/**
|
@@ -281,41 +336,41 @@ class Advanced_Ads_Admin_Settings {
|
|
281 |
*
|
282 |
* @since 1.5.1
|
283 |
*/
|
284 |
-
public function render_settings_licenses_section_callback(){
|
285 |
echo '<p>' . sprintf( __( 'Enter license keys for our powerful <a href="%s" target="_blank">add-ons</a>.', 'advanced-ads' ), ADVADS_URL . 'add-ons/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses' );
|
286 |
-
echo ' ' . sprintf( __( 'See also <a href="%s" target="_blank">Issues and questions about licenses</a>.', 'advanced-ads' ), ADVADS_URL . 'manual-category/purchase-licenses/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses') . '</p>';
|
287 |
// nonce field
|
288 |
echo '<input type="hidden" id="advads-licenses-ajax-referrer" value="' . wp_create_nonce( "advads_ajax_license_nonce" ) . '"/>';
|
289 |
}
|
290 |
-
|
291 |
/**
|
292 |
* render licenses pithces settings section
|
293 |
*
|
294 |
* @since 1.8.12
|
295 |
*/
|
296 |
-
public function render_settings_licenses_pitch_section_callback(){
|
297 |
-
|
298 |
echo '<h3>' . __( 'Are you missing something?', 'advanced-ads' ) . '</h3>';
|
299 |
-
|
300 |
Advanced_Ads_Overview_Widgets_Callbacks::render_addons( $hide_activated = true );
|
301 |
}
|
302 |
-
|
303 |
/**
|
304 |
* render pro pitch settings section
|
305 |
*
|
306 |
* @since 1.8.12
|
307 |
*/
|
308 |
-
public function render_settings_pro_pitch_section_callback(){
|
309 |
echo '<br/>';
|
310 |
include ADVADS_BASE_PATH . 'admin/views/pitch-pro-tab.php';
|
311 |
}
|
312 |
-
|
313 |
/**
|
314 |
* render tracking pitch settings section
|
315 |
*
|
316 |
* @since 1.8.12
|
317 |
*/
|
318 |
-
public function render_settings_tracking_pitch_section_callback(){
|
319 |
echo '<br/>';
|
320 |
include ADVADS_BASE_PATH . 'admin/views/pitch-tracking.php';
|
321 |
}
|
@@ -325,17 +380,17 @@ class Advanced_Ads_Admin_Settings {
|
|
325 |
*
|
326 |
* @since 1.3.11
|
327 |
*/
|
328 |
-
public function render_settings_disable_ads(){
|
329 |
$options = Advanced_Ads::get_instance()->options();
|
330 |
|
331 |
-
// set the variables
|
332 |
-
$disable_all
|
333 |
-
$disable_404
|
334 |
-
$disable_archives
|
335 |
-
$disable_secondary = isset($options['disabled-ads']['secondary']) ? 1 : 0;
|
336 |
-
$disable_feed
|
337 |
|
338 |
-
// load the template
|
339 |
include ADVADS_BASE_PATH . 'admin/views/settings-disable-ads.php';
|
340 |
}
|
341 |
|
@@ -344,25 +399,25 @@ class Advanced_Ads_Admin_Settings {
|
|
344 |
*
|
345 |
* @since 1.1.1
|
346 |
*/
|
347 |
-
public function render_settings_hide_for_users(){
|
348 |
-
$options
|
349 |
-
$current_capability_role = isset($options['hide-for-user-role']) ? $options['hide-for-user-role'] : 0;
|
350 |
|
351 |
$capability_roles = array(
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
);
|
359 |
-
echo '<select name="'.ADVADS_SLUG.'[hide-for-user-role]">';
|
360 |
foreach ( $capability_roles as $_capability => $_role ) {
|
361 |
-
echo '<option value="'
|
362 |
}
|
363 |
echo '</select>';
|
364 |
|
365 |
-
echo '<p class="description">'. __( 'Choose the lowest role a user must have in order to not see any ads.', 'advanced-ads' ) .'</p>';
|
366 |
}
|
367 |
|
368 |
/**
|
@@ -370,16 +425,16 @@ class Advanced_Ads_Admin_Settings {
|
|
370 |
*
|
371 |
* @since 1.2.3
|
372 |
*/
|
373 |
-
public function render_settings_advanced_js(){
|
374 |
$options = Advanced_Ads::get_instance()->options();
|
375 |
-
$checked = ( ! empty($options['advanced-js'])) ? 1 : 0;
|
376 |
|
377 |
// display notice if js file was overridden
|
378 |
-
if( ! $checked && apply_filters( 'advanced-ads-activate-advanced-js', $checked ) ){
|
379 |
echo '<p>' . __( '<strong>notice: </strong>the file is currently enabled by an add-on that needs it.', 'advanced-ads' ) . '</p>';
|
380 |
}
|
381 |
-
echo '<input id="advanced-ads-advanced-js" type="checkbox" value="1" name="'.ADVADS_SLUG.'[advanced-js]" '.checked( $checked, 1, false ).'>';
|
382 |
-
echo '<p class="description">'. sprintf( __( 'Enable advanced JavaScript functions (<a href="%s" target="_blank">here</a>). Some features and add-ons might override this setting if they need features from this file.', 'advanced-ads' ), ADVADS_URL . 'javascript-functions/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings' ) .'</p>';
|
383 |
}
|
384 |
|
385 |
/**
|
@@ -387,19 +442,19 @@ class Advanced_Ads_Admin_Settings {
|
|
387 |
*
|
388 |
* @since 1.4.1
|
389 |
*/
|
390 |
-
public function render_settings_content_injection_everywhere(){
|
391 |
$options = Advanced_Ads::get_instance()->options();
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
echo '<input id="advanced-ads-injection-everywhere" type="number" value="' . $everywhere . '" min="-1" name="'.ADVADS_SLUG.'[content-injection-everywhere]">';
|
402 |
-
echo '<p class="description">'. __( 'Some plugins and themes trigger ad injections where it shouldn’t happen. Therefore, Advanced Ads ignores injected placements on non-singular pages and outside the loop. However, this can cause problems with some themes. Set this option to -1 in order to enable unlimited ad injection at your own risk, set it to 0 to keep it disabled or choose a positive number to enable the injection only in the first x posts on your archive pages.', 'advanced-ads' ) .'</p>';
|
403 |
|
404 |
}
|
405 |
|
@@ -408,11 +463,11 @@ class Advanced_Ads_Admin_Settings {
|
|
408 |
*
|
409 |
* @since 1.4.1
|
410 |
*/
|
411 |
-
public function render_settings_content_injection_priority(){
|
412 |
-
$options
|
413 |
-
$priority = ( isset($options['content-injection-priority'])) ? intval( $options['content-injection-priority'] ) : 100;
|
414 |
|
415 |
-
echo '<input id="advanced-ads-content-injection-priority" type="number" value="'
|
416 |
echo '<p class="description">';
|
417 |
if ( $priority < 11 ) {
|
418 |
echo '<span class="advads-error-message">' . __( 'Please check your post content. A priority of 10 and below might cause issues (wpautop function might run twice).', 'advanced-ads' ) . '</span><br />';
|
@@ -426,59 +481,63 @@ class Advanced_Ads_Admin_Settings {
|
|
426 |
*
|
427 |
* @since 1.7.22
|
428 |
*/
|
429 |
-
public function render_settings_content_injection_level_limitation(){
|
430 |
$options = Advanced_Ads::get_instance()->options();
|
431 |
-
$checked = ( ! empty($options['content-injection-level-disabled'])) ? 1 : 0;
|
432 |
|
433 |
-
echo '<input id="advanced-ads-content-injection-level-disabled" type="checkbox" value="1" name="'.ADVADS_SLUG.'[content-injection-level-disabled]" '.checked( $checked, 1, false ).'>';
|
434 |
-
echo '<p class="description">'. __( 'Advanced Ads ignores paragraphs and other elements in containers when injecting ads into the post content. Check this option to ignore this limitation and ads might show up again.', 'advanced-ads' ) . '</p>';
|
435 |
}
|
436 |
-
|
437 |
/**
|
438 |
* render setting for blocking bots
|
439 |
*
|
440 |
* @since 1.4.9
|
441 |
*/
|
442 |
-
public function render_settings_block_bots(){
|
443 |
$options = Advanced_Ads::get_instance()->options();
|
444 |
-
$checked = ( ! empty($options['block-bots'])) ? 1 : 0;
|
445 |
|
446 |
-
echo '<input id="advanced-ads-block-bots" type="checkbox" value="1" name="'.ADVADS_SLUG.'[block-bots]" '.checked( $checked, 1, false ).'>';
|
447 |
-
if( Advanced_Ads::get_instance()->is_bot() ){
|
448 |
echo '<span class="advads-error-message">' . __( 'You look like a bot', 'advanced-ads' ) . '</a>. </span>';
|
449 |
}
|
450 |
-
echo '<span class="description"><a href="'. ADVADS_URL . 'hide-ads-from-bots/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings" target="blank">'. __( 'Read this first', 'advanced-ads' ) . '</a></span>';
|
451 |
-
echo '<p class="description">'. __( 'Hide ads from crawlers, bots and empty user agents.', 'advanced-ads' ) .'</p>';
|
452 |
}
|
453 |
|
454 |
/**
|
455 |
* render setting to disable notices
|
456 |
*
|
457 |
* @since 1.5.3
|
|
|
458 |
*/
|
459 |
-
public function render_settings_disabled_notices(){
|
460 |
$options = Advanced_Ads::get_instance()->options();
|
461 |
-
$checked = ( ! empty($options['disable-notices'])) ? 1 : 0;
|
462 |
|
463 |
-
echo '<input id="advanced-ads-disabled-notices" type="checkbox" value="1" name="'.ADVADS_SLUG.'[disable-notices]" '.checked( $checked, 1, false ).'>';
|
464 |
-
echo '<p class="description">'.
|
|
|
|
|
|
|
465 |
}
|
466 |
|
467 |
/**
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
public function render_settings_front_prefix(){
|
473 |
$options = Advanced_Ads::get_instance()->options();
|
474 |
|
475 |
-
$prefix
|
476 |
-
$old_prefix = ( isset($options['id-prefix'])) ? esc_attr( $options['id-prefix'] ) : '';
|
477 |
|
478 |
-
echo '<input id="advanced-ads-front-prefix" type="text" value="'
|
479 |
// deprecated
|
480 |
-
echo '<input type="hidden" value="'
|
481 |
-
echo '<p class="description">'. __( 'Prefix of class or id attributes in the frontend. Change it if you don’t want <strong>ad blockers</strong> to mark these blocks as ads.<br/>You might need to <strong>rewrite css rules afterwards</strong>.', 'advanced-ads' ) .'</p>';
|
482 |
}
|
483 |
|
484 |
/**
|
@@ -486,39 +545,43 @@ class Advanced_Ads_Admin_Settings {
|
|
486 |
*
|
487 |
* @since 1.6.14
|
488 |
*/
|
489 |
-
public function render_settings_editors_manage_ads(){
|
490 |
$options = Advanced_Ads::get_instance()->options();
|
491 |
|
492 |
// is false by default if no options where previously set
|
493 |
-
if( isset($options['editors-manage-ads']) && $options['editors-manage-ads'] ){
|
494 |
-
|
495 |
} else {
|
496 |
-
|
497 |
}
|
498 |
|
499 |
-
echo '<input id="advanced-ads-editors-manage-ads" type="checkbox" ' . checked( $allow, true, false ) . ' name="'.ADVADS_SLUG.'[editors-manage-ads]" />';
|
500 |
-
echo '<p class="description">'. __( 'Allow editors to also manage and publish ads.', 'advanced-ads' ) .
|
501 |
-
|
502 |
}
|
503 |
|
504 |
/**
|
505 |
* render setting to add an "Advertisement" label before ads
|
506 |
*
|
507 |
*/
|
508 |
-
public function render_settings_add_custom_label(){
|
509 |
$options = Advanced_Ads::get_instance()->options();
|
510 |
|
511 |
$enabled = isset( $options['custom-label']['enabled'] );
|
512 |
-
$label
|
513 |
?>
|
514 |
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
|
|
|
|
|
|
|
|
520 |
|
521 |
-
|
522 |
}
|
523 |
|
524 |
/**
|
@@ -526,38 +589,39 @@ class Advanced_Ads_Admin_Settings {
|
|
526 |
*
|
527 |
* @since 1.8.4 – moved here from Tracking add-on
|
528 |
*/
|
529 |
-
public function render_settings_link_target_callback(){
|
530 |
-
|
531 |
// get option if saved for tracking
|
532 |
$options = Advanced_Ads::get_instance()->options();
|
533 |
-
if( !isset( $options['target-blank'] ) && class_exists( 'Advanced_Ads_Tracking_Plugin' ) ){
|
534 |
$tracking_options = Advanced_Ads_Tracking_Plugin::get_instance()->options();
|
535 |
-
if( isset( $tracking_options['target'] ) ){
|
536 |
$options['target-blank'] = $tracking_options['target'];
|
537 |
}
|
538 |
}
|
539 |
-
|
540 |
-
$target = isset($options['target-blank']) ? $options['target-blank'] : 0;
|
541 |
include ADVADS_BASE_PATH . 'admin/views/setting-target.php';
|
542 |
-
}
|
543 |
-
|
544 |
/**
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
public function render_settings_uninstall_delete_data(){
|
549 |
$options = Advanced_Ads::get_instance()->options();
|
550 |
$enabled = ! empty( $options['uninstall-delete-data'] ); ?>
|
551 |
|
552 |
-
|
553 |
-
|
|
|
554 |
<?php
|
555 |
}
|
556 |
|
557 |
/**
|
558 |
* Render setting to disable shortcode button.
|
559 |
*/
|
560 |
-
public function render_settings_disable_shortcode_button(){
|
561 |
$options = Advanced_Ads::get_instance()->options();
|
562 |
|
563 |
$checked = ! empty( $options['disable-shortcode-button'] );
|
@@ -570,9 +634,10 @@ class Advanced_Ads_Admin_Settings {
|
|
570 |
* sanitize plugin settings
|
571 |
*
|
572 |
* @since 1.5.1
|
|
|
573 |
* @param array $options all the options
|
574 |
*/
|
575 |
-
public function sanitize_settings($options){
|
576 |
|
577 |
// sanitize whatever option one wants to sanitize
|
578 |
|
@@ -585,10 +650,10 @@ class Advanced_Ads_Admin_Settings {
|
|
585 |
// check if editors can edit ads now and set the rights
|
586 |
// else, remove that right
|
587 |
$editor_role = get_role( 'editor' );
|
588 |
-
if( null == $editor_role ){
|
589 |
-
|
590 |
}
|
591 |
-
if( isset($options['editors-manage-ads']) && $options['editors-manage-ads'] ){
|
592 |
$editor_role->add_cap( 'advanced_ads_see_interface' );
|
593 |
$editor_role->add_cap( 'advanced_ads_edit_ads' );
|
594 |
$editor_role->add_cap( 'advanced_ads_manage_placements' );
|
@@ -602,16 +667,16 @@ class Advanced_Ads_Admin_Settings {
|
|
602 |
|
603 |
// we need 3 states: ! isset, 1, 0
|
604 |
$options['disabled-ads']['feed'] = isset( $options['disabled-ads']['feed'] ) ? 1 : 0;
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
|
616 |
return $options;
|
617 |
}
|
1 |
<?php
|
2 |
+
defined( 'ABSPATH' ) || exit;
|
3 |
|
4 |
class Advanced_Ads_Admin_Settings {
|
5 |
/**
|
9 |
*/
|
10 |
protected static $instance = null;
|
11 |
|
12 |
+
/**
|
13 |
+
* Advanced_Ads_Admin_Settings constructor.
|
14 |
+
*/
|
15 |
private function __construct() {
|
16 |
+
// settings handling.
|
17 |
add_action( 'admin_init', array( $this, 'settings_init' ) );
|
18 |
}
|
19 |
|
25 |
public static function get_instance() {
|
26 |
// If the single instance hasn't been set, set it now.
|
27 |
if ( null == self::$instance ) {
|
28 |
+
self::$instance = new self();
|
29 |
}
|
30 |
|
31 |
return self::$instance;
|
32 |
}
|
33 |
|
34 |
/**
|
35 |
+
* Initialize settings
|
36 |
*
|
37 |
* @since 1.0.1
|
38 |
*/
|
39 |
+
public function settings_init() {
|
40 |
|
41 |
+
// get settings page hook.
|
42 |
$hook = Advanced_Ads_Admin::get_instance()->plugin_screen_hook_suffix;
|
43 |
|
44 |
+
// register settings.
|
45 |
+
register_setting( ADVADS_SLUG, ADVADS_SLUG, array( $this, 'sanitize_settings' ) );
|
46 |
|
47 |
+
// "Management" settings section.
|
48 |
add_settings_section(
|
49 |
'advanced_ads_setting_section',
|
50 |
+
__( 'Admin', 'advanced-ads' ),
|
51 |
+
array( $this, 'render_settings_section_callback' ),
|
52 |
+
$hook
|
53 |
+
);
|
54 |
+
|
55 |
+
// "Disable ads" settings section.
|
56 |
+
add_settings_section(
|
57 |
+
'advanced_ads_setting_section_disable_ads',
|
58 |
+
__( 'Disable ads', 'advanced-ads' ),
|
59 |
+
array( $this, 'render_settings_section_disable_ads_callback' ),
|
60 |
+
$hook
|
61 |
+
);
|
62 |
+
|
63 |
+
// "Layout / Output" settings section.
|
64 |
+
add_settings_section(
|
65 |
+
'advanced_ads_setting_section_output',
|
66 |
+
__( 'Layout / Output', 'advanced-ads' ),
|
67 |
+
array( $this, 'render_settings_section_output_callback' ),
|
68 |
+
$hook
|
69 |
+
);
|
70 |
+
|
71 |
+
// "Content injection" settings section.
|
72 |
+
add_settings_section(
|
73 |
+
'advanced_ads_setting_section_injection',
|
74 |
+
__( 'Content injection', 'advanced-ads' ),
|
75 |
+
array( $this, 'render_settings_section_injection_callback' ),
|
76 |
$hook
|
77 |
);
|
78 |
+
|
79 |
+
// Pro pitch section.
|
80 |
+
if ( ! defined( 'AAP_VERSION' ) ) {
|
81 |
+
add_settings_section(
|
82 |
+
'advanced_ads_settings_pro_pitch_section',
|
83 |
+
'',
|
84 |
+
array( $this, 'render_settings_pro_pitch_section_callback' ),
|
85 |
+
'advanced-ads-settings-pro-pitch-page'
|
86 |
+
);
|
87 |
+
|
88 |
+
add_filter( 'advanced-ads-setting-tabs', array( $this, 'pro_pitch_tab' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
}
|
90 |
|
91 |
+
// Tracking pitch section.
|
92 |
+
if ( ! defined( 'AAT_VERSION' ) ) {
|
93 |
+
add_settings_section(
|
94 |
+
'advanced_ads_settings_tracking_pitch_section',
|
95 |
+
'',
|
96 |
+
array( $this, 'render_settings_tracking_pitch_section_callback' ),
|
97 |
+
'advanced-ads-settings-tracking-pitch-page'
|
98 |
+
);
|
99 |
+
|
100 |
+
add_filter( 'advanced-ads-setting-tabs', array( $this, 'tracking_pitch_tab' ) );
|
101 |
+
}
|
102 |
+
|
103 |
+
// licenses section only for main blog.
|
104 |
+
if ( is_main_site( get_current_blog_id() ) ) {
|
105 |
+
// register license settings.
|
106 |
+
register_setting( ADVADS_SLUG . '-licenses', ADVADS_SLUG . '-licenses' );
|
107 |
+
|
108 |
+
add_settings_section(
|
109 |
+
'advanced_ads_settings_license_section',
|
110 |
+
'',
|
111 |
+
array( $this, 'render_settings_licenses_section_callback' ),
|
112 |
+
'advanced-ads-settings-license-page'
|
113 |
+
);
|
114 |
+
|
115 |
+
add_filter( 'advanced-ads-setting-tabs', array( $this, 'license_tab' ) );
|
116 |
+
|
117 |
+
add_settings_section(
|
118 |
+
'advanced_ads_settings_license_pitch_section',
|
119 |
+
'',
|
120 |
+
array( $this, 'render_settings_licenses_pitch_section_callback' ),
|
121 |
+
'advanced-ads-settings-license-page'
|
122 |
+
);
|
123 |
+
}
|
124 |
+
|
125 |
+
// add setting fields to disable ads.
|
126 |
add_settings_field(
|
127 |
'disable-ads',
|
128 |
__( 'Disable ads', 'advanced-ads' ),
|
129 |
+
array( $this, 'render_settings_disable_ads' ),
|
130 |
$hook,
|
131 |
+
'advanced_ads_setting_section_disable_ads'
|
132 |
);
|
133 |
+
// add setting fields for user role.
|
134 |
add_settings_field(
|
135 |
'hide-for-user-role',
|
136 |
__( 'Hide ads for logged in users', 'advanced-ads' ),
|
137 |
+
array( $this, 'render_settings_hide_for_users' ),
|
138 |
$hook,
|
139 |
+
'advanced_ads_setting_section_disable_ads'
|
140 |
);
|
141 |
+
// add setting fields for content injection protection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
add_settings_field(
|
143 |
'content-injection-everywhere',
|
144 |
__( 'Unlimited ad injection', 'advanced-ads' ),
|
145 |
+
array( $this, 'render_settings_content_injection_everywhere' ),
|
146 |
$hook,
|
147 |
+
'advanced_ads_setting_section_injection'
|
148 |
);
|
149 |
+
// add setting fields for content injection priority.
|
150 |
add_settings_field(
|
151 |
'content-injection-priority',
|
152 |
__( 'Priority of content injection filter', 'advanced-ads' ),
|
153 |
+
array( $this, 'render_settings_content_injection_priority' ),
|
154 |
$hook,
|
155 |
+
'advanced_ads_setting_section_injection'
|
156 |
);
|
157 |
+
// add setting fields to remove injection level limitation.
|
158 |
add_settings_field(
|
159 |
'content-injection-level-limitation',
|
160 |
__( 'Disable level limitation', 'advanced-ads' ),
|
161 |
+
array( $this, 'render_settings_content_injection_level_limitation' ),
|
162 |
$hook,
|
163 |
+
'advanced_ads_setting_section_injection'
|
164 |
);
|
165 |
+
// add setting fields for hiding ads from bots.
|
166 |
add_settings_field(
|
167 |
'block-bots',
|
168 |
__( 'Hide ads from bots', 'advanced-ads' ),
|
169 |
+
array( $this, 'render_settings_block_bots' ),
|
170 |
$hook,
|
171 |
+
'advanced_ads_setting_section_disable_ads'
|
172 |
);
|
173 |
+
// opt out from internal notices.
|
174 |
add_settings_field(
|
175 |
'disable-notices',
|
176 |
+
__( 'Disable Ad Health and other notices', 'advanced-ads' ),
|
177 |
+
array( $this, 'render_settings_disabled_notices' ),
|
178 |
$hook,
|
179 |
'advanced_ads_setting_section'
|
180 |
);
|
181 |
+
// opt out from internal notices.
|
182 |
add_settings_field(
|
183 |
'front-prefix',
|
184 |
__( 'ID prefix', 'advanced-ads' ),
|
185 |
+
array( $this, 'render_settings_front_prefix' ),
|
186 |
$hook,
|
187 |
+
'advanced_ads_setting_section_output'
|
188 |
);
|
189 |
+
// allow editors to manage ads.
|
190 |
add_settings_field(
|
191 |
'editors-manage-ads',
|
192 |
__( 'Allow editors to manage ads', 'advanced-ads' ),
|
193 |
+
array( $this, 'render_settings_editors_manage_ads' ),
|
194 |
$hook,
|
195 |
'advanced_ads_setting_section'
|
196 |
);
|
197 |
+
// ad label.
|
198 |
add_settings_field(
|
199 |
'add-custom-label',
|
200 |
__( 'Ad label', 'advanced-ads' ),
|
201 |
array( $this, 'render_settings_add_custom_label' ),
|
202 |
$hook,
|
203 |
+
'advanced_ads_setting_section_output'
|
204 |
);
|
205 |
+
|
206 |
+
// add setting fields.
|
207 |
add_settings_field(
|
208 |
'link-target',
|
209 |
+
__( 'Open links in a new window', 'advanced-ads' ),
|
210 |
+
array( $this, 'render_settings_link_target_callback' ),
|
211 |
$hook,
|
212 |
+
'advanced_ads_setting_section_output'
|
213 |
+
);
|
214 |
+
// add setting fields for advanced js.
|
215 |
+
add_settings_field(
|
216 |
+
'activate-advanced-js',
|
217 |
+
__( 'Use advanced JavaScript', 'advanced-ads' ),
|
218 |
+
array( $this, 'render_settings_advanced_js' ),
|
219 |
+
$hook,
|
220 |
+
'advanced_ads_setting_section_output'
|
221 |
+
);
|
222 |
|
223 |
+
// only for main blog.
|
224 |
if ( is_main_site( get_current_blog_id() ) ) {
|
225 |
add_settings_field(
|
226 |
'uninstall-delete-data',
|
231 |
);
|
232 |
}
|
233 |
|
234 |
+
// allow to disable shortcode button in TinyMCE.
|
235 |
add_settings_field(
|
236 |
'disable-shortcode-button',
|
237 |
__( 'Disable shortcode button', 'advanced-ads' ),
|
240 |
'advanced_ads_setting_section'
|
241 |
);
|
242 |
|
243 |
+
// hook for additional settings from add-ons.
|
244 |
do_action( 'advanced-ads-settings-init', $hook );
|
245 |
}
|
246 |
|
247 |
/**
|
248 |
+
* Add license tab
|
249 |
*
|
250 |
+
* @param array $tabs setting tabs.
|
251 |
+
* @return array
|
252 |
*/
|
253 |
+
public function license_tab( array $tabs ) {
|
254 |
|
255 |
$tabs['licenses'] = array(
|
256 |
+
'page' => 'advanced-ads-settings-license-page',
|
257 |
'group' => ADVADS_SLUG . '-licenses',
|
258 |
'tabid' => 'licenses',
|
259 |
+
'title' => __( 'Licenses', 'advanced-ads' ),
|
260 |
);
|
261 |
|
262 |
return $tabs;
|
263 |
}
|
264 |
+
|
265 |
/**
|
266 |
+
* Add pro pitch tab
|
267 |
*
|
268 |
+
* @oaram array $tabs setting tabs
|
269 |
*/
|
270 |
+
public function pro_pitch_tab( array $tabs ) {
|
271 |
|
272 |
$tabs['pro_pitch'] = array(
|
273 |
+
'page' => 'advanced-ads-settings-pro-pitch-page',
|
274 |
//'group' => ADVADS_SLUG . '-pro-pitch',
|
275 |
'tabid' => 'pro-pitch',
|
276 |
+
'title' => __( 'Pro', 'advanced-ads' ),
|
277 |
);
|
278 |
|
279 |
return $tabs;
|
280 |
}
|
281 |
+
|
282 |
/**
|
283 |
+
* Add tracking pitch tab
|
284 |
*
|
285 |
+
* array $tabs setting tabs
|
286 |
*/
|
287 |
+
public function tracking_pitch_tab( array $tabs ) {
|
288 |
|
289 |
$tabs['tracking_pitch'] = array(
|
290 |
+
'page' => 'advanced-ads-settings-tracking-pitch-page',
|
291 |
'tabid' => 'tracking-pitch',
|
292 |
+
'title' => __( 'Tracking', 'advanced-ads' ),
|
293 |
);
|
294 |
|
295 |
return $tabs;
|
296 |
}
|
297 |
|
298 |
/**
|
299 |
+
* Render settings section
|
300 |
*
|
301 |
* @since 1.1.1
|
302 |
*/
|
303 |
+
public function render_settings_section_callback() {
|
304 |
+
// for whatever purpose there might come.
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Render "Disable Ads" settings section
|
309 |
+
*
|
310 |
+
* @since 1.12
|
311 |
+
*/
|
312 |
+
public function render_settings_section_disable_ads_callback() {
|
313 |
+
// for whatever purpose there might come.
|
314 |
+
}
|
315 |
+
|
316 |
+
/**
|
317 |
+
* Render "Content Injection" settings section
|
318 |
+
*
|
319 |
+
* @since 1.12
|
320 |
+
*/
|
321 |
+
public function render_settings_section_output_callback() {
|
322 |
+
// for whatever purpose there might come.
|
323 |
+
}
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Render "Content Injection" settings section
|
327 |
+
*
|
328 |
+
* @since 1.12
|
329 |
+
*/
|
330 |
+
public function render_settings_section_injection_callback() {
|
331 |
+
// for whatever purpose there might come.
|
332 |
}
|
333 |
|
334 |
/**
|
336 |
*
|
337 |
* @since 1.5.1
|
338 |
*/
|
339 |
+
public function render_settings_licenses_section_callback() {
|
340 |
echo '<p>' . sprintf( __( 'Enter license keys for our powerful <a href="%s" target="_blank">add-ons</a>.', 'advanced-ads' ), ADVADS_URL . 'add-ons/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses' );
|
341 |
+
echo ' ' . sprintf( __( 'See also <a href="%s" target="_blank">Issues and questions about licenses</a>.', 'advanced-ads' ), ADVADS_URL . 'manual-category/purchase-licenses/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-licenses' ) . '</p>';
|
342 |
// nonce field
|
343 |
echo '<input type="hidden" id="advads-licenses-ajax-referrer" value="' . wp_create_nonce( "advads_ajax_license_nonce" ) . '"/>';
|
344 |
}
|
345 |
+
|
346 |
/**
|
347 |
* render licenses pithces settings section
|
348 |
*
|
349 |
* @since 1.8.12
|
350 |
*/
|
351 |
+
public function render_settings_licenses_pitch_section_callback() {
|
352 |
+
|
353 |
echo '<h3>' . __( 'Are you missing something?', 'advanced-ads' ) . '</h3>';
|
354 |
+
|
355 |
Advanced_Ads_Overview_Widgets_Callbacks::render_addons( $hide_activated = true );
|
356 |
}
|
357 |
+
|
358 |
/**
|
359 |
* render pro pitch settings section
|
360 |
*
|
361 |
* @since 1.8.12
|
362 |
*/
|
363 |
+
public function render_settings_pro_pitch_section_callback() {
|
364 |
echo '<br/>';
|
365 |
include ADVADS_BASE_PATH . 'admin/views/pitch-pro-tab.php';
|
366 |
}
|
367 |
+
|
368 |
/**
|
369 |
* render tracking pitch settings section
|
370 |
*
|
371 |
* @since 1.8.12
|
372 |
*/
|
373 |
+
public function render_settings_tracking_pitch_section_callback() {
|
374 |
echo '<br/>';
|
375 |
include ADVADS_BASE_PATH . 'admin/views/pitch-tracking.php';
|
376 |
}
|
380 |
*
|
381 |
* @since 1.3.11
|
382 |
*/
|
383 |
+
public function render_settings_disable_ads() {
|
384 |
$options = Advanced_Ads::get_instance()->options();
|
385 |
|
386 |
+
// set the variables.
|
387 |
+
$disable_all = isset( $options['disabled-ads']['all'] ) ? 1 : 0;
|
388 |
+
$disable_404 = isset( $options['disabled-ads']['404'] ) ? 1 : 0;
|
389 |
+
$disable_archives = isset( $options['disabled-ads']['archives'] ) ? 1 : 0;
|
390 |
+
$disable_secondary = isset( $options['disabled-ads']['secondary'] ) ? 1 : 0;
|
391 |
+
$disable_feed = ( ! isset( $options['disabled-ads']['feed'] ) || $options['disabled-ads']['feed'] ) ? 1 : 0;
|
392 |
|
393 |
+
// load the template.
|
394 |
include ADVADS_BASE_PATH . 'admin/views/settings-disable-ads.php';
|
395 |
}
|
396 |
|
399 |
*
|
400 |
* @since 1.1.1
|
401 |
*/
|
402 |
+
public function render_settings_hide_for_users() {
|
403 |
+
$options = Advanced_Ads::get_instance()->options();
|
404 |
+
$current_capability_role = isset( $options['hide-for-user-role'] ) ? $options['hide-for-user-role'] : 0;
|
405 |
|
406 |
$capability_roles = array(
|
407 |
+
'' => __( '(display to all)', 'advanced-ads' ),
|
408 |
+
'read' => __( 'Subscriber', 'advanced-ads' ),
|
409 |
+
'delete_posts' => __( 'Contributor', 'advanced-ads' ),
|
410 |
+
'edit_posts' => __( 'Author', 'advanced-ads' ),
|
411 |
+
'edit_pages' => __( 'Editor', 'advanced-ads' ),
|
412 |
+
'activate_plugins' => __( 'Admin', 'advanced-ads' ),
|
413 |
);
|
414 |
+
echo '<select name="' . ADVADS_SLUG . '[hide-for-user-role]">';
|
415 |
foreach ( $capability_roles as $_capability => $_role ) {
|
416 |
+
echo '<option value="' . $_capability . '" ' . selected( $_capability, $current_capability_role, false ) . '>' . $_role . '</option>';
|
417 |
}
|
418 |
echo '</select>';
|
419 |
|
420 |
+
echo '<p class="description">' . __( 'Choose the lowest role a user must have in order to not see any ads.', 'advanced-ads' ) . '</p>';
|
421 |
}
|
422 |
|
423 |
/**
|
425 |
*
|
426 |
* @since 1.2.3
|
427 |
*/
|
428 |
+
public function render_settings_advanced_js() {
|
429 |
$options = Advanced_Ads::get_instance()->options();
|
430 |
+
$checked = ( ! empty( $options['advanced-js'] ) ) ? 1 : 0;
|
431 |
|
432 |
// display notice if js file was overridden
|
433 |
+
if ( ! $checked && apply_filters( 'advanced-ads-activate-advanced-js', $checked ) ) {
|
434 |
echo '<p>' . __( '<strong>notice: </strong>the file is currently enabled by an add-on that needs it.', 'advanced-ads' ) . '</p>';
|
435 |
}
|
436 |
+
echo '<input id="advanced-ads-advanced-js" type="checkbox" value="1" name="' . ADVADS_SLUG . '[advanced-js]" ' . checked( $checked, 1, false ) . '>';
|
437 |
+
echo '<p class="description">' . sprintf( __( 'Enable advanced JavaScript functions (<a href="%s" target="_blank">here</a>). Some features and add-ons might override this setting if they need features from this file.', 'advanced-ads' ), ADVADS_URL . 'javascript-functions/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings' ) . '</p>';
|
438 |
}
|
439 |
|
440 |
/**
|
442 |
*
|
443 |
* @since 1.4.1
|
444 |
*/
|
445 |
+
public function render_settings_content_injection_everywhere() {
|
446 |
$options = Advanced_Ads::get_instance()->options();
|
447 |
+
|
448 |
+
if ( ! isset( $options['content-injection-everywhere'] ) ) {
|
449 |
+
$everywhere = 0;
|
450 |
+
} elseif ( $options['content-injection-everywhere'] === 'true' ) {
|
451 |
+
$everywhere = - 1;
|
452 |
+
} else {
|
453 |
+
$everywhere = absint( $options['content-injection-everywhere'] );
|
454 |
+
}
|
455 |
+
|
456 |
+
echo '<input id="advanced-ads-injection-everywhere" type="number" value="' . $everywhere . '" min="-1" name="' . ADVADS_SLUG . '[content-injection-everywhere]">';
|
457 |
+
echo '<p class="description">' . __( 'Some plugins and themes trigger ad injections where it shouldn’t happen. Therefore, Advanced Ads ignores injected placements on non-singular pages and outside the loop. However, this can cause problems with some themes. Set this option to -1 in order to enable unlimited ad injection at your own risk, set it to 0 to keep it disabled or choose a positive number to enable the injection only in the first x posts on your archive pages.', 'advanced-ads' ) . '</p>';
|
458 |
|
459 |
}
|
460 |
|
463 |
*
|
464 |
* @since 1.4.1
|
465 |
*/
|
466 |
+
public function render_settings_content_injection_priority() {
|
467 |
+
$options = Advanced_Ads::get_instance()->options();
|
468 |
+
$priority = ( isset( $options['content-injection-priority'] ) ) ? intval( $options['content-injection-priority'] ) : 100;
|
469 |
|
470 |
+
echo '<input id="advanced-ads-content-injection-priority" type="number" value="' . $priority . '" name="' . ADVADS_SLUG . '[content-injection-priority]" size="3"/>';
|
471 |
echo '<p class="description">';
|
472 |
if ( $priority < 11 ) {
|
473 |
echo '<span class="advads-error-message">' . __( 'Please check your post content. A priority of 10 and below might cause issues (wpautop function might run twice).', 'advanced-ads' ) . '</span><br />';
|
481 |
*
|
482 |
* @since 1.7.22
|
483 |
*/
|
484 |
+
public function render_settings_content_injection_level_limitation() {
|
485 |
$options = Advanced_Ads::get_instance()->options();
|
486 |
+
$checked = ( ! empty( $options['content-injection-level-disabled'] ) ) ? 1 : 0;
|
487 |
|
488 |
+
echo '<input id="advanced-ads-content-injection-level-disabled" type="checkbox" value="1" name="' . ADVADS_SLUG . '[content-injection-level-disabled]" ' . checked( $checked, 1, false ) . '>';
|
489 |
+
echo '<p class="description">' . __( 'Advanced Ads ignores paragraphs and other elements in containers when injecting ads into the post content. Check this option to ignore this limitation and ads might show up again.', 'advanced-ads' ) . '</p>';
|
490 |
}
|
491 |
+
|
492 |
/**
|
493 |
* render setting for blocking bots
|
494 |
*
|
495 |
* @since 1.4.9
|
496 |
*/
|
497 |
+
public function render_settings_block_bots() {
|
498 |
$options = Advanced_Ads::get_instance()->options();
|
499 |
+
$checked = ( ! empty( $options['block-bots'] ) ) ? 1 : 0;
|
500 |
|
501 |
+
echo '<input id="advanced-ads-block-bots" type="checkbox" value="1" name="' . ADVADS_SLUG . '[block-bots]" ' . checked( $checked, 1, false ) . '>';
|
502 |
+
if ( Advanced_Ads::get_instance()->is_bot() ) {
|
503 |
echo '<span class="advads-error-message">' . __( 'You look like a bot', 'advanced-ads' ) . '</a>. </span>';
|
504 |
}
|
505 |
+
echo '<span class="description"><a href="' . ADVADS_URL . 'hide-ads-from-bots/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings" target="blank">' . __( 'Read this first', 'advanced-ads' ) . '</a></span>';
|
506 |
+
echo '<p class="description">' . __( 'Hide ads from crawlers, bots and empty user agents.', 'advanced-ads' ) . '</p>';
|
507 |
}
|
508 |
|
509 |
/**
|
510 |
* render setting to disable notices
|
511 |
*
|
512 |
* @since 1.5.3
|
513 |
+
* @updated 1.13 disable Ad Health as well
|
514 |
*/
|
515 |
+
public function render_settings_disabled_notices() {
|
516 |
$options = Advanced_Ads::get_instance()->options();
|
517 |
+
$checked = ( ! empty( $options['disable-notices'] ) ) ? 1 : 0;
|
518 |
|
519 |
+
echo '<input id="advanced-ads-disabled-notices" type="checkbox" value="1" name="' . ADVADS_SLUG . '[disable-notices]" ' . checked( $checked, 1, false ) . '>';
|
520 |
+
echo '<p class="description">' . sprintf(
|
521 |
+
// translators: %1$s is a starting <a> tag and %2$s a closing one
|
522 |
+
__( 'Disable %1$sAd Health%2$s in frontend and backend, warnings and internal notices like tips, tutorials, email newsletters and update notices.', 'advanced-ads' ), '<a href="'
|
523 |
+
. ADVADS_URL . 'manual/ad-health/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-ad-health" target="_blank"> ', '</a>' ) . '</p>';
|
524 |
}
|
525 |
|
526 |
/**
|
527 |
+
* render setting for frontend prefix
|
528 |
+
*
|
529 |
+
* @since 1.6.8
|
530 |
+
*/
|
531 |
+
public function render_settings_front_prefix() {
|
532 |
$options = Advanced_Ads::get_instance()->options();
|
533 |
|
534 |
+
$prefix = Advanced_Ads_Plugin::get_instance()->get_frontend_prefix();
|
535 |
+
$old_prefix = ( isset( $options['id-prefix'] ) ) ? esc_attr( $options['id-prefix'] ) : '';
|
536 |
|
537 |
+
echo '<input id="advanced-ads-front-prefix" type="text" value="' . $prefix . '" name="' . ADVADS_SLUG . '[front-prefix]" />';
|
538 |
// deprecated
|
539 |
+
echo '<input type="hidden" value="' . $old_prefix . '" name="' . ADVADS_SLUG . '[id-prefix]" />';
|
540 |
+
echo '<p class="description">' . __( 'Prefix of class or id attributes in the frontend. Change it if you don’t want <strong>ad blockers</strong> to mark these blocks as ads.<br/>You might need to <strong>rewrite css rules afterwards</strong>.', 'advanced-ads' ) . '</p>';
|
541 |
}
|
542 |
|
543 |
/**
|
545 |
*
|
546 |
* @since 1.6.14
|
547 |
*/
|
548 |
+
public function render_settings_editors_manage_ads() {
|
549 |
$options = Advanced_Ads::get_instance()->options();
|
550 |
|
551 |
// is false by default if no options where previously set
|
552 |
+
if ( isset( $options['editors-manage-ads'] ) && $options['editors-manage-ads'] ) {
|
553 |
+
$allow = true;
|
554 |
} else {
|
555 |
+
$allow = false;
|
556 |
}
|
557 |
|
558 |
+
echo '<input id="advanced-ads-editors-manage-ads" type="checkbox" ' . checked( $allow, true, false ) . ' name="' . ADVADS_SLUG . '[editors-manage-ads]" />';
|
559 |
+
echo '<p class="description">' . __( 'Allow editors to also manage and publish ads.', 'advanced-ads' ) .
|
560 |
+
' ' . sprintf( __( 'You can assign different ad-related roles on a user basis with <a href="%s" target="_blank">Advanced Ads Pro</a>.', 'advanced-ads' ), ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings' ) . '</p>';
|
561 |
}
|
562 |
|
563 |
/**
|
564 |
* render setting to add an "Advertisement" label before ads
|
565 |
*
|
566 |
*/
|
567 |
+
public function render_settings_add_custom_label() {
|
568 |
$options = Advanced_Ads::get_instance()->options();
|
569 |
|
570 |
$enabled = isset( $options['custom-label']['enabled'] );
|
571 |
+
$label = ! empty ( $options['custom-label']['text'] ) ? esc_html( $options['custom-label']['text'] ) : _x( 'Advertisements', 'label before ads', 'advanced-ads' );
|
572 |
?>
|
573 |
|
574 |
+
<fieldset>
|
575 |
+
<input type="checkbox" <?php checked( $enabled, true ); ?> value="1"
|
576 |
+
name="<?php echo ADVADS_SLUG . '[custom-label][enabled]'; ?>"/>
|
577 |
+
<input id="advads-custom-label" type="text" value="<?php echo $label; ?>"
|
578 |
+
name="<?php echo ADVADS_SLUG . '[custom-label][text]'; ?>"/>
|
579 |
+
</fieldset>
|
580 |
+
<p class="description"><?php _e( 'Displayed above ads.', 'advanced-ads' ); ?> <a target="_blank"
|
581 |
+
href="<?php echo ADVADS_URL . 'manual/advertisement-label/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-advertisement-label' ?>"><?php _e( 'Manual', 'advanced-ads' ); ?></a>
|
582 |
+
</p>
|
583 |
|
584 |
+
<?php
|
585 |
}
|
586 |
|
587 |
/**
|
589 |
*
|
590 |
* @since 1.8.4 – moved here from Tracking add-on
|
591 |
*/
|
592 |
+
public function render_settings_link_target_callback() {
|
593 |
+
|
594 |
// get option if saved for tracking
|
595 |
$options = Advanced_Ads::get_instance()->options();
|
596 |
+
if ( ! isset( $options['target-blank'] ) && class_exists( 'Advanced_Ads_Tracking_Plugin' ) ) {
|
597 |
$tracking_options = Advanced_Ads_Tracking_Plugin::get_instance()->options();
|
598 |
+
if ( isset( $tracking_options['target'] ) ) {
|
599 |
$options['target-blank'] = $tracking_options['target'];
|
600 |
}
|
601 |
}
|
602 |
+
|
603 |
+
$target = isset( $options['target-blank'] ) ? $options['target-blank'] : 0;
|
604 |
include ADVADS_BASE_PATH . 'admin/views/setting-target.php';
|
605 |
+
}
|
606 |
+
|
607 |
/**
|
608 |
+
* render setting 'Delete data on uninstall"
|
609 |
+
*
|
610 |
+
*/
|
611 |
+
public function render_settings_uninstall_delete_data() {
|
612 |
$options = Advanced_Ads::get_instance()->options();
|
613 |
$enabled = ! empty( $options['uninstall-delete-data'] ); ?>
|
614 |
|
615 |
+
<input type="checkbox" value="1"
|
616 |
+
name="<?php echo ADVADS_SLUG; ?>[uninstall-delete-data]" <?php checked( $enabled, 1 ); ?>>
|
617 |
+
<p class="description"><?php _e( 'Clean up all data related to Advanced Ads when removing the plugin.', 'advanced-ads' ); ?></p>
|
618 |
<?php
|
619 |
}
|
620 |
|
621 |
/**
|
622 |
* Render setting to disable shortcode button.
|
623 |
*/
|
624 |
+
public function render_settings_disable_shortcode_button() {
|
625 |
$options = Advanced_Ads::get_instance()->options();
|
626 |
|
627 |
$checked = ! empty( $options['disable-shortcode-button'] );
|
634 |
* sanitize plugin settings
|
635 |
*
|
636 |
* @since 1.5.1
|
637 |
+
*
|
638 |
* @param array $options all the options
|
639 |
*/
|
640 |
+
public function sanitize_settings( $options ) {
|
641 |
|
642 |
// sanitize whatever option one wants to sanitize
|
643 |
|
650 |
// check if editors can edit ads now and set the rights
|
651 |
// else, remove that right
|
652 |
$editor_role = get_role( 'editor' );
|
653 |
+
if ( null == $editor_role ) {
|
654 |
+
return $options;
|
655 |
}
|
656 |
+
if ( isset( $options['editors-manage-ads'] ) && $options['editors-manage-ads'] ) {
|
657 |
$editor_role->add_cap( 'advanced_ads_see_interface' );
|
658 |
$editor_role->add_cap( 'advanced_ads_edit_ads' );
|
659 |
$editor_role->add_cap( 'advanced_ads_manage_placements' );
|
667 |
|
668 |
// we need 3 states: ! isset, 1, 0
|
669 |
$options['disabled-ads']['feed'] = isset( $options['disabled-ads']['feed'] ) ? 1 : 0;
|
670 |
+
|
671 |
+
if ( isset( $options['content-injection-everywhere'] ) ) {
|
672 |
+
if ( $options['content-injection-everywhere'] == 0 ) {
|
673 |
+
unset( $options['content-injection-everywhere'] );
|
674 |
+
} elseif ( $options['content-injection-everywhere'] <= - 1 ) {
|
675 |
+
$options['content-injection-everywhere'] = "true";
|
676 |
+
} else {
|
677 |
+
$options['content-injection-everywhere'] = absint( $options['content-injection-everywhere'] );
|
678 |
+
}
|
679 |
+
}
|
680 |
|
681 |
return $options;
|
682 |
}
|
admin/includes/notices.php
CHANGED
@@ -7,7 +7,7 @@ $advanced_ads_admin_notices = apply_filters( 'advanced-ads-notices', array(
|
|
7 |
'nl_intro' => array(
|
8 |
'type' => 'info',
|
9 |
// 'text' => sprintf(__( 'Advanced Ads successfully installed. <a href="%s" class="button button-primary">Create your first ad</a>', 'advanced-ads' ), admin_url( 'post-new.php?post_type=advanced_ads' )),
|
10 |
-
'text' => Advanced_Ads_Admin_Notices::get_welcome_panel(),
|
11 |
'global' => true
|
12 |
),
|
13 |
// email tutorial
|
@@ -51,12 +51,6 @@ $advanced_ads_admin_notices = apply_filters( 'advanced-ads-notices', array(
|
|
51 |
. '</p>',
|
52 |
'global' => false
|
53 |
),
|
54 |
-
// adblocker assets expired
|
55 |
-
'assets_expired' => array(
|
56 |
-
'type' => 'update',
|
57 |
-
'text' => sprintf( __('Some assets were changed. Please <strong>rebuild the asset folder</strong> in the <a href="%s">Advanced Ads settings</a> to update the ad blocker disguise.', 'advanced-ads' ), admin_url( 'admin.php?page=advanced-ads-settings' ) ),
|
58 |
-
'global' => true
|
59 |
-
),
|
60 |
// Black Friday 2018 promotion
|
61 |
'bf2018' => array(
|
62 |
'type' => 'info',
|
7 |
'nl_intro' => array(
|
8 |
'type' => 'info',
|
9 |
// 'text' => sprintf(__( 'Advanced Ads successfully installed. <a href="%s" class="button button-primary">Create your first ad</a>', 'advanced-ads' ), admin_url( 'post-new.php?post_type=advanced_ads' )),
|
10 |
+
'text' => Advanced_Ads_Admin_Notices::get_instance()->get_welcome_panel(),
|
11 |
'global' => true
|
12 |
),
|
13 |
// email tutorial
|
51 |
. '</p>',
|
52 |
'global' => false
|
53 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
// Black Friday 2018 promotion
|
55 |
'bf2018' => array(
|
56 |
'type' => 'info',
|
admin/views/ad-info-bottom.php
CHANGED
@@ -26,3 +26,11 @@ if ( $this->start_wizard_automatically() ) :
|
|
26 |
<script>jQuery( document ).ready(function ($) { advads_wizard.start() });</script>
|
27 |
<?php
|
28 |
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
<script>jQuery( document ).ready(function ($) { advads_wizard.start() });</script>
|
27 |
<?php
|
28 |
endif;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Support and review box
|
32 |
+
*/
|
33 |
+
if( ! Advanced_Ads_Plugin::any_activated_add_on() ) :
|
34 |
+
include ADVADS_BASE_PATH . 'admin/views/support-callout.php';
|
35 |
+
?><script>jQuery( document ).ready(function () { jQuery( '#advads-support-callout').insertAfter( '#ad-main-box' ); });</script>
|
36 |
+
<?php endif;
|
admin/views/checks.php
CHANGED
@@ -6,41 +6,16 @@
|
|
6 |
*/
|
7 |
|
8 |
$messages = array();
|
9 |
-
if ( ! Advanced_Ads_Checks::php_version_minimum() ) :
|
10 |
-
$messages[] = sprintf( __( 'Your <strong>PHP version (%1$s) is too low</strong>. Advanced Ads is built for PHP %2$s and higher. It might work, but updating PHP is highly recommended. Please ask your hosting provider for more information.', 'advanced-ads' ), phpversion(), Advanced_Ads_Checks::MINIMUM_PHP_VERSION );
|
11 |
-
endif;
|
12 |
-
if ( Advanced_Ads_Checks::cache() && ! defined( 'AAP_VERSION' ) ) :
|
13 |
-
$messages[] = sprintf( __( 'Your <strong>website uses cache</strong>. Some dynamic features like ad rotation or visitor conditions might not work properly. Use the cache-busting feature of <a href="%s" target="_blank">Advanced Ads Pro</a> to load ads dynamically.', 'advanced-ads' ), ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=support' );
|
14 |
-
endif;
|
15 |
-
if ( Advanced_Ads_Checks::wp_update_available() ) :
|
16 |
-
$messages[] = __( 'There is a <strong>new WordPress version available</strong>. Please update.', 'advanced-ads' );
|
17 |
-
endif;
|
18 |
-
if ( Advanced_Ads_Checks::plugin_updates_available() ) :
|
19 |
-
$messages[] = __( 'There are <strong>plugin updates available</strong>. Please update.', 'advanced-ads' );
|
20 |
-
endif;
|
21 |
-
if ( Advanced_Ads_Checks::active_autoptimize() && ! defined( 'AAP_VERSION' ) ) :
|
22 |
-
$messages[] = sprintf( __( '<strong>Autoptimize plugin detected</strong>. While this plugin is great for site performance, it is known to alter code, including scripts from ad networks. <a href="%s" target="_blank">Advanced Ads Pro</a> has a build-in support for Autoptimize.', 'advanced-ads' ), ADVADS_URL . 'add-ons/advanced-ads-pro/#utm_source=advanced-ads&utm_medium=link&utm_campaign=support' );
|
23 |
-
endif;
|
24 |
-
if ( count( Advanced_Ads_Checks::conflicting_plugins() ) ) :
|
25 |
-
$messages[] = sprintf( __( 'Plugins that are known to cause (partial) problems: <strong>%1$s</strong>. <a href="%2$s" target="_blank">Learn more</a>.', 'advanced-ads' ), implode( ', ', Advanced_Ads_Checks::conflicting_plugins() ), ADVADS_URL . 'manual/known-plugin-conflicts/#utm_source=advanced-ads&utm_medium=link&utm_campaign=support' );
|
26 |
-
endif;
|
27 |
-
if ( count( Advanced_Ads_Checks::php_extensions() ) ) :
|
28 |
-
$messages[] = sprintf( __( 'Missing PHP extensions could cause issues. Please ask your hosting provider to enable them: %s', 'advanced-ads' ), implode( ', ', Advanced_Ads_Checks::php_extensions() ) );
|
29 |
-
endif;
|
30 |
-
if ( Advanced_Ads_Checks::ads_disabled() ) :
|
31 |
-
$messages[] = sprintf( __( 'Ads are disabled for all or some pages. See "disabled ads" in <a href="%s">settings</a>.', 'advanced-ads' ), admin_url( 'admin.php?page=advanced-ads-settings#top#general' ) );
|
32 |
-
endif;
|
33 |
-
if ( defined( 'IS_WPCOM' ) ) :
|
34 |
-
$messages[] = __( 'This site is hosted on wordpress.com.', 'advanced-ads' );
|
35 |
-
endif;
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
}
|
40 |
|
41 |
-
|
|
|
|
|
|
|
42 |
|
43 |
-
|
44 |
|
45 |
if ( count( $messages ) ) :
|
46 |
?><div class="message error">
|
6 |
*/
|
7 |
|
8 |
$messages = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
// this check is left here even though we no longer show it here, but we don’t want to check it all the time on each page
|
11 |
+
Advanced_Ads_Checks::jquery_ui_conflict();
|
|
|
12 |
|
13 |
+
if( Advanced_Ads_Ad_Health_Notices::has_visible_problems() ){
|
14 |
+
$messages[] = sprintf( esc_attr__( 'Advanced Ads detected potential problems with your ad setup. %1$sShow me these errors%2$s', 'advanced-ads' ),
|
15 |
+
'<a href="'. admin_url( 'admin.php?page=advanced-ads' ) .'">', '</a>' );
|
16 |
+
}
|
17 |
|
18 |
+
$messages = apply_filters( 'advanced-ads-support-messages', $messages );
|
19 |
|
20 |
if ( count( $messages ) ) :
|
21 |
?><div class="message error">
|
admin/views/overview-notice-row.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<li data-notice="<?php echo esc_attr( $_notice_key ); ?>" <?php echo $is_hidden ? 'style="display: none;"' : ''; ?>>
|
2 |
+
<span><?php echo $text; ?></span>
|
3 |
+
<?php if ( $can_hide ) : ?>
|
4 |
+
<button type="button" class="advads-ad-health-notice-hide<?php echo ! $hide ? ' remove' : ''; ?>"><span class="dashicons dashicons-hidden"></span></button>
|
5 |
+
<?php endif; ?>
|
6 |
+
<?php if ( $date ) : ?>
|
7 |
+
<span class="date"><?php echo esc_attr( $date ); ?></span>
|
8 |
+
<?php endif; ?>
|
9 |
+
</li>
|
admin/views/overview-notices.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ( Advanced_Ads_Ad_Health_Notices::get_instance()->has_notices_by_type( 'problem' ) ) :
|
2 |
+
|
3 |
+
?><h3><?php esc_attr_e( 'Problems', 'advanceda-ads' ); ?></h3>
|
4 |
+
<?php
|
5 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->display_problems();
|
6 |
+
|
7 |
+
endif;
|
8 |
+
if ( Advanced_Ads_Ad_Health_Notices::get_instance()->has_notices_by_type( 'notice' ) ) :
|
9 |
+
|
10 |
+
?><h3><?php
|
11 |
+
esc_attr_e( 'Notifications', 'advanceda-ads' );
|
12 |
+
?>
|
13 |
+
</h3>
|
14 |
+
<?php
|
15 |
+
|
16 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->display_notices();
|
17 |
+
|
18 |
+
endif;
|
19 |
+
$ignored_count = count( Advanced_Ads_Ad_Health_Notices::get_instance()->ignore );
|
20 |
+
?>
|
21 |
+
<p class="adsvads-ad-health-notices-show-hidden" <?php echo ! $ignored_count ? 'style="display: none;"' : ''; ?>><?php
|
22 |
+
printf(
|
23 |
+
// translators: %s includes a number and markup like <span class="count">6</span>.
|
24 |
+
__( 'Show %s hidden', 'advanced-ads' ), '<span class="count">' . $ignored_count . '</span>' );
|
25 |
+
?>
|
26 |
+
<button type="button"><span class="dashicons dashicons-visibility"></span></button>
|
27 |
+
</p>
|
28 |
+
<?php
|
29 |
+
|
30 |
+
if ( Advanced_Ads_Ad_Health_Notices::has_visible_problems() ) {
|
31 |
+
include ADVADS_BASE_PATH . 'admin/views/support-callout.php';
|
32 |
+
}
|
admin/views/overview-widget.php
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
<div id="<?php echo $id; ?>" class="postbox position-<?php echo $position; ?>">
|
|
|
2 |
<h2><?php echo $title; ?></h2>
|
|
|
3 |
<div class="inside">
|
4 |
<div class="main">
|
5 |
<?php echo $content; ?>
|
1 |
<div id="<?php echo $id; ?>" class="postbox position-<?php echo $position; ?>">
|
2 |
+
<?php if( !empty( $title ) ) : ?>
|
3 |
<h2><?php echo $title; ?></h2>
|
4 |
+
<?php endif; ?>
|
5 |
<div class="inside">
|
6 |
<div class="main">
|
7 |
<?php echo $content; ?>
|
admin/views/support-callout.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="advads-support-callout">
|
2 |
+
<p>
|
3 |
+
<a href="<?php echo Advanced_Ads_Plugin::support_url( '#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-notices-support' ); ?>" target="_blank"><strong><?php _e( 'Problems or questions?', 'advanced-ads' ); ?></strong>
|
4 |
+
<?php _e( 'Save time and get personal support.', 'advanced-ads' ); ?> <strong style="text-decoration: underline;"><?php _e( 'Ask your question!', 'advanced-ads' ); ?></strong>
|
5 |
+
</a>
|
6 |
+
</p>
|
7 |
+
</div>
|
advanced-ads.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
-
* Version: 1.
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: https://wpadvancedads.com
|
18 |
* Text Domain: advanced-ads
|
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
|
|
39 |
// general and global slug, e.g. to store options in WP
|
40 |
define( 'ADVADS_SLUG', 'advanced-ads' );
|
41 |
define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
|
42 |
-
define( 'ADVADS_VERSION', '1.
|
43 |
|
44 |
/*----------------------------------------------------------------------------*
|
45 |
* Autoloading, modules and functions
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
+
* Version: 1.12
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: https://wpadvancedads.com
|
18 |
* Text Domain: advanced-ads
|
39 |
// general and global slug, e.g. to store options in WP
|
40 |
define( 'ADVADS_SLUG', 'advanced-ads' );
|
41 |
define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
|
42 |
+
define( 'ADVADS_VERSION', '1.12' );
|
43 |
|
44 |
/*----------------------------------------------------------------------------*
|
45 |
* Autoloading, modules and functions
|
classes/ad-ajax.php
CHANGED
@@ -11,6 +11,8 @@ class Advanced_Ads_Ajax {
|
|
11 |
{
|
12 |
add_action( 'wp_ajax_advads_ad_select', array( $this, 'advads_ajax_ad_select' ) );
|
13 |
add_action( 'wp_ajax_nopriv_advads_ad_select', array( $this, 'advads_ajax_ad_select' ) );
|
|
|
|
|
14 |
}
|
15 |
|
16 |
private static $instance;
|
@@ -107,4 +109,28 @@ class Advanced_Ads_Ajax {
|
|
107 |
return array( 'status' => 'error', 'message' => 'No valid ID or METHOD found.' );
|
108 |
}
|
109 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
11 |
{
|
12 |
add_action( 'wp_ajax_advads_ad_select', array( $this, 'advads_ajax_ad_select' ) );
|
13 |
add_action( 'wp_ajax_nopriv_advads_ad_select', array( $this, 'advads_ajax_ad_select' ) );
|
14 |
+
add_action( 'wp_ajax_advads-ad-health-notice-push', array( $this, 'ad_health_notice_push' ) );
|
15 |
+
add_action( 'wp_ajax_nopriv_advads-ad-health-notice-push', array( $this, 'ad_health_notice_push' ) );
|
16 |
}
|
17 |
|
18 |
private static $instance;
|
109 |
return array( 'status' => 'error', 'message' => 'No valid ID or METHOD found.' );
|
110 |
}
|
111 |
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Push an Ad Health notice to the queue in the backend
|
115 |
+
*/
|
116 |
+
public function ad_health_notice_push(){
|
117 |
+
|
118 |
+
check_ajax_referer( 'advanced-ads-ad-health-ajax-nonce', 'nonce' );
|
119 |
+
|
120 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
|
121 |
+
return;
|
122 |
+
}
|
123 |
+
|
124 |
+
$key = ( !empty( $_REQUEST['key'] ) ) ? esc_attr( $_REQUEST['key'] ) : false;
|
125 |
+
$attr = ( !empty( $_REQUEST['attr'] ) && is_array( $_REQUEST['attr'] ) ) ? $_REQUEST['attr'] : array();
|
126 |
+
|
127 |
+
// update or new entry?
|
128 |
+
if( isset( $attr['mode'] ) && 'update' === $attr['mode'] ){
|
129 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->update( $key, $attr );
|
130 |
+
} else {
|
131 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->add( $key, $attr );
|
132 |
+
}
|
133 |
+
|
134 |
+
die();
|
135 |
+
}
|
136 |
}
|
classes/ad-health-notices.php
ADDED
@@ -0,0 +1,688 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Container class for Ad Health notice handling
|
5 |
+
*
|
6 |
+
* @package WordPress
|
7 |
+
* @subpackage Advanced Ads Plugin
|
8 |
+
* @since 1.12
|
9 |
+
*
|
10 |
+
* related scripts / functions
|
11 |
+
*
|
12 |
+
* advads_push_notice() function to push notifications using AJAX in admin/assets/js/admin-global.js
|
13 |
+
* push_ad_health_notice() in Advanced_Ads_Ad_Ajax_Callbacks to push notifications sent via AJAX
|
14 |
+
* Advanced_Ads_Checks – for the various checks
|
15 |
+
* list of notification texts in admin/includes/ad-health-notices.php
|
16 |
+
*/
|
17 |
+
class Advanced_Ads_Ad_Health_Notices {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Instance of this class.
|
21 |
+
*
|
22 |
+
* @var object
|
23 |
+
*/
|
24 |
+
protected static $instance = null;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Options
|
28 |
+
*
|
29 |
+
* @var array
|
30 |
+
*/
|
31 |
+
protected $options;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* All detected notices
|
35 |
+
*
|
36 |
+
* Structure is
|
37 |
+
* [notice_key] => array(
|
38 |
+
* 'text' - if not given, it uses the default text for output )
|
39 |
+
* 'orig_key' - original notice key
|
40 |
+
* )
|
41 |
+
*
|
42 |
+
* @var array
|
43 |
+
*/
|
44 |
+
public $notices = array();
|
45 |
+
|
46 |
+
/**
|
47 |
+
* All ignored notices
|
48 |
+
*
|
49 |
+
* @var array
|
50 |
+
*/
|
51 |
+
public $ignore = array();
|
52 |
+
|
53 |
+
/**
|
54 |
+
* All displayed notices ($notices minus $hidden)
|
55 |
+
*
|
56 |
+
* @var array
|
57 |
+
*/
|
58 |
+
public $displayed_notices = array();
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Load default notices
|
62 |
+
*
|
63 |
+
* @var array
|
64 |
+
*/
|
65 |
+
public $default_notices = array();
|
66 |
+
|
67 |
+
/**
|
68 |
+
* The last notice key saved
|
69 |
+
*
|
70 |
+
* @var string
|
71 |
+
*/
|
72 |
+
public $last_saved_notice_key = false;
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Name of the transient saved for daily checks in the backend
|
76 |
+
*
|
77 |
+
* @const string
|
78 |
+
*/
|
79 |
+
const DAILY_CHECK_TRANSIENT_NAME = 'advanced-ads-daily-ad-health-check-ran';
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Plugin class
|
83 |
+
*
|
84 |
+
* @var string
|
85 |
+
*/
|
86 |
+
private $plugin;
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Advanced_Ads_Ad_Health_Notices constructor.
|
90 |
+
*/
|
91 |
+
public function __construct() {
|
92 |
+
// load default notices.
|
93 |
+
include ADVADS_BASE_PATH . '/admin/includes/ad-health-notices.php';
|
94 |
+
$this->default_notices = $advanced_ads_ad_health_notices;
|
95 |
+
|
96 |
+
// stop here if notices are disabled.
|
97 |
+
if ( ! self::notices_enabled() ) {
|
98 |
+
return;
|
99 |
+
}
|
100 |
+
|
101 |
+
// fills the class arrays.
|
102 |
+
$this->load_notices();
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Run checks
|
106 |
+
* needs to run after plugins_loaded with priority 10
|
107 |
+
* current_screen seems like the perfect hook
|
108 |
+
*/
|
109 |
+
add_action( 'current_screen', array( $this, 'run_checks' ), 20 );
|
110 |
+
|
111 |
+
// add notification when an ad expires.
|
112 |
+
add_action( 'advanced-ads-ad-expired', array( $this, 'ad_expired' ), 10, 2 );
|
113 |
+
}
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Check if notices are enabled using "disable-notices" option in plugin settings
|
117 |
+
*
|
118 |
+
* @return bool
|
119 |
+
*/
|
120 |
+
public static function notices_enabled() {
|
121 |
+
$options = Advanced_Ads::get_instance()->options();
|
122 |
+
|
123 |
+
return empty( $options['disable-notices'] );
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Return an instance of this class.
|
128 |
+
*
|
129 |
+
* @return object A single instance of this class.
|
130 |
+
*/
|
131 |
+
public static function get_instance() {
|
132 |
+
|
133 |
+
// If the single instance hasn't been set, set it now.
|
134 |
+
if ( null === self::$instance ) {
|
135 |
+
self::$instance = new self();
|
136 |
+
}
|
137 |
+
|
138 |
+
return self::$instance;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Load notice arrays
|
143 |
+
*/
|
144 |
+
public function load_notices() {
|
145 |
+
|
146 |
+
$options = $this->options();
|
147 |
+
|
148 |
+
// load notices from "notices".
|
149 |
+
$this->notices = isset( $options['notices'] ) ? $options['notices'] : array();
|
150 |
+
|
151 |
+
// load hidden notices.
|
152 |
+
$this->ignore = isset( $options['ignore'] ) ? $options['ignore'] : array();
|
153 |
+
|
154 |
+
// get displayed notices
|
155 |
+
// get keys of notices.
|
156 |
+
$notice_keys = array_keys( $this->notices );
|
157 |
+
$this->displayed_notices = array_diff( $notice_keys, $this->ignore );
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Manage when to run checks
|
162 |
+
* - once per day on any backend page
|
163 |
+
* - on each Advanced Ads related page
|
164 |
+
*/
|
165 |
+
public function run_checks() {
|
166 |
+
|
167 |
+
// run in WP Admin only.
|
168 |
+
if ( ! is_admin() ) {
|
169 |
+
return;
|
170 |
+
}
|
171 |
+
|
172 |
+
// don’t run on AJAX calls.
|
173 |
+
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
174 |
+
return;
|
175 |
+
}
|
176 |
+
|
177 |
+
// run only daily unless we are on an Advanced Ads related page.
|
178 |
+
if ( ! Advanced_Ads_Admin::screen_belongs_to_advanced_ads()
|
179 |
+
&& get_transient( self::DAILY_CHECK_TRANSIENT_NAME ) ) {
|
180 |
+
return;
|
181 |
+
}
|
182 |
+
|
183 |
+
$this->checks();
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* General checks done on each Advanced Ads-related page or once per day
|
188 |
+
*/
|
189 |
+
public function checks() {
|
190 |
+
|
191 |
+
if ( ! Advanced_Ads_Checks::php_version_minimum() ) {
|
192 |
+
$this->add( 'old_php' );
|
193 |
+
} else {
|
194 |
+
$this->remove( 'old_php' );
|
195 |
+
}
|
196 |
+
if ( Advanced_Ads_Checks::cache() && ! defined( 'AAP_VERSION' ) ) {
|
197 |
+
$this->add( 'cache_no_pro' );
|
198 |
+
} else {
|
199 |
+
$this->remove( 'cache_no_pro' );
|
200 |
+
}
|
201 |
+
if ( Advanced_Ads_Checks::plugin_updates_available() ) {
|
202 |
+
$this->add( 'plugin_updates_available' );
|
203 |
+
} else {
|
204 |
+
$this->remove( 'plugin_updates_available' );
|
205 |
+
}
|
206 |
+
if ( Advanced_Ads_Checks::active_autoptimize() && ! defined( 'AAP_VERSION' ) ) {
|
207 |
+
$this->add( 'autoptimize_no_pro' );
|
208 |
+
} else {
|
209 |
+
$this->remove( 'autoptimize_no_pro' );
|
210 |
+
}
|
211 |
+
if ( count( Advanced_Ads_Checks::conflicting_plugins() ) ) {
|
212 |
+
$this->add( 'conflicting_plugins' );
|
213 |
+
} else {
|
214 |
+
$this->remove( 'conflicting_plugins' );
|
215 |
+
}
|
216 |
+
if ( count( Advanced_Ads_Checks::php_extensions() ) ) {
|
217 |
+
$this->add( 'php_extensions_missing' );
|
218 |
+
} else {
|
219 |
+
$this->remove( 'php_extensions_missing' );
|
220 |
+
}
|
221 |
+
if ( Advanced_Ads_Checks::ads_disabled() ) {
|
222 |
+
$this->add( 'ads_disabled' );
|
223 |
+
} else {
|
224 |
+
$this->remove( 'ads_disabled' );
|
225 |
+
}
|
226 |
+
if ( defined( 'IS_WPCOM' ) ) {
|
227 |
+
$this->add( 'wp_com' );
|
228 |
+
}
|
229 |
+
if ( Advanced_Ads_Checks::get_defined_constants() ) {
|
230 |
+
$this->add( 'constants_enabled' );
|
231 |
+
} else {
|
232 |
+
$this->remove( 'constants_enabled' );
|
233 |
+
}
|
234 |
+
if ( Advanced_Ads_Checks::assets_expired() ) {
|
235 |
+
$this->add( 'assets_expired' );
|
236 |
+
} else {
|
237 |
+
$this->remove( 'assets_expired' );
|
238 |
+
}
|
239 |
+
if ( Advanced_Ads_Checks::licenses_invalid() ) {
|
240 |
+
$this->add( 'license_invalid' );
|
241 |
+
} else {
|
242 |
+
$this->remove( 'license_invalid' );
|
243 |
+
}
|
244 |
+
if ( ! Advanced_Ads::get_number_of_ads() ) {
|
245 |
+
$this->add( 'no_ads' );
|
246 |
+
} else {
|
247 |
+
$this->remove( 'no_ads' );
|
248 |
+
}
|
249 |
+
|
250 |
+
set_transient( self::DAILY_CHECK_TRANSIENT_NAME, true, DAY_IN_SECONDS );
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Add a notice to the queue
|
255 |
+
*
|
256 |
+
* @param string $notice_key notice key to be added to the notice array.
|
257 |
+
* @param array $atts additional attributes.
|
258 |
+
*
|
259 |
+
* attributes
|
260 |
+
* - append_key string attached to the key; enables to create multiple messages for one original key
|
261 |
+
* - append_text text added to the default message
|
262 |
+
* - ad_id ID of an ad, attaches the link to the ad edit page to the message
|
263 |
+
*/
|
264 |
+
public function add( $notice_key, $atts = array() ) {
|
265 |
+
|
266 |
+
// stop here if notices are disabled.
|
267 |
+
if ( empty( $notice_key ) || ! self::notices_enabled() ) {
|
268 |
+
return;
|
269 |
+
}
|
270 |
+
|
271 |
+
// add string to key.
|
272 |
+
if ( ! empty( $atts['append_key'] ) ) {
|
273 |
+
$orig_notice_key = $notice_key;
|
274 |
+
$notice_key .= $atts['append_key'];
|
275 |
+
}
|
276 |
+
|
277 |
+
$notice_key = esc_attr( $notice_key );
|
278 |
+
$options = $this->options();
|
279 |
+
|
280 |
+
// load notices from "queue".
|
281 |
+
$notices = isset( $options['notices'] ) ? $options['notices'] : array();
|
282 |
+
|
283 |
+
// check if notice_key was already saved, this prevents the same notice from showing up in different forms.
|
284 |
+
if ( isset( $notices[ $notice_key ] ) ) {
|
285 |
+
return;
|
286 |
+
}
|
287 |
+
|
288 |
+
// save the new notice key.
|
289 |
+
$notices[ $notice_key ] = array();
|
290 |
+
|
291 |
+
// save text, if given.
|
292 |
+
if ( ! empty( $atts['text'] ) ) {
|
293 |
+
$notices[ $notice_key ]['text'] = $atts['text'];
|
294 |
+
}
|
295 |
+
|
296 |
+
// attach link to ad, if given.
|
297 |
+
if ( ! empty( $atts['ad_id'] ) ) {
|
298 |
+
$id = absint( $atts['ad_id'] );
|
299 |
+
$ad = new Advanced_Ads_Ad( $id );
|
300 |
+
if ( $id && isset( $ad->title ) && '' !== $ad->title ) {
|
301 |
+
$edit_link = ' <a href="' . get_edit_post_link( $id ) . '">' . $ad->title . '</a>';
|
302 |
+
$notices[ $notice_key ]['append_text'] = isset( $notices[ $notice_key ]['append_text'] ) ? $notices[ $notice_key ]['append_text'] . $edit_link : $edit_link;
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
// save the original key, if we manipulated it.
|
307 |
+
if ( ! empty( $atts['append_key'] ) ) {
|
308 |
+
$notices[ $notice_key ]['orig_key'] = $orig_notice_key;
|
309 |
+
}
|
310 |
+
|
311 |
+
// add current time – we store localized time including the offset set in WP.
|
312 |
+
$notices[ $notice_key ]['time'] = current_time( 'timestamp', 0 );
|
313 |
+
|
314 |
+
$this->last_saved_notice_key = $notice_key;
|
315 |
+
|
316 |
+
// update db.
|
317 |
+
$options['notices'] = $this->notices = $notices;
|
318 |
+
$this->update_options( $options );
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Updating an existing notice or add it, if it doesn’t exist, yet
|
323 |
+
*
|
324 |
+
* @param string $notice_key notice key to be added to the notice array.
|
325 |
+
* @param array $atts additional attributes.
|
326 |
+
*
|
327 |
+
* attributes:
|
328 |
+
* - append_text – text added to the default message
|
329 |
+
*/
|
330 |
+
public function update( $notice_key, $atts = array() ) {
|
331 |
+
|
332 |
+
// stop here if notices are disabled.
|
333 |
+
if ( empty( $notice_key ) || ! self::notices_enabled() ) {
|
334 |
+
return;
|
335 |
+
}
|
336 |
+
|
337 |
+
// check if the notice already exists.
|
338 |
+
$notice_key = esc_attr( $notice_key );
|
339 |
+
$options = $this->options();
|
340 |
+
|
341 |
+
// load notices from "queue".
|
342 |
+
$notices = isset( $options['notices'] ) ? $options['notices'] : array();
|
343 |
+
|
344 |
+
// check if notice_key was already saved, this prevents the same notice from showing up in different forms.
|
345 |
+
if ( ! isset( $notices[ $notice_key ] ) ) {
|
346 |
+
$this->add( $notice_key, $atts );
|
347 |
+
|
348 |
+
$notice_key = $this->last_saved_notice_key;
|
349 |
+
|
350 |
+
// just in case, get notices again.
|
351 |
+
$notices = $this->notices;
|
352 |
+
}
|
353 |
+
|
354 |
+
// add more text.
|
355 |
+
if ( ! empty( $atts['append_text'] ) ) {
|
356 |
+
$notices[ $notice_key ]['append_text'] = isset( $notices[ $notice_key ]['append_text'] ) ? $notices[ $notice_key ]['append_text'] . $atts['append_text'] : $atts['append_text'];
|
357 |
+
}
|
358 |
+
|
359 |
+
// update db.
|
360 |
+
$options['notices'] = $this->notices = $notices;
|
361 |
+
$this->update_options( $options );
|
362 |
+
}
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Decide based on the notice, whether to remove or ignore it
|
366 |
+
*
|
367 |
+
* @param string $notice_key key of the notice.
|
368 |
+
*/
|
369 |
+
public function hide( $notice_key ) {
|
370 |
+
if ( empty( $notice_key ) ) {
|
371 |
+
return;
|
372 |
+
}
|
373 |
+
|
374 |
+
// get original notice array for the "hide" attribute.
|
375 |
+
$notice_array = $this->get_notice_array_for_key( $notice_key );
|
376 |
+
|
377 |
+
if ( isset( $notice_array['hide'] ) && false === $notice_array['hide'] ) {
|
378 |
+
// remove item.
|
379 |
+
self::get_instance()->remove( $notice_key );
|
380 |
+
} else {
|
381 |
+
// hide item.
|
382 |
+
self::get_instance()->ignore( $notice_key );
|
383 |
+
}
|
384 |
+
|
385 |
+
}
|
386 |
+
|
387 |
+
/**
|
388 |
+
* Remove notice
|
389 |
+
* Would remove it from "notice" array. The notice can be added anytime again
|
390 |
+
* practically, this allows users to "skip" an notice if they are sure that it was only temporary
|
391 |
+
*
|
392 |
+
* @param string $notice_key notice key to be removed.
|
393 |
+
*/
|
394 |
+
public function remove( $notice_key ) {
|
395 |
+
|
396 |
+
// stop here if notices are disabled.
|
397 |
+
if ( empty( $notice_key ) || ! self::notices_enabled() ) {
|
398 |
+
return;
|
399 |
+
}
|
400 |
+
|
401 |
+
// get notices from options.
|
402 |
+
$options_before = $options = $this->options();
|
403 |
+
if ( ! isset( $options['notices'] )
|
404 |
+
|| ! is_array( $options['notices'] )
|
405 |
+
|| ! isset( $options['notices'][ $notice_key ] ) ) {
|
406 |
+
return;
|
407 |
+
}
|
408 |
+
|
409 |
+
unset( $options['notices'][ $notice_key ] );
|
410 |
+
|
411 |
+
// only update if changed.
|
412 |
+
if ( $options_before !== $options ) {
|
413 |
+
$this->update_options( $options );
|
414 |
+
|
415 |
+
// update already registered notices.
|
416 |
+
$this->load_notices();
|
417 |
+
}
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Ignore any notice
|
422 |
+
* adds notice key into "ignore" array
|
423 |
+
* does not remove it from "notices" array
|
424 |
+
*
|
425 |
+
* @param str $notice_key key of the notice to be ignored.
|
426 |
+
*/
|
427 |
+
public function ignore( $notice_key ) {
|
428 |
+
|
429 |
+
// stop here if notices are disabled.
|
430 |
+
if ( empty( $notice_key ) || ! self::notices_enabled() ) {
|
431 |
+
return;
|
432 |
+
}
|
433 |
+
|
434 |
+
// get options.
|
435 |
+
$options_before = $options = $this->options();
|
436 |
+
$ignored = isset( $options['ignore'] ) && is_array( $options['ignore'] ) ? $options['ignore'] : array();
|
437 |
+
|
438 |
+
// adds notice key to ignore array if it doesn’t exist already.
|
439 |
+
if ( false === array_search( $notice_key, $ignored, true ) ) {
|
440 |
+
$ignored[] = $notice_key;
|
441 |
+
}
|
442 |
+
|
443 |
+
// update db.
|
444 |
+
$options['ignore'] = $ignored;
|
445 |
+
|
446 |
+
// only update if changed.
|
447 |
+
if ( $options_before !== $options ) {
|
448 |
+
$this->update_options( $options );
|
449 |
+
|
450 |
+
// update already registered notices.
|
451 |
+
$this->load_notices();
|
452 |
+
}
|
453 |
+
}
|
454 |
+
|
455 |
+
/**
|
456 |
+
* Clear all "ignore" messages
|
457 |
+
*/
|
458 |
+
public function unignore() {
|
459 |
+
|
460 |
+
// get options.
|
461 |
+
$options_before = $options = $this->options();
|
462 |
+
|
463 |
+
// empty ignore value.
|
464 |
+
$options['ignore'] = array();
|
465 |
+
|
466 |
+
// only update if changed.
|
467 |
+
if ( $options_before !== $options ) {
|
468 |
+
$this->update_options( $options );
|
469 |
+
|
470 |
+
// update already registered notices.
|
471 |
+
$this->load_notices();
|
472 |
+
}
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* Render notice widget on overview page
|
477 |
+
*/
|
478 |
+
public function render_widget() {
|
479 |
+
|
480 |
+
// only render, if there are notices.
|
481 |
+
if ( $this->has_notices() ) {
|
482 |
+
include ADVADS_BASE_PATH . 'admin/views/overview-notices.php';
|
483 |
+
}
|
484 |
+
}
|
485 |
+
|
486 |
+
/**
|
487 |
+
* Display notices in a list
|
488 |
+
*
|
489 |
+
* @param string $type which type of notice to show; default: 'problem'.
|
490 |
+
*
|
491 |
+
*/
|
492 |
+
public function display( $type = 'problem' ) {
|
493 |
+
|
494 |
+
// iterate through notices.
|
495 |
+
?><ul class="advads-ad-health-notices advads-ad-health-notices-<?php echo $type; ?>"><?php
|
496 |
+
|
497 |
+
// failsafe in case this is not an array.
|
498 |
+
if( !is_array( $this->notices ) ){
|
499 |
+
return;
|
500 |
+
}
|
501 |
+
|
502 |
+
foreach ( $this->notices as $_notice_key => $_notice ) {
|
503 |
+
|
504 |
+
$notice_array = $this->get_notice_array_for_key( $_notice_key );
|
505 |
+
$notice_type = isset( $notice_array['type'] ) ? $notice_array['type'] : 'problem';
|
506 |
+
|
507 |
+
// skip if type is not correct
|
508 |
+
if( $notice_type !== $type ) {
|
509 |
+
continue;
|
510 |
+
}
|
511 |
+
|
512 |
+
if ( ! empty( $_notice['text'] ) ) {
|
513 |
+
$text = $_notice['text'];
|
514 |
+
} elseif ( isset( $notice_array['text'] ) ) {
|
515 |
+
$text = $notice_array['text'];
|
516 |
+
} else {
|
517 |
+
continue;
|
518 |
+
}
|
519 |
+
|
520 |
+
// attach "append_text"
|
521 |
+
if ( !empty( $_notice[ 'append_text' ] ) ) {
|
522 |
+
$text .= $_notice[ 'append_text' ];
|
523 |
+
}
|
524 |
+
|
525 |
+
$can_hide = ( ! isset( $notice_array['can_hide'] ) || true === $notice_array['can_hide'] ) ? true : false;
|
526 |
+
$hide = ( ! isset( $notice_array['hide'] ) || true === $notice_array['hide'] ) ? true : false;
|
527 |
+
$is_hidden = in_array( $_notice_key, $this->ignore ) ? true : false;
|
528 |
+
$date = isset( $_notice[ 'time' ] ) ? date_i18n( get_option( 'date_format' ), $_notice[ 'time' ] ) : false;
|
529 |
+
|
530 |
+
include ADVADS_BASE_PATH . '/admin/views/overview-notice-row.php';
|
531 |
+
}
|
532 |
+
|
533 |
+
?></ul><?php
|
534 |
+
}
|
535 |
+
|
536 |
+
/**
|
537 |
+
* display problems
|
538 |
+
*/
|
539 |
+
public function display_problems() {
|
540 |
+
$this->display( 'problem' );
|
541 |
+
}
|
542 |
+
|
543 |
+
/**
|
544 |
+
* display problems
|
545 |
+
*/
|
546 |
+
public function display_notices() {
|
547 |
+
$this->display( 'notice' );
|
548 |
+
}
|
549 |
+
|
550 |
+
/**
|
551 |
+
* Return notices option from DB
|
552 |
+
*
|
553 |
+
* @return array $options
|
554 |
+
*/
|
555 |
+
public function options() {
|
556 |
+
if ( ! isset( $this->options ) ) {
|
557 |
+
$this->options = get_option( ADVADS_SLUG . '-ad-health-notices', array() );
|
558 |
+
}
|
559 |
+
if ( ! is_array( $this->options ) ) {
|
560 |
+
$this->options = array();
|
561 |
+
}
|
562 |
+
|
563 |
+
return $this->options;
|
564 |
+
}
|
565 |
+
|
566 |
+
/**
|
567 |
+
* Update notice options
|
568 |
+
*
|
569 |
+
* @param array $options new options
|
570 |
+
*/
|
571 |
+
public function update_options( array $options ) {
|
572 |
+
// do not allow to clear options
|
573 |
+
if ( $options === array() ) {
|
574 |
+
return;
|
575 |
+
}
|
576 |
+
|
577 |
+
$this->options = $options;
|
578 |
+
update_option( ADVADS_SLUG . '-ad-health-notices', $options );
|
579 |
+
}
|
580 |
+
|
581 |
+
/**
|
582 |
+
* Get the number of overall visible notices
|
583 |
+
*/
|
584 |
+
public static function get_number_of_notices() {
|
585 |
+
$displayed_notices = self::get_instance()->displayed_notices;
|
586 |
+
if ( ! is_array( $displayed_notices ) ) {
|
587 |
+
return 0;
|
588 |
+
}
|
589 |
+
|
590 |
+
return count( $displayed_notices );
|
591 |
+
}
|
592 |
+
|
593 |
+
/**
|
594 |
+
* Check if there are visible problems (notices of type "problem")
|
595 |
+
*
|
596 |
+
* @return bool true if there are visible notices (notices that are not hidden)
|
597 |
+
*/
|
598 |
+
public static function has_visible_problems() {
|
599 |
+
$displayed_notices = self::get_instance()->displayed_notices;
|
600 |
+
if ( ! is_array( $displayed_notices ) ) {
|
601 |
+
return false;
|
602 |
+
}
|
603 |
+
|
604 |
+
return 0 < count( $displayed_notices );
|
605 |
+
}
|
606 |
+
|
607 |
+
/**
|
608 |
+
* Get notices by type – hidden and displayed
|
609 |
+
*
|
610 |
+
* @param string $type type of the notice
|
611 |
+
* @return array
|
612 |
+
*/
|
613 |
+
public function get_notices_by_type( $type = 'problem' ) {
|
614 |
+
|
615 |
+
// get all notices with a given type and which are ignored
|
616 |
+
|
617 |
+
$notices_by_type = array();
|
618 |
+
|
619 |
+
foreach ( $this->notices as $_key => $_notice ) {
|
620 |
+
$notice_array = $this->get_notice_array_for_key( $_key );
|
621 |
+
|
622 |
+
if ( isset( $notice_array['type'] ) && $type === $notice_array['type'] ) {
|
623 |
+
$notices_by_type[ $_key ] = $_notice;
|
624 |
+
}
|
625 |
+
}
|
626 |
+
|
627 |
+
return $notices_by_type;
|
628 |
+
}
|
629 |
+
|
630 |
+
/**
|
631 |
+
* Check if there are notices
|
632 |
+
*
|
633 |
+
* @return bool true if there are notices, false if not
|
634 |
+
*/
|
635 |
+
public function has_notices() {
|
636 |
+
|
637 |
+
// get all notices
|
638 |
+
return isset( $this->notices ) && is_array( $this->notices ) && count( $this->notices );
|
639 |
+
|
640 |
+
}
|
641 |
+
|
642 |
+
/**
|
643 |
+
* Check if there are notices for a given type
|
644 |
+
*
|
645 |
+
* @param string $type type of the notice
|
646 |
+
* @return integer
|
647 |
+
*/
|
648 |
+
public function has_notices_by_type( $type = 'problem' ) {
|
649 |
+
|
650 |
+
// get all notices with a given type
|
651 |
+
$notices = $this->get_notices_by_type( $type );
|
652 |
+
|
653 |
+
if ( ! is_array( $notices ) ) {
|
654 |
+
return 0;
|
655 |
+
}
|
656 |
+
|
657 |
+
return count( $notices );
|
658 |
+
}
|
659 |
+
|
660 |
+
/**
|
661 |
+
* Get the notice array for a notice key
|
662 |
+
* useful, if a notice key was manipulated
|
663 |
+
*
|
664 |
+
* @param string notice_key key of the notice
|
665 |
+
*
|
666 |
+
* @return array type
|
667 |
+
*/
|
668 |
+
public function get_notice_array_for_key( $notice_key ) {
|
669 |
+
|
670 |
+
// check if there is an original key
|
671 |
+
$orig_key = isset( $this->notices[ $notice_key ]['orig_key'] ) ? $this->notices[ $notice_key ]['orig_key'] : $notice_key;
|
672 |
+
|
673 |
+
return isset( $this->default_notices[ $orig_key ] ) ? $this->default_notices[ $orig_key ] : array();
|
674 |
+
}
|
675 |
+
|
676 |
+
/**
|
677 |
+
* Add notification when an ad expires based on the expiry date
|
678 |
+
*
|
679 |
+
* @param integer $ad_id ID of the ad
|
680 |
+
* @param object $ad ad object
|
681 |
+
*/
|
682 |
+
public function ad_expired( $ad_id, $ad ) {
|
683 |
+
$id = ! empty( $ad_id ) ? absint( $ad_id ) : 0;
|
684 |
+
$this->update( 'ad_expired', array( 'append_key' => $id, 'ad_id' => $id ) );
|
685 |
+
}
|
686 |
+
|
687 |
+
|
688 |
+
}
|
classes/ad.php
CHANGED
@@ -435,7 +435,7 @@ class Advanced_Ads_Ad {
|
|
435 |
*/
|
436 |
public function can_display_by_expiry_date(){
|
437 |
|
438 |
-
// if expiry_date is not set null is returned
|
439 |
$ad_expiry_date = (int) $this->options( 'expiry_date' );
|
440 |
|
441 |
if ( $ad_expiry_date <= 0 || $ad_expiry_date > time() ) {
|
@@ -445,6 +445,10 @@ class Advanced_Ads_Ad {
|
|
445 |
// set status to 'draft' if the ad is expired
|
446 |
if ( $this->status !== 'draft' ) {
|
447 |
wp_update_post( array( 'ID' => $this->id, 'post_status' => 'draft' ) );
|
|
|
|
|
|
|
|
|
448 |
}
|
449 |
|
450 |
return false;
|
435 |
*/
|
436 |
public function can_display_by_expiry_date(){
|
437 |
|
438 |
+
// if expiry_date is not set, null is returned
|
439 |
$ad_expiry_date = (int) $this->options( 'expiry_date' );
|
440 |
|
441 |
if ( $ad_expiry_date <= 0 || $ad_expiry_date > time() ) {
|
445 |
// set status to 'draft' if the ad is expired
|
446 |
if ( $this->status !== 'draft' ) {
|
447 |
wp_update_post( array( 'ID' => $this->id, 'post_status' => 'draft' ) );
|
448 |
+
/**
|
449 |
+
* Run when an ad expires
|
450 |
+
*/
|
451 |
+
do_action( 'advanced-ads-ad-expired', $this->id, $this );
|
452 |
}
|
453 |
|
454 |
return false;
|
classes/ad_ajax_callbacks.php
CHANGED
@@ -36,6 +36,11 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
|
|
36 |
add_action( 'wp_ajax_advads-ad-injection-content', array( $this, 'inject_placement' ) );
|
37 |
add_action( 'wp_ajax_advads-save-hide-wizard-state', array( $this, 'save_wizard_state' ) );
|
38 |
add_action( 'wp_ajax_advads-adsense-enable-pla', array( $this, 'adsense_enable_pla' ) );
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
}
|
41 |
|
@@ -419,4 +424,76 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
|
|
419 |
update_option( GADSENSE_OPT_NAME, $options );
|
420 |
die();
|
421 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
}
|
36 |
add_action( 'wp_ajax_advads-ad-injection-content', array( $this, 'inject_placement' ) );
|
37 |
add_action( 'wp_ajax_advads-save-hide-wizard-state', array( $this, 'save_wizard_state' ) );
|
38 |
add_action( 'wp_ajax_advads-adsense-enable-pla', array( $this, 'adsense_enable_pla' ) );
|
39 |
+
add_action( 'wp_ajax_advads-ad-health-notice-display', array( $this, 'ad_health_notice_display' ) );
|
40 |
+
add_action( 'wp_ajax_advads-ad-health-notice-push', array( $this, 'ad_health_notice_push' ) );
|
41 |
+
add_action( 'wp_ajax_advads-ad-health-notice-hide', array( $this, 'ad_health_notice_hide' ) );
|
42 |
+
add_action( 'wp_ajax_advads-ad-health-notice-unignore', array( $this, 'ad_health_notice_unignore' ) );
|
43 |
+
add_action( 'wp_ajax_advads-ad-health-notice-solved', array( $this, 'ad_health_notice_solved' ) );
|
44 |
|
45 |
}
|
46 |
|
424 |
update_option( GADSENSE_OPT_NAME, $options );
|
425 |
die();
|
426 |
}
|
427 |
+
|
428 |
+
/**
|
429 |
+
* Display list of Ad Health notices
|
430 |
+
*/
|
431 |
+
public function ad_health_notice_display(){
|
432 |
+
|
433 |
+
check_ajax_referer( 'advanced-ads-admin-ajax-nonce', 'nonce' );
|
434 |
+
|
435 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
|
436 |
+
return;
|
437 |
+
}
|
438 |
+
|
439 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->render_widget();
|
440 |
+
die();
|
441 |
+
}
|
442 |
+
|
443 |
+
/**
|
444 |
+
* Push an Ad Health notice to the queue
|
445 |
+
*/
|
446 |
+
public function ad_health_notice_push(){
|
447 |
+
|
448 |
+
check_ajax_referer( 'advanced-ads-admin-ajax-nonce', 'nonce' );
|
449 |
+
|
450 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
|
451 |
+
return;
|
452 |
+
}
|
453 |
+
|
454 |
+
$key = ( !empty( $_REQUEST['key'] ) ) ? esc_attr( $_REQUEST['key'] ) : false;
|
455 |
+
$attr = ( !empty( $_REQUEST['attr'] ) && is_array( $_REQUEST['attr'] ) ) ? $_REQUEST['attr'] : array();
|
456 |
+
|
457 |
+
// update or new entry?
|
458 |
+
if( isset( $attr['mode'] ) && 'update' === $attr['mode'] ){
|
459 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->update( $key, $attr );
|
460 |
+
} else {
|
461 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->add( $key, $attr );
|
462 |
+
}
|
463 |
+
|
464 |
+
die();
|
465 |
+
}
|
466 |
+
|
467 |
+
/**
|
468 |
+
* Hide Ad Health notice
|
469 |
+
*/
|
470 |
+
public function ad_health_notice_hide(){
|
471 |
+
check_ajax_referer( 'advanced-ads-admin-ajax-nonce', 'nonce' );
|
472 |
+
|
473 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
|
474 |
+
return;
|
475 |
+
}
|
476 |
+
|
477 |
+
$notice_key = ( !empty( $_REQUEST['notice'] ) ) ? esc_attr( $_REQUEST['notice'] ) : false;
|
478 |
+
|
479 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->hide( $notice_key );
|
480 |
+
die();
|
481 |
+
}
|
482 |
+
|
483 |
+
/**
|
484 |
+
* Show all ignored notices of a given type
|
485 |
+
*/
|
486 |
+
public function ad_health_notice_unignore(){
|
487 |
+
check_ajax_referer( 'advanced-ads-admin-ajax-nonce', 'nonce' );
|
488 |
+
|
489 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
|
490 |
+
return;
|
491 |
+
}
|
492 |
+
|
493 |
+
// $notice_key = ( !empty( $_REQUEST['type'] ) ) ? esc_attr( $_REQUEST['type'] ) : false;
|
494 |
+
|
495 |
+
// Advanced_Ads_Ad_Health_Notices::get_instance()->unignore_by_type( $notice_key );
|
496 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->unignore();
|
497 |
+
die();
|
498 |
+
}
|
499 |
}
|
classes/checks.php
CHANGED
@@ -104,6 +104,7 @@ class Advanced_Ads_Checks {
|
|
104 |
$add_ons = apply_filters( 'advanced-ads-add-ons', array() );
|
105 |
|
106 |
if( $add_ons === array() ) {
|
|
|
107 |
return false;
|
108 |
}
|
109 |
|
@@ -132,6 +133,8 @@ class Advanced_Ads_Checks {
|
|
132 |
}
|
133 |
}
|
134 |
|
|
|
|
|
135 |
return false;
|
136 |
}
|
137 |
|
@@ -144,7 +147,7 @@ class Advanced_Ads_Checks {
|
|
144 |
*/
|
145 |
public static function active_autoptimize(){
|
146 |
|
147 |
-
if( defined( '
|
148 |
return true;
|
149 |
}
|
150 |
|
@@ -273,6 +276,7 @@ class Advanced_Ads_Checks {
|
|
273 |
'ADVANCED_ADS_DISABLE_SHORTCODE_BUTTON',
|
274 |
'ADVANCED_ADS_DISALLOW_PHP',
|
275 |
'ADVANCED_ADS_ENABLE_REVISIONS',
|
|
|
276 |
'ADVANCED_ADS_PRO_CUSTOM_POSITION_MOVE_INTO_HIDDEN',
|
277 |
'ADVANCED_ADS_PRO_PAGE_IMPR_EXDAYS',
|
278 |
'ADVANCED_ADS_PRO_REFERRER_EXDAYS',
|
@@ -292,6 +296,16 @@ class Advanced_Ads_Checks {
|
|
292 |
return $result;
|
293 |
}
|
294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
/**
|
296 |
* check for potential jQuery errors
|
297 |
* only script, so no return, but direct output
|
@@ -299,12 +313,11 @@ class Advanced_Ads_Checks {
|
|
299 |
*/
|
300 |
public static function jquery_ui_conflict(){
|
301 |
?>
|
302 |
-
<div id="advads-jqueryui-conflict-message" style="display:none;" class="message error"><p><?php printf( __( 'Possible conflict between jQueryUI library, used by Advanced Ads and other libraries (probably <a href="%s">Twitter Bootstrap</a>). This might lead to misfortunate formats in forms, but should not damage features.', 'advanced-ads' ), 'http://getbootstrap.com/javascript/#js-noconflict' ); ?></p></div>
|
303 |
<script>// string from jquery-ui source code
|
304 |
jQuery(document).ready(function(){
|
305 |
var needle = 'var g="string"==typeof f,h=c.call(arguments,1)';
|
306 |
if ( jQuery.fn.button.toString().indexOf( needle ) === -1 || jQuery.fn.tooltip.toString().indexOf( needle ) === -1 ) {
|
307 |
-
|
308 |
}
|
309 |
});
|
310 |
</script><?php
|
104 |
$add_ons = apply_filters( 'advanced-ads-add-ons', array() );
|
105 |
|
106 |
if( $add_ons === array() ) {
|
107 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->remove( 'license_invalid' );
|
108 |
return false;
|
109 |
}
|
110 |
|
133 |
}
|
134 |
}
|
135 |
|
136 |
+
// remove notice, if one is given
|
137 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->remove( 'license_invalid' );
|
138 |
return false;
|
139 |
}
|
140 |
|
147 |
*/
|
148 |
public static function active_autoptimize(){
|
149 |
|
150 |
+
if( defined( 'AUTOPTIMIZE_PLUGIN_VERSION' ) ){
|
151 |
return true;
|
152 |
}
|
153 |
|
276 |
'ADVANCED_ADS_DISABLE_SHORTCODE_BUTTON',
|
277 |
'ADVANCED_ADS_DISALLOW_PHP',
|
278 |
'ADVANCED_ADS_ENABLE_REVISIONS',
|
279 |
+
'ADVANCED_ADS_GEO_TEST_IP',
|
280 |
'ADVANCED_ADS_PRO_CUSTOM_POSITION_MOVE_INTO_HIDDEN',
|
281 |
'ADVANCED_ADS_PRO_PAGE_IMPR_EXDAYS',
|
282 |
'ADVANCED_ADS_PRO_REFERRER_EXDAYS',
|
296 |
return $result;
|
297 |
}
|
298 |
|
299 |
+
/**
|
300 |
+
* Notice for Adblocker module if assets have expired
|
301 |
+
*/
|
302 |
+
public static function assets_expired() {
|
303 |
+
$plugin_options = Advanced_Ads_Plugin::get_instance()->options();
|
304 |
+
$adblocker_options = Advanced_Ads_Ad_Blocker::get_instance()->options();
|
305 |
+
|
306 |
+
return ( ! empty ( $plugin_options['use-adblocker'] ) && empty ( $adblocker_options['module_can_work'] ) );
|
307 |
+
}
|
308 |
+
|
309 |
/**
|
310 |
* check for potential jQuery errors
|
311 |
* only script, so no return, but direct output
|
313 |
*/
|
314 |
public static function jquery_ui_conflict(){
|
315 |
?>
|
|
|
316 |
<script>// string from jquery-ui source code
|
317 |
jQuery(document).ready(function(){
|
318 |
var needle = 'var g="string"==typeof f,h=c.call(arguments,1)';
|
319 |
if ( jQuery.fn.button.toString().indexOf( needle ) === -1 || jQuery.fn.tooltip.toString().indexOf( needle ) === -1 ) {
|
320 |
+
advads_push_notice( 'jquery_ui_conflict' );
|
321 |
}
|
322 |
});
|
323 |
</script><?php
|
classes/frontend_checks.php
CHANGED
@@ -17,11 +17,13 @@ class Advanced_Ads_Frontend_Checks {
|
|
17 |
|
18 |
if ( ! is_admin()
|
19 |
&& is_admin_bar_showing()
|
20 |
-
|
|
|
21 |
) {
|
22 |
add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 1000 );
|
23 |
add_filter( 'the_content', array( $this, 'set_did_the_content' ) );
|
24 |
add_filter( 'wp_footer', array( $this, 'footer_checks' ), -101 );
|
|
|
25 |
add_filter( 'advanced-ads-ad-select-args', array( $this, 'ad_select_args_callback' ) );
|
26 |
$enabled = true;
|
27 |
}
|
@@ -41,6 +43,17 @@ class Advanced_Ads_Frontend_Checks {
|
|
41 |
$args['frontend-check'] = true;
|
42 |
return $args;
|
43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
/**
|
46 |
* List current ad situation on the page in the admin-bar.
|
@@ -215,19 +228,6 @@ class Advanced_Ads_Frontend_Checks {
|
|
215 |
) );
|
216 |
}
|
217 |
|
218 |
-
if ( ! extension_loaded( 'dom' ) ) {
|
219 |
-
$nodes[] = array( 'type' => 1, 'data' => array(
|
220 |
-
'parent' => 'advanced_ads_ad_health',
|
221 |
-
'id' => 'advanced_ads_ad_health_no_dom_document',
|
222 |
-
'title' => sprintf( __( 'The %s extension(s) is not loaded', 'advanced-ads' ), 'dom' ),
|
223 |
-
'href' => 'http://php.net/manual/en/book.dom.php',
|
224 |
-
'meta' => array(
|
225 |
-
'class' => 'advanced_ads_ad_health_warning',
|
226 |
-
'target' => '_blank'
|
227 |
-
)
|
228 |
-
) );
|
229 |
-
}
|
230 |
-
|
231 |
$nodes[] = array( 'type' => 2, 'data' => array(
|
232 |
'parent' => 'advanced_ads_ad_health',
|
233 |
'id' => 'advanced_ads_ad_health_has_http',
|
@@ -336,12 +336,27 @@ class Advanced_Ads_Frontend_Checks {
|
|
336 |
*/
|
337 |
$nodes = apply_filters( 'advanced-ads-ad-health-nodes', $nodes );
|
338 |
usort( $nodes, array( $this, 'sort_nodes' ) );
|
|
|
|
|
|
|
339 |
|
340 |
$wp_admin_bar->add_node( array(
|
341 |
-
'id'
|
342 |
-
'title'
|
|
|
|
|
343 |
) );
|
344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
$display_fine = true;
|
346 |
|
347 |
foreach ( $nodes as $node ) {
|
@@ -349,8 +364,8 @@ class Advanced_Ads_Frontend_Checks {
|
|
349 |
if ( $node['type'] === 1 ) { $display_fine = false; }
|
350 |
$wp_admin_bar->add_node( $node['data'] );
|
351 |
}
|
352 |
-
|
353 |
-
if ( $display_fine ) {
|
354 |
$wp_admin_bar->add_node( array(
|
355 |
'parent' => 'advanced_ads_ad_health',
|
356 |
'id' => 'advanced_ads_ad_health_fine',
|
@@ -409,10 +424,13 @@ class Advanced_Ads_Frontend_Checks {
|
|
409 |
*/
|
410 |
public function footer_checks() {
|
411 |
$adsense_options = Advanced_Ads_AdSense_Data::get_instance()->get_options();
|
|
|
412 |
ob_start();
|
413 |
?><!-- Advanced Ads: <?php _e( 'the following code is used for automatic error detection and only visible to admins', 'advanced-ads' ); ?>-->
|
414 |
-
<style>.hidden { display: none; }
|
415 |
#wp-admin-bar-advanced_ads_ad_health-default a:after { content: "\25BA"; margin-left: .5em; font-size: smaller; }
|
|
|
|
|
416 |
.advanced-ads-highlight-ads { outline:4px solid blue !important; }</style>
|
417 |
<script type="text/javascript" src="<?php echo ADVADS_BASE_URL . 'admin/assets/js/advertisement.js' ?>"></script>
|
418 |
<script>
|
@@ -420,12 +438,13 @@ class Advanced_Ads_Frontend_Checks {
|
|
420 |
showCount: function() {
|
421 |
try {
|
422 |
// Count only warnings that have the 'advanced_ads_ad_health_warning' class.
|
423 |
-
|
|
|
424 |
var fine_item = document.getElementById( 'wp-admin-bar-advanced_ads_ad_health_fine' );
|
425 |
} catch ( e ) { return; }
|
426 |
|
427 |
if ( warning_count ) {
|
428 |
-
var header = document.querySelector( '#wp-admin-bar-advanced_ads_ad_health >
|
429 |
|
430 |
if ( fine_item ) {
|
431 |
// Hide 'fine' item.
|
@@ -433,7 +452,8 @@ class Advanced_Ads_Frontend_Checks {
|
|
433 |
}
|
434 |
|
435 |
if ( header ) {
|
436 |
-
header.innerHTML = header.innerHTML.replace(
|
|
|
437 |
header.className += ' advads-adminbar-is-warnings';
|
438 |
}
|
439 |
}
|
@@ -453,7 +473,7 @@ class Advanced_Ads_Frontend_Checks {
|
|
453 |
* Add item to Ad Health node.
|
454 |
*
|
455 |
* @param string selector Selector of the node.
|
456 |
-
* @param string/array
|
457 |
*/
|
458 |
add_item_to_node: function( selector, item ) {
|
459 |
if ( typeof item === 'string' ) {
|
@@ -471,6 +491,39 @@ class Advanced_Ads_Frontend_Checks {
|
|
471 |
advanced_ads_frontend_checks.showCount();
|
472 |
}
|
473 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
|
475 |
/**
|
476 |
* Search for hidden AdSense.
|
@@ -497,6 +550,7 @@ class Advanced_Ads_Frontend_Checks {
|
|
497 |
});
|
498 |
if( advads_ad_health_check_adsense_hidden_ids.length ){
|
499 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_hidden_adsense', advads_ad_health_check_adsense_hidden_ids );
|
|
|
500 |
}
|
501 |
if ( responsive_zero_width.length ) {
|
502 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_floated_responsive_adsense', responsive_zero_width );
|
@@ -639,6 +693,7 @@ class Advanced_Ads_Frontend_Checks {
|
|
639 |
<script>advanced_ads_ready( function() {
|
640 |
var ad_id = '<?php echo $ad->id; ?>';
|
641 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_has_http', ad_id );
|
|
|
642 |
});</script>
|
643 |
<?php
|
644 |
$content .= Advanced_Ads_Utils::get_inline_asset( ob_get_clean() );
|
@@ -649,6 +704,7 @@ class Advanced_Ads_Frontend_Checks {
|
|
649 |
<script>advanced_ads_ready( function() {
|
650 |
var ad_id = '<?php echo $ad->id; ?>';
|
651 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_incorrect_head', ad_id );
|
|
|
652 |
});</script>
|
653 |
<?php
|
654 |
$content .= Advanced_Ads_Utils::get_inline_asset( ob_get_clean() );
|
@@ -685,6 +741,10 @@ class Advanced_Ads_Frontend_Checks {
|
|
685 |
if ( ! $ad->is_head_placement ) {
|
686 |
return true;
|
687 |
}
|
|
|
|
|
|
|
|
|
688 |
if ( ! $dom = $this->get_ad_dom( $content ) ) {
|
689 |
return true;
|
690 |
}
|
@@ -694,7 +754,7 @@ class Advanced_Ads_Frontend_Checks {
|
|
694 |
$count = $body->childNodes->length;
|
695 |
for ( $i = 0; $i < $count; $i++ ) {
|
696 |
$node = $body->childNodes->item( $i );
|
697 |
-
|
698 |
if ( XML_TEXT_NODE === $node->nodeType ) {
|
699 |
return false;
|
700 |
}
|
17 |
|
18 |
if ( ! is_admin()
|
19 |
&& is_admin_bar_showing()
|
20 |
+
&& current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) )
|
21 |
+
&& Advanced_Ads_Ad_Health_Notices::notices_enabled()
|
22 |
) {
|
23 |
add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_menu' ), 1000 );
|
24 |
add_filter( 'the_content', array( $this, 'set_did_the_content' ) );
|
25 |
add_filter( 'wp_footer', array( $this, 'footer_checks' ), -101 );
|
26 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
27 |
add_filter( 'advanced-ads-ad-select-args', array( $this, 'ad_select_args_callback' ) );
|
28 |
$enabled = true;
|
29 |
}
|
43 |
$args['frontend-check'] = true;
|
44 |
return $args;
|
45 |
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Enqueue scripts
|
49 |
+
* needs to add ajaxurl in case no other plugin is doing that
|
50 |
+
*/
|
51 |
+
public function enqueue_scripts() {
|
52 |
+
|
53 |
+
// we don’t have our own script, so we attach this information to jquery
|
54 |
+
wp_localize_script( 'jquery', 'advads_frontend_checks',
|
55 |
+
array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
|
56 |
+
}
|
57 |
|
58 |
/**
|
59 |
* List current ad situation on the page in the admin-bar.
|
228 |
) );
|
229 |
}
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
$nodes[] = array( 'type' => 2, 'data' => array(
|
232 |
'parent' => 'advanced_ads_ad_health',
|
233 |
'id' => 'advanced_ads_ad_health_has_http',
|
336 |
*/
|
337 |
$nodes = apply_filters( 'advanced-ads-ad-health-nodes', $nodes );
|
338 |
usort( $nodes, array( $this, 'sort_nodes' ) );
|
339 |
+
|
340 |
+
// load number of already detected notices
|
341 |
+
$notices = Advanced_Ads_Ad_Health_Notices::get_number_of_notices();
|
342 |
|
343 |
$wp_admin_bar->add_node( array(
|
344 |
+
'id' => 'advanced_ads_ad_health',
|
345 |
+
'title' => __( 'Ad Health', 'advanced-ads' ) . ' <span class="advanced-ads-issue-counter">' . $notices . '</span>',
|
346 |
+
'parent' => false,
|
347 |
+
'href' => admin_url( 'admin.php?page=advanced-ads' )
|
348 |
) );
|
349 |
|
350 |
+
// show that there are backend notices
|
351 |
+
if( $notices ){
|
352 |
+
$wp_admin_bar->add_node( array(
|
353 |
+
'parent' => 'advanced_ads_ad_health',
|
354 |
+
'id' => 'advanced_ads_ad_health_more',
|
355 |
+
'title' => sprintf(__( 'Show %d more notifications', 'advanced-ads' ), absint( $notices ) ),
|
356 |
+
'href' => admin_url( 'admin.php?page=advanced-ads' ),
|
357 |
+
) );
|
358 |
+
}
|
359 |
+
|
360 |
$display_fine = true;
|
361 |
|
362 |
foreach ( $nodes as $node ) {
|
364 |
if ( $node['type'] === 1 ) { $display_fine = false; }
|
365 |
$wp_admin_bar->add_node( $node['data'] );
|
366 |
}
|
367 |
+
|
368 |
+
if ( $display_fine && !$notices ) {
|
369 |
$wp_admin_bar->add_node( array(
|
370 |
'parent' => 'advanced_ads_ad_health',
|
371 |
'id' => 'advanced_ads_ad_health_fine',
|
424 |
*/
|
425 |
public function footer_checks() {
|
426 |
$adsense_options = Advanced_Ads_AdSense_Data::get_instance()->get_options();
|
427 |
+
$notices = Advanced_Ads_Ad_Health_Notices::get_number_of_notices();
|
428 |
ob_start();
|
429 |
?><!-- Advanced Ads: <?php _e( 'the following code is used for automatic error detection and only visible to admins', 'advanced-ads' ); ?>-->
|
430 |
+
<style>.hidden { display: none; }
|
431 |
#wp-admin-bar-advanced_ads_ad_health-default a:after { content: "\25BA"; margin-left: .5em; font-size: smaller; }
|
432 |
+
#wpadminbar .advanced-ads-issue-counter { background-color: #d54e21; display: none; padding: 1px 7px 1px 6px!important; border-radius: 50%; color: #fff; }
|
433 |
+
#wpadminbar .advads-adminbar-is-warnings .advanced-ads-issue-counter { display: inline; }
|
434 |
.advanced-ads-highlight-ads { outline:4px solid blue !important; }</style>
|
435 |
<script type="text/javascript" src="<?php echo ADVADS_BASE_URL . 'admin/assets/js/advertisement.js' ?>"></script>
|
436 |
<script>
|
438 |
showCount: function() {
|
439 |
try {
|
440 |
// Count only warnings that have the 'advanced_ads_ad_health_warning' class.
|
441 |
+
// increase by internal notices
|
442 |
+
var warning_count = document.querySelectorAll( '.advanced_ads_ad_health_warning:not(.hidden)' ).length + <?php echo $notices; ?>;
|
443 |
var fine_item = document.getElementById( 'wp-admin-bar-advanced_ads_ad_health_fine' );
|
444 |
} catch ( e ) { return; }
|
445 |
|
446 |
if ( warning_count ) {
|
447 |
+
var header = document.querySelector( '#wp-admin-bar-advanced_ads_ad_health > a' );
|
448 |
|
449 |
if ( fine_item ) {
|
450 |
// Hide 'fine' item.
|
452 |
}
|
453 |
|
454 |
if ( header ) {
|
455 |
+
header.innerHTML = header.innerHTML.replace(/<span class="advanced-ads-issue-counter">\d*<\/span>/, '') + '<span class="advanced-ads-issue-counter">' + warning_count + '</span>';
|
456 |
+
// add class
|
457 |
header.className += ' advads-adminbar-is-warnings';
|
458 |
}
|
459 |
}
|
473 |
* Add item to Ad Health node.
|
474 |
*
|
475 |
* @param string selector Selector of the node.
|
476 |
+
* @param string/array item item(s) to add.
|
477 |
*/
|
478 |
add_item_to_node: function( selector, item ) {
|
479 |
if ( typeof item === 'string' ) {
|
491 |
advanced_ads_frontend_checks.showCount();
|
492 |
}
|
493 |
},
|
494 |
+
|
495 |
+
/**
|
496 |
+
* Add item to Ad Health notices in the backend
|
497 |
+
*
|
498 |
+
* @param str key of the notice
|
499 |
+
* @param {type} context
|
500 |
+
* @returns {undefined}
|
501 |
+
*/
|
502 |
+
add_item_to_notices: function( key, attr = '' ) {
|
503 |
+
var cookie = advads.get_cookie( 'advanced_ads_ad_health_notices' );
|
504 |
+
if( cookie ){
|
505 |
+
advads_cookie_notices = JSON.parse( cookie );
|
506 |
+
} else {
|
507 |
+
advads_cookie_notices = new Array();
|
508 |
+
}
|
509 |
+
// stop if notice was added less than 1 hour ago
|
510 |
+
if( 0 <= advads_cookie_notices.indexOf( key ) ){
|
511 |
+
return;
|
512 |
+
}
|
513 |
+
var query = {
|
514 |
+
action: 'advads-ad-health-notice-push',
|
515 |
+
key: key,
|
516 |
+
attr: attr,
|
517 |
+
nonce: '<?php echo wp_create_nonce('advanced-ads-ad-health-ajax-nonce'); ?>'
|
518 |
+
};
|
519 |
+
// send query
|
520 |
+
// update notices and cookie
|
521 |
+
jQuery.post( advads_frontend_checks.ajax_url, query, function (r) {
|
522 |
+
advads_cookie_notices.push( key );
|
523 |
+
var notices_str = JSON.stringify( advads_cookie_notices );
|
524 |
+
advads.set_cookie_sec( 'advanced_ads_ad_health_notices', notices_str, 3600 ); // 1 hour
|
525 |
+
});
|
526 |
+
},
|
527 |
|
528 |
/**
|
529 |
* Search for hidden AdSense.
|
550 |
});
|
551 |
if( advads_ad_health_check_adsense_hidden_ids.length ){
|
552 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_hidden_adsense', advads_ad_health_check_adsense_hidden_ids );
|
553 |
+
advanced_ads_frontend_checks.add_item_to_notices( 'adsense_hidden' );
|
554 |
}
|
555 |
if ( responsive_zero_width.length ) {
|
556 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_floated_responsive_adsense', responsive_zero_width );
|
693 |
<script>advanced_ads_ready( function() {
|
694 |
var ad_id = '<?php echo $ad->id; ?>';
|
695 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_has_http', ad_id );
|
696 |
+
advanced_ads_frontend_checks.add_item_to_notices( 'ad_has_http', { append_key: ad_id, ad_id: ad_id } );
|
697 |
});</script>
|
698 |
<?php
|
699 |
$content .= Advanced_Ads_Utils::get_inline_asset( ob_get_clean() );
|
704 |
<script>advanced_ads_ready( function() {
|
705 |
var ad_id = '<?php echo $ad->id; ?>';
|
706 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_incorrect_head', ad_id );
|
707 |
+
advanced_ads_frontend_checks.add_item_to_notices( 'ad_with_output_in_head', { append_key: ad_id, ad_id: ad_id } );
|
708 |
});</script>
|
709 |
<?php
|
710 |
$content .= Advanced_Ads_Utils::get_inline_asset( ob_get_clean() );
|
741 |
if ( ! $ad->is_head_placement ) {
|
742 |
return true;
|
743 |
}
|
744 |
+
|
745 |
+
// strip linebreaks, because, a line break after a comment is identified as a text node
|
746 |
+
$content = preg_replace( "/\r|\n/", "", $content );
|
747 |
+
|
748 |
if ( ! $dom = $this->get_ad_dom( $content ) ) {
|
749 |
return true;
|
750 |
}
|
754 |
$count = $body->childNodes->length;
|
755 |
for ( $i = 0; $i < $count; $i++ ) {
|
756 |
$node = $body->childNodes->item( $i );
|
757 |
+
|
758 |
if ( XML_TEXT_NODE === $node->nodeType ) {
|
759 |
return false;
|
760 |
}
|
classes/plugin.php
CHANGED
@@ -117,6 +117,7 @@ class Advanced_Ads_Plugin {
|
|
117 |
Advanced_Ads_Display_Conditions::get_instance();
|
118 |
new Advanced_Ads_Frontend_Checks;
|
119 |
new Advanced_Ads_Compatibility;
|
|
|
120 |
}
|
121 |
|
122 |
/**
|
@@ -708,7 +709,14 @@ class Advanced_Ads_Plugin {
|
|
708 |
*/
|
709 |
static function support_url( $utm = '' ){
|
710 |
|
711 |
-
return self::any_activated_add_on() ? ADVADS_URL . 'support/' .$utm : 'https://wordpress.org/support/plugin/advanced-ads#new-post';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
}
|
713 |
|
714 |
}
|
117 |
Advanced_Ads_Display_Conditions::get_instance();
|
118 |
new Advanced_Ads_Frontend_Checks;
|
119 |
new Advanced_Ads_Compatibility;
|
120 |
+
Advanced_Ads_Ad_Health_Notices::get_instance(); // load to fetch notices
|
121 |
}
|
122 |
|
123 |
/**
|
709 |
*/
|
710 |
static function support_url( $utm = '' ){
|
711 |
|
712 |
+
// return self::any_activated_add_on() ? ADVADS_URL . 'support/' .$utm : 'https://wordpress.org/support/plugin/advanced-ads#new-post';
|
713 |
+
$urm = empty( $utm ) ? '#utm_source=advanced-ads&utm_medium=link&utm_campaign=disable-support' : $utm;
|
714 |
+
if( self::any_activated_add_on() ){
|
715 |
+
$url = ADVADS_URL . 'support/' .$utm . '-with-addons';
|
716 |
+
} else {
|
717 |
+
$url = ADVADS_URL . 'support/' .$utm . '-free-user';
|
718 |
+
}
|
719 |
+
return $url;
|
720 |
}
|
721 |
|
722 |
}
|
languages/advanced-ads.pot
CHANGED
@@ -3,7 +3,7 @@ msgid ""
|
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Advanved Ads\n"
|
5 |
"Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
|
6 |
-
"POT-Creation-Date: 2019-02-
|
7 |
"POT-Revision-Date: Wed Jul 13 2016 13:23:05 GMT+0200 (CEST)\n"
|
8 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
9 |
"Last-Translator: Thomas Maier <post@webzunft.de>\n"
|
@@ -23,40 +23,40 @@ msgstr ""
|
|
23 |
"X-Poedit-Basepath: ../\n"
|
24 |
"X-Poedit-SearchPath-0: ."
|
25 |
|
26 |
-
#: admin/class-advanced-ads-admin.php:
|
27 |
#: classes/visitor-conditions.php:242 admin/views/ad-display-metabox.php:189
|
28 |
#: modules/gadsense/admin/views/adsense-ad-parameters.php:89
|
29 |
#: modules/gadsense/admin/views/adsense-ad-parameters.php:92
|
30 |
msgid "or"
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: admin/class-advanced-ads-admin.php:
|
34 |
#: classes/visitor-conditions.php:242 admin/views/ad-visitor-metabox.php:157
|
35 |
msgid "and"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: admin/class-advanced-ads-admin.php:
|
39 |
msgid "After which paragraph?"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: admin/class-advanced-ads-admin.php:
|
43 |
#, php-format
|
44 |
msgid "time of %s"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: admin/class-advanced-ads-admin.php:
|
48 |
-
#: admin/includes/class-menu.php:
|
49 |
#: modules/gadsense/admin/admin.php:198
|
50 |
msgid "Support"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: admin/class-advanced-ads-admin.php:
|
54 |
-
#: admin/includes/class-overview-widgets.php:
|
55 |
msgid "Add-Ons"
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: admin/class-advanced-ads-admin.php:
|
59 |
-
#: admin/includes/class-overview-widgets.php:
|
60 |
#, php-format
|
61 |
msgid ""
|
62 |
"Thank the developer with a ★★★★★ review on <a "
|
@@ -96,11 +96,11 @@ msgid "main query"
|
|
96 |
msgstr ""
|
97 |
|
98 |
#: classes/ad-debug.php:118 classes/ad-debug.php:167 classes/ad-debug.php:169
|
99 |
-
#: public/class-advanced-ads.php:
|
100 |
msgid "Ad"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: classes/ad-debug.php:121 public/class-advanced-ads.php:
|
104 |
msgctxt "ad group singular name"
|
105 |
msgid "Ad Group"
|
106 |
msgstr ""
|
@@ -118,6 +118,7 @@ msgid "Visitor Conditions"
|
|
118 |
msgstr ""
|
119 |
|
120 |
#: classes/ad-debug.php:272 classes/frontend_checks.php:235
|
|
|
121 |
msgid ""
|
122 |
"Your website is using HTTPS, but the ad code contains HTTP and might not "
|
123 |
"work."
|
@@ -214,7 +215,7 @@ msgstr ""
|
|
214 |
msgid "Set <em>%s</em> to show more ads"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: classes/ad_placements.php:590 admin/includes/class-settings.php:
|
218 |
msgid "Disable level limitation"
|
219 |
msgstr ""
|
220 |
|
@@ -333,14 +334,6 @@ msgstr ""
|
|
333 |
msgid "No shortcode detected in your code."
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: classes/checks.php:302
|
337 |
-
#, php-format
|
338 |
-
msgid ""
|
339 |
-
"Possible conflict between jQueryUI library, used by Advanced Ads and other "
|
340 |
-
"libraries (probably <a href=\"%s\">Twitter Bootstrap</a>). This might lead "
|
341 |
-
"to misfortunate formats in forms, but should not damage features."
|
342 |
-
msgstr ""
|
343 |
-
|
344 |
#: classes/display-conditions.php:69
|
345 |
msgid "post type"
|
346 |
msgstr ""
|
@@ -525,54 +518,45 @@ msgstr ""
|
|
525 |
msgid "Unable to locate needed folder (%s)."
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: classes/frontend_checks.php:
|
529 |
msgid "Random AdSense ads"
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: classes/frontend_checks.php:
|
533 |
msgid "You look like a bot"
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: classes/frontend_checks.php:
|
537 |
msgid "Ad blocker enabled"
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: classes/frontend_checks.php:
|
541 |
#, php-format
|
542 |
msgid "<em>%s</em> filter does not exist"
|
543 |
msgstr ""
|
544 |
|
545 |
-
#: classes/frontend_checks.php:
|
546 |
msgid "Ads are disabled on this page"
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: classes/frontend_checks.php:
|
550 |
msgid "Ads are disabled in the content of this page"
|
551 |
msgstr ""
|
552 |
|
553 |
-
#: classes/frontend_checks.php:
|
554 |
msgid "the current post ID is 0 "
|
555 |
msgstr ""
|
556 |
|
557 |
-
#: classes/frontend_checks.php:183
|
558 |
-
msgid "Ads are disabled on all pages"
|
559 |
-
msgstr ""
|
560 |
-
|
561 |
#: classes/frontend_checks.php:196
|
562 |
-
msgid "Ads are disabled on
|
563 |
msgstr ""
|
564 |
|
565 |
#: classes/frontend_checks.php:209
|
566 |
-
msgid "Ads are disabled on
|
567 |
msgstr ""
|
568 |
|
569 |
#: classes/frontend_checks.php:222
|
570 |
-
|
571 |
-
#: modules/import-export/classes/XmlEncoder.php:64
|
572 |
-
#: modules/import-export/classes/XmlEncoder.php:193
|
573 |
-
#: modules/import-export/classes/XmlEncoder.php:196
|
574 |
-
#, php-format
|
575 |
-
msgid "The %s extension(s) is not loaded"
|
576 |
msgstr ""
|
577 |
|
578 |
#: classes/frontend_checks.php:236
|
@@ -580,16 +564,16 @@ msgstr ""
|
|
580 |
msgid "Ad IDs: %s"
|
581 |
msgstr ""
|
582 |
|
583 |
-
#: classes/frontend_checks.php:248
|
584 |
#, php-format
|
585 |
msgid "Visible ads should not use the Header placement: %s"
|
586 |
msgstr ""
|
587 |
|
588 |
-
#: classes/frontend_checks.php:262
|
589 |
msgid "AdSense violation"
|
590 |
msgstr ""
|
591 |
|
592 |
-
#: classes/frontend_checks.php:263
|
593 |
msgid "Ad is hidden"
|
594 |
msgstr ""
|
595 |
|
@@ -619,25 +603,30 @@ msgstr ""
|
|
619 |
msgid "Auto ads code found"
|
620 |
msgstr ""
|
621 |
|
622 |
-
#: classes/frontend_checks.php:
|
623 |
msgid "Ad Health"
|
624 |
msgstr ""
|
625 |
|
626 |
-
#: classes/frontend_checks.php:
|
|
|
|
|
|
|
|
|
|
|
627 |
msgid "Everything is fine"
|
628 |
msgstr ""
|
629 |
|
630 |
-
#: classes/frontend_checks.php:
|
631 |
msgid "Get help"
|
632 |
msgstr ""
|
633 |
|
634 |
-
#: classes/frontend_checks.php:
|
635 |
msgid ""
|
636 |
"the following code is used for automatic error detection and only visible to "
|
637 |
"admins"
|
638 |
msgstr ""
|
639 |
|
640 |
-
#: classes/frontend_checks.php:
|
641 |
#, php-format
|
642 |
msgid ""
|
643 |
"This ad was automatically placed here by AdSense. <a href=\"%s\" "
|
@@ -705,7 +694,7 @@ msgstr ""
|
|
705 |
msgid "--empty--"
|
706 |
msgstr ""
|
707 |
|
708 |
-
#: classes/widget.php:79 admin/includes/class-menu.php:
|
709 |
#: admin/includes/class-shortcode-creator.php:98 admin/views/placements.php:26
|
710 |
#: modules/gutenberg/includes/class-gutenberg.php:81
|
711 |
#: modules/import-export/views/page.php:25
|
@@ -718,8 +707,8 @@ msgstr ""
|
|
718 |
msgid "Ad Groups"
|
719 |
msgstr ""
|
720 |
|
721 |
-
#: classes/widget.php:93 public/class-advanced-ads.php:
|
722 |
-
#: admin/includes/class-menu.php:
|
723 |
#: admin/includes/class-shortcode-creator.php:84
|
724 |
#: admin/views/ad-group-list-form-row.php:90
|
725 |
#: admin/views/ad-group-list-header.php:17 admin/views/placements-item.php:16
|
@@ -764,61 +753,61 @@ msgstr ""
|
|
764 |
msgid "Advanced Ads Error: %s"
|
765 |
msgstr ""
|
766 |
|
767 |
-
#: public/class-advanced-ads.php:
|
768 |
msgctxt "ad group general name"
|
769 |
msgid "Ad Groups & Rotations"
|
770 |
msgstr ""
|
771 |
|
772 |
-
#: public/class-advanced-ads.php:
|
773 |
msgid "Search Ad Groups"
|
774 |
msgstr ""
|
775 |
|
776 |
-
#: public/class-advanced-ads.php:
|
777 |
msgid "All Ad Groups"
|
778 |
msgstr ""
|
779 |
|
780 |
-
#: public/class-advanced-ads.php:
|
781 |
msgid "Parent Ad Groups"
|
782 |
msgstr ""
|
783 |
|
784 |
-
#: public/class-advanced-ads.php:
|
785 |
msgid "Parent Ad Groups:"
|
786 |
msgstr ""
|
787 |
|
788 |
-
#: public/class-advanced-ads.php:
|
789 |
msgid "Edit Ad Group"
|
790 |
msgstr ""
|
791 |
|
792 |
-
#: public/class-advanced-ads.php:
|
793 |
msgid "Update Ad Group"
|
794 |
msgstr ""
|
795 |
|
796 |
-
#: public/class-advanced-ads.php:
|
797 |
msgid "Add New Ad Group"
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: public/class-advanced-ads.php:
|
801 |
msgid "New Ad Groups Name"
|
802 |
msgstr ""
|
803 |
|
804 |
-
#: public/class-advanced-ads.php:
|
805 |
msgid "Groups"
|
806 |
msgstr ""
|
807 |
|
808 |
-
#: public/class-advanced-ads.php:
|
809 |
msgid "No Ad Group found"
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: public/class-advanced-ads.php:
|
813 |
-
#: admin/includes/class-menu.php:
|
814 |
msgid "New Ad"
|
815 |
msgstr ""
|
816 |
|
817 |
-
#: public/class-advanced-ads.php:
|
818 |
msgid "Add New Ad"
|
819 |
msgstr ""
|
820 |
|
821 |
-
#: public/class-advanced-ads.php:
|
822 |
#: admin/includes/class-ad-groups-list.php:313
|
823 |
#: modules/import-export/classes/import.php:146
|
824 |
#: modules/import-export/classes/import.php:186
|
@@ -826,39 +815,135 @@ msgstr ""
|
|
826 |
msgid "Edit"
|
827 |
msgstr ""
|
828 |
|
829 |
-
#: public/class-advanced-ads.php:
|
830 |
msgid "Edit Ad"
|
831 |
msgstr ""
|
832 |
|
833 |
-
#: public/class-advanced-ads.php:
|
834 |
msgid "View"
|
835 |
msgstr ""
|
836 |
|
837 |
-
#: public/class-advanced-ads.php:
|
838 |
msgid "View the Ad"
|
839 |
msgstr ""
|
840 |
|
841 |
-
#: public/class-advanced-ads.php:
|
842 |
msgid "Search Ads"
|
843 |
msgstr ""
|
844 |
|
845 |
-
#: public/class-advanced-ads.php:
|
846 |
msgid "No Ads found"
|
847 |
msgstr ""
|
848 |
|
849 |
-
#: public/class-advanced-ads.php:
|
850 |
msgid "No Ads found in Trash"
|
851 |
msgstr ""
|
852 |
|
853 |
-
#: public/class-advanced-ads.php:
|
854 |
msgid "Parent Ad"
|
855 |
msgstr ""
|
856 |
|
857 |
-
#: public/class-advanced-ads.php:
|
858 |
msgctxt "label above ads"
|
859 |
msgid "Advertisements"
|
860 |
msgstr ""
|
861 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
#: admin/includes/class-ad-groups-list.php:165
|
863 |
msgid "Ad weight"
|
864 |
msgstr ""
|
@@ -1105,36 +1190,36 @@ msgstr ""
|
|
1105 |
msgid "any expiry date"
|
1106 |
msgstr ""
|
1107 |
|
1108 |
-
#: admin/includes/class-menu.php:
|
1109 |
-
#: admin/includes/class-menu.php:
|
1110 |
msgid "Overview"
|
1111 |
msgstr ""
|
1112 |
|
1113 |
-
#: admin/includes/class-menu.php:
|
1114 |
msgid "Ad Groups & Rotations"
|
1115 |
msgstr ""
|
1116 |
|
1117 |
-
#: admin/includes/class-menu.php:
|
1118 |
msgid "Groups & Rotation"
|
1119 |
msgstr ""
|
1120 |
|
1121 |
-
#: admin/includes/class-menu.php:
|
1122 |
msgid "Ad Placements"
|
1123 |
msgstr ""
|
1124 |
|
1125 |
-
#: admin/includes/class-menu.php:
|
1126 |
msgid "Advanced Ads Settings"
|
1127 |
msgstr ""
|
1128 |
|
1129 |
-
#: admin/includes/class-menu.php:
|
1130 |
msgid "Settings"
|
1131 |
msgstr ""
|
1132 |
|
1133 |
-
#: admin/includes/class-menu.php:
|
1134 |
msgid "Sorry, you are not allowed to access this feature."
|
1135 |
msgstr ""
|
1136 |
|
1137 |
-
#: admin/includes/class-menu.php:
|
1138 |
msgid ""
|
1139 |
"You attempted to edit an ad group that doesn’t exist. Perhaps it was "
|
1140 |
"deleted?"
|
@@ -1148,7 +1233,7 @@ msgstr ""
|
|
1148 |
msgid "Ad Parameters"
|
1149 |
msgstr ""
|
1150 |
|
1151 |
-
#: admin/includes/class-meta-box.php:64
|
1152 |
msgid "Layout / Output"
|
1153 |
msgstr ""
|
1154 |
|
@@ -1161,7 +1246,7 @@ msgid "Ad Stats"
|
|
1161 |
msgstr ""
|
1162 |
|
1163 |
#: admin/includes/class-meta-box.php:140 admin/includes/class-meta-box.php:151
|
1164 |
-
#: admin/includes/class-meta-box.php:156 admin/includes/class-settings.php:
|
1165 |
#: admin/views/ad-output-metabox.php:81
|
1166 |
#: modules/privacy/admin/views/setting-enable.php:2
|
1167 |
msgid "Manual"
|
@@ -1201,19 +1286,19 @@ msgstr ""
|
|
1201 |
msgid "Latest posts on wpadvancedads.com"
|
1202 |
msgstr ""
|
1203 |
|
1204 |
-
#: admin/includes/class-notices.php:
|
1205 |
#, php-format
|
1206 |
msgid ""
|
1207 |
"You don’t seem to have an email address. Please use <a href=\"%s\" "
|
1208 |
"target=\"_blank\">this form</a> to sign up."
|
1209 |
msgstr ""
|
1210 |
|
1211 |
-
#: admin/includes/class-notices.php:
|
1212 |
msgid ""
|
1213 |
"How embarrassing. The email server seems to be down. Please try again later."
|
1214 |
msgstr ""
|
1215 |
|
1216 |
-
#: admin/includes/class-notices.php:
|
1217 |
#, php-format
|
1218 |
msgid ""
|
1219 |
"Please check your email (%s) for the confirmation message. If you didn’t "
|
@@ -1221,20 +1306,15 @@ msgid ""
|
|
1221 |
"href=\"%s\" target=\"_blank\">this form</a> to sign up."
|
1222 |
msgstr ""
|
1223 |
|
1224 |
-
#: admin/includes/class-overview-widgets.php:
|
1225 |
msgid "Next steps"
|
1226 |
msgstr ""
|
1227 |
|
1228 |
-
#: admin/includes/class-overview-widgets.php:
|
1229 |
msgid "Manual and Support"
|
1230 |
msgstr ""
|
1231 |
|
1232 |
-
#: admin/includes/class-overview-widgets.php:
|
1233 |
-
#: admin/views/notices/welcome-panel.php:6
|
1234 |
-
msgid "Create your first ad"
|
1235 |
-
msgstr ""
|
1236 |
-
|
1237 |
-
#: admin/includes/class-overview-widgets.php:68
|
1238 |
#: modules/gadsense/admin/views/adsense-account.php:99
|
1239 |
#: modules/gadsense/admin/views/adsense-account.php:117
|
1240 |
#: modules/gadsense/admin/views/adsense-ad-parameters.php:94
|
@@ -1242,312 +1322,316 @@ msgstr ""
|
|
1242 |
msgid "Connect to AdSense"
|
1243 |
msgstr ""
|
1244 |
|
1245 |
-
#: admin/includes/class-overview-widgets.php:
|
1246 |
msgid "Join the newsletter for more benefits"
|
1247 |
msgstr ""
|
1248 |
|
1249 |
-
#: admin/includes/class-overview-widgets.php:
|
1250 |
msgid "Get 2 free add-ons"
|
1251 |
msgstr ""
|
1252 |
|
1253 |
-
#: admin/includes/class-overview-widgets.php:
|
1254 |
msgid "Get the first steps and more tutorials to your inbox"
|
1255 |
msgstr ""
|
1256 |
|
1257 |
-
#: admin/includes/class-overview-widgets.php:
|
1258 |
msgid "How to earn more with AdSense"
|
1259 |
msgstr ""
|
1260 |
|
1261 |
-
#: admin/includes/class-overview-widgets.php:
|
1262 |
msgid "Join now"
|
1263 |
msgstr ""
|
1264 |
|
1265 |
-
#: admin/includes/class-overview-widgets.php:
|
1266 |
msgid ""
|
1267 |
"Do you find Advanced Ads useful and would like to keep us motivated? Please "
|
1268 |
"help us with a review."
|
1269 |
msgstr ""
|
1270 |
|
1271 |
-
#: admin/includes/class-overview-widgets.php:
|
1272 |
msgid "Sure, I’ll rate the plugin"
|
1273 |
msgstr ""
|
1274 |
|
1275 |
-
#: admin/includes/class-overview-widgets.php:
|
1276 |
msgid "I already did"
|
1277 |
msgstr ""
|
1278 |
|
1279 |
-
#: admin/includes/class-overview-widgets.php:
|
1280 |
msgid "Manage your ads"
|
1281 |
msgstr ""
|
1282 |
|
1283 |
-
#: admin/includes/class-overview-widgets.php:
|
1284 |
msgid "Get the All Access pass"
|
1285 |
msgstr ""
|
1286 |
|
1287 |
-
#: admin/includes/class-overview-widgets.php:
|
1288 |
#: admin/views/notices/welcome-panel.php:22
|
1289 |
#, php-format
|
1290 |
msgid "<a href=\"%s\" target=\"_blank\">Manual</a>"
|
1291 |
msgstr ""
|
1292 |
|
1293 |
-
#: admin/includes/class-overview-widgets.php:
|
1294 |
#, php-format
|
1295 |
msgid "<a href=\"%s\" target=\"_blank\">FAQ and Support</a>"
|
1296 |
msgstr ""
|
1297 |
|
1298 |
-
#: admin/includes/class-overview-widgets.php:
|
1299 |
msgid "The solution for professional websites."
|
1300 |
msgstr ""
|
1301 |
|
1302 |
-
#: admin/includes/class-overview-widgets.php:
|
1303 |
#: admin/views/pitch-pro-tab.php:7
|
1304 |
msgid "support for cached sites"
|
1305 |
msgstr ""
|
1306 |
|
1307 |
-
#: admin/includes/class-overview-widgets.php:
|
1308 |
-
#: admin/includes/class-overview-widgets.php:
|
1309 |
-
#: admin/includes/class-overview-widgets.php:
|
1310 |
-
#: admin/includes/class-overview-widgets.php:
|
1311 |
#, php-format
|
1312 |
msgid "integrates with <strong>%s</strong>"
|
1313 |
msgstr ""
|
1314 |
|
1315 |
-
#: admin/includes/class-overview-widgets.php:
|
1316 |
msgid "click fraud protection, lazy load, ad-block ads"
|
1317 |
msgstr ""
|
1318 |
|
1319 |
-
#: admin/includes/class-overview-widgets.php:
|
1320 |
#: admin/views/pitch-pro-tab.php:8
|
1321 |
msgid "11 more display and visitor conditions"
|
1322 |
msgstr ""
|
1323 |
|
1324 |
-
#: admin/includes/class-overview-widgets.php:
|
1325 |
#: admin/views/pitch-pro-tab.php:9
|
1326 |
msgid "6 more placements"
|
1327 |
msgstr ""
|
1328 |
|
1329 |
-
#: admin/includes/class-overview-widgets.php:
|
1330 |
#: admin/views/pitch-pro-tab.php:10
|
1331 |
msgid "placement tests for ad optimization"
|
1332 |
msgstr ""
|
1333 |
|
1334 |
-
#: admin/includes/class-overview-widgets.php:
|
1335 |
#: admin/views/pitch-pro-tab.php:11
|
1336 |
msgid "ad grids and many more advanced features"
|
1337 |
msgstr ""
|
1338 |
|
1339 |
-
#: admin/includes/class-overview-widgets.php:
|
1340 |
msgid ""
|
1341 |
"Analyze clicks and impressions of your ads locally or in Google Analytics, "
|
1342 |
"share reports, and limit ads to a specific number of impressions or clicks."
|
1343 |
msgstr ""
|
1344 |
|
1345 |
-
#: admin/includes/class-overview-widgets.php:
|
1346 |
msgid ""
|
1347 |
"Display ads based on the device or the size of your visitor’s browser, and "
|
1348 |
"control ads on AMP pages."
|
1349 |
msgstr ""
|
1350 |
|
1351 |
-
#: admin/includes/class-overview-widgets.php:
|
1352 |
msgid ""
|
1353 |
"Earn more money and let advertisers pay for ad space directly on the "
|
1354 |
"frontend of your site."
|
1355 |
msgstr ""
|
1356 |
|
1357 |
-
#: admin/includes/class-overview-widgets.php:
|
1358 |
msgid ""
|
1359 |
"Target visitors with ads that match their geo location and make more money "
|
1360 |
"with regional campaigns."
|
1361 |
msgstr ""
|
1362 |
|
1363 |
-
#: admin/includes/class-overview-widgets.php:
|
1364 |
msgid ""
|
1365 |
"Increase click rates on your ads by placing them in sticky positions above, "
|
1366 |
"next or below your site."
|
1367 |
msgstr ""
|
1368 |
|
1369 |
-
#: admin/includes/class-overview-widgets.php:
|
1370 |
msgid ""
|
1371 |
"Users will never miss an ad or other information in a PopUp. Choose when it "
|
1372 |
"shows up and for how long a user can close it."
|
1373 |
msgstr ""
|
1374 |
|
1375 |
-
#: admin/includes/class-overview-widgets.php:
|
1376 |
msgid ""
|
1377 |
"Create a beautiful and simple slider from your ads to show more information "
|
1378 |
"on less space."
|
1379 |
msgstr ""
|
1380 |
|
1381 |
-
#: admin/includes/class-overview-widgets.php:
|
1382 |
msgid ""
|
1383 |
"Place AdSense In-feed ads between posts on homepage, category, and archive "
|
1384 |
"pages."
|
1385 |
msgstr ""
|
1386 |
|
1387 |
-
#: admin/includes/class-overview-widgets.php:
|
1388 |
-
#: admin/includes/class-overview-widgets.php:
|
1389 |
-
#: admin/includes/class-overview-widgets.php:
|
1390 |
msgid "Install now"
|
1391 |
msgstr ""
|
1392 |
|
1393 |
-
#: admin/includes/class-overview-widgets.php:
|
1394 |
-
#: admin/includes/class-overview-widgets.php:
|
1395 |
-
#: admin/includes/class-overview-widgets.php:
|
1396 |
-
#: admin/includes/class-overview-widgets.php:
|
1397 |
-
#: admin/includes/class-overview-widgets.php:
|
1398 |
-
#: admin/includes/class-overview-widgets.php:
|
1399 |
-
#: admin/includes/class-overview-widgets.php:
|
1400 |
-
#: admin/includes/class-overview-widgets.php:
|
1401 |
msgid "Activate now"
|
1402 |
msgstr ""
|
1403 |
|
1404 |
-
#: admin/includes/class-overview-widgets.php:
|
1405 |
msgid "Visit your ad stats"
|
1406 |
msgstr ""
|
1407 |
|
1408 |
-
#: admin/includes/class-overview-widgets.php:
|
1409 |
msgid "Use Genesis specific ad positions."
|
1410 |
msgstr ""
|
1411 |
|
1412 |
-
#: admin/includes/class-overview-widgets.php:
|
1413 |
msgid ""
|
1414 |
"Manage ad positions with WPBakery Page Builder (formerly Visual Composer)."
|
1415 |
msgstr ""
|
1416 |
|
1417 |
-
#: admin/includes/class-overview-widgets.php:
|
1418 |
msgid "Our best deal with all add-ons included."
|
1419 |
msgstr ""
|
1420 |
|
1421 |
-
#: admin/includes/class-overview-widgets.php:
|
1422 |
msgid "Get full access"
|
1423 |
msgstr ""
|
1424 |
|
1425 |
-
#: admin/includes/class-overview-widgets.php:
|
1426 |
#: admin/views/ad-display-metabox.php:48 admin/views/ad-visitor-metabox.php:47
|
1427 |
msgid "Visit the manual"
|
1428 |
msgstr ""
|
1429 |
|
1430 |
-
#: admin/includes/class-overview-widgets.php:
|
1431 |
msgid "Get this add-on"
|
1432 |
msgstr ""
|
1433 |
|
1434 |
-
#: admin/includes/class-settings.php:
|
|
|
|
|
|
|
|
|
1435 |
msgid "Disable ads"
|
1436 |
msgstr ""
|
1437 |
|
1438 |
-
#: admin/includes/class-settings.php:
|
1439 |
-
msgid "
|
1440 |
msgstr ""
|
1441 |
|
1442 |
-
#: admin/includes/class-settings.php:
|
1443 |
-
msgid "
|
1444 |
msgstr ""
|
1445 |
|
1446 |
-
#: admin/includes/class-settings.php:
|
1447 |
msgid "Unlimited ad injection"
|
1448 |
msgstr ""
|
1449 |
|
1450 |
-
#: admin/includes/class-settings.php:
|
1451 |
msgid "Priority of content injection filter"
|
1452 |
msgstr ""
|
1453 |
|
1454 |
-
#: admin/includes/class-settings.php:
|
1455 |
msgid "Hide ads from bots"
|
1456 |
msgstr ""
|
1457 |
|
1458 |
-
#: admin/includes/class-settings.php:
|
1459 |
-
msgid "Disable notices"
|
1460 |
msgstr ""
|
1461 |
|
1462 |
-
#: admin/includes/class-settings.php:
|
1463 |
msgid "ID prefix"
|
1464 |
msgstr ""
|
1465 |
|
1466 |
-
#: admin/includes/class-settings.php:
|
1467 |
msgid "Allow editors to manage ads"
|
1468 |
msgstr ""
|
1469 |
|
1470 |
-
#: admin/includes/class-settings.php:
|
1471 |
msgid "Ad label"
|
1472 |
msgstr ""
|
1473 |
|
1474 |
-
#: admin/includes/class-settings.php:
|
1475 |
msgid "Open links in a new window"
|
1476 |
msgstr ""
|
1477 |
|
1478 |
-
#: admin/includes/class-settings.php:
|
|
|
|
|
|
|
|
|
1479 |
msgid "Delete data on uninstall"
|
1480 |
msgstr ""
|
1481 |
|
1482 |
-
#: admin/includes/class-settings.php:
|
1483 |
msgid "Disable shortcode button"
|
1484 |
msgstr ""
|
1485 |
|
1486 |
-
#: admin/includes/class-settings.php:
|
1487 |
msgid "Licenses"
|
1488 |
msgstr ""
|
1489 |
|
1490 |
-
#: admin/includes/class-settings.php:
|
1491 |
msgid "Pro"
|
1492 |
msgstr ""
|
1493 |
|
1494 |
-
#: admin/includes/class-settings.php:
|
1495 |
msgid "Tracking"
|
1496 |
msgstr ""
|
1497 |
|
1498 |
-
#: admin/includes/class-settings.php:
|
1499 |
#, php-format
|
1500 |
msgid ""
|
1501 |
"Enter license keys for our powerful <a href=\"%s\" target=\"_blank\">add-"
|
1502 |
"ons</a>."
|
1503 |
msgstr ""
|
1504 |
|
1505 |
-
#: admin/includes/class-settings.php:
|
1506 |
#, php-format
|
1507 |
msgid ""
|
1508 |
"See also <a href=\"%s\" target=\"_blank\">Issues and questions about "
|
1509 |
"licenses</a>."
|
1510 |
msgstr ""
|
1511 |
|
1512 |
-
#: admin/includes/class-settings.php:
|
1513 |
msgid "Are you missing something?"
|
1514 |
msgstr ""
|
1515 |
|
1516 |
-
#: admin/includes/class-settings.php:
|
1517 |
msgid "(display to all)"
|
1518 |
msgstr ""
|
1519 |
|
1520 |
-
#: admin/includes/class-settings.php:
|
1521 |
msgid "Subscriber"
|
1522 |
msgstr ""
|
1523 |
|
1524 |
-
#: admin/includes/class-settings.php:
|
1525 |
msgid "Contributor"
|
1526 |
msgstr ""
|
1527 |
|
1528 |
-
#: admin/includes/class-settings.php:
|
1529 |
msgid "Author"
|
1530 |
msgstr ""
|
1531 |
|
1532 |
-
#: admin/includes/class-settings.php:
|
1533 |
msgid "Editor"
|
1534 |
msgstr ""
|
1535 |
|
1536 |
-
#: admin/includes/class-settings.php:
|
1537 |
-
msgid "Admin"
|
1538 |
-
msgstr ""
|
1539 |
-
|
1540 |
-
#: admin/includes/class-settings.php:365
|
1541 |
msgid "Choose the lowest role a user must have in order to not see any ads."
|
1542 |
msgstr ""
|
1543 |
|
1544 |
-
#: admin/includes/class-settings.php:
|
1545 |
msgid ""
|
1546 |
"<strong>notice: </strong>the file is currently enabled by an add-on that "
|
1547 |
"needs it."
|
1548 |
msgstr ""
|
1549 |
|
1550 |
-
#: admin/includes/class-settings.php:
|
1551 |
#, php-format
|
1552 |
msgid ""
|
1553 |
"Enable advanced JavaScript functions (<a href=\"%s\" target=\"_blank\">"
|
@@ -1555,7 +1639,7 @@ msgid ""
|
|
1555 |
"need features from this file."
|
1556 |
msgstr ""
|
1557 |
|
1558 |
-
#: admin/includes/class-settings.php:
|
1559 |
msgid ""
|
1560 |
"Some plugins and themes trigger ad injections where it shouldn’t happen. "
|
1561 |
"Therefore, Advanced Ads ignores injected placements on non-singular pages "
|
@@ -1565,72 +1649,73 @@ msgid ""
|
|
1565 |
"injection only in the first x posts on your archive pages."
|
1566 |
msgstr ""
|
1567 |
|
1568 |
-
#: admin/includes/class-settings.php:
|
1569 |
msgid ""
|
1570 |
"Please check your post content. A priority of 10 and below might cause "
|
1571 |
"issues (wpautop function might run twice)."
|
1572 |
msgstr ""
|
1573 |
|
1574 |
-
#: admin/includes/class-settings.php:
|
1575 |
msgid ""
|
1576 |
"Play with this value in order to change the priority of the injected ads "
|
1577 |
"compared to other auto injected elements in the post content."
|
1578 |
msgstr ""
|
1579 |
|
1580 |
-
#: admin/includes/class-settings.php:
|
1581 |
msgid ""
|
1582 |
"Advanced Ads ignores paragraphs and other elements in containers when "
|
1583 |
"injecting ads into the post content. Check this option to ignore this "
|
1584 |
"limitation and ads might show up again."
|
1585 |
msgstr ""
|
1586 |
|
1587 |
-
#: admin/includes/class-settings.php:
|
1588 |
msgid "Read this first"
|
1589 |
msgstr ""
|
1590 |
|
1591 |
-
#: admin/includes/class-settings.php:
|
1592 |
msgid "Hide ads from crawlers, bots and empty user agents."
|
1593 |
msgstr ""
|
1594 |
|
1595 |
-
|
|
|
|
|
1596 |
msgid ""
|
1597 |
-
"Disable
|
1598 |
-
"notices
|
1599 |
-
"Advanced Ads already."
|
1600 |
msgstr ""
|
1601 |
|
1602 |
-
#: admin/includes/class-settings.php:
|
1603 |
msgid ""
|
1604 |
"Prefix of class or id attributes in the frontend. Change it if you don’t "
|
1605 |
"want <strong>ad blockers</strong> to mark these blocks as ads.<br/>You might "
|
1606 |
"need to <strong>rewrite css rules afterwards</strong>."
|
1607 |
msgstr ""
|
1608 |
|
1609 |
-
#: admin/includes/class-settings.php:
|
1610 |
msgid "Allow editors to also manage and publish ads."
|
1611 |
msgstr ""
|
1612 |
|
1613 |
-
#: admin/includes/class-settings.php:
|
1614 |
#, php-format
|
1615 |
msgid ""
|
1616 |
"You can assign different ad-related roles on a user basis with <a "
|
1617 |
"href=\"%s\" target=\"_blank\">Advanced Ads Pro</a>."
|
1618 |
msgstr ""
|
1619 |
|
1620 |
-
#: admin/includes/class-settings.php:
|
1621 |
msgctxt "label before ads"
|
1622 |
msgid "Advertisements"
|
1623 |
msgstr ""
|
1624 |
|
1625 |
-
#: admin/includes/class-settings.php:
|
1626 |
msgid "Displayed above ads."
|
1627 |
msgstr ""
|
1628 |
|
1629 |
-
#: admin/includes/class-settings.php:
|
1630 |
msgid "Clean up all data related to Advanced Ads when removing the plugin."
|
1631 |
msgstr ""
|
1632 |
|
1633 |
-
#: admin/includes/class-settings.php:
|
1634 |
msgid "Disable shortcode button in visual editor."
|
1635 |
msgstr ""
|
1636 |
|
@@ -1672,17 +1757,6 @@ msgstr ""
|
|
1672 |
msgid "Subscribe me now"
|
1673 |
msgstr ""
|
1674 |
|
1675 |
-
#: admin/includes/notices.php:37
|
1676 |
-
msgid ""
|
1677 |
-
"One or more license keys for <strong>Advanced Ads add-ons are invalid or "
|
1678 |
-
"missing</strong>."
|
1679 |
-
msgstr ""
|
1680 |
-
|
1681 |
-
#: admin/includes/notices.php:37
|
1682 |
-
#, php-format
|
1683 |
-
msgid "Please add valid license keys <a href=\"%s\">here</a>."
|
1684 |
-
msgstr ""
|
1685 |
-
|
1686 |
#: admin/includes/notices.php:43
|
1687 |
#, php-format
|
1688 |
msgid "You’ve successfully <strong>created %s ads using Advanced Ads</strong>."
|
@@ -1699,21 +1773,13 @@ msgstr ""
|
|
1699 |
#: admin/includes/notices.php:57
|
1700 |
#, php-format
|
1701 |
msgid ""
|
1702 |
-
"Some assets were changed. Please <strong>rebuild the asset folder</strong> "
|
1703 |
-
"in the <a href=\"%s\">Advanced Ads settings</a> to update the ad blocker "
|
1704 |
-
"disguise."
|
1705 |
-
msgstr ""
|
1706 |
-
|
1707 |
-
#: admin/includes/notices.php:63
|
1708 |
-
#, php-format
|
1709 |
-
msgid ""
|
1710 |
"Our Black Friday / Cyber Monday Offer: <span style=\"font-weight: bold; font-"
|
1711 |
"size: 1.4em; color: green;\">-30%%</span> on all add-ons and All Access.<a "
|
1712 |
"class=\"button button-primary\" target=\"_blank\" href=\"%s\">Get All "
|
1713 |
"Access</a>"
|
1714 |
msgstr ""
|
1715 |
|
1716 |
-
#: admin/includes/notices.php:
|
1717 |
#, php-format
|
1718 |
msgid ""
|
1719 |
"Our Black Friday / Cyber Monday Offer: <span style=\"font-weight: bold; font-"
|
@@ -2322,68 +2388,11 @@ msgstr ""
|
|
2322 |
msgid "not on mobile devices"
|
2323 |
msgstr ""
|
2324 |
|
2325 |
-
#: admin/views/checks.php:
|
2326 |
#, php-format
|
2327 |
msgid ""
|
2328 |
-
"
|
2329 |
-
"
|
2330 |
-
"recommended. Please ask your hosting provider for more information."
|
2331 |
-
msgstr ""
|
2332 |
-
|
2333 |
-
#: admin/views/checks.php:13
|
2334 |
-
#, php-format
|
2335 |
-
msgid ""
|
2336 |
-
"Your <strong>website uses cache</strong>. Some dynamic features like ad "
|
2337 |
-
"rotation or visitor conditions might not work properly. Use the cache-"
|
2338 |
-
"busting feature of <a href=\"%s\" target=\"_blank\">Advanced Ads Pro</a> to "
|
2339 |
-
"load ads dynamically."
|
2340 |
-
msgstr ""
|
2341 |
-
|
2342 |
-
#: admin/views/checks.php:16
|
2343 |
-
msgid ""
|
2344 |
-
"There is a <strong>new WordPress version available</strong>. Please update."
|
2345 |
-
msgstr ""
|
2346 |
-
|
2347 |
-
#: admin/views/checks.php:19
|
2348 |
-
msgid "There are <strong>plugin updates available</strong>. Please update."
|
2349 |
-
msgstr ""
|
2350 |
-
|
2351 |
-
#: admin/views/checks.php:22
|
2352 |
-
#, php-format
|
2353 |
-
msgid ""
|
2354 |
-
"<strong>Autoptimize plugin detected</strong>. While this plugin is great for "
|
2355 |
-
"site performance, it is known to alter code, including scripts from ad "
|
2356 |
-
"networks. <a href=\"%s\" target=\"_blank\">Advanced Ads Pro</a> has a build-"
|
2357 |
-
"in support for Autoptimize."
|
2358 |
-
msgstr ""
|
2359 |
-
|
2360 |
-
#: admin/views/checks.php:25
|
2361 |
-
#, php-format
|
2362 |
-
msgid ""
|
2363 |
-
"Plugins that are known to cause (partial) problems: <strong>%1$s</strong>. "
|
2364 |
-
"<a href=\"%2$s\" target=\"_blank\">Learn more</a>."
|
2365 |
-
msgstr ""
|
2366 |
-
|
2367 |
-
#: admin/views/checks.php:28
|
2368 |
-
#, php-format
|
2369 |
-
msgid ""
|
2370 |
-
"Missing PHP extensions could cause issues. Please ask your hosting provider "
|
2371 |
-
"to enable them: %s"
|
2372 |
-
msgstr ""
|
2373 |
-
|
2374 |
-
#: admin/views/checks.php:31
|
2375 |
-
#, php-format
|
2376 |
-
msgid ""
|
2377 |
-
"Ads are disabled for all or some pages. See \"disabled ads\" in <a "
|
2378 |
-
"href=\"%s\">settings</a>."
|
2379 |
-
msgstr ""
|
2380 |
-
|
2381 |
-
#: admin/views/checks.php:34
|
2382 |
-
msgid "This site is hosted on wordpress.com."
|
2383 |
-
msgstr ""
|
2384 |
-
|
2385 |
-
#: admin/views/checks.php:38 admin/views/support.php:25
|
2386 |
-
msgid "Advanced Ads related constants enabled"
|
2387 |
msgstr ""
|
2388 |
|
2389 |
#: admin/views/feedback-disable.php:5
|
@@ -2459,6 +2468,12 @@ msgstr ""
|
|
2459 |
msgid "Disabling the plugin now…"
|
2460 |
msgstr ""
|
2461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2462 |
#: admin/views/pitch-bundle.php:1
|
2463 |
msgid "All Access – with all available add-ons"
|
2464 |
msgstr ""
|
@@ -2895,6 +2910,18 @@ msgstr ""
|
|
2895 |
msgid "Import & Export"
|
2896 |
msgstr ""
|
2897 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2898 |
#: admin/views/support.php:6
|
2899 |
msgid ""
|
2900 |
"Please fix the red highlighted issues on this page or try to understand "
|
@@ -3324,6 +3351,14 @@ msgstr ""
|
|
3324 |
msgid "Zero size file downloaded <em>%s</em>"
|
3325 |
msgstr ""
|
3326 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3327 |
#: modules/import-export/classes/XmlEncoder.php:75
|
3328 |
msgctxt "import_export"
|
3329 |
msgid "The data must be an array"
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Advanved Ads\n"
|
5 |
"Report-Msgid-Bugs-To: http://wordpress.org/plugins/plugin-name\n"
|
6 |
+
"POT-Creation-Date: 2019-02-22 12:17+0000\n"
|
7 |
"POT-Revision-Date: Wed Jul 13 2016 13:23:05 GMT+0200 (CEST)\n"
|
8 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
9 |
"Last-Translator: Thomas Maier <post@webzunft.de>\n"
|
23 |
"X-Poedit-Basepath: ../\n"
|
24 |
"X-Poedit-SearchPath-0: ."
|
25 |
|
26 |
+
#: admin/class-advanced-ads-admin.php:222 classes/display-conditions.php:215
|
27 |
#: classes/visitor-conditions.php:242 admin/views/ad-display-metabox.php:189
|
28 |
#: modules/gadsense/admin/views/adsense-ad-parameters.php:89
|
29 |
#: modules/gadsense/admin/views/adsense-ad-parameters.php:92
|
30 |
msgid "or"
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: admin/class-advanced-ads-admin.php:223 classes/display-conditions.php:215
|
34 |
#: classes/visitor-conditions.php:242 admin/views/ad-visitor-metabox.php:157
|
35 |
msgid "and"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: admin/class-advanced-ads-admin.php:224
|
39 |
msgid "After which paragraph?"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: admin/class-advanced-ads-admin.php:336
|
43 |
#, php-format
|
44 |
msgid "time of %s"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: admin/class-advanced-ads-admin.php:401 admin/includes/class-menu.php:113
|
48 |
+
#: admin/includes/class-menu.php:116 admin/views/settings.php:28
|
49 |
#: modules/gadsense/admin/admin.php:198
|
50 |
msgid "Support"
|
51 |
msgstr ""
|
52 |
|
53 |
+
#: admin/class-advanced-ads-admin.php:405
|
54 |
+
#: admin/includes/class-overview-widgets.php:39
|
55 |
msgid "Add-Ons"
|
56 |
msgstr ""
|
57 |
|
58 |
+
#: admin/class-advanced-ads-admin.php:671
|
59 |
+
#: admin/includes/class-overview-widgets.php:154
|
60 |
#, php-format
|
61 |
msgid ""
|
62 |
"Thank the developer with a ★★★★★ review on <a "
|
96 |
msgstr ""
|
97 |
|
98 |
#: classes/ad-debug.php:118 classes/ad-debug.php:167 classes/ad-debug.php:169
|
99 |
+
#: public/class-advanced-ads.php:707 admin/views/ad-group-list-ads.php:13
|
100 |
msgid "Ad"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: classes/ad-debug.php:121 public/class-advanced-ads.php:670
|
104 |
msgctxt "ad group singular name"
|
105 |
msgid "Ad Group"
|
106 |
msgstr ""
|
118 |
msgstr ""
|
119 |
|
120 |
#: classes/ad-debug.php:272 classes/frontend_checks.php:235
|
121 |
+
#: admin/includes/ad-health-notices.php:166
|
122 |
msgid ""
|
123 |
"Your website is using HTTPS, but the ad code contains HTTP and might not "
|
124 |
"work."
|
215 |
msgid "Set <em>%s</em> to show more ads"
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: classes/ad_placements.php:590 admin/includes/class-settings.php:160
|
219 |
msgid "Disable level limitation"
|
220 |
msgstr ""
|
221 |
|
334 |
msgid "No shortcode detected in your code."
|
335 |
msgstr ""
|
336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
#: classes/display-conditions.php:69
|
338 |
msgid "post type"
|
339 |
msgstr ""
|
518 |
msgid "Unable to locate needed folder (%s)."
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: classes/frontend_checks.php:91
|
522 |
msgid "Random AdSense ads"
|
523 |
msgstr ""
|
524 |
|
525 |
+
#: classes/frontend_checks.php:105 admin/includes/class-settings.php:503
|
526 |
msgid "You look like a bot"
|
527 |
msgstr ""
|
528 |
|
529 |
+
#: classes/frontend_checks.php:119
|
530 |
msgid "Ad blocker enabled"
|
531 |
msgstr ""
|
532 |
|
533 |
+
#: classes/frontend_checks.php:138
|
534 |
#, php-format
|
535 |
msgid "<em>%s</em> filter does not exist"
|
536 |
msgstr ""
|
537 |
|
538 |
+
#: classes/frontend_checks.php:157
|
539 |
msgid "Ads are disabled on this page"
|
540 |
msgstr ""
|
541 |
|
542 |
+
#: classes/frontend_checks.php:170
|
543 |
msgid "Ads are disabled in the content of this page"
|
544 |
msgstr ""
|
545 |
|
546 |
+
#: classes/frontend_checks.php:182
|
547 |
msgid "the current post ID is 0 "
|
548 |
msgstr ""
|
549 |
|
|
|
|
|
|
|
|
|
550 |
#: classes/frontend_checks.php:196
|
551 |
+
msgid "Ads are disabled on all pages"
|
552 |
msgstr ""
|
553 |
|
554 |
#: classes/frontend_checks.php:209
|
555 |
+
msgid "Ads are disabled on 404 pages"
|
556 |
msgstr ""
|
557 |
|
558 |
#: classes/frontend_checks.php:222
|
559 |
+
msgid "Ads are disabled on non singular pages"
|
|
|
|
|
|
|
|
|
|
|
560 |
msgstr ""
|
561 |
|
562 |
#: classes/frontend_checks.php:236
|
564 |
msgid "Ad IDs: %s"
|
565 |
msgstr ""
|
566 |
|
567 |
+
#: classes/frontend_checks.php:248 admin/includes/ad-health-notices.php:145
|
568 |
#, php-format
|
569 |
msgid "Visible ads should not use the Header placement: %s"
|
570 |
msgstr ""
|
571 |
|
572 |
+
#: classes/frontend_checks.php:262 admin/includes/ad-health-notices.php:157
|
573 |
msgid "AdSense violation"
|
574 |
msgstr ""
|
575 |
|
576 |
+
#: classes/frontend_checks.php:263 admin/includes/ad-health-notices.php:158
|
577 |
msgid "Ad is hidden"
|
578 |
msgstr ""
|
579 |
|
603 |
msgid "Auto ads code found"
|
604 |
msgstr ""
|
605 |
|
606 |
+
#: classes/frontend_checks.php:345
|
607 |
msgid "Ad Health"
|
608 |
msgstr ""
|
609 |
|
610 |
+
#: classes/frontend_checks.php:355
|
611 |
+
#, php-format
|
612 |
+
msgid "Show %d more notifications"
|
613 |
+
msgstr ""
|
614 |
+
|
615 |
+
#: classes/frontend_checks.php:372
|
616 |
msgid "Everything is fine"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: classes/frontend_checks.php:383
|
620 |
msgid "Get help"
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: classes/frontend_checks.php:429
|
624 |
msgid ""
|
625 |
"the following code is used for automatic error detection and only visible to "
|
626 |
"admins"
|
627 |
msgstr ""
|
628 |
|
629 |
+
#: classes/frontend_checks.php:626
|
630 |
#, php-format
|
631 |
msgid ""
|
632 |
"This ad was automatically placed here by AdSense. <a href=\"%s\" "
|
694 |
msgid "--empty--"
|
695 |
msgstr ""
|
696 |
|
697 |
+
#: classes/widget.php:79 admin/includes/class-menu.php:95
|
698 |
#: admin/includes/class-shortcode-creator.php:98 admin/views/placements.php:26
|
699 |
#: modules/gutenberg/includes/class-gutenberg.php:81
|
700 |
#: modules/import-export/views/page.php:25
|
707 |
msgid "Ad Groups"
|
708 |
msgstr ""
|
709 |
|
710 |
+
#: classes/widget.php:93 public/class-advanced-ads.php:706
|
711 |
+
#: admin/includes/class-menu.php:68 admin/includes/class-menu.php:68
|
712 |
#: admin/includes/class-shortcode-creator.php:84
|
713 |
#: admin/views/ad-group-list-form-row.php:90
|
714 |
#: admin/views/ad-group-list-header.php:17 admin/views/placements-item.php:16
|
753 |
msgid "Advanced Ads Error: %s"
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: public/class-advanced-ads.php:669
|
757 |
msgctxt "ad group general name"
|
758 |
msgid "Ad Groups & Rotations"
|
759 |
msgstr ""
|
760 |
|
761 |
+
#: public/class-advanced-ads.php:671
|
762 |
msgid "Search Ad Groups"
|
763 |
msgstr ""
|
764 |
|
765 |
+
#: public/class-advanced-ads.php:672
|
766 |
msgid "All Ad Groups"
|
767 |
msgstr ""
|
768 |
|
769 |
+
#: public/class-advanced-ads.php:673
|
770 |
msgid "Parent Ad Groups"
|
771 |
msgstr ""
|
772 |
|
773 |
+
#: public/class-advanced-ads.php:674
|
774 |
msgid "Parent Ad Groups:"
|
775 |
msgstr ""
|
776 |
|
777 |
+
#: public/class-advanced-ads.php:675
|
778 |
msgid "Edit Ad Group"
|
779 |
msgstr ""
|
780 |
|
781 |
+
#: public/class-advanced-ads.php:676
|
782 |
msgid "Update Ad Group"
|
783 |
msgstr ""
|
784 |
|
785 |
+
#: public/class-advanced-ads.php:677
|
786 |
msgid "Add New Ad Group"
|
787 |
msgstr ""
|
788 |
|
789 |
+
#: public/class-advanced-ads.php:678
|
790 |
msgid "New Ad Groups Name"
|
791 |
msgstr ""
|
792 |
|
793 |
+
#: public/class-advanced-ads.php:679 modules/import-export/views/page.php:24
|
794 |
msgid "Groups"
|
795 |
msgstr ""
|
796 |
|
797 |
+
#: public/class-advanced-ads.php:680
|
798 |
msgid "No Ad Group found"
|
799 |
msgstr ""
|
800 |
|
801 |
+
#: public/class-advanced-ads.php:708 public/class-advanced-ads.php:712
|
802 |
+
#: admin/includes/class-menu.php:85 admin/views/ad-group-list-ads.php:28
|
803 |
msgid "New Ad"
|
804 |
msgstr ""
|
805 |
|
806 |
+
#: public/class-advanced-ads.php:709 admin/includes/class-menu.php:85
|
807 |
msgid "Add New Ad"
|
808 |
msgstr ""
|
809 |
|
810 |
+
#: public/class-advanced-ads.php:710
|
811 |
#: admin/includes/class-ad-groups-list.php:313
|
812 |
#: modules/import-export/classes/import.php:146
|
813 |
#: modules/import-export/classes/import.php:186
|
815 |
msgid "Edit"
|
816 |
msgstr ""
|
817 |
|
818 |
+
#: public/class-advanced-ads.php:711
|
819 |
msgid "Edit Ad"
|
820 |
msgstr ""
|
821 |
|
822 |
+
#: public/class-advanced-ads.php:713
|
823 |
msgid "View"
|
824 |
msgstr ""
|
825 |
|
826 |
+
#: public/class-advanced-ads.php:714
|
827 |
msgid "View the Ad"
|
828 |
msgstr ""
|
829 |
|
830 |
+
#: public/class-advanced-ads.php:715
|
831 |
msgid "Search Ads"
|
832 |
msgstr ""
|
833 |
|
834 |
+
#: public/class-advanced-ads.php:716
|
835 |
msgid "No Ads found"
|
836 |
msgstr ""
|
837 |
|
838 |
+
#: public/class-advanced-ads.php:717
|
839 |
msgid "No Ads found in Trash"
|
840 |
msgstr ""
|
841 |
|
842 |
+
#: public/class-advanced-ads.php:718
|
843 |
msgid "Parent Ad"
|
844 |
msgstr ""
|
845 |
|
846 |
+
#: public/class-advanced-ads.php:876
|
847 |
msgctxt "label above ads"
|
848 |
msgid "Advertisements"
|
849 |
msgstr ""
|
850 |
|
851 |
+
#: admin/includes/ad-health-notices.php:23
|
852 |
+
#, php-format
|
853 |
+
msgid ""
|
854 |
+
"Your <strong>PHP version (%1$s) is too low</strong>. Advanced Ads is built "
|
855 |
+
"for PHP %2$s and higher. It might work, but updating PHP is highly "
|
856 |
+
"recommended. Please ask your hosting provider for more information."
|
857 |
+
msgstr ""
|
858 |
+
|
859 |
+
#: admin/includes/ad-health-notices.php:34
|
860 |
+
#, php-format
|
861 |
+
msgid ""
|
862 |
+
"Your <strong>website uses cache</strong>. Some dynamic features like ad "
|
863 |
+
"rotation or visitor conditions might not work properly. Use the cache-"
|
864 |
+
"busting feature of <a href=\"%s\" target=\"_blank\">Advanced Ads Pro</a> to "
|
865 |
+
"load ads dynamically."
|
866 |
+
msgstr ""
|
867 |
+
|
868 |
+
#: admin/includes/ad-health-notices.php:42
|
869 |
+
msgid "There are <strong>plugin updates available</strong>. Please update."
|
870 |
+
msgstr ""
|
871 |
+
|
872 |
+
#: admin/includes/ad-health-notices.php:51
|
873 |
+
#, php-format
|
874 |
+
msgid ""
|
875 |
+
"<strong>Autoptimize plugin detected</strong>. While this plugin is great for "
|
876 |
+
"site performance, it is known to alter code, including scripts from ad "
|
877 |
+
"networks. <a href=\"%s\" target=\"_blank\">Advanced Ads Pro</a> has a build-"
|
878 |
+
"in support for Autoptimize."
|
879 |
+
msgstr ""
|
880 |
+
|
881 |
+
#: admin/includes/ad-health-notices.php:61
|
882 |
+
#, php-format
|
883 |
+
msgid ""
|
884 |
+
"Plugins that are known to cause (partial) problems: <strong>%1$s</strong>. "
|
885 |
+
"<a href=\"%2$s\" target=\"_blank\">Learn more</a>."
|
886 |
+
msgstr ""
|
887 |
+
|
888 |
+
#: admin/includes/ad-health-notices.php:72
|
889 |
+
#, php-format
|
890 |
+
msgid ""
|
891 |
+
"Missing PHP extensions could cause issues. Please ask your hosting provider "
|
892 |
+
"to enable them: %s"
|
893 |
+
msgstr ""
|
894 |
+
|
895 |
+
#: admin/includes/ad-health-notices.php:82
|
896 |
+
#, php-format
|
897 |
+
msgid ""
|
898 |
+
"Ads are disabled for all or some pages. See \"disabled ads\" in <a "
|
899 |
+
"href=\"%s\">settings</a>."
|
900 |
+
msgstr ""
|
901 |
+
|
902 |
+
#: admin/includes/ad-health-notices.php:91
|
903 |
+
msgid "This site is hosted on wordpress.com."
|
904 |
+
msgstr ""
|
905 |
+
|
906 |
+
#: admin/includes/ad-health-notices.php:97 admin/views/support.php:25
|
907 |
+
msgid "Advanced Ads related constants enabled"
|
908 |
+
msgstr ""
|
909 |
+
|
910 |
+
#: admin/includes/ad-health-notices.php:105
|
911 |
+
#, php-format
|
912 |
+
msgid ""
|
913 |
+
"Possible conflict between jQueryUI library, used by Advanced Ads and other "
|
914 |
+
"libraries (probably <a href=\"%s\">Twitter Bootstrap</a>). This might lead "
|
915 |
+
"to misfortunate formats in forms, but should not damage features."
|
916 |
+
msgstr ""
|
917 |
+
|
918 |
+
#: admin/includes/ad-health-notices.php:115
|
919 |
+
#, php-format
|
920 |
+
msgid ""
|
921 |
+
"Some assets were changed. Please <strong>rebuild the asset folder</strong> "
|
922 |
+
"in the <a href=\"%s\">Advanced Ads settings</a> to update the ad blocker "
|
923 |
+
"disguise."
|
924 |
+
msgstr ""
|
925 |
+
|
926 |
+
#: admin/includes/ad-health-notices.php:124 admin/includes/notices.php:37
|
927 |
+
msgid ""
|
928 |
+
"One or more license keys for <strong>Advanced Ads add-ons are invalid or "
|
929 |
+
"missing</strong>."
|
930 |
+
msgstr ""
|
931 |
+
|
932 |
+
#: admin/includes/ad-health-notices.php:127 admin/includes/notices.php:37
|
933 |
+
#, php-format
|
934 |
+
msgid "Please add valid license keys <a href=\"%s\">here</a>."
|
935 |
+
msgstr ""
|
936 |
+
|
937 |
+
#: admin/includes/ad-health-notices.php:135
|
938 |
+
msgid "Ad expired"
|
939 |
+
msgstr ""
|
940 |
+
|
941 |
+
#: admin/includes/ad-health-notices.php:179
|
942 |
+
#: admin/includes/class-overview-widgets.php:84
|
943 |
+
#: admin/views/notices/welcome-panel.php:6
|
944 |
+
msgid "Create your first ad"
|
945 |
+
msgstr ""
|
946 |
+
|
947 |
#: admin/includes/class-ad-groups-list.php:165
|
948 |
msgid "Ad weight"
|
949 |
msgstr ""
|
1190 |
msgid "any expiry date"
|
1191 |
msgstr ""
|
1192 |
|
1193 |
+
#: admin/includes/class-menu.php:58 admin/includes/class-menu.php:74
|
1194 |
+
#: admin/includes/class-menu.php:78 admin/includes/class-menu.php:78
|
1195 |
msgid "Overview"
|
1196 |
msgstr ""
|
1197 |
|
1198 |
+
#: admin/includes/class-menu.php:90
|
1199 |
msgid "Ad Groups & Rotations"
|
1200 |
msgstr ""
|
1201 |
|
1202 |
+
#: admin/includes/class-menu.php:90
|
1203 |
msgid "Groups & Rotation"
|
1204 |
msgstr ""
|
1205 |
|
1206 |
+
#: admin/includes/class-menu.php:95
|
1207 |
msgid "Ad Placements"
|
1208 |
msgstr ""
|
1209 |
|
1210 |
+
#: admin/includes/class-menu.php:99
|
1211 |
msgid "Advanced Ads Settings"
|
1212 |
msgstr ""
|
1213 |
|
1214 |
+
#: admin/includes/class-menu.php:99
|
1215 |
msgid "Settings"
|
1216 |
msgstr ""
|
1217 |
|
1218 |
+
#: admin/includes/class-menu.php:210 admin/includes/class-menu.php:237
|
1219 |
msgid "Sorry, you are not allowed to access this feature."
|
1220 |
msgstr ""
|
1221 |
|
1222 |
+
#: admin/includes/class-menu.php:223
|
1223 |
msgid ""
|
1224 |
"You attempted to edit an ad group that doesn’t exist. Perhaps it was "
|
1225 |
"deleted?"
|
1233 |
msgid "Ad Parameters"
|
1234 |
msgstr ""
|
1235 |
|
1236 |
+
#: admin/includes/class-meta-box.php:64 admin/includes/class-settings.php:66
|
1237 |
msgid "Layout / Output"
|
1238 |
msgstr ""
|
1239 |
|
1246 |
msgstr ""
|
1247 |
|
1248 |
#: admin/includes/class-meta-box.php:140 admin/includes/class-meta-box.php:151
|
1249 |
+
#: admin/includes/class-meta-box.php:156 admin/includes/class-settings.php:581
|
1250 |
#: admin/views/ad-output-metabox.php:81
|
1251 |
#: modules/privacy/admin/views/setting-enable.php:2
|
1252 |
msgid "Manual"
|
1286 |
msgid "Latest posts on wpadvancedads.com"
|
1287 |
msgstr ""
|
1288 |
|
1289 |
+
#: admin/includes/class-notices.php:444
|
1290 |
#, php-format
|
1291 |
msgid ""
|
1292 |
"You don’t seem to have an email address. Please use <a href=\"%s\" "
|
1293 |
"target=\"_blank\">this form</a> to sign up."
|
1294 |
msgstr ""
|
1295 |
|
1296 |
+
#: admin/includes/class-notices.php:462
|
1297 |
msgid ""
|
1298 |
"How embarrassing. The email server seems to be down. Please try again later."
|
1299 |
msgstr ""
|
1300 |
|
1301 |
+
#: admin/includes/class-notices.php:467
|
1302 |
#, php-format
|
1303 |
msgid ""
|
1304 |
"Please check your email (%s) for the confirmation message. If you didn’t "
|
1306 |
"href=\"%s\" target=\"_blank\">this form</a> to sign up."
|
1307 |
msgstr ""
|
1308 |
|
1309 |
+
#: admin/includes/class-overview-widgets.php:33
|
1310 |
msgid "Next steps"
|
1311 |
msgstr ""
|
1312 |
|
1313 |
+
#: admin/includes/class-overview-widgets.php:35
|
1314 |
msgid "Manual and Support"
|
1315 |
msgstr ""
|
1316 |
|
1317 |
+
#: admin/includes/class-overview-widgets.php:87
|
|
|
|
|
|
|
|
|
|
|
1318 |
#: modules/gadsense/admin/views/adsense-account.php:99
|
1319 |
#: modules/gadsense/admin/views/adsense-account.php:117
|
1320 |
#: modules/gadsense/admin/views/adsense-ad-parameters.php:94
|
1322 |
msgid "Connect to AdSense"
|
1323 |
msgstr ""
|
1324 |
|
1325 |
+
#: admin/includes/class-overview-widgets.php:97
|
1326 |
msgid "Join the newsletter for more benefits"
|
1327 |
msgstr ""
|
1328 |
|
1329 |
+
#: admin/includes/class-overview-widgets.php:99
|
1330 |
msgid "Get 2 free add-ons"
|
1331 |
msgstr ""
|
1332 |
|
1333 |
+
#: admin/includes/class-overview-widgets.php:100
|
1334 |
msgid "Get the first steps and more tutorials to your inbox"
|
1335 |
msgstr ""
|
1336 |
|
1337 |
+
#: admin/includes/class-overview-widgets.php:101
|
1338 |
msgid "How to earn more with AdSense"
|
1339 |
msgstr ""
|
1340 |
|
1341 |
+
#: admin/includes/class-overview-widgets.php:104
|
1342 |
msgid "Join now"
|
1343 |
msgstr ""
|
1344 |
|
1345 |
+
#: admin/includes/class-overview-widgets.php:112 admin/includes/notices.php:44
|
1346 |
msgid ""
|
1347 |
"Do you find Advanced Ads useful and would like to keep us motivated? Please "
|
1348 |
"help us with a review."
|
1349 |
msgstr ""
|
1350 |
|
1351 |
+
#: admin/includes/class-overview-widgets.php:114 admin/includes/notices.php:47
|
1352 |
msgid "Sure, I’ll rate the plugin"
|
1353 |
msgstr ""
|
1354 |
|
1355 |
+
#: admin/includes/class-overview-widgets.php:116 admin/includes/notices.php:48
|
1356 |
msgid "I already did"
|
1357 |
msgstr ""
|
1358 |
|
1359 |
+
#: admin/includes/class-overview-widgets.php:122
|
1360 |
msgid "Manage your ads"
|
1361 |
msgstr ""
|
1362 |
|
1363 |
+
#: admin/includes/class-overview-widgets.php:126
|
1364 |
msgid "Get the All Access pass"
|
1365 |
msgstr ""
|
1366 |
|
1367 |
+
#: admin/includes/class-overview-widgets.php:152
|
1368 |
#: admin/views/notices/welcome-panel.php:22
|
1369 |
#, php-format
|
1370 |
msgid "<a href=\"%s\" target=\"_blank\">Manual</a>"
|
1371 |
msgstr ""
|
1372 |
|
1373 |
+
#: admin/includes/class-overview-widgets.php:153
|
1374 |
#, php-format
|
1375 |
msgid "<a href=\"%s\" target=\"_blank\">FAQ and Support</a>"
|
1376 |
msgstr ""
|
1377 |
|
1378 |
+
#: admin/includes/class-overview-widgets.php:171
|
1379 |
msgid "The solution for professional websites."
|
1380 |
msgstr ""
|
1381 |
|
1382 |
+
#: admin/includes/class-overview-widgets.php:174
|
1383 |
#: admin/views/pitch-pro-tab.php:7
|
1384 |
msgid "support for cached sites"
|
1385 |
msgstr ""
|
1386 |
|
1387 |
+
#: admin/includes/class-overview-widgets.php:177
|
1388 |
+
#: admin/includes/class-overview-widgets.php:178
|
1389 |
+
#: admin/includes/class-overview-widgets.php:179
|
1390 |
+
#: admin/includes/class-overview-widgets.php:180
|
1391 |
#, php-format
|
1392 |
msgid "integrates with <strong>%s</strong>"
|
1393 |
msgstr ""
|
1394 |
|
1395 |
+
#: admin/includes/class-overview-widgets.php:181
|
1396 |
msgid "click fraud protection, lazy load, ad-block ads"
|
1397 |
msgstr ""
|
1398 |
|
1399 |
+
#: admin/includes/class-overview-widgets.php:182
|
1400 |
#: admin/views/pitch-pro-tab.php:8
|
1401 |
msgid "11 more display and visitor conditions"
|
1402 |
msgstr ""
|
1403 |
|
1404 |
+
#: admin/includes/class-overview-widgets.php:183
|
1405 |
#: admin/views/pitch-pro-tab.php:9
|
1406 |
msgid "6 more placements"
|
1407 |
msgstr ""
|
1408 |
|
1409 |
+
#: admin/includes/class-overview-widgets.php:184
|
1410 |
#: admin/views/pitch-pro-tab.php:10
|
1411 |
msgid "placement tests for ad optimization"
|
1412 |
msgstr ""
|
1413 |
|
1414 |
+
#: admin/includes/class-overview-widgets.php:185
|
1415 |
#: admin/views/pitch-pro-tab.php:11
|
1416 |
msgid "ad grids and many more advanced features"
|
1417 |
msgstr ""
|
1418 |
|
1419 |
+
#: admin/includes/class-overview-widgets.php:192
|
1420 |
msgid ""
|
1421 |
"Analyze clicks and impressions of your ads locally or in Google Analytics, "
|
1422 |
"share reports, and limit ads to a specific number of impressions or clicks."
|
1423 |
msgstr ""
|
1424 |
|
1425 |
+
#: admin/includes/class-overview-widgets.php:198
|
1426 |
msgid ""
|
1427 |
"Display ads based on the device or the size of your visitor’s browser, and "
|
1428 |
"control ads on AMP pages."
|
1429 |
msgstr ""
|
1430 |
|
1431 |
+
#: admin/includes/class-overview-widgets.php:211
|
1432 |
msgid ""
|
1433 |
"Earn more money and let advertisers pay for ad space directly on the "
|
1434 |
"frontend of your site."
|
1435 |
msgstr ""
|
1436 |
|
1437 |
+
#: admin/includes/class-overview-widgets.php:217
|
1438 |
msgid ""
|
1439 |
"Target visitors with ads that match their geo location and make more money "
|
1440 |
"with regional campaigns."
|
1441 |
msgstr ""
|
1442 |
|
1443 |
+
#: admin/includes/class-overview-widgets.php:223
|
1444 |
msgid ""
|
1445 |
"Increase click rates on your ads by placing them in sticky positions above, "
|
1446 |
"next or below your site."
|
1447 |
msgstr ""
|
1448 |
|
1449 |
+
#: admin/includes/class-overview-widgets.php:229
|
1450 |
msgid ""
|
1451 |
"Users will never miss an ad or other information in a PopUp. Choose when it "
|
1452 |
"shows up and for how long a user can close it."
|
1453 |
msgstr ""
|
1454 |
|
1455 |
+
#: admin/includes/class-overview-widgets.php:235
|
1456 |
msgid ""
|
1457 |
"Create a beautiful and simple slider from your ads to show more information "
|
1458 |
"on less space."
|
1459 |
msgstr ""
|
1460 |
|
1461 |
+
#: admin/includes/class-overview-widgets.php:241
|
1462 |
msgid ""
|
1463 |
"Place AdSense In-feed ads between posts on homepage, category, and archive "
|
1464 |
"pages."
|
1465 |
msgstr ""
|
1466 |
|
1467 |
+
#: admin/includes/class-overview-widgets.php:244
|
1468 |
+
#: admin/includes/class-overview-widgets.php:419
|
1469 |
+
#: admin/includes/class-overview-widgets.php:435
|
1470 |
msgid "Install now"
|
1471 |
msgstr ""
|
1472 |
|
1473 |
+
#: admin/includes/class-overview-widgets.php:262
|
1474 |
+
#: admin/includes/class-overview-widgets.php:283
|
1475 |
+
#: admin/includes/class-overview-widgets.php:308
|
1476 |
+
#: admin/includes/class-overview-widgets.php:326
|
1477 |
+
#: admin/includes/class-overview-widgets.php:344
|
1478 |
+
#: admin/includes/class-overview-widgets.php:362
|
1479 |
+
#: admin/includes/class-overview-widgets.php:380
|
1480 |
+
#: admin/includes/class-overview-widgets.php:398
|
1481 |
msgid "Activate now"
|
1482 |
msgstr ""
|
1483 |
|
1484 |
+
#: admin/includes/class-overview-widgets.php:291
|
1485 |
msgid "Visit your ad stats"
|
1486 |
msgstr ""
|
1487 |
|
1488 |
+
#: admin/includes/class-overview-widgets.php:415
|
1489 |
msgid "Use Genesis specific ad positions."
|
1490 |
msgstr ""
|
1491 |
|
1492 |
+
#: admin/includes/class-overview-widgets.php:431
|
1493 |
msgid ""
|
1494 |
"Manage ad positions with WPBakery Page Builder (formerly Visual Composer)."
|
1495 |
msgstr ""
|
1496 |
|
1497 |
+
#: admin/includes/class-overview-widgets.php:447
|
1498 |
msgid "Our best deal with all add-ons included."
|
1499 |
msgstr ""
|
1500 |
|
1501 |
+
#: admin/includes/class-overview-widgets.php:449
|
1502 |
msgid "Get full access"
|
1503 |
msgstr ""
|
1504 |
|
1505 |
+
#: admin/includes/class-overview-widgets.php:463
|
1506 |
#: admin/views/ad-display-metabox.php:48 admin/views/ad-visitor-metabox.php:47
|
1507 |
msgid "Visit the manual"
|
1508 |
msgstr ""
|
1509 |
|
1510 |
+
#: admin/includes/class-overview-widgets.php:466
|
1511 |
msgid "Get this add-on"
|
1512 |
msgstr ""
|
1513 |
|
1514 |
+
#: admin/includes/class-settings.php:50 admin/includes/class-settings.php:412
|
1515 |
+
msgid "Admin"
|
1516 |
+
msgstr ""
|
1517 |
+
|
1518 |
+
#: admin/includes/class-settings.php:58 admin/includes/class-settings.php:128
|
1519 |
msgid "Disable ads"
|
1520 |
msgstr ""
|
1521 |
|
1522 |
+
#: admin/includes/class-settings.php:74
|
1523 |
+
msgid "Content injection"
|
1524 |
msgstr ""
|
1525 |
|
1526 |
+
#: admin/includes/class-settings.php:136
|
1527 |
+
msgid "Hide ads for logged in users"
|
1528 |
msgstr ""
|
1529 |
|
1530 |
+
#: admin/includes/class-settings.php:144
|
1531 |
msgid "Unlimited ad injection"
|
1532 |
msgstr ""
|
1533 |
|
1534 |
+
#: admin/includes/class-settings.php:152
|
1535 |
msgid "Priority of content injection filter"
|
1536 |
msgstr ""
|
1537 |
|
1538 |
+
#: admin/includes/class-settings.php:168
|
1539 |
msgid "Hide ads from bots"
|
1540 |
msgstr ""
|
1541 |
|
1542 |
+
#: admin/includes/class-settings.php:176
|
1543 |
+
msgid "Disable Ad Health and other notices"
|
1544 |
msgstr ""
|
1545 |
|
1546 |
+
#: admin/includes/class-settings.php:184
|
1547 |
msgid "ID prefix"
|
1548 |
msgstr ""
|
1549 |
|
1550 |
+
#: admin/includes/class-settings.php:192
|
1551 |
msgid "Allow editors to manage ads"
|
1552 |
msgstr ""
|
1553 |
|
1554 |
+
#: admin/includes/class-settings.php:200
|
1555 |
msgid "Ad label"
|
1556 |
msgstr ""
|
1557 |
|
1558 |
+
#: admin/includes/class-settings.php:209
|
1559 |
msgid "Open links in a new window"
|
1560 |
msgstr ""
|
1561 |
|
1562 |
+
#: admin/includes/class-settings.php:217
|
1563 |
+
msgid "Use advanced JavaScript"
|
1564 |
+
msgstr ""
|
1565 |
+
|
1566 |
+
#: admin/includes/class-settings.php:227
|
1567 |
msgid "Delete data on uninstall"
|
1568 |
msgstr ""
|
1569 |
|
1570 |
+
#: admin/includes/class-settings.php:237
|
1571 |
msgid "Disable shortcode button"
|
1572 |
msgstr ""
|
1573 |
|
1574 |
+
#: admin/includes/class-settings.php:259
|
1575 |
msgid "Licenses"
|
1576 |
msgstr ""
|
1577 |
|
1578 |
+
#: admin/includes/class-settings.php:276
|
1579 |
msgid "Pro"
|
1580 |
msgstr ""
|
1581 |
|
1582 |
+
#: admin/includes/class-settings.php:292 admin/views/pitch-tracking.php:2
|
1583 |
msgid "Tracking"
|
1584 |
msgstr ""
|
1585 |
|
1586 |
+
#: admin/includes/class-settings.php:340
|
1587 |
#, php-format
|
1588 |
msgid ""
|
1589 |
"Enter license keys for our powerful <a href=\"%s\" target=\"_blank\">add-"
|
1590 |
"ons</a>."
|
1591 |
msgstr ""
|
1592 |
|
1593 |
+
#: admin/includes/class-settings.php:341
|
1594 |
#, php-format
|
1595 |
msgid ""
|
1596 |
"See also <a href=\"%s\" target=\"_blank\">Issues and questions about "
|
1597 |
"licenses</a>."
|
1598 |
msgstr ""
|
1599 |
|
1600 |
+
#: admin/includes/class-settings.php:353
|
1601 |
msgid "Are you missing something?"
|
1602 |
msgstr ""
|
1603 |
|
1604 |
+
#: admin/includes/class-settings.php:407
|
1605 |
msgid "(display to all)"
|
1606 |
msgstr ""
|
1607 |
|
1608 |
+
#: admin/includes/class-settings.php:408
|
1609 |
msgid "Subscriber"
|
1610 |
msgstr ""
|
1611 |
|
1612 |
+
#: admin/includes/class-settings.php:409
|
1613 |
msgid "Contributor"
|
1614 |
msgstr ""
|
1615 |
|
1616 |
+
#: admin/includes/class-settings.php:410
|
1617 |
msgid "Author"
|
1618 |
msgstr ""
|
1619 |
|
1620 |
+
#: admin/includes/class-settings.php:411
|
1621 |
msgid "Editor"
|
1622 |
msgstr ""
|
1623 |
|
1624 |
+
#: admin/includes/class-settings.php:420
|
|
|
|
|
|
|
|
|
1625 |
msgid "Choose the lowest role a user must have in order to not see any ads."
|
1626 |
msgstr ""
|
1627 |
|
1628 |
+
#: admin/includes/class-settings.php:434
|
1629 |
msgid ""
|
1630 |
"<strong>notice: </strong>the file is currently enabled by an add-on that "
|
1631 |
"needs it."
|
1632 |
msgstr ""
|
1633 |
|
1634 |
+
#: admin/includes/class-settings.php:437
|
1635 |
#, php-format
|
1636 |
msgid ""
|
1637 |
"Enable advanced JavaScript functions (<a href=\"%s\" target=\"_blank\">"
|
1639 |
"need features from this file."
|
1640 |
msgstr ""
|
1641 |
|
1642 |
+
#: admin/includes/class-settings.php:457
|
1643 |
msgid ""
|
1644 |
"Some plugins and themes trigger ad injections where it shouldn’t happen. "
|
1645 |
"Therefore, Advanced Ads ignores injected placements on non-singular pages "
|
1649 |
"injection only in the first x posts on your archive pages."
|
1650 |
msgstr ""
|
1651 |
|
1652 |
+
#: admin/includes/class-settings.php:473
|
1653 |
msgid ""
|
1654 |
"Please check your post content. A priority of 10 and below might cause "
|
1655 |
"issues (wpautop function might run twice)."
|
1656 |
msgstr ""
|
1657 |
|
1658 |
+
#: admin/includes/class-settings.php:475
|
1659 |
msgid ""
|
1660 |
"Play with this value in order to change the priority of the injected ads "
|
1661 |
"compared to other auto injected elements in the post content."
|
1662 |
msgstr ""
|
1663 |
|
1664 |
+
#: admin/includes/class-settings.php:489
|
1665 |
msgid ""
|
1666 |
"Advanced Ads ignores paragraphs and other elements in containers when "
|
1667 |
"injecting ads into the post content. Check this option to ignore this "
|
1668 |
"limitation and ads might show up again."
|
1669 |
msgstr ""
|
1670 |
|
1671 |
+
#: admin/includes/class-settings.php:505
|
1672 |
msgid "Read this first"
|
1673 |
msgstr ""
|
1674 |
|
1675 |
+
#: admin/includes/class-settings.php:506
|
1676 |
msgid "Hide ads from crawlers, bots and empty user agents."
|
1677 |
msgstr ""
|
1678 |
|
1679 |
+
#. %1$s is a starting <a> tag and %2$s a closing one
|
1680 |
+
#: admin/includes/class-settings.php:522
|
1681 |
+
#, php-format
|
1682 |
msgid ""
|
1683 |
+
"Disable %1$sAd Health%2$s in frontend and backend, warnings and internal "
|
1684 |
+
"notices like tips, tutorials, email newsletters and update notices."
|
|
|
1685 |
msgstr ""
|
1686 |
|
1687 |
+
#: admin/includes/class-settings.php:540
|
1688 |
msgid ""
|
1689 |
"Prefix of class or id attributes in the frontend. Change it if you don’t "
|
1690 |
"want <strong>ad blockers</strong> to mark these blocks as ads.<br/>You might "
|
1691 |
"need to <strong>rewrite css rules afterwards</strong>."
|
1692 |
msgstr ""
|
1693 |
|
1694 |
+
#: admin/includes/class-settings.php:559
|
1695 |
msgid "Allow editors to also manage and publish ads."
|
1696 |
msgstr ""
|
1697 |
|
1698 |
+
#: admin/includes/class-settings.php:560
|
1699 |
#, php-format
|
1700 |
msgid ""
|
1701 |
"You can assign different ad-related roles on a user basis with <a "
|
1702 |
"href=\"%s\" target=\"_blank\">Advanced Ads Pro</a>."
|
1703 |
msgstr ""
|
1704 |
|
1705 |
+
#: admin/includes/class-settings.php:571
|
1706 |
msgctxt "label before ads"
|
1707 |
msgid "Advertisements"
|
1708 |
msgstr ""
|
1709 |
|
1710 |
+
#: admin/includes/class-settings.php:580
|
1711 |
msgid "Displayed above ads."
|
1712 |
msgstr ""
|
1713 |
|
1714 |
+
#: admin/includes/class-settings.php:617
|
1715 |
msgid "Clean up all data related to Advanced Ads when removing the plugin."
|
1716 |
msgstr ""
|
1717 |
|
1718 |
+
#: admin/includes/class-settings.php:630
|
1719 |
msgid "Disable shortcode button in visual editor."
|
1720 |
msgstr ""
|
1721 |
|
1757 |
msgid "Subscribe me now"
|
1758 |
msgstr ""
|
1759 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1760 |
#: admin/includes/notices.php:43
|
1761 |
#, php-format
|
1762 |
msgid "You’ve successfully <strong>created %s ads using Advanced Ads</strong>."
|
1773 |
#: admin/includes/notices.php:57
|
1774 |
#, php-format
|
1775 |
msgid ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1776 |
"Our Black Friday / Cyber Monday Offer: <span style=\"font-weight: bold; font-"
|
1777 |
"size: 1.4em; color: green;\">-30%%</span> on all add-ons and All Access.<a "
|
1778 |
"class=\"button button-primary\" target=\"_blank\" href=\"%s\">Get All "
|
1779 |
"Access</a>"
|
1780 |
msgstr ""
|
1781 |
|
1782 |
+
#: admin/includes/notices.php:63
|
1783 |
#, php-format
|
1784 |
msgid ""
|
1785 |
"Our Black Friday / Cyber Monday Offer: <span style=\"font-weight: bold; font-"
|
2388 |
msgid "not on mobile devices"
|
2389 |
msgstr ""
|
2390 |
|
2391 |
+
#: admin/views/checks.php:14
|
2392 |
#, php-format
|
2393 |
msgid ""
|
2394 |
+
"Advanced Ads detected potential problems with your ad setup. %1$sShow me "
|
2395 |
+
"these errors%2$s"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2396 |
msgstr ""
|
2397 |
|
2398 |
#: admin/views/feedback-disable.php:5
|
2468 |
msgid "Disabling the plugin now…"
|
2469 |
msgstr ""
|
2470 |
|
2471 |
+
#. %s includes a number and markup like <span class="count">6</span>.
|
2472 |
+
#: admin/views/overview-notices.php:24
|
2473 |
+
#, php-format
|
2474 |
+
msgid "Show %s hidden"
|
2475 |
+
msgstr ""
|
2476 |
+
|
2477 |
#: admin/views/pitch-bundle.php:1
|
2478 |
msgid "All Access – with all available add-ons"
|
2479 |
msgstr ""
|
2910 |
msgid "Import & Export"
|
2911 |
msgstr ""
|
2912 |
|
2913 |
+
#: admin/views/support-callout.php:3
|
2914 |
+
msgid "Problems or questions?"
|
2915 |
+
msgstr ""
|
2916 |
+
|
2917 |
+
#: admin/views/support-callout.php:4
|
2918 |
+
msgid "Save time and get personal support."
|
2919 |
+
msgstr ""
|
2920 |
+
|
2921 |
+
#: admin/views/support-callout.php:4
|
2922 |
+
msgid "Ask your question!"
|
2923 |
+
msgstr ""
|
2924 |
+
|
2925 |
#: admin/views/support.php:6
|
2926 |
msgid ""
|
2927 |
"Please fix the red highlighted issues on this page or try to understand "
|
3351 |
msgid "Zero size file downloaded <em>%s</em>"
|
3352 |
msgstr ""
|
3353 |
|
3354 |
+
#: modules/import-export/classes/XmlEncoder.php:61
|
3355 |
+
#: modules/import-export/classes/XmlEncoder.php:64
|
3356 |
+
#: modules/import-export/classes/XmlEncoder.php:193
|
3357 |
+
#: modules/import-export/classes/XmlEncoder.php:196
|
3358 |
+
#, php-format
|
3359 |
+
msgid "The %s extension(s) is not loaded"
|
3360 |
+
msgstr ""
|
3361 |
+
|
3362 |
#: modules/import-export/classes/XmlEncoder.php:75
|
3363 |
msgctxt "import_export"
|
3364 |
msgid "The data must be an array"
|
modules/ad-blocker/admin/admin.php
CHANGED
@@ -306,7 +306,7 @@ class Advanced_Ads_Ad_Blocker_Admin
|
|
306 |
}
|
307 |
// successful result, save options and rewrite previous error options
|
308 |
update_option( ADVADS_AB_SLUG, $new_options);
|
309 |
-
|
310 |
}
|
311 |
|
312 |
/**
|
306 |
}
|
307 |
// successful result, save options and rewrite previous error options
|
308 |
update_option( ADVADS_AB_SLUG, $new_options);
|
309 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->remove( 'assets_expired' );
|
310 |
}
|
311 |
|
312 |
/**
|
modules/gadsense/admin/views/mapi-ad-selector.php
CHANGED
@@ -21,7 +21,7 @@ if ( $hide_idle_ads ) {
|
|
21 |
$unsupported_ad_type_link = Advanced_Ads_AdSense_MAPI::UNSUPPORTED_TYPE_LINK;
|
22 |
|
23 |
?>
|
24 |
-
<div id="mapi-wrap">
|
25 |
<button type="button" id="mapi-close-selector" class="notice-dismiss"></button>
|
26 |
<?php if ( $hide_idle_ads ) : ?>
|
27 |
<i id="mapi-show-idle" title="<?php esc_attr_e( 'Show inactive ads' , 'advanced-ads' ); ?>" class="dashicons dashicons-visibility mapiaction" data-mapiaction="showidle"></i>
|
@@ -29,15 +29,15 @@ $unsupported_ad_type_link = Advanced_Ads_AdSense_MAPI::UNSUPPORTED_TYPE_LINK;
|
|
29 |
<i id="mapi-hide-idle" title="<?php esc_attr_e( 'Hide inactive ads' , 'advanced-ads' ); ?>" class="dashicons dashicons-hidden mapiaction" data-mapiaction="hideidle"></i>
|
30 |
<?php endif; ?>
|
31 |
<?php if ( !empty( $ad_units ) ) : ?>
|
32 |
-
<i
|
33 |
esc_attr_e( 'Update the ad units list', 'advanced-ads' ) ?>"></i>
|
34 |
<?php endif; ?>
|
35 |
-
<div id="mapi-loading-overlay">
|
36 |
<img alt="..." src="<?php echo ADVADS_BASE_URL . 'admin/assets/img/loader.gif'; ?>" style="margin-top:8em;" />
|
37 |
</div>
|
38 |
|
39 |
<?php if ( !empty( $ad_units ) ) : ?>
|
40 |
-
<div id="mapi-list-header">
|
41 |
<span><?php echo esc_attr_x( 'Ad unit', 'AdSense ad', 'advanced-ads' ); ?></span>
|
42 |
<span><?php esc_html_e( 'Name', 'advanced-ads' ); ?></span>
|
43 |
<span><?php echo esc_html_x( 'Slot ID', 'AdSense ad', 'advanced-ads' ); ?></span>
|
@@ -45,7 +45,7 @@ $unsupported_ad_type_link = Advanced_Ads_AdSense_MAPI::UNSUPPORTED_TYPE_LINK;
|
|
45 |
<span><?php esc_html_e( 'Size', 'advanced-ads' ); ?></span>
|
46 |
</div>
|
47 |
<?php endif; ?>
|
48 |
-
<div id="mapi-table-wrap">
|
49 |
<table class="widefat striped">
|
50 |
<?php if ( empty( $ad_units ) ) : ?>
|
51 |
<thead>
|
21 |
$unsupported_ad_type_link = Advanced_Ads_AdSense_MAPI::UNSUPPORTED_TYPE_LINK;
|
22 |
|
23 |
?>
|
24 |
+
<div id="mapi-wrap" class="aa-select-list">
|
25 |
<button type="button" id="mapi-close-selector" class="notice-dismiss"></button>
|
26 |
<?php if ( $hide_idle_ads ) : ?>
|
27 |
<i id="mapi-show-idle" title="<?php esc_attr_e( 'Show inactive ads' , 'advanced-ads' ); ?>" class="dashicons dashicons-visibility mapiaction" data-mapiaction="showidle"></i>
|
29 |
<i id="mapi-hide-idle" title="<?php esc_attr_e( 'Hide inactive ads' , 'advanced-ads' ); ?>" class="dashicons dashicons-hidden mapiaction" data-mapiaction="hideidle"></i>
|
30 |
<?php endif; ?>
|
31 |
<?php if ( !empty( $ad_units ) ) : ?>
|
32 |
+
<i class="aa-select-list-update dashicons dashicons-update mapiaction" data-mapiaction="updateList" style="color:#0085ba;cursor:pointer;font-size:20px;" title="<?php
|
33 |
esc_attr_e( 'Update the ad units list', 'advanced-ads' ) ?>"></i>
|
34 |
<?php endif; ?>
|
35 |
+
<div id="mapi-loading-overlay" class="aa-select-list-loading-overlay">
|
36 |
<img alt="..." src="<?php echo ADVADS_BASE_URL . 'admin/assets/img/loader.gif'; ?>" style="margin-top:8em;" />
|
37 |
</div>
|
38 |
|
39 |
<?php if ( !empty( $ad_units ) ) : ?>
|
40 |
+
<div id="mapi-list-header" class="aa-select-list-header">
|
41 |
<span><?php echo esc_attr_x( 'Ad unit', 'AdSense ad', 'advanced-ads' ); ?></span>
|
42 |
<span><?php esc_html_e( 'Name', 'advanced-ads' ); ?></span>
|
43 |
<span><?php echo esc_html_x( 'Slot ID', 'AdSense ad', 'advanced-ads' ); ?></span>
|
45 |
<span><?php esc_html_e( 'Size', 'advanced-ads' ); ?></span>
|
46 |
</div>
|
47 |
<?php endif; ?>
|
48 |
+
<div id="mapi-table-wrap" class="aa-select-list-table-wrap">
|
49 |
<table class="widefat striped">
|
50 |
<?php if ( empty( $ad_units ) ) : ?>
|
51 |
<thead>
|
public/class-advanced-ads.php
CHANGED
@@ -433,6 +433,12 @@ class Advanced_Ads {
|
|
433 |
if ( $this->has_many_the_content() ) {
|
434 |
return $content;
|
435 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
}
|
437 |
|
438 |
// run only within the loop on single pages of public post types.
|
433 |
if ( $this->has_many_the_content() ) {
|
434 |
return $content;
|
435 |
}
|
436 |
+
|
437 |
+
}
|
438 |
+
|
439 |
+
// No need to inject ads because all tags are stripped from excepts.
|
440 |
+
if ( doing_filter( 'get_the_excerpt' ) ) {
|
441 |
+
return $content;
|
442 |
}
|
443 |
|
444 |
// run only within the loop on single pages of public post types.
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: webzunft
|
|
3 |
Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
|
4 |
Tags: ads, ad manager, ad rotation, adsense, banner
|
5 |
Requires at least: 4.6
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -245,7 +245,7 @@ There is a dedicated Flash ad type in [Pro](https://wpadvancedads.com/add-ons/ad
|
|
245 |
|
246 |
= Is the plugin compatible with page builders? =
|
247 |
|
248 |
-
Yes. It works out of the box with all site builders that allow shortcodes or widgets, like Elementor, SiteOrigin, Beaver Builder, WPBakery Page Builder (formerly Visual Composer), and others.
|
249 |
There is also a [free add-on to support the WPBakery Page Builder (formerly Visual Composer)](https://wordpress.org/plugins/ads-for-visual-composer/).
|
250 |
|
251 |
= Will ads show up for ad block users? =
|
@@ -277,6 +277,13 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
|
|
277 |
|
278 |
== Changelog ==
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
= 1.11.2 =
|
281 |
|
282 |
* removed "Limit to 3 AdSense ads" option for users who don‘t have it enabled since AdSense no longer has such a rule
|
3 |
Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
|
4 |
Tags: ads, ad manager, ad rotation, adsense, banner
|
5 |
Requires at least: 4.6
|
6 |
+
Tested up to: 5.1
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 1.12
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
245 |
|
246 |
= Is the plugin compatible with page builders? =
|
247 |
|
248 |
+
Yes. It works out of the box with all site builders that allow shortcodes or widgets, like Elementor, SiteOrigin, Beaver Builder, WPBakery Page Builder (formerly Visual Composer), [Nimble Page Builder](https://wordpress.org/plugins/nimble-builder/), and others.
|
249 |
There is also a [free add-on to support the WPBakery Page Builder (formerly Visual Composer)](https://wordpress.org/plugins/ads-for-visual-composer/).
|
250 |
|
251 |
= Will ads show up for ad block users? =
|
277 |
|
278 |
== Changelog ==
|
279 |
|
280 |
+
= 1.12 =
|
281 |
+
|
282 |
+
* new ad health notification logic in WP Admin to show notifications and critical issues at one place
|
283 |
+
* disable Ad Health in frontend and backend using the existing "Disable Notices" option, now called "Disable Ad Health and other notices"
|
284 |
+
* prevented ad injection into excerpts
|
285 |
+
* reordered settings page
|
286 |
+
|
287 |
= 1.11.2 =
|
288 |
|
289 |
* removed "Limit to 3 AdSense ads" option for users who don‘t have it enabled since AdSense no longer has such a rule
|
vendor/autoload_52.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit7ce491af71c20f0c4c61971657d35fd8::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -12,6 +12,7 @@ return array(
|
|
12 |
'Advanced_Ads_Ad' => $baseDir . '/classes/ad.php',
|
13 |
'Advanced_Ads_Ad_Ajax_Callbacks' => $baseDir . '/classes/ad_ajax_callbacks.php',
|
14 |
'Advanced_Ads_Ad_Debug' => $baseDir . '/classes/ad-debug.php',
|
|
|
15 |
'Advanced_Ads_Ad_List_Filters' => $baseDir . '/admin/includes/class-list-filters.php',
|
16 |
'Advanced_Ads_Ad_Type_Abstract' => $baseDir . '/classes/ad_type_abstract.php',
|
17 |
'Advanced_Ads_Ad_Type_Content' => $baseDir . '/classes/ad_type_content.php',
|
12 |
'Advanced_Ads_Ad' => $baseDir . '/classes/ad.php',
|
13 |
'Advanced_Ads_Ad_Ajax_Callbacks' => $baseDir . '/classes/ad_ajax_callbacks.php',
|
14 |
'Advanced_Ads_Ad_Debug' => $baseDir . '/classes/ad-debug.php',
|
15 |
+
'Advanced_Ads_Ad_Health_Notices' => $baseDir . '/classes/ad-health-notices.php',
|
16 |
'Advanced_Ads_Ad_List_Filters' => $baseDir . '/admin/includes/class-list-filters.php',
|
17 |
'Advanced_Ads_Ad_Type_Abstract' => $baseDir . '/classes/ad_type_abstract.php',
|
18 |
'Advanced_Ads_Ad_Type_Content' => $baseDir . '/classes/ad_type_content.php',
|
vendor/composer/autoload_real_52.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
-
class
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitf5d5d78e14ee3ef64a684f6e70b265cd {
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
2 |
|
3 |
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
|
5 |
+
class ComposerAutoloaderInit7ce491af71c20f0c4c61971657d35fd8 {
|
6 |
private static $loader;
|
7 |
|
8 |
public static function loadClassLoader($class) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit7ce491af71c20f0c4c61971657d35fd8', 'loadClassLoader'), true /*, true */);
|
23 |
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit7ce491af71c20f0c4c61971657d35fd8', 'loadClassLoader'));
|
25 |
|
26 |
$vendorDir = dirname(dirname(__FILE__));
|
27 |
$baseDir = dirname($vendorDir);
|
vendor/composer/autoload_static.php
CHANGED
@@ -37,6 +37,7 @@ class ComposerStaticInitd24de3c06687d3cf4aad0b15c83747be
|
|
37 |
'Advanced_Ads_Ad' => __DIR__ . '/../..' . '/classes/ad.php',
|
38 |
'Advanced_Ads_Ad_Ajax_Callbacks' => __DIR__ . '/../..' . '/classes/ad_ajax_callbacks.php',
|
39 |
'Advanced_Ads_Ad_Debug' => __DIR__ . '/../..' . '/classes/ad-debug.php',
|
|
|
40 |
'Advanced_Ads_Ad_List_Filters' => __DIR__ . '/../..' . '/admin/includes/class-list-filters.php',
|
41 |
'Advanced_Ads_Ad_Type_Abstract' => __DIR__ . '/../..' . '/classes/ad_type_abstract.php',
|
42 |
'Advanced_Ads_Ad_Type_Content' => __DIR__ . '/../..' . '/classes/ad_type_content.php',
|
37 |
'Advanced_Ads_Ad' => __DIR__ . '/../..' . '/classes/ad.php',
|
38 |
'Advanced_Ads_Ad_Ajax_Callbacks' => __DIR__ . '/../..' . '/classes/ad_ajax_callbacks.php',
|
39 |
'Advanced_Ads_Ad_Debug' => __DIR__ . '/../..' . '/classes/ad-debug.php',
|
40 |
+
'Advanced_Ads_Ad_Health_Notices' => __DIR__ . '/../..' . '/classes/ad-health-notices.php',
|
41 |
'Advanced_Ads_Ad_List_Filters' => __DIR__ . '/../..' . '/admin/includes/class-list-filters.php',
|
42 |
'Advanced_Ads_Ad_Type_Abstract' => __DIR__ . '/../..' . '/classes/ad_type_abstract.php',
|
43 |
'Advanced_Ads_Ad_Type_Content' => __DIR__ . '/../..' . '/classes/ad_type_content.php',
|