Version Description
Download this release
Release Info
Developer | broadstreetads |
Plugin | WordPress Ad Widget |
Version | 2.6.0 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.6.0
- adwidget.php +37 -8
- readme.txt +2 -2
- views/admin.php +12 -7
adwidget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Wordpress Ad Widget
|
4 |
Plugin URI: https://github.com/broadstreetads/wordpress-ad-widget
|
5 |
Description: The easiest way to place ads in your Wordpress sidebar. Go to Settings -> Ad Widget
|
6 |
-
Version: 2.
|
7 |
Author: Broadstreet Ads
|
8 |
Author URI: http://broadstreetads.com
|
9 |
*/
|
@@ -20,7 +20,8 @@ add_action('admin_menu', array('AdWidget_Core', 'registerAdmin'));
|
|
20 |
class AdWidget_Core
|
21 |
{
|
22 |
CONST KEY_INSTALL_REPORT = 'AdWidget_Installed';
|
23 |
-
CONST VERSION = '2.
|
|
|
24 |
|
25 |
/**
|
26 |
* The callback used to register the scripts
|
@@ -83,8 +84,7 @@ class AdWidget_Core
|
|
83 |
* on the blog in case of errors and other needs.
|
84 |
*/
|
85 |
public static function sendReport($message = 'General')
|
86 |
-
{
|
87 |
-
|
88 |
$report = "$message\n";
|
89 |
$report .= get_bloginfo('name'). "\n";
|
90 |
$report .= get_bloginfo('url'). "\n";
|
@@ -95,6 +95,30 @@ class AdWidget_Core
|
|
95 |
|
96 |
@wp_mail('plugin@broadstreetads.com', "Report: $message", $report);
|
97 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
/**
|
100 |
* If this is a new installation and we've never sent a report to the
|
@@ -102,25 +126,27 @@ class AdWidget_Core
|
|
102 |
* issues should arise in the future.
|
103 |
*/
|
104 |
public static function sendInstallReportIfNew()
|
105 |
-
{
|
106 |
$install_key = self::KEY_INSTALL_REPORT;
|
107 |
$upgrade_key = self::KEY_INSTALL_REPORT .'_'. self::VERSION;
|
108 |
|
109 |
$installed = self::getOption($install_key);
|
110 |
$upgraded = self::getOption($upgrade_key);
|
111 |
|
112 |
-
$sent = ($installed && $upgraded);
|
113 |
|
114 |
if($sent === FALSE)
|
115 |
-
{
|
116 |
if(!$installed)
|
117 |
{
|
|
|
118 |
self::sendReport("Installation");
|
119 |
self::setOption($install_key, 'true');
|
120 |
self::setOption($upgrade_key, 'true');
|
121 |
}
|
122 |
else
|
123 |
{
|
|
|
124 |
self::sendReport("Upgrade");
|
125 |
self::setOption($upgrade_key, 'true');
|
126 |
}
|
@@ -422,9 +448,12 @@ class AdWidget_ImageWidget extends WP_Widget
|
|
422 |
<label for="<?php echo $this->get_field_id('w_new'); ?>">Open in New Window? </label>
|
423 |
<input type="checkbox" name="<?php echo $this->get_field_name('w_new'); ?>" value="yes" <?php if($instance['w_resize'] == 'yes') echo 'checked'; ?> />
|
424 |
</p>
|
|
|
|
|
|
|
425 |
<?php if(!Broadstreet_Adwidget_Mini_Utility::hasAdserving()): ?>
|
426 |
<p>
|
427 |
-
|
428 |
<script language="javascript">
|
429 |
if(!window.broadstreet_upgrade)
|
430 |
{
|
3 |
Plugin Name: Wordpress Ad Widget
|
4 |
Plugin URI: https://github.com/broadstreetads/wordpress-ad-widget
|
5 |
Description: The easiest way to place ads in your Wordpress sidebar. Go to Settings -> Ad Widget
|
6 |
+
Version: 2.6.0
|
7 |
Author: Broadstreet Ads
|
8 |
Author URI: http://broadstreetads.com
|
9 |
*/
|
20 |
class AdWidget_Core
|
21 |
{
|
22 |
CONST KEY_INSTALL_REPORT = 'AdWidget_Installed';
|
23 |
+
CONST VERSION = '2.6.0';
|
24 |
+
CONST KEY_WELCOME = 'AdWidget_Welcome';
|
25 |
|
26 |
/**
|
27 |
* The callback used to register the scripts
|
84 |
* on the blog in case of errors and other needs.
|
85 |
*/
|
86 |
public static function sendReport($message = 'General')
|
87 |
+
{
|
|
|
88 |
$report = "$message\n";
|
89 |
$report .= get_bloginfo('name'). "\n";
|
90 |
$report .= get_bloginfo('url'). "\n";
|
95 |
|
96 |
@wp_mail('plugin@broadstreetads.com', "Report: $message", $report);
|
97 |
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Send a welcome email to the user
|
101 |
+
*/
|
102 |
+
public static function sendWelcome()
|
103 |
+
{
|
104 |
+
$got_welcome = self::getOption(self::KEY_WELCOME);
|
105 |
+
|
106 |
+
if($got_welcome != 'true') {
|
107 |
+
$email = get_bloginfo('admin_email');
|
108 |
+
$subject = "Message from WP AdWidget";
|
109 |
+
|
110 |
+
$body = "Thank you for using WP AdWidget! If you have any questions, reach out to kenny@broadstreetads.com.\n\n"
|
111 |
+
. "*One Other Thing*\n\nYou might also be interested in Selfie: http://wordpress.org/plugins/selfie :)\n\n"
|
112 |
+
. "It's self serve advertising that you can implement in a couple minutes.\n\n"
|
113 |
+
. "Best of luck!\n"
|
114 |
+
. "- Kenny Katzgrau\n\n"
|
115 |
+
. '"Our readers are perhaps our greatest untapped resource" - New York Times Innovation Report';
|
116 |
+
|
117 |
+
self::setOption(self::KEY_WELCOME, 'true');
|
118 |
+
|
119 |
+
@wp_mail($email, $subject, $body);
|
120 |
+
}
|
121 |
+
}
|
122 |
|
123 |
/**
|
124 |
* If this is a new installation and we've never sent a report to the
|
126 |
* issues should arise in the future.
|
127 |
*/
|
128 |
public static function sendInstallReportIfNew()
|
129 |
+
{
|
130 |
$install_key = self::KEY_INSTALL_REPORT;
|
131 |
$upgrade_key = self::KEY_INSTALL_REPORT .'_'. self::VERSION;
|
132 |
|
133 |
$installed = self::getOption($install_key);
|
134 |
$upgraded = self::getOption($upgrade_key);
|
135 |
|
136 |
+
$sent = ($installed && $upgraded);
|
137 |
|
138 |
if($sent === FALSE)
|
139 |
+
{
|
140 |
if(!$installed)
|
141 |
{
|
142 |
+
self::sendWelcome();
|
143 |
self::sendReport("Installation");
|
144 |
self::setOption($install_key, 'true');
|
145 |
self::setOption($upgrade_key, 'true');
|
146 |
}
|
147 |
else
|
148 |
{
|
149 |
+
self::sendWelcome();
|
150 |
self::sendReport("Upgrade");
|
151 |
self::setOption($upgrade_key, 'true');
|
152 |
}
|
448 |
<label for="<?php echo $this->get_field_id('w_new'); ?>">Open in New Window? </label>
|
449 |
<input type="checkbox" name="<?php echo $this->get_field_name('w_new'); ?>" value="yes" <?php if($instance['w_resize'] == 'yes') echo 'checked'; ?> />
|
450 |
</p>
|
451 |
+
<p>
|
452 |
+
<span style="color: green; font-weight: bold;">Tip:</span> If you're using this widget, you might also find <a target="_blank" href="http://wordpress.org/plugins/selfie">Selfie</a> useful.
|
453 |
+
</p>
|
454 |
<?php if(!Broadstreet_Adwidget_Mini_Utility::hasAdserving()): ?>
|
455 |
<p>
|
456 |
+
When you're ready for a more powerful adserver with click reporting <a target="_blank" href="#" onclick="broadstreet_upgrade(); return false;">click here</a>.
|
457 |
<script language="javascript">
|
458 |
if(!window.broadstreet_upgrade)
|
459 |
{
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: Broadstreet
|
3 |
Tags: wordpress,ad,widget,sidebar,google,tag,code
|
4 |
Requires at least: 3.0
|
5 |
-
Tested up to: 3.9
|
6 |
-
Stable tag: 2.
|
7 |
|
8 |
Easily upload ad images and ad code to your sidebar. For those that don't need or
|
9 |
want a complicated ad management system.
|
2 |
Contributors: Broadstreet
|
3 |
Tags: wordpress,ad,widget,sidebar,google,tag,code
|
4 |
Requires at least: 3.0
|
5 |
+
Tested up to: 3.9.1
|
6 |
+
Stable tag: 2.6.0
|
7 |
|
8 |
Easily upload ad images and ad code to your sidebar. For those that don't need or
|
9 |
want a complicated ad management system.
|
views/admin.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<div style="float: left; width:
|
2 |
<script>(function(d, s, id) {
|
3 |
var js, fjs = d.getElementsByTagName(s)[0];
|
4 |
if (d.getElementById(id)) return;
|
@@ -17,7 +17,7 @@
|
|
17 |
<h1>Wordpress Ad Widget</h1>
|
18 |
<script src="https://broadstreet-common.s3.amazonaws.com/broadstreet-net/init.js"></script>
|
19 |
<script type="text/javascript" src="http://cdn.broadstreetads.com/init.js"></script>
|
20 |
-
|
21 |
|
22 |
<?php if(Broadstreet_Adwidget_Mini_Utility::hasAdserving()): ?>
|
23 |
|
@@ -69,14 +69,13 @@ instructions! Send questions to kenny@broadstreetads.com .
|
|
69 |
Here's a short instructional video if you need help:
|
70 |
</p>
|
71 |
|
72 |
-
<iframe src="http://www.screenr.com/embed/u0t7" width="
|
73 |
|
74 |
</div>
|
75 |
|
76 |
-
<div style="float:
|
77 |
-
<
|
78 |
-
<
|
79 |
-
<div id="bs-blog"></div>
|
80 |
|
81 |
<div>
|
82 |
<div class="fb-like" data-href="http://www.facebook.com/broadstreetads" data-send="false" data-layout="box_count" data-width="450" data-show-faces="true"></div>
|
@@ -84,6 +83,12 @@ Here's a short instructional video if you need help:
|
|
84 |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
85 |
</div>
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
</div>
|
88 |
|
89 |
<div style="clear:both;"></div>
|
1 |
+
<div style="float: left; width: 550px;">
|
2 |
<script>(function(d, s, id) {
|
3 |
var js, fjs = d.getElementsByTagName(s)[0];
|
4 |
if (d.getElementById(id)) return;
|
17 |
<h1>Wordpress Ad Widget</h1>
|
18 |
<script src="https://broadstreet-common.s3.amazonaws.com/broadstreet-net/init.js"></script>
|
19 |
<script type="text/javascript" src="http://cdn.broadstreetads.com/init.js"></script>
|
20 |
+
|
21 |
|
22 |
<?php if(Broadstreet_Adwidget_Mini_Utility::hasAdserving()): ?>
|
23 |
|
69 |
Here's a short instructional video if you need help:
|
70 |
</p>
|
71 |
|
72 |
+
<iframe src="http://www.screenr.com/embed/u0t7" width="550" height="396" frameborder="0"></iframe>
|
73 |
|
74 |
</div>
|
75 |
|
76 |
+
<div style="float: left; width: 300px; margin-top: 10px; margin-left: 20px;">
|
77 |
+
<script type="text/javascript">broadstreet.zone(423);</script>
|
78 |
+
<br/>
|
|
|
79 |
|
80 |
<div>
|
81 |
<div class="fb-like" data-href="http://www.facebook.com/broadstreetads" data-send="false" data-layout="box_count" data-width="450" data-show-faces="true"></div>
|
83 |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
84 |
</div>
|
85 |
|
86 |
+
<h2>The Streetlight</h2>
|
87 |
+
<p>A blog for local news publishers</p>
|
88 |
+
<div id="bs-blog"></div>
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
</div>
|
93 |
|
94 |
<div style="clear:both;"></div>
|