AdRotate Banner Manager - Version 4.11

Version Description

FREE = * [change] Widgets loaded via WordPress method * [change] Dashboard tweaks and improvements * [change] Caching notifications optimised * [fix] Datepickers not working in Safari (macOS)

Download this release

Release Info

Developer adegans
Plugin Icon 128x128 AdRotate Banner Manager
Version 4.11
Comparing to
See all releases

Code changes from version 4.10 to 4.11

adrotate-functions.php CHANGED
@@ -652,6 +652,7 @@ function adrotate_dashboard_scripts() {
652
wp_enqueue_script('textatcursor', plugins_url('/library/textatcursor.js', __FILE__));
653
wp_enqueue_script('tablesorter', plugins_url('/library/jquery.tablesorter.min.js', __FILE__), array('jquery'));
654
wp_enqueue_script('adrotate-tablesorter', plugins_url('/library/jquery.adrotate.tablesorter.js', __FILE__), array('jquery', 'tablesorter'));
655
}
656
657
// WP Pointers
652
wp_enqueue_script('textatcursor', plugins_url('/library/textatcursor.js', __FILE__));
653
wp_enqueue_script('tablesorter', plugins_url('/library/jquery.tablesorter.min.js', __FILE__), array('jquery'));
654
wp_enqueue_script('adrotate-tablesorter', plugins_url('/library/jquery.adrotate.tablesorter.js', __FILE__), array('jquery', 'tablesorter'));
655
+ wp_enqueue_script('adrotate-datepicker-fallback', plugins_url('/library/jquery.adrotate.datepicker.fallback.js', __FILE__), array('jquery'));
656
}
657
658
// WP Pointers
adrotate-manage-publisher.php CHANGED
@@ -200,7 +200,11 @@ function adrotate_insert_input() {
200
201
// Sort out start dates
202
if(strlen($start_date) > 0) {
203
- list($start_year, $start_month, $start_day) = explode('-', $start_date);
204
} else {
205
$start_year = $start_month = $start_day = 0;
206
}
@@ -216,7 +220,11 @@ function adrotate_insert_input() {
216
217
// Sort out end dates
218
if(strlen($end_date) > 0) {
219
- list($end_year, $end_month, $end_day) = explode('-', $end_date);
220
} else {
221
$end_year = $end_month = $end_day = 0;
222
}
200
201
// Sort out start dates
202
if(strlen($start_date) > 0) {
203
+ if(strstr($start_date, '-')) {
204
+ list($start_year, $start_month, $start_day) = explode('-', $start_date); // yyyy-mm-dd
205
+ } else {
206
+ list($start_day, $start_month, $start_year) = explode('/', $start_date); // Fuck you Safari (dd/mm/yyyy)
207
+ }
208
} else {
209
$start_year = $start_month = $start_day = 0;
210
}
220
221
// Sort out end dates
222
if(strlen($end_date) > 0) {
223
+ if(strstr($end_date, '-')) {
224
+ list($end_year, $end_month, $end_day) = explode('-', $end_date); // yyyy-mm-dd
225
+ } else {
226
+ list($end_day, $end_month, $end_year) = explode('/', $end_date); // Fuck you Safari (dd/mm/yyyy)
227
+ }
228
} else {
229
$end_year = $end_month = $end_day = 0;
230
}
adrotate-output.php CHANGED
@@ -222,7 +222,7 @@ function adrotate_group($group_ids, $fallback = 0, $weight = 0, $site = 0) {
222
-------------------------------------------------------------*/
223
function adrotate_inject_posts($post_content) {
224
global $wpdb, $post, $adrotate_debug;
225
-
226
$group_array = array();
227
if(is_page()) {
228
// Inject ads into page
@@ -233,7 +233,7 @@ function adrotate_inject_posts($post_content) {
233
if(!is_array($pages)) $pages = array();
234
235
if(in_array($post->ID, $pages)) {
236
- $group_array[$id->id] = array('location' => $id->page_loc, 'paragraph' => $id->page_par, 'ids' => $pages);
237
}
238
}
239
unset($ids, $pages);
@@ -250,7 +250,7 @@ function adrotate_inject_posts($post_content) {
250
251
foreach($wp_categories as &$value) {
252
if(in_array($value, $categories)) {
253
- $group_array[$id->id] = array('location' => $id->cat_loc, 'paragraph' => $id->cat_par, 'ids' => $categories);
254
}
255
}
256
}
@@ -269,47 +269,42 @@ function adrotate_inject_posts($post_content) {
269
270
if($group_count > 0) {
271
$before = $after = $inside = 0;
272
foreach($group_array as $group_id => $group) {
273
- if(is_page($group['ids']) OR is_category($group['ids']) OR in_category($group['ids'])) {
274
// Advert in front of content
275
if(($group['location'] == 1 OR $group['location'] == 3) AND $before == 0) {
276
- $post_content = adrotate_group($group_id).$post_content;
277
- unset($group_array[$group_id]);
278
$before = 1;
279
}
280
281
// Advert behind the content
282
if(($group['location'] == 2 OR $group['location'] == 3) AND $after == 0) {
283
- $post_content = $post_content.adrotate_group($group_id);
284
- unset($group_array[$group_id]);
285
$after = 1;
286
}
287
288
// Adverts inside the content
289
- if($group['location'] == 4) {
290
- $paragraphs = explode('</p>', $post_content);
291
- $paragraph_count = count($paragraphs);
292
- $count_p = ($group['paragraph'] == 99) ? ceil($paragraph_count / 2) : $group['paragraph'];
293
-
294
- foreach($paragraphs as $index => $paragraph) {
295
- if(trim($paragraph)) {
296
- $paragraphs[$index] .= '</p>';
297
- }
298
-
299
- if($count_p == $index + 1 AND $inside == 0) {
300
- $paragraphs[$index] .= adrotate_group($group_id);
301
- unset($group_array[$group_id]);
302
- $inside = 1;
303
- }
304
- }
305
- $inside = 0; // Reset for the next paragraph
306
- $post_content = implode('', $paragraphs);
307
- unset($paragraphs, $paragraph_count);
308
}
309
}
310
}
311
- unset($group_array, $before, $after, $inside);
312
}
313
return $post_content;
314
}
315
@@ -639,9 +634,11 @@ function adrotate_dashboard_error() {
639
}
640
641
// Caching
642
if($adrotate_config['w3caching'] == "N" AND is_plugin_active('w3-total-cache/w3-total-cache.php')) {
643
$error['w3tc_active'] = __('You are using W3 Total Cache but W3 Total Cache support is not enabled. This may affect rotation of adverts, statistics and other dynamic elements in the plugin.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Enable W3 Total Cache Support', 'adrotate').'</a>.';
644
}
645
if($adrotate_config['w3caching'] == "Y" AND !is_plugin_active('w3-total-cache/w3-total-cache.php')) {
646
$error['w3tc_not_active'] = __('You have enabled caching support but W3 Total Cache is not active on your site!', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Disable W3 Total Cache Support', 'adrotate').'</a>.';
647
}
@@ -649,9 +646,11 @@ function adrotate_dashboard_error() {
649
$error['w3tc_no_hash'] = __('You have enable caching support but the W3TC_DYNAMIC_SECURITY definition is not set.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('How to configure W3 Total Cache', 'adrotate').'</a>.';
650
}
651
652
if($adrotate_config['borlabscache'] == "N" AND is_plugin_active('borlabs-cache/borlabs-cache.php')) {
653
$error['borlabs_active'] = __('You are using Borlabs Cache but Borlabs Cache support is not enabled. This may affect rotation of adverts, statistics and other dynamic elements in the plugin.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Enable Borlabs Cache Support', 'adrotate').'</a>.';
654
}
655
if($adrotate_config['borlabscache'] == "Y" AND !is_plugin_active('borlabs-cache/borlabs-cache.php')) {
656
$error['borlabs_not_active'] = __('You have enable caching support but Borlabs Cache is not active on your site!', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Disable Borlabs Cache Support', 'adrotate').'</a>.';
657
}
@@ -702,16 +701,18 @@ function adrotate_notifications_dashboard() {
702
if(isset($_GET['hide']) AND $_GET['hide'] == 3) update_option('adrotate_hide_competition', 1);
703
704
$pro_banner = get_option('adrotate_hide_banner');
705
- echo '<div class="updated" style="padding: 0; margin: 0;">';
706
- echo ' <div class="ajdg_notification">';
707
- echo ' <div class="button_div"><a class="button" target="_blank" href="https://ajdg.solutions/products/adrotate-for-wordpress/?add-to-cart=1126&utm_campaign=adrotate-page&utm_medium=upgrade-banner-button&utm_source=adrotate-free">'.__('Buy now', 'adrotate').'</a></div>';
708
- echo ' <div class="text">'.__("If you like <strong>AdRotate</strong>, please consider upgrading to the <strong>PRO</strong> version and get more features.", 'adrotate').'<br /><span>'.__('Use discount code <b>getadrotatepro</b> for 10% off on any AdRotate license!', 'adrotate' ).' '.__('Thank you for your support!', 'adrotate' ).'</span></div>';
709
- echo ' <div class="icon"><img title="" src="'.plugins_url('/images/logo-60x60.png', __FILE__).'" alt=""/></div>';
710
- echo ' </div>';
711
- echo '</div>';
712
713
$review_banner = get_option('adrotate_hide_review');
714
- if($review_banner != 1 AND $review_banner < (adrotate_now() - 1209600)) {
715
echo '<div class="updated" style="padding: 0; margin: 0;">';
716
echo ' <div class="ajdg_notification">';
717
echo ' <div class="button_div"><a class="button" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/adrotate?rate=5#postform">Rate AdRotate</a></div>';
@@ -818,6 +819,48 @@ function adrotate_help_info() {
818
);
819
}
820
821
/*-------------------------------------------------------------
822
Name: adrotate_trademark
823
Purpose: Trademark notice
222
-------------------------------------------------------------*/
223
function adrotate_inject_posts($post_content) {
224
global $wpdb, $post, $adrotate_debug;
225
+
226
$group_array = array();
227
if(is_page()) {
228
// Inject ads into page
233
if(!is_array($pages)) $pages = array();
234
235
if(in_array($post->ID, $pages)) {
236
+ $group_array[$id->id] = array('location' => $id->page_loc, 'paragraph' => $id->page_par, 'posts' => $pages);
237
}
238
}
239
unset($ids, $pages);
250
251
foreach($wp_categories as &$value) {
252
if(in_array($value, $categories)) {
253
+ $group_array[$id->id] = array('location' => $id->cat_loc, 'paragraph' => $id->cat_par, 'posts' => $categories);
254
}
255
}
256
}
269
270
if($group_count > 0) {
271
$before = $after = $inside = 0;
272
+
273
+ $paragraphs = explode('</p>', $post_content);
274
+ $paragraph_count = count($paragraphs);
275
+
276
foreach($group_array as $group_id => $group) {
277
+ if(is_page($group['posts']) OR is_category($group['posts']) OR in_category($group['posts'])) {
278
// Advert in front of content
279
if(($group['location'] == 1 OR $group['location'] == 3) AND $before == 0) {
280
+ array_splice($paragraphs, 0, 0, adrotate_group($group_id));
281
$before = 1;
282
}
283
284
// Advert behind the content
285
if(($group['location'] == 2 OR $group['location'] == 3) AND $after == 0) {
286
+ array_splice($paragraphs, $paragraph_count, 0, adrotate_group($group_id));
287
$after = 1;
288
}
289
290
// Adverts inside the content
291
+ if($group['location'] == 4 AND $inside == 0) {
292
+ $insert_after = ($group['paragraph'] == 99) ? ceil($paragraph_count / 2) : $group['paragraph'];
293
+ array_splice($paragraphs, $insert_after, 0, adrotate_group($group_id));
294
+ $inside = 1;
295
+ } else {
296
+ // Reset
297
+ $inside = 0;
298
}
299
+
300
+ unset($group_array[$group_id]);
301
}
302
}
303
+ $post_content = implode('', $paragraphs);
304
+
305
+ unset($group_array, $before, $after, $inside, $paragraphs, $paragraph_count);
306
}
307
+
308
return $post_content;
309
}
310
634
}
635
636
// Caching
637
+ /*
638
if($adrotate_config['w3caching'] == "N" AND is_plugin_active('w3-total-cache/w3-total-cache.php')) {
639
$error['w3tc_active'] = __('You are using W3 Total Cache but W3 Total Cache support is not enabled. This may affect rotation of adverts, statistics and other dynamic elements in the plugin.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Enable W3 Total Cache Support', 'adrotate').'</a>.';
640
}
641
+ */
642
if($adrotate_config['w3caching'] == "Y" AND !is_plugin_active('w3-total-cache/w3-total-cache.php')) {
643
$error['w3tc_not_active'] = __('You have enabled caching support but W3 Total Cache is not active on your site!', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Disable W3 Total Cache Support', 'adrotate').'</a>.';
644
}
646
$error['w3tc_no_hash'] = __('You have enable caching support but the W3TC_DYNAMIC_SECURITY definition is not set.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('How to configure W3 Total Cache', 'adrotate').'</a>.';
647
}
648
649
+ /*
650
if($adrotate_config['borlabscache'] == "N" AND is_plugin_active('borlabs-cache/borlabs-cache.php')) {
651
$error['borlabs_active'] = __('You are using Borlabs Cache but Borlabs Cache support is not enabled. This may affect rotation of adverts, statistics and other dynamic elements in the plugin.', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Enable Borlabs Cache Support', 'adrotate').'</a>.';
652
}
653
+ */
654
if($adrotate_config['borlabscache'] == "Y" AND !is_plugin_active('borlabs-cache/borlabs-cache.php')) {
655
$error['borlabs_not_active'] = __('You have enable caching support but Borlabs Cache is not active on your site!', 'adrotate').' <a href="'.admin_url('/admin.php?page=adrotate-settings&tab=misc').'">'.__('Disable Borlabs Cache Support', 'adrotate').'</a>.';
656
}
701
if(isset($_GET['hide']) AND $_GET['hide'] == 3) update_option('adrotate_hide_competition', 1);
702
703
$pro_banner = get_option('adrotate_hide_banner');
704
+ if($pro_banner < (adrotate_now() - (7 * 86400))) {
705
+ echo '<div class="updated" style="padding: 0; margin: 0;">';
706
+ echo ' <div class="ajdg_notification">';
707
+ echo ' <div class="button_div"><a class="button" target="_blank" href="https://ajdg.solutions/products/adrotate-for-wordpress/?add-to-cart=1126&utm_campaign=adrotate-page&utm_medium=upgrade-banner-button&utm_source=adrotate-free">'.__('Buy now', 'adrotate').'</a></div>';
708
+ echo ' <div class="text">'.__("If you like <strong>AdRotate</strong>, please consider upgrading to the <strong>PRO</strong> version and get more features.", 'adrotate').'<br /><span>'.__('Use discount code <b>getadrotatepro</b> for 10% off on any AdRotate license!', 'adrotate' ).' '.__('Thank you for your support!', 'adrotate' ).'</span></div>';
709
+ echo ' <div class="icon"><img title="" src="'.plugins_url('/images/logo-60x60.png', __FILE__).'" alt=""/></div>';
710
+ echo ' </div>';
711
+ echo '</div>';
712
+ }
713
714
$review_banner = get_option('adrotate_hide_review');
715
+ if($review_banner != 1 AND $review_banner < (adrotate_now() - (14 * 86400))) {
716
echo '<div class="updated" style="padding: 0; margin: 0;">';
717
echo ' <div class="ajdg_notification">';
718
echo ' <div class="button_div"><a class="button" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/adrotate?rate=5#postform">Rate AdRotate</a></div>';
819
);
820
}
821
822
+ /*-------------------------------------------------------------
823
+ Name: adrotate_action_links
824
+ Purpose: Plugin page link
825
+ Since: 4.11
826
+ -------------------------------------------------------------*/
827
+ function adrotate_action_links($links) {
828
+ $custom_actions = array();
829
+ $custom_actions['adrotate-pro'] = sprintf('<a href="%s" target="_blank">%s</a>', 'https://ajdg.solutions/cart/?add-to-cart=1124&utm_campaign=adrotate&utm_medium=action_links&utm_source=adrotate', 'Get Pro');
830
+ $custom_actions['adrotate-help'] = sprintf('<a href="%s" target="_blank">%s</a>', 'https://ajdg.solutions/forums/?utm_campaign=adrotate&utm_medium=action_links&utm_source=adrotate', 'Support');
831
+ $custom_actions['adrotate-arnan'] = sprintf('<a href="%s" target="_blank">%s</a>', 'http://www.arnan.me/?utm_campaign=adrotate&utm_medium=action_links&utm_source=adrotate', 'arnan.me');
832
+
833
+ return array_merge($custom_actions, $links);
834
+ }
835
+
836
+ /*-------------------------------------------------------------
837
+ Name: adrotate_credits
838
+ Purpose: Promotional stuff shown throughout the plugin
839
+ Since: 3.7
840
+ -------------------------------------------------------------*/
841
+ function adrotate_credits() {
842
+ echo '<table class="widefat" style="margin-top: .5em">';
843
+
844
+ echo '<thead>';
845
+ echo '<tr valign="top">';
846
+ echo ' <th colspan="2"><strong>'.__('Help AdRotate Grow', 'adrotate').'</strong></th>';
847
+ echo ' <th width="45%"><strong>'.__('AdRotate Professional', 'adrotate').'</strong></th>';
848
+ echo '</tr>';
849
+ echo '</thead>';
850
+
851
+ echo '<tbody>';
852
+ echo '<tr>';
853
+ echo '<td><center><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate&utm_medium=credits&utm_source=adrotate" title="AdRotate plugin for WordPress"><img src="'.plugins_url('/images/logo-60x60.png', __FILE__).'" alt="AdRotate Logo" width="60" height="60" /></a></center></td>';
854
+ echo '<td>'.__("Many users only think to review AdRotate when something goes wrong while thousands of people happily use AdRotate.", 'adrotate').' <strong>'. __("If you find AdRotate useful please leave your", 'adrotate').' <a href="https://wordpress.org/support/view/plugin-reviews/adrotate?rate=5#postform" target="_blank">'.__('rating','adrotate').'</a> '.__('and','adrotate').' <a href="https://wordpress.org/support/view/plugin-reviews/adrotate" target="_blank">'.__('review','adrotate').'</a> '.__('on WordPress.org to help AdRotate grow in a positive way', 'adrotate').'!</strong></td>';
855
+ echo '<td><a href="https://ajdg.solutions/cart/?add-to-cart=1124&utm_campaign=adrotate&utm_medium=credits&utm_source=adrotate" title="Get AdRotate Pro for WordPress"><img src="'.plugins_url('/images/adrotate-product.png', __FILE__).'" alt="AdRotate Pro for WordPress" width="70" height="70" align="left" /></a>'.__('Get more advanced features like Geo Targeting, scheduling and much more with AdRotate Pro.', 'adrotate').'<br />'.__('Includes premium support and free updates!', 'adrotate').'<br /><strong>So why wait? <a href="https://ajdg.solutions/cart/?add-to-cart=1124&utm_campaign=adrotate&utm_medium=credits&utm_source=adrotate" title="Get AdRotate Pro for WordPress">'.__('Get started today', 'adrotate').' &raquo;</a></strong></td>';
856
+
857
+ echo '</tr>';
858
+ echo '</tbody>';
859
+
860
+ echo '</table>';
861
+ echo adrotate_trademark();
862
+ }
863
+
864
/*-------------------------------------------------------------
865
Name: adrotate_trademark
866
Purpose: Trademark notice
adrotate-widget.php CHANGED
@@ -9,6 +9,10 @@
9
* liability that might arise from it's use.
10
------------------------------------------------------------------------------------ */
11
12
/*-------------------------------------------------------------
13
Name: adrotate_widget
14
9
* liability that might arise from it's use.
10
------------------------------------------------------------------------------------ */
11
12
+ function adrotate_widget() {
13
+ register_widget('adrotate_widgets');
14
+ }
15
+
16
/*-------------------------------------------------------------
17
Name: adrotate_widget
18
adrotate.php CHANGED
@@ -7,7 +7,7 @@ Author URI: http://www.arnan.me/
7
Description: Monetise your website with adverts while keeping things simple. Start making money today!
8
Text Domain: adrotate
9
Domain Path: /languages/
10
- Version: 4.10
11
License: GPLv3
12
*/
13
@@ -22,7 +22,7 @@ License: GPLv3
22
------------------------------------------------------------------------------------ */
23
24
/*--- AdRotate values ---------------------------------------*/
25
- define("ADROTATE_DISPLAY", '4.10');
26
define("ADROTATE_VERSION", 391);
27
define("ADROTATE_DB_VERSION", 64);
28
$plugin_folder = plugin_dir_path(__FILE__);
@@ -53,7 +53,7 @@ register_deactivation_hook(__FILE__, 'adrotate_deactivate');
53
register_uninstall_hook(__FILE__, 'adrotate_uninstall');
54
add_action('adrotate_evaluate_ads', 'adrotate_evaluate_ads');
55
add_action('adrotate_empty_trackerdata', 'adrotate_empty_trackerdata');
56
- add_action('widgets_init', create_function('', 'return register_widget("adrotate_widgets");'));
57
add_filter('adrotate_apply_photon','adrotate_apply_jetpack_photon');
58
/*-----------------------------------------------------------*/
59
@@ -80,6 +80,7 @@ if(is_admin()) {
80
add_action("admin_enqueue_scripts", 'adrotate_dashboard_scripts');
81
add_action("admin_print_styles", 'adrotate_dashboard_styles');
82
add_action('admin_notices','adrotate_notifications_dashboard');
83
/*--- Internal redirects ------------------------------------*/
84
if(isset($_POST['adrotate_generate_submit'])) add_action('init', 'adrotate_generate_input');
85
if(isset($_POST['adrotate_ad_submit'])) add_action('init', 'adrotate_insert_input');
@@ -275,7 +276,7 @@ function adrotate_manage() {
275
?>
276
<br class="clear" />
277
278
- <?php echo adrotate_trademark(); ?>
279
280
</div>
281
<?php
@@ -330,7 +331,7 @@ function adrotate_manage_group() {
330
?>
331
<br class="clear" />
332
333
- <?php echo adrotate_trademark(); ?>
334
335
</div>
336
<?php
@@ -355,7 +356,7 @@ function adrotate_manage_schedules() {
355
356
<br class="clear" />
357
358
- <?php echo adrotate_trademark(); ?>
359
360
</div>
361
<?php
@@ -412,7 +413,7 @@ function adrotate_statistics() {
412
?>
413
<br class="clear" />
414
415
- <?php echo adrotate_trademark(); ?>
416
417
</div>
418
<?php
@@ -451,7 +452,7 @@ function adrotate_manage_media() {
451
452
<br class="clear" />
453
454
- <?php echo adrotate_trademark(); ?>
455
456
</div>
457
<?php
@@ -536,7 +537,7 @@ function adrotate_options() {
536
537
<br class="clear" />
538
539
- <?php echo adrotate_trademark(); ?>
540
541
</div>
542
<?php
7
Description: Monetise your website with adverts while keeping things simple. Start making money today!
8
Text Domain: adrotate
9
Domain Path: /languages/
10
+ Version: 4.11
11
License: GPLv3
12
*/
13
22
------------------------------------------------------------------------------------ */
23
24
/*--- AdRotate values ---------------------------------------*/
25
+ define("ADROTATE_DISPLAY", '4.11');
26
define("ADROTATE_VERSION", 391);
27
define("ADROTATE_DB_VERSION", 64);
28
$plugin_folder = plugin_dir_path(__FILE__);
53
register_uninstall_hook(__FILE__, 'adrotate_uninstall');
54
add_action('adrotate_evaluate_ads', 'adrotate_evaluate_ads');
55
add_action('adrotate_empty_trackerdata', 'adrotate_empty_trackerdata');
56
+ add_action('widgets_init', 'adrotate_widget');
57
add_filter('adrotate_apply_photon','adrotate_apply_jetpack_photon');
58
/*-----------------------------------------------------------*/
59
80
add_action("admin_enqueue_scripts", 'adrotate_dashboard_scripts');
81
add_action("admin_print_styles", 'adrotate_dashboard_styles');
82
add_action('admin_notices','adrotate_notifications_dashboard');
83
+ add_filter('plugin_action_links_' . plugin_basename( __FILE__ ), 'adrotate_action_links');
84
/*--- Internal redirects ------------------------------------*/
85
if(isset($_POST['adrotate_generate_submit'])) add_action('init', 'adrotate_generate_input');
86
if(isset($_POST['adrotate_ad_submit'])) add_action('init', 'adrotate_insert_input');
276
?>
277
<br class="clear" />
278
279
+ <?php adrotate_credits(); ?>
280
281
</div>
282
<?php
331
?>
332
<br class="clear" />
333
334
+ <?php adrotate_credits(); ?>
335
336
</div>
337
<?php
356
357
<br class="clear" />
358
359
+ <?php adrotate_credits(); ?>
360
361
</div>
362
<?php
413
?>
414
<br class="clear" />
415
416
+ <?php adrotate_credits(); ?>
417
418
</div>
419
<?php
452
453
<br class="clear" />
454
455
+ <?php adrotate_credits(); ?>
456
457
</div>
458
<?php
537
538
<br class="clear" />
539
540
+ <?php adrotate_credits(); ?>
541
542
</div>
543
<?php
dashboard/publisher/adverts-edit.php CHANGED
@@ -31,10 +31,11 @@ wp_enqueue_media();
31
wp_enqueue_script('uploader-hook', plugins_url().'/adrotate/library/uploader-hook.js', array('jquery'));
32
33
// Set up start and end date
34
- list($start_day, $start_month, $start_year, $start_hour, $start_minute) = explode(" ", date("d m Y H i", $schedule->starttime));
35
- list($end_day, $end_month, $end_year, $end_hour, $end_minute) = explode(" ", date("d m Y H i", $schedule->stoptime));
36
- $start_date = $start_year.'-'.$start_month.'-'.$start_day;
37
- $end_date = $end_year.'-'.$end_month.'-'.$end_day;
38
39
$meta_array = array();
40
foreach($linkmeta as $meta) {
@@ -218,11 +219,11 @@ if($edit_banner->imagetype == "field") {
218
<tr>
219
<th><?php _e('Start date', 'adrotate'); ?></th>
220
<td>
221
- <input tabindex="9" type="date" id="datepicker" name="adrotate_start_date" value="<?php echo $start_date; ?>" class="datepicker" />
222
</td>
223
<th><?php _e('End date', 'adrotate'); ?></th>
224
<td>
225
- <input tabindex="10" type="date" id="datepicker" name="adrotate_end_date" value="<?php echo $end_date; ?>" class="datepicker" />
226
</td>
227
</tr>
228
<tr>
31
wp_enqueue_script('uploader-hook', plugins_url().'/adrotate/library/uploader-hook.js', array('jquery'));
32
33
// Set up start and end date
34
+ list($start_day, $start_month, $start_year) = explode(" ", date("d m Y", $schedule->starttime));
35
+ list($end_day, $end_month, $end_year) = explode(" ", date("d m Y", $schedule->stoptime));
36
+ $start_date = $start_day.'/'.$start_month.'/'.$start_year;
37
+ $end_date = $end_day.'/'.$end_month.'/'.$end_year;
38
+ $start_hour = $start_minute = $end_hour = $end_minute = '00';
39
40
$meta_array = array();
41
foreach($linkmeta as $meta) {
219
<tr>
220
<th><?php _e('Start date', 'adrotate'); ?></th>
221
<td>
222
+ <input tabindex="9" type="date" id="startdate_picker" name="adrotate_start_date" value="<?php echo $start_date; ?>" class="datepicker" />
223
</td>
224
<th><?php _e('End date', 'adrotate'); ?></th>
225
<td>
226
+ <input tabindex="10" type="date" id="enddate_picker" name="adrotate_end_date" value="<?php echo $end_date; ?>" class="datepicker" />
227
</td>
228
</tr>
229
<tr>
dashboard/settings/geotargeting.php CHANGED
@@ -23,22 +23,27 @@
23
<select name="adrotate_enable_geo_disabled">
24
<option value="0" disabled="1"><?php _e('Disabled', 'adrotate'); ?></option>
25
<option value="0" disabled="1">AdRotate Geo</option>
26
- <option value="0" disabled="1">MaxMind City (Recommended)</option>
27
<option value="0" disabled="1">MaxMind Country</option>
28
- <option value="0" disabled="1">CloudFlare (<?php _e('Experimental', 'adrotate'); ?>)</option>
29
</select><br />
30
<span class="description">
31
<p><strong>AdRotate Geo</strong> - <?php _e('30000 free lookups every day, uses GeoLite2 databases from MaxMind!', 'adrotate'); ?><br />
32
<em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4/ipv6, Countries, Cities, DMA codes, States and State ISO (3166-2) codes.</em><br />
33
<em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for small to medium websites.', 'adrotate'); ?></em><br /><br />
34
35
<strong>MaxMind</strong> - <a href="https://www.maxmind.com/en/geoip2-precision-services?rId=ajdgnet" target="_blank">GeoIP2 Precision</a> - <?php _e('The most accurate geo targeting you can get for only $20 USD per 50000 lookups.', 'adrotate'); ?> <a href="https://www.maxmind.com/en/geoip2-precision-city?rId=ajdgnet" target="_blank"><?php _e('Buy now', 'adrotate'); ?>.</a><br />
36
<em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4/ipv6, Countries, States, State ISO (3166-2) codes, Cities and DMA codes.</em><br />
37
<em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for any size website as long as you have lookups.', 'adrotate'); ?></em><br /><br />
38
39
<strong>CloudFlare</strong> - <a href="https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-CloudFlare-IP-Geolocation-do-" target="_blank">IP Geolocation</a> - <?php _e('Basic geolocation included in every CloudFlare account.', 'adrotate'); ?><br />
40
<em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4/ipv6, Countries.</em><br />
41
- <em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for any size website.', 'adrotate'); ?></em><br /><br />
42
</span>
43
</td>
44
</tr>
23
<select name="adrotate_enable_geo_disabled">
24
<option value="0" disabled="1"><?php _e('Disabled', 'adrotate'); ?></option>
25
<option value="0" disabled="1">AdRotate Geo</option>
26
+ <option value="0" disabled="1">FreegeoIP</option>
27
+ <option value="0" disabled="1">MaxMind City</option>
28
<option value="0" disabled="1">MaxMind Country</option>
29
+ <option value="0" disabled="1">CloudFlare</option>
30
</select><br />
31
<span class="description">
32
<p><strong>AdRotate Geo</strong> - <?php _e('30000 free lookups every day, uses GeoLite2 databases from MaxMind!', 'adrotate'); ?><br />
33
<em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4/ipv6, Countries, Cities, DMA codes, States and State ISO (3166-2) codes.</em><br />
34
<em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for small to medium websites.', 'adrotate'); ?></em><br /><br />
35
36
+ <p><strong>FreegeoIP</strong> - <?php _e('15000 free lookups per hour, uses GeoLite2 databases from MaxMind!', 'adrotate'); ?><br />
37
+ <em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4, Countries, Cities, DMA codes, States and State ISO (3166-2) codes.</em><br />
38
+ <em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for medium sized websites.', 'adrotate'); ?></em><br /><br />
39
+
40
<strong>MaxMind</strong> - <a href="https://www.maxmind.com/en/geoip2-precision-services?rId=ajdgnet" target="_blank">GeoIP2 Precision</a> - <?php _e('The most accurate geo targeting you can get for only $20 USD per 50000 lookups.', 'adrotate'); ?> <a href="https://www.maxmind.com/en/geoip2-precision-city?rId=ajdgnet" target="_blank"><?php _e('Buy now', 'adrotate'); ?>.</a><br />
41
<em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4/ipv6, Countries, States, State ISO (3166-2) codes, Cities and DMA codes.</em><br />
42
<em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for any size website as long as you have lookups.', 'adrotate'); ?></em><br /><br />
43
44
<strong>CloudFlare</strong> - <a href="https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-CloudFlare-IP-Geolocation-do-" target="_blank">IP Geolocation</a> - <?php _e('Basic geolocation included in every CloudFlare account.', 'adrotate'); ?><br />
45
<em><strong><?php _e('Supports:', 'adrotate'); ?></strong> ipv4/ipv6, Countries.</em><br />
46
+ <em><strong><?php _e('Scalability:', 'adrotate'); ?></strong> <?php _e('Suitable for any size website.', 'adrotate'); ?></em>
47
</span>
48
</td>
49
</tr>
images/date-arrow.png ADDED
Binary file
library/dashboard.css CHANGED
@@ -37,3 +37,27 @@
37
38
/* Tablesorter */
39
table.tablesorter thead tr .header { text-decoration: underline; cursor: pointer; }
37
38
/* Tablesorter */
39
table.tablesorter thead tr .header { text-decoration: underline; cursor: pointer; }
40
+
41
+ /* Fallback DatePicker */
42
+ .ui-datepicker { background: #efefef; margin: 5px auto 0; -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5); -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5); box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, .5); }
43
+ .ui-datepicker a { text-decoration: none; }
44
+ .ui-datepicker table { width: 100%; }
45
+ .ui-datepicker-header { background: #0073aa; color: #fff; font-weight: bold; line-height: 30px; border-width: 1px 0 0 0; border-style: solid; border-color: #111; }
46
+ .ui-datepicker-title { text-align: center; }
47
+ .ui-datepicker-prev, .ui-datepicker-next { display: inline-block; width: 30px; height: 30px; text-align: center; cursor: pointer; background-image: url('../images/date-arrow.png'); background-repeat: no-repeat; line-height: 600%; overflow: hidden; }
48
+ .ui-datepicker-prev { float: left; background-position: center -30px; }
49
+ .ui-datepicker-next { float: right; background-position: center 0px; }
50
+ .ui-datepicker thead { background-color: #dfdfdf; border-bottom: 1px solid #bbb; }
51
+ .ui-datepicker th { text-transform: uppercase; padding: 5px 0; color: #666666; }
52
+ .ui-datepicker tbody td { padding: 0; border-right: 1px solid #bbb; }
53
+ .ui-datepicker tbody td:last-child { border-right: 0px; }
54
+ .ui-datepicker tbody tr { border-bottom: 1px solid #bbb; }
55
+ .ui-datepicker tbody tr:last-child { border-bottom: 0px; }
56
+ .ui-datepicker td span, .ui-datepicker td a { display: inline-block; font-weight: bold; text-align: center; width: 30px; height: 30px; line-height: 30px; color: #666666; }
57
+ .ui-datepicker-calendar .ui-state-default { background: #efefef; }
58
+ .ui-datepicker-calendar .ui-state-hover { background: #f7f7f7; }
59
+ .ui-datepicker-calendar .ui-state-active { background: #6eafbf; color: #e0e0e0; border: 1px solid #55838f; position: relative; margin: -1px; }
60
+ .ui-datepicker-unselectable .ui-state-default { background: #f4f4f4; color: #b4b3b3; }
61
+ .ui-datepicker-calendar td:first-child .ui-state-active { width: 29px; margin-left: 0; }
62
+ .ui-datepicker-calendar td:last-child .ui-state-active { width: 29px; margin-right: 0; }
63
+ .ui-datepicker-calendar tr:last-child .ui-state-active { height: 29px; margin-bottom: 0; }
library/jquery.adrotate.datepicker.fallback.js ADDED
@@ -0,0 +1,28 @@
1
+ /*
2
+ Fallback datepicker for non-compliant browsers
3
+ Arnan de Gans (http://www.arnan.me)
4
+ Version: 0.1
5
+ Original code: Arnan de Gans
6
+ */
7
+
8
+ /* ------------------------------------------------------------------------------------
9
+ * COPYRIGHT AND TRADEMARK NOTICE
10
+ * Copyright 2008-2018 Arnan de Gans. All Rights Reserved.
11
+ * ADROTATE is a trademark of Arnan de Gans.
12
+
13
+ * COPYRIGHT NOTICES AND ALL THE COMMENTS SHOULD REMAIN INTACT.
14
+ * By using this code you agree to indemnify Arnan de Gans from any
15
+ * liability that might arise from it's use.
16
+ ------------------------------------------------------------------------------------ */
17
+
18
+ (function($) {
19
+ $(document).ready(function() {
20
+ var elem = document.createElement('input');
21
+ elem.setAttribute('type', 'date');
22
+
23
+ if(elem.type === 'text') {
24
+ $('#startdate_picker').datepicker({dateFormat: 'dd/mm/yy'});
25
+ $('#enddate_picker').datepicker({dateFormat: 'dd/mm/yy'});
26
+ }
27
+ });
28
+ }(jQuery));
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.arnan.me/#donate
4
Tags: ad, advert, adsense, advertising, doubleclick, responsive, ad rotator, ad manager, banner manager, advert manager, analytics, advertisement,
5
Requires at least: 3.8
6
Tested up to: 4.9
7
- Stable tag: 4.10
8
License: GPLv3
9
10
Monetise your website with adverts while keeping things simple. Start making money today!
@@ -23,16 +23,16 @@ AdRotate looks and feels similar to the WordPress dashboard you already know, yo
23
24
Want more features? Get AdRotate Professional! AdRotate Pro has even more features and gives you access to AdRotate Geo and fast personal email support!
25
Pro features include; Geo targeting in every country, Fine grained control with schedules, Adblock Disguise, Mobile adverts, Media/asset management and much more!
26
- Check out the many extras on the [AdRotate Pro website](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate-free)!
27
28
<strong>Getting started</strong>
29
You'll be running your advertising campaigns in minutes.
30
- But if you need a hand installing AdRotate or you want someone to handle the initial setup. Take a look at these [services](https://ajdg.solutions/pricing/?utm_campaign=installation_services&utm_medium=readme&utm_source=adrotate-free).
31
32
> Getting started with AdRotate is not all that complex, but a little help or advise is never bad.
33
34
<strong>Support and Bug Reports</strong>
35
- All support questions can be posted on my support [Support Forums](https://ajdg.solutions/forums/?utm_campaign=forums&utm_medium=readme&utm_source=adrotate-free).
36
Please post bug reports for AdRotate Pro on [the support forum for bug reports](https://ajdg.solutions/forums/forum/adrotate-for-wordpress/bug-reports/).
37
38
> I don't always check the wordpress.org forums, use my forum instead for faster replies!
@@ -69,7 +69,7 @@ Please post bug reports for AdRotate Pro on [the support forum for bug reports](
69
* Dashboard notifications when ads are about to expire or need attention
70
* Use shortcodes, widgets or PHP to put ads on your site
71
72
- AdRotate and AdRotate Pro share many features. But some features are available in AdRotate Professional only. Learn more about [AdRotate Pro](https://ajdg.solutions/plugins/adrotate-for-wordpress/features/?utm_campaign=features&utm_medium=readme&utm_source=adrotate-free) on my website.
73
74
**AdRotate Switch**
75
@@ -83,7 +83,7 @@ Check out [AdRotate Switch](https://wordpress.org/plugins/adrotate-switch/) for
83
84
Installing the plugin is as easy as clicking "Install Now" from your dashboards plugin page.
85
86
- For more detailed instructions check out the [installation steps](https://ajdg.solutions/manuals/adrotate-manuals/installing-adrotate-on-your-website/?utm_campaign=setup-manual&utm_medium=readme&utm_source=adrotate-free) on the AdRotate website.
87
88
== Frequently Asked Questions ==
89
@@ -91,41 +91,46 @@ For more detailed instructions check out the [installation steps](https://ajdg.s
91
Maybe. Take a look at [AdRotate Switch](https://wordpress.org/plugins/adrotate-switch/) and see if your current advertising plugin is compatible for migrating your data!
92
93
= How do I use AdRotate =
94
- There are [user guides](https://ajdg.solutions/manuals/adrotate-manuals/?utm_campaign=adrotate-manual&utm_medium=readme&utm_source=adrotate-free) with every popular feature explained.
95
- You can also post your questions on the [forum](https://ajdg.solutions/forums/?utm_campaign=forums&utm_medium=readme&utm_source=adrotate-free)!
96
97
== Changelog ==
98
99
- Be a Professional and go Pro. With [AdRotate Professional](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate-free)!
100
-
101
-
102
- = 4.10 FREE =
103
- * [fix] Improved integration with Jetpack Photon
104
- * [fix] Improved PHP7.2+ compatibility
105
- * [new] Date pickers for advert scheduling
106
- * [change] Compatibility with Borlabs Cache 1.1.9.1+
107
-
108
- = 4.12 PRO =
109
- * [fix] Improved integration with Jetpack Photon
110
- * [fix] Improved PHP7.2+ compatibility
111
- * [fix] Improved compatibility with Google Global Tag (gtag.js)
112
- * [fix] Statistics display for 'the best' and 'the worst'
113
- * [new] Date pickers for schedules
114
- * [new] Date pickers for statistics export
115
- * [new] Set a tracking value for clicks in Google Analytics
116
- * [new] Set a tracking value for impressions in Google Analytics
117
- * [new] Network group widget for multisite networks
118
- * [change] Compatibility with Borlabs Cache 1.1.9.1+
119
- * [change] Advert and group widgets no longer support multisite
120
-
121
- All recent changes are available on the [AdRotate website](https://ajdg.solutions/plugins/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
122
123
== Upgrade Notice ==
124
125
- * [fix] Improved integration with Jetpack Photon
126
- * [fix] Improved PHP7.2+ compatibility
127
- * [new] Date pickers for advert scheduling
128
- * [change] Compatibility with Borlabs Cache 1.1.9.1+
129
130
== Screenshots ==
131
4
Tags: ad, advert, adsense, advertising, doubleclick, responsive, ad rotator, ad manager, banner manager, advert manager, analytics, advertisement,
5
Requires at least: 3.8
6
Tested up to: 4.9
7
+ Stable tag: 4.11
8
License: GPLv3
9
10
Monetise your website with adverts while keeping things simple. Start making money today!
23
24
Want more features? Get AdRotate Professional! AdRotate Pro has even more features and gives you access to AdRotate Geo and fast personal email support!
25
Pro features include; Geo targeting in every country, Fine grained control with schedules, Adblock Disguise, Mobile adverts, Media/asset management and much more!
26
+ Check out the many extras on the [AdRotate Pro website](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate)!
27
28
<strong>Getting started</strong>
29
You'll be running your advertising campaigns in minutes.
30
+ But if you need a hand installing AdRotate or you want someone to handle the initial setup. Take a look at these [services](https://ajdg.solutions/pricing/?utm_campaign=installation_services&utm_medium=readme&utm_source=adrotate).
31
32
> Getting started with AdRotate is not all that complex, but a little help or advise is never bad.
33
34
<strong>Support and Bug Reports</strong>
35
+ All support questions can be posted on my support [Support Forums](https://ajdg.solutions/forums/?utm_campaign=forums&utm_medium=readme&utm_source=adrotate).
36
Please post bug reports for AdRotate Pro on [the support forum for bug reports](https://ajdg.solutions/forums/forum/adrotate-for-wordpress/bug-reports/).
37
38
> I don't always check the wordpress.org forums, use my forum instead for faster replies!
69
* Dashboard notifications when ads are about to expire or need attention
70
* Use shortcodes, widgets or PHP to put ads on your site
71
72
+ AdRotate and AdRotate Pro share many features. But some features are available in AdRotate Professional only. Learn more about [AdRotate Pro](https://ajdg.solutions/plugins/adrotate-for-wordpress/features/?utm_campaign=features&utm_medium=readme&utm_source=adrotate) on my website.
73
74
**AdRotate Switch**
75
83
84
Installing the plugin is as easy as clicking "Install Now" from your dashboards plugin page.
85
86
+ For more detailed instructions check out the [installation steps](https://ajdg.solutions/manuals/adrotate-manuals/installing-adrotate-on-your-website/?utm_campaign=setup-manual&utm_medium=readme&utm_source=adrotate) on the AdRotate website.
87
88
== Frequently Asked Questions ==
89
91
Maybe. Take a look at [AdRotate Switch](https://wordpress.org/plugins/adrotate-switch/) and see if your current advertising plugin is compatible for migrating your data!
92
93
= How do I use AdRotate =
94
+ There are [user guides](https://ajdg.solutions/manuals/adrotate-manuals/?utm_campaign=adrotate-manual&utm_medium=readme&utm_source=adrotate) with every popular feature explained.
95
+ You can also post your questions on the [forum](https://ajdg.solutions/forums/?utm_campaign=forums&utm_medium=readme&utm_source=adrotate)!
96
97
== Changelog ==
98
99
+ Be a Professional and go Pro. With [AdRotate Professional](https://ajdg.solutions/plugins/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate)!
100
+
101
+
102
+ = 4.11 FREE =
103
+ * [change] Widgets loaded via WordPress method
104
+ * [change] Dashboard tweaks and improvements
105
+ * [change] Caching notifications optimised
106
+ * [fix] Datepickers not working in Safari (macOS)
107
+
108
+ = 4.13 PRO =
109
+ * Legacy widgets removed, set up new widgets!
110
+ * [new] Delete unused advert images from Maintenance
111
+ * [change] 'AdRotate (Old)' widget removed
112
+ * [change] Widgets loaded via WordPress method
113
+ * [change] Dashboard tweaks and improvements
114
+ * [change] Caching notifications optimised
115
+ * [change] Redid the maintenance dashboard
116
+ * [fix] Google Adsense event names inconsistent
117
+ * [fix] Google Adsense showing wrong banner names
118
+ * [fix] Google Adsense output incorrent
119
+ * [fix] Google Adsense not applying data values
120
+ * [fix] Export column headers mixed up for some users
121
+ * [fix] Datepickers not working in Safari (macOS)
122
+ * [fix] Not being able to select gtag.js in settings
123
+ * [fix] Nothing showing in network widget on primary site
124
+ * [fix] Nothing showing in network widget if there are no groups
125
+
126
+ All recent changes are available on the [AdRotate website](https://ajdg.solutions/plugins/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate).
127
128
== Upgrade Notice ==
129
130
+ * [change] Widgets loaded via WordPress method
131
+ * [change] Dashboard tweaks and improvements
132
+ * [change] Caching notifications optimised
133
+ * [fix] Datepickers not working in Safari (macOS)
134
135
== Screenshots ==
136