Version Description
- show hint if Auto ads are enabled
- allow responsive Adsense ads with custom sizes to be floated
- show an advice if user does not have permissions to edit ads
- fixed AdSense key overlay not accepting copy&paste in Safari and Firefox
Download this release
Release Info
Developer | webzunft |
Plugin | Advanced Ads |
Version | 1.10.8 |
Comparing to | |
See all releases |
Code changes from version 1.10.7 to 1.10.8
- admin/class-advanced-ads-admin.php +16 -6
- admin/includes/class-ad-type.php +2 -2
- admin/includes/class-licenses.php +10 -0
- admin/views/ad-output-metabox.php +3 -2
- admin/views/ad-submitbox-meta.php +2 -1
- advanced-ads.php +2 -2
- classes/ad.php +8 -1
- classes/frontend_checks.php +23 -2
- modules/gadsense/admin/assets/js/mapi-settings.js +3 -0
- modules/gadsense/admin/assets/js/new-ad.js +26 -8
- modules/gadsense/admin/views/adsense-account.php +1 -1
- modules/gadsense/includes/class-ad-type-adsense.php +3 -2
- public/class-advanced-ads.php +18 -0
- public/views/ad-edit-bar.php +3 -0
- readme.txt +45 -30
admin/class-advanced-ads-admin.php
CHANGED
@@ -442,15 +442,25 @@ class Advanced_Ads_Admin {
|
|
442 |
if ( isset( $form['advanced_ads_disable_reason'] )
|
443 |
&& 'get help' === $form['advanced_ads_disable_reason']
|
444 |
&& ! empty( $form['advanced_ads_disable_reply_email'] ) ) {
|
445 |
-
$email
|
446 |
-
$current_user
|
447 |
-
$name
|
448 |
-
$from
|
|
|
449 |
if ( isset( $form['advanced_ads_disable_text'][0] )
|
450 |
&& trim( $form['advanced_ads_disable_text'][0] ) !== '' ) { // is a text given then ask for help.
|
451 |
-
|
|
|
|
|
|
|
|
|
|
|
452 |
} else { // if no text is given, just reply.
|
453 |
-
$
|
|
|
|
|
|
|
|
|
454 |
}
|
455 |
}
|
456 |
if ( $from ) {
|
442 |
if ( isset( $form['advanced_ads_disable_reason'] )
|
443 |
&& 'get help' === $form['advanced_ads_disable_reason']
|
444 |
&& ! empty( $form['advanced_ads_disable_reply_email'] ) ) {
|
445 |
+
$email = isset( $form['advanced_ads_disable_reply_email'] ) ? trim( $form['advanced_ads_disable_reply_email'] ) : $current_user->email;
|
446 |
+
$current_user = wp_get_current_user();
|
447 |
+
$name = ( $current_user instanceof WP_User ) ? $current_user->user_nicename : '';
|
448 |
+
$from = $name . ' <' . $email . '>';
|
449 |
+
$is_german = ( preg_match( '/\.de$/', $from ) || "de_" === substr( get_locale(), 0, 3 ) || "de_" === substr( get_user_locale(), 0, 3 ) );
|
450 |
if ( isset( $form['advanced_ads_disable_text'][0] )
|
451 |
&& trim( $form['advanced_ads_disable_text'][0] ) !== '' ) { // is a text given then ask for help.
|
452 |
+
// send German text
|
453 |
+
if( $is_german ){
|
454 |
+
$text .= "\n\n Hilfe ist auf dem Weg.";
|
455 |
+
} else {
|
456 |
+
$text .= "\n\n Help is on its way.";
|
457 |
+
}
|
458 |
} else { // if no text is given, just reply.
|
459 |
+
if( $is_german ){
|
460 |
+
$text .= "\n\n Vielen Dank für das Feedback.";
|
461 |
+
} else {
|
462 |
+
$text .= "\n\n Thank you for your feedback.";
|
463 |
+
}
|
464 |
}
|
465 |
}
|
466 |
if ( $from ) {
|
admin/includes/class-ad-type.php
CHANGED
@@ -656,7 +656,7 @@ class Advanced_Ads_Admin_Ad_Type {
|
|
656 |
}
|
657 |
|
658 |
/**
|
659 |
-
* Replace '
|
660 |
*
|
661 |
* @param string $translation Translated text.
|
662 |
* @param string $text Text to translate.
|
@@ -665,7 +665,7 @@ class Advanced_Ads_Admin_Ad_Type {
|
|
665 |
public function replace_cheating_message( $translated_text, $untranslated_text ) {
|
666 |
global $typenow;
|
667 |
|
668 |
-
if ( isset( $typenow ) && $untranslated_text === '
|
669 |
$translated_text = __( 'You don’t have access to ads. Please deactivate and re-enable Advanced Ads again to fix this.', 'advanced-ads' );
|
670 |
}
|
671 |
|
656 |
}
|
657 |
|
658 |
/**
|
659 |
+
* Replace 'You need a higher level of permission.' message if user role does not have required permissions.
|
660 |
*
|
661 |
* @param string $translation Translated text.
|
662 |
* @param string $text Text to translate.
|
665 |
public function replace_cheating_message( $translated_text, $untranslated_text ) {
|
666 |
global $typenow;
|
667 |
|
668 |
+
if ( isset( $typenow ) && $untranslated_text === 'You need a higher level of permission.' && $typenow === $this->post_type ) {
|
669 |
$translated_text = __( 'You don’t have access to ads. Please deactivate and re-enable Advanced Ads again to fix this.', 'advanced-ads' );
|
670 |
}
|
671 |
|
admin/includes/class-licenses.php
CHANGED
@@ -139,6 +139,11 @@ class Advanced_Ads_Admin_Licenses {
|
|
139 |
'body' => $api_params
|
140 |
) );
|
141 |
|
|
|
|
|
|
|
|
|
|
|
142 |
if ( is_wp_error( $response ) ) {
|
143 |
$body = wp_remote_retrieve_body( $response );
|
144 |
if ( $body ){
|
@@ -256,6 +261,11 @@ class Advanced_Ads_Admin_Licenses {
|
|
256 |
'sslverify' => false,
|
257 |
) );
|
258 |
|
|
|
|
|
|
|
|
|
|
|
259 |
if ( is_wp_error( $response ) ) {
|
260 |
$body = wp_remote_retrieve_body( $response );
|
261 |
if ( $body ){
|
139 |
'body' => $api_params
|
140 |
) );
|
141 |
|
142 |
+
// show license debug output if constant is set
|
143 |
+
if( defined( 'ADVANCED_ADS_SHOW_LICENSE_RESPONSE' ) ){
|
144 |
+
return '<pre>' . print_r( $response, true ) . '</pre>';
|
145 |
+
}
|
146 |
+
|
147 |
if ( is_wp_error( $response ) ) {
|
148 |
$body = wp_remote_retrieve_body( $response );
|
149 |
if ( $body ){
|
261 |
'sslverify' => false,
|
262 |
) );
|
263 |
|
264 |
+
// show license debug output if constant is set
|
265 |
+
if( defined( 'ADVANCED_ADS_SHOW_LICENSE_RESPONSE' ) ){
|
266 |
+
return '<pre>' . print_r( $response, true ) . '</pre>';
|
267 |
+
}
|
268 |
+
|
269 |
if ( is_wp_error( $response ) ) {
|
270 |
$body = wp_remote_retrieve_body( $response );
|
271 |
if ( $body ){
|
admin/views/ad-output-metabox.php
CHANGED
@@ -27,8 +27,9 @@
|
|
27 |
<p><label><input type="checkbox" name="advanced_ad[output][clearfix]" value="1"<?php
|
28 |
if ( isset( $options['clearfix'] ) ) {
|
29 |
checked( $options['clearfix'], 1 ); }
|
30 |
-
|
31 |
-
|
|
|
32 |
</div>
|
33 |
<hr/>
|
34 |
<span class="label"><?php _e( 'Margin', 'advanced-ads' ); ?></span>
|
27 |
<p><label><input type="checkbox" name="advanced_ad[output][clearfix]" value="1"<?php
|
28 |
if ( isset( $options['clearfix'] ) ) {
|
29 |
checked( $options['clearfix'], 1 ); }
|
30 |
+
?>/><?php
|
31 |
+
_e( 'Check this if you don\'t want the following elements to float around the ad. (adds a clearfix)', 'advanced-ads' );
|
32 |
+
?></label></p>
|
33 |
</div>
|
34 |
<hr/>
|
35 |
<span class="label"><?php _e( 'Margin', 'advanced-ads' ); ?></span>
|
admin/views/ad-submitbox-meta.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
$TZ = Advanced_Ads_Admin::timezone_get_name( Advanced_Ads_Admin::get_wp_timezone() );
|
3 |
?><div id="advanced-ads-expiry-date" class="misc-pub-section curtime misc-pub-curtime">
|
4 |
<label onclick="advads_toggle_box('#advanced-ads-expiry-date-enable', '#advanced-ads-expiry-date .inner')">
|
5 |
-
<input type="checkbox" id="advanced-ads-expiry-date-enable" name="advanced_ad[expiry_date][enabled]" value="1" <?php checked( $enabled, 1 ); ?>/><?php _e( 'Set expiry date', 'advanced-ads' );
|
6 |
</label>
|
7 |
<br/>
|
8 |
|
@@ -31,5 +31,6 @@ $TZ = Advanced_Ads_Admin::timezone_get_name( Advanced_Ads_Admin::get_wp_timezone
|
|
31 |
<?php printf( _x( '%1$s %2$s, %3$s @ %4$s %5$s', 'order of expiry date fields 1: month, 2: day, 3: year, 4: hour, 5: minute', 'advanced-ads' ), $month, $day, $year, $hour, $minute ); ?>
|
32 |
</div>
|
33 |
</fieldset>
|
|
|
34 |
</div>
|
35 |
</div>
|
2 |
$TZ = Advanced_Ads_Admin::timezone_get_name( Advanced_Ads_Admin::get_wp_timezone() );
|
3 |
?><div id="advanced-ads-expiry-date" class="misc-pub-section curtime misc-pub-curtime">
|
4 |
<label onclick="advads_toggle_box('#advanced-ads-expiry-date-enable', '#advanced-ads-expiry-date .inner')">
|
5 |
+
<input type="checkbox" id="advanced-ads-expiry-date-enable" name="advanced_ad[expiry_date][enabled]" value="1" <?php checked( $enabled, 1 ); ?>/><?php _e( 'Set expiry date', 'advanced-ads' ); ?>
|
6 |
</label>
|
7 |
<br/>
|
8 |
|
31 |
<?php printf( _x( '%1$s %2$s, %3$s @ %4$s %5$s', 'order of expiry date fields 1: month, 2: day, 3: year, 4: hour, 5: minute', 'advanced-ads' ), $month, $day, $year, $hour, $minute ); ?>
|
32 |
</div>
|
33 |
</fieldset>
|
34 |
+
(<?php echo $TZ; ?>)
|
35 |
</div>
|
36 |
</div>
|
advanced-ads.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
-
* Version: 1.10.
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: https://wpadvancedads.com
|
18 |
* Text Domain: advanced-ads
|
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
|
|
39 |
// general and global slug, e.g. to store options in WP
|
40 |
define( 'ADVADS_SLUG', 'advanced-ads' );
|
41 |
define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
|
42 |
-
define( 'ADVADS_VERSION', '1.10.
|
43 |
|
44 |
/*----------------------------------------------------------------------------*
|
45 |
* Autoloading, modules and functions
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
+
* Version: 1.10.8
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: https://wpadvancedads.com
|
18 |
* Text Domain: advanced-ads
|
39 |
// general and global slug, e.g. to store options in WP
|
40 |
define( 'ADVADS_SLUG', 'advanced-ads' );
|
41 |
define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
|
42 |
+
define( 'ADVADS_VERSION', '1.10.8' );
|
43 |
|
44 |
/*----------------------------------------------------------------------------*
|
45 |
* Autoloading, modules and functions
|
classes/ad.php
CHANGED
@@ -543,7 +543,6 @@ class Advanced_Ads_Ad {
|
|
543 |
return;
|
544 |
}
|
545 |
|
546 |
-
|
547 |
if ( ! $this->is_head_placement ) {
|
548 |
// filter to manipulate the output before the wrapper is added
|
549 |
$output = apply_filters( 'advanced-ads-output-inside-wrapper', $output, $this );
|
@@ -552,6 +551,13 @@ class Advanced_Ads_Ad {
|
|
552 |
$output = $this->label . $output;
|
553 |
}
|
554 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
555 |
// build wrapper around the ad
|
556 |
$output = $this->add_wrapper( $output );
|
557 |
|
@@ -560,6 +566,7 @@ class Advanced_Ads_Ad {
|
|
560 |
$output .= '<br style="clear: both; display: block; float: none;"/>';
|
561 |
}
|
562 |
}
|
|
|
563 |
|
564 |
// apply a custom filter by ad type
|
565 |
$output = apply_filters( 'advanced-ads-ad-output', $output, $this );
|
543 |
return;
|
544 |
}
|
545 |
|
|
|
546 |
if ( ! $this->is_head_placement ) {
|
547 |
// filter to manipulate the output before the wrapper is added
|
548 |
$output = apply_filters( 'advanced-ads-output-inside-wrapper', $output, $this );
|
551 |
$output = $this->label . $output;
|
552 |
}
|
553 |
|
554 |
+
// add edit button for users with the appropriate rights
|
555 |
+
if( current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ){
|
556 |
+
ob_start();
|
557 |
+
include ADVADS_BASE_PATH . 'public/views/ad-edit-bar.php';
|
558 |
+
$output = ob_get_clean() . $output;
|
559 |
+
}
|
560 |
+
|
561 |
// build wrapper around the ad
|
562 |
$output = $this->add_wrapper( $output );
|
563 |
|
566 |
$output .= '<br style="clear: both; display: block; float: none;"/>';
|
567 |
}
|
568 |
}
|
569 |
+
|
570 |
|
571 |
// apply a custom filter by ad type
|
572 |
$output = apply_filters( 'advanced-ads-ad-output', $output, $this );
|
classes/frontend_checks.php
CHANGED
@@ -313,6 +313,18 @@ class Advanced_Ads_Frontend_Checks {
|
|
313 |
'id' => 'advanced_ads_ad_health_highlight_ads',
|
314 |
'title' => sprintf( '<label style="color: inherit;"><input id="advanced_ads_highlight_ads_checkbox" type="checkbox"> %s</label>', __( 'highlight ads', 'advanced-ads' ) )
|
315 |
) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
316 |
|
317 |
/**
|
318 |
* Add new node.
|
@@ -530,11 +542,12 @@ class Advanced_Ads_Frontend_Checks {
|
|
530 |
|
531 |
<?php if( ! isset( $adsense_options['violation-warnings-disable'] ) ) : ?>
|
532 |
// show warning if AdSense ad is hidden
|
|
|
533 |
setTimeout( function(){
|
534 |
advanced_ads_ready( advanced_ads_frontend_checks.advads_highlight_hidden_adsense );
|
|
|
535 |
}, 2000 );
|
536 |
|
537 |
-
|
538 |
// highlight AdSense Auto Ads ads 3 seconds after site loaded
|
539 |
setTimeout( function(){
|
540 |
advanced_ads_ready( advads_highlight_adsense_autoads )
|
@@ -556,7 +569,15 @@ class Advanced_Ads_Frontend_Checks {
|
|
556 |
}
|
557 |
advanced_ads_frontend_checks.showCount();
|
558 |
}
|
559 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
560 |
}
|
561 |
<?php endif;
|
562 |
/**
|
313 |
'id' => 'advanced_ads_ad_health_highlight_ads',
|
314 |
'title' => sprintf( '<label style="color: inherit;"><input id="advanced_ads_highlight_ads_checkbox" type="checkbox"> %s</label>', __( 'highlight ads', 'advanced-ads' ) )
|
315 |
) );
|
316 |
+
|
317 |
+
// search for AdSense Verification and Auto ads code
|
318 |
+
$nodes[] = array( 'type' => 3, 'data' => array(
|
319 |
+
'parent' => 'advanced_ads_ad_health',
|
320 |
+
'id' => 'advanced_ads_ad_health_auto_ads_found',
|
321 |
+
'title' => __( 'Auto ads code found', 'advanced-ads' ),
|
322 |
+
'href' => 'https://wpadvancedads.com/manual/ad-health/?utm_source=advanced-ads&utm_medium=link&utm_campaign=adhealth-adsense-auto-ads-found#Auto_ads_code_found',
|
323 |
+
'meta' => array(
|
324 |
+
'class' => 'hidden advanced_ads_ad_health_highlight_ads',
|
325 |
+
'target' => '_blank',
|
326 |
+
)
|
327 |
+
) );
|
328 |
|
329 |
/**
|
330 |
* Add new node.
|
542 |
|
543 |
<?php if( ! isset( $adsense_options['violation-warnings-disable'] ) ) : ?>
|
544 |
// show warning if AdSense ad is hidden
|
545 |
+
// show hint if AdSense Auto ads are enabled
|
546 |
setTimeout( function(){
|
547 |
advanced_ads_ready( advanced_ads_frontend_checks.advads_highlight_hidden_adsense );
|
548 |
+
advads_highlight_adsense_auto_ads();
|
549 |
}, 2000 );
|
550 |
|
|
|
551 |
// highlight AdSense Auto Ads ads 3 seconds after site loaded
|
552 |
setTimeout( function(){
|
553 |
advanced_ads_ready( advads_highlight_adsense_autoads )
|
569 |
}
|
570 |
advanced_ads_frontend_checks.showCount();
|
571 |
}
|
572 |
+
}
|
573 |
+
|
574 |
+
// inform the user that AdSense Auto ads code was found
|
575 |
+
function advads_highlight_adsense_auto_ads(){
|
576 |
+
var auto_ads_pattern = /enable_page_level_ads: true/m
|
577 |
+
if (auto_ads_pattern.exec( jQuery('body').text() ) ){
|
578 |
+
var advads_autoads_code_link = document.querySelector( '#wp-admin-bar-advanced_ads_ad_health_auto_ads_found' );
|
579 |
+
advads_autoads_code_link.className = advads_autoads_code_link.className.replace( 'hidden', '' );
|
580 |
+
}
|
581 |
}
|
582 |
<?php endif;
|
583 |
/**
|
modules/gadsense/admin/assets/js/mapi-settings.js
CHANGED
@@ -116,6 +116,9 @@
|
|
116 |
} );
|
117 |
|
118 |
$( function(){
|
|
|
|
|
|
|
119 |
if ( '' == $( '#adsense-id' ).val().trim() ) {
|
120 |
$( '#adsense #submit' ).parent().css( 'display', 'none' );
|
121 |
}
|
116 |
} );
|
117 |
|
118 |
$( function(){
|
119 |
+
// move the API connection code submission pop-up outside of the settings form
|
120 |
+
$( '#wpwrap' ).append( $( '#gadsense-modal' ) );
|
121 |
+
|
122 |
if ( '' == $( '#adsense-id' ).val().trim() ) {
|
123 |
$( '#adsense #submit' ).parent().css( 'display', 'none' );
|
124 |
}
|
modules/gadsense/admin/assets/js/new-ad.js
CHANGED
@@ -193,6 +193,27 @@
|
|
193 |
|
194 |
}
|
195 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
// On DOM ready
|
197 |
$(function () {
|
198 |
$( document ).on('click', '.advads-adsense-show-code', function(e){
|
@@ -271,6 +292,10 @@
|
|
271 |
advads_update_adsense_type();
|
272 |
});
|
273 |
|
|
|
|
|
|
|
|
|
274 |
function getRemoteCode( slotID ) {
|
275 |
|
276 |
if ( '' == slotID ) return;
|
@@ -732,14 +757,7 @@
|
|
732 |
$( document ).trigger( 'gadsenseUnitChanged' );
|
733 |
window.gadsenseFormatAdContent();
|
734 |
|
735 |
-
|
736 |
-
var position = $( '#advanced-ad-output-position input[name="advanced_ad[output][position]"]:checked' ).val();
|
737 |
-
if ( -1 !== ['responsive', 'link-responsive', 'matched-content', 'in-article', 'in-feed' ].indexOf( type ) && ( 'left' == position || 'right' == position ) ){
|
738 |
-
$('#ad-parameters-box-notices .advads-ad-notice-responsive-position').show();
|
739 |
-
} else {
|
740 |
-
$('#ad-parameters-box-notices .advads-ad-notice-responsive-position').hide();
|
741 |
-
}
|
742 |
-
|
743 |
}
|
744 |
|
745 |
advads_update_adsense_type();
|
193 |
|
194 |
}
|
195 |
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Show / hide position warning.
|
199 |
+
*/
|
200 |
+
function show_float_warnings( unit_type ) {
|
201 |
+
var resize_type = $('#ad-resize-type').val();
|
202 |
+
var position = $( '#advanced-ad-output-position input[name="advanced_ad[output][position]"]:checked' ).val();
|
203 |
+
|
204 |
+
if (
|
205 |
+
( -1 !== [ 'link-responsive', 'matched-content', 'in-article', 'in-feed' ].indexOf( unit_type )
|
206 |
+
|| ( 'responsive' === unit_type && 'manual' !== resize_type )
|
207 |
+
)
|
208 |
+
&& ( 'left' == position || 'right' == position )
|
209 |
+
) {
|
210 |
+
$('#ad-parameters-box-notices .advads-ad-notice-responsive-position').show();
|
211 |
+
} else {
|
212 |
+
$('#ad-parameters-box-notices .advads-ad-notice-responsive-position').hide();
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
// On DOM ready
|
218 |
$(function () {
|
219 |
$( document ).on('click', '.advads-adsense-show-code', function(e){
|
292 |
advads_update_adsense_type();
|
293 |
});
|
294 |
|
295 |
+
$( document ).on( 'change', '#ad-resize-type', function( ev ) {
|
296 |
+
show_float_warnings( 'responsive' );
|
297 |
+
} );
|
298 |
+
|
299 |
function getRemoteCode( slotID ) {
|
300 |
|
301 |
if ( '' == slotID ) return;
|
757 |
$( document ).trigger( 'gadsenseUnitChanged' );
|
758 |
window.gadsenseFormatAdContent();
|
759 |
|
760 |
+
show_float_warnings( type );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
761 |
}
|
762 |
|
763 |
advads_update_adsense_type();
|
modules/gadsense/admin/views/adsense-account.php
CHANGED
@@ -116,7 +116,7 @@ $has_token = Advanced_Ads_AdSense_MAPI::has_token( $adsense_id );
|
|
116 |
<div id="gadsense-modal-content-inner">
|
117 |
<i class="dashicons dashicons-dismiss"></i>
|
118 |
<label style="font-size:1.1em;font-weight:600;margin-bottom:.3em;display:block;"><?php _e( 'Please enter the confirmation code.', 'advanced-ads' ) ?></label>
|
119 |
-
<input type="text" class="widefat
|
120 |
<p><label><input type="checkbox" value="1" id="mapi-autoads"<?php echo ( $options['page-level-enabled'] ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Insert the AdSense header code used for verification and the Auto Ads feature.', 'advanced-ads' ) ?></label></p>
|
121 |
<p class="submit">
|
122 |
<button id="mapi-confirm-code" class="button-primary preventDefault"><?php _e( 'Submit code', 'advanced-ads' ) ?></button>
|
116 |
<div id="gadsense-modal-content-inner">
|
117 |
<i class="dashicons dashicons-dismiss"></i>
|
118 |
<label style="font-size:1.1em;font-weight:600;margin-bottom:.3em;display:block;"><?php _e( 'Please enter the confirmation code.', 'advanced-ads' ) ?></label>
|
119 |
+
<input type="text" class="widefat" id="mapi-code" value="" />
|
120 |
<p><label><input type="checkbox" value="1" id="mapi-autoads"<?php echo ( $options['page-level-enabled'] ) ? ' checked="checked"' : ''; ?> /> <?php _e( 'Insert the AdSense header code used for verification and the Auto Ads feature.', 'advanced-ads' ) ?></label></p>
|
121 |
<p class="submit">
|
122 |
<button id="mapi-confirm-code" class="button-primary preventDefault"><?php _e( 'Submit code', 'advanced-ads' ) ?></button>
|
modules/gadsense/includes/class-ad-type-adsense.php
CHANGED
@@ -214,10 +214,11 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
|
|
214 |
* A simple did_action check isn't sufficient, some hooks may be attached and fired but didn't touch the output
|
215 |
*/
|
216 |
$this->append_defaut_responsive_content( $output, $pub_id, $content );
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
-
// Remove float setting if this is a responsive ad unit without custom sizes.
|
220 |
-
unset( $ad->wrapper['style']['float'] );
|
221 |
}
|
222 |
|
223 |
|
214 |
* A simple did_action check isn't sufficient, some hooks may be attached and fired but didn't touch the output
|
215 |
*/
|
216 |
$this->append_defaut_responsive_content( $output, $pub_id, $content );
|
217 |
+
|
218 |
+
// Remove float setting if this is a responsive ad unit without custom sizes.
|
219 |
+
unset( $ad->wrapper['style']['float'] );
|
220 |
}
|
221 |
|
|
|
|
|
222 |
}
|
223 |
|
224 |
|
public/class-advanced-ads.php
CHANGED
@@ -189,6 +189,9 @@ class Advanced_Ads {
|
|
189 |
|
190 |
// add meta robots noindex, nofollow to images, which are part of 'Image ad' ad type.
|
191 |
add_action( 'wp_head', array( $this, 'noindex_attachment_images' ) );
|
|
|
|
|
|
|
192 |
|
193 |
// check if ads are disabled in secondary queries.
|
194 |
add_action( 'the_post', array( $this, 'set_query_type' ), 10, 2 );
|
@@ -780,6 +783,21 @@ class Advanced_Ads {
|
|
780 |
}
|
781 |
}
|
782 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
783 |
|
784 |
/**
|
785 |
* Supports the "$this->is_main_query=true" while main query is being executed
|
189 |
|
190 |
// add meta robots noindex, nofollow to images, which are part of 'Image ad' ad type.
|
191 |
add_action( 'wp_head', array( $this, 'noindex_attachment_images' ) );
|
192 |
+
|
193 |
+
// use custom CSS or other custom header code.
|
194 |
+
add_action( 'wp_head', array( $this, 'custom_header_code' ) );
|
195 |
|
196 |
// check if ads are disabled in secondary queries.
|
197 |
add_action( 'the_post', array( $this, 'set_query_type' ), 10, 2 );
|
783 |
}
|
784 |
}
|
785 |
}
|
786 |
+
|
787 |
+
/**
|
788 |
+
* Show custom CSS in the header
|
789 |
+
*
|
790 |
+
* @since 1.10.8
|
791 |
+
*/
|
792 |
+
public function custom_header_code(){
|
793 |
+
if( current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ){
|
794 |
+
?><style>
|
795 |
+
div.advads-edit-bar{position:relative;top:0;left:0;height:0;display:none;z-index:10000;}
|
796 |
+
a.advads-edit-button{position:absolute;top:0;left:0;text-decoration:none;border-bottom:none;color:#0074a2;margin-top:-5px;}
|
797 |
+
a.advads-edit-button span{top:10px;line-height:25px;margin-left:-5px;width:26px;height:26px;border-radius:13px;border:solid 1px #0074a2;background:#fff}
|
798 |
+
div:hover > .advads-edit-bar{display:block;}</style><?php
|
799 |
+
}
|
800 |
+
}
|
801 |
|
802 |
/**
|
803 |
* Supports the "$this->is_main_query=true" while main query is being executed
|
public/views/ad-edit-bar.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<div class="advads-edit-bar">
|
2 |
+
<a href="<?php echo get_edit_post_link( $this->id ); ?>" class="advads-edit-button" title="<?php echo $this->title; ?>"><span class="dashicons dashicons-edit"></span></a>
|
3 |
+
</div>
|
readme.txt
CHANGED
@@ -5,11 +5,11 @@ Tags: ads, ad manager, ad widget, ad rotation, adsense, advertise, advertisement
|
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 4.9
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 1.10.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
-
Manage and optimize your ads. All ad codes, AdSense Auto ads, ad widget, rotation, header and footer code injection, Google AdSense partner support
|
13 |
|
14 |
== Description ==
|
15 |
|
@@ -19,14 +19,13 @@ Are you looking for a simple ad manager plugin? These are the top arguments to u
|
|
19 |
* Google AdSense Partner
|
20 |
* most features to test and optimize ads
|
21 |
* unlimited ad units
|
22 |
-
*
|
23 |
-
*
|
24 |
-
* the only solution with *Ad Health* integration and AdSense violation checks
|
25 |
* best rated [free support](https://wordpress.org/support/plugin/advanced-ads)
|
26 |
|
27 |
Would you like to know if there is a certain feature, what the optimized setup would be, or how to implement your client’s demands? Just [open a thread in the forum](https://wordpress.org/support/plugin/advanced-ads#new-post)!
|
28 |
|
29 |
-
Based on my experience as a publisher with millions of monthly served ads, I've developed
|
30 |
|
31 |
[Full Feature List](https://wpadvancedads.com/features/).
|
32 |
|
@@ -34,7 +33,7 @@ Based on my experience as a publisher with millions of monthly served ads, I've
|
|
34 |
|
35 |
* create and display **unlimited** ad units
|
36 |
* rotate ads
|
37 |
-
* schedule ads and set
|
38 |
* target ads by content and user groups
|
39 |
* inject ads into posts and pages automatically without coding
|
40 |
* sell ads on your website automatically with the [Selling Ads add-on](https://wpadvancedads.com/add-ons/selling-ads/)
|
@@ -43,25 +42,26 @@ Based on my experience as a publisher with millions of monthly served ads, I've
|
|
43 |
|
44 |
choose between different ad types that enable you to:
|
45 |
|
46 |
-
* insert
|
47 |
* dedicated support for all types of Google AdSense banners, including Responsive, InFeed and InArticle ads
|
48 |
* display images and image banners
|
49 |
* create content-rich ads with the WordPress TinyMCE editor
|
50 |
-
* create Amazon ads with the Rich Content ad type and the [Amazon Associates Link Builder](https://wordpress.org/plugins/amazon-associates-link-builder/)
|
51 |
-
*
|
|
|
52 |
|
53 |
= display ads for WP =
|
54 |
|
55 |
* use functions to display ads in template files
|
56 |
* use shortcodes to place them manually in post content
|
57 |
-
* show ads in
|
58 |
* disable all ads on specific pages
|
59 |
* display multiple ads (ad blocks)
|
60 |
-
* display a customizable label, e.g., “Advertisements” above each banner ad
|
61 |
|
62 |
= display conditions =
|
63 |
|
64 |
-
show ads based on conditions like
|
65 |
|
66 |
* individual posts, pages, and other post types
|
67 |
* posts by category, tags, taxonomies, author, and age
|
@@ -74,7 +74,7 @@ show ads based on conditions like
|
|
74 |
|
75 |
= visitor conditions =
|
76 |
|
77 |
-
|
78 |
|
79 |
* display or hide a banner by device: mobile and tablet or desktop
|
80 |
* display or hide a banner by role and for logged in visitors
|
@@ -92,34 +92,38 @@ Placements to insert ads in pre-defined positions in your theme and content. [Li
|
|
92 |
* ads in the footer
|
93 |
* test placements against each other with [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/)
|
94 |
* many more ad positions with [add-ons](https://wpadvancedads.com/add-ons/)
|
95 |
-
*
|
96 |
|
97 |
= mobile devices =
|
98 |
|
99 |
* display ads on mobile and tablets or desktop only
|
100 |
* display responsive image ads
|
101 |
* ads for specific browser sizes only using [Responsive Ads](https://wpadvancedads.com/add-ons/responsive-ads/)
|
102 |
-
*
|
103 |
|
104 |
= Google AdSense =
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
*
|
109 |
-
*
|
110 |
-
*
|
111 |
-
*
|
112 |
-
*
|
113 |
-
*
|
114 |
-
*
|
115 |
-
*
|
116 |
-
*
|
|
|
|
|
|
|
|
|
117 |
|
118 |
= ad blocker =
|
119 |
|
120 |
-
* basic features to prevent ad
|
121 |
* prevent ad blockers from breaking sites where plugin scripts are running
|
122 |
-
* show alternative content to ad block users with [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/)
|
123 |
|
124 |
Learn more on the [plugin homepage](https://wpadvancedads.com).
|
125 |
|
@@ -131,12 +135,12 @@ Localizations: English, German, French, Spanish, Italian, Dutch, Portuguese, Jap
|
|
131 |
>
|
132 |
> * all add-ons include priority email support
|
133 |
> * [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/) – powerful tools for ad optimizations: cache-busting, more placements, lazy load, ad blocker module, click fraud, and more
|
134 |
-
> * [Selling Ads](https://wpadvancedads.com/add-ons/selling-ads/) - allows you to sell ads on your website fully automated, including payments and advertiser profiles.
|
135 |
> * [Geo Targeting](https://wpadvancedads.com/add-ons/geo-targeting/) – display ads based on geo location of the visitor
|
136 |
> * [Tracking](https://wpadvancedads.com/add-ons/tracking/) – ad tracking and statistics
|
137 |
> * [Responsive Ads](https://wpadvancedads.com/add-ons/responsive-ads/) – create mobile ads or ads for specific browser sizes and ads on AMP
|
138 |
> * [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/) – increase click rates with fixed, sticky, and anchor ads
|
139 |
> * [PopUp and Layer Ads](https://wpadvancedads.com/add-ons/popup-and-layer-ads/) – display ads and other content in layers and popups
|
|
|
140 |
> * [Slider](https://wpadvancedads.com/add-ons/slider/) – create a simple slider from your ads
|
141 |
|
142 |
If you have problems with Advanced Ads, please reach out to [our support](https://wordpress.org/support/plugin/advanced-ads).
|
@@ -249,6 +253,10 @@ You can still monetize those spots with custom content.
|
|
249 |
|
250 |
Read more about ad blockers and the features Advanced Ads has to deal with them [on this page](https://wpadvancedads.com/manual/ad-blockers/).
|
251 |
|
|
|
|
|
|
|
|
|
252 |
= I am a developer. Can I customize the plugin? =
|
253 |
|
254 |
Yes. Advanced Ads is based on WordPress standards and therefore easily customizable using either WordPress hooks or the ones we defined [here](https://wpadvancedads.com/codex/).
|
@@ -267,6 +275,13 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
|
|
267 |
|
268 |
== Changelog ==
|
269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
= 1.10.7 =
|
271 |
|
272 |
* reverted code optimization that broke some forms
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 4.9
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 1.10.8
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
+
Manage and optimize your ads. All ad codes, Google AdSense Auto ads, ad widget, rotation, header and footer code injection, Google AdSense partner support
|
13 |
|
14 |
== Description ==
|
15 |
|
19 |
* Google AdSense Partner
|
20 |
* most features to test and optimize ads
|
21 |
* unlimited ad units
|
22 |
+
* works with all ad types and networks (e.g. Google AdSense, Google Ad Manager, or Amazon ads)
|
23 |
+
* the only solution with *Ad Health* integration and Google AdSense violation checks
|
|
|
24 |
* best rated [free support](https://wordpress.org/support/plugin/advanced-ads)
|
25 |
|
26 |
Would you like to know if there is a certain feature, what the optimized setup would be, or how to implement your client’s demands? Just [open a thread in the forum](https://wordpress.org/support/plugin/advanced-ads#new-post)!
|
27 |
|
28 |
+
Based on my experience as a publisher with millions of monthly served ads, I've developed this ad management plugin for WordPress when no other solution offered testing and optimization features. It allowed us to grow to 100 MM monthly ad impressions. Benefit from this knowledge and monetize your website today!
|
29 |
|
30 |
[Full Feature List](https://wpadvancedads.com/features/).
|
31 |
|
33 |
|
34 |
* create and display **unlimited** ad units
|
35 |
* rotate ads
|
36 |
+
* schedule ads and set start time and expiration date
|
37 |
* target ads by content and user groups
|
38 |
* inject ads into posts and pages automatically without coding
|
39 |
* sell ads on your website automatically with the [Selling Ads add-on](https://wpadvancedads.com/add-ons/selling-ads/)
|
42 |
|
43 |
choose between different ad types that enable you to:
|
44 |
|
45 |
+
* insert ads content from all ad and affiliate networks (e.g., Google AdSense, Chitika, Amazon, BuySellAds, Google Ad Manager, DoubleClick (DFP), Ezoic, media.net, Booking.com, Tradedoubler, Awin, Getyourguide,...)
|
46 |
* dedicated support for all types of Google AdSense banners, including Responsive, InFeed and InArticle ads
|
47 |
* display images and image banners
|
48 |
* create content-rich ads with the WordPress TinyMCE editor
|
49 |
+
* create Amazon ads with the Rich Content ad type and the [Amazon Associates Link Builder](https://wordpress.org/plugins/amazon-associates-link-builder/) or insert contextual Amazon Native Shopping Ads
|
50 |
+
* inject HTML, CSS, Javascript or PHP code
|
51 |
+
* use shortcodes within ads (to also deliver advertisements from another ad plugin like Ad Inserter, AdRotate, Quick AdSense, WP Bannerize, or the Google AdSense Plugin WP QUADS)
|
52 |
|
53 |
= display ads for WP =
|
54 |
|
55 |
* use functions to display ads in template files
|
56 |
* use shortcodes to place them manually in post content
|
57 |
+
* show ads in the sidebar and in widgets
|
58 |
* disable all ads on specific pages
|
59 |
* display multiple ads (ad blocks)
|
60 |
+
* display a customizable ad label, e.g., “Advertisements” above each banner ad
|
61 |
|
62 |
= display conditions =
|
63 |
|
64 |
+
show ads based on conditions like:
|
65 |
|
66 |
* individual posts, pages, and other post types
|
67 |
* posts by category, tags, taxonomies, author, and age
|
74 |
|
75 |
= visitor conditions =
|
76 |
|
77 |
+
serve ads by conditions based on the visitor. [List of all visitor conditions](https://wpadvancedads.com/manual/visitor-conditions/)
|
78 |
|
79 |
* display or hide a banner by device: mobile and tablet or desktop
|
80 |
* display or hide a banner by role and for logged in visitors
|
92 |
* ads in the footer
|
93 |
* test placements against each other with [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/)
|
94 |
* many more ad positions with [add-ons](https://wpadvancedads.com/add-ons/)
|
95 |
+
* automatic insertion of any kind of code into header or footer, not only advertising
|
96 |
|
97 |
= mobile devices =
|
98 |
|
99 |
* display ads on mobile and tablets or desktop only
|
100 |
* display responsive image ads
|
101 |
* ads for specific browser sizes only using [Responsive Ads](https://wpadvancedads.com/add-ons/responsive-ads/)
|
102 |
+
* inserting ads on AMP pages with [Responsive Ads](https://wpadvancedads.com/add-ons/responsive-ads/)
|
103 |
|
104 |
= Google AdSense =
|
105 |
|
106 |
+
Amazing features of the most powerful and easy Google AdSense plugin.
|
107 |
+
|
108 |
+
* pull ad units directly from your Google AdSense account
|
109 |
+
* supports all Google AdSense ad types, including Google AdSense display ads, AdSense link units, native ads like Google AdSense In-feed ads, Google AdSense In-article ads, and Google AdSense matched content ads
|
110 |
+
* change type and sizes of an ad without going into your Google AdSense account
|
111 |
+
* optional limit to 3 Google AdSense ads banners
|
112 |
+
* hide Google AdSense advertisements on 404 pages by default (to comply with Google AdSense terms)
|
113 |
+
* insert Google AdSense code for verification and AdSense Auto Ads (previously called Page-Level ads and QuickStart)
|
114 |
+
* easy Ad Health integration and Google AdSense violation checks
|
115 |
+
* option to make the Google AdSense background transparent
|
116 |
+
* place Google AdSense In-feed ads using the also free [In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/)
|
117 |
+
* assistant for exact sizes of responsive AdSense code with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
|
118 |
+
* convert Google AdSense ads into AMP ads automatically with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
|
119 |
+
|
120 |
+
https://vimeo.com/299410390
|
121 |
|
122 |
= ad blocker =
|
123 |
|
124 |
+
* basic features to prevent ad units from being removed by AdBlock and others
|
125 |
* prevent ad blockers from breaking sites where plugin scripts are running
|
126 |
+
* ad blocking detection: show alternative content to ad block users with [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/) and improve the monetization of your website
|
127 |
|
128 |
Learn more on the [plugin homepage](https://wpadvancedads.com).
|
129 |
|
135 |
>
|
136 |
> * all add-ons include priority email support
|
137 |
> * [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/) – powerful tools for ad optimizations: cache-busting, more placements, lazy load, ad blocker module, click fraud, and more
|
|
|
138 |
> * [Geo Targeting](https://wpadvancedads.com/add-ons/geo-targeting/) – display ads based on geo location of the visitor
|
139 |
> * [Tracking](https://wpadvancedads.com/add-ons/tracking/) – ad tracking and statistics
|
140 |
> * [Responsive Ads](https://wpadvancedads.com/add-ons/responsive-ads/) – create mobile ads or ads for specific browser sizes and ads on AMP
|
141 |
> * [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/) – increase click rates with fixed, sticky, and anchor ads
|
142 |
> * [PopUp and Layer Ads](https://wpadvancedads.com/add-ons/popup-and-layer-ads/) – display ads and other content in layers and popups
|
143 |
+
> * [Selling Ads](https://wpadvancedads.com/add-ons/selling-ads/) - allows you to sell ads on your website fully automated, including payments and advertiser profiles.
|
144 |
> * [Slider](https://wpadvancedads.com/add-ons/slider/) – create a simple slider from your ads
|
145 |
|
146 |
If you have problems with Advanced Ads, please reach out to [our support](https://wordpress.org/support/plugin/advanced-ads).
|
253 |
|
254 |
Read more about ad blockers and the features Advanced Ads has to deal with them [on this page](https://wpadvancedads.com/manual/ad-blockers/).
|
255 |
|
256 |
+
= Does the plugin supports an ads.txt? =
|
257 |
+
|
258 |
+
Google AdSense and some other networks ask you to provide an ads.txt. You can create and integrate this file easily with [this plugin](https://wordpress.org/plugins/ads-txt/).
|
259 |
+
|
260 |
= I am a developer. Can I customize the plugin? =
|
261 |
|
262 |
Yes. Advanced Ads is based on WordPress standards and therefore easily customizable using either WordPress hooks or the ones we defined [here](https://wpadvancedads.com/codex/).
|
275 |
|
276 |
== Changelog ==
|
277 |
|
278 |
+
= 1.10.8 =
|
279 |
+
|
280 |
+
* show hint if Auto ads are enabled
|
281 |
+
* allow responsive Adsense ads with custom sizes to be floated
|
282 |
+
* show an advice if user does not have permissions to edit ads
|
283 |
+
* fixed AdSense key overlay not accepting copy&paste in Safari and Firefox
|
284 |
+
|
285 |
= 1.10.7 =
|
286 |
|
287 |
* reverted code optimization that broke some forms
|