Version Description
- added link to get help in some error notices
- fixed error caused by ads.txt module on multisites that use WordPress lower then 5.1
- fixed compatibility with Gutenberg plugin
Download this release
Release Info
Developer | webzunft |
Plugin | Advanced Ads |
Version | 1.13.3 |
Comparing to | |
See all releases |
Code changes from version 1.13.2 to 1.13.3
- admin/assets/js/admin.js +4 -0
- admin/includes/ad-health-notices.php +5 -2
- advanced-ads.php +2 -2
- classes/ad-health-notices.php +25 -0
- modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php +1 -2
- modules/ads-txt/main.php +9 -5
- modules/ads-txt/public/class-advanced-ads-ads-txt-public.php +0 -4
- modules/gadsense/includes/class-mapi.php +33 -0
- modules/gutenberg/includes/class-gutenberg.php +1 -1
- readme.txt +9 -1
admin/assets/js/admin.js
CHANGED
@@ -856,6 +856,10 @@ function advads_ads_txt_find_issues() {
|
|
856 |
var $wrapper = jQuery( '#advads-ads-txt-notice-wrapper' );
|
857 |
var $refresh = jQuery( '#advads-ads-txt-notice-refresh' );
|
858 |
|
|
|
|
|
|
|
|
|
859 |
if ( ! $wrapper.find( 'ul' ).length ) {
|
860 |
load();
|
861 |
}
|
856 |
var $wrapper = jQuery( '#advads-ads-txt-notice-wrapper' );
|
857 |
var $refresh = jQuery( '#advads-ads-txt-notice-refresh' );
|
858 |
|
859 |
+
if ( ! $wrapper.length ) {
|
860 |
+
return;
|
861 |
+
}
|
862 |
+
|
863 |
if ( ! $wrapper.find( 'ul' ).length ) {
|
864 |
load();
|
865 |
}
|
admin/includes/ad-health-notices.php
CHANGED
@@ -146,6 +146,7 @@ $advanced_ads_ad_health_notices = apply_filters( 'advanced-ads-ad-health-notices
|
|
146 |
),
|
147 |
'type' => 'notice',
|
148 |
'hide' => false,
|
|
|
149 |
),
|
150 |
// ad AdSense ad was hidden in the frontend using CSS
|
151 |
// check in Ad Health in frontend.
|
@@ -158,6 +159,7 @@ $advanced_ads_ad_health_notices = apply_filters( 'advanced-ads-ad-health-notices
|
|
158 |
),
|
159 |
'type' => 'problem',
|
160 |
'hide' => false,
|
|
|
161 |
),
|
162 |
// Ad has HTTP, but site uses HTTPS
|
163 |
// check in Ad Health in frontend.
|
@@ -165,6 +167,7 @@ $advanced_ads_ad_health_notices = apply_filters( 'advanced-ads-ad-health-notices
|
|
165 |
'text' => __( 'Your website is using HTTPS, but the ad code contains HTTP and might not work.', 'advanced-ads' ),
|
166 |
'type' => 'notice',
|
167 |
'hide' => false,
|
|
|
168 |
),
|
169 |
// dummy text for general AdSense issue.
|
170 |
'adsense_issue' => array(
|
@@ -180,14 +183,14 @@ $advanced_ads_ad_health_notices = apply_filters( 'advanced-ads-ad-health-notices
|
|
180 |
),
|
181 |
// AdSense connection error: disapproved account.
|
182 |
'adsense_connect_disapprovedAccount' => array(
|
183 |
-
'text' => __( 'Last AdSense account connection attempt failed.', 'advanced-ads' ) .' ' . __('Your account was not approved by AdSense.', 'advance-ads' ) . ' ' . Advanced_Ads_Ad_Health_Notices::get_adsense_error_link( 'disapprovedAccount' ),
|
184 |
'type' => 'problem',
|
185 |
'hide' => false,
|
186 |
),
|
187 |
// AdSense connection error: no adsense account.
|
188 |
'adsense_connect_noAdSenseAccount' => array(
|
189 |
'text' => sprintf(
|
190 |
-
__( 'Last AdSense account connection attempt failed.', 'advanced-ads' ) .' ' . __('Create a new AdSense account %1$shere%2$s.', 'advance-ads' ) . ' ' . Advanced_Ads_Ad_Health_Notices::get_adsense_error_link( 'noAdSenseAccount' ),
|
191 |
'<a href="https://www.google.com/adsense/start/?utm_source=AdvancedAdsPlugIn&utm_medium=partnerships&utm_campaign=AdvancedAdsPartner" target="_blank">',
|
192 |
'</a>'
|
193 |
),
|
146 |
),
|
147 |
'type' => 'notice',
|
148 |
'hide' => false,
|
149 |
+
'get_help_link' => ADVADS_URL . 'manual/ad-health/?utm_source=advanced-ads&utm_medium=link&utm_campaign=error-visible-ad-in-header#header-ads',
|
150 |
),
|
151 |
// ad AdSense ad was hidden in the frontend using CSS
|
152 |
// check in Ad Health in frontend.
|
159 |
),
|
160 |
'type' => 'problem',
|
161 |
'hide' => false,
|
162 |
+
'get_help_link' => ADVADS_URL . 'adsense-errors/?utm_source=advanced-ads&utm_medium=link&utm_campaign=error-adsense-hidden#AdSense_hidden',
|
163 |
),
|
164 |
// Ad has HTTP, but site uses HTTPS
|
165 |
// check in Ad Health in frontend.
|
167 |
'text' => __( 'Your website is using HTTPS, but the ad code contains HTTP and might not work.', 'advanced-ads' ),
|
168 |
'type' => 'notice',
|
169 |
'hide' => false,
|
170 |
+
'get_help_link' => ADVADS_URL . 'manual/ad-health/?utm_source=advanced-ads&utm_medium=link&utm_campaign=error-https-ads#https-ads',
|
171 |
),
|
172 |
// dummy text for general AdSense issue.
|
173 |
'adsense_issue' => array(
|
183 |
),
|
184 |
// AdSense connection error: disapproved account.
|
185 |
'adsense_connect_disapprovedAccount' => array(
|
186 |
+
'text' => __( 'Last AdSense account connection attempt failed.', 'advanced-ads' ) . ' ' . __( 'Your account was not approved by AdSense.', 'advance-ads' ) . ' ' . Advanced_Ads_Ad_Health_Notices::get_adsense_error_link( 'disapprovedAccount' ),
|
187 |
'type' => 'problem',
|
188 |
'hide' => false,
|
189 |
),
|
190 |
// AdSense connection error: no adsense account.
|
191 |
'adsense_connect_noAdSenseAccount' => array(
|
192 |
'text' => sprintf(
|
193 |
+
__( 'Last AdSense account connection attempt failed.', 'advanced-ads' ) . ' ' . __( 'Create a new AdSense account %1$shere%2$s.', 'advance-ads' ) . ' ' . Advanced_Ads_Ad_Health_Notices::get_adsense_error_link( 'noAdSenseAccount' ),
|
194 |
'<a href="https://www.google.com/adsense/start/?utm_source=AdvancedAdsPlugIn&utm_medium=partnerships&utm_campaign=AdvancedAdsPartner" target="_blank">',
|
195 |
'</a>'
|
196 |
),
|
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.13.
|
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.13.
|
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.13.3
|
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.13.3' );
|
43 |
|
44 |
/*----------------------------------------------------------------------------*
|
45 |
* Autoloading, modules and functions
|
classes/ad-health-notices.php
CHANGED
@@ -535,6 +535,13 @@ class Advanced_Ads_Ad_Health_Notices {
|
|
535 |
$text .= $_notice['append_text'];
|
536 |
}
|
537 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
538 |
$can_hide = ( ! isset( $notice_array['can_hide'] ) || true === $notice_array['can_hide'] ) ? true : false;
|
539 |
$hide = ( ! isset( $notice_array['hide'] ) || true === $notice_array['hide'] ) ? true : false;
|
540 |
$is_hidden = in_array( $_notice_key, $this->ignore, true ) ? true : false;
|
@@ -754,5 +761,23 @@ class Advanced_Ads_Ad_Health_Notices {
|
|
754 |
return $link;
|
755 |
}
|
756 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
757 |
|
758 |
}
|
535 |
$text .= $_notice['append_text'];
|
536 |
}
|
537 |
|
538 |
+
// attach "get help" link.
|
539 |
+
if ( ! empty( $_notice['get_help_link'] ) ) {
|
540 |
+
$text .= $this->get_help_link( $_notice['get_help_link'] );
|
541 |
+
} elseif ( isset( $notice_array['get_help_link'] ) ) {
|
542 |
+
$text .= $this->get_help_link( $notice_array['get_help_link'] );
|
543 |
+
}
|
544 |
+
|
545 |
$can_hide = ( ! isset( $notice_array['can_hide'] ) || true === $notice_array['can_hide'] ) ? true : false;
|
546 |
$hide = ( ! isset( $notice_array['hide'] ) || true === $notice_array['hide'] ) ? true : false;
|
547 |
$is_hidden = in_array( $_notice_key, $this->ignore, true ) ? true : false;
|
761 |
return $link;
|
762 |
}
|
763 |
|
764 |
+
/**
|
765 |
+
* Return a "Get Help" link
|
766 |
+
*
|
767 |
+
* @param string $link target URL.
|
768 |
+
*
|
769 |
+
* @return string HTML of the target link
|
770 |
+
*/
|
771 |
+
public function get_help_link( $link ) {
|
772 |
+
|
773 |
+
$link = esc_url( $link );
|
774 |
+
|
775 |
+
if ( ! $link ) {
|
776 |
+
return '';
|
777 |
+
}
|
778 |
+
|
779 |
+
return ' <a href="' . $link . '" target="_blank">' . __( 'Get help', 'advanced.ads' ) . '</a>';
|
780 |
+
}
|
781 |
+
|
782 |
|
783 |
}
|
modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php
CHANGED
@@ -141,8 +141,7 @@ class Advanced_Ads_Ads_Txt_Admin {
|
|
141 |
private function can_process_all_network() {
|
142 |
return ! Advanced_Ads_Ads_Txt_Utils::is_subdir()
|
143 |
&& is_super_admin()
|
144 |
-
&& is_multisite()
|
145 |
-
&& function_exists( 'is_site_meta_supported' ) && is_site_meta_supported();
|
146 |
}
|
147 |
|
148 |
/**
|
141 |
private function can_process_all_network() {
|
142 |
return ! Advanced_Ads_Ads_Txt_Utils::is_subdir()
|
143 |
&& is_super_admin()
|
144 |
+
&& is_multisite();
|
|
|
145 |
}
|
146 |
|
147 |
/**
|
modules/ads-txt/main.php
CHANGED
@@ -7,9 +7,13 @@
|
|
7 |
|
8 |
class_exists( 'Advanced_Ads', false ) || exit();
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
15 |
}
|
7 |
|
8 |
class_exists( 'Advanced_Ads', false ) || exit();
|
9 |
|
10 |
+
if (
|
11 |
+
! is_multisite()
|
12 |
+
|| ( function_exists( 'is_site_meta_supported' ) && is_site_meta_supported() )
|
13 |
+
) {
|
14 |
+
if ( is_admin() ) {
|
15 |
+
new Advanced_Ads_Ads_Txt_Admin( new Advanced_Ads_Ads_Txt_Strategy() );
|
16 |
+
} else {
|
17 |
+
new Advanced_Ads_Ads_Txt_Public( new Advanced_Ads_Ads_Txt_Strategy() );
|
18 |
+
}
|
19 |
}
|
modules/ads-txt/public/class-advanced-ads-ads-txt-public.php
CHANGED
@@ -63,10 +63,6 @@ class Advanced_Ads_Ads_Txt_Public {
|
|
63 |
* @return string
|
64 |
*/
|
65 |
public function prepare_multisite( $domain = null ) {
|
66 |
-
if ( ! function_exists( 'is_site_meta_supported' ) || ! is_site_meta_supported() ) {
|
67 |
-
return;
|
68 |
-
}
|
69 |
-
|
70 |
global $current_blog, $wpdb;
|
71 |
$domain = $domain ? $domain : $current_blog->domain;
|
72 |
$need_file_on_root_domain = Advanced_Ads_Ads_Txt_Utils::need_file_on_root_domain();
|
63 |
* @return string
|
64 |
*/
|
65 |
public function prepare_multisite( $domain = null ) {
|
|
|
|
|
|
|
|
|
66 |
global $current_blog, $wpdb;
|
67 |
$domain = $domain ? $domain : $current_blog->domain;
|
68 |
$need_file_on_root_domain = Advanced_Ads_Ads_Txt_Utils::need_file_on_root_domain();
|
modules/gadsense/includes/class-mapi.php
CHANGED
@@ -161,6 +161,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
161 |
*/
|
162 |
public function ajax_dismiss_connect_error() {
|
163 |
$nonce = isset( $_GET['nonce'] ) ? $_GET['nonce'] : '';
|
|
|
|
|
|
|
164 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
165 |
$options = self::get_option();
|
166 |
$options['connect_error'] = array();
|
@@ -546,6 +549,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
546 |
public function ajax_revoke_tokken() {
|
547 |
|
548 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
|
|
|
|
|
|
549 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
550 |
$adsense_id = stripslashes( $_POST['adsenseId'] );
|
551 |
$options = self::get_option();
|
@@ -583,6 +589,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
583 |
*/
|
584 |
public function ajax_save_reconstructed_code() {
|
585 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
|
|
|
|
|
|
586 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
587 |
$code = stripslashes( $_POST['code'] );
|
588 |
$slot = stripslashes( $_POST['slot'] );
|
@@ -601,6 +610,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
601 |
* Get ad code for a given unit
|
602 |
*/
|
603 |
public function ajax_get_adCode() {
|
|
|
|
|
|
|
604 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
605 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
606 |
$unit = stripslashes( $_POST['unit'] );
|
@@ -660,6 +672,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
660 |
* Dismiss an account alert
|
661 |
*/
|
662 |
public function ajax_dismiss_alert() {
|
|
|
|
|
|
|
663 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
664 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
665 |
$account = stripslashes( $_POST['account'] );
|
@@ -692,6 +707,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
692 |
* Get / Update the list of alerts on an AdSense account.
|
693 |
*/
|
694 |
public function ajax_get_account_alerts() {
|
|
|
|
|
|
|
695 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
696 |
if ( false !== wp_verify_nonce( $nonce, 'mapi-alerts' ) ) {
|
697 |
$account = stripslashes( $_POST['account'] );
|
@@ -776,6 +794,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
776 |
* Show / Hide idle ads on the ad list table.
|
777 |
*/
|
778 |
public function ajax_toggle_idle_ads() {
|
|
|
|
|
|
|
779 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
780 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
781 |
|
@@ -799,6 +820,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
799 |
* Get / Update the ad unit list for a given ad client. The corresponding <select /> input used in the ad selector is passed as a fied of an array
|
800 |
*/
|
801 |
public function ajax_get_adUnits() {
|
|
|
|
|
|
|
802 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
803 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
804 |
$account = stripslashes( $_POST['account'] );
|
@@ -842,6 +866,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
842 |
* Save account and token after account selection MCN.
|
843 |
*/
|
844 |
public function ajax_account_selected() {
|
|
|
|
|
|
|
845 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
846 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
847 |
$token_data = wp_unslash( $_POST['token_data'] );
|
@@ -882,6 +909,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
882 |
* Get AdSense account details from a new access token.
|
883 |
*/
|
884 |
public function ajax_get_account_details() {
|
|
|
|
|
|
|
885 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
886 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
887 |
|
@@ -995,6 +1025,9 @@ class Advanced_Ads_AdSense_MAPI {
|
|
995 |
* Submit Google API confirmation code. Save the token and update ad client list.
|
996 |
*/
|
997 |
public function ajax_confirm_code() {
|
|
|
|
|
|
|
998 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
999 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
1000 |
$code = urldecode( $_POST['code'] );
|
161 |
*/
|
162 |
public function ajax_dismiss_connect_error() {
|
163 |
$nonce = isset( $_GET['nonce'] ) ? $_GET['nonce'] : '';
|
164 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
165 |
+
die;
|
166 |
+
}
|
167 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
168 |
$options = self::get_option();
|
169 |
$options['connect_error'] = array();
|
549 |
public function ajax_revoke_tokken() {
|
550 |
|
551 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
552 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
553 |
+
die;
|
554 |
+
}
|
555 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
556 |
$adsense_id = stripslashes( $_POST['adsenseId'] );
|
557 |
$options = self::get_option();
|
589 |
*/
|
590 |
public function ajax_save_reconstructed_code() {
|
591 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
592 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) ) {
|
593 |
+
die;
|
594 |
+
}
|
595 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
596 |
$code = stripslashes( $_POST['code'] );
|
597 |
$slot = stripslashes( $_POST['slot'] );
|
610 |
* Get ad code for a given unit
|
611 |
*/
|
612 |
public function ajax_get_adCode() {
|
613 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) ) {
|
614 |
+
die;
|
615 |
+
}
|
616 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
617 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
618 |
$unit = stripslashes( $_POST['unit'] );
|
672 |
* Dismiss an account alert
|
673 |
*/
|
674 |
public function ajax_dismiss_alert() {
|
675 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
676 |
+
die;
|
677 |
+
}
|
678 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
679 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
680 |
$account = stripslashes( $_POST['account'] );
|
707 |
* Get / Update the list of alerts on an AdSense account.
|
708 |
*/
|
709 |
public function ajax_get_account_alerts() {
|
710 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
711 |
+
die;
|
712 |
+
}
|
713 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
714 |
if ( false !== wp_verify_nonce( $nonce, 'mapi-alerts' ) ) {
|
715 |
$account = stripslashes( $_POST['account'] );
|
794 |
* Show / Hide idle ads on the ad list table.
|
795 |
*/
|
796 |
public function ajax_toggle_idle_ads() {
|
797 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) ) {
|
798 |
+
die;
|
799 |
+
}
|
800 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
801 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
802 |
|
820 |
* Get / Update the ad unit list for a given ad client. The corresponding <select /> input used in the ad selector is passed as a fied of an array
|
821 |
*/
|
822 |
public function ajax_get_adUnits() {
|
823 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) ) {
|
824 |
+
die;
|
825 |
+
}
|
826 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
827 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
828 |
$account = stripslashes( $_POST['account'] );
|
866 |
* Save account and token after account selection MCN.
|
867 |
*/
|
868 |
public function ajax_account_selected() {
|
869 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
870 |
+
die;
|
871 |
+
}
|
872 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
873 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
874 |
$token_data = wp_unslash( $_POST['token_data'] );
|
909 |
* Get AdSense account details from a new access token.
|
910 |
*/
|
911 |
public function ajax_get_account_details() {
|
912 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
913 |
+
die;
|
914 |
+
}
|
915 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
916 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
917 |
|
1025 |
* Submit Google API confirmation code. Save the token and update ad client list.
|
1026 |
*/
|
1027 |
public function ajax_confirm_code() {
|
1028 |
+
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
|
1029 |
+
die;
|
1030 |
+
}
|
1031 |
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
1032 |
if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
|
1033 |
$code = urldecode( $_POST['code'] );
|
modules/gutenberg/includes/class-gutenberg.php
CHANGED
@@ -97,7 +97,7 @@ class Advanced_Ads_Gutenberg {
|
|
97 |
|
98 |
// put the inline code with the global variable right before the block's JS file
|
99 |
wp_add_inline_script( ADVADS_BASE . '/gutenberg-ad', 'var advadsGutenberg = ' . $inline_script, 'before' );
|
100 |
-
|
101 |
}
|
102 |
|
103 |
/**
|
97 |
|
98 |
// put the inline code with the global variable right before the block's JS file
|
99 |
wp_add_inline_script( ADVADS_BASE . '/gutenberg-ad', 'var advadsGutenberg = ' . $inline_script, 'before' );
|
100 |
+
wp_enqueue_script( ADVADS_BASE . '/gutenberg-ad' );
|
101 |
}
|
102 |
|
103 |
/**
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: ads, ad manager, ad rotation, adsense, banner
|
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 1.13.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -127,6 +127,8 @@ Amazing features of the most powerful and easy Google AdSense plugin.
|
|
127 |
* generates ads.txt with custom content
|
128 |
* adds the content for AdSense to the ads.txt automatically
|
129 |
|
|
|
|
|
130 |
https://vimeo.com/299410390
|
131 |
|
132 |
= ad blocker =
|
@@ -286,6 +288,12 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
|
|
286 |
|
287 |
== Changelog ==
|
288 |
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
= 1.13.2 =
|
290 |
|
291 |
* added AdSense ad slot ID to "AdSense hidden" warning
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 1.13.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
127 |
* generates ads.txt with custom content
|
128 |
* adds the content for AdSense to the ads.txt automatically
|
129 |
|
130 |
+
(available with WordPress 5.1)
|
131 |
+
|
132 |
https://vimeo.com/299410390
|
133 |
|
134 |
= ad blocker =
|
288 |
|
289 |
== Changelog ==
|
290 |
|
291 |
+
= 1.13.3 =
|
292 |
+
|
293 |
+
* added link to get help in some error notices
|
294 |
+
* fixed error caused by ads.txt module on multisites that use WordPress lower then 5.1
|
295 |
+
* fixed compatibility with Gutenberg plugin
|
296 |
+
|
297 |
= 1.13.2 =
|
298 |
|
299 |
* added AdSense ad slot ID to "AdSense hidden" warning
|