Version Description
Invalidate the options cache after saving.
Download this release
Release Info
Developer | reviewmylife |
Plugin | Ad Injection |
Version | 0.9.3 |
Comparing to | |
See all releases |
Code changes from version 0.9.2 to 0.9.3
- ad-injection-admin.php +10 -3
- ad-injection.php +1 -1
- readme.txt +8 -2
ad-injection-admin.php
CHANGED
@@ -37,6 +37,13 @@ function adinj_checkNonce(){
|
|
37 |
}
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
// TODO investigate register_settings for a future release
|
41 |
if (isset($_POST['adinj_action'])){
|
42 |
switch($_POST['adinj_action']){
|
@@ -85,7 +92,7 @@ case 'Save all settings':
|
|
85 |
$blocked_ips = stripslashes($_POST['blocked_ips']);
|
86 |
$options['blocked_ips'] = $blocked_ips;
|
87 |
|
88 |
-
|
89 |
|
90 |
// TODO could stop this if not mfunc mode
|
91 |
adinj_write_config_file();
|
@@ -94,7 +101,7 @@ case 'Save all settings':
|
|
94 |
|
95 |
case 'Reset to Default':
|
96 |
adinj_checkNonce();
|
97 |
-
|
98 |
break;
|
99 |
|
100 |
case 'Delete settings from DB':
|
@@ -792,7 +799,7 @@ function adinj_activate_hook() {
|
|
792 |
$pending_options['ad_code_bottom_1'] = read_ad_from_file($bottom_file);
|
793 |
}
|
794 |
|
795 |
-
|
796 |
}
|
797 |
|
798 |
// If the options in the database are out of sync with our default options
|
37 |
}
|
38 |
}
|
39 |
|
40 |
+
function adinj_update_options($options){
|
41 |
+
update_option('adinj_options', $options);
|
42 |
+
// Refresh options from database as cached values are now invalidated
|
43 |
+
global $adinj_data;
|
44 |
+
$adinj_data = get_option('adinj_options');
|
45 |
+
}
|
46 |
+
|
47 |
// TODO investigate register_settings for a future release
|
48 |
if (isset($_POST['adinj_action'])){
|
49 |
switch($_POST['adinj_action']){
|
92 |
$blocked_ips = stripslashes($_POST['blocked_ips']);
|
93 |
$options['blocked_ips'] = $blocked_ips;
|
94 |
|
95 |
+
adinj_update_options($options);
|
96 |
|
97 |
// TODO could stop this if not mfunc mode
|
98 |
adinj_write_config_file();
|
101 |
|
102 |
case 'Reset to Default':
|
103 |
adinj_checkNonce();
|
104 |
+
adinj_update_options(adinj_default_options());
|
105 |
break;
|
106 |
|
107 |
case 'Delete settings from DB':
|
799 |
$pending_options['ad_code_bottom_1'] = read_ad_from_file($bottom_file);
|
800 |
}
|
801 |
|
802 |
+
adinj_update_options($pending_options);
|
803 |
}
|
804 |
|
805 |
// If the options in the database are out of sync with our default options
|
ad-injection.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Ad Injection
|
4 |
Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
|
5 |
Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
|
6 |
-
Version: 0.9.
|
7 |
Author: reviewmylife
|
8 |
Author URI: http://www.reviewmylife.co.uk/
|
9 |
License: GPLv2
|
3 |
Plugin Name: Ad Injection
|
4 |
Plugin URI: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-wordpress/
|
5 |
Description: Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
|
6 |
+
Version: 0.9.3
|
7 |
Author: reviewmylife
|
8 |
Author URI: http://www.reviewmylife.co.uk/
|
9 |
License: GPLv2
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.reviewmylife.co.uk/blog/2010/12/06/ad-injection-plugin-w
|
|
4 |
Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free
|
5 |
Requires at least: 3.0.0
|
6 |
Tested up to: 3.0.3
|
7 |
-
Stable tag: 0.9.
|
8 |
|
9 |
Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
|
10 |
|
@@ -171,6 +171,9 @@ For more information visit [reviewmylife](http://www.reviewmylife.co.uk/blog/201
|
|
171 |
|
172 |
== Changelog ==
|
173 |
|
|
|
|
|
|
|
174 |
= 0.9.2 =
|
175 |
If you are using mfunc mode and have added ad widgets please re-save them to regenerate the ad files.
|
176 |
Save ad files to a new directory so they don't need to be re-created after upgrade.
|
@@ -213,8 +216,11 @@ Fix 'Something badly wrong in num_rand_ads_to_insert' message that occurs on pag
|
|
213 |
|
214 |
== Upgrade Notice ==
|
215 |
|
|
|
|
|
|
|
216 |
= 0.9.2 =
|
217 |
-
If you are using mfunc mode and have added ad widgets please re-save them to regenerate the ad files.
|
218 |
|
219 |
= 0.9.1 =
|
220 |
Fix dynamic checking for widgets. Fix potential PHP error message with widgets.
|
4 |
Tags: ad injection, adsense, advert injection, advert, ad, injection, advertising, affiliate, inject, injection, insert, widget, monetize, monetise, banner, Amazon, ClickBank, TradeDoubler, Google, adBrite, post, WordPress, automatically, plugin, Adsense Injection, free
|
5 |
Requires at least: 3.0.0
|
6 |
Tested up to: 3.0.3
|
7 |
+
Stable tag: 0.9.3
|
8 |
|
9 |
Injects any advert (e.g. AdSense) into your WordPress posts or widget area. Restrict who sees the ads by post length, age, referrer or IP. Cache compatible.
|
10 |
|
171 |
|
172 |
== Changelog ==
|
173 |
|
174 |
+
= 0.9.3 =
|
175 |
+
Invalidate the options cache after saving.
|
176 |
+
|
177 |
= 0.9.2 =
|
178 |
If you are using mfunc mode and have added ad widgets please re-save them to regenerate the ad files.
|
179 |
Save ad files to a new directory so they don't need to be re-created after upgrade.
|
216 |
|
217 |
== Upgrade Notice ==
|
218 |
|
219 |
+
= 0.9.3 =
|
220 |
+
If you are using mfunc mode and have added ad widgets please re-save them to regenerate the ad files (fixed from 0.9.2).
|
221 |
+
|
222 |
= 0.9.2 =
|
223 |
+
If you are using mfunc mode and have added ad widgets please re-save them to regenerate the ad files (fixed from 0.9.2).
|
224 |
|
225 |
= 0.9.1 =
|
226 |
Fix dynamic checking for widgets. Fix potential PHP error message with widgets.
|