AdRotate Banner Manager - Version 5.8

Version Description

Enjoy this latest update with the latest tweaks and fixes to further improve AdRotate for WordPress!

Download this release

Release Info

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

Code changes from version 5.7.1 to 5.8

adrotate-functions.php CHANGED
@@ -431,19 +431,10 @@ function adrotate_ad_is_in_groups($id) {
431
Since: 3.9.12
432
-------------------------------------------------------------*/
433
function adrotate_hash($ad, $group = 0, $blog_id = 0) {
434
- global $adrotate_debug, $adrotate_config;
435
436
- if($adrotate_debug['timers'] == true) {
437
- $timer = 0;
438
- } else {
439
- $timer = $adrotate_config['impression_timer'];
440
- }
441
-
442
- if($adrotate_debug['track'] == true) {
443
- return "$ad,$group,$blog_id,$timer";
444
- } else {
445
- return base64_encode("$ad,$group,$blog_id,$timer");
446
- }
447
}
448
449
/*-------------------------------------------------------------
431
Since: 3.9.12
432
-------------------------------------------------------------*/
433
function adrotate_hash($ad, $group = 0, $blog_id = 0) {
434
+ global $adrotate_config;
435
436
+ $timer = $adrotate_config['impression_timer'];
437
+ return base64_encode("$ad,$group,$blog_id,$timer");
438
}
439
440
/*-------------------------------------------------------------
adrotate-manage-publisher.php CHANGED
@@ -753,16 +753,6 @@ function adrotate_options_submit() {
753
754
update_option('adrotate_config', $config);
755
}
756
-
757
- if($settings_tab == 'maintenance') {
758
- $debug = get_option('adrotate_debug');
759
-
760
- $debug['general'] = (isset($_POST['adrotate_debug'])) ? true : false;
761
- $debug['timers'] = (isset($_POST['adrotate_debug_timers'])) ? true : false;
762
- $debug['track'] = (isset($_POST['adrotate_debug_track'])) ? true : false;
763
-
764
- update_option('adrotate_debug', $debug);
765
- }
766
767
// Return to dashboard
768
adrotate_return('adrotate-settings', 400, array('tab' => $settings_tab));
753
754
update_option('adrotate_config', $config);
755
}
756
757
// Return to dashboard
758
adrotate_return('adrotate-settings', 400, array('tab' => $settings_tab));
adrotate-output.php CHANGED
@@ -391,7 +391,7 @@ function adrotate_preview($banner_id) {
391
Since: 3.0
392
-------------------------------------------------------------*/
393
function adrotate_ad_output($id, $group = 0, $name, $bannercode, $tracker, $image) {
394
- global $blog_id, $adrotate_debug, $adrotate_config;
395
396
$banner_output = $bannercode;
397
$banner_output = stripslashes(htmlspecialchars_decode($banner_output, ENT_QUOTES));
@@ -415,9 +415,6 @@ function adrotate_ad_output($id, $group = 0, $name, $bannercode, $tracker, $imag
415
unset($value, $regs, $result);
416
}
417
}
418
- if($adrotate_debug['timers'] == true) {
419
- $banner_output = str_ireplace('<a ', '<a data-debug="1" ', $banner_output);
420
- }
421
}
422
}
423
@@ -555,25 +552,15 @@ function adrotate_nonce_error() {
555
Since: 3.0
556
-------------------------------------------------------------*/
557
function adrotate_error($action, $arg = null) {
558
- global $adrotate_debug;
559
-
560
switch($action) {
561
// Ads
562
case "ad_expired" :
563
- if($adrotate_debug['general'] == true) {
564
- $result = '<span style="font-weight: bold; color: #f00;">'.__('Error, Ad is not available at this time due to schedule/geolocation restrictions or does not exist!', 'adrotate').'</span>';
565
- } else {
566
- $result = '<!-- '.__('Error, Ad is not available at this time due to schedule/geolocation restrictions!', 'adrotate').' -->';
567
- }
568
return $result;
569
break;
570
571
case "ad_unqualified" :
572
- if($adrotate_debug['general'] == true) {
573
- $result = '<span style="font-weight: bold; color: #f00;">'.__('Either there are no banners, they are disabled or none qualified for this location!', 'adrotate').'</span>';
574
- } else {
575
- $result = '<!-- '.__('Either there are no banners, they are disabled or none qualified for this location!', 'adrotate').' -->';
576
- }
577
return $result;
578
break;
579
@@ -661,6 +648,12 @@ function adrotate_dashboard_error() {
661
if(!is_writable(WP_CONTENT_DIR."/".$adrotate_config['banner_folder'])) {
662
$error['banners_folder'] = __('Your AdRotate Banner folder is not writable or does not exist.', 'adrotate').' <a href="https://ajdg.solutions/manuals/adrotate-manuals/manage-banner-images/" target="_blank">'.__('Set up your banner folder', 'adrotate').'</a>.';
663
}
664
665
$error = (isset($error) AND is_array($error)) ? $error : false;
666
@@ -803,24 +796,13 @@ function adrotate_help_info() {
803
'<strong>Personal:</strong> Take a look at the <a href="https://www.arnan.me/?pk_campaign=adrotatefree&pk_keyword=helptab" target="_blank">arnan.me website</a>, also Arnan has <a href="https://www.twitter.com/arnandegans/" target="_blank">Twitter</a> and he is on <a href="https://linkedin.com/in/arnandegans/" target="_blank">LinkedIn</a>.</p>'
804
)
805
);
806
- $screen->add_help_tab(array(
807
- 'id' => 'adrotate_partners',
808
- 'title' => 'Advertising Partners',
809
- 'content' => '<h4>Our partners</h4>'.
810
- '<p>Try these great advertising partners for getting relevant adverts to your site. Increase revenue with their contextual adverts and earn more money with AdRotate!</p>'.
811
-
812
- '<p><strong>Media.net:</strong> <a href="https://ajdg.solutions/go/medianet/" target="_blank">Sign up for Media.net Contextual Adverts</a><br />Get 10% extra earnings commission for the first 3 months!</p>'.
813
-
814
- '<p><small><em>These are affiliate links, using them costs you nothing but helps with the future of AdRotate!</em></small></p>'
815
- )
816
- );
817
$screen->add_help_tab(array(
818
'id' => 'adrotate_support',
819
'title' => 'Getting Support',
820
'content' => '<h4>Get help using AdRotate</h4>'.
821
'<p>Everyone needs some help sometimes. AdRotate has many guides and manuals as well as a Support Forum on the AdRotate website to get you going.<br />All the relevant links to getting help and the Professional Services I offer can be found on the <a href="'.admin_url('admin.php?page=adrotate-support').'">Support dashboard</a>.</p>'.
822
823
- '<p>Take a look at the <a href="https://ajdg.solutions/support/adrotate-manuals/?pk_campaign=adrotatefree&pk_keyword=helptab" target="_blank">AdRotate Manuals</a> and the <a href="https://ajdg.solutions/forums/forum/adrotate-for-wordpress/?pk_campaign=adrotatefree&pk_keyword=helptab" target="_blank">Support Forum</a> here.</p>'
824
)
825
);
826
}
391
Since: 3.0
392
-------------------------------------------------------------*/
393
function adrotate_ad_output($id, $group = 0, $name, $bannercode, $tracker, $image) {
394
+ global $blog_id, $adrotate_config;
395
396
$banner_output = $bannercode;
397
$banner_output = stripslashes(htmlspecialchars_decode($banner_output, ENT_QUOTES));
415
unset($value, $regs, $result);
416
}
417
}
418
}
419
}
420
552
Since: 3.0
553
-------------------------------------------------------------*/
554
function adrotate_error($action, $arg = null) {
555
switch($action) {
556
// Ads
557
case "ad_expired" :
558
+ $result = '<!-- '.__('Error, Ad is not available at this time due to schedule/geolocation restrictions!', 'adrotate').' -->';
559
return $result;
560
break;
561
562
case "ad_unqualified" :
563
+ $result = '<!-- '.__('Either there are no banners, they are disabled or none qualified for this location!', 'adrotate').' -->';
564
return $result;
565
break;
566
648
if(!is_writable(WP_CONTENT_DIR."/".$adrotate_config['banner_folder'])) {
649
$error['banners_folder'] = __('Your AdRotate Banner folder is not writable or does not exist.', 'adrotate').' <a href="https://ajdg.solutions/manuals/adrotate-manuals/manage-banner-images/" target="_blank">'.__('Set up your banner folder', 'adrotate').'</a>.';
650
}
651
+ if(is_dir(WP_PLUGIN_DIR."/adrotate-pro/")) {
652
+ $error['adrotate_exists'] = __('You have the AdRotate Professional installed. Please check out the upgrade manual and switch over to AdRotate Pro!', 'adrotate-pro').' <a href="https://ajdg.solutions/support/adrotate-manuals/upgrade-adrotate-to-adrotate-pro/" target="_blank">'.__('Upgrade instructions', 'adrotate-pro').'</a>.';
653
+ }
654
+ if(is_dir(WP_PLUGIN_DIR."/adrotate_new/") OR is_dir(WP_PLUGIN_DIR."/adrotate-pro_new/")) {
655
+ $error['adrotate_exists'] = __('Something is wrong with your installation of AdRotate. Either the plugin is installed twice or your current installation has the wrong folder name. Please install the plugin properly!', 'adrotate-pro').' <a href="https://ajdg.solutions/support/adrotate-manuals/installing-adrotate-on-your-website/" target="_blank">'.__('Installation instructions', 'adrotate-pro').'</a>.';
656
+ }
657
658
$error = (isset($error) AND is_array($error)) ? $error : false;
659
796
'<strong>Personal:</strong> Take a look at the <a href="https://www.arnan.me/?pk_campaign=adrotatefree&pk_keyword=helptab" target="_blank">arnan.me website</a>, also Arnan has <a href="https://www.twitter.com/arnandegans/" target="_blank">Twitter</a> and he is on <a href="https://linkedin.com/in/arnandegans/" target="_blank">LinkedIn</a>.</p>'
797
)
798
);
799
$screen->add_help_tab(array(
800
'id' => 'adrotate_support',
801
'title' => 'Getting Support',
802
'content' => '<h4>Get help using AdRotate</h4>'.
803
'<p>Everyone needs some help sometimes. AdRotate has many guides and manuals as well as a Support Forum on the AdRotate website to get you going.<br />All the relevant links to getting help and the Professional Services I offer can be found on the <a href="'.admin_url('admin.php?page=adrotate-support').'">Support dashboard</a>.</p>'.
804
805
+ '<p>Take a look at the <a href="https://ajdg.solutions/support/adrotate-manuals/?pk_campaign=adrotatefree&pk_keyword=helptab" target="_blank">AdRotate Manuals</a> and the <a href="https://ajdg.solutions/forums/forum/adrotate-for-wordpress/?pk_campaign=adrotatefree&pk_keyword=helptab" target="_blank">Support Forum</a> here. Also check out <a href="https://ajdg.solutions/recommended-products/?pk_campaign=adrotatepro&pk_keyword=helptab" target="_blank">recommended products and services</a> I use.</p>'
806
)
807
);
808
}
adrotate-setup.php CHANGED
@@ -41,17 +41,15 @@ function adrotate_activate_setup() {
41
global $wpdb, $userdata;
42
43
if(version_compare(PHP_VERSION, '5.6.0', '<') == -1) {
44
- deactivate_plugins(plugin_basename('adrotate/adrotate.php'));
45
wp_die('AdRotate 5.0 and newer requires PHP 5.6 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to dashboard</a>.');
46
return;
47
} else {
48
if(!current_user_can('activate_plugins')) {
49
- deactivate_plugins(plugin_basename('adrotate/adrotate.php'));
50
wp_die('You do not have appropriate access to activate this plugin! Contact your administrator!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to dashboard</a>.');
51
return;
52
} else {
53
- deactivate_plugins(plugin_basename('adrotate-pro/adrotate-pro.php'));
54
-
55
// Set defaults for internal versions
56
add_option('adrotate_db_version', array('current' => ADROTATE_DB_VERSION, 'previous' => ''));
57
add_option('adrotate_version', array('current' => ADROTATE_VERSION, 'previous' => ''));
@@ -60,8 +58,6 @@ function adrotate_activate_setup() {
60
add_option('adrotate_config', array());
61
add_option('adrotate_notifications', array());
62
add_option('adrotate_crawlers', array());
63
- add_option('adrotate_db_timer', date('U'));
64
- add_option('adrotate_debug', array('general' => false, 'timers' => false, 'track' => false));
65
add_option('adrotate_advert_status', array('error' => 0, 'expired' => 0, 'expiressoon' => 0, 'normal' => 0, 'total' => 0));
66
add_option('adrotate_geo_required', 0);
67
add_option('adrotate_geo_requests', 0);
@@ -167,12 +163,10 @@ function adrotate_check_config() {
167
$config = get_option('adrotate_config');
168
$notifications = get_option('adrotate_notifications');
169
$crawlers = get_option('adrotate_crawlers');
170
- $debug = get_option('adrotate_debug');
171
172
if(!isset($config)) $config = array();
173
if(!isset($notifications)) $notifications = array();
174
if(!isset($crawlers)) $crawlers = array();
175
- if(!isset($debug)) $debug = array();
176
177
if(!isset($config['advertiser'])) $config['advertiser'] = 'subscriber';
178
if(!isset($config['global_report'])) $config['global_report'] = 'administrator';
@@ -218,11 +212,6 @@ function adrotate_check_config() {
218
219
if(!isset($crawlers) OR count($crawlers) < 1) $crawlers = array("008", "bot", "crawler", "spider", "Accoona-AI-Agent", "alexa", "Arachmo", "B-l-i-t-z-B-O-T", "boitho.com-dc", "Cerberian Drtrs","Charlotte", "cosmos", "Covario IDS", "DataparkSearch","FindLinks", "Holmes", "htdig", "ia_archiver", "ichiro", "inktomi", "igdeSpyder", "L.webis", "Larbin", "LinkWalker", "lwp-trivial", "mabontland", "Mnogosearch", "mogimogi", "Morning Paper", "MVAClient", "NetResearchServer", "NewsGator", "NG-Search", "NutchCVS", "Nymesis", "oegp", "Orbiter", "Peew", "Pompos", "PostPost", "PycURL", "Qseero", "Radian6", "SBIder", "ScoutJet", "Scrubby", "SearchSight", "semanticdiscovery", "ShopWiki", "silk", "Snappy", "Sqworm", "StackRambler", "Teoma", "TinEye", "truwoGPS", "updated", "Vagabondo", "Vortex", "voyager", "VYU2", "webcollage", "Websquash.com", "wf84", "WomlpeFactory", "yacy", "Yahoo! Slurp", "Yahoo! Slurp China", "YahooSeeker", "YahooSeeker-Testing", "YandexImages", "Yeti", "yoogliFetchAgent", "Zao", "ZyBorg", "froogle","looksmart", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "Scooter", "appie", "WebBug", "Spade", "rabaz", "TechnoratiSnoop");
220
update_option('adrotate_crawlers', $crawlers);
221
-
222
- if(!isset($debug['general'])) $debug['general'] = false;
223
- if(!isset($debug['timers'])) $debug['timers'] = false;
224
- if(!isset($debug['track'])) $debug['track'] = false;
225
- update_option('adrotate_debug', $debug);
226
}
227
228
/*-------------------------------------------------------------
@@ -243,29 +232,30 @@ function adrotate_dummy_data() {
243
244
if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
245
// Demo ad 1
246
- $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo banner 468x60', 'bannercode' => '&lt;a href=\&quot;http:\/\/ajdg.net/landing.php?src=adrotate\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/banners/adrotate-468x60.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
247
$ad_id = $wpdb->insert_id;
248
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
249
$schedule_id = $wpdb->insert_id;
250
$wpdb->insert("{$wpdb->prefix}adrotate_linkmeta", array('ad' => $ad_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id));
251
unset($ad_id, $schedule_id);
252
253
// Demo ad 2
254
- $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo banner 728x90', 'bannercode' => '&lt;a href=\&quot;http:\/\/ajdg.net/landing.php?src=adrotate\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/banners/adrotate-728x90.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'tracker' => 'Y', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
255
$ad_id = $wpdb->insert_id;
256
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
257
$schedule_id = $wpdb->insert_id;
258
$wpdb->insert("{$wpdb->prefix}adrotate_linkmeta", array('ad' => $ad_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id));
259
unset($ad_id, $schedule_id);
260
}
261
}
262
263
/*-------------------------------------------------------------
264
Name: adrotate_database_install
265
-
266
Purpose: Creates database table if it doesnt exist
267
- Receive: -none-
268
- Return: -none-
269
Since: 3.0.3
270
-------------------------------------------------------------*/
271
function adrotate_database_install() {
@@ -312,7 +302,9 @@ function adrotate_database_install() {
312
`budget` double NOT NULL default '0',
313
`crate` double NOT NULL default '0',
314
`irate` double NOT NULL default '0',
315
`cities` text NOT NULL,
316
`countries` text NOT NULL,
317
PRIMARY KEY (`id`)
318
) ".$charset_collate.$engine.";");
@@ -415,19 +407,15 @@ function adrotate_database_install() {
415
416
/*-------------------------------------------------------------
417
Name: adrotate_check_upgrade
418
-
419
Purpose: Checks if the plugin needs to upgrade stuff upon activation
420
- Receive: -none-
421
- Return: -none-
422
Since: 3.7.3
423
-------------------------------------------------------------*/
424
function adrotate_check_upgrade() {
425
global $wpdb;
426
427
- if(version_compare(PHP_VERSION, '5.3.0', '<') == -1) {
428
- deactivate_plugins(plugin_basename('adrotate/adrotate.php'));
429
- wp_die('AdRotate 3.10.8 and up requires PHP 5.3 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to plugins</a>.');
430
- return;
431
} else {
432
$adrotate_db_version = get_option("adrotate_db_version");
433
if($adrotate_db_version['current'] < ADROTATE_DB_VERSION) {
@@ -447,10 +435,7 @@ function adrotate_check_upgrade() {
447
448
/*-------------------------------------------------------------
449
Name: adrotate_database_upgrade
450
-
451
Purpose: Upgrades AdRotate where required
452
- Receive: -none-
453
- Return: -none-
454
Since: 3.0.3
455
-------------------------------------------------------------*/
456
function adrotate_database_upgrade() {
@@ -518,6 +503,13 @@ function adrotate_database_upgrade() {
518
$wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_transactions`");
519
}
520
521
update_option("adrotate_db_version", array('current' => ADROTATE_DB_VERSION, 'previous' => $adrotate_db_version['current']));
522
}
523
@@ -662,88 +654,69 @@ function adrotate_core_upgrade() {
662
}
663
664
/*-------------------------------------------------------------
665
- Name: adrotate_optimize_database
666
- Purpose: Optimizes all AdRotate tables
667
- Since: 3.4
668
- -------------------------------------------------------------*/
669
- function adrotate_optimize_database() {
670
- global $wpdb;
671
-
672
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
673
-
674
- $adrotate_db_timer = get_option('adrotate_db_timer');
675
- $now = adrotate_now();
676
-
677
- if($adrotate_db_timer < ($now - DAY_IN_SECONDS)) {
678
- dbDelta("OPTIMIZE TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_stats_archive`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_transactions`;");
679
- dbDelta("REPAIR TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_stats_archive`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_transactions`;");
680
- update_option('adrotate_db_timer', $now);
681
- adrotate_return('adrotate-settings', 403, array('tab' => 'maintenance'));
682
- } else {
683
- adrotate_return('adrotate-settings', 504, array('tab' => 'maintenance'));
684
- }
685
- }
686
-
687
- /*-------------------------------------------------------------
688
- Name: adrotate_cleanup_database
689
Purpose: Clean AdRotate tables
690
- Since: 3.5
691
-------------------------------------------------------------*/
692
- function adrotate_cleanup_database() {
693
- global $wpdb;
694
695
$now = adrotate_now();
696
-
697
- // Delete old stats
698
- if(isset($_POST['adrotate_db_cleanup_statistics'])) {
699
- $lastyear = $now - (DAY_IN_SECONDS * 365);
700
- $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_stats` WHERE `thetime` < $lastyear;");
701
- }
702
-
703
- // Delete export files
704
- if(isset($_POST['adrotate_db_cleanup_exportfiles'])) {
705
- array_map('unlink', glob(WP_CONTENT_DIR.'/reports/AdRotate_export_*.csv'));
706
- }
707
708
// Clean up Tracker data
709
$yesterday = $now - DAY_IN_SECONDS;
710
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_tracker` WHERE `timer` < $yesterday;");
711
712
// Delete empty ads, groups and schedules
713
- $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' OR `type` = 'a_empty' OR `type` = 'generator';");
714
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '';");
715
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_schedule` WHERE `name` = '';");
716
- $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_transactions` WHERE `reference` = '';");
717
718
- // Clean up meta data and schedules
719
$ads = $wpdb->get_results("SELECT `id` FROM `{$wpdb->prefix}adrotate` ORDER BY `id`;");
720
- $metas = $wpdb->get_results("SELECT `id`, `ad`, `schedule` FROM `{$wpdb->prefix}adrotate_linkmeta` ORDER BY `id`;");
721
-
722
- $adverts = $linkmeta = $schedules = array();
723
foreach($ads as $ad) {
724
$adverts[$ad->id] = $ad->id;
725
}
726
foreach($metas as $meta) {
727
$linkmeta[$meta->id] = $meta->ad;
728
- if($meta->schedule > 0) $schedules[$meta->id] = $meta->schedule;
729
}
730
731
$delete_meta = array_diff($linkmeta, $adverts);
732
- $delete_schedule = array_diff($schedules, $adverts);
733
-
734
foreach($delete_meta as $meta => $advert) {
735
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `id` = {$meta};");
736
unset($delete_meta[$meta], $meta, $advert);
737
}
738
- foreach($delete_schedule as $meta => $schedule) {
739
- $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_schedule` WHERE `id` = {$schedule};");
740
- unset($delete_schedule[$meta], $meta, $schedule);
741
- }
742
- unset($ads, $metas, $adverts, $linkmeta, $delete_meta, $delete_schedule);
743
744
// Clean up stray linkmeta
745
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = 0 OR `ad` = '';");
746
747
adrotate_return('adrotate-settings', 406, array('tab' => 'maintenance'));
748
}
749
@@ -755,9 +728,8 @@ function adrotate_cleanup_database() {
755
function adrotate_empty_trackerdata() {
756
global $wpdb;
757
758
- $now = adrotate_now();
759
- $clicks = $now - DAY_IN_SECONDS;
760
- $impressions = $now - HOUR_IN_SECONDS;
761
762
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_tracker` WHERE `timer` < {$impressions} AND `stat` = 'i';");
763
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_tracker` WHERE `timer` < {$clicks} AND `stat` = 'c';");
41
global $wpdb, $userdata;
42
43
if(version_compare(PHP_VERSION, '5.6.0', '<') == -1) {
44
+ deactivate_plugins('adrotate/adrotate.php');
45
wp_die('AdRotate 5.0 and newer requires PHP 5.6 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to dashboard</a>.');
46
return;
47
} else {
48
if(!current_user_can('activate_plugins')) {
49
+ deactivate_plugins('adrotate/adrotate.php');
50
wp_die('You do not have appropriate access to activate this plugin! Contact your administrator!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to dashboard</a>.');
51
return;
52
} else {
53
// Set defaults for internal versions
54
add_option('adrotate_db_version', array('current' => ADROTATE_DB_VERSION, 'previous' => ''));
55
add_option('adrotate_version', array('current' => ADROTATE_VERSION, 'previous' => ''));
58
add_option('adrotate_config', array());
59
add_option('adrotate_notifications', array());
60
add_option('adrotate_crawlers', array());
61
add_option('adrotate_advert_status', array('error' => 0, 'expired' => 0, 'expiressoon' => 0, 'normal' => 0, 'total' => 0));
62
add_option('adrotate_geo_required', 0);
63
add_option('adrotate_geo_requests', 0);
163
$config = get_option('adrotate_config');
164
$notifications = get_option('adrotate_notifications');
165
$crawlers = get_option('adrotate_crawlers');
166
167
if(!isset($config)) $config = array();
168
if(!isset($notifications)) $notifications = array();
169
if(!isset($crawlers)) $crawlers = array();
170
171
if(!isset($config['advertiser'])) $config['advertiser'] = 'subscriber';
172
if(!isset($config['global_report'])) $config['global_report'] = 'administrator';
212
213
if(!isset($crawlers) OR count($crawlers) < 1) $crawlers = array("008", "bot", "crawler", "spider", "Accoona-AI-Agent", "alexa", "Arachmo", "B-l-i-t-z-B-O-T", "boitho.com-dc", "Cerberian Drtrs","Charlotte", "cosmos", "Covario IDS", "DataparkSearch","FindLinks", "Holmes", "htdig", "ia_archiver", "ichiro", "inktomi", "igdeSpyder", "L.webis", "Larbin", "LinkWalker", "lwp-trivial", "mabontland", "Mnogosearch", "mogimogi", "Morning Paper", "MVAClient", "NetResearchServer", "NewsGator", "NG-Search", "NutchCVS", "Nymesis", "oegp", "Orbiter", "Peew", "Pompos", "PostPost", "PycURL", "Qseero", "Radian6", "SBIder", "ScoutJet", "Scrubby", "SearchSight", "semanticdiscovery", "ShopWiki", "silk", "Snappy", "Sqworm", "StackRambler", "Teoma", "TinEye", "truwoGPS", "updated", "Vagabondo", "Vortex", "voyager", "VYU2", "webcollage", "Websquash.com", "wf84", "WomlpeFactory", "yacy", "Yahoo! Slurp", "Yahoo! Slurp China", "YahooSeeker", "YahooSeeker-Testing", "YandexImages", "Yeti", "yoogliFetchAgent", "Zao", "ZyBorg", "froogle","looksmart", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "Scooter", "appie", "WebBug", "Spade", "rabaz", "TechnoratiSnoop");
214
update_option('adrotate_crawlers', $crawlers);
215
}
216
217
/*-------------------------------------------------------------
232
233
if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
234
// Demo ad 1
235
+ $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo banner 468x60', 'bannercode' => '&lt;a href=\&quot;http:\/\/ajdg.net/landing.php?src=adrotate\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/banners/adrotate-468x60.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'state_req' => 'N', 'cities' => serialize(array()), 'states' => serialize(array()), 'countries' => serialize(array())));
236
+
237
$ad_id = $wpdb->insert_id;
238
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
239
$schedule_id = $wpdb->insert_id;
240
$wpdb->insert("{$wpdb->prefix}adrotate_linkmeta", array('ad' => $ad_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id));
241
+
242
unset($ad_id, $schedule_id);
243
244
// Demo ad 2
245
+ $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo banner 728x90', 'bannercode' => '&lt;a href=\&quot;http:\/\/ajdg.net/landing.php?src=adrotate\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/banners/adrotate-728x90.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'tracker' => 'Y', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'state_req' => 'N', 'cities' => serialize(array()), 'states' => serialize(array()), 'countries' => serialize(array())));
246
+
247
$ad_id = $wpdb->insert_id;
248
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
249
$schedule_id = $wpdb->insert_id;
250
$wpdb->insert("{$wpdb->prefix}adrotate_linkmeta", array('ad' => $ad_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id));
251
+
252
unset($ad_id, $schedule_id);
253
}
254
}
255
256
/*-------------------------------------------------------------
257
Name: adrotate_database_install
258
Purpose: Creates database table if it doesnt exist
259
Since: 3.0.3
260
-------------------------------------------------------------*/
261
function adrotate_database_install() {
302
`budget` double NOT NULL default '0',
303
`crate` double NOT NULL default '0',
304
`irate` double NOT NULL default '0',
305
+ `state_req` char(1) NOT NULL default 'N',
306
`cities` text NOT NULL,
307
+ `states` text NOT NULL,
308
`countries` text NOT NULL,
309
PRIMARY KEY (`id`)
310
) ".$charset_collate.$engine.";");
407
408
/*-------------------------------------------------------------
409
Name: adrotate_check_upgrade
410
Purpose: Checks if the plugin needs to upgrade stuff upon activation
411
Since: 3.7.3
412
-------------------------------------------------------------*/
413
function adrotate_check_upgrade() {
414
global $wpdb;
415
416
+ if(version_compare(PHP_VERSION, '5.6.0', '<') == -1) {
417
+ deactivate_plugins(plugin_basename('adrotate-pro/adrotate-pro.php'));
418
+ wp_die('AdRotate 5.0 and newer requires PHP 5.6 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to dashboard</a>.');
419
} else {
420
$adrotate_db_version = get_option("adrotate_db_version");
421
if($adrotate_db_version['current'] < ADROTATE_DB_VERSION) {
435
436
/*-------------------------------------------------------------
437
Name: adrotate_database_upgrade
438
Purpose: Upgrades AdRotate where required
439
Since: 3.0.3
440
-------------------------------------------------------------*/
441
function adrotate_database_upgrade() {
503
$wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_transactions`");
504
}
505
506
+ // Database: 66
507
+ // AdRotate: 5.8
508
+ if($adrotate_db_version['current'] < 66) {
509
+ adrotate_add_column("{$wpdb->prefix}adrotate", 'states', 'text NOT NULL AFTER `cities`');
510
+ adrotate_add_column("{$wpdb->prefix}adrotate", 'state_req', 'char(1) NOT NULL default \'N\' AFTER `irate`');
511
+ }
512
+
513
update_option("adrotate_db_version", array('current' => ADROTATE_DB_VERSION, 'previous' => $adrotate_db_version['current']));
514
}
515
654
}
655
656
/*-------------------------------------------------------------
657
+ Name: adrotate_clean_setup
658
Purpose: Clean AdRotate tables
659
+ Clean/delete AdRotate assets
660
+ Since: 5.8
661
-------------------------------------------------------------*/
662
+ function adrotate_clean_setup() {
663
+ global $wpdb, $adrotate_config;
664
665
$now = adrotate_now();
666
667
// Clean up Tracker data
668
$yesterday = $now - DAY_IN_SECONDS;
669
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_tracker` WHERE `timer` < $yesterday;");
670
671
// Delete empty ads, groups and schedules
672
+ $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' OR `type` = 'a_empty';");
673
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '';");
674
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_schedule` WHERE `name` = '';");
675
676
+ // Remove CSS from deleted groups
677
+ $groups = $wpdb->get_col("SELECT `id` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` != '' ORDER BY `id` ASC;");
678
+ $group_css = get_option('adrotate_group_css');
679
+ foreach($group_css as $group_id => $css) {
680
+ if(!array_key_exists($group_id, $groups)) {
681
+ unset($group_css[$group_id]);
682
+ }
683
+ }
684
+ update_option('adrotate_group_css', $group_css);
685
+ unset($groups, $group_css);
686
+
687
+ // Clean up meta data
688
$ads = $wpdb->get_results("SELECT `id` FROM `{$wpdb->prefix}adrotate` ORDER BY `id`;");
689
+ $metas = $wpdb->get_results("SELECT `id`, `ad` FROM `{$wpdb->prefix}adrotate_linkmeta` ORDER BY `id`;");
690
+
691
+ $adverts = $linkmeta = array();
692
foreach($ads as $ad) {
693
$adverts[$ad->id] = $ad->id;
694
}
695
foreach($metas as $meta) {
696
$linkmeta[$meta->id] = $meta->ad;
697
}
698
699
$delete_meta = array_diff($linkmeta, $adverts);
700
foreach($delete_meta as $meta => $advert) {
701
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `id` = {$meta};");
702
unset($delete_meta[$meta], $meta, $advert);
703
}
704
+ unset($ads, $metas, $adverts, $linkmeta, $delete_meta);
705
706
// Clean up stray linkmeta
707
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = 0 OR `ad` = '';");
708
709
+ // (Optionally) Delete old stats
710
+ if(isset($_POST['adrotate_db_cleanup_statistics'])) {
711
+ $lastyear = $now - (DAY_IN_SECONDS * 365);
712
+ $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_stats` WHERE `thetime` < $lastyear;");
713
+ }
714
+
715
+ // (Optionally) Delete export files
716
+ if(isset($_POST['adrotate_asset_cleanup_exportfiles'])) {
717
+ array_map('unlink', glob(WP_CONTENT_DIR.'/reports/AdRotate_export_*.csv'));
718
+ }
719
+
720
adrotate_return('adrotate-settings', 406, array('tab' => 'maintenance'));
721
}
722
728
function adrotate_empty_trackerdata() {
729
global $wpdb;
730
731
+ $clicks = adrotate_now() - DAY_IN_SECONDS;
732
+ $impressions = adrotate_now() - HOUR_IN_SECONDS;
733
734
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_tracker` WHERE `timer` < {$impressions} AND `stat` = 'i';");
735
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_tracker` WHERE `timer` < {$clicks} AND `stat` = 'c';");
adrotate-statistics.php CHANGED
@@ -437,7 +437,7 @@ function adrotate_archive_stats($id) {
437
Since: 3.11.3
438
-------------------------------------------------------------*/
439
function adrotate_count_impression($ad, $group = 0, $blog_id = 0) {
440
- global $wpdb, $adrotate_config, $adrotate_debug;
441
442
if(($adrotate_config['enable_loggedin_impressions'] == 'Y' AND is_user_logged_in()) OR !is_user_logged_in()) {
443
$now = adrotate_now();
@@ -449,11 +449,7 @@ function adrotate_count_impression($ad, $group = 0, $blog_id = 0) {
449
switch_to_blog($blog_id);
450
}
451
452
- if($adrotate_debug['timers'] == true) {
453
- $impression_timer = $now;
454
- } else {
455
- $impression_timer = $now - $adrotate_config['impression_timer'];
456
- }
457
458
if($remote_ip != "unknown" AND !empty($remote_ip)) {
459
$saved_timer = $wpdb->get_var($wpdb->prepare("SELECT `timer` FROM `{$wpdb->prefix}adrotate_tracker` WHERE `ipaddress` = '%s' AND `stat` = 'i' AND `bannerid` = %d ORDER BY `timer` DESC LIMIT 1;", $remote_ip, $ad));
@@ -485,12 +481,8 @@ function adrotate_impression_callback() {
485
define('DONOTCACHEDB', true);
486
define('DONOTCACHCEOBJECT', true);
487
488
- global $adrotate_debug;
489
-
490
$meta = $_POST['track'];
491
- if($adrotate_debug['track'] != true) {
492
- $meta = base64_decode($meta);
493
- }
494
495
$meta = esc_attr($meta);
496
// Don't use $impression_timer - It's for impressions used in javascript
@@ -510,13 +502,10 @@ function adrotate_click_callback() {
510
define('DONOTCACHEDB', true);
511
define('DONOTCACHCEOBJECT', true);
512
513
- global $wpdb, $adrotate_config, $adrotate_debug;
514
515
$meta = $_POST['track'];
516
-
517
- if($adrotate_debug['track'] != true) {
518
- $meta = base64_decode($meta);
519
- }
520
521
$meta = esc_attr($meta);
522
// Don't use $impression_timer - It's for impressions used in javascript
@@ -535,12 +524,7 @@ function adrotate_click_callback() {
535
if(adrotate_is_human() AND $remote_ip != "unknown" AND !empty($remote_ip)) {
536
$now = adrotate_now();
537
$today = adrotate_date_start('day');
538
-
539
- if($adrotate_debug['timers'] == true) {
540
- $click_timer = $now;
541
- } else {
542
- $click_timer = $now - $adrotate_config['click_timer'];
543
- }
544
545
$saved_timer = $wpdb->get_var($wpdb->prepare("SELECT `timer` FROM `{$wpdb->prefix}adrotate_tracker` WHERE `ipaddress` = '%s' AND `stat` = 'c' AND `bannerid` = %d ORDER BY `timer` DESC LIMIT 1;", $remote_ip, $ad));
546
if($saved_timer < $click_timer) {
437
Since: 3.11.3
438
-------------------------------------------------------------*/
439
function adrotate_count_impression($ad, $group = 0, $blog_id = 0) {
440
+ global $wpdb, $adrotate_config;
441
442
if(($adrotate_config['enable_loggedin_impressions'] == 'Y' AND is_user_logged_in()) OR !is_user_logged_in()) {
443
$now = adrotate_now();
449
switch_to_blog($blog_id);
450
}
451
452
+ $impression_timer = $now - $adrotate_config['impression_timer'];
453
454
if($remote_ip != "unknown" AND !empty($remote_ip)) {
455
$saved_timer = $wpdb->get_var($wpdb->prepare("SELECT `timer` FROM `{$wpdb->prefix}adrotate_tracker` WHERE `ipaddress` = '%s' AND `stat` = 'i' AND `bannerid` = %d ORDER BY `timer` DESC LIMIT 1;", $remote_ip, $ad));
481
define('DONOTCACHEDB', true);
482
define('DONOTCACHCEOBJECT', true);
483
484
$meta = $_POST['track'];
485
+ $meta = base64_decode($meta);
486
487
$meta = esc_attr($meta);
488
// Don't use $impression_timer - It's for impressions used in javascript
502
define('DONOTCACHEDB', true);
503
define('DONOTCACHCEOBJECT', true);
504
505
+ global $wpdb, $adrotate_config;
506
507
$meta = $_POST['track'];
508
+ $meta = base64_decode($meta);
509
510
$meta = esc_attr($meta);
511
// Don't use $impression_timer - It's for impressions used in javascript
524
if(adrotate_is_human() AND $remote_ip != "unknown" AND !empty($remote_ip)) {
525
$now = adrotate_now();
526
$today = adrotate_date_start('day');
527
+ $click_timer = $now - $adrotate_config['click_timer'];
528
529
$saved_timer = $wpdb->get_var($wpdb->prepare("SELECT `timer` FROM `{$wpdb->prefix}adrotate_tracker` WHERE `ipaddress` = '%s' AND `stat` = 'c' AND `bannerid` = %d ORDER BY `timer` DESC LIMIT 1;", $remote_ip, $ad));
530
if($saved_timer < $click_timer) {
adrotate.php CHANGED
@@ -6,7 +6,7 @@ Author: Arnan de Gans
6
Author URI: https://www.arnan.me/?pk_campaign=adrotatefree&pk_keyword=plugin_info
7
Description: Monetise your website with adverts while keeping things simple. Start making money today!
8
Text Domain: adrotate
9
- Version: 5.7.1
10
License: GPLv3
11
*/
12
@@ -21,9 +21,9 @@ License: GPLv3
21
------------------------------------------------------------------------------------ */
22
23
/*--- AdRotate values ---------------------------------------*/
24
- define("ADROTATE_DISPLAY", '5.7.1');
25
define("ADROTATE_VERSION", 395);
26
- define("ADROTATE_DB_VERSION", 65);
27
$plugin_folder = plugin_dir_path(__FILE__);
28
/*-----------------------------------------------------------*/
29
@@ -43,7 +43,6 @@ $adrotate_config = get_option('adrotate_config');
43
$adrotate_crawlers = get_option('adrotate_crawlers');
44
$adrotate_version = get_option("adrotate_version");
45
$adrotate_db_version = get_option("adrotate_db_version");
46
- $adrotate_debug = get_option("adrotate_debug");
47
/*-----------------------------------------------------------*/
48
49
/*--- Core --------------------------------------------------*/
@@ -88,8 +87,7 @@ if(is_admin()) {
88
if(isset($_POST['adrotate_error_action_submit'])) add_action('init', 'adrotate_request_action');
89
if(isset($_POST['adrotate_save_options'])) add_action('init', 'adrotate_options_submit');
90
if(isset($_POST['adrotate_request_submit'])) add_action('init', 'adrotate_mail_message');
91
- if(isset($_POST['adrotate_db_optimize_submit'])) add_action('init', 'adrotate_optimize_database');
92
- if(isset($_POST['adrotate_db_cleanup_submit'])) add_action('init', 'adrotate_cleanup_database');
93
if(isset($_POST['adrotate_evaluate_submit'])) add_action('init', 'adrotate_prepare_evaluate_ads');
94
}
95
@@ -490,7 +488,6 @@ function adrotate_options() {
490
$status = (isset($_GET['status'])) ? esc_attr($_GET['status']) : '';
491
$error = (isset($_GET['error'])) ? esc_attr($_GET['error']) : '';
492
493
-
494
$action = (isset($_GET['action'])) ? esc_attr($_GET['action']) : '';
495
if($action == 'update-db') adrotate_check_upgrade();
496
if($action == 'reset-tasks') adrotate_check_schedules();
@@ -514,7 +511,6 @@ function adrotate_options() {
514
515
<?php
516
$adrotate_config = get_option('adrotate_config');
517
- $adrotate_debug = get_option('adrotate_debug');
518
519
if($active_tab == 'general') {
520
$adrotate_crawlers = get_option('adrotate_crawlers');
6
Author URI: https://www.arnan.me/?pk_campaign=adrotatefree&pk_keyword=plugin_info
7
Description: Monetise your website with adverts while keeping things simple. Start making money today!
8
Text Domain: adrotate
9
+ Version: 5.8
10
License: GPLv3
11
*/
12
21
------------------------------------------------------------------------------------ */
22
23
/*--- AdRotate values ---------------------------------------*/
24
+ define("ADROTATE_DISPLAY", '5.8');
25
define("ADROTATE_VERSION", 395);
26
+ define("ADROTATE_DB_VERSION", 66);
27
$plugin_folder = plugin_dir_path(__FILE__);
28
/*-----------------------------------------------------------*/
29
43
$adrotate_crawlers = get_option('adrotate_crawlers');
44
$adrotate_version = get_option("adrotate_version");
45
$adrotate_db_version = get_option("adrotate_db_version");
46
/*-----------------------------------------------------------*/
47
48
/*--- Core --------------------------------------------------*/
87
if(isset($_POST['adrotate_error_action_submit'])) add_action('init', 'adrotate_request_action');
88
if(isset($_POST['adrotate_save_options'])) add_action('init', 'adrotate_options_submit');
89
if(isset($_POST['adrotate_request_submit'])) add_action('init', 'adrotate_mail_message');
90
+ if(isset($_POST['adrotate_cleanup_submit'])) add_action('init', 'adrotate_clean_setup');
91
if(isset($_POST['adrotate_evaluate_submit'])) add_action('init', 'adrotate_prepare_evaluate_ads');
92
}
93
488
$status = (isset($_GET['status'])) ? esc_attr($_GET['status']) : '';
489
$error = (isset($_GET['error'])) ? esc_attr($_GET['error']) : '';
490
491
$action = (isset($_GET['action'])) ? esc_attr($_GET['action']) : '';
492
if($action == 'update-db') adrotate_check_upgrade();
493
if($action == 'reset-tasks') adrotate_check_schedules();
511
512
<?php
513
$adrotate_config = get_option('adrotate_config');
514
515
if($active_tab == 'general') {
516
$adrotate_crawlers = get_option('adrotate_crawlers');
dashboard/info.php CHANGED
@@ -55,30 +55,30 @@ $data = get_option("adrotate_advert_status");
55
<tr>
56
<td width="33%">
57
<div class="ajdg-sales-widget" style="display: inline-block; margin-right:2%;">
58
- <a href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=service-6" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/html5-service.jpg", dirname(__FILE__)); ?>" alt="HTML5 Advert setup" width="228" height="120"></div></a>
59
- <a href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=service-6" target="_blank"><div class="title"><?php _e('HTML5 Advert setup', 'adrotate'); ?></div></a>
60
<div class="sub_title"><?php _e('Professional service', 'adrotate'); ?></div>
61
- <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=service-6_buy" target="_blank">Only &euro; 22,50 p/ad</a></div>
62
- <hr>
63
- <div class="description"><?php _e('Did you get a HTML5 advert and can’t get it to work in AdRotate Pro? I’ll install and configure it for you.', 'adrotate'); ?></div>
64
- </div>
65
</td>
66
<td width="33%">
67
<div class="ajdg-sales-widget" style="display: inline-block; margin-right:2%;">
68
- <a href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=service-3" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/wordpress-maintenance.jpg", dirname(__FILE__)); ?>" alt="WordPress Maintenance" width="228" height="120"></div></a>
69
- <a href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=service-3" target="_blank"><div class="title"><?php _e('WP Maintenance', 'adrotate'); ?></div></a>
70
<div class="sub_title"><?php _e('Professional service', 'adrotate'); ?></div>
71
- <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=service-3_buy" target="_blank">Starting at &euro; 22,50</a></div>
72
- <hr>
73
- <div class="description"><?php _e('Get all the latest updates for WordPress and plugins. Maintenance, delete spam and clean up files.', 'adrotate'); ?></div>
74
- </div>
75
</td>
76
<td>
77
<div class="ajdg-sales-widget" style="display: inline-block;">
78
- <a href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=woo-2" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/single-page-checkout.jpg", dirname(__FILE__)); ?>" alt="WooCommerce Single Page Checkout" width="228" height="120"></div></a>
79
- <a href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=woo-2" target="_blank"><div class="title"><?php _e('Single Page Checkout', 'adrotate'); ?></div></a>
80
<div class="sub_title"><?php _e('WooCommerce Plugin', 'adrotate'); ?></div>
81
- <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=info_page&pk_content=woo-2_buy" target="_blank">Only &euro; 10,-</a></div>
82
<hr>
83
<div class="description"><?php _e('Merge your cart and checkout pages into one single page in seconds with no setup required at all.', 'adrotate'); ?></div>
84
</div>
55
<tr>
56
<td width="33%">
57
<div class="ajdg-sales-widget" style="display: inline-block; margin-right:2%;">
58
+ <a href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/wordpress-maintenance.jpg", dirname(__FILE__)); ?>" alt="WordPress Maintenance" width="228" height="120"></div></a>
59
+ <a href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank"><div class="title"><?php _e('WP Maintenance', 'adrotate'); ?></div></a>
60
<div class="sub_title"><?php _e('Professional service', 'adrotate'); ?></div>
61
+ <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank">Starting at &euro; 22,50</a></div>
62
+ <hr>
63
+ <div class="description"><?php _e('Get all the latest updates for WordPress and plugins. Maintenance, delete spam and clean up files.', 'adrotate'); ?></div>
64
+ </div>
65
</td>
66
<td width="33%">
67
<div class="ajdg-sales-widget" style="display: inline-block; margin-right:2%;">
68
+ <a href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/html5-service.jpg", dirname(__FILE__)); ?>" alt="HTML5 Advert setup" width="228" height="120"></div></a>
69
+ <a href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank"><div class="title"><?php _e('HTML5 Advert setup', 'adrotate'); ?></div></a>
70
<div class="sub_title"><?php _e('Professional service', 'adrotate'); ?></div>
71
+ <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank">Only &euro; 22,50 p/ad</a></div>
72
+ <hr>
73
+ <div class="description"><?php _e('Did you get a HTML5 advert and can’t get it to work in AdRotate Pro? I’ll install and configure it for you.', 'adrotate'); ?></div>
74
+ </div>
75
</td>
76
<td>
77
<div class="ajdg-sales-widget" style="display: inline-block;">
78
+ <a href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/single-page-checkout.jpg", dirname(__FILE__)); ?>" alt="WooCommerce Single Page Checkout" width="228" height="120"></div></a>
79
+ <a href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank"><div class="title"><?php _e('Single Page Checkout', 'adrotate'); ?></div></a>
80
<div class="sub_title"><?php _e('WooCommerce Plugin', 'adrotate'); ?></div>
81
+ <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=info_page" target="_blank">Only &euro; 10,-</a></div>
82
<hr>
83
<div class="description"><?php _e('Merge your cart and checkout pages into one single page in seconds with no setup required at all.', 'adrotate'); ?></div>
84
</div>
dashboard/publisher/adverts-edit.php CHANGED
@@ -12,7 +12,7 @@
12
if(!$ad_edit_id) {
13
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;");
14
if($edit_id == 0) {
15
- $wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'type' => 'empty', 'weight' => 6, 'autodelete' => 'N', 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
16
$edit_id = $wpdb->insert_id;
17
18
$wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y', 'autodelete' => 'N'));
@@ -111,7 +111,7 @@ if($edit_banner) {
111
<tr>
112
<th width="15%"><?php _e('Name', 'adrotate'); ?></th>
113
<td>
114
- <input tabindex="1" name="adrotate_title" type="text" class="ajdg-fullwidth ajdg-inputfield" value="<?php echo stripslashes($edit_banner->title);?>" autocomplete="off" />
115
</td>
116
<td width="35%">
117
&nbsp;
@@ -120,7 +120,7 @@ if($edit_banner) {
120
<tr>
121
<th valign="top"><?php _e('AdCode', 'adrotate'); ?></th>
122
<td>
123
- <label for="adrotate_bannercode"><textarea tabindex="2" id="adrotate_bannercode" name="adrotate_bannercode" cols="80" rows="15" class="ajdg-fullwidth"><?php echo stripslashes($edit_banner->bannercode); ?></textarea></label>
124
</td>
125
<td width="35%" rowspan="2">
126
<p><strong><?php _e('Basic Examples:', 'adrotate'); ?></strong></p>
@@ -135,8 +135,8 @@ if($edit_banner) {
135
<tr>
136
<th valign="top"><?php _e('Useful tags', 'adrotate'); ?></th>
137
<td colspan="2">
138
- <span class="description"><a href="#" onclick="textatcursor('adrotate_bannercode','%id%');return false;"><span class="ajdg-tooltip">%id%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Insert the advert ID Number.', 'adrotate-pro'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','%asset%');return false;"><span class="ajdg-tooltip">%asset%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Use this tag when selecting a image below.', 'adrotate-pro'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','%title%');return false;"><span class="ajdg-tooltip">%title%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Insert the advert name.', 'adrotate-pro'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','%random%');return false;"><span class="ajdg-tooltip">%random%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Insert a random string. Useful for DFP/DoubleClick type adverts.', 'adrotate-pro'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','target=&quot;_blank&quot;');return false;"><span class="ajdg-tooltip">target="_blank"<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Add inside the &lt;a&gt; tag to open the advert in a new window.', 'adrotate-pro'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','rel=&quot;nofollow&quot;');return false;"><span class="ajdg-tooltip">rel="nofollow"<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Add inside the &lt;a&gt; tag to tell crawlers to ignore this link.', 'adrotate-pro'); ?></span></span></a></em><br />
139
- <?php _e('Place the cursor where you want to add a tag and click to add it to your AdCode.', 'adrotate-pro'); ?></p>
140
</td>
141
</tr>
142
<?php if($edit_banner->type != 'empty') { ?>
@@ -187,8 +187,8 @@ if($edit_banner) {
187
<td colspan="3">
188
<label for="adrotate_active">
189
<select tabindex="7" name="adrotate_active">
190
- <option value="active" <?php if($edit_banner->type == "active" OR $edit_banner->type == "error") { echo 'selected'; } ?>><?php _e('Yes, this ad will be used', 'adrotate'); ?></option>
191
- <option value="disabled" <?php if($edit_banner->type == "disabled") { echo 'selected'; } ?>><?php _e('No, do not show this ad anywhere', 'adrotate'); ?></option>
192
</select>
193
</label>
194
</td>
@@ -362,6 +362,26 @@ if($edit_banner) {
362
<div id="dashboard-widgets" class="metabox-holder">
363
<div id="left-column" class="ajdg-postbox-container">
364
365
<div class="ajdg-postbox">
366
<h2 class="ajdg-postbox-title"><?php _e('Select Countries and or Regions', 'adrotate'); ?></h2>
367
<div id="countries" class="ajdg-postbox-content">
@@ -395,6 +415,33 @@ if($edit_banner) {
395
<tr>
396
<td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">South Africa</td>
397
</tr>
398
</tbody>
399
</table>
400
</div>
@@ -402,17 +449,6 @@ if($edit_banner) {
402
</div>
403
404
</div>
405
- <div id="right-column" class="ajdg-postbox-container">
406
-
407
- <div class="ajdg-postbox">
408
- <h2 class="ajdg-postbox-title"><?php _e('Enter cities, metro IDs, States or State ISO codes', 'adrotate'); ?></h2>
409
- <div id="cities" class="ajdg-postbox-content">
410
- <textarea name="adrotate_geo_cities" cols="40" rows="6" class="ajdg-fullwidth" disabled>Amsterdam, 29022, Noord Holland, New York, California, Tokyo, London, CA, NY, Ohio</textarea><br />
411
- <p><em><?php _e('A comma separated list of items:', 'adrotate'); ?> (Alkmaar, New York, Manila, Tokyo) <?php _e('AdRotate does not check the validity of names so make sure you spell them correctly!', 'adrotate'); ?></em></p>
412
- </div>
413
- </div>
414
-
415
- </div>
416
</div>
417
</div>
418
12
if(!$ad_edit_id) {
13
$edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;");
14
if($edit_id == 0) {
15
+ $wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'tracker' => 'N', 'show_everyone' => 'Y', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'type' => 'empty', 'weight' => 6, 'autodelete' => 'N', 'budget' => 0, 'crate' => 0, 'irate' => 0, 'state_req' => 'N', 'cities' => serialize(array()), 'states' => serialize(array()), 'cities' => serialize(array()), 'countries' => serialize(array())));
16
$edit_id = $wpdb->insert_id;
17
18
$wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y', 'autodelete' => 'N'));
111
<tr>
112
<th width="15%"><?php _e('Name', 'adrotate'); ?></th>
113
<td>
114
+ <label for="adrotate_title"><input tabindex="1" id="adrotate_title" name="adrotate_title" type="text" size="70" class="ajdg-inputfield ajdg-fullwidth" value="<?php echo stripslashes($edit_banner->title);?>" autocomplete="off" /></label>
115
</td>
116
<td width="35%">
117
&nbsp;
120
<tr>
121
<th valign="top"><?php _e('AdCode', 'adrotate'); ?></th>
122
<td>
123
+ <label for="adrotate_bannercode"><textarea tabindex="2" id="adrotate_bannercode" name="adrotate_bannercode" cols="70" rows="10" class="ajdg-fullwidth"><?php echo stripslashes($edit_banner->bannercode); ?></textarea></label>
124
</td>
125
<td width="35%" rowspan="2">
126
<p><strong><?php _e('Basic Examples:', 'adrotate'); ?></strong></p>
135
<tr>
136
<th valign="top"><?php _e('Useful tags', 'adrotate'); ?></th>
137
<td colspan="2">
138
+ <span class="description"><a href="#" onclick="textatcursor('adrotate_bannercode','%id%');return false;"><span class="ajdg-tooltip">%id%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Insert the advert ID Number.', 'adrotate'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','%asset%');return false;"><span class="ajdg-tooltip">%asset%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Use this tag when selecting a image below.', 'adrotate'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','%title%');return false;"><span class="ajdg-tooltip">%title%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Insert the advert name.', 'adrotate'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','%random%');return false;"><span class="ajdg-tooltip">%random%<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Insert a random string. Useful for DFP/DoubleClick type adverts.', 'adrotate'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','target=&quot;_blank&quot;');return false;"><span class="ajdg-tooltip">target="_blank"<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Add inside the &lt;a&gt; tag to open the advert in a new window.', 'adrotate'); ?></span></span></a> <a href="#" onclick="textatcursor('adrotate_bannercode','rel=&quot;nofollow&quot;');return false;"><span class="ajdg-tooltip">rel="nofollow"<span class="ajdg-tooltiptext ajdg-tooltip-top"><?php _e('Add inside the &lt;a&gt; tag to tell crawlers to ignore this link.', 'adrotate'); ?></span></span></a></em><br />
139
+ <?php _e('Place the cursor where you want to add a tag and click to add it to your AdCode.', 'adrotate'); ?></p>
140
</td>
141
</tr>
142
<?php if($edit_banner->type != 'empty') { ?>
187
<td colspan="3">
188
<label for="adrotate_active">
189
<select tabindex="7" name="adrotate_active">
190
+ <option value="active" <?php if($edit_banner->type == "active" OR $edit_banner->type == "error") { echo 'selected'; } ?>><?php _e('Enabled, this ad will be visible', 'adrotate'); ?></option>
191
+ <option value="disabled" <?php if($edit_banner->type == "disabled") { echo 'selected'; } ?>><?php _e('Disabled, do not show this advert anywhere', 'adrotate'); ?></option>
192
</select>
193
</label>
194
</td>
362
<div id="dashboard-widgets" class="metabox-holder">
363
<div id="left-column" class="ajdg-postbox-container">
364
365
+ <div class="ajdg-postbox">
366
+ <h2 class="ajdg-postbox-title"><?php _e('Enter cities or metro IDs (DMA)', 'adrotate'); ?></h2>
367
+ <div id="cities" class="ajdg-postbox-content">
368
+ <textarea tabindex="32" name="adrotate_geo_cities" class="geo-cities ajdg-fullwidth" cols="40" rows="6" disabled>Jakarta, Cancun, Los Angeles, Seattle</textarea><br />
369
+ <p><em><?php _e('A comma separated list of Cities or Metro IDs:', 'adrotate'); ?> Amsterdam, New York, Manila, Mexico City, Tokyo.<br /><?php _e('AdRotate does not check the validity of names and assumes the basic english name.', 'adrotate'); ?></em></p>
370
+ </div>
371
+ </div>
372
+
373
+ <div class="ajdg-postbox">
374
+ <h2 class="ajdg-postbox-title"><?php _e('Enter States or State ISO3166-2 codes', 'adrotate'); ?></h2>
375
+ <div id="cities" class="ajdg-postbox-content">
376
+ <label for="adrotate_geo_state_required"><input tabindex="33" type="checkbox" name="adrotate_geo_state_required" disabled /> <?php _e('The listed cities must be in these states?', 'adrotate'); ?></label><br />
377
+ <textarea tabindex="34" name="adrotate_geo_states" class="geo-states ajdg-fullwidth" cols="40" rows="2" disabled>New York, CA, Florida</textarea>
378
+ <p><em><?php _e('A comma separated list of states:', 'adrotate'); ?> Ohio, California, Noord Holland, Normandy.<br /><?php _e('AdRotate does not check the validity of names and assumes the basic english name.', 'adrotate'); ?></em></p>
379
+ </div>
380
+ </div>
381
+
382
+ </div>
383
+ <div id="right-column" class="ajdg-postbox-container">
384
+
385
<div class="ajdg-postbox">
386
<h2 class="ajdg-postbox-title"><?php _e('Select Countries and or Regions', 'adrotate'); ?></h2>
387
<div id="countries" class="ajdg-postbox-content">
415
<tr>
416
<td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">South Africa</td>
417
</tr>
418
+ <tr>
419
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Belize</td>
420
+ </tr>
421
+ <tr>
422
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">France</td>
423
+ </tr>
424
+ <tr>
425
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Belgium</td>
426
+ </tr>
427
+ <tr>
428
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Spain</td>
429
+ </tr>
430
+ <tr>
431
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">India</td>
432
+ </tr>
433
+ <tr>
434
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Egypt</td>
435
+ </tr>
436
+ <tr>
437
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Greece</td>
438
+ </tr>
439
+ <tr>
440
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Italy</td>
441
+ </tr>
442
+ <tr>
443
+ <td class="check-column" style="padding: 0px;"><input type="checkbox" name="adrotate_geo_countries[]" value="" disabled></td><td style="padding: 0px;">Russia</td>
444
+ </tr>
445
</tbody>
446
</table>
447
</div>
449
</div>
450
451
</div>
452
</div>
453
</div>
454
dashboard/settings/geotargeting.php CHANGED
@@ -29,15 +29,15 @@
29
<option value="0" disabled="1">CloudFlare</option>
30
</select><br />
31
<span class="description">
32
- <p><strong>AdRotate Geo</strong> - <?php _e('20000 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 sized websites.', 'adrotate'); ?></em><br /><br />
35
36
- <p><strong>ipstack</strong> - <?php _e('10000 free lookups per month, requires account.', '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 small to medium sized websites with a free account - Paid options available.', 'adrotate'); ?></em><br /><br />
39
40
- <strong>MaxMind GeoIP2</strong> - <?php _e('The most accurate geo targeting available.', 'adrotate'); ?><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
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 sized websites.', 'adrotate'); ?></em><br /><br />
35
36
+ <p><strong>ipstack</strong> (<a href="https://ipstack.com/product" target="_blank>"><?php _e('More info', 'adrotate'); ?></a>) - <?php _e('10000 free lookups per month, requires account.', '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 small to medium sized websites with a free account - Paid options available.', 'adrotate'); ?></em><br /><br />
39
40
+ <strong>MaxMind GeoIP2</strong> (<a href="https://www.maxmind.com/en/geoip2-precision-city-service" target="_blank>"><?php _e('More info', 'adrotate'); ?></a>)- <?php _e('The most accurate geo targeting available.', 'adrotate'); ?><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
dashboard/settings/maintenance.php CHANGED
@@ -17,44 +17,26 @@
17
<span class="description"><?php _e('Use these functions when you notice your database is slow, unresponsive and sluggish.', 'adrotate'); ?></span>
18
<table class="form-table">
19
<tr>
20
- <th valign="top"><?php _e('Optimize Database', 'adrotate'); ?></th>
21
<td>
22
- <input type="submit" id="post-role-submit" name="adrotate_db_optimize_submit" value="<?php _e('Optimize Database', 'adrotate'); ?>" class="button-secondary" onclick="return confirm('<?php _e('You are about to optimize the AdRotate database.', 'adrotate'); ?>\n\n<?php _e('Did you make a backup of your database?', 'adrotate'); ?>\n\n<?php _e('This may take a moment and may cause your website to respond slow temporarily!', 'adrotate'); ?>\n\n<?php _e('OK to continue, CANCEL to stop.', 'adrotate'); ?>')" /><br />
23
- <span class="description"><?php _e('Cleans up overhead data in the AdRotate tables.', 'adrotate'); ?><br />
24
- <?php _e('Overhead data is accumulated garbage resulting from many changes you\'ve made. This can vary from nothing to hundreds of KiB of data.', 'adrotate'); ?></span>
25
</td>
26
</tr>
27
<tr>
28
<th valign="top"><?php _e('Clean-up Database and Files', 'adrotate'); ?></th>
29
<td>
30
- <input type="submit" id="post-role-submit" name="adrotate_db_cleanup_submit" value="<?php _e('Clean-up Database', 'adrotate'); ?>" class="button-secondary" onclick="return confirm('<?php _e('You are about to clean up your database. This may delete expired schedules, older statistics and try to delete export files', 'adrotate'); ?>\n\n<?php _e('Are you sure you want to continue?', 'adrotate'); ?>\n<?php _e('THIS ACTION CAN NOT BE UNDONE!', 'adrotate'); ?>')" /><br />
31
<label for="adrotate_db_cleanup_statistics"><input type="checkbox" name="adrotate_db_cleanup_statistics" value="1" /> <?php _e('Delete stats older than 365 days.', 'adrotate'); ?></label><br />
32
<label for="adrotate_db_cleanup_exportfiles"><input type="checkbox" name="adrotate_db_cleanup_exportfiles" value="1" /> <?php _e('Delete leftover export files.', 'adrotate'); ?></label><br />
33
<span class="description"><?php _e('For when you create an advert, group or schedule and it does not save or keep changes you make.', 'adrotate'); ?><br /><?php _e('Additionally you can delete statistics and/or unused export files. This will improve the speed of your site.', 'adrotate'); ?></span>
34
</td>
35
</tr>
36
- <tr>
37
- <th valign="top"><?php _e('Re-evaluate Ads', 'adrotate'); ?></th>
38
- <td>
39
- <input type="submit" id="post-role-submit" name="adrotate_evaluate_submit" value="<?php _e('Re-evaluate all ads', 'adrotate'); ?>" class="button-secondary" onclick="return confirm('<?php _e('You are about to check all ads for errors.', 'adrotate'); ?>\n\n<?php _e('This might take a while and may slow down your site during this action!', 'adrotate'); ?>\n\n<?php _e('OK to continue, CANCEL to stop.', 'adrotate'); ?>')" /><br />
40
- <span class="description"><?php _e('This will apply all evaluation rules to all ads to see if any error slipped in. Normally you should not need this feature.', 'adrotate'); ?></span>
41
- </td>
42
- </tr>
43
- </table>
44
- <span class="description"><?php _e('DISCLAIMER: The above functions are intented to be used to OPTIMIZE your database. They only apply to your ads/groups and stats. Not to other settings or other parts of WordPress! Always always make a backup! If for any reason your data is lost, damaged or otherwise becomes unusable in any way or by any means in whichever way I will not take responsibility. You should always have a backup of your database. These functions do NOT destroy data. If data is lost, damaged or unusable in any way, your database likely was beyond repair already. Claiming it worked before clicking these buttons is not a valid point in any case.', 'adrotate'); ?></span>
45
-
46
- <h3><?php _e('Troubleshooting', 'adrotate'); ?></h3>
47
- <span class="description"><?php _e('The below options are not meant for normal use and are only there for developers to review saved settings or how ads are selected. These can be used as a measure of troubleshooting upon request but for normal use they SHOULD BE LEFT UNCHECKED!!', 'adrotate'); ?></span>
48
- <table class="form-table">
49
- <tr>
50
- <th valign="top"><?php _e('Developer Debug', 'adrotate'); ?></th>
51
- <td>
52
- <input type="checkbox" name="adrotate_debug" <?php if($adrotate_debug['general'] == true) { ?>checked="checked" <?php } ?> /> General - <span class="description"><?php _e('Troubleshoot ads and how they are selected. Visible on the front-end.', 'adrotate'); ?></span><br />
53
- <input type="checkbox" name="adrotate_debug_timers" <?php if($adrotate_debug['timers'] == true) { ?>checked="checked" <?php } ?> /> Clicktracking - <span class="description"><?php _e('Disable timers for clicks and impressions.', 'adrotate'); ?></span><br />
54
- <input type="checkbox" name="adrotate_debug_track" <?php if($adrotate_debug['track'] == true) { ?>checked="checked" <?php } ?> /> Tracking Encryption - <span class="description"><?php _e('Temporarily disable encryption on the redirect url.', 'adrotate'); ?></span><br />
55
- </td>
56
- </tr>
57
</table>
58
59
<h3><?php _e('Status and Versions', 'adrotate'); ?></h3>
60
<table class="form-table">
17
<span class="description"><?php _e('Use these functions when you notice your database is slow, unresponsive and sluggish.', 'adrotate'); ?></span>
18
<table class="form-table">
19
<tr>
20
+ <th valign="top"><?php _e('Check adverts', 'adrotate'); ?></th>
21
<td>
22
+ <input type="submit" id="post-role-submit" name="adrotate_evaluate_submit" value="<?php _e('Check all adverts for configuration errors', 'adrotate'); ?>" class="button-secondary" onclick="return confirm('<?php _e('You are about to check all adverts for errors.', 'adrotate'); ?>\n\n<?php _e('This might take a few seconds!', 'adrotate'); ?>\n\n<?php _e('OK to continue, CANCEL to stop.', 'adrotate'); ?>')" />
23
+ <br /><br />
24
+ <span class="description"><?php _e('Apply all evaluation rules to all adverts to see if any error slipped in.', 'adrotate'); ?></span>
25
</td>
26
</tr>
27
<tr>
28
<th valign="top"><?php _e('Clean-up Database and Files', 'adrotate'); ?></th>
29
<td>
30
+ <input type="submit" id="post-role-submit" name="adrotate_cleanup_submit" value="<?php _e('Clean-up database and old files', 'adrotate'); ?>" class="button-secondary" onclick="return confirm('<?php _e('You are about to do maintenance on your setup of AdRotate.', 'adrotate'); ?>\n\n<?php _e('This optionally may delete old statistics and tries to delete old export files.', 'adrotate'); ?>\n\n<?php _e('Are you sure you want to continue?', 'adrotate'); ?>\n<?php _e('THIS ACTION CAN NOT BE UNDONE!', 'adrotate'); ?>')" />
31
+ <br /><br />
32
+ <label for="adrotate_db_cleanup_db"><input type="checkbox" name="adrotate_db_cleanup_db" value="0" checked disabled /> <?php _e('Basic database maintenance.', 'adrotate'); ?></label><br />
33
<label for="adrotate_db_cleanup_statistics"><input type="checkbox" name="adrotate_db_cleanup_statistics" value="1" /> <?php _e('Delete stats older than 365 days.', 'adrotate'); ?></label><br />
34
<label for="adrotate_db_cleanup_exportfiles"><input type="checkbox" name="adrotate_db_cleanup_exportfiles" value="1" /> <?php _e('Delete leftover export files.', 'adrotate'); ?></label><br />
35
<span class="description"><?php _e('For when you create an advert, group or schedule and it does not save or keep changes you make.', 'adrotate'); ?><br /><?php _e('Additionally you can delete statistics and/or unused export files. This will improve the speed of your site.', 'adrotate'); ?></span>
36
</td>
37
</tr>
38
</table>
39
+ <span class="description"><?php _e('DISCLAIMER: The above functions are intented to be used to OPTIMIZE your database or clean up overhead data. They only apply to your ads/groups and stats. Not to other settings or other parts of WordPress! Always always make a backup! If for any reason your data is lost, damaged or otherwise becomes unusable in any way or by any means in whichever way I will not take responsibility. You should always have a backup of your database. These functions do NOT destroy data. If data is lost, damaged or unusable in any way, your database likely was beyond repair already. Claiming it worked before clicking these buttons is not a valid point in any case.', 'adrotate'); ?></span>
40
41
<h3><?php _e('Status and Versions', 'adrotate'); ?></h3>
42
<table class="form-table">
dashboard/support.php CHANGED
@@ -35,6 +35,47 @@ $data = get_option("adrotate_advert_status");
35
</div>
36
</div>
37
38
</div>
39
<div id="right-column" class="ajdg-postbox-container">
40
@@ -42,7 +83,7 @@ $data = get_option("adrotate_advert_status");
42
<h2 class="ajdg-postbox-title"><?php _e('Premium Support available in AdRotate Pro', 'adrotate'); ?></h2>
43
<div id="support" class="ajdg-postbox-content">
44
<form name="request" id="post" method="post" action="admin.php?page=adrotate">
45
- <p><img src="<?php echo plugins_url('/images/icon-contact.png', dirname(__FILE__)); ?>" class="alignleft pro-image" />&raquo; <?php _e('What went wrong? Or what are you trying to do?', 'adrotate'); ?><br />&raquo; <?php _e('Include error messages and/or relevant information.', 'adrotate'); ?><br />&raquo; <?php _e('Try to remember any actions that may cause the problem.', 'adrotate'); ?><br />&raquo; <?php _e('Any code/HTML will be stripped from your message.', 'adrotate'); ?></p>
46
47
<p><label for="ajdg_support_username"><strong><?php _e('Your name:', 'adrotate'); ?></strong><br /><input tabindex="1" name="ajdg_support_username" type="text" class="search-input" style="width:100%;" value="<?php echo $current_user->display_name;?>" autocomplete="off" disabled /></label></p>
48
<p><label for="ajdg_support_email"><strong><?php _e('Your Email Address:', 'adrotate'); ?></strong><br /><input tabindex="1" name="ajdg_support_email" type="text" class="search-input" style="width:100%;" value="<?php echo $current_user->user_email;?>" autocomplete="off" disabled /></label></p>
35
</div>
36
</div>
37
38
+ <div class="ajdg-postbox">
39
+ <h2 class="ajdg-postbox-title"><?php _e('Plugins and services', 'adrotate'); ?></h2>
40
+ <div id="services" class="ajdg-postbox-content">
41
+ <p>Professional services and plugins by Arnan de Gans. Get the most out of your website! Check out these and other services and plugins on <a href="https://ajdg.solutions/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank">my website</a>, or share it to people who may need them.</p>
42
+ <table width="100%">
43
+ <tr>
44
+ <td width="33%">
45
+ <div class="ajdg-sales-widget" style="display: inline-block; margin-right:2%;">
46
+ <a href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/wordpress-maintenance.jpg", dirname(__FILE__)); ?>" alt="WordPress Maintenance" width="228" height="120"></div></a>
47
+ <a href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank"><div class="title"><?php _e('WP Maintenance', 'adrotate'); ?></div></a>
48
+ <div class="sub_title"><?php _e('Professional service', 'adrotate'); ?></div>
49
+ <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/wordpress-maintenance-and-updates/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank">Starting at &euro; 22,50</a></div>
50
+ <hr>
51
+ <div class="description"><?php _e('Get all the latest updates for WordPress and plugins. Maintenance, delete spam and clean up files.', 'adrotate'); ?></div>
52
+ </div>
53
+ </td>
54
+ <td width="33%">
55
+ <div class="ajdg-sales-widget" style="display: inline-block; margin-right:2%;">
56
+ <a href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/html5-service.jpg", dirname(__FILE__)); ?>" alt="HTML5 Advert setup" width="228" height="120"></div></a>
57
+ <a href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank"><div class="title"><?php _e('HTML5 Advert setup', 'adrotate'); ?></div></a>
58
+ <div class="sub_title"><?php _e('Professional service', 'adrotate'); ?></div>
59
+ <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/adrotate-html5-setup-service/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank">Only &euro; 22,50 p/ad</a></div>
60
+ <hr>
61
+ <div class="description"><?php _e('Did you get a HTML5 advert and can’t get it to work in AdRotate Pro? I’ll install and configure it for you.', 'adrotate'); ?></div>
62
+ </div>
63
+ </td>
64
+ <td>
65
+ <div class="ajdg-sales-widget" style="display: inline-block;">
66
+ <a href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank"><div class="header"><img src="<?php echo plugins_url("/images/offers/single-page-checkout.jpg", dirname(__FILE__)); ?>" alt="WooCommerce Single Page Checkout" width="228" height="120"></div></a>
67
+ <a href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank"><div class="title"><?php _e('Single Page Checkout', 'adrotate'); ?></div></a>
68
+ <div class="sub_title"><?php _e('WooCommerce Plugin', 'adrotate'); ?></div>
69
+ <div class="cta"><a role="button" class="cta_button" href="https://ajdg.solutions/product/woocommerce-single-page-checkout/?pk_campaign=adrotatefree&pk_keyword=support_page" target="_blank">Only &euro; 10,-</a></div>
70
+ <hr>
71
+ <div class="description"><?php _e('Merge your cart and checkout pages into one single page in seconds with no setup required at all.', 'adrotate'); ?></div>
72
+ </div>
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
77
+ </div>
78
+
79
</div>
80
<div id="right-column" class="ajdg-postbox-container">
81
83
<h2 class="ajdg-postbox-title"><?php _e('Premium Support available in AdRotate Pro', 'adrotate'); ?></h2>
84
<div id="support" class="ajdg-postbox-content">
85
<form name="request" id="post" method="post" action="admin.php?page=adrotate">
86
+ <p><img src="<?php echo plugins_url('/images/icon-contact.png', dirname(__FILE__)); ?>" class="alignleft pro-image" />&raquo; <?php _e('Premium support always comes first!', 'adrotate'); ?><br />&raquo; <?php _e('No queuing up on the forum...', 'adrotate'); ?><br />&raquo; <?php _e('Using this form includes essential information for a quick answer.', 'adrotate'); ?><br />&raquo; <?php _e('Available in AdRotate Professional!', 'adrotate'); ?></p>
87
88
<p><label for="ajdg_support_username"><strong><?php _e('Your name:', 'adrotate'); ?></strong><br /><input tabindex="1" name="ajdg_support_username" type="text" class="search-input" style="width:100%;" value="<?php echo $current_user->display_name;?>" autocomplete="off" disabled /></label></p>
89
<p><label for="ajdg_support_email"><strong><?php _e('Your Email Address:', 'adrotate'); ?></strong><br /><input tabindex="1" name="ajdg_support_email" type="text" class="search-input" style="width:100%;" value="<?php echo $current_user->user_email;?>" autocomplete="off" disabled /></label></p>
language/adrotate-bg_BG.mo DELETED
Binary file
language/adrotate-de_DE.mo ADDED
Binary file
language/adrotate-de_DE.po ADDED
@@ -0,0 +1,7415 @@
<