Version Description
- AdSense deprecated Link Units and might no longer fill them. So we removed them when creating new ads. Learn more
- enable AdSense Auto ads on AMP pages
- interpret WP blocks in the plain text ad type
- remove MailPoet warning since they are not retiring custom shortcodes after all
- convert jQuery shorthand functions to
.on()
and.trigger()
- made shortcode button work with WordPress 4.9
- allow to exclude conditions from the "new display condition" dropdown
- prevent AdSense earnings box from appearing on non AdSense ad page when AdSense connection is lost
Download this release
Release Info
Developer | advancedads |
Plugin | Advanced Ads |
Version | 1.24.0 |
Comparing to | |
See all releases |
Code changes from version 1.23.2 to 1.24.0
- admin/assets/js/admin-global.js +19 -18
- admin/assets/js/admin.js +28 -29
- admin/assets/js/conditions.js +1 -2
- admin/assets/js/ui.js +2 -4
- admin/assets/js/wizard.js +8 -8
- admin/includes/ad-health-notices.php +8 -23
- admin/includes/class-shortcode-creator.php +5 -3
- advanced-ads.php +2 -2
- classes/ad_type_plain.php +7 -0
- classes/compatibility.php +0 -14
- classes/display-conditions.php +30 -3
- classes/frontend_checks.php +0 -10
- languages/advanced-ads.pot +136 -136
- modules/gadsense/admin/views/adsense-ad-parameters.php +11 -0
- modules/gadsense/admin/views/settings/amp-auto-ads.php +15 -0
- modules/gadsense/includes/class-ad-type-adsense.php +13 -4
- modules/gadsense/includes/class-gadsense-data.php +18 -7
- modules/gadsense/includes/class-network-adsense.php +49 -42
- modules/gadsense/public/public.php +79 -2
- readme.txt +14 -3
admin/assets/js/admin-global.js
CHANGED
@@ -7,10 +7,6 @@ jQuery( document ).ready(function () {
|
|
7 |
* ADMIN NOTICES
|
8 |
*/
|
9 |
// close button
|
10 |
-
// remove duplicate close buttons
|
11 |
-
jQuery(window).on('load', function () {
|
12 |
-
jQuery('a.notice-dismiss').next('button.notice-dismiss').remove();
|
13 |
-
});
|
14 |
// .advads-notice-dismiss class can be used to add a custom close button (e.g., link)
|
15 |
jQuery(document).on('click', '.advads-admin-notice .notice-dismiss, .advads-notice-dismiss', function(event){
|
16 |
event.preventDefault();
|
@@ -84,7 +80,7 @@ jQuery( document ).ready(function () {
|
|
84 |
if( notice.attr('data-notice') === undefined) return;
|
85 |
// var list = notice.parent( 'ul' );
|
86 |
var remove = jQuery( this ).hasClass( 'remove' );
|
87 |
-
|
88 |
// fix height to prevent the box from going smaller first, then show the "show" link and grow again
|
89 |
var notice_box = jQuery( '#advads_overview_notices' );
|
90 |
notice_box.css( 'height', notice_box.height() + 'px' );
|
@@ -119,14 +115,14 @@ jQuery( document ).ready(function () {
|
|
119 |
jQuery(document).on('click', '.adsvads-ad-health-notices-show-hidden', function(){
|
120 |
advads_ad_health_show_hidden();
|
121 |
});
|
122 |
-
|
123 |
/**
|
124 |
* DEACTIVATION FEEDBACK FORM
|
125 |
*/
|
126 |
// show overlay when clicked on "deactivate"
|
127 |
advads_deactivate_link = jQuery('.wp-admin.plugins-php tr[data-slug="advanced-ads"] .row-actions .deactivate a');
|
128 |
advads_deactivate_link_url = advads_deactivate_link.attr( 'href' );
|
129 |
-
advads_deactivate_link.click
|
130 |
e.preventDefault();
|
131 |
// only show feedback form once per 30 days
|
132 |
var c_value = advads_admin_get_cookie( "advanced_ads_hide_deactivate_feedback" );
|
@@ -138,17 +134,17 @@ jQuery( document ).ready(function () {
|
|
138 |
}
|
139 |
});
|
140 |
// show text fields
|
141 |
-
jQuery('#advanced-ads-feedback-content input[type="radio"]').click
|
142 |
// show text field if there is one
|
143 |
jQuery(this).parents('li').next('li').children('input[type="text"], textarea').show();
|
144 |
});
|
145 |
// handle technical issue feedback in particular
|
146 |
-
jQuery('#advanced-ads-feedback-content .advanced_ads_disable_help_text').focus
|
147 |
// show text field if there is one
|
148 |
jQuery(this).parents('li').siblings('.advanced_ads_disable_reply').show();
|
149 |
});
|
150 |
// send form or close it
|
151 |
-
jQuery('#advanced-ads-feedback-content .button').click
|
152 |
e.preventDefault();
|
153 |
var self = jQuery( this );
|
154 |
// set cookie for 30 days
|
@@ -157,7 +153,7 @@ jQuery( document ).ready(function () {
|
|
157 |
document.cookie = "advanced_ads_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
|
158 |
// save if plugin should be disabled
|
159 |
var disable_plugin = self.hasClass('advanced-ads-feedback-not-deactivate') ? false : true;
|
160 |
-
|
161 |
// hide the content of the feedback form
|
162 |
jQuery( '#advanced-ads-feedback-content form' ).hide();
|
163 |
if ( self.hasClass('advanced-ads-feedback-submit') ) {
|
@@ -192,7 +188,7 @@ jQuery( document ).ready(function () {
|
|
192 |
}
|
193 |
});
|
194 |
// close form and disable the plugin without doing anything
|
195 |
-
jQuery('.advanced-ads-feedback-only-deactivate').click
|
196 |
// hide the content of the feedback form
|
197 |
jQuery( '#advanced-ads-feedback-content form' ).hide();
|
198 |
// show feedback message
|
@@ -205,11 +201,16 @@ jQuery( document ).ready(function () {
|
|
205 |
}, 3000);
|
206 |
});
|
207 |
// close button for feedback form
|
208 |
-
jQuery('#advanced-ads-feedback-overlay-close-button').click
|
209 |
jQuery( '#advanced-ads-feedback-overlay' ).hide();
|
210 |
});
|
211 |
});
|
212 |
|
|
|
|
|
|
|
|
|
|
|
213 |
function advads_admin_get_cookie (name) {
|
214 |
var i, x, y, ADVcookies = document.cookie.split( ";" );
|
215 |
for (i = 0; i < ADVcookies.length; i++)
|
@@ -258,20 +259,20 @@ function advads_display_ad_health_notices(){
|
|
258 |
action: 'advads-ad-health-notice-display',
|
259 |
nonce: advadsglobal.ajax_nonce
|
260 |
};
|
261 |
-
|
262 |
var widget = jQuery( '#advads_overview_notices .main' );
|
263 |
-
|
264 |
// add loader icon to the widget
|
265 |
widget.html( '<span class="advads-loader"></span>' );
|
266 |
// send query
|
267 |
jQuery.post(ajaxurl, query, function (r) {
|
268 |
widget.html( r );
|
269 |
-
|
270 |
// update number in menu
|
271 |
advads_ad_health_reload_number_in_menu();
|
272 |
// update list headlines
|
273 |
advads_ad_health_maybe_remove_list();
|
274 |
-
|
275 |
// remove widget, if return is empty
|
276 |
if( r === '' ){
|
277 |
jQuery( '#advads_overview_notices' ).remove();
|
@@ -318,7 +319,7 @@ function advads_ad_health_maybe_remove_list(){
|
|
318 |
var lists = jQuery( document ).find( '#advads_overview_notices .advads-ad-health-notices' );
|
319 |
|
320 |
// check each list separately
|
321 |
-
lists.each( function( index ) {
|
322 |
var list = jQuery( this );
|
323 |
// check if there are visible items in the list
|
324 |
if( list.find( 'li:visible' ).length ){
|
7 |
* ADMIN NOTICES
|
8 |
*/
|
9 |
// close button
|
|
|
|
|
|
|
|
|
10 |
// .advads-notice-dismiss class can be used to add a custom close button (e.g., link)
|
11 |
jQuery(document).on('click', '.advads-admin-notice .notice-dismiss, .advads-notice-dismiss', function(event){
|
12 |
event.preventDefault();
|
80 |
if( notice.attr('data-notice') === undefined) return;
|
81 |
// var list = notice.parent( 'ul' );
|
82 |
var remove = jQuery( this ).hasClass( 'remove' );
|
83 |
+
|
84 |
// fix height to prevent the box from going smaller first, then show the "show" link and grow again
|
85 |
var notice_box = jQuery( '#advads_overview_notices' );
|
86 |
notice_box.css( 'height', notice_box.height() + 'px' );
|
115 |
jQuery(document).on('click', '.adsvads-ad-health-notices-show-hidden', function(){
|
116 |
advads_ad_health_show_hidden();
|
117 |
});
|
118 |
+
|
119 |
/**
|
120 |
* DEACTIVATION FEEDBACK FORM
|
121 |
*/
|
122 |
// show overlay when clicked on "deactivate"
|
123 |
advads_deactivate_link = jQuery('.wp-admin.plugins-php tr[data-slug="advanced-ads"] .row-actions .deactivate a');
|
124 |
advads_deactivate_link_url = advads_deactivate_link.attr( 'href' );
|
125 |
+
advads_deactivate_link.on( 'click', function ( e ) {
|
126 |
e.preventDefault();
|
127 |
// only show feedback form once per 30 days
|
128 |
var c_value = advads_admin_get_cookie( "advanced_ads_hide_deactivate_feedback" );
|
134 |
}
|
135 |
});
|
136 |
// show text fields
|
137 |
+
jQuery('#advanced-ads-feedback-content input[type="radio"]').on('click',function () {
|
138 |
// show text field if there is one
|
139 |
jQuery(this).parents('li').next('li').children('input[type="text"], textarea').show();
|
140 |
});
|
141 |
// handle technical issue feedback in particular
|
142 |
+
jQuery('#advanced-ads-feedback-content .advanced_ads_disable_help_text').on('focus',function () {
|
143 |
// show text field if there is one
|
144 |
jQuery(this).parents('li').siblings('.advanced_ads_disable_reply').show();
|
145 |
});
|
146 |
// send form or close it
|
147 |
+
jQuery('#advanced-ads-feedback-content .button').on('click', function ( e ) {
|
148 |
e.preventDefault();
|
149 |
var self = jQuery( this );
|
150 |
// set cookie for 30 days
|
153 |
document.cookie = "advanced_ads_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
|
154 |
// save if plugin should be disabled
|
155 |
var disable_plugin = self.hasClass('advanced-ads-feedback-not-deactivate') ? false : true;
|
156 |
+
|
157 |
// hide the content of the feedback form
|
158 |
jQuery( '#advanced-ads-feedback-content form' ).hide();
|
159 |
if ( self.hasClass('advanced-ads-feedback-submit') ) {
|
188 |
}
|
189 |
});
|
190 |
// close form and disable the plugin without doing anything
|
191 |
+
jQuery('.advanced-ads-feedback-only-deactivate').on('click', function () {
|
192 |
// hide the content of the feedback form
|
193 |
jQuery( '#advanced-ads-feedback-content form' ).hide();
|
194 |
// show feedback message
|
201 |
}, 3000);
|
202 |
});
|
203 |
// close button for feedback form
|
204 |
+
jQuery('#advanced-ads-feedback-overlay-close-button').on('click', function () {
|
205 |
jQuery( '#advanced-ads-feedback-overlay' ).hide();
|
206 |
});
|
207 |
});
|
208 |
|
209 |
+
// remove duplicate close buttons
|
210 |
+
jQuery(window).on('load', function () {
|
211 |
+
jQuery('a.notice-dismiss').next('button.notice-dismiss').remove();
|
212 |
+
});
|
213 |
+
|
214 |
function advads_admin_get_cookie (name) {
|
215 |
var i, x, y, ADVcookies = document.cookie.split( ";" );
|
216 |
for (i = 0; i < ADVcookies.length; i++)
|
259 |
action: 'advads-ad-health-notice-display',
|
260 |
nonce: advadsglobal.ajax_nonce
|
261 |
};
|
262 |
+
|
263 |
var widget = jQuery( '#advads_overview_notices .main' );
|
264 |
+
|
265 |
// add loader icon to the widget
|
266 |
widget.html( '<span class="advads-loader"></span>' );
|
267 |
// send query
|
268 |
jQuery.post(ajaxurl, query, function (r) {
|
269 |
widget.html( r );
|
270 |
+
|
271 |
// update number in menu
|
272 |
advads_ad_health_reload_number_in_menu();
|
273 |
// update list headlines
|
274 |
advads_ad_health_maybe_remove_list();
|
275 |
+
|
276 |
// remove widget, if return is empty
|
277 |
if( r === '' ){
|
278 |
jQuery( '#advads_overview_notices' ).remove();
|
319 |
var lists = jQuery( document ).find( '#advads_overview_notices .advads-ad-health-notices' );
|
320 |
|
321 |
// check each list separately
|
322 |
+
lists.each( function( index ) {
|
323 |
var list = jQuery( this );
|
324 |
// check if there are visible items in the list
|
325 |
if( list.find( 'li:visible' ).length ){
|
admin/assets/js/admin.js
CHANGED
@@ -106,13 +106,13 @@ jQuery( document ).ready( function ( $ ) {
|
|
106 |
*/
|
107 |
|
108 |
// display new ad group form
|
109 |
-
$( '#advads-new-ad-group-link' ).
|
110 |
e.preventDefault()
|
111 |
$( '#advads-new-group-form' ).show().find( 'input[type="text"]' ).focus()
|
112 |
} )
|
113 |
|
114 |
// display ad groups form
|
115 |
-
|
116 |
e.preventDefault();
|
117 |
var advadsgroupformrow = $(this).parents('.advads-group-row').next('.advads-ad-group-form');
|
118 |
if (advadsgroupformrow.is(':visible')) {
|
@@ -128,7 +128,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
128 |
}
|
129 |
});
|
130 |
// display ad groups usage
|
131 |
-
|
132 |
e.preventDefault();
|
133 |
var usagediv = $(this).parents('.advads-group-row').find('.advads-usage');
|
134 |
if (usagediv.is(':visible')) {
|
@@ -138,8 +138,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
138 |
}
|
139 |
});
|
140 |
// handle the submission of the groups form
|
141 |
-
$( 'form#advads-form-groups' ).
|
142 |
-
var grouprows = jQuery( 'tr.advads-ad-group-form' )
|
143 |
jQuery( 'tr.advads-ad-group-form' ).each( function ( k, v ) {
|
144 |
v = jQuery( v )
|
145 |
if ( ! v.data( 'touched' ) ) {
|
@@ -148,12 +147,12 @@ jQuery( document ).ready( function ( $ ) {
|
|
148 |
} )
|
149 |
} )
|
150 |
// display placement settings form
|
151 |
-
$( '.advads-placements-table a.advads-placement-options-link' ).
|
152 |
e.preventDefault()
|
153 |
Advanced_Ads_Admin.toggle_placements_visibility( this )
|
154 |
} )
|
155 |
// display manual placement usage
|
156 |
-
$( '.advads-placements-table .usage-link' ).
|
157 |
e.preventDefault()
|
158 |
var usagediv = $( this ).parents( 'tr' ).find( '.advads-usage' )
|
159 |
if ( usagediv.is( ':visible' ) ) {
|
@@ -163,7 +162,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
163 |
}
|
164 |
} )
|
165 |
// show warning if Container ID option contains invalid characters
|
166 |
-
$( '#advads-output-wrapper-id' ).
|
167 |
var id_value = $( this ).val()
|
168 |
if ( /^[a-z-0-9]*$/.test( id_value ) ) {
|
169 |
$( '.advads-output-wrapper-id-error' ).removeClass( 'advads-error-message' )
|
@@ -183,7 +182,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
183 |
}
|
184 |
|
185 |
// group page: add ad to group
|
186 |
-
$( '.advads-group-add-ad button' ).
|
187 |
var $settings_row = $( this ).closest( '.advads-ad-group-form' ),
|
188 |
$ad = $settings_row.find( '.advads-group-add-ad-list-ads option:selected' )
|
189 |
$weight_selector = $settings_row.find( '.advads-group-add-ad-list-weights' ).last(),
|
@@ -213,7 +212,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
213 |
$ad_row.remove()
|
214 |
} )
|
215 |
// group page: handle switching of group types based on a class derrived from that type
|
216 |
-
$( '.advads-ad-group-type input' ).
|
217 |
advads_show_group_options( $( this ) )
|
218 |
} )
|
219 |
|
@@ -241,7 +240,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
241 |
|
242 |
} )
|
243 |
// show more than 3 ads when clicked on a link
|
244 |
-
$( '.advads-group-ads-list-show-more' ).
|
245 |
jQuery( this ).hide().parents( '.advads-ad-group-list-ads' ).find( 'li' ).show()
|
246 |
} )
|
247 |
|
@@ -250,7 +249,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
250 |
*/
|
251 |
|
252 |
// automatically copy the first entered license key into all other empty fields
|
253 |
-
$( '.advads-settings-tab-main-form .advads-license-key' ).
|
254 |
// get number of license fields
|
255 |
|
256 |
var license_key = $( this ).val()
|
@@ -279,7 +278,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
279 |
} )
|
280 |
|
281 |
// activate licenses
|
282 |
-
$( '.advads-license-activate' ).
|
283 |
|
284 |
var button = $( this )
|
285 |
|
@@ -331,7 +330,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
331 |
} )
|
332 |
|
333 |
// deactivate licenses
|
334 |
-
$( '.advads-license-deactivate' ).
|
335 |
|
336 |
var button = $( this )
|
337 |
|
@@ -418,7 +417,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
418 |
} )
|
419 |
|
420 |
// on submit remove placements that were untouched
|
421 |
-
$( 'form#advanced-ads-placements-form' ).
|
422 |
var grouprows = jQuery( 'form#advanced-ads-placements-form tr.advanced-ads-placement-row' )
|
423 |
jQuery( 'form#advanced-ads-placements-form tr.advanced-ads-placement-row' ).each( function ( k, v ) {
|
424 |
v = jQuery( v )
|
@@ -437,7 +436,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
437 |
advads_show_placement_content_xpath_field( this );
|
438 |
})
|
439 |
// update xpath field when tag option changes
|
440 |
-
$( '.advads-placements-content-tag' ).
|
441 |
advads_show_placement_content_xpath_field( this );
|
442 |
} )
|
443 |
/**
|
@@ -502,7 +501,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
502 |
$( '#advads-image-preview' ).html( new_image )
|
503 |
$( '#advads-image-edit-link' ).attr( 'href', attachment.editLink )
|
504 |
// process "reserve this space" checkbox
|
505 |
-
$( '#advanced-ads-ad-parameters-size input[type=number]:first' ).change
|
506 |
}
|
507 |
} )
|
508 |
} )
|
@@ -516,7 +515,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
516 |
window.formfield = ''
|
517 |
|
518 |
// adblocker related code
|
519 |
-
$( '#advanced-ads-use-adblocker' ).
|
520 |
advads_toggle_box( this, '#advads-adblocker-wrapper' )
|
521 |
} )
|
522 |
|
@@ -568,30 +567,30 @@ jQuery( document ).ready( function ( $ ) {
|
|
568 |
} )
|
569 |
// process "reserve this space" checkbox - ad type changed
|
570 |
$( '#advanced-ads-ad-parameters' ).on( 'paramloaded', function () {
|
571 |
-
$( '#advanced-ads-ad-parameters-size input[type=number]:first' ).change
|
572 |
-
} )
|
573 |
// process "reserve this space" checkbox - on load
|
574 |
-
$( '#advanced-ads-ad-parameters-size input[type=number]:first' ).change
|
575 |
|
576 |
// move meta box markup to hndle headline
|
577 |
$( '.advads-hndlelinks' ).each( function () {
|
578 |
$( this ).appendTo( $( this ).parents('.postbox').find( 'h2.hndle' ) )
|
579 |
$( this ).removeClass( 'hidden' )
|
580 |
-
} )
|
581 |
// open tutorial link when clicked on it
|
582 |
-
$( '.advads-video-link' ).
|
583 |
el.preventDefault()
|
584 |
var video_container = $( this ).parents( 'h2' ).siblings( '.inside' ).find( '.advads-video-link-container' )
|
585 |
video_container.html( video_container.data( 'videolink' ) )
|
586 |
-
} )
|
587 |
// open inline tutorial link when clicked on it
|
588 |
-
$( '.advads-video-link-inline' ).
|
589 |
el.preventDefault()
|
590 |
var video_container = $( this ).parents( 'div' ).siblings( '.advads-video-link-container' )
|
591 |
video_container.html( video_container.data( 'videolink' ) )
|
592 |
-
} )
|
593 |
// switch import type
|
594 |
-
jQuery( '.advads_import_type' ).
|
595 |
if ( this.value === 'xml_content' ) {
|
596 |
jQuery( '#advads_xml_file' ).hide()
|
597 |
jQuery( '#advads_xml_content' ).show()
|
@@ -599,7 +598,7 @@ jQuery( document ).ready( function ( $ ) {
|
|
599 |
jQuery( '#advads_xml_file' ).show()
|
600 |
jQuery( '#advads_xml_content' ).hide()
|
601 |
}
|
602 |
-
} )
|
603 |
|
604 |
// Find Adsense Auto Ads inside ad content.
|
605 |
var ad_content = jQuery( 'textarea[name=advanced_ad\\[content\\]]' ).html()
|
@@ -795,7 +794,7 @@ function advads_ads_txt_find_issues () {
|
|
795 |
load( 'get_notices' )
|
796 |
}
|
797 |
|
798 |
-
$refresh.click
|
799 |
load( 'get_notices' )
|
800 |
} )
|
801 |
|
106 |
*/
|
107 |
|
108 |
// display new ad group form
|
109 |
+
$( '#advads-new-ad-group-link' ).on( 'click', function ( e ) {
|
110 |
e.preventDefault()
|
111 |
$( '#advads-new-group-form' ).show().find( 'input[type="text"]' ).focus()
|
112 |
} )
|
113 |
|
114 |
// display ad groups form
|
115 |
+
$( '#advads-ad-group-list a.edit, #advads-ad-group-list a.row-title' ).on( 'click', function ( e ) {
|
116 |
e.preventDefault();
|
117 |
var advadsgroupformrow = $(this).parents('.advads-group-row').next('.advads-ad-group-form');
|
118 |
if (advadsgroupformrow.is(':visible')) {
|
128 |
}
|
129 |
});
|
130 |
// display ad groups usage
|
131 |
+
$( '#advads-ad-group-list a.usage' ).on( 'click', function ( e ) {
|
132 |
e.preventDefault();
|
133 |
var usagediv = $(this).parents('.advads-group-row').find('.advads-usage');
|
134 |
if (usagediv.is(':visible')) {
|
138 |
}
|
139 |
});
|
140 |
// handle the submission of the groups form
|
141 |
+
$( 'form#advads-form-groups' ).on( 'submit', function () {
|
|
|
142 |
jQuery( 'tr.advads-ad-group-form' ).each( function ( k, v ) {
|
143 |
v = jQuery( v )
|
144 |
if ( ! v.data( 'touched' ) ) {
|
147 |
} )
|
148 |
} )
|
149 |
// display placement settings form
|
150 |
+
$( '.advads-placements-table a.advads-placement-options-link' ).on( 'click', function ( e ) {
|
151 |
e.preventDefault()
|
152 |
Advanced_Ads_Admin.toggle_placements_visibility( this )
|
153 |
} )
|
154 |
// display manual placement usage
|
155 |
+
$( '.advads-placements-table .usage-link' ).on( 'click', function ( e ) {
|
156 |
e.preventDefault()
|
157 |
var usagediv = $( this ).parents( 'tr' ).find( '.advads-usage' )
|
158 |
if ( usagediv.is( ':visible' ) ) {
|
162 |
}
|
163 |
} )
|
164 |
// show warning if Container ID option contains invalid characters
|
165 |
+
$( '#advads-output-wrapper-id' ).on( 'keyup', function () {
|
166 |
var id_value = $( this ).val()
|
167 |
if ( /^[a-z-0-9]*$/.test( id_value ) ) {
|
168 |
$( '.advads-output-wrapper-id-error' ).removeClass( 'advads-error-message' )
|
182 |
}
|
183 |
|
184 |
// group page: add ad to group
|
185 |
+
$( '.advads-group-add-ad button' ).on( 'click', function () {
|
186 |
var $settings_row = $( this ).closest( '.advads-ad-group-form' ),
|
187 |
$ad = $settings_row.find( '.advads-group-add-ad-list-ads option:selected' )
|
188 |
$weight_selector = $settings_row.find( '.advads-group-add-ad-list-weights' ).last(),
|
212 |
$ad_row.remove()
|
213 |
} )
|
214 |
// group page: handle switching of group types based on a class derrived from that type
|
215 |
+
$( '.advads-ad-group-type input' ).on( 'click', function () {
|
216 |
advads_show_group_options( $( this ) )
|
217 |
} )
|
218 |
|
240 |
|
241 |
} )
|
242 |
// show more than 3 ads when clicked on a link
|
243 |
+
$( '.advads-group-ads-list-show-more' ).on( 'click', function () {
|
244 |
jQuery( this ).hide().parents( '.advads-ad-group-list-ads' ).find( 'li' ).show()
|
245 |
} )
|
246 |
|
249 |
*/
|
250 |
|
251 |
// automatically copy the first entered license key into all other empty fields
|
252 |
+
$( '.advads-settings-tab-main-form .advads-license-key' ).on( 'blur', function () {
|
253 |
// get number of license fields
|
254 |
|
255 |
var license_key = $( this ).val()
|
278 |
} )
|
279 |
|
280 |
// activate licenses
|
281 |
+
$( '.advads-license-activate' ).on( 'click', function () {
|
282 |
|
283 |
var button = $( this )
|
284 |
|
330 |
} )
|
331 |
|
332 |
// deactivate licenses
|
333 |
+
$( '.advads-license-deactivate' ).on( 'click', function () {
|
334 |
|
335 |
var button = $( this )
|
336 |
|
417 |
} )
|
418 |
|
419 |
// on submit remove placements that were untouched
|
420 |
+
$( 'form#advanced-ads-placements-form' ).on( 'submit', function () {
|
421 |
var grouprows = jQuery( 'form#advanced-ads-placements-form tr.advanced-ads-placement-row' )
|
422 |
jQuery( 'form#advanced-ads-placements-form tr.advanced-ads-placement-row' ).each( function ( k, v ) {
|
423 |
v = jQuery( v )
|
436 |
advads_show_placement_content_xpath_field( this );
|
437 |
})
|
438 |
// update xpath field when tag option changes
|
439 |
+
$( '.advads-placements-content-tag' ).on( 'change', function () {
|
440 |
advads_show_placement_content_xpath_field( this );
|
441 |
} )
|
442 |
/**
|
501 |
$( '#advads-image-preview' ).html( new_image )
|
502 |
$( '#advads-image-edit-link' ).attr( 'href', attachment.editLink )
|
503 |
// process "reserve this space" checkbox
|
504 |
+
$( '#advanced-ads-ad-parameters-size input[type=number]:first' ).trigger( 'change' );
|
505 |
}
|
506 |
} )
|
507 |
} )
|
515 |
window.formfield = ''
|
516 |
|
517 |
// adblocker related code
|
518 |
+
$( '#advanced-ads-use-adblocker' ).on( 'change', function () {
|
519 |
advads_toggle_box( this, '#advads-adblocker-wrapper' )
|
520 |
} )
|
521 |
|
567 |
} )
|
568 |
// process "reserve this space" checkbox - ad type changed
|
569 |
$( '#advanced-ads-ad-parameters' ).on( 'paramloaded', function () {
|
570 |
+
$( '#advanced-ads-ad-parameters-size input[type=number]:first' ).trigger( 'change' );
|
571 |
+
} );
|
572 |
// process "reserve this space" checkbox - on load
|
573 |
+
$( '#advanced-ads-ad-parameters-size input[type=number]:first' ).trigger( 'change' );
|
574 |
|
575 |
// move meta box markup to hndle headline
|
576 |
$( '.advads-hndlelinks' ).each( function () {
|
577 |
$( this ).appendTo( $( this ).parents('.postbox').find( 'h2.hndle' ) )
|
578 |
$( this ).removeClass( 'hidden' )
|
579 |
+
} );
|
580 |
// open tutorial link when clicked on it
|
581 |
+
$( '.advads-video-link' ).on( 'click', function ( el ) {
|
582 |
el.preventDefault()
|
583 |
var video_container = $( this ).parents( 'h2' ).siblings( '.inside' ).find( '.advads-video-link-container' )
|
584 |
video_container.html( video_container.data( 'videolink' ) )
|
585 |
+
} );
|
586 |
// open inline tutorial link when clicked on it
|
587 |
+
$( '.advads-video-link-inline' ).on( 'click', function ( el ) {
|
588 |
el.preventDefault()
|
589 |
var video_container = $( this ).parents( 'div' ).siblings( '.advads-video-link-container' )
|
590 |
video_container.html( video_container.data( 'videolink' ) )
|
591 |
+
} );
|
592 |
// switch import type
|
593 |
+
jQuery( '.advads_import_type' ).on( 'change', function () {
|
594 |
if ( this.value === 'xml_content' ) {
|
595 |
jQuery( '#advads_xml_file' ).hide()
|
596 |
jQuery( '#advads_xml_content' ).show()
|
598 |
jQuery( '#advads_xml_file' ).show()
|
599 |
jQuery( '#advads_xml_content' ).hide()
|
600 |
}
|
601 |
+
} );
|
602 |
|
603 |
// Find Adsense Auto Ads inside ad content.
|
604 |
var ad_content = jQuery( 'textarea[name=advanced_ad\\[content\\]]' ).html()
|
794 |
load( 'get_notices' )
|
795 |
}
|
796 |
|
797 |
+
$refresh.on('click', function () {
|
798 |
load( 'get_notices' )
|
799 |
} )
|
800 |
|
admin/assets/js/conditions.js
CHANGED
@@ -7,8 +7,7 @@ jQuery( document ).ready(
|
|
7 |
/**
|
8 |
* Pressing the button to add a new condition to the list of conditions
|
9 |
*/
|
10 |
-
$( '.advads-conditions-new button' ).click(
|
11 |
-
function () {
|
12 |
// get the form fieldset and values.
|
13 |
var condition_form_container = $( this ).parents( 'fieldset' )
|
14 |
var condition_type = condition_form_container.find( '.advads-conditions-new select' ).val()
|
7 |
/**
|
8 |
* Pressing the button to add a new condition to the list of conditions
|
9 |
*/
|
10 |
+
$( '.advads-conditions-new button' ).on( 'click', function () {
|
|
|
11 |
// get the form fieldset and values.
|
12 |
var condition_form_container = $( this ).parents( 'fieldset' )
|
13 |
var condition_type = condition_form_container.find( '.advads-conditions-new select' ).val()
|
admin/assets/js/ui.js
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
$label.addClass( 'advads-ui-state-active' );
|
26 |
}
|
27 |
|
28 |
-
$button.change
|
29 |
var $changed = jQuery( this );
|
30 |
var $label = jQuery( 'label[for="' + $changed.attr( 'id' ) + '"]', $ancestor );
|
31 |
|
@@ -128,9 +128,7 @@
|
|
128 |
}
|
129 |
$this.data( 'advads_tooltip', true );
|
130 |
|
131 |
-
$this
|
132 |
-
.on( 'mouseover', open )
|
133 |
-
.on( 'focusin', open );
|
134 |
} );
|
135 |
};
|
136 |
} )( jQuery );
|
25 |
$label.addClass( 'advads-ui-state-active' );
|
26 |
}
|
27 |
|
28 |
+
$button.on('change', function() {
|
29 |
var $changed = jQuery( this );
|
30 |
var $label = jQuery( 'label[for="' + $changed.attr( 'id' ) + '"]', $ancestor );
|
31 |
|
128 |
}
|
129 |
$this.data( 'advads_tooltip', true );
|
130 |
|
131 |
+
$this.on( 'mouseover focusin', open );
|
|
|
|
|
132 |
} );
|
133 |
};
|
134 |
} )( jQuery );
|
admin/assets/js/wizard.js
CHANGED
@@ -16,21 +16,21 @@ var advads_wizard = {
|
|
16 |
status: false, // what is the current status? true if running, else false
|
17 |
init: function( status ){ // status can be "start" to start wizard or nothing to not start it
|
18 |
var _this = this;
|
19 |
-
jQuery('#advads-wizard-controls-next').click
|
20 |
-
jQuery('#advads-wizard-controls-prev').click
|
21 |
-
jQuery('#advads-wizard-controls-save').click
|
22 |
-
jQuery('#advads-wizard-display-conditions-show').click
|
23 |
-
jQuery('#advads-wizard-visitor-conditions-show').click
|
24 |
jQuery( '.advads-show-in-wizard').hide();
|
25 |
-
jQuery( '#advads-start-wizard' ).click
|
26 |
_this.start();
|
27 |
});
|
28 |
// end wizard when the button was clicked
|
29 |
-
jQuery( '.advads-stop-wizard' ).click
|
30 |
_this.close();
|
31 |
});
|
32 |
// jump to next box when ad type is selected
|
33 |
-
jQuery('#advanced-ad-type input').change
|
34 |
_this.next();
|
35 |
});
|
36 |
},
|
16 |
status: false, // what is the current status? true if running, else false
|
17 |
init: function( status ){ // status can be "start" to start wizard or nothing to not start it
|
18 |
var _this = this;
|
19 |
+
jQuery('#advads-wizard-controls-next').on('click', function( ){ _this.next(); } );
|
20 |
+
jQuery('#advads-wizard-controls-prev').on('click', function( ){ _this.prev(); } );
|
21 |
+
jQuery('#advads-wizard-controls-save').on('click', function( e ){ e.preventDefault(); jQuery('#publish').trigger('click'); } ); // save ad
|
22 |
+
jQuery('#advads-wizard-display-conditions-show').on('click', function( ){ _this.show_conditions( '#ad-display-box' ); } );
|
23 |
+
jQuery('#advads-wizard-visitor-conditions-show').on('click', function( ){ _this.show_conditions( '#ad-visitor-box' ); } );
|
24 |
jQuery( '.advads-show-in-wizard').hide();
|
25 |
+
jQuery( '#advads-start-wizard' ).on('click', function(){
|
26 |
_this.start();
|
27 |
});
|
28 |
// end wizard when the button was clicked
|
29 |
+
jQuery( '.advads-stop-wizard' ).on('click', function(){
|
30 |
_this.close();
|
31 |
});
|
32 |
// jump to next box when ad type is selected
|
33 |
+
jQuery('#advanced-ad-type input').on('change', function(){
|
34 |
_this.next();
|
35 |
});
|
36 |
},
|
admin/includes/ad-health-notices.php
CHANGED
@@ -116,19 +116,6 @@ $advanced_ads_ad_health_notices = apply_filters(
|
|
116 |
'get_help_link' => ADVADS_URL . 'manual/ad-health/?utm_source=advanced-ads&utm_medium=link&utm_campaign=error-visible-ad-in-header#header-ads',
|
117 |
'timeout' => YEAR_IN_SECONDS,
|
118 |
),
|
119 |
-
// ad AdSense ad was hidden in the frontend using CSS
|
120 |
-
// check in Ad Health in frontend.
|
121 |
-
'adsense_hidden' => array(
|
122 |
-
// 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.
|
123 |
-
'text' => sprintf(
|
124 |
-
'%s: %s.',
|
125 |
-
__( 'AdSense violation', 'advanced-ads' ),
|
126 |
-
__( 'Ad is hidden', 'advanced-ads' )
|
127 |
-
),
|
128 |
-
'type' => 'problem',
|
129 |
-
'hide' => false,
|
130 |
-
'get_help_link' => ADVADS_URL . 'adsense-errors/?utm_source=advanced-ads&utm_medium=link&utm_campaign=error-adsense-hidden#AdSense_hidden',
|
131 |
-
),
|
132 |
// Ad has HTTP, but site uses HTTPS
|
133 |
// check in Ad Health in frontend.
|
134 |
'ad_has_http' => array(
|
@@ -191,6 +178,14 @@ $advanced_ads_ad_health_notices = apply_filters(
|
|
191 |
) . ' ' . Advanced_Ads_Ad_Health_Notices::get_adsense_error_link( 'ADS_TXT_ISSUES' ),
|
192 |
'type' => 'problem',
|
193 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
'nested_the_content_filters' => array(
|
195 |
'text' => sprintf(
|
196 |
// translators: %s is a filter hook, here `the_content`.
|
@@ -286,15 +281,5 @@ $advanced_ads_ad_health_notices = apply_filters(
|
|
286 |
'hide' => false,
|
287 |
'timeout' => YEAR_IN_SECONDS,
|
288 |
),
|
289 |
-
// MailPoet changed how they are using custom shortcodes
|
290 |
-
// Advanced_Ads_Compatibility::mailpoet_ad_shortcode().
|
291 |
-
'mailpoet-deprecated-custom-shortcodes' => array(
|
292 |
-
'text' =>
|
293 |
-
__( 'MailPoet is going to deprecate custom shortcodes. This might remove ads from your newsletters.', 'advanced-ads' )
|
294 |
-
. ' <a href="' . ADVADS_URL . 'mailpoet-newsletters/?utm_source=advanced-ads&utm_medium=link&utm_campaign=notice-mailpoet-shortcodes#Enable_MailPoet_support_in_Advanced_Ads">' . __( 'Learn more', 'advanced-ads' ) . '</a>',
|
295 |
-
'type' => 'problem',
|
296 |
-
'hide' => false,
|
297 |
-
'timeout' => YEAR_IN_SECONDS,
|
298 |
-
),
|
299 |
)
|
300 |
);
|
116 |
'get_help_link' => ADVADS_URL . 'manual/ad-health/?utm_source=advanced-ads&utm_medium=link&utm_campaign=error-visible-ad-in-header#header-ads',
|
117 |
'timeout' => YEAR_IN_SECONDS,
|
118 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
// Ad has HTTP, but site uses HTTPS
|
120 |
// check in Ad Health in frontend.
|
121 |
'ad_has_http' => array(
|
178 |
) . ' ' . Advanced_Ads_Ad_Health_Notices::get_adsense_error_link( 'ADS_TXT_ISSUES' ),
|
179 |
'type' => 'problem',
|
180 |
),
|
181 |
+
// AdSense deprecated link units
|
182 |
+
'adsense_link_units_deprecated' => array(
|
183 |
+
'text' => __( 'Google AdSense deprecated Link Units. Please choose another format.', 'advanced-ads' )
|
184 |
+
. ' <a href="' . esc_url( ADVADS_URL ) . 'adsense-link-units/" target="_blank" rel="noopener">'
|
185 |
+
. esc_html__( 'Learn more', 'advanced-ads' )
|
186 |
+
. '</a>',
|
187 |
+
'type' => 'problem',
|
188 |
+
),
|
189 |
'nested_the_content_filters' => array(
|
190 |
'text' => sprintf(
|
191 |
// translators: %s is a filter hook, here `the_content`.
|
281 |
'hide' => false,
|
282 |
'timeout' => YEAR_IN_SECONDS,
|
283 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
)
|
285 |
);
|
admin/includes/class-shortcode-creator.php
CHANGED
@@ -74,8 +74,10 @@ class Advanced_Ads_Shortcode_Creator {
|
|
74 |
|
75 |
/**
|
76 |
* Print shortcode plugin inline.
|
|
|
|
|
77 |
*/
|
78 |
-
public function print_shortcode_plugin() {
|
79 |
static $printed = null;
|
80 |
|
81 |
if ( $printed !== null ) {
|
@@ -84,8 +86,8 @@ class Advanced_Ads_Shortcode_Creator {
|
|
84 |
|
85 |
$printed = true;
|
86 |
|
87 |
-
//
|
88 |
-
if ( !
|
89 |
return;
|
90 |
}
|
91 |
|
74 |
|
75 |
/**
|
76 |
* Print shortcode plugin inline.
|
77 |
+
*
|
78 |
+
* @param array|null $mce_settings TinyMCE settings array.
|
79 |
*/
|
80 |
+
public function print_shortcode_plugin( $mce_settings = array() ) {
|
81 |
static $printed = null;
|
82 |
|
83 |
if ( $printed !== null ) {
|
86 |
|
87 |
$printed = true;
|
88 |
|
89 |
+
// The `tinymce` argument of the `wp_editor()` function is set to `false`.
|
90 |
+
if ( empty( $mce_settings ) && ! ( doing_action( 'print_default_editor_scripts' ) && user_can_richedit() ) ) {
|
91 |
return;
|
92 |
}
|
93 |
|
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, Advanced Ads GmbH
|
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 |
// Autoloading, modules and functions.
|
45 |
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
+
* Version: 1.24.0
|
16 |
* Author: Thomas Maier, Advanced Ads GmbH
|
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.24.0' );
|
43 |
|
44 |
// Autoloading, modules and functions.
|
45 |
|
classes/ad_type_plain.php
CHANGED
@@ -159,6 +159,13 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
159 |
return '';
|
160 |
}
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
if ( ! empty( $ad->output['allow_shortcodes'] ) ) {
|
163 |
$content = $this->do_shortcode( $content, $ad );
|
164 |
}
|
159 |
return '';
|
160 |
}
|
161 |
|
162 |
+
/**
|
163 |
+
* Apply do_blocks if the content has block code
|
164 |
+
*/
|
165 |
+
if ( has_blocks( $content ) ) {
|
166 |
+
$content = do_blocks( $content );
|
167 |
+
}
|
168 |
+
|
169 |
if ( ! empty( $ad->output['allow_shortcodes'] ) ) {
|
170 |
$content = $this->do_shortcode( $content, $ad );
|
171 |
}
|
classes/compatibility.php
CHANGED
@@ -143,10 +143,6 @@ class Advanced_Ads_Compatibility {
|
|
143 |
* e.g., [custom:ad:123] to display ad with the ID 123
|
144 |
* [custom:ad_group:345] to display ad group with the ID 345
|
145 |
*
|
146 |
-
* DECEMBER 2020: MailPoet deprecated support for custom shortcodes in December 2020
|
147 |
-
* right now, it is not clear if and how this will work in the future
|
148 |
-
* we add an Ad Health notice to users who use one of our custom shortcodes
|
149 |
-
*
|
150 |
* @param string $shortcode shortcode that placed the ad.
|
151 |
* @param mixed $newsletter unused.
|
152 |
* @param mixed $subscriber unused.
|
@@ -168,11 +164,6 @@ class Advanced_Ads_Compatibility {
|
|
168 |
return '';
|
169 |
}
|
170 |
|
171 |
-
// see function comment above
|
172 |
-
if ( class_exists( 'Advanced_Ads_Ad_Health_Notices', false ) ) {
|
173 |
-
Advanced_Ads_Ad_Health_Notices::get_instance()->add( 'mailpoet-deprecated-custom-shortcodes' );
|
174 |
-
}
|
175 |
-
|
176 |
// only display if the ad group type could work, i.e. default (random) and ordered.
|
177 |
$ad_group = new Advanced_Ads_Group( $group_id );
|
178 |
if ( isset( $ad_group->type ) && in_array( $ad_group->type, array( 'default', 'ordered' ), true ) ) {
|
@@ -192,11 +183,6 @@ class Advanced_Ads_Compatibility {
|
|
192 |
return '';
|
193 |
}
|
194 |
|
195 |
-
// see function comment above
|
196 |
-
if ( class_exists( 'Advanced_Ads_Ad_Health_Notices', false ) ) {
|
197 |
-
Advanced_Ads_Ad_Health_Notices::get_instance()->add( 'mailpoet-deprecated-custom-shortcodes' );
|
198 |
-
}
|
199 |
-
|
200 |
$ad = new Advanced_Ads_Ad( $ad_id );
|
201 |
// only display if the ad type could work, i.e. plain text and image ads.
|
202 |
if ( isset( $ad->type ) && in_array( $ad->type, array( 'plain', 'image' ), true ) ) {
|
143 |
* e.g., [custom:ad:123] to display ad with the ID 123
|
144 |
* [custom:ad_group:345] to display ad group with the ID 345
|
145 |
*
|
|
|
|
|
|
|
|
|
146 |
* @param string $shortcode shortcode that placed the ad.
|
147 |
* @param mixed $newsletter unused.
|
148 |
* @param mixed $subscriber unused.
|
164 |
return '';
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
167 |
// only display if the ad group type could work, i.e. default (random) and ordered.
|
168 |
$ad_group = new Advanced_Ads_Group( $group_id );
|
169 |
if ( isset( $ad_group->type ) && in_array( $ad_group->type, array( 'default', 'ordered' ), true ) ) {
|
183 |
return '';
|
184 |
}
|
185 |
|
|
|
|
|
|
|
|
|
|
|
186 |
$ad = new Advanced_Ads_Ad( $ad_id );
|
187 |
// only display if the ad type could work, i.e. plain text and image ads.
|
188 |
if ( isset( $ad->type ) && in_array( $ad->type, array( 'plain', 'image' ), true ) ) {
|
classes/display-conditions.php
CHANGED
@@ -232,16 +232,43 @@ class Advanced_Ads_Display_Conditions {
|
|
232 |
}
|
233 |
|
234 |
/**
|
235 |
-
* Render the list of set display conditions
|
236 |
*
|
237 |
* @param array $set_conditions array of existing conditions.
|
238 |
* @param string $list_target ID of the list with the conditions.
|
239 |
* @param string $form_name prefix of the form field name attribute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
*/
|
241 |
-
public static function render_condition_list( array $set_conditions, $list_target = '', $form_name = '' ) {
|
242 |
-
|
243 |
$conditions = self::get_instance()->get_conditions();
|
244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
// use default form name if not given explicitly.
|
246 |
// @todo create a random form name, in case we have more than one form per page and the parameter is not given.
|
247 |
$form_name = ! $form_name ? self::FORM_NAME : $form_name;
|
232 |
}
|
233 |
|
234 |
/**
|
235 |
+
* Render the list of set display conditions.
|
236 |
*
|
237 |
* @param array $set_conditions array of existing conditions.
|
238 |
* @param string $list_target ID of the list with the conditions.
|
239 |
* @param string $form_name prefix of the form field name attribute.
|
240 |
+
* @param array $options {
|
241 |
+
* Optional. Render options.
|
242 |
+
*
|
243 |
+
* @type string/array $in May be:
|
244 |
+
* - set to `all` (default) to include all conditions, including not global.
|
245 |
+
* - set to `global` to include all conditions, except for not global.
|
246 |
+
* - set to array of condition ID's to include only them.
|
247 |
+
* }
|
248 |
*/
|
249 |
+
public static function render_condition_list( array $set_conditions, $list_target = '', $form_name = '', $options = array() ) {
|
|
|
250 |
$conditions = self::get_instance()->get_conditions();
|
251 |
|
252 |
+
|
253 |
+
if ( isset( $options['in'] ) ) {
|
254 |
+
if ( 'global' === $options['in'] ) {
|
255 |
+
$conditions = array_filter( $conditions, function( $condition ) {
|
256 |
+
return ! isset( $condition['options']['global'] ) || $condition['options']['global'];
|
257 |
+
} );
|
258 |
+
} elseif ( is_array( $options['in'] ) ) {
|
259 |
+
// Include already set condition types.
|
260 |
+
$set_types = array();
|
261 |
+
foreach ( $set_conditions as $set_condition ) {
|
262 |
+
if ( isset( $set_condition['type'] ) ) {
|
263 |
+
$set_types[] = $set_condition['type'];
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
$in = array_merge( $options['in'], $set_types );
|
268 |
+
$conditions = array_intersect_key( $conditions, array_flip( $in ) );
|
269 |
+
}
|
270 |
+
}
|
271 |
+
|
272 |
// use default form name if not given explicitly.
|
273 |
// @todo create a random form name, in case we have more than one form per page and the parameter is not given.
|
274 |
$form_name = ! $form_name ? self::FORM_NAME : $form_name;
|
classes/frontend_checks.php
CHANGED
@@ -748,23 +748,13 @@ class Advanced_Ads_Frontend_Checks {
|
|
748 |
context = 'html'
|
749 |
}
|
750 |
if ( window.jQuery ) {
|
751 |
-
var advads_ad_health_check_adsense_hidden_ids = [];
|
752 |
var responsive_zero_width = [];
|
753 |
jQuery( 'ins.adsbygoogle', context ).each( function() {
|
754 |
-
// The parent container is invisible.
|
755 |
-
if( ! jQuery( this ).parent().is(':visible') ){
|
756 |
-
// advads_ad_health_check_adsense_hidden_ids.push( this.dataset.adSlot );
|
757 |
-
// advanced_ads_frontend_checks.add_item_to_notices( 'adsense_hidden', { mode: 'add', append_key: this.dataset.adSlot, append_text: ' AdSense ID: ' + this.dataset.adSlot + ' URL: ' + window.location + ', ' + jQuery( document ).width() + 'px' } );
|
758 |
-
}
|
759 |
-
|
760 |
// Zero width, perhaps because a parent container is floated
|
761 |
if ( jQuery( this ).attr( 'data-ad-format' ) && 0 === jQuery( this ).width() ) {
|
762 |
responsive_zero_width.push( this.dataset.adSlot );
|
763 |
}
|
764 |
});
|
765 |
-
if( advads_ad_health_check_adsense_hidden_ids.length ){
|
766 |
-
// advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_hidden_adsense', advads_ad_health_check_adsense_hidden_ids );
|
767 |
-
}
|
768 |
if ( responsive_zero_width.length ) {
|
769 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_floated_responsive_adsense', responsive_zero_width );
|
770 |
}
|
748 |
context = 'html'
|
749 |
}
|
750 |
if ( window.jQuery ) {
|
|
|
751 |
var responsive_zero_width = [];
|
752 |
jQuery( 'ins.adsbygoogle', context ).each( function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
753 |
// Zero width, perhaps because a parent container is floated
|
754 |
if ( jQuery( this ).attr( 'data-ad-format' ) && 0 === jQuery( this ).width() ) {
|
755 |
responsive_zero_width.push( this.dataset.adSlot );
|
756 |
}
|
757 |
});
|
|
|
|
|
|
|
758 |
if ( responsive_zero_width.length ) {
|
759 |
advanced_ads_frontend_checks.add_item_to_node( '.advanced_ads_ad_health_floated_responsive_adsense', responsive_zero_width );
|
760 |
}
|
languages/advanced-ads.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Advanced Ads plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Advanced Ads 1.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
|
7 |
"Last-Translator: Thomas Maier <post@webzunft.de>\n"
|
8 |
"Language-Team: webgilde <support@wpadvancedads.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2021-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: advanced-ads\n"
|
@@ -33,7 +33,7 @@ msgid "Thomas Maier, Advanced Ads GmbH"
|
|
33 |
msgstr ""
|
34 |
|
35 |
#: admin/class-advanced-ads-admin.php:216
|
36 |
-
#: classes/display-conditions.php:
|
37 |
#: classes/visitor-conditions.php:311
|
38 |
#: modules/gadsense/admin/views/external-ads-links.php:17
|
39 |
#: modules/gadsense/admin/views/external-ads-links.php:22
|
@@ -42,7 +42,7 @@ msgid "or"
|
|
42 |
msgstr ""
|
43 |
|
44 |
#: admin/class-advanced-ads-admin.php:217
|
45 |
-
#: classes/display-conditions.php:
|
46 |
#: classes/visitor-conditions.php:311
|
47 |
msgid "and"
|
48 |
msgstr ""
|
@@ -158,97 +158,87 @@ msgstr ""
|
|
158 |
msgid "Visible ads should not use the Header placement: %s"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: admin/includes/ad-health-notices.php:
|
162 |
-
#: classes/frontend_checks.php:279
|
163 |
-
msgid "AdSense violation"
|
164 |
-
msgstr ""
|
165 |
-
|
166 |
-
#: admin/includes/ad-health-notices.php:126
|
167 |
-
#: classes/frontend_checks.php:280
|
168 |
-
msgid "Ad is hidden"
|
169 |
-
msgstr ""
|
170 |
-
|
171 |
-
#: admin/includes/ad-health-notices.php:135
|
172 |
#: classes/ad-debug.php:272
|
173 |
#: classes/frontend_checks.php:252
|
174 |
msgid "Your website is using HTTPS, but the ad code contains HTTP and might not work."
|
175 |
msgstr ""
|
176 |
|
177 |
-
#: admin/includes/ad-health-notices.php:
|
178 |
-
#: admin/includes/ad-health-notices.php:
|
179 |
#: modules/gadsense/includes/class-mapi.php:95
|
180 |
msgid "Last AdSense account connection attempt failed."
|
181 |
msgstr ""
|
182 |
|
183 |
#. translators: %1$s is the opening a tag and %2$s the closing one.
|
184 |
-
#: admin/includes/ad-health-notices.php:
|
185 |
msgid "Create a new AdSense account %1$shere%2$s."
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: admin/includes/ad-health-notices.php:
|
189 |
-
#: admin/includes/ad-health-notices.php:
|
190 |
-
#: admin/includes/ad-health-notices.php:
|
191 |
msgid "One of your sites is missing the AdSense publisher ID in the ads.txt file."
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: admin/includes/ad-health-notices.php:
|
195 |
-
#: admin/includes/ad-health-notices.php:
|
196 |
-
#: admin/includes/ad-health-notices.php:
|
197 |
msgctxt "related to ads.txt file"
|
198 |
msgid "Create one now."
|
199 |
msgstr ""
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
#. translators: %s is a filter hook, here `the_content`.
|
202 |
-
#: admin/includes/ad-health-notices.php:
|
203 |
msgid "<strong>%s</strong> filter found multiple times."
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: admin/includes/ad-health-notices.php:
|
207 |
msgid "Advanced Ads uses the outermost of them."
|
208 |
msgstr ""
|
209 |
|
210 |
#. translators: %1$s is a plugin name, %2$s is the opening a tag and %3$s the closing one.
|
211 |
-
#: admin/includes/ad-health-notices.php:
|
212 |
-
#: admin/includes/ad-health-notices.php:
|
213 |
-
#: admin/includes/ad-health-notices.php:
|
214 |
-
#: admin/includes/ad-health-notices.php:
|
215 |
msgid "Learn how to integrate %1$s with Advanced Ads %2$shere%3$s."
|
216 |
msgstr ""
|
217 |
|
218 |
#. translators: %s is a service or plugin name.
|
219 |
-
#: admin/includes/ad-health-notices.php:
|
220 |
msgid "%s detected."
|
221 |
msgstr ""
|
222 |
|
223 |
-
|
224 |
-
#: admin/includes/ad-health-notices.php:258
|
225 |
msgid "Learn how this might impact your ad setup."
|
226 |
msgstr ""
|
227 |
|
228 |
-
#: admin/includes/ad-health-notices.php:
|
229 |
msgid "Advanced Ads handles your ads.txt file automatically. You might be able to <strong>remove %1$s</strong>."
|
230 |
msgstr ""
|
231 |
|
232 |
-
#: admin/includes/ad-health-notices.php:
|
233 |
msgid "Advanced Ads handles header and footer codes."
|
234 |
msgstr ""
|
235 |
|
236 |
-
#: admin/includes/ad-health-notices.php:
|
237 |
msgid "You might be able to <strong>remove %1$s</strong>."
|
238 |
msgstr ""
|
239 |
|
240 |
-
#: admin/includes/ad-health-notices.php:
|
241 |
msgid "Learn how."
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: admin/includes/ad-health-notices.php:293
|
245 |
-
msgid "MailPoet is going to deprecate custom shortcodes. This might remove ads from your newsletters."
|
246 |
-
msgstr ""
|
247 |
-
|
248 |
-
#: admin/includes/ad-health-notices.php:294
|
249 |
-
msgid "Learn more"
|
250 |
-
msgstr ""
|
251 |
-
|
252 |
#: admin/includes/class-ad-groups-list.php:172
|
253 |
msgid "Ad weight"
|
254 |
msgstr ""
|
@@ -544,7 +534,7 @@ msgstr ""
|
|
544 |
|
545 |
#: admin/includes/class-menu.php:80
|
546 |
#: admin/includes/class-menu.php:81
|
547 |
-
#: admin/includes/class-shortcode-creator.php:
|
548 |
#: admin/views/ad-group-list-form-row.php:91
|
549 |
#: admin/views/ad-group-list-header.php:16
|
550 |
#: admin/views/placement-form.php:88
|
@@ -581,7 +571,7 @@ msgid "Ad Placements"
|
|
581 |
msgstr ""
|
582 |
|
583 |
#: admin/includes/class-menu.php:132
|
584 |
-
#: admin/includes/class-shortcode-creator.php:
|
585 |
#: admin/views/placements.php:54
|
586 |
#: classes/widget.php:115
|
587 |
#: modules/gutenberg/includes/class-gutenberg.php:81
|
@@ -995,13 +985,13 @@ msgctxt "label before ads"
|
|
995 |
msgid "Advertisements"
|
996 |
msgstr ""
|
997 |
|
998 |
-
#: admin/includes/class-shortcode-creator.php:
|
999 |
#: classes/widget.php:113
|
1000 |
#: modules/gutenberg/includes/class-gutenberg.php:77
|
1001 |
msgid "--empty--"
|
1002 |
msgstr ""
|
1003 |
|
1004 |
-
#: admin/includes/class-shortcode-creator.php:
|
1005 |
#: admin/views/placement-form.php:81
|
1006 |
#: admin/views/placements-item.php:14
|
1007 |
#: classes/widget.php:122
|
@@ -1366,7 +1356,7 @@ msgstr ""
|
|
1366 |
#: admin/views/placements-ad-label.php:9
|
1367 |
#: admin/views/placements-ad-label.php:11
|
1368 |
#: admin/views/placements.php:150
|
1369 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
1370 |
msgid "default"
|
1371 |
msgstr ""
|
1372 |
|
@@ -1596,7 +1586,7 @@ msgid "Forced to OR."
|
|
1596 |
msgstr ""
|
1597 |
|
1598 |
#: admin/views/conditions/display-conditions-list.php:46
|
1599 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
1600 |
msgid "manual"
|
1601 |
msgstr ""
|
1602 |
|
@@ -1809,7 +1799,6 @@ msgstr ""
|
|
1809 |
msgid "Adjust the placement options"
|
1810 |
msgstr ""
|
1811 |
|
1812 |
-
#. translators: %s is a URL.
|
1813 |
#: admin/views/placement-injection-top.php:21
|
1814 |
msgid "Ad not showing up? Take a look <a href=\"%s\" target=\"_blank\">here</a>"
|
1815 |
msgstr ""
|
@@ -1903,12 +1892,10 @@ msgstr ""
|
|
1903 |
msgid "Existing placement"
|
1904 |
msgstr ""
|
1905 |
|
1906 |
-
#. translators: %s is some HTML.
|
1907 |
#: admin/views/placement-injection-top.php:168
|
1908 |
msgid "Or use the shortcode %s to insert the ad into the content manually."
|
1909 |
msgstr ""
|
1910 |
|
1911 |
-
#. translators: %s is a URL.
|
1912 |
#: admin/views/placement-injection-top.php:176
|
1913 |
msgid "Learn more about your choices to display an ad in the <a href=\"%s\" target=\"_blank\">manual</a>."
|
1914 |
msgstr ""
|
@@ -2761,134 +2748,134 @@ msgstr ""
|
|
2761 |
msgid "archive: %s"
|
2762 |
msgstr ""
|
2763 |
|
2764 |
-
#: classes/display-conditions.php:
|
2765 |
msgid "parent page"
|
2766 |
msgstr ""
|
2767 |
|
2768 |
-
#: classes/display-conditions.php:
|
2769 |
msgid "post meta"
|
2770 |
msgstr ""
|
2771 |
|
2772 |
-
#: classes/display-conditions.php:
|
2773 |
msgid "page template"
|
2774 |
msgstr ""
|
2775 |
|
2776 |
-
#: classes/display-conditions.php:
|
2777 |
msgid "url parameters"
|
2778 |
msgstr ""
|
2779 |
|
2780 |
-
#: classes/display-conditions.php:
|
2781 |
msgid "accelerated mobile pages"
|
2782 |
msgstr ""
|
2783 |
|
2784 |
-
#: classes/display-conditions.php:
|
2785 |
msgctxt "display the terms search field on ad edit page"
|
2786 |
msgid "add more terms"
|
2787 |
msgstr ""
|
2788 |
|
2789 |
-
#: classes/display-conditions.php:
|
2790 |
msgid "term name or id"
|
2791 |
msgstr ""
|
2792 |
|
2793 |
-
#: classes/display-conditions.php:
|
2794 |
msgid "title or id"
|
2795 |
msgstr ""
|
2796 |
|
2797 |
-
#: classes/display-conditions.php:
|
2798 |
#: includes/array_ad_conditions.php:63
|
2799 |
msgid "Home Page"
|
2800 |
msgstr ""
|
2801 |
|
2802 |
-
#: classes/display-conditions.php:
|
2803 |
#: includes/array_ad_conditions.php:64
|
2804 |
msgid "show on Home page"
|
2805 |
msgstr ""
|
2806 |
|
2807 |
-
#: classes/display-conditions.php:
|
2808 |
#: includes/array_ad_conditions.php:68
|
2809 |
msgid "Singular Pages"
|
2810 |
msgstr ""
|
2811 |
|
2812 |
-
#: classes/display-conditions.php:
|
2813 |
#: includes/array_ad_conditions.php:69
|
2814 |
msgid "show on singular pages/posts"
|
2815 |
msgstr ""
|
2816 |
|
2817 |
-
#: classes/display-conditions.php:
|
2818 |
#: includes/array_ad_conditions.php:73
|
2819 |
msgid "Archive Pages"
|
2820 |
msgstr ""
|
2821 |
|
2822 |
-
#: classes/display-conditions.php:
|
2823 |
#: includes/array_ad_conditions.php:74
|
2824 |
msgid "show on any type of archive page (category, tag, author and date)"
|
2825 |
msgstr ""
|
2826 |
|
2827 |
-
#: classes/display-conditions.php:
|
2828 |
#: includes/array_ad_conditions.php:78
|
2829 |
msgid "Search Results"
|
2830 |
msgstr ""
|
2831 |
|
2832 |
-
#: classes/display-conditions.php:
|
2833 |
#: includes/array_ad_conditions.php:79
|
2834 |
msgid "show on search result pages"
|
2835 |
msgstr ""
|
2836 |
|
2837 |
-
#: classes/display-conditions.php:
|
2838 |
#: includes/array_ad_conditions.php:83
|
2839 |
msgid "404 Page"
|
2840 |
msgstr ""
|
2841 |
|
2842 |
-
#: classes/display-conditions.php:
|
2843 |
#: includes/array_ad_conditions.php:84
|
2844 |
msgid "show on 404 error page"
|
2845 |
msgstr ""
|
2846 |
|
2847 |
-
#: classes/display-conditions.php:
|
2848 |
#: includes/array_ad_conditions.php:88
|
2849 |
msgid "Attachment Pages"
|
2850 |
msgstr ""
|
2851 |
|
2852 |
-
#: classes/display-conditions.php:
|
2853 |
#: includes/array_ad_conditions.php:89
|
2854 |
msgid "show on attachment pages"
|
2855 |
msgstr ""
|
2856 |
|
2857 |
-
#: classes/display-conditions.php:
|
2858 |
#: includes/array_ad_conditions.php:93
|
2859 |
msgid "Secondary Queries"
|
2860 |
msgstr ""
|
2861 |
|
2862 |
-
#: classes/display-conditions.php:
|
2863 |
#: includes/array_ad_conditions.php:94
|
2864 |
msgid "allow ads in secondary queries"
|
2865 |
msgstr ""
|
2866 |
|
2867 |
-
#: classes/display-conditions.php:
|
2868 |
msgid "RSS Feed"
|
2869 |
msgstr ""
|
2870 |
|
2871 |
-
#: classes/display-conditions.php:
|
2872 |
msgid "allow ads in RSS Feed"
|
2873 |
msgstr ""
|
2874 |
|
2875 |
-
#: classes/display-conditions.php:
|
2876 |
msgid "REST API"
|
2877 |
msgstr ""
|
2878 |
|
2879 |
-
#: classes/display-conditions.php:
|
2880 |
msgid "allow ads in REST API"
|
2881 |
msgstr ""
|
2882 |
|
2883 |
-
#: classes/display-conditions.php:
|
2884 |
msgid "older than"
|
2885 |
msgstr ""
|
2886 |
|
2887 |
-
#: classes/display-conditions.php:
|
2888 |
msgid "younger than"
|
2889 |
msgstr ""
|
2890 |
|
2891 |
-
#: classes/display-conditions.php:
|
2892 |
msgid "days"
|
2893 |
msgstr ""
|
2894 |
|
@@ -2968,6 +2955,14 @@ msgstr ""
|
|
2968 |
msgid "Ad IDs: %s"
|
2969 |
msgstr ""
|
2970 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2971 |
#: classes/frontend_checks.php:281
|
2972 |
msgid "IDs: %s"
|
2973 |
msgstr ""
|
@@ -3012,81 +3007,81 @@ msgstr ""
|
|
3012 |
msgid "the following code is used for automatic error detection and only visible to admins"
|
3013 |
msgstr ""
|
3014 |
|
3015 |
-
#: classes/frontend_checks.php:
|
3016 |
-
#: classes/frontend_checks.php:
|
3017 |
msgid "Hi %s"
|
3018 |
msgstr ""
|
3019 |
|
3020 |
-
#: classes/frontend_checks.php:
|
3021 |
msgid "Advanced Ads detected AdSense Auto ads (%sx) on this page."
|
3022 |
msgstr ""
|
3023 |
|
3024 |
-
#: classes/frontend_checks.php:
|
3025 |
-
#: classes/frontend_checks.php:
|
3026 |
msgid "Is that correct?"
|
3027 |
msgstr ""
|
3028 |
|
3029 |
-
#: classes/frontend_checks.php:
|
3030 |
msgid "All is fine"
|
3031 |
msgstr ""
|
3032 |
|
3033 |
-
#: classes/frontend_checks.php:
|
3034 |
msgid "Something is off"
|
3035 |
msgstr ""
|
3036 |
|
3037 |
-
#: classes/frontend_checks.php:
|
3038 |
-
#: classes/frontend_checks.php:
|
3039 |
msgid "PS: This is a one-time check from your friendly Advanced Ads plugin. It is only visible to you."
|
3040 |
msgstr ""
|
3041 |
|
3042 |
-
#: classes/frontend_checks.php:
|
3043 |
msgid "Advanced Ads detected the AdSense Auto ads code and <strong>no ads on this page</strong>."
|
3044 |
msgstr ""
|
3045 |
|
3046 |
-
#: classes/frontend_checks.php:
|
3047 |
msgid "This is fine"
|
3048 |
msgstr ""
|
3049 |
|
3050 |
-
#: classes/frontend_checks.php:
|
3051 |
msgid "I expected something else"
|
3052 |
msgstr ""
|
3053 |
|
3054 |
-
#: classes/frontend_checks.php:
|
3055 |
-
#: classes/frontend_checks.php:
|
3056 |
msgid "Just click on your problem to learn more from our knowledge base."
|
3057 |
msgstr ""
|
3058 |
|
3059 |
-
#: classes/frontend_checks.php:
|
3060 |
msgid "I want to disable AdSense Auto ads"
|
3061 |
msgstr ""
|
3062 |
|
3063 |
-
#: classes/frontend_checks.php:
|
3064 |
-
#: classes/frontend_checks.php:
|
3065 |
msgid "I don’t see any Auto ads"
|
3066 |
msgstr ""
|
3067 |
|
3068 |
-
#: classes/frontend_checks.php:
|
3069 |
msgid "I only see blank space"
|
3070 |
msgstr ""
|
3071 |
|
3072 |
-
#: classes/frontend_checks.php:
|
3073 |
msgid "I want to change the position of the ads"
|
3074 |
msgstr ""
|
3075 |
|
3076 |
-
#: classes/frontend_checks.php:
|
3077 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3078 |
msgid "Display Auto ads only on specific pages"
|
3079 |
msgstr ""
|
3080 |
|
3081 |
-
#: classes/frontend_checks.php:
|
3082 |
msgid "How to look for the Auto ads code"
|
3083 |
msgstr ""
|
3084 |
|
3085 |
-
#: classes/frontend_checks.php:
|
3086 |
msgid "I have another question or problem"
|
3087 |
msgstr ""
|
3088 |
|
3089 |
-
#: classes/frontend_checks.php:
|
3090 |
msgid "Closing the message"
|
3091 |
msgstr ""
|
3092 |
|
@@ -3492,39 +3487,43 @@ msgstr ""
|
|
3492 |
msgid "Responsive (Matched Content)"
|
3493 |
msgstr ""
|
3494 |
|
3495 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3496 |
msgid "Link ads"
|
3497 |
msgstr ""
|
3498 |
|
3499 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3500 |
msgid "Link ads (Responsive)"
|
3501 |
msgstr ""
|
3502 |
|
3503 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3504 |
msgid "In-article"
|
3505 |
msgstr ""
|
3506 |
|
3507 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3508 |
msgid "In-feed"
|
3509 |
msgstr ""
|
3510 |
|
3511 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
|
|
|
|
|
|
|
|
3512 |
msgid "Resizing"
|
3513 |
msgstr ""
|
3514 |
|
3515 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3516 |
msgid "Layout"
|
3517 |
msgstr ""
|
3518 |
|
3519 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3520 |
msgid "Layout-Key"
|
3521 |
msgstr ""
|
3522 |
|
3523 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3524 |
msgid "Clearfix"
|
3525 |
msgstr ""
|
3526 |
|
3527 |
-
#: modules/gadsense/admin/views/adsense-ad-parameters.php:
|
3528 |
msgid "Enable this box if responsive ads cover something on your site"
|
3529 |
msgstr ""
|
3530 |
|
@@ -3636,6 +3635,10 @@ msgstr ""
|
|
3636 |
msgid "Choose a different ad from your AdSense account above."
|
3637 |
msgstr ""
|
3638 |
|
|
|
|
|
|
|
|
|
3639 |
#: modules/gadsense/includes/class-ad-type-adsense.php:34
|
3640 |
msgid "AdSense ad"
|
3641 |
msgstr ""
|
@@ -3741,31 +3744,31 @@ msgid "An error occurred while requesting account details."
|
|
3741 |
msgstr ""
|
3742 |
|
3743 |
#: modules/gadsense/includes/class-mapi.php:1456
|
3744 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3745 |
msgctxt "AdSense ad type"
|
3746 |
msgid "Matched Content"
|
3747 |
msgstr ""
|
3748 |
|
3749 |
#: modules/gadsense/includes/class-mapi.php:1459
|
3750 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3751 |
msgctxt "AdSense ad type"
|
3752 |
msgid "In-article"
|
3753 |
msgstr ""
|
3754 |
|
3755 |
#: modules/gadsense/includes/class-mapi.php:1461
|
3756 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3757 |
msgctxt "AdSense ad type"
|
3758 |
msgid "In-feed"
|
3759 |
msgstr ""
|
3760 |
|
3761 |
#: modules/gadsense/includes/class-mapi.php:1466
|
3762 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3763 |
msgctxt "AdSense ad type"
|
3764 |
msgid "Display"
|
3765 |
msgstr ""
|
3766 |
|
3767 |
#: modules/gadsense/includes/class-mapi.php:1468
|
3768 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3769 |
msgctxt "AdSense ad type"
|
3770 |
msgid "Link"
|
3771 |
msgstr ""
|
@@ -3833,45 +3836,42 @@ msgstr ""
|
|
3833 |
msgid "Enable this option to stop loading stats from AdSense into your WordPress backend."
|
3834 |
msgstr ""
|
3835 |
|
3836 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3837 |
msgid "Insert the AdSense header code to enable Auto ads and verify your website."
|
3838 |
msgstr ""
|
3839 |
|
3840 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3841 |
msgid "Why are ads appearing in random positions?"
|
3842 |
msgstr ""
|
3843 |
|
3844 |
-
|
|
|
3845 |
msgid "Adjust Auto ads options"
|
3846 |
msgstr ""
|
3847 |
|
3848 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3849 |
-
msgid "Enable AMP Auto ads"
|
3850 |
-
msgstr ""
|
3851 |
-
|
3852 |
-
#: modules/gadsense/includes/class-network-adsense.php:276
|
3853 |
msgid "Disable warnings about potential violations of the AdSense terms."
|
3854 |
msgstr ""
|
3855 |
|
3856 |
-
#.
|
3857 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3858 |
msgid "Our <a href=\"%s\" target=\"_blank\">Ad Health</a> feature monitors if AdSense is implemented correctly on your site. It also considers ads not managed with Advanced Ads. Enable this option to remove these checks"
|
3859 |
msgstr ""
|
3860 |
|
3861 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3862 |
msgid "Enable this option in case your theme adds an unfortunate background color to AdSense ads."
|
3863 |
msgstr ""
|
3864 |
|
3865 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3866 |
msgid "enable"
|
3867 |
msgstr ""
|
3868 |
|
3869 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3870 |
msgid "disable"
|
3871 |
msgstr ""
|
3872 |
|
3873 |
-
#.
|
3874 |
-
#: modules/gadsense/includes/class-network-adsense.php:
|
3875 |
msgid "Whether your responsive ad unit may expand to <a href='%s' target='blank'>use the full width</a> of your visitor's mobile device screen"
|
3876 |
msgstr ""
|
3877 |
|
2 |
# This file is distributed under the same license as the Advanced Ads plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Advanced Ads 1.24.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
|
7 |
"Last-Translator: Thomas Maier <post@webzunft.de>\n"
|
8 |
"Language-Team: webgilde <support@wpadvancedads.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2021-03-10T10:43:43+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: advanced-ads\n"
|
33 |
msgstr ""
|
34 |
|
35 |
#: admin/class-advanced-ads-admin.php:216
|
36 |
+
#: classes/display-conditions.php:317
|
37 |
#: classes/visitor-conditions.php:311
|
38 |
#: modules/gadsense/admin/views/external-ads-links.php:17
|
39 |
#: modules/gadsense/admin/views/external-ads-links.php:22
|
42 |
msgstr ""
|
43 |
|
44 |
#: admin/class-advanced-ads-admin.php:217
|
45 |
+
#: classes/display-conditions.php:317
|
46 |
#: classes/visitor-conditions.php:311
|
47 |
msgid "and"
|
48 |
msgstr ""
|
158 |
msgid "Visible ads should not use the Header placement: %s"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: admin/includes/ad-health-notices.php:122
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
#: classes/ad-debug.php:272
|
163 |
#: classes/frontend_checks.php:252
|
164 |
msgid "Your website is using HTTPS, but the ad code contains HTTP and might not work."
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: admin/includes/ad-health-notices.php:135
|
168 |
+
#: admin/includes/ad-health-notices.php:142
|
169 |
#: modules/gadsense/includes/class-mapi.php:95
|
170 |
msgid "Last AdSense account connection attempt failed."
|
171 |
msgstr ""
|
172 |
|
173 |
#. translators: %1$s is the opening a tag and %2$s the closing one.
|
174 |
+
#: admin/includes/ad-health-notices.php:144
|
175 |
msgid "Create a new AdSense account %1$shere%2$s."
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: admin/includes/ad-health-notices.php:154
|
179 |
+
#: admin/includes/ad-health-notices.php:164
|
180 |
+
#: admin/includes/ad-health-notices.php:174
|
181 |
msgid "One of your sites is missing the AdSense publisher ID in the ads.txt file."
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: admin/includes/ad-health-notices.php:156
|
185 |
+
#: admin/includes/ad-health-notices.php:166
|
186 |
+
#: admin/includes/ad-health-notices.php:176
|
187 |
msgctxt "related to ads.txt file"
|
188 |
msgid "Create one now."
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: admin/includes/ad-health-notices.php:183
|
192 |
+
msgid "Google AdSense deprecated Link Units. Please choose another format."
|
193 |
+
msgstr ""
|
194 |
+
|
195 |
+
#: admin/includes/ad-health-notices.php:185
|
196 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:125
|
197 |
+
msgid "Learn more"
|
198 |
+
msgstr ""
|
199 |
+
|
200 |
#. translators: %s is a filter hook, here `the_content`.
|
201 |
+
#: admin/includes/ad-health-notices.php:192
|
202 |
msgid "<strong>%s</strong> filter found multiple times."
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: admin/includes/ad-health-notices.php:194
|
206 |
msgid "Advanced Ads uses the outermost of them."
|
207 |
msgstr ""
|
208 |
|
209 |
#. translators: %1$s is a plugin name, %2$s is the opening a tag and %3$s the closing one.
|
210 |
+
#: admin/includes/ad-health-notices.php:203
|
211 |
+
#: admin/includes/ad-health-notices.php:214
|
212 |
+
#: admin/includes/ad-health-notices.php:225
|
213 |
+
#: admin/includes/ad-health-notices.php:238
|
214 |
msgid "Learn how to integrate %1$s with Advanced Ads %2$shere%3$s."
|
215 |
msgstr ""
|
216 |
|
217 |
#. translators: %s is a service or plugin name.
|
218 |
+
#: admin/includes/ad-health-notices.php:252
|
219 |
msgid "%s detected."
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: admin/includes/ad-health-notices.php:253
|
|
|
223 |
msgid "Learn how this might impact your ad setup."
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: admin/includes/ad-health-notices.php:264
|
227 |
msgid "Advanced Ads handles your ads.txt file automatically. You might be able to <strong>remove %1$s</strong>."
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: admin/includes/ad-health-notices.php:275
|
231 |
msgid "Advanced Ads handles header and footer codes."
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: admin/includes/ad-health-notices.php:276
|
235 |
msgid "You might be able to <strong>remove %1$s</strong>."
|
236 |
msgstr ""
|
237 |
|
238 |
+
#: admin/includes/ad-health-notices.php:279
|
239 |
msgid "Learn how."
|
240 |
msgstr ""
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
#: admin/includes/class-ad-groups-list.php:172
|
243 |
msgid "Ad weight"
|
244 |
msgstr ""
|
534 |
|
535 |
#: admin/includes/class-menu.php:80
|
536 |
#: admin/includes/class-menu.php:81
|
537 |
+
#: admin/includes/class-shortcode-creator.php:184
|
538 |
#: admin/views/ad-group-list-form-row.php:91
|
539 |
#: admin/views/ad-group-list-header.php:16
|
540 |
#: admin/views/placement-form.php:88
|
571 |
msgstr ""
|
572 |
|
573 |
#: admin/includes/class-menu.php:132
|
574 |
+
#: admin/includes/class-shortcode-creator.php:198
|
575 |
#: admin/views/placements.php:54
|
576 |
#: classes/widget.php:115
|
577 |
#: modules/gutenberg/includes/class-gutenberg.php:81
|
985 |
msgid "Advertisements"
|
986 |
msgstr ""
|
987 |
|
988 |
+
#: admin/includes/class-shortcode-creator.php:182
|
989 |
#: classes/widget.php:113
|
990 |
#: modules/gutenberg/includes/class-gutenberg.php:77
|
991 |
msgid "--empty--"
|
992 |
msgstr ""
|
993 |
|
994 |
+
#: admin/includes/class-shortcode-creator.php:191
|
995 |
#: admin/views/placement-form.php:81
|
996 |
#: admin/views/placements-item.php:14
|
997 |
#: classes/widget.php:122
|
1356 |
#: admin/views/placements-ad-label.php:9
|
1357 |
#: admin/views/placements-ad-label.php:11
|
1358 |
#: admin/views/placements.php:150
|
1359 |
+
#: modules/gadsense/includes/class-network-adsense.php:323
|
1360 |
msgid "default"
|
1361 |
msgstr ""
|
1362 |
|
1586 |
msgstr ""
|
1587 |
|
1588 |
#: admin/views/conditions/display-conditions-list.php:46
|
1589 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:120
|
1590 |
msgid "manual"
|
1591 |
msgstr ""
|
1592 |
|
1799 |
msgid "Adjust the placement options"
|
1800 |
msgstr ""
|
1801 |
|
|
|
1802 |
#: admin/views/placement-injection-top.php:21
|
1803 |
msgid "Ad not showing up? Take a look <a href=\"%s\" target=\"_blank\">here</a>"
|
1804 |
msgstr ""
|
1892 |
msgid "Existing placement"
|
1893 |
msgstr ""
|
1894 |
|
|
|
1895 |
#: admin/views/placement-injection-top.php:168
|
1896 |
msgid "Or use the shortcode %s to insert the ad into the content manually."
|
1897 |
msgstr ""
|
1898 |
|
|
|
1899 |
#: admin/views/placement-injection-top.php:176
|
1900 |
msgid "Learn more about your choices to display an ad in the <a href=\"%s\" target=\"_blank\">manual</a>."
|
1901 |
msgstr ""
|
2748 |
msgid "archive: %s"
|
2749 |
msgstr ""
|
2750 |
|
2751 |
+
#: classes/display-conditions.php:287
|
2752 |
msgid "parent page"
|
2753 |
msgstr ""
|
2754 |
|
2755 |
+
#: classes/display-conditions.php:288
|
2756 |
msgid "post meta"
|
2757 |
msgstr ""
|
2758 |
|
2759 |
+
#: classes/display-conditions.php:289
|
2760 |
msgid "page template"
|
2761 |
msgstr ""
|
2762 |
|
2763 |
+
#: classes/display-conditions.php:290
|
2764 |
msgid "url parameters"
|
2765 |
msgstr ""
|
2766 |
|
2767 |
+
#: classes/display-conditions.php:293
|
2768 |
msgid "accelerated mobile pages"
|
2769 |
msgstr ""
|
2770 |
|
2771 |
+
#: classes/display-conditions.php:621
|
2772 |
msgctxt "display the terms search field on ad edit page"
|
2773 |
msgid "add more terms"
|
2774 |
msgstr ""
|
2775 |
|
2776 |
+
#: classes/display-conditions.php:625
|
2777 |
msgid "term name or id"
|
2778 |
msgstr ""
|
2779 |
|
2780 |
+
#: classes/display-conditions.php:701
|
2781 |
msgid "title or id"
|
2782 |
msgstr ""
|
2783 |
|
2784 |
+
#: classes/display-conditions.php:755
|
2785 |
#: includes/array_ad_conditions.php:63
|
2786 |
msgid "Home Page"
|
2787 |
msgstr ""
|
2788 |
|
2789 |
+
#: classes/display-conditions.php:756
|
2790 |
#: includes/array_ad_conditions.php:64
|
2791 |
msgid "show on Home page"
|
2792 |
msgstr ""
|
2793 |
|
2794 |
+
#: classes/display-conditions.php:760
|
2795 |
#: includes/array_ad_conditions.php:68
|
2796 |
msgid "Singular Pages"
|
2797 |
msgstr ""
|
2798 |
|
2799 |
+
#: classes/display-conditions.php:761
|
2800 |
#: includes/array_ad_conditions.php:69
|
2801 |
msgid "show on singular pages/posts"
|
2802 |
msgstr ""
|
2803 |
|
2804 |
+
#: classes/display-conditions.php:765
|
2805 |
#: includes/array_ad_conditions.php:73
|
2806 |
msgid "Archive Pages"
|
2807 |
msgstr ""
|
2808 |
|
2809 |
+
#: classes/display-conditions.php:766
|
2810 |
#: includes/array_ad_conditions.php:74
|
2811 |
msgid "show on any type of archive page (category, tag, author and date)"
|
2812 |
msgstr ""
|
2813 |
|
2814 |
+
#: classes/display-conditions.php:770
|
2815 |
#: includes/array_ad_conditions.php:78
|
2816 |
msgid "Search Results"
|
2817 |
msgstr ""
|
2818 |
|
2819 |
+
#: classes/display-conditions.php:771
|
2820 |
#: includes/array_ad_conditions.php:79
|
2821 |
msgid "show on search result pages"
|
2822 |
msgstr ""
|
2823 |
|
2824 |
+
#: classes/display-conditions.php:775
|
2825 |
#: includes/array_ad_conditions.php:83
|
2826 |
msgid "404 Page"
|
2827 |
msgstr ""
|
2828 |
|
2829 |
+
#: classes/display-conditions.php:776
|
2830 |
#: includes/array_ad_conditions.php:84
|
2831 |
msgid "show on 404 error page"
|
2832 |
msgstr ""
|
2833 |
|
2834 |
+
#: classes/display-conditions.php:780
|
2835 |
#: includes/array_ad_conditions.php:88
|
2836 |
msgid "Attachment Pages"
|
2837 |
msgstr ""
|
2838 |
|
2839 |
+
#: classes/display-conditions.php:781
|
2840 |
#: includes/array_ad_conditions.php:89
|
2841 |
msgid "show on attachment pages"
|
2842 |
msgstr ""
|
2843 |
|
2844 |
+
#: classes/display-conditions.php:785
|
2845 |
#: includes/array_ad_conditions.php:93
|
2846 |
msgid "Secondary Queries"
|
2847 |
msgstr ""
|
2848 |
|
2849 |
+
#: classes/display-conditions.php:786
|
2850 |
#: includes/array_ad_conditions.php:94
|
2851 |
msgid "allow ads in secondary queries"
|
2852 |
msgstr ""
|
2853 |
|
2854 |
+
#: classes/display-conditions.php:790
|
2855 |
msgid "RSS Feed"
|
2856 |
msgstr ""
|
2857 |
|
2858 |
+
#: classes/display-conditions.php:791
|
2859 |
msgid "allow ads in RSS Feed"
|
2860 |
msgstr ""
|
2861 |
|
2862 |
+
#: classes/display-conditions.php:795
|
2863 |
msgid "REST API"
|
2864 |
msgstr ""
|
2865 |
|
2866 |
+
#: classes/display-conditions.php:796
|
2867 |
msgid "allow ads in REST API"
|
2868 |
msgstr ""
|
2869 |
|
2870 |
+
#: classes/display-conditions.php:831
|
2871 |
msgid "older than"
|
2872 |
msgstr ""
|
2873 |
|
2874 |
+
#: classes/display-conditions.php:832
|
2875 |
msgid "younger than"
|
2876 |
msgstr ""
|
2877 |
|
2878 |
+
#: classes/display-conditions.php:834
|
2879 |
msgid "days"
|
2880 |
msgstr ""
|
2881 |
|
2955 |
msgid "Ad IDs: %s"
|
2956 |
msgstr ""
|
2957 |
|
2958 |
+
#: classes/frontend_checks.php:279
|
2959 |
+
msgid "AdSense violation"
|
2960 |
+
msgstr ""
|
2961 |
+
|
2962 |
+
#: classes/frontend_checks.php:280
|
2963 |
+
msgid "Ad is hidden"
|
2964 |
+
msgstr ""
|
2965 |
+
|
2966 |
#: classes/frontend_checks.php:281
|
2967 |
msgid "IDs: %s"
|
2968 |
msgstr ""
|
3007 |
msgid "the following code is used for automatic error detection and only visible to admins"
|
3008 |
msgstr ""
|
3009 |
|
3010 |
+
#: classes/frontend_checks.php:874
|
3011 |
+
#: classes/frontend_checks.php:889
|
3012 |
msgid "Hi %s"
|
3013 |
msgstr ""
|
3014 |
|
3015 |
+
#: classes/frontend_checks.php:874
|
3016 |
msgid "Advanced Ads detected AdSense Auto ads (%sx) on this page."
|
3017 |
msgstr ""
|
3018 |
|
3019 |
+
#: classes/frontend_checks.php:874
|
3020 |
+
#: classes/frontend_checks.php:889
|
3021 |
msgid "Is that correct?"
|
3022 |
msgstr ""
|
3023 |
|
3024 |
+
#: classes/frontend_checks.php:876
|
3025 |
msgid "All is fine"
|
3026 |
msgstr ""
|
3027 |
|
3028 |
+
#: classes/frontend_checks.php:877
|
3029 |
msgid "Something is off"
|
3030 |
msgstr ""
|
3031 |
|
3032 |
+
#: classes/frontend_checks.php:879
|
3033 |
+
#: classes/frontend_checks.php:894
|
3034 |
msgid "PS: This is a one-time check from your friendly Advanced Ads plugin. It is only visible to you."
|
3035 |
msgstr ""
|
3036 |
|
3037 |
+
#: classes/frontend_checks.php:889
|
3038 |
msgid "Advanced Ads detected the AdSense Auto ads code and <strong>no ads on this page</strong>."
|
3039 |
msgstr ""
|
3040 |
|
3041 |
+
#: classes/frontend_checks.php:891
|
3042 |
msgid "This is fine"
|
3043 |
msgstr ""
|
3044 |
|
3045 |
+
#: classes/frontend_checks.php:892
|
3046 |
msgid "I expected something else"
|
3047 |
msgstr ""
|
3048 |
|
3049 |
+
#: classes/frontend_checks.php:897
|
3050 |
+
#: classes/frontend_checks.php:905
|
3051 |
msgid "Just click on your problem to learn more from our knowledge base."
|
3052 |
msgstr ""
|
3053 |
|
3054 |
+
#: classes/frontend_checks.php:898
|
3055 |
msgid "I want to disable AdSense Auto ads"
|
3056 |
msgstr ""
|
3057 |
|
3058 |
+
#: classes/frontend_checks.php:899
|
3059 |
+
#: classes/frontend_checks.php:906
|
3060 |
msgid "I don’t see any Auto ads"
|
3061 |
msgstr ""
|
3062 |
|
3063 |
+
#: classes/frontend_checks.php:900
|
3064 |
msgid "I only see blank space"
|
3065 |
msgstr ""
|
3066 |
|
3067 |
+
#: classes/frontend_checks.php:901
|
3068 |
msgid "I want to change the position of the ads"
|
3069 |
msgstr ""
|
3070 |
|
3071 |
+
#: classes/frontend_checks.php:902
|
3072 |
+
#: modules/gadsense/includes/class-network-adsense.php:226
|
3073 |
msgid "Display Auto ads only on specific pages"
|
3074 |
msgstr ""
|
3075 |
|
3076 |
+
#: classes/frontend_checks.php:907
|
3077 |
msgid "How to look for the Auto ads code"
|
3078 |
msgstr ""
|
3079 |
|
3080 |
+
#: classes/frontend_checks.php:908
|
3081 |
msgid "I have another question or problem"
|
3082 |
msgstr ""
|
3083 |
|
3084 |
+
#: classes/frontend_checks.php:911
|
3085 |
msgid "Closing the message"
|
3086 |
msgstr ""
|
3087 |
|
3487 |
msgid "Responsive (Matched Content)"
|
3488 |
msgstr ""
|
3489 |
|
3490 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:112
|
3491 |
msgid "Link ads"
|
3492 |
msgstr ""
|
3493 |
|
3494 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:115
|
3495 |
msgid "Link ads (Responsive)"
|
3496 |
msgstr ""
|
3497 |
|
3498 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:117
|
3499 |
msgid "In-article"
|
3500 |
msgstr ""
|
3501 |
|
3502 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:118
|
3503 |
msgid "In-feed"
|
3504 |
msgstr ""
|
3505 |
|
3506 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:123
|
3507 |
+
msgid "Google AdSense deprecated Link Units. Please choose another type."
|
3508 |
+
msgstr ""
|
3509 |
+
|
3510 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:130
|
3511 |
msgid "Resizing"
|
3512 |
msgstr ""
|
3513 |
|
3514 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:139
|
3515 |
msgid "Layout"
|
3516 |
msgstr ""
|
3517 |
|
3518 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:144
|
3519 |
msgid "Layout-Key"
|
3520 |
msgstr ""
|
3521 |
|
3522 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:149
|
3523 |
msgid "Clearfix"
|
3524 |
msgstr ""
|
3525 |
|
3526 |
+
#: modules/gadsense/admin/views/adsense-ad-parameters.php:152
|
3527 |
msgid "Enable this box if responsive ads cover something on your site"
|
3528 |
msgstr ""
|
3529 |
|
3635 |
msgid "Choose a different ad from your AdSense account above."
|
3636 |
msgstr ""
|
3637 |
|
3638 |
+
#: modules/gadsense/admin/views/settings/amp-auto-ads.php:13
|
3639 |
+
msgid "Enable AMP Auto ads"
|
3640 |
+
msgstr ""
|
3641 |
+
|
3642 |
#: modules/gadsense/includes/class-ad-type-adsense.php:34
|
3643 |
msgid "AdSense ad"
|
3644 |
msgstr ""
|
3744 |
msgstr ""
|
3745 |
|
3746 |
#: modules/gadsense/includes/class-mapi.php:1456
|
3747 |
+
#: modules/gadsense/includes/class-network-adsense.php:516
|
3748 |
msgctxt "AdSense ad type"
|
3749 |
msgid "Matched Content"
|
3750 |
msgstr ""
|
3751 |
|
3752 |
#: modules/gadsense/includes/class-mapi.php:1459
|
3753 |
+
#: modules/gadsense/includes/class-network-adsense.php:517
|
3754 |
msgctxt "AdSense ad type"
|
3755 |
msgid "In-article"
|
3756 |
msgstr ""
|
3757 |
|
3758 |
#: modules/gadsense/includes/class-mapi.php:1461
|
3759 |
+
#: modules/gadsense/includes/class-network-adsense.php:518
|
3760 |
msgctxt "AdSense ad type"
|
3761 |
msgid "In-feed"
|
3762 |
msgstr ""
|
3763 |
|
3764 |
#: modules/gadsense/includes/class-mapi.php:1466
|
3765 |
+
#: modules/gadsense/includes/class-network-adsense.php:519
|
3766 |
msgctxt "AdSense ad type"
|
3767 |
msgid "Display"
|
3768 |
msgstr ""
|
3769 |
|
3770 |
#: modules/gadsense/includes/class-mapi.php:1468
|
3771 |
+
#: modules/gadsense/includes/class-network-adsense.php:520
|
3772 |
msgctxt "AdSense ad type"
|
3773 |
msgid "Link"
|
3774 |
msgstr ""
|
3836 |
msgid "Enable this option to stop loading stats from AdSense into your WordPress backend."
|
3837 |
msgstr ""
|
3838 |
|
3839 |
+
#: modules/gadsense/includes/class-network-adsense.php:223
|
3840 |
msgid "Insert the AdSense header code to enable Auto ads and verify your website."
|
3841 |
msgstr ""
|
3842 |
|
3843 |
+
#: modules/gadsense/includes/class-network-adsense.php:227
|
3844 |
msgid "Why are ads appearing in random positions?"
|
3845 |
msgstr ""
|
3846 |
|
3847 |
+
#. translators: this is the text for a link to a sub-page in an AdSense account
|
3848 |
+
#: modules/gadsense/includes/class-network-adsense.php:234
|
3849 |
msgid "Adjust Auto ads options"
|
3850 |
msgstr ""
|
3851 |
|
3852 |
+
#: modules/gadsense/includes/class-network-adsense.php:279
|
|
|
|
|
|
|
|
|
3853 |
msgid "Disable warnings about potential violations of the AdSense terms."
|
3854 |
msgstr ""
|
3855 |
|
3856 |
+
#. translators: %s is a URL.
|
3857 |
+
#: modules/gadsense/includes/class-network-adsense.php:285
|
3858 |
msgid "Our <a href=\"%s\" target=\"_blank\">Ad Health</a> feature monitors if AdSense is implemented correctly on your site. It also considers ads not managed with Advanced Ads. Enable this option to remove these checks"
|
3859 |
msgstr ""
|
3860 |
|
3861 |
+
#: modules/gadsense/includes/class-network-adsense.php:310
|
3862 |
msgid "Enable this option in case your theme adds an unfortunate background color to AdSense ads."
|
3863 |
msgstr ""
|
3864 |
|
3865 |
+
#: modules/gadsense/includes/class-network-adsense.php:324
|
3866 |
msgid "enable"
|
3867 |
msgstr ""
|
3868 |
|
3869 |
+
#: modules/gadsense/includes/class-network-adsense.php:325
|
3870 |
msgid "disable"
|
3871 |
msgstr ""
|
3872 |
|
3873 |
+
#. translators: %s is a URL.
|
3874 |
+
#: modules/gadsense/includes/class-network-adsense.php:332
|
3875 |
msgid "Whether your responsive ad unit may expand to <a href='%s' target='blank'>use the full width</a> of your visitor's mobile device screen"
|
3876 |
msgstr ""
|
3877 |
|
modules/gadsense/admin/views/adsense-ad-parameters.php
CHANGED
@@ -108,13 +108,24 @@ if( $pub_id_errors ) : ?>
|
|
108 |
<option value="normal" <?php selected( $unit_type, 'normal' ); ?>><?php _e( 'Normal', 'advanced-ads' ); ?></option>
|
109 |
<option value="responsive" <?php selected( $unit_type, 'responsive' ); ?>><?php _e( 'Responsive', 'advanced-ads' ); ?></option>
|
110 |
<option value="matched-content" <?php selected( $unit_type, 'matched-content' ); ?>><?php _e( 'Responsive (Matched Content)', 'advanced-ads' ); ?></option>
|
|
|
111 |
<option value="link" <?php selected( $unit_type, 'link' ); ?>><?php _e( 'Link ads', 'advanced-ads' ); ?></option>
|
|
|
|
|
112 |
<option value="link-responsive" <?php selected( $unit_type, 'link-responsive' ); ?>><?php _e( 'Link ads (Responsive)', 'advanced-ads' ); ?></option>
|
|
|
113 |
<option value="in-article" <?php selected( $unit_type, 'in-article' ); ?>><?php _e( 'In-article', 'advanced-ads' ); ?></option>
|
114 |
<option value="in-feed" <?php selected( $unit_type, 'in-feed' ); ?>><?php _e( 'In-feed', 'advanced-ads' ); ?></option>
|
115 |
</select>
|
116 |
<a href="<?php echo ADVADS_URL . 'adsense-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=adsense-ad-types'; ?>" target="_blank"><?php _e( 'manual', 'advanced-ads' ); ?></a>
|
117 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
<hr/>
|
119 |
<label class="label" <?php if ( ! $is_responsive || 2 > count( $sizing_array ) ) { echo 'style="display: none;"'; } ?> id="resize-label"><?php _e( 'Resizing', 'advanced-ads' ); ?></label>
|
120 |
<div <?php if ( ! $is_responsive || 2 > count( $sizing_array ) ) { echo 'style="display: none;"'; } ?>>
|
108 |
<option value="normal" <?php selected( $unit_type, 'normal' ); ?>><?php _e( 'Normal', 'advanced-ads' ); ?></option>
|
109 |
<option value="responsive" <?php selected( $unit_type, 'responsive' ); ?>><?php _e( 'Responsive', 'advanced-ads' ); ?></option>
|
110 |
<option value="matched-content" <?php selected( $unit_type, 'matched-content' ); ?>><?php _e( 'Responsive (Matched Content)', 'advanced-ads' ); ?></option>
|
111 |
+
<?php if ( $unit_type === 'link' ) : ?>
|
112 |
<option value="link" <?php selected( $unit_type, 'link' ); ?>><?php _e( 'Link ads', 'advanced-ads' ); ?></option>
|
113 |
+
<?php endif; ?>
|
114 |
+
<?php if ( $unit_type === 'link-responsive' ) : ?>
|
115 |
<option value="link-responsive" <?php selected( $unit_type, 'link-responsive' ); ?>><?php _e( 'Link ads (Responsive)', 'advanced-ads' ); ?></option>
|
116 |
+
<?php endif; ?>
|
117 |
<option value="in-article" <?php selected( $unit_type, 'in-article' ); ?>><?php _e( 'In-article', 'advanced-ads' ); ?></option>
|
118 |
<option value="in-feed" <?php selected( $unit_type, 'in-feed' ); ?>><?php _e( 'In-feed', 'advanced-ads' ); ?></option>
|
119 |
</select>
|
120 |
<a href="<?php echo ADVADS_URL . 'adsense-ads/#utm_source=advanced-ads&utm_medium=link&utm_campaign=adsense-ad-types'; ?>" target="_blank"><?php _e( 'manual', 'advanced-ads' ); ?></a>
|
121 |
</div>
|
122 |
+
<?php if ( in_array( $unit_type, array( 'link', 'link-responsive' ), true ) ) : ?>
|
123 |
+
<p class="advads-message-warning"><?php esc_html_e( 'Google AdSense deprecated Link Units. Please choose another type.', 'advanced-ads' ); ?>
|
124 |
+
<a href="<?php echo esc_url( ADVADS_URL ); ?>adsense-link-units/"" target="_blank" rel="noopener">
|
125 |
+
<?php esc_html_e( 'Learn more', 'advanced-ads' ); ?>
|
126 |
+
</a>
|
127 |
+
</p>
|
128 |
+
<?php endif; ?>
|
129 |
<hr/>
|
130 |
<label class="label" <?php if ( ! $is_responsive || 2 > count( $sizing_array ) ) { echo 'style="display: none;"'; } ?> id="resize-label"><?php _e( 'Resizing', 'advanced-ads' ); ?></label>
|
131 |
<div <?php if ( ! $is_responsive || 2 > count( $sizing_array ) ) { echo 'style="display: none;"'; } ?>>
|
modules/gadsense/admin/views/settings/amp-auto-ads.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Option to enable AdSense Auto ads on AMP pages
|
4 |
+
* located under Advanced Ads > Settings > AdSense > Auto ads
|
5 |
+
*
|
6 |
+
* @var string $option_name name of the option.
|
7 |
+
* @var bool $auto_ads_enabled true if the AMP Auto ads option is enabled.
|
8 |
+
*/
|
9 |
+
?>
|
10 |
+
<p>
|
11 |
+
<label>
|
12 |
+
<input type="checkbox" name="<?php echo esc_attr( $option_name ); ?>[auto_ads_enabled]" value="1" <?php checked( $auto_ads_enabled ); ?>/>
|
13 |
+
<?php esc_html_e( 'Enable AMP Auto ads', 'advanced-ads' ); ?>
|
14 |
+
</label>
|
15 |
+
</p>
|
modules/gadsense/includes/class-ad-type-adsense.php
CHANGED
@@ -214,7 +214,9 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
|
|
214 |
return '';
|
215 |
}
|
216 |
|
217 |
-
|
|
|
|
|
218 |
|
219 |
$output = apply_filters( 'advanced-ads-gadsense-output', false, $ad, $pub_id, $content );
|
220 |
if ( false !== $output ) {
|
@@ -226,6 +228,12 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
|
|
226 |
|
227 |
$output = '';
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
// build static normal content ads first.
|
230 |
if ( $is_static_normal_content ) {
|
231 |
$output .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>' . "\n";
|
@@ -275,9 +283,9 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
|
|
275 |
}
|
276 |
|
277 |
/**
|
278 |
-
* @param $output
|
279 |
-
* @param $pub_id
|
280 |
-
* @param $content
|
281 |
*/
|
282 |
protected function append_defaut_responsive_content( &$output, $pub_id, $content ) {
|
283 |
$format = '';
|
@@ -287,6 +295,7 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
|
|
287 |
$format = 'autorelaxed';
|
288 |
break;
|
289 |
case 'link-responsive':
|
|
|
290 |
$format = 'link';
|
291 |
break;
|
292 |
case 'in-feed':
|
214 |
return '';
|
215 |
}
|
216 |
|
217 |
+
// "link" was a static format until AdSense stopped filling them in March 2021. Their responsive format serves as a fallback recommended by AdSense
|
218 |
+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
219 |
+
$is_static_normal_content = ! in_array( $content->unitType, array( 'responsive', 'link', 'link-responsive', 'matched-content', 'in-article', 'in-feed' ), true );
|
220 |
|
221 |
$output = apply_filters( 'advanced-ads-gadsense-output', false, $ad, $pub_id, $content );
|
222 |
if ( false !== $output ) {
|
228 |
|
229 |
$output = '';
|
230 |
|
231 |
+
// add notice when a link unit is used
|
232 |
+
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
233 |
+
if ( in_array( $content->unitType, array( 'link', 'link-responsive' ), true ) ) {
|
234 |
+
Advanced_Ads_Ad_Health_Notices::get_instance()->add( 'adsense_link_units_deprecated' );
|
235 |
+
}
|
236 |
+
|
237 |
// build static normal content ads first.
|
238 |
if ( $is_static_normal_content ) {
|
239 |
$output .= '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>' . "\n";
|
283 |
}
|
284 |
|
285 |
/**
|
286 |
+
* @param string $output Current ad unit code.
|
287 |
+
* @param string $pub_id AdSense publisher ID.
|
288 |
+
* @param object $content Ad unit content with all parameters.
|
289 |
*/
|
290 |
protected function append_defaut_responsive_content( &$output, $pub_id, $content ) {
|
291 |
$format = '';
|
295 |
$format = 'autorelaxed';
|
296 |
break;
|
297 |
case 'link-responsive':
|
298 |
+
case 'link':
|
299 |
$format = 'link';
|
300 |
break;
|
301 |
case 'in-feed':
|
modules/gadsense/includes/class-gadsense-data.php
CHANGED
@@ -12,7 +12,7 @@ class Advanced_Ads_AdSense_Data {
|
|
12 |
|
13 |
// set defaults
|
14 |
if (!isset($options['adsense-id'])) {
|
15 |
-
|
16 |
$options['adsense-id'] = '';
|
17 |
// starting version 1.7.9, the default limit setting was changed from true to false due to AdSense policy change
|
18 |
$options['limit-per-page'] = false;
|
@@ -27,7 +27,7 @@ class Advanced_Ads_AdSense_Data {
|
|
27 |
|
28 |
if (!isset($options['page-level-enabled'])) {
|
29 |
$options['page-level-enabled'] = false;
|
30 |
-
|
31 |
}
|
32 |
if ( ! isset( $options['background'] ) ) {
|
33 |
$options['background'] = false;
|
@@ -92,12 +92,23 @@ class Advanced_Ads_AdSense_Data {
|
|
92 |
};
|
93 |
return false;
|
94 |
}
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
96 |
public function is_hide_stats(){
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
102 |
|
103 |
}
|
12 |
|
13 |
// set defaults
|
14 |
if (!isset($options['adsense-id'])) {
|
15 |
+
|
16 |
$options['adsense-id'] = '';
|
17 |
// starting version 1.7.9, the default limit setting was changed from true to false due to AdSense policy change
|
18 |
$options['limit-per-page'] = false;
|
27 |
|
28 |
if (!isset($options['page-level-enabled'])) {
|
29 |
$options['page-level-enabled'] = false;
|
30 |
+
|
31 |
}
|
32 |
if ( ! isset( $options['background'] ) ) {
|
33 |
$options['background'] = false;
|
92 |
};
|
93 |
return false;
|
94 |
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Whether to hide the AdSense stats metabox.
|
98 |
+
*
|
99 |
+
* @return bool
|
100 |
+
*/
|
101 |
public function is_hide_stats(){
|
102 |
+
global $post;
|
103 |
+
|
104 |
+
if ( $post instanceof WP_Post && Advanced_Ads::POST_TYPE_SLUG === $post->post_type ) {
|
105 |
+
$the_ad = new Advanced_Ads_Ad( $post->ID );
|
106 |
+
if ( $the_ad->type !== 'adsense' ) {
|
107 |
+
return true;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
return isset( $this->options['hide-stats'] );
|
112 |
}
|
113 |
|
114 |
}
|
modules/gadsense/includes/class-network-adsense.php
CHANGED
@@ -161,7 +161,7 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
161 |
?><label><input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[limit-per-page]" value="1" <?php checked( $limit_per_page ); ?> />
|
162 |
<?php
|
163 |
printf(
|
164 |
-
|
165 |
esc_html( __( 'Limit to %d AdSense ads', 'advanced-ads' ) ),
|
166 |
3
|
167 |
);
|
@@ -169,9 +169,9 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
169 |
</label>
|
170 |
<p class="description">
|
171 |
<?php
|
172 |
-
|
173 |
?>
|
174 |
-
|
175 |
<?php
|
176 |
if ( defined( 'AAP_VERSION' ) ) :
|
177 |
// Give warning when cache-busting in Pro is active.
|
@@ -220,9 +220,7 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
220 |
|
221 |
?>
|
222 |
<label><input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[page-level-enabled]" value="1" <?php checked( $page_level ); ?> />
|
223 |
-
|
224 |
-
esc_attr_e( 'Insert the AdSense header code to enable Auto ads and verify your website.', 'advanced-ads' );
|
225 |
-
?>
|
226 |
</label>
|
227 |
<ul>
|
228 |
<li><a href="<?php echo esc_url( ADVADS_URL ) . 'adsense-auto-ads-wordpress/#Display_Auto_Ads_only_on_specific_pages'; ?>" target="_blank"><?php esc_attr_e( 'Display Auto ads only on specific pages', 'advanced-ads' ); ?></a></li>
|
@@ -230,16 +228,14 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
230 |
<?php
|
231 |
if ( ! empty( $options['adsense-id'] ) ) :
|
232 |
?>
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
?>
|
240 |
-
</a></li>
|
241 |
<?php
|
242 |
-
|
243 |
?>
|
244 |
</ul>
|
245 |
<?php if ( Advanced_Ads_Compatibility::borlabs_cookie_adsense_auto_ads_code_exists() ) : ?>
|
@@ -249,19 +245,26 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
249 |
<?php endif; ?>
|
250 |
|
251 |
<?php
|
252 |
-
|
253 |
-
|
254 |
-
?>
|
255 |
-
<p><label><input type="checkbox" disabled="disabled"/><?php esc_html_e( 'Enable AMP Auto ads', 'advanced-ads' ); ?></label>
|
256 |
-
<?php
|
257 |
-
Advanced_Ads_Admin_Upgrades::upgrade_link( null, ADVADS_URL . 'add-ons/responsive-ads/', 'upgrade-settings-adsense-amp-auto-ads' );
|
258 |
-
?>
|
259 |
-
</p>
|
260 |
-
<?php
|
261 |
-
endif;
|
262 |
do_action( 'advanced-ads-settings-adsense-below-auto-ads-option' );
|
263 |
}
|
264 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
/**
|
266 |
* Render AdSense violation warnings setting
|
267 |
*
|
@@ -273,12 +276,12 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
273 |
|
274 |
?>
|
275 |
<label><input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[violation-warnings-disable]" value="1" <?php checked( 1, $disable_violation_warnings ); ?> />
|
276 |
-
|
277 |
<p class="description">
|
278 |
-
|
279 |
printf(
|
280 |
wp_kses(
|
281 |
-
|
282 |
__( 'Our <a href="%s" target="_blank">Ad Health</a> feature monitors if AdSense is implemented correctly on your site. It also considers ads not managed with Advanced Ads. Enable this option to remove these checks', 'advanced-ads' ),
|
283 |
array(
|
284 |
'a' => array(
|
@@ -289,9 +292,9 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
289 |
),
|
290 |
esc_url( ADVADS_URL ) . 'manual/ad-health/#utm_source=advanced-ads&utm_medium=link&utm_campaign=backend-autoads-ads'
|
291 |
);
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
}
|
296 |
|
297 |
/**
|
@@ -302,9 +305,11 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
302 |
$background = $options['background'];
|
303 |
|
304 |
?>
|
305 |
-
<label
|
306 |
-
|
307 |
-
|
|
|
|
|
308 |
}
|
309 |
|
310 |
/**
|
@@ -320,10 +325,10 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
320 |
<option value="disable" <?php selected( $fw, 'disable' ); ?>><?php esc_html_e( 'disable', 'advanced-ads' ); ?></option>
|
321 |
</select>
|
322 |
<p class="description">
|
323 |
-
|
324 |
echo wp_kses(
|
325 |
sprintf(
|
326 |
-
|
327 |
__( "Whether your responsive ad unit may expand to <a href='%s' target='blank'>use the full width</a> of your visitor's mobile device screen", 'advanced-ads' ),
|
328 |
esc_url( 'https://support.google.com/adsense/answer/7445870' )
|
329 |
),
|
@@ -334,8 +339,8 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
334 |
),
|
335 |
)
|
336 |
);
|
337 |
-
|
338 |
-
|
339 |
<?php
|
340 |
}
|
341 |
|
@@ -406,10 +411,12 @@ class Advanced_Ads_Network_Adsense extends Advanced_Ads_Ad_Network {
|
|
406 |
$units = array();
|
407 |
$mapi_options = Advanced_Ads_AdSense_MAPI::get_option();
|
408 |
|
409 |
-
if (
|
410 |
-
|
411 |
-
|
412 |
-
|
|
|
|
|
413 |
$ad_codes = $mapi_options['ad_codes'];
|
414 |
foreach ( $mapi_options['accounts'][ $adsense_id ]['ad_units'] as $id => $raw ) {
|
415 |
$ad_unit = new Advanced_Ads_Ad_Network_Ad_Unit( $raw );
|
161 |
?><label><input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[limit-per-page]" value="1" <?php checked( $limit_per_page ); ?> />
|
162 |
<?php
|
163 |
printf(
|
164 |
+
// Translators: $d a number of ads.
|
165 |
esc_html( __( 'Limit to %d AdSense ads', 'advanced-ads' ) ),
|
166 |
3
|
167 |
);
|
169 |
</label>
|
170 |
<p class="description">
|
171 |
<?php
|
172 |
+
esc_html_e( 'There is no explicit limit for AdSense ads anymore, but you can still use this setting to prevent too many AdSense ads to show accidentally on your site.', 'advanced-ads' );
|
173 |
?>
|
174 |
+
</p>
|
175 |
<?php
|
176 |
if ( defined( 'AAP_VERSION' ) ) :
|
177 |
// Give warning when cache-busting in Pro is active.
|
220 |
|
221 |
?>
|
222 |
<label><input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[page-level-enabled]" value="1" <?php checked( $page_level ); ?> />
|
223 |
+
<?php esc_attr_e( 'Insert the AdSense header code to enable Auto ads and verify your website.', 'advanced-ads' ); ?>
|
|
|
|
|
224 |
</label>
|
225 |
<ul>
|
226 |
<li><a href="<?php echo esc_url( ADVADS_URL ) . 'adsense-auto-ads-wordpress/#Display_Auto_Ads_only_on_specific_pages'; ?>" target="_blank"><?php esc_attr_e( 'Display Auto ads only on specific pages', 'advanced-ads' ); ?></a></li>
|
228 |
<?php
|
229 |
if ( ! empty( $options['adsense-id'] ) ) :
|
230 |
?>
|
231 |
+
<li><a href="https://www.google.com/adsense/new/u/0/<?php echo esc_attr( $options['adsense-id'] ); ?>/myads/auto-ads" target="_blank">
|
232 |
+
<?php
|
233 |
+
/* translators: this is the text for a link to a sub-page in an AdSense account */
|
234 |
+
esc_attr_e( 'Adjust Auto ads options', 'advanced-ads' );
|
235 |
+
?>
|
236 |
+
</a></li>
|
|
|
|
|
237 |
<?php
|
238 |
+
endif;
|
239 |
?>
|
240 |
</ul>
|
241 |
<?php if ( Advanced_Ads_Compatibility::borlabs_cookie_adsense_auto_ads_code_exists() ) : ?>
|
245 |
<?php endif; ?>
|
246 |
|
247 |
<?php
|
248 |
+
self::render_settings_adsense_amp();
|
249 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
do_action( 'advanced-ads-settings-adsense-below-auto-ads-option' );
|
251 |
}
|
252 |
|
253 |
+
/**
|
254 |
+
* Render Adsense AMP setting fields.
|
255 |
+
*/
|
256 |
+
public function render_settings_adsense_amp() {
|
257 |
+
// AMP Auto ads was removed from Responsive add-on version 1.10.0
|
258 |
+
if ( defined( 'AAR_VERSION' ) && 1 === version_compare( '1.10.0', AAR_VERSION ) ) {
|
259 |
+
return;
|
260 |
+
}
|
261 |
+
|
262 |
+
$adsense_options = Advanced_Ads_AdSense_Data::get_instance()->get_options();
|
263 |
+
$auto_ads_enabled = ! empty( $adsense_options['amp']['auto_ads_enabled'] );
|
264 |
+
$option_name = GADSENSE_OPT_NAME . '[amp]';
|
265 |
+
include GADSENSE_BASE_PATH . 'admin/views/settings/amp-auto-ads.php';
|
266 |
+
}
|
267 |
+
|
268 |
/**
|
269 |
* Render AdSense violation warnings setting
|
270 |
*
|
276 |
|
277 |
?>
|
278 |
<label><input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[violation-warnings-disable]" value="1" <?php checked( 1, $disable_violation_warnings ); ?> />
|
279 |
+
<?php esc_html_e( 'Disable warnings about potential violations of the AdSense terms.', 'advanced-ads' ); ?></label>
|
280 |
<p class="description">
|
281 |
+
<?php
|
282 |
printf(
|
283 |
wp_kses(
|
284 |
+
/* translators: %s is a URL. */
|
285 |
__( 'Our <a href="%s" target="_blank">Ad Health</a> feature monitors if AdSense is implemented correctly on your site. It also considers ads not managed with Advanced Ads. Enable this option to remove these checks', 'advanced-ads' ),
|
286 |
array(
|
287 |
'a' => array(
|
292 |
),
|
293 |
esc_url( ADVADS_URL ) . 'manual/ad-health/#utm_source=advanced-ads&utm_medium=link&utm_campaign=backend-autoads-ads'
|
294 |
);
|
295 |
+
?>
|
296 |
+
</p>
|
297 |
+
<?php
|
298 |
}
|
299 |
|
300 |
/**
|
305 |
$background = $options['background'];
|
306 |
|
307 |
?>
|
308 |
+
<label>
|
309 |
+
<input type="checkbox" name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[background]" value="1" <?php checked( $background ); ?> />
|
310 |
+
<?php esc_html_e( 'Enable this option in case your theme adds an unfortunate background color to AdSense ads.', 'advanced-ads' ); ?>
|
311 |
+
</label>
|
312 |
+
<?php
|
313 |
}
|
314 |
|
315 |
/**
|
325 |
<option value="disable" <?php selected( $fw, 'disable' ); ?>><?php esc_html_e( 'disable', 'advanced-ads' ); ?></option>
|
326 |
</select>
|
327 |
<p class="description">
|
328 |
+
<?php
|
329 |
echo wp_kses(
|
330 |
sprintf(
|
331 |
+
/* translators: %s is a URL. */
|
332 |
__( "Whether your responsive ad unit may expand to <a href='%s' target='blank'>use the full width</a> of your visitor's mobile device screen", 'advanced-ads' ),
|
333 |
esc_url( 'https://support.google.com/adsense/answer/7445870' )
|
334 |
),
|
339 |
),
|
340 |
)
|
341 |
);
|
342 |
+
?>
|
343 |
+
</p>
|
344 |
<?php
|
345 |
}
|
346 |
|
411 |
$units = array();
|
412 |
$mapi_options = Advanced_Ads_AdSense_MAPI::get_option();
|
413 |
|
414 |
+
if (
|
415 |
+
isset( $mapi_options['ad_codes'] )
|
416 |
+
&& isset( $mapi_options['accounts'] )
|
417 |
+
&& isset( $mapi_options['accounts'][ $adsense_id ] )
|
418 |
+
&& isset( $mapi_options['accounts'][ $adsense_id ]['ad_units'] )
|
419 |
+
) {
|
420 |
$ad_codes = $mapi_options['ad_codes'];
|
421 |
foreach ( $mapi_options['accounts'][ $adsense_id ]['ad_units'] as $id => $raw ) {
|
422 |
$ad_unit = new Advanced_Ads_Ad_Network_Ad_Unit( $raw );
|
modules/gadsense/public/public.php
CHANGED
@@ -5,13 +5,28 @@
|
|
5 |
*/
|
6 |
class Advanced_Ads_AdSense_Public {
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
11 |
|
|
|
|
|
|
|
12 |
private function __construct() {
|
13 |
$this->data = Advanced_Ads_AdSense_Data::get_instance();
|
14 |
add_action( 'wp_head', array( $this, 'inject_header' ), 20 );
|
|
|
|
|
15 |
}
|
16 |
|
17 |
/**
|
@@ -87,4 +102,66 @@ class Advanced_Ads_AdSense_Public {
|
|
87 |
include GADSENSE_BASE_PATH . 'public/templates/page-level.php';
|
88 |
}
|
89 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
5 |
*/
|
6 |
class Advanced_Ads_AdSense_Public {
|
7 |
|
8 |
+
/**
|
9 |
+
* AdSense account related data
|
10 |
+
*
|
11 |
+
* @var Advanced_Ads_AdSense_Data
|
12 |
+
*/
|
13 |
+
private $data;
|
14 |
|
15 |
+
/**
|
16 |
+
* Instance of Advanced_Ads_AdSense_Public
|
17 |
+
*
|
18 |
+
* @var Advanced_Ads_AdSense_Public
|
19 |
+
*/
|
20 |
+
private static $instance;
|
21 |
|
22 |
+
/**
|
23 |
+
* Advanced_Ads_AdSense_Public constructor.
|
24 |
+
*/
|
25 |
private function __construct() {
|
26 |
$this->data = Advanced_Ads_AdSense_Data::get_instance();
|
27 |
add_action( 'wp_head', array( $this, 'inject_header' ), 20 );
|
28 |
+
// Fires before cache-busting frontend is initialized and tracking method is set
|
29 |
+
add_action( 'wp', array( $this, 'inject_amp_code' ), 20 );
|
30 |
}
|
31 |
|
32 |
/**
|
102 |
include GADSENSE_BASE_PATH . 'public/templates/page-level.php';
|
103 |
}
|
104 |
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Handle AdSense AMP code
|
108 |
+
*/
|
109 |
+
public function inject_amp_code() {
|
110 |
+
|
111 |
+
// The is_amp_endpoint function is used for multiple plugins.
|
112 |
+
if ( function_exists( 'is_amp_endpoint' ) ) {
|
113 |
+
$adsense_data = Advanced_Ads_AdSense_Data::get_instance();
|
114 |
+
$adsense_options = $adsense_data->get_options();
|
115 |
+
|
116 |
+
// AMP Auto ads was removed from Responsive add-on version 1.10.0
|
117 |
+
if ( defined( 'AAR_VERSION' ) && 1 === version_compare( '1.10.0', AAR_VERSION )
|
118 |
+
|| empty( $adsense_options['amp']['auto_ads_enabled'] ) ) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
// Adds the AdSense Auto ads AMP code to the page (head) in "Reader" mode.
|
123 |
+
add_action( 'amp_post_template_data', array( $this, 'add_auto_ads_amp_head_script' ) );
|
124 |
+
|
125 |
+
// SmartMag theme (http://theme-sphere.com/smart-mag/documentation/).
|
126 |
+
add_action( 'bunyad_amp_pre_main', array( $this, 'add_auto_ads_amp_body_script' ) );
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Add AMP Auto ads body code to footer for `AMP` plugin ( https://wordpress.org/plugins/amp/ )
|
130 |
+
*
|
131 |
+
* Adds the Auto ads `body` tag to `wp_footer` because there is no WordPress right hook after `body`
|
132 |
+
* The AdSense Auto ads code is added automatically to the `head` section using the amp_post_template_data hook above.
|
133 |
+
*
|
134 |
+
* use `wp_footer` in Transition and Standard mode
|
135 |
+
* use `amp_post_template_footer` in Reader mode
|
136 |
+
*/
|
137 |
+
add_action( 'wp_footer', array( $this, 'add_auto_ads_amp_body_script' ) );
|
138 |
+
add_action( 'amp_post_template_footer', array( $this, 'add_auto_ads_amp_body_script' ) );
|
139 |
+
|
140 |
+
// Other AMP plugins.
|
141 |
+
} elseif ( function_exists( 'is_wp_amp' ) ) {
|
142 |
+
// WP AMP — Accelerated Mobile Pages for WordPress and WooCommerce (https://codecanyon.net/item/wp-amp-accelerated-mobile-pages-for-wordpress-and-woocommerce/16278608).
|
143 |
+
add_action( 'amphtml_after_footer', array( $this, 'add_adsense_auto_ads' ) );
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Add AdSense AMP Auto ads code to the header.
|
149 |
+
*
|
150 |
+
* @param array $data AMP components.
|
151 |
+
*/
|
152 |
+
public function add_auto_ads_amp_head_script( $data ) {
|
153 |
+
$data['amp_component_scripts']['amp-auto-ads'] = 'https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js';
|
154 |
+
|
155 |
+
return $data;
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Add Adsense Auto Ads body script.
|
160 |
+
*/
|
161 |
+
public function add_auto_ads_amp_body_script() {
|
162 |
+
$pub_id = $this->data->get_adsense_id();
|
163 |
+
if ( $pub_id ) {
|
164 |
+
printf( '<amp-auto-ads type="adsense" data-ad-client="ca-%s"></amp-auto-ads>', esc_attr( $pub_id ) );
|
165 |
+
}
|
166 |
+
}
|
167 |
}
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: webzunft, advancedads
|
3 |
Tags: ads, ad manager, ad rotation, adsense, banner
|
4 |
Requires at least: 4.6
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -123,7 +123,7 @@ Amazing features of the most powerful and easy Google AdSense plugin.
|
|
123 |
* change type and sizes of an ad without going into your Google AdSense account
|
124 |
* hide Google AdSense advertisements on 404 pages by default (to comply with Google AdSense terms)
|
125 |
* insert Google AdSense code for verification and AdSense Auto Ads (previously called Page-Level ads and QuickStart)
|
126 |
-
*
|
127 |
* easy Ad Health integration and Google AdSense violation checks
|
128 |
* option to make the Google AdSense background transparent
|
129 |
* place Google AdSense In-feed ads using the also free [In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/)
|
@@ -317,6 +317,17 @@ Yes. You can use plenty of [hooks](https://wpadvancedads.com/codex/) to customiz
|
|
317 |
|
318 |
== Changelog ==
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
= 1.23.2 =
|
321 |
|
322 |
- reverted erroneously removing plugin author index
|
2 |
Contributors: webzunft, advancedads
|
3 |
Tags: ads, ad manager, ad rotation, adsense, banner
|
4 |
Requires at least: 4.6
|
5 |
+
Tested up to: 5.7
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 1.24.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
123 |
* change type and sizes of an ad without going into your Google AdSense account
|
124 |
* hide Google AdSense advertisements on 404 pages by default (to comply with Google AdSense terms)
|
125 |
* insert Google AdSense code for verification and AdSense Auto Ads (previously called Page-Level ads and QuickStart)
|
126 |
+
* enable AdSense Auto ads on AMP
|
127 |
* easy Ad Health integration and Google AdSense violation checks
|
128 |
* option to make the Google AdSense background transparent
|
129 |
* place Google AdSense In-feed ads using the also free [In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/)
|
317 |
|
318 |
== Changelog ==
|
319 |
|
320 |
+
= 1.24.0 =
|
321 |
+
|
322 |
+
- AdSense deprecated Link Units and might no longer fill them. So we removed them when creating new ads. [Learn more](https://wpadvancedads.com/adsense-link-units/)
|
323 |
+
- enable AdSense Auto ads on AMP pages
|
324 |
+
- interpret WP blocks in the plain text ad type
|
325 |
+
- remove MailPoet warning since they are not retiring custom shortcodes after all
|
326 |
+
- convert jQuery shorthand functions to `.on()` and `.trigger()`
|
327 |
+
- made shortcode button work with WordPress 4.9
|
328 |
+
- allow to exclude conditions from the "new display condition" dropdown
|
329 |
+
- prevent AdSense earnings box from appearing on non AdSense ad page when AdSense connection is lost
|
330 |
+
|
331 |
= 1.23.2 =
|
332 |
|
333 |
- reverted erroneously removing plugin author index
|