Version Description
- fixed issue with PHP 7.1 and higher
Download this release
Release Info
Developer | webzunft |
Plugin | Advanced Ads |
Version | 1.13.1 |
Comparing to | |
See all releases |
Code changes from version 1.13 to 1.13.1
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.1
|
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.1' );
|
43 |
|
44 |
/*----------------------------------------------------------------------------*
|
45 |
* Autoloading, modules and functions
|
modules/ads-txt/admin/views/setting-create.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
</p>
|
25 |
<p class="description">
|
26 |
<?php
|
27 |
-
esc_html_e( 'Usually, this should be enabled on the main site of the network - often the one without a subdomain or subdirectory
|
28 |
?>
|
29 |
</p>
|
30 |
<?php endif; ?>
|
24 |
</p>
|
25 |
<p class="description">
|
26 |
<?php
|
27 |
+
esc_html_e( 'Usually, this should be enabled on the main site of the network - often the one without a subdomain or subdirectory.', 'advanced-ads' );
|
28 |
?>
|
29 |
</p>
|
30 |
<?php endif; ?>
|
modules/ads-txt/includes/class-advanced-ads-ads-txt-strategy.php
CHANGED
@@ -21,6 +21,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
21 |
*/
|
22 |
public function is_all_network() {
|
23 |
$options = $this->get_options();
|
|
|
24 |
return is_multisite() && $options['all_network'];
|
25 |
}
|
26 |
|
@@ -31,6 +32,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
31 |
*/
|
32 |
public function is_enabled() {
|
33 |
$this->options = $this->get_options();
|
|
|
34 |
return $this->options['enabled'];
|
35 |
}
|
36 |
|
@@ -41,6 +43,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
41 |
*/
|
42 |
public function get_additional_content() {
|
43 |
$options = $this->get_options();
|
|
|
44 |
return $options['custom'];
|
45 |
}
|
46 |
|
@@ -56,13 +59,14 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
56 |
$additional_content = array_filter( array_map( 'trim', $additional_content ) );
|
57 |
$additional_content = implode( "\n", $additional_content );
|
58 |
|
59 |
-
$this->options['enabled']
|
60 |
$this->options['all_network'] = $all_network;
|
61 |
-
$this->options['custom']
|
62 |
|
63 |
if ( $this->options !== $prev ) {
|
64 |
$this->changed = true;
|
65 |
}
|
|
|
66 |
return true;
|
67 |
}
|
68 |
|
@@ -71,6 +75,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
71 |
*
|
72 |
* @param string $id Ad network id.
|
73 |
* @param string $rec A Record to add.
|
|
|
74 |
* @return bool
|
75 |
*/
|
76 |
public function add_network_data( $id, $rec ) {
|
@@ -81,6 +86,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
81 |
if ( $this->options !== $prev ) {
|
82 |
$this->changed = true;
|
83 |
}
|
|
|
84 |
return true;
|
85 |
|
86 |
}
|
@@ -89,6 +95,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
89 |
* Prepare content of a blog for output.
|
90 |
*
|
91 |
* @param array $options Options.
|
|
|
92 |
* @return string
|
93 |
*/
|
94 |
public function parse_content( $options ) {
|
@@ -101,7 +108,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
101 |
}
|
102 |
|
103 |
if ( ! empty( $options['custom'] ) ) {
|
104 |
-
$o .= $options['custom']
|
105 |
}
|
106 |
|
107 |
return $o;
|
@@ -132,6 +139,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
132 |
|
133 |
$this->changed = false;
|
134 |
delete_transient( Advanced_Ads_Ads_Txt_Utils::TRANSIENT );
|
|
|
135 |
return true;
|
136 |
}
|
137 |
|
@@ -148,9 +156,13 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
148 |
if ( is_multisite() ) {
|
149 |
$options = get_site_meta( get_current_blog_id(), self::OPTION, true );
|
150 |
} else {
|
151 |
-
$options = get_option( self::OPTION );
|
|
|
|
|
|
|
152 |
}
|
153 |
$this->options = $this->load_default_options( $options );
|
|
|
154 |
return $this->options;
|
155 |
}
|
156 |
|
@@ -158,6 +170,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
158 |
* Load default options.
|
159 |
*
|
160 |
* @param array $options Options.
|
|
|
161 |
* @return array
|
162 |
*/
|
163 |
public function load_default_options( $options ) {
|
@@ -173,6 +186,7 @@ class Advanced_Ads_Ads_Txt_Strategy {
|
|
173 |
if ( ! isset( $options['networks'] ) || ! is_array( $options['networks'] ) ) {
|
174 |
$options['networks'] = array();
|
175 |
}
|
|
|
176 |
return $options;
|
177 |
}
|
178 |
|
21 |
*/
|
22 |
public function is_all_network() {
|
23 |
$options = $this->get_options();
|
24 |
+
|
25 |
return is_multisite() && $options['all_network'];
|
26 |
}
|
27 |
|
32 |
*/
|
33 |
public function is_enabled() {
|
34 |
$this->options = $this->get_options();
|
35 |
+
|
36 |
return $this->options['enabled'];
|
37 |
}
|
38 |
|
43 |
*/
|
44 |
public function get_additional_content() {
|
45 |
$options = $this->get_options();
|
46 |
+
|
47 |
return $options['custom'];
|
48 |
}
|
49 |
|
59 |
$additional_content = array_filter( array_map( 'trim', $additional_content ) );
|
60 |
$additional_content = implode( "\n", $additional_content );
|
61 |
|
62 |
+
$this->options['enabled'] = $is_enabled;
|
63 |
$this->options['all_network'] = $all_network;
|
64 |
+
$this->options['custom'] = $additional_content;
|
65 |
|
66 |
if ( $this->options !== $prev ) {
|
67 |
$this->changed = true;
|
68 |
}
|
69 |
+
|
70 |
return true;
|
71 |
}
|
72 |
|
75 |
*
|
76 |
* @param string $id Ad network id.
|
77 |
* @param string $rec A Record to add.
|
78 |
+
*
|
79 |
* @return bool
|
80 |
*/
|
81 |
public function add_network_data( $id, $rec ) {
|
86 |
if ( $this->options !== $prev ) {
|
87 |
$this->changed = true;
|
88 |
}
|
89 |
+
|
90 |
return true;
|
91 |
|
92 |
}
|
95 |
* Prepare content of a blog for output.
|
96 |
*
|
97 |
* @param array $options Options.
|
98 |
+
*
|
99 |
* @return string
|
100 |
*/
|
101 |
public function parse_content( $options ) {
|
108 |
}
|
109 |
|
110 |
if ( ! empty( $options['custom'] ) ) {
|
111 |
+
$o .= $options['custom'] . "\n";
|
112 |
}
|
113 |
|
114 |
return $o;
|
139 |
|
140 |
$this->changed = false;
|
141 |
delete_transient( Advanced_Ads_Ads_Txt_Utils::TRANSIENT );
|
142 |
+
|
143 |
return true;
|
144 |
}
|
145 |
|
156 |
if ( is_multisite() ) {
|
157 |
$options = get_site_meta( get_current_blog_id(), self::OPTION, true );
|
158 |
} else {
|
159 |
+
$options = get_option( self::OPTION, array() );
|
160 |
+
}
|
161 |
+
if ( ! is_array( $options ) ) {
|
162 |
+
$options = array();
|
163 |
}
|
164 |
$this->options = $this->load_default_options( $options );
|
165 |
+
|
166 |
return $this->options;
|
167 |
}
|
168 |
|
170 |
* Load default options.
|
171 |
*
|
172 |
* @param array $options Options.
|
173 |
+
*
|
174 |
* @return array
|
175 |
*/
|
176 |
public function load_default_options( $options ) {
|
186 |
if ( ! isset( $options['networks'] ) || ! is_array( $options['networks'] ) ) {
|
187 |
$options['networks'] = array();
|
188 |
}
|
189 |
+
|
190 |
return $options;
|
191 |
}
|
192 |
|
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 |
|
@@ -286,6 +286,10 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
|
|
286 |
|
287 |
== Changelog ==
|
288 |
|
|
|
|
|
|
|
|
|
289 |
= 1.13 =
|
290 |
|
291 |
* added support for 'ads.txt'
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 1.13.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
286 |
|
287 |
== Changelog ==
|
288 |
|
289 |
+
= 1.13.1 =
|
290 |
+
|
291 |
+
* fixed issue with PHP 7.1 and higher
|
292 |
+
|
293 |
= 1.13 =
|
294 |
|
295 |
* added support for 'ads.txt'
|