AdRotate Banner Manager - Version 3.12

Version Description

FREE = * [change] Improved WordPress 4.3 compatibility * [new] Now uses the same status system as AdRotate Pro * [new] Complete overhaul of the settings page * [fix] Wrong variable used for default advert sizes * [change] Updated H2 tags to H1 for WordPress 4.3 * [change] Updated Widget Class structure * [change] Tweaks to the dashboard * [change] Revised debug options * [i18n] New and updated translation strings

Download this release

Release Info

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

Code changes from version 3.11.7 to 3.12

Files changed (45) hide show
  1. adrotate-export.php +1 -1
  2. adrotate-functions.php +81 -69
  3. adrotate-manage-publisher.php +125 -133
  4. adrotate-output.php +13 -17
  5. adrotate-setup.php +38 -32
  6. adrotate-statistics.php +1 -7
  7. adrotate-widget.php +1 -1
  8. adrotate.php +95 -340
  9. dashboard/{adrotate-pro.php → adrotatepro.php} +23 -10
  10. dashboard/{adrotate-info.php → info.php} +20 -68
  11. dashboard/publisher/{adrotate-ads-main-disabled.php → adverts-disabled.php} +1 -1
  12. dashboard/publisher/{adrotate-ads-edit.php → adverts-edit.php} +2 -2
  13. dashboard/publisher/{adrotate-ads-main-error.php → adverts-error.php} +1 -1
  14. dashboard/publisher/{adrotate-ads-main.php → adverts-main.php} +1 -1
  15. dashboard/publisher/{adrotate-ads-report.php → adverts-report.php} +1 -1
  16. dashboard/publisher/{adrotate-groups-edit.php → groups-edit.php} +0 -0
  17. dashboard/publisher/{adrotate-groups-main.php → groups-main.php} +0 -0
  18. dashboard/publisher/{adrotate-groups-report.php → groups-report.php} +1 -1
  19. dashboard/settings/advertisers.php +29 -0
  20. dashboard/settings/general.php +40 -0
  21. dashboard/settings/geotargeting.php +52 -0
  22. dashboard/settings/maintenance.php +66 -0
  23. dashboard/settings/misc.php +25 -0
  24. dashboard/settings/notifications.php +75 -0
  25. dashboard/settings/roles.php +36 -0
  26. dashboard/settings/statistics.php +55 -0
  27. language/adrotate-bg_BG.mo +0 -0
  28. language/adrotate-bg_BG.po +2138 -1735
  29. language/adrotate-el.mo +0 -0
  30. language/adrotate-el.po +2120 -1718
  31. language/adrotate-en_US.mo +0 -0
  32. language/adrotate-en_US.po +2235 -1700
  33. language/adrotate-es_ES.mo +0 -0
  34. language/adrotate-es_ES.po +2167 -1759
  35. language/adrotate-fr_FR.mo +0 -0
  36. language/adrotate-fr_FR.po +2070 -1541
  37. language/adrotate-ja.mo +0 -0
  38. language/adrotate-ja.po +2094 -1700
  39. language/adrotate-pl_PL.mo +0 -0
  40. language/adrotate-pl_PL.po +2151 -1749
  41. language/adrotate-sr_RS.mo +0 -0
  42. language/adrotate-sr_RS.po +2158 -1768
  43. language/adrotate-sv_SV.mo +0 -0
  44. language/adrotate-sv_SV.po +2127 -1727
  45. readme.txt +48 -53
adrotate-export.php CHANGED
@@ -57,7 +57,7 @@ function adrotate_export_ads($ids) {
57
58
file_put_contents(WP_CONTENT_DIR . '/reports/'.$filename, $xml->saveXML());
59
60
- adrotate_return('exported', array($filename));
61
exit;
62
}
63
?>
57
58
file_put_contents(WP_CONTENT_DIR . '/reports/'.$filename, $xml->saveXML());
59
60
+ adrotate_return('adrotate-ads', 215, array('file' => $filename));
61
exit;
62
}
63
?>
adrotate-functions.php CHANGED
@@ -495,7 +495,7 @@ function adrotate_prepare_evaluate_ads($return = true, $id = 0) {
495
);
496
497
update_option('adrotate_advert_status', $result);
498
- if($return) adrotate_return('db_evaluated');
499
}
500
501
/*-------------------------------------------------------------
@@ -808,121 +808,133 @@ function adrotate_folder_contents($current) {
808
Purpose: Internal redirects
809
Receive: $action, $arg (array)
810
Return: -none-
811
- Since: 0.2
812
- Usage: array('wp_page', 'message', 'arguments', 'id')
813
-------------------------------------------------------------*/
814
- function adrotate_return($action, $arg = null) {
815
-
816
- switch($action) {
817
- // Manage Ads
818
- case "new" :
819
- wp_redirect('admin.php?page=adrotate-ads&message=new');
820
- break;
821
-
822
- case "update" :
823
- wp_redirect('admin.php?page=adrotate-ads&view=edit&message=updated&ad='.$arg[0]);
824
- break;
825
826
- case "update_manage" :
827
- wp_redirect('admin.php?page=adrotate-ads&message=updated');
828
- break;
829
830
- case "delete" :
831
- wp_redirect('admin.php?page=adrotate-ads&message=deleted');
832
- break;
833
834
- case "reset" :
835
- wp_redirect('admin.php?page=adrotate-ads&message=reset');
836
break;
837
838
- case "renew" :
839
- wp_redirect('admin.php?page=adrotate-ads&message=renew');
840
break;
841
842
- case "deactivate" :
843
- wp_redirect('admin.php?page=adrotate-ads&message=deactivate');
844
break;
845
846
- case "activate" :
847
- wp_redirect('admin.php?page=adrotate-ads&message=activate');
848
break;
849
850
- case "exported" :
851
- wp_redirect('admin.php?page=adrotate-ads&message=exported&file='.$arg[0]);
852
break;
853
854
- case "field_error" :
855
- wp_redirect('admin.php?page=adrotate-ads&message=field_error');
856
break;
857
858
- // Groups
859
- case "group_new" :
860
- wp_redirect('admin.php?page=adrotate-groups&message=created');
861
break;
862
863
- case "group_edit" :
864
- wp_redirect('admin.php?page=adrotate-groups&view=edit&message=updated&group='.$arg[0]);
865
break;
866
867
- case "group_delete" :
868
- wp_redirect('admin.php?page=adrotate-groups&message=deleted');
869
break;
870
871
- case "group_delete_banners" :
872
- wp_redirect('admin.php?page=adrotate-groups&message=deleted_banners');
873
break;
874
875
// Settings
876
- case "settings_saved" :
877
- wp_redirect('admin.php?page=adrotate-settings&message=updated');
878
break;
879
880
- // Maintenance
881
- case "db_optimized" :
882
- wp_redirect('admin.php?page=adrotate-settings&message=db_optimized');
883
break;
884
885
- case "db_evaluated" :
886
- wp_redirect('admin.php?page=adrotate-settings&message=db_evaluated');
887
break;
888
889
- case "db_repaired" :
890
- wp_redirect('admin.php?page=adrotate-settings&message=db_optimized');
891
break;
892
893
- case "db_cleaned" :
894
- wp_redirect('admin.php?page=adrotate-settings&message=db_cleaned');
895
break;
896
897
- case "db_timer" :
898
- wp_redirect('admin.php?page=adrotate-settings&message=db_timer');
899
break;
900
901
- // Misc plugin events
902
- case "mail_sent" :
903
- wp_redirect('admin.php?page=adrotate-advertiser&message=mail_sent');
904
break;
905
906
- case "beta_mail_sent" :
907
- wp_redirect('admin.php?page=adrotate-beta&message=sent');
908
break;
909
910
- case "beta_mail_empty" :
911
- wp_redirect('admin.php?page=adrotate-beta&message=empty');
912
break;
913
914
- case "no_access" :
915
- wp_redirect('admin.php?page=adrotate&message=no_access');
916
break;
917
918
- case "error" :
919
- wp_redirect('admin.php?page=adrotate&message=error');
920
break;
921
-
922
- default:
923
- wp_redirect('admin.php?page=adrotate');
924
break;
925
-
926
}
927
}
928
?>
495
);
496
497
update_option('adrotate_advert_status', $result);
498
+ if($return) adrotate_return('adrotate-settings', 405);
499
}
500
501
/*-------------------------------------------------------------
808
Purpose: Internal redirects
809
Receive: $action, $arg (array)
810
Return: -none-
811
+ Since: 3.12
812
-------------------------------------------------------------*/
813
+ function adrotate_return($page, $status, $args = null) {
814
+
815
+ if(strlen($page) > 0 AND ($status > 0 AND $status < 1000)) {
816
+ $defaults = array(
817
+ 'status' => $status
818
+ );
819
+ $arguments = wp_parse_args($args, $defaults);
820
+ $redirect = 'admin.php?page=' . $page . '&'.http_build_query($arguments);
821
+ } else {
822
+ $redirect = 'admin.php?page=adrotate';
823
+ }
824
825
+ wp_redirect($redirect);
826
+ }
827
828
+ /*-------------------------------------------------------------
829
+ Name: adrotate_status
830
831
+ Purpose: Internal redirects
832
+ Receive: $status, $args
833
+ Return: -none-
834
+ Since: 3.12
835
+ -------------------------------------------------------------*/
836
+ function adrotate_status($status, $args = null) {
837
+
838
+ $defaults = array(
839
+ 'ad' => '',
840
+ 'group' => '',
841
+ 'file' => ''
842
+ );
843
+ $arguments = wp_parse_args($args, $defaults);
844
+
845
+ switch($status) {
846
+ // Management messages
847
+ case '200' :
848
+ echo '<div id="message" class="updated"><p>'. __('Ad saved', 'adrotate') .'</p></div>';
849
break;
850
851
+ case '201' :
852
+ echo '<div id="message" class="updated"><p>'. __('Group saved', 'adrotate') .'</p></div>';
853
break;
854
855
+ case '203' :
856
+ echo '<div id="message" class="updated"><p>'. __('Ad(s) deleted', 'adrotate') .'</p></div>';
857
break;
858
859
+ case '204' :
860
+ echo '<div id="message" class="updated"><p>'. __('Group deleted', 'adrotate') .'</p></div>';
861
break;
862
863
+ case '208' :
864
+ echo '<div id="message" class="updated"><p>'. __('Ad(s) statistics reset', 'adrotate') .'</p></div>';
865
break;
866
867
+ case '209' :
868
+ echo '<div id="message" class="updated"><p>'. __('Ad(s) renewed', 'adrotate') .'</p></div>';
869
break;
870
871
+ case '210' :
872
+ echo '<div id="message" class="updated"><p>'. __('Ad(s) deactivated', 'adrotate') .'</p></div>';
873
break;
874
875
+ case '211' :
876
+ echo '<div id="message" class="updated"><p>'. __('Ad(s) activated', 'adrotate') .'</p></div>';
877
break;
878
879
+ case '213' :
880
+ echo '<div id="message" class="updated"><p>'. __('Group including it\'s Ads deleted', 'adrotate') .'</p></div>';
881
break;
882
883
+ case '215' :
884
+ echo '<div id="message" class="updated"><p>'. __('Export created', 'adrotate') .'. <a href="' . WP_CONTENT_URL . '/reports/'.$arguments['file'].'">Download</a>.</p></div>';
885
break;
886
887
// Settings
888
+ case '400' :
889
+ echo '<div id="message" class="updated"><p>'. __('Settings saved', 'adrotate') .'</p></div>';
890
break;
891
892
+ case '403' :
893
+ echo '<div id="message" class="updated"><p>'. __('Database optimized', 'adrotate') .'</p></div>';
894
break;
895
896
+ case '404' :
897
+ echo '<div id="message" class="updated"><p>'. __('Database repaired', 'adrotate') .'</p></div>';
898
break;
899
900
+ case '405' :
901
+ echo '<div id="message" class="updated"><p>'. __('Ads evaluated and statuses have been corrected where required', 'adrotate') .'</p></div>';
902
break;
903
904
+ case '406' :
905
+ echo '<div id="message" class="updated"><p>'. __('Empty database records removed', 'adrotate') .'</p></div>';
906
break;
907
908
+ // (all) Error messages
909
+ case '500' :
910
+ echo '<div id="message" class="error"><p>'. __('Action prohibited', 'adrotate') .'</p></div>';
911
break;
912
913
+ case '501' :
914
+ echo '<div id="message" class="error"><p>'. __('The ad was saved but has an issue which might prevent it from working properly. Review the colored ad.', 'adrotate') .'</p></div>';
915
break;
916
917
+ case '503' :
918
+ echo '<div id="message" class="error"><p>'. __('No data found in selected time period', 'adrotate') .'</p></div>';
919
break;
920
921
+ case '504' :
922
+ echo '<div id="message" class="error"><p>'. __('Database can only be optimized or cleaned once every hour', 'adrotate') .'</p></div>';
923
break;
924
925
+ case '505' :
926
+ echo '<div id="message" class="error"><p>'. __('Form can not be (partially) empty!', 'adrotate') .'</p></div>';
927
break;
928
929
+ case '509' :
930
+ echo '<div id="message" class="updated"><p>'. __('No ads found.', 'adrotate') .'</p></div>';
931
break;
932
+
933
+ default :
934
+ echo '<div id="message" class="updated"><p>'. __('Unexpected error', 'adrotate') .'</p></div>';
935
break;
936
}
937
+
938
+ unset($arguments, $args);
939
}
940
?>
adrotate-manage-publisher.php CHANGED
@@ -186,10 +186,10 @@ function adrotate_insert_input() {
186
adrotate_prepare_evaluate_ads(false, $id);
187
}
188
189
- adrotate_return($action, array($id));
190
exit;
191
} else {
192
- adrotate_return('no_access');
193
}
194
} else {
195
adrotate_nonce_error();
@@ -250,7 +250,7 @@ function adrotate_insert_group() {
250
// Sort out block shape
251
if($rows < 1 OR $rows == '' OR !is_numeric($rows)) $rows = 2;
252
if($columns < 1 OR $columns == '' OR !is_numeric($columns)) $columns = 2;
253
- if((is_numeric($adwidth) AND $adwidth < 1 OR $adwidth > 9999) OR $adwidth == '' OR (!is_numeric($adwidth) AND $adwidth != 'auto')) $adheight = '125';
254
if((is_numeric($adheight) AND $adheight < 1 OR $adheight > 9999) OR $adheight == '' OR (!is_numeric($adheight) AND $adheight != 'auto')) $adheight = '125';
255
if($admargin < 0 OR $admargin > 99 OR $admargin == '' OR !is_numeric($admargin)) $admargin = 0;
256
@@ -311,10 +311,10 @@ function adrotate_insert_group() {
311
$dynamic_count = $wpdb->get_var("SELECT COUNT(*) as `total` FROM `".$wpdb->prefix."adrotate_groups` WHERE `name` != '' AND `modus` = 1;");
312
update_option('adrotate_dynamic_required', $dynamic_count);
313
314
- adrotate_return($action, array($id));
315
exit;
316
} else {
317
- adrotate_return('no_access');
318
}
319
} else {
320
adrotate_nonce_error();
@@ -358,6 +358,7 @@ function adrotate_request_action() {
358
list($action, $specific) = explode("-", $actions);
359
360
if($banner_ids != '') {
361
if($action == 'export') {
362
if(current_user_can('adrotate_moderate')) {
363
adrotate_export($banner_ids);
@@ -372,7 +373,7 @@ function adrotate_request_action() {
372
adrotate_active($banner_id, 'deactivate');
373
$result_id = $banner_id;
374
} else {
375
- adrotate_return('no_access');
376
}
377
}
378
if($action == 'activate') {
@@ -380,7 +381,7 @@ function adrotate_request_action() {
380
adrotate_active($banner_id, 'activate');
381
$result_id = $banner_id;
382
} else {
383
- adrotate_return('no_access');
384
}
385
}
386
if($action == 'delete') {
@@ -388,7 +389,7 @@ function adrotate_request_action() {
388
adrotate_delete($banner_id, 'banner');
389
$result_id = $banner_id;
390
} else {
391
- adrotate_return('no_access');
392
}
393
}
394
if($action == 'reset') {
@@ -396,7 +397,7 @@ function adrotate_request_action() {
396
adrotate_reset($banner_id);
397
$result_id = $banner_id;
398
} else {
399
- adrotate_return('no_access');
400
}
401
}
402
if($action == 'renew') {
@@ -404,7 +405,7 @@ function adrotate_request_action() {
404
adrotate_renew($banner_id, $specific);
405
$result_id = $banner_id;
406
} else {
407
- adrotate_return('no_access');
408
}
409
}
410
if($action == 'weight') {
@@ -412,7 +413,7 @@ function adrotate_request_action() {
412
adrotate_weight($banner_id, $specific);
413
$result_id = $banner_id;
414
} else {
415
- adrotate_return('no_access');
416
}
417
}
418
}
@@ -420,13 +421,14 @@ function adrotate_request_action() {
420
}
421
422
if($group_ids != '') {
423
foreach($group_ids as $group_id) {
424
if($action == 'group_delete') {
425
if(current_user_can('adrotate_group_delete')) {
426
adrotate_delete($group_id, 'group');
427
$result_id = $group_id;
428
} else {
429
- adrotate_return('no_access');
430
}
431
}
432
if($action == 'group_delete_banners') {
@@ -434,13 +436,13 @@ function adrotate_request_action() {
434
adrotate_delete($group_id, 'bannergroup');
435
$result_id = $group_id;
436
} else {
437
- adrotate_return('no_access');
438
}
439
}
440
}
441
}
442
443
- adrotate_return($action, array($result_id));
444
} else {
445
adrotate_nonce_error();
446
exit;
@@ -479,9 +481,6 @@ function adrotate_delete($id, $what) {
479
$wpdb->query($wpdb->prepare("DELETE FROM `".$wpdb->prefix."adrotate_linkmeta` WHERE `group` = %d;", $id));
480
$wpdb->query($wpdb->prepare("DELETE FROM `".$wpdb->prefix."adrotate_stats` WHERE `group` = %d;", $id)); // Perhaps unnessesary
481
adrotate_prepare_evaluate_ads(false);
482
- } else {
483
- adrotate_return('error');
484
- exit;
485
}
486
}
487
}
@@ -575,95 +574,119 @@ function adrotate_export($ids) {
575
Since: 0.1
576
-------------------------------------------------------------*/
577
function adrotate_options_submit() {
578
-
579
if(wp_verify_nonce($_POST['adrotate_nonce_settings'],'adrotate_settings')) {
580
- // Set and save user roles
581
- adrotate_set_capability($_POST['adrotate_ad_manage'], "adrotate_ad_manage");
582
- adrotate_set_capability($_POST['adrotate_ad_delete'], "adrotate_ad_delete");
583
- adrotate_set_capability($_POST['adrotate_group_manage'], "adrotate_group_manage");
584
- adrotate_set_capability($_POST['adrotate_group_delete'], "adrotate_group_delete");
585
- $config['ad_manage'] = $_POST['adrotate_ad_manage'];
586
- $config['ad_delete'] = $_POST['adrotate_ad_delete'];
587
- $config['group_manage'] = $_POST['adrotate_group_manage'];
588
- $config['group_delete'] = $_POST['adrotate_group_delete'];
589
-
590
- // Enable stats
591
- $stats = trim($_POST['adrotate_stats']);
592
- if(is_numeric($stats) AND $stats >= 0 AND $stats <= 2) {
593
- $config['stats'] = $stats;
594
- } else {
595
- $config['stats'] = 1;
596
- }
597
598
- // Set the banner folder, reset if empty
599
- $config['banner_folder'] = "wp-content/banners/";
600
601
- // Turn option off.
602
- $config['notification_email_switch'] = 'N';
603
- $config['notification_email'] = array();
604
- $config['advertiser_email'] = array();
605
606
- // Set up impression tracker timer
607
- $impression_timer = trim($_POST['adrotate_impression_timer']);
608
- if(is_numeric($impression_timer) AND $impression_timer >= 10 AND $impression_timer <= 3600) {
609
- $config['impression_timer'] = $impression_timer;
610
- } else {
611
- $config['impression_timer'] = 60;
612
}
613
614
- // Set up click timer
615
- $click_timer = trim($_POST['adrotate_click_timer']);
616
- if(is_numeric($click_timer) AND $click_timer >= 60 AND $click_timer <= 86400) {
617
- $config['click_timer'] = $click_timer;
618
- } else {
619
- $config['click_timer'] = 86400;
620
}
621
622
- // Miscellaneous Options
623
- if(isset($_POST['adrotate_widgetalign'])) $config['widgetalign'] = 'Y';
624
- else $config['widgetalign'] = 'N';
625
- if(isset($_POST['adrotate_widgetpadding'])) $config['widgetpadding'] = 'Y';
626
- else $config['widgetpadding'] = 'N';
627
- if(isset($_POST['adrotate_w3caching'])) $config['w3caching'] = 'Y';
628
- else $config['w3caching'] = 'N';
629
- if(isset($_POST['adrotate_jquery'])) $config['jquery'] = 'Y';
630
- else $config['jquery'] = 'N';
631
- if(isset($_POST['adrotate_jsfooter'])) $config['jsfooter'] = 'Y';
632
- else $config['jsfooter'] = 'N';
633
- $config['adblock'] = 'N'; // Pro only
634
- $config['adblock_timer'] = 0; // Pro only
635
- $config['adblock_message'] = ''; // Pro only
636
-
637
- update_option('adrotate_config', $config);
638
-
639
- // Sort out crawlers
640
- $crawlers = explode(',', trim($_POST['adrotate_crawlers']));
641
- $clean_crawler = array();
642
- foreach($crawlers as $crawler) {
643
- $crawler = preg_replace('/[^a-zA-Z0-9\[\]\-_:; ]/i', '', trim($crawler));
644
- if(strlen($crawler) > 0) $clean_crawler[] = $crawler;
645
}
646
- update_option('adrotate_crawlers', $clean_crawler);
647
-
648
- // Debug option
649
- if(isset($_POST['adrotate_debug'])) $debug['general'] = true;
650
- else $debug['general'] = false;
651
- if(isset($_POST['adrotate_debug_dashboard'])) $debug['dashboard'] = true;
652
- else $debug['dashboard'] = false;
653
- if(isset($_POST['adrotate_debug_userroles'])) $debug['userroles'] = true;
654
- else $debug['userroles'] = false;
655
- if(isset($_POST['adrotate_debug_userstats'])) $debug['userstats'] = true;
656
- else $debug['userstats'] = false;
657
- if(isset($_POST['adrotate_debug_stats'])) $debug['stats'] = true;
658
- else $debug['stats'] = false;
659
- if(isset($_POST['adrotate_debug_timers'])) $debug['timers'] = true;
660
- else $debug['timers'] = false;
661
- if(isset($_POST['adrotate_debug_track'])) $debug['track'] = true;
662
- else $debug['track'] = false;
663
- update_option('adrotate_debug', $debug);
664
665
// Return to dashboard
666
- adrotate_return('settings_saved');
667
} else {
668
adrotate_nonce_error();
669
exit;
@@ -674,47 +697,16 @@ function adrotate_options_submit() {
674
Name: adrotate_prepare_roles
675
676
Purpose: Prepare user roles for WordPress
677
- Receive: -None-
678
- Return: $action
679
Since: 3.0
680
-------------------------------------------------------------*/
681
- function adrotate_prepare_roles() {
682
-
683
- if(isset($_POST['adrotate_role_add_submit'])) {
684
- $action = "role_add";
685
- adrotate_add_roles();
686
- update_option('adrotate_roles', '1');
687
}
688
- if(isset($_POST['adrotate_role_remove_submit'])) {
689
- $action = "role_remove";
690
- adrotate_remove_roles();
691
- update_option('adrotate_roles', '0');
692
}
693
-
694
- adrotate_return($action);
695
- }
696
-
697
- /*-------------------------------------------------------------
698
- Name: adrotate_add_roles
699
-
700
- Purpose: Add User roles and capabilities
701
- Receive: -None-
702
- Return: -None-
703
- Since: 3.0
704
- -------------------------------------------------------------*/
705
- function adrotate_add_roles() {
706
- add_role('adrotate_advertiser', 'AdRotate Advertiser', array('read' => 1));
707
- }
708
-
709
- /*-------------------------------------------------------------
710
- Name: adrotate_remove_roles
711
-
712
- Purpose: Remove User roles and capabilities
713
- Receive: -None-
714
- Return: -None-
715
- Since: 3.0
716
- -------------------------------------------------------------*/
717
- function adrotate_remove_roles() {
718
- remove_role('adrotate_advertiser');
719
}
720
?>
186
adrotate_prepare_evaluate_ads(false, $id);
187
}
188
189
+ adrotate_return('adrotate-ads', 200);
190
exit;
191
} else {
192
+ adrotate_return('adrotate-ads', 500);
193
}
194
} else {
195
adrotate_nonce_error();
250
// Sort out block shape
251
if($rows < 1 OR $rows == '' OR !is_numeric($rows)) $rows = 2;
252
if($columns < 1 OR $columns == '' OR !is_numeric($columns)) $columns = 2;
253
+ if((is_numeric($adwidth) AND $adwidth < 1 OR $adwidth > 9999) OR $adwidth == '' OR (!is_numeric($adwidth) AND $adwidth != 'auto')) $adwidth = '125';
254
if((is_numeric($adheight) AND $adheight < 1 OR $adheight > 9999) OR $adheight == '' OR (!is_numeric($adheight) AND $adheight != 'auto')) $adheight = '125';
255
if($admargin < 0 OR $admargin > 99 OR $admargin == '' OR !is_numeric($admargin)) $admargin = 0;
256
311
$dynamic_count = $wpdb->get_var("SELECT COUNT(*) as `total` FROM `".$wpdb->prefix."adrotate_groups` WHERE `name` != '' AND `modus` = 1;");
312
update_option('adrotate_dynamic_required', $dynamic_count);
313
314
+ adrotate_return('adrotate-groups', 201);
315
exit;
316
} else {
317
+ adrotate_return('adrotate-groups', 500);
318
}
319
} else {
320
adrotate_nonce_error();
358
list($action, $specific) = explode("-", $actions);
359
360
if($banner_ids != '') {
361
+ $return = 'adrotate-ads';
362
if($action == 'export') {
363
if(current_user_can('adrotate_moderate')) {
364
adrotate_export($banner_ids);
373
adrotate_active($banner_id, 'deactivate');
374
$result_id = $banner_id;
375
} else {
376
+ adrotate_return($return, 500);
377
}
378
}
379
if($action == 'activate') {
381
adrotate_active($banner_id, 'activate');
382
$result_id = $banner_id;
383
} else {
384
+ adrotate_return($return, 500);
385
}
386
}
387
if($action == 'delete') {
389
adrotate_delete($banner_id, 'banner');
390
$result_id = $banner_id;
391
} else {
392
+ adrotate_return($return, 500);
393
}
394
}
395
if($action == 'reset') {
397
adrotate_reset($banner_id);
398
$result_id = $banner_id;
399
} else {
400
+ adrotate_return($return, 500);
401
}
402
}
403
if($action == 'renew') {
405
adrotate_renew($banner_id, $specific);
406
$result_id = $banner_id;
407
} else {
408
+ adrotate_return($return, 500);
409
}
410
}
411
if($action == 'weight') {
413
adrotate_weight($banner_id, $specific);
414
$result_id = $banner_id;
415
} else {
416
+ adrotate_return($return, 500);
417
}
418
}
419
}
421
}
422
423
if($group_ids != '') {
424
+ $return = 'adrotate-groups';
425
foreach($group_ids as $group_id) {
426
if($action == 'group_delete') {
427
if(current_user_can('adrotate_group_delete')) {
428
adrotate_delete($group_id, 'group');
429
$result_id = $group_id;
430
} else {
431
+ adrotate_return($return, 500);
432
}
433
}
434
if($action == 'group_delete_banners') {
436
adrotate_delete($group_id, 'bannergroup');
437
$result_id = $group_id;
438
} else {
439
+ adrotate_return($return, 500);
440
}
441
}
442
}
443
}
444
445
+ adrotate_return($return, $result_id);
446
} else {
447
adrotate_nonce_error();
448
exit;
481
$wpdb->query($wpdb->prepare("DELETE FROM `".$wpdb->prefix."adrotate_linkmeta` WHERE `group` = %d;", $id));
482
$wpdb->query($wpdb->prepare("DELETE FROM `".$wpdb->prefix."adrotate_stats` WHERE `group` = %d;", $id)); // Perhaps unnessesary
483
adrotate_prepare_evaluate_ads(false);
484
}
485
}
486
}
574
Since: 0.1
575
-------------------------------------------------------------*/
576
function adrotate_options_submit() {
577
if(wp_verify_nonce($_POST['adrotate_nonce_settings'],'adrotate_settings')) {
578
579
+ $settings_tab = esc_attr($_POST['adrotate_settings_tab']);
580
+
581
+ if($settings_tab == 'general') {
582
+ $config = get_option('adrotate_config');
583
+
584
+ $config['jquery'] = (isset($_POST['adrotate_jquery'])) ? 'Y' : 'N';
585
+ $config['jsfooter'] = (isset($_POST['adrotate_jsfooter'])) ? 'Y' : 'N';
586
+
587
+ // Turn options off. Available in AdRotate Pro only
588
+ $config['banner_folder'] = "wp-content/banners/";
589
+ $config['notification_email'] = array();
590
+ $config['advertiser_email'] = array();
591
+ $config['adblock'] = 'N';
592
+ $config['adblock_timer'] = 0;
593
+ $config['adblock_message'] = '';
594
+ $config['enable_geo'] = 0;
595
+ $config['geo_cookie_life'] = 86400;
596
+ $config['geo_email'] = '';
597
+ $config['geo_pass'] = '';
598
+ $config['enable_advertisers'] = 'N';
599
+ $config['enable_editing'] = 'N';
600
+ $config['enable_geo_advertisers'] = 0;
601
+ $config['adblock'] = 'N';
602
+ $config['adblock_loggedin'] = 'N';
603
+ $config['adblock_timer'] = 5;
604
+ $config['adblock_message'] = "Ad blocker detected! Please wait %time% seconds or disable your ad blocker!";
605
+ update_option('adrotate_config', $config);
606
+
607
+ // Sort out crawlers
608
+ $crawlers = explode(',', trim($_POST['adrotate_crawlers']));
609
+ $new_crawlers = array();
610
+ foreach($crawlers as $crawler) {
611
+ $crawler = preg_replace('/[^a-zA-Z0-9\[\]\-_:; ]/i', '', trim($crawler));
612
+ if(strlen($crawler) > 0) $new_crawlers[] = $crawler;
613
+ }
614
+ update_option('adrotate_crawlers', $new_crawlers);
615
+
616
+ $notifications = get_option('adrotate_notifications');
617
+
618
+ // Turn options off. Available in AdRotate Pro only
619
+ $notifications['notification_email'] = 'N';
620
+ $notifications['notification_push'] = 'N';
621
+ $notifications['notification_dashboard'] = 'Y';
622
+ $notifications['notification_email_publisher'] = array();
623
+ $notifications['notification_email_advertiser'] = array(get_option('admin_email'));
624
+ $notifications['notification_push_geo'] = 'N';
625
+ $notifications['notification_push_status'] = 'N';
626
+ $notifications['notification_push_queue'] = 'N';
627
+ $notifications['notification_push_approved'] = 'N';
628
+ $notifications['notification_push_rejected'] = 'N';
629
+ $notifications['notification_push_user'] = '';
630
+ $notifications['notification_push_api'] = '';
631
+
632
+ update_option('adrotate_notifications', $notifications);
633
+ }
634
635
+ if($settings_tab == 'stats') {
636
+ $config = get_option('adrotate_config');
637
+
638
+ $stats = trim($_POST['adrotate_stats']);
639
+ $config['stats'] = (is_numeric($stats) AND $stats >= 0 AND $stats <= 3) ? $stats : 1;
640
+ $config['enable_loggedin_impressions'] = 'Y';
641
+ $config['enable_loggedin_clicks'] = 'Y';
642
+ $impression_timer = trim($_POST['adrotate_impression_timer']);
643
+ $config['impression_timer'] = (is_numeric($impression_timer) AND $impression_timer >= 10 AND $impression_timer <= 3600) ? $impression_timer : 60;
644
+ $click_timer = trim($_POST['adrotate_click_timer']);
645
+ $config['click_timer'] = (is_numeric($click_timer) AND $click_timer >= 60 AND $click_timer <= 86400) ? $click_timer : 86400;
646
647
+ update_option('adrotate_config', $config);
648
}
649
650
+ if($settings_tab == 'roles') {
651
+ $config = get_option('adrotate_config');
652
+
653
+ adrotate_set_capability($_POST['adrotate_ad_manage'], "adrotate_ad_manage");
654
+ adrotate_set_capability($_POST['adrotate_ad_delete'], "adrotate_ad_delete");
655
+ adrotate_set_capability($_POST['adrotate_group_manage'], "adrotate_group_manage");
656
+ adrotate_set_capability($_POST['adrotate_group_delete'], "adrotate_group_delete");
657
+ $config['ad_manage'] = $_POST['adrotate_ad_manage'];
658
+ $config['ad_delete'] = $_POST['adrotate_ad_delete'];
659
+ $config['group_manage'] = $_POST['adrotate_group_manage'];
660
+ $config['group_delete'] = $_POST['adrotate_group_delete'];
661
+
662
+ update_option('adrotate_config', $config);
663
}
664
+
665
+ if($settings_tab == 'misc') {
666
+ $config = get_option('adrotate_config');
667
+
668
+ $config['widgetalign'] = (isset($_POST['adrotate_widgetalign'])) ? 'Y' : 'N';
669
+ $config['widgetpadding'] = (isset($_POST['adrotate_widgetpadding'])) ? 'Y' : 'N';
670
+ $config['adminbar'] = (isset($_POST['adrotate_adminbar'])) ? 'Y' : 'N';
671
+ $config['hide_schedules'] = (isset($_POST['adrotate_hide_schedules'])) ? 'Y' : 'N';
672
+ $config['w3caching'] = (isset($_POST['adrotate_w3caching'])) ? 'Y' : 'N';
673
674
+ update_option('adrotate_config', $config);
675
+ }
676
+
677
+ if($settings_tab == 'maintenance') {
678
+ $debug = get_option('adrotate_debug');
679
+
680
+ $debug['general'] = (isset($_POST['adrotate_debug'])) ? true : false;
681
+ $debug['publisher'] = (isset($_POST['adrotate_debug_publisher'])) ? true : false;
682
+ $debug['timers'] = (isset($_POST['adrotate_debug_timers'])) ? true : false;
683
+ $debug['track'] = (isset($_POST['adrotate_debug_track'])) ? true : false;
684
+
685
+ update_option('adrotate_debug', $debug);
686
}
687
688
// Return to dashboard
689
+ adrotate_return('adrotate-settings', 400, array('tab' => $settings_tab));
690
} else {
691
adrotate_nonce_error();
692
exit;
697
Name: adrotate_prepare_roles
698
699
Purpose: Prepare user roles for WordPress
700
+ Receive: $action
701
+ Return: -None-
702
Since: 3.0
703
-------------------------------------------------------------*/
704
+ function adrotate_prepare_roles($action) {
705
+ if($action == 'add') {
706
+ add_role('adrotate_advertiser', __('AdRotate Advertiser', 'adrotate'), array('read' => 1));
707
}
708
+ if($action == 'remove') {
709
+ remove_role('adrotate_advertiser');
710
}
711
}
712
?>
adrotate-output.php CHANGED
@@ -438,7 +438,7 @@ function adrotate_ad_output($id, $group = 0, $bannercode, $tracker, $link, $imag
438
}
439
unset($matches);
440
441
- $banner_output = str_replace('%title%', get_the_title(), $banner_output);
442
$banner_output = str_replace('%random%', rand(100000,999999), $banner_output);
443
$banner_output = str_replace('%image%', $image, $banner_output);
444
$banner_output = str_replace('%id%', $id, $banner_output);
@@ -588,7 +588,7 @@ function adrotate_custom_css() {
588
if($group->modus == 2) { // Block group
589
if($group->adwidth != 'auto') {
590
$width_sum = $group->gridcolumns * ($group->admargin + $group->adwidth + $group->admargin);
591
- $grid_width = "min-width:".$group->admargin."px; max-width:".$width_sum."px;";
592
} else {
593
$grid_width = "width:auto;";
594
}
@@ -734,8 +734,8 @@ function adrotate_notifications_dashboard() {
734
if($pro_banner != 1 AND $pro_banner < (adrotate_now() - 604800) AND strpos($page, 'adrotate') !== false) {
735
echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">';
736
echo ' <div class="adrotate_banner">';
737
- echo ' <div class="button_div"><a class="button" target="_blank" href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-upgradebanner&pk_kwd=upgrade_adrotatefree">'.__('Learn More', 'adrotate').'</a></div>';
738
- echo ' <div class="text">'.__("You've been using <strong>AdRotate</strong> for a while now. Why not upgrade to the <strong>PRO</strong> version", 'adrotate').'?<br /><span>'.__('Get more features to even better run your advertising campaigns.', 'adrotate' ).' '.__('Thank you for your consideration!', 'adrotate' ).'</span></div>';
739
echo ' <a class="close_banner" href="admin.php?page=adrotate-pro&hide=1"><img title="Close" src="'.plugins_url('images/icon-close.png', __FILE__).'" alt=""/></a>';
740
echo ' <div class="icon"><img title="" src="'.plugins_url('images/adrotate-logo-60x60.png', __FILE__).'" alt=""/></div>';
741
echo ' </div>';
@@ -779,22 +779,19 @@ function adrotate_notifications_dashboard() {
779
-------------------------------------------------------------*/
780
function adrotate_welcome_pointer() {
781
$pointer_content = '<h3>AdRotate '.ADROTATE_DISPLAY.'</h3>';
782
- $pointer_content .= '<p>'.__('Welcome, and thanks for using AdRotate. Everything related to AdRotate is in this menu. Check out the', 'adrotate').' <a href="http:\/\/ajdg.solutions\/manuals\/adrotate\/" target="_blank">'.__('manuals', 'adrotate').'</a> '.__('and', 'adrotate').' <a href="https:\/\/ajdg.solutions\/forums\/forum\/adrotate-for-wordpress\/" target="_blank">'.__('forums', 'adrotate').'</a>.</p>';
783
- $pointer_content .= '<p><strong>AdRotate Professional</strong><br />Did you know there is also a premium version of AdRotate? Find out how you can benefit from the <a href="admin.php?page=adrotate-pro" target="_blank">extra features</a>.</p>';
784
?>
785
<script type="text/javascript">
786
jQuery(document).ready(function($) {
787
$('#toplevel_page_adrotate').pointer({
788
'content':'<?php echo $pointer_content; ?>',
789
- 'position':{
790
- 'edge':'left', // left, right, top, bottom
791
- 'align':'middle' // top, bottom, left, right, middle
792
- },
793
close: function() {
794
$.post(ajaxurl, {
795
- pointer:'adrotatefree_'+<?php echo ADROTATE_VERSION.ADROTATE_DB_VERSION; ?>,
796
- action:'dismiss-wp-pointer'
797
- });
798
}
799
}).pointer("open");
800
});
@@ -848,7 +845,7 @@ function adrotate_credits() {
848
echo '<thead>';
849
echo '<tr valign="top">';
850
echo ' <th colspan="2">'.__('Help AdRotate Grow', 'adrotate').'</th>';
851
- echo ' <th colspan="2" width="40%">'.__('Brought to you by', 'adrotate').'</th>';
852
echo '</tr>';
853
echo '</thead>';
854
@@ -857,8 +854,7 @@ function adrotate_credits() {
857
echo '<td><center><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-credits&pk_kwd=adrotate_logo" title="AdRotate plugin for WordPress"><img src="'.plugins_url('/images/adrotate-logo-60x60.png', __FILE__).'" alt="adrotate-logo-60x60" width="60" height="60" /></a></center></td>';
858
echo '<td>'.__("A lot of users only think to review AdRotate when something goes wrong while thousands of people use AdRotate satisfactory. Don't let this go unnoticed.", 'adrotate').' <strong>'. __("If you find AdRotate useful please leave your honest", '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>';
859
860
- echo '<td><center><a href="https://ajdg.solutions/?pk_campaign=adrotatefree-credits&pk_kwd=ajdg_logo" title="AJdG Solutions"><img src="'.plugins_url('/images/ajdg-logo-100x60.png', __FILE__).'" alt="ajdg-logo-100x60" width="100" height="60" /></a></center></td>';
861
- echo '<td><a href="https://ajdg.solutions/?pk_campaign=adrotatefree-credits&pk_kwd=ajdg_link" title="AJdG Solutions">AJdG Solutions</a> - '.__('Your one stop for Webdevelopment, consultancy and anything WordPress! Find out more about what I can do for you!', 'adrotate').' '.__('Visit the', 'adrotate').' <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-credits&pk_kwd=ajdg_link" target="_blank">AJdG Solutions</a> '.__('website', 'adrotate').'</td>';
862
echo '</tr>';
863
echo '</tbody>';
864
@@ -875,7 +871,7 @@ function adrotate_credits() {
875
Since: 3.9.14
876
-------------------------------------------------------------*/
877
function adrotate_trademark() {
878
- return '<center><small>AdRotate&reg; and the AdRotate Logo are owned by Arnan de Gans for AJdG Solutions.</small></center>';
879
}
880
881
/*-------------------------------------------------------------
438
}
439
unset($matches);
440
441
+ $banner_output = str_replace('%title%', $name, $banner_output);
442
$banner_output = str_replace('%random%', rand(100000,999999), $banner_output);
443
$banner_output = str_replace('%image%', $image, $banner_output);
444
$banner_output = str_replace('%id%', $id, $banner_output);
588
if($group->modus == 2) { // Block group
589
if($group->adwidth != 'auto') {
590
$width_sum = $group->gridcolumns * ($group->admargin + $group->adwidth + $group->admargin);
591
+ $grid_width = "width:".$group->admargin."px; max-width:".$width_sum."px;";
592
} else {
593
$grid_width = "width:auto;";
594
}
734
if($pro_banner != 1 AND $pro_banner < (adrotate_now() - 604800) AND strpos($page, 'adrotate') !== false) {
735
echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">';
736
echo ' <div class="adrotate_banner">';
737
+ echo ' <div class="button_div"><a class="button" target="_blank" href="https://ajdg.solutions/cart/?add-to-cart=1126?pk_campaign=adrotatefree-upgradebanner&pk_kwd=upgrade_adrotatefree">'.__('Buy now', 'adrotate').'</a></div>';
738
+ echo ' <div class="text">'.__("You've been using <strong>AdRotate</strong> for a while now. Why not upgrade to the <strong>PRO</strong> version", 'adrotate').'?<br /><span>'.__('Use discount code <b>getadrotatepro</b> for 10% off on any AdRotate license!', 'adrotate' ).' '.__('Thank you for your purchase!', 'adrotate' ).'</span></div>';
739
echo ' <a class="close_banner" href="admin.php?page=adrotate-pro&hide=1"><img title="Close" src="'.plugins_url('images/icon-close.png', __FILE__).'" alt=""/></a>';
740
echo ' <div class="icon"><img title="" src="'.plugins_url('images/adrotate-logo-60x60.png', __FILE__).'" alt=""/></div>';
741
echo ' </div>';
779
-------------------------------------------------------------*/
780
function adrotate_welcome_pointer() {
781
$pointer_content = '<h3>AdRotate '.ADROTATE_DISPLAY.'</h3>';
782
+ $pointer_content .= '<p>'.__('Welcome, and thanks for using AdRotate. Everything related to AdRotate is in this menu. Check out the', 'adrotate').' <a href="http:\/\/ajdg.solutions\/manuals\/adrotate-manuals\/" target="_blank">'.__('manuals', 'adrotate').'</a> '.__('and', 'adrotate').' <a href="https:\/\/ajdg.solutions\/forums\/forum\/adrotate-for-wordpress\/" target="_blank">'.__('forums', 'adrotate').'</a>.</p>';
783
+ $pointer_content .= '<p><strong>AdRotate Professional</strong><br />Did you know there is also a premium version of AdRotate? benefit from many <a href="admin.php?page=adrotate-pro">extra features</a>.</p>';
784
?>
785
<script type="text/javascript">
786
jQuery(document).ready(function($) {
787
$('#toplevel_page_adrotate').pointer({
788
'content':'<?php echo $pointer_content; ?>',
789
+ 'position':{ 'edge':'left', 'align':'middle' },
790
close: function() {
791
$.post(ajaxurl, {
792
+ pointer:'adrotatefree_'+<?php echo ADROTATE_VERSION.ADROTATE_DB_VERSION; ?>,
793
+ action:'dismiss-wp-pointer'
794
+ });
795
}
796
}).pointer("open");
797
});
845
echo '<thead>';
846
echo '<tr valign="top">';
847
echo ' <th colspan="2">'.__('Help AdRotate Grow', 'adrotate').'</th>';
848
+ echo ' <th colspan="2" width="20%"><center>'.__('Brought to you by', 'adrotate').'</center></th>';
849
echo '</tr>';
850
echo '</thead>';
851
854
echo '<td><center><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-credits&pk_kwd=adrotate_logo" title="AdRotate plugin for WordPress"><img src="'.plugins_url('/images/adrotate-logo-60x60.png', __FILE__).'" alt="adrotate-logo-60x60" width="60" height="60" /></a></center></td>';
855
echo '<td>'.__("A lot of users only think to review AdRotate when something goes wrong while thousands of people use AdRotate satisfactory. Don't let this go unnoticed.", 'adrotate').' <strong>'. __("If you find AdRotate useful please leave your honest", '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>';
856
857
+ echo '<td><center><a href="https://ajdg.solutions/?pk_campaign=adrotatefree-credits&pk_kwd=ajdg_logo" title="AJdG Solutions"><img src="'.plugins_url('/images/ajdg-logo-100x60.png', __FILE__).'" alt="ajdg-logo-100x60" width="100" height="60" /></a></center></td></td>';
858
echo '</tr>';
859
echo '</tbody>';
860
871
Since: 3.9.14
872
-------------------------------------------------------------*/
873
function adrotate_trademark() {
874
+ return '<center><small>AdRotate<sup>&reg;</sup> is a registered trademark.</small></center>';
875
}
876
877
/*-------------------------------------------------------------
adrotate-setup.php CHANGED
@@ -67,7 +67,7 @@ function adrotate_activate_setup() {
67
add_option('adrotate_notifications', array());
68
add_option('adrotate_crawlers', array());
69
add_option('adrotate_db_timer', date('U'));
70
- add_option('adrotate_debug', array('general' => false, 'dashboard' => false, 'userroles' => false, 'userstats' => false, 'stats' => false, 'track' => false));
71
add_option('adrotate_advert_status', array('error' => 0, 'expired' => 0, 'expiressoon' => 0, 'normal' => 0, 'total' => 0));
72
add_option('adrotate_geo_required', 0);
73
add_option('adrotate_geo_requests', 0);
@@ -89,8 +89,9 @@ function adrotate_activate_setup() {
89
$role->add_cap("adrotate_group_delete");
90
91
// Switch additional roles off
92
- adrotate_remove_roles();
93
- update_option('adrotate_roles', '0');
94
95
// Set up some schedules
96
$firstrun = adrotate_date_start('day');
@@ -131,9 +132,8 @@ function adrotate_deactivate($network_wide) {
131
-------------------------------------------------------------*/
132
function adrotate_deactivate_setup() {
133
// Clear out roles
134
- $adrotate_roles = get_option('adrotate_roles');
135
- if($adrotate_roles == 1) {
136
- adrotate_remove_roles();
137
}
138
139
update_option('adrotate_hide_banner', adrotate_now());
@@ -202,7 +202,7 @@ function adrotate_uninstall_setup() {
202
delete_option('adrotate_geo_requests');
203
delete_option('adrotate_responsive_required');
204
delete_option('adrotate_dynamic_required');
205
- delete_option('adrotate_roles');
206
delete_option('adrotate_server'); // Obsolete in 3.11.1
207
delete_option('adrotate_server_hide'); // Obsolete in 3.11.1
208
delete_option('adrotate_version');
@@ -257,12 +257,14 @@ function adrotate_check_config() {
257
if(!isset($crawlers)) $crawlers = array();
258
if(!isset($debug)) $debug = array();
259
260
- if(!isset($config['advertiser'])) $config['advertiser'] = 'administrator';
261
if(!isset($config['global_report'])) $config['global_report'] = 'administrator';
262
if(!isset($config['ad_manage'])) $config['ad_manage'] = 'administrator';
263
if(!isset($config['ad_delete'])) $config['ad_delete'] = 'administrator';
264
if(!isset($config['group_manage'])) $config['group_manage'] = 'administrator';
265
if(!isset($config['group_delete'])) $config['group_delete'] = 'administrator';
266
if(!isset($config['moderate'])) $config['moderate'] = 'administrator';
267
if(!isset($config['moderate_approve'])) $config['moderate_approve'] = 'administrator';
268
if(!isset($config['enable_advertisers']) OR ($config['enable_advertisers'] != 'Y' AND $config['enable_advertisers'] != 'N')) $config['enable_advertisers'] = 'N';
@@ -277,7 +279,6 @@ function adrotate_check_config() {
277
if(!isset($config['enable_geo_advertisers'])) $config['enable_geo_advertisers'] = 0;
278
if(!isset($config['banner_folder'])) $config['banner_folder'] = "wp-content/banners/";
279
if(!isset($config['adminbar']) OR ($config['adminbar'] != 'Y' AND $config['adminbar'] != 'N')) $config['adminbar'] = 'Y';
280
- if(!isset($config['dashboard_notifications']) OR ($config['dashboard_notifications'] != 'Y' AND $config['dashboard_notifications'] != 'N')) $config['dashboard_notifications'] = 'Y';
281
if(!isset($config['impression_timer']) OR $config['impression_timer'] < 10 OR $config['impression_timer'] > 3600) $config['impression_timer'] = 60;
282
if(!isset($config['click_timer']) OR $config['click_timer'] < 60 OR $config['click_timer'] > 86400) $config['click_timer'] = 86400;
283
if(!isset($config['hide_schedules']) OR ($config['hide_schedules'] != 'Y' AND $config['hide_schedules'] != 'N')) $config['hide_schedules'] = 'N';
@@ -288,26 +289,35 @@ function adrotate_check_config() {
288
if(!isset($config['jsfooter']) OR ($config['jsfooter'] != 'Y' AND $config['jsfooter'] != 'N')) $config['jsfooter'] = 'Y';
289
if(!isset($config['adblock']) OR ($config['adblock'] != 'Y' AND $config['adblock'] != 'N')) $config['adblock'] = 'N';
290
if(!isset($config['adblock_timer']) OR $config['adblock_timer'] < 0 OR $config['adblock_timer'] > 20) $config['adblock_timer'] = 5;
291
- if(!isset($config['adblock_message'])) $config['adblock_message'] = "";
292
if(!isset($config['adblock_loggedin']) OR ($config['adblock_loggedin'] != 'Y' AND $config['adblock_loggedin'] != 'N')) $config['adblock_loggedin'] = "N";
293
update_option('adrotate_config', $config);
294
295
if(!isset($notifications['notification_push']) OR ($notifications['notification_push'] != 'Y' AND $notifications['notification_push'] != 'N')) $notifications['notification_push'] = 'N';
296
if(!isset($notifications['notification_email']) OR ($notifications['notification_email'] != 'Y' AND $notifications['notification_email'] != 'N')) $notifications['notification_email'] = 'Y';
297
update_option('adrotate_notifications', $notifications);
298
299
if(!isset($crawlers) OR count($crawlers) < 1) $crawlers = array("008", "ABACHOBot", "Accoona-AI-Agent", "AddSugarSpiderBot", "alexa", "AnyApexBot", "Arachmo", "B-l-i-t-z-B-O-T", "Baiduspider", "BecomeBot", "BeslistBot","BillyBobBot", "Bimbot", "Bingbot", "BlitzBOT", "boitho.com-dc", "boitho.com-robot", "btbot", "CatchBot", "Cerberian Drtrs","Charlotte", "ConveraCrawler", "cosmos", "Covario IDS", "DataparkSearch", "DiamondBot", "Discobot", "Dotbot", "EmeraldShield.com WebBot", "envolk[ITS]spider", "EsperanzaBot", "Exabot", "FAST Enterprise Crawler", "FAST-WebCrawler", "FDSE robot","FindLinks", "FurlBot", "FyberSpider", "g2crawler", "Gaisbot", "GalaxyBot", "genieBot", "Gigabot", "Girafabot", "Googlebot", "Googlebot-Image", "GurujiBot", "HappyFunBot", "hl_ftien_spider", "Holmes", "htdig", "iaskspider", "ia_archiver", "iCCrawler", "ichiro", "inktomi", "igdeSpyder", "IRLbot", "IssueCrawler", "Jaxified Bot", "Jyxobot", "KoepaBot", "L.webis", "LapozzBot", "Larbin", "LDSpider", "LexxeBot", "Linguee Bot", "LinkWalker", "lmspider", "lwp-trivial", "mabontland", "magpie-crawler", "Mediapartners-Google", "MJ12bot", "Mnogosearch", "mogimogi", "MojeekBot", "Moreoverbot", "Morning Paper", "msnbot", "MSRBot", "MVAClient", "mxbot", "NetResearchServer", "NetSeer Crawler", "NewsGator", "NG-Search", "nicebot", "noxtrumbot", "Nusearch Spider", "NutchCVS", "Nymesis", "obot", "oegp", "omgilibot", "OmniExplorer_Bot", "OOZBOT", "Orbiter", "PageBitesHyperBot", "Peew", "polybot", "Pompos", "PostPost", "Psbot", "PycURL", "Qseero", "Radian6", "RAMPyBot", "RufusBot", "SandCrawler", "SBIder", "ScoutJet", "Scrubby", "SearchSight", "Seekbot", "semanticdiscovery", "Sensis Web Crawler", "SEOChat::Bot", "SeznamBot", "Shim-Crawler", "ShopWiki", "Shoula robot", "silk", "Sitebot", "Snappy", "sogou spider", "Sosospider", "Speedy Spider", "Sqworm", "StackRambler", "suggybot", "SurveyBot", "SynooBot", "Teoma", "TerrawizBot", "TheSuBot", "Thumbnail.CZ robot", "TinEye", "truwoGPS", "TurnitinBot", "TweetedTimes Bot", "TwengaBot", "updated", "Urlfilebot", "Vagabondo", "VoilaBot", "Vortex", "voyager", "VYU2", "webcollage", "Websquash.com", "wf84", "WoFindeIch Robot", "WomlpeFactory", "Xaldon_WebSpider", "yacy", "Yahoo! Slurp", "Yahoo! Slurp China", "YahooSeeker", "YahooSeeker-Testing", "YandexBot", "YandexImages", "Yasaklibot", "Yeti", "YodaoBot", "yoogliFetchAgent", "YoudaoBot", "Zao", "Zealbot", "zspider", "ZyBorg", "crawler", "bot", "froogle","looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "Googlebot", "Scooter", "appie", "WebBug", "Spade", "rabaz", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot", "Mediapartners-Google", "Sogou web spider", "WebAlta Crawler");
300
update_option('adrotate_crawlers', $crawlers);
301
302
if(!isset($debug['general'])) $debug['general'] = false;
303
- if(!isset($debug['dashboard'])) $debug['dashboard'] = false;
304
- if(!isset($debug['userroles'])) $debug['userroles'] = false;
305
- if(!isset($debug['userstats'])) $debug['userstats'] = false;
306
- if(!isset($debug['stats'])) $debug['stats'] = false;
307
if(!isset($debug['timers'])) $debug['timers'] = false;
308
if(!isset($debug['track'])) $debug['track'] = false;
309
update_option('adrotate_debug', $debug);
310
-
311
}
312
313
/*-------------------------------------------------------------
@@ -331,7 +341,7 @@ function adrotate_dummy_data() {
331
332
if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
333
// Demo ad 1
334
- $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 468x60', 'bannercode' => '&lt;a href=\&quot;https:\/\/ajdg.solutions\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/dummy-banners/adrotate-468x60.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'link' => '', 'tracker' => 'N', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
335
$ad_id = $wpdb->insert_id;
336
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'dayimpressions' => 0));
337
$schedule_id = $wpdb->insert_id;
@@ -339,15 +349,7 @@ function adrotate_dummy_data() {
339
unset($ad_id, $schedule_id);
340
341
// Demo ad 2
342
- $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 200x200', 'bannercode' => '&lt;a href=\&quot;http:\/\/ajdg.solutions\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/dummy-banners/adrotate-200x200.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'link' => '', 'tracker' => 'N', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
343
- $ad_id = $wpdb->insert_id;
344
- $wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'dayimpressions' => 0));
345
- $schedule_id = $wpdb->insert_id;
346
- $wpdb->insert("{$wpdb->prefix}adrotate_linkmeta", array('ad' => $ad_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id));
347
- unset($ad_id, $schedule_id);
348
-
349
- // Demo ad 3 (Floating Coconut)
350
- $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Visit floatingcoconut.net', 'bannercode' => '&lt;a href=\&quot;http:\/\/www.floatingcoconut.net\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/banners/floatingcoconut-horizontal.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'link' => '', 'tracker' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
351
$ad_id = $wpdb->insert_id;
352
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'dayimpressions' => 0));
353
$schedule_id = $wpdb->insert_id;
@@ -762,10 +764,7 @@ function adrotate_core_upgrade() {
762
global $wp_roles;
763
764
$firstrun = date('U') + 3600;
765
-
766
$adrotate_version = get_option("adrotate_version");
767
- // Legacy compatibility (Support 3.7.4 and older)
768
- if(!is_array($adrotate_version)) $adrotate_version = array('current' => $adrotate_version, 'previous' => 0);
769
770
if($adrotate_version['current'] < 323) {
771
delete_option('adrotate_notification_timer');
@@ -776,7 +775,7 @@ function adrotate_core_upgrade() {
776
}
777
778
if($adrotate_version['current'] < 350) {
779
- update_option('adrotate_debug', array('general' => false, 'dashboard' => false, 'userroles' => false, 'userstats' => false, 'stats' => false));
780
}
781
782
if($adrotate_version['current'] < 351) {
@@ -903,6 +902,13 @@ function adrotate_core_upgrade() {
903
update_option('adrotate_config', $config379);
904
}
905
906
update_option("adrotate_version", array('current' => ADROTATE_VERSION, 'previous' => $adrotate_version['current']));
907
}
908
@@ -925,9 +931,9 @@ function adrotate_optimize_database() {
925
if($adrotate_db_timer < ($now - 86400)) {
926
dbDelta("OPTIMIZE TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`, ;");
927
update_option('adrotate_db_timer', $now);
928
- adrotate_return('db_optimized');
929
} else {
930
- adrotate_return('db_timer');
931
}
932
}
933
@@ -985,7 +991,7 @@ function adrotate_cleanup_database() {
985
// Clean up stray linkmeta
986
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = 0 OR `ad` = '';");
987
988
- adrotate_return('db_cleaned');
989
}
990
991
/*-------------------------------------------------------------
67
add_option('adrotate_notifications', array());
68
add_option('adrotate_crawlers', array());
69
add_option('adrotate_db_timer', date('U'));
70
+ add_option('adrotate_debug', array('general' => false, 'publisher' => false, 'timers' => false, 'track' => false));
71
add_option('adrotate_advert_status', array('error' => 0, 'expired' => 0, 'expiressoon' => 0, 'normal' => 0, 'total' => 0));
72
add_option('adrotate_geo_required', 0);
73
add_option('adrotate_geo_requests', 0);
89
$role->add_cap("adrotate_group_delete");
90
91
// Switch additional roles off
92
+ if(is_object(get_role('adrotate_advertiser'))) {
93
+ adrotate_prepare_roles('remove');
94
+ }
95
96
// Set up some schedules
97
$firstrun = adrotate_date_start('day');
132
-------------------------------------------------------------*/
133
function adrotate_deactivate_setup() {
134
// Clear out roles
135
+ if(is_object(get_role('adrotate_advertiser'))) {
136
+ adrotate_prepare_roles('remove');
137
}
138
139
update_option('adrotate_hide_banner', adrotate_now());
202
delete_option('adrotate_geo_requests');
203
delete_option('adrotate_responsive_required');
204
delete_option('adrotate_dynamic_required');
205
+ delete_option('adrotate_roles'); // Obsolete in 3.11.8
206
delete_option('adrotate_server'); // Obsolete in 3.11.1
207
delete_option('adrotate_server_hide'); // Obsolete in 3.11.1
208
delete_option('adrotate_version');
257
if(!isset($crawlers)) $crawlers = array();
258
if(!isset($debug)) $debug = array();
259
260
+ if(!isset($config['advertiser'])) $config['advertiser'] = 'subscriber';
261
if(!isset($config['global_report'])) $config['global_report'] = 'administrator';
262
if(!isset($config['ad_manage'])) $config['ad_manage'] = 'administrator';
263
if(!isset($config['ad_delete'])) $config['ad_delete'] = 'administrator';
264
if(!isset($config['group_manage'])) $config['group_manage'] = 'administrator';
265
if(!isset($config['group_delete'])) $config['group_delete'] = 'administrator';
266
+ if(!isset($config['schedule_manage'])) $config['schedule_manage'] = 'administrator';
267
+ if(!isset($config['schedule_delete'])) $config['schedule_delete'] = 'administrator';
268
if(!isset($config['moderate'])) $config['moderate'] = 'administrator';
269
if(!isset($config['moderate_approve'])) $config['moderate_approve'] = 'administrator';
270
if(!isset($config['enable_advertisers']) OR ($config['enable_advertisers'] != 'Y' AND $config['enable_advertisers'] != 'N')) $config['enable_advertisers'] = 'N';
279
if(!isset($config['enable_geo_advertisers'])) $config['enable_geo_advertisers'] = 0;
280
if(!isset($config['banner_folder'])) $config['banner_folder'] = "wp-content/banners/";
281
if(!isset($config['adminbar']) OR ($config['adminbar'] != 'Y' AND $config['adminbar'] != 'N')) $config['adminbar'] = 'Y';
282
if(!isset($config['impression_timer']) OR $config['impression_timer'] < 10 OR $config['impression_timer'] > 3600) $config['impression_timer'] = 60;
283
if(!isset($config['click_timer']) OR $config['click_timer'] < 60 OR $config['click_timer'] > 86400) $config['click_timer'] = 86400;
284
if(!isset($config['hide_schedules']) OR ($config['hide_schedules'] != 'Y' AND $config['hide_schedules'] != 'N')) $config['hide_schedules'] = 'N';
289
if(!isset($config['jsfooter']) OR ($config['jsfooter'] != 'Y' AND $config['jsfooter'] != 'N')) $config['jsfooter'] = 'Y';
290
if(!isset($config['adblock']) OR ($config['adblock'] != 'Y' AND $config['adblock'] != 'N')) $config['adblock'] = 'N';
291
if(!isset($config['adblock_timer']) OR $config['adblock_timer'] < 0 OR $config['adblock_timer'] > 20) $config['adblock_timer'] = 5;
292
+ if(!isset($config['adblock_message'])) $config['adblock_message'] = "Ad blocker detected! Please wait %time% seconds or disable your ad blocker!";
293
if(!isset($config['adblock_loggedin']) OR ($config['adblock_loggedin'] != 'Y' AND $config['adblock_loggedin'] != 'N')) $config['adblock_loggedin'] = "N";
294
update_option('adrotate_config', $config);
295
296
if(!isset($notifications['notification_push']) OR ($notifications['notification_push'] != 'Y' AND $notifications['notification_push'] != 'N')) $notifications['notification_push'] = 'N';
297
if(!isset($notifications['notification_email']) OR ($notifications['notification_email'] != 'Y' AND $notifications['notification_email'] != 'N')) $notifications['notification_email'] = 'Y';
298
+ if(!isset($config['notification_dashboard']) OR ($config['notification_dashboard'] != 'Y' AND $config['notification_dashboard'] != 'N')) $config['notification_dashboard'] = 'Y';
299
+
300
+ if(!isset($notifications['notification_push_geo']) OR ($notifications['notification_push_geo'] != 'Y' AND $notifications['notification_push_geo'] != 'N')) $notifications['notification_push_geo'] = 'N';
301
+ if(!isset($notifications['notification_push_status']) OR ($notifications['notification_push_status'] != 'Y' AND $notifications['notification_push_status'] != 'N')) $notifications['notification_push_status'] = 'N';
302
+ if(!isset($notifications['notification_push_queue']) OR ($notifications['notification_push_queue'] != 'Y' AND $notifications['notification_push_queue'] != 'N')) $notifications['notification_push_queue'] = 'N';
303
+ if(!isset($notifications['notification_push_approved']) OR ($notifications['notification_push_approved'] != 'Y' AND $notifications['notification_push_approved'] != 'N')) $notifications['notification_push_approved'] = 'N';
304
+ if(!isset($notifications['notification_push_rejected']) OR ($notifications['notification_push_rejected'] != 'Y' AND $notifications['notification_push_rejected'] != 'N')) $notifications['notification_push_rejected'] = 'N';
305
+ if(!isset($notifications['notification_push_user'])) $notifications['notification_push_user'] = '';
306
+ if(!isset($notifications['notification_push_api'])) $notifications['notification_push_api'] = '';
307
+ if(!isset($notifications['notification_push_advertisers']) OR ($notifications['notification_push_advertisers'] != 'Y' AND $notifications['notification_push_advertisers'] != 'N')) $notifications['notification_push_advertisers'] = 'N';
308
+
309
+ if(!isset($notifications['notification_email_publisher'])) $notifications['notification_email_publisher'] = array(get_option('admin_email'));
310
+ if(!isset($notifications['notification_email_advertiser'])) $notifications['notification_email_advertiser'] = array(get_option('admin_email'));
311
update_option('adrotate_notifications', $notifications);
312
313
if(!isset($crawlers) OR count($crawlers) < 1) $crawlers = array("008", "ABACHOBot", "Accoona-AI-Agent", "AddSugarSpiderBot", "alexa", "AnyApexBot", "Arachmo", "B-l-i-t-z-B-O-T", "Baiduspider", "BecomeBot", "BeslistBot","BillyBobBot", "Bimbot", "Bingbot", "BlitzBOT", "boitho.com-dc", "boitho.com-robot", "btbot", "CatchBot", "Cerberian Drtrs","Charlotte", "ConveraCrawler", "cosmos", "Covario IDS", "DataparkSearch", "DiamondBot", "Discobot", "Dotbot", "EmeraldShield.com WebBot", "envolk[ITS]spider", "EsperanzaBot", "Exabot", "FAST Enterprise Crawler", "FAST-WebCrawler", "FDSE robot","FindLinks", "FurlBot", "FyberSpider", "g2crawler", "Gaisbot", "GalaxyBot", "genieBot", "Gigabot", "Girafabot", "Googlebot", "Googlebot-Image", "GurujiBot", "HappyFunBot", "hl_ftien_spider", "Holmes", "htdig", "iaskspider", "ia_archiver", "iCCrawler", "ichiro", "inktomi", "igdeSpyder", "IRLbot", "IssueCrawler", "Jaxified Bot", "Jyxobot", "KoepaBot", "L.webis", "LapozzBot", "Larbin", "LDSpider", "LexxeBot", "Linguee Bot", "LinkWalker", "lmspider", "lwp-trivial", "mabontland", "magpie-crawler", "Mediapartners-Google", "MJ12bot", "Mnogosearch", "mogimogi", "MojeekBot", "Moreoverbot", "Morning Paper", "msnbot", "MSRBot", "MVAClient", "mxbot", "NetResearchServer", "NetSeer Crawler", "NewsGator", "NG-Search", "nicebot", "noxtrumbot", "Nusearch Spider", "NutchCVS", "Nymesis", "obot", "oegp", "omgilibot", "OmniExplorer_Bot", "OOZBOT", "Orbiter", "PageBitesHyperBot", "Peew", "polybot", "Pompos", "PostPost", "Psbot", "PycURL", "Qseero", "Radian6", "RAMPyBot", "RufusBot", "SandCrawler", "SBIder", "ScoutJet", "Scrubby", "SearchSight", "Seekbot", "semanticdiscovery", "Sensis Web Crawler", "SEOChat::Bot", "SeznamBot", "Shim-Crawler", "ShopWiki", "Shoula robot", "silk", "Sitebot", "Snappy", "sogou spider", "Sosospider", "Speedy Spider", "Sqworm", "StackRambler", "suggybot", "SurveyBot", "SynooBot", "Teoma", "TerrawizBot", "TheSuBot", "Thumbnail.CZ robot", "TinEye", "truwoGPS", "TurnitinBot", "TweetedTimes Bot", "TwengaBot", "updated", "Urlfilebot", "Vagabondo", "VoilaBot", "Vortex", "voyager", "VYU2", "webcollage", "Websquash.com", "wf84", "WoFindeIch Robot", "WomlpeFactory", "Xaldon_WebSpider", "yacy", "Yahoo! Slurp", "Yahoo! Slurp China", "YahooSeeker", "YahooSeeker-Testing", "YandexBot", "YandexImages", "Yasaklibot", "Yeti", "YodaoBot", "yoogliFetchAgent", "YoudaoBot", "Zao", "Zealbot", "zspider", "ZyBorg", "crawler", "bot", "froogle","looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory", "Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "Googlebot", "Scooter", "appie", "WebBug", "Spade", "rabaz", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot", "Mediapartners-Google", "Sogou web spider", "WebAlta Crawler");
314
update_option('adrotate_crawlers', $crawlers);
315
316
if(!isset($debug['general'])) $debug['general'] = false;
317
+ if(!isset($debug['publisher'])) $debug['publisher'] = false;
318
if(!isset($debug['timers'])) $debug['timers'] = false;
319
if(!isset($debug['track'])) $debug['track'] = false;
320
update_option('adrotate_debug', $debug);
321
}
322
323
/*-------------------------------------------------------------
341
342
if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
343
// Demo ad 1
344
+ $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 468x60', 'bannercode' => '&lt;a href=\&quot;http:\/\/www.adrotateforwordpress.com\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/dummy-banners/adrotate-468x60.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'link' => '', 'tracker' => 'N', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
345
$ad_id = $wpdb->insert_id;
346
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'dayimpressions' => 0));
347
$schedule_id = $wpdb->insert_id;
349
unset($ad_id, $schedule_id);
350
351
// Demo ad 2
352
+ $wpdb->insert("{$wpdb->prefix}adrotate", array('title' => 'Demo ad 200x200', 'bannercode' => '&lt;a href=\&quot;http:\/\/www.adrotateforwordpress.com\&quot;&gt;&lt;img src=\&quot;http://ajdg.solutions/assets/dummy-banners/adrotate-200x200.jpg\&quot; /&gt;&lt;/a&gt;', 'thetime' => $now, 'updated' => $now, 'author' => $current_user->user_login, 'imagetype' => '', 'image' => '', 'link' => '', 'tracker' => 'N', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
353
$ad_id = $wpdb->insert_id;
354
$wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'dayimpressions' => 0));
355
$schedule_id = $wpdb->insert_id;
764
global $wp_roles;
765
766
$firstrun = date('U') + 3600;
767
$adrotate_version = get_option("adrotate_version");
768
769
if($adrotate_version['current'] < 323) {
770
delete_option('adrotate_notification_timer');
775
}
776
777
if($adrotate_version['current'] < 350) {
778
+ update_option('adrotate_debug', array('general' => false, 'stats' => false));
779
}
780
781
if($adrotate_version['current'] < 351) {
902
update_option('adrotate_config', $config379);
903
}
904
905
+ // 3.12
906
+ if($adrotate_version['current'] < 380) {
907
+ delete_option('adrotate_roles');
908
+ update_option('adrotate_debug', array('general' => false, 'publisher' => false, 'timers' => false, 'track' => false));
909
+ if(get_option('adrotate_hide_banner') == 1) update_option('adrotate_hide_banner', adrotate_now());
910
+ }
911
+
912
update_option("adrotate_version", array('current' => ADROTATE_VERSION, 'previous' => $adrotate_version['current']));
913
}
914
931
if($adrotate_db_timer < ($now - 86400)) {
932
dbDelta("OPTIMIZE TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`, ;");
933
update_option('adrotate_db_timer', $now);
934
+ adrotate_return('adrotate-settings', 403);
935
} else {
936
+ adrotate_return('adrotate-settings', 504);
937
}
938
}
939
991
// Clean up stray linkmeta
992
$wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = 0 OR `ad` = '';");
993
994
+ adrotate_return('adrotate-settings', 406);
995
}
996
997
/*-------------------------------------------------------------
adrotate-statistics.php CHANGED
@@ -236,7 +236,7 @@ function adrotate_stats_nav($type, $id, $month, $year) {
236
Since: 3.8
237
-------------------------------------------------------------*/
238
function adrotate_stats_graph($type, $id, $chartid, $start, $end) {
239
- global $wpdb, $adrotate_debug;
240
241
if($type == 'ads' OR $type == 'advertiser') {
242
$stats = $wpdb->get_results($wpdb->prepare("SELECT `thetime`, SUM(`clicks`) as `clicks`, SUM(`impressions`) as `impressions` FROM `".$wpdb->prefix."adrotate_stats` WHERE `ad` = %d AND `thetime` >= %d AND `thetime` <= %d GROUP BY `thetime` ASC;", $id, $start, $end), ARRAY_A);
@@ -271,12 +271,6 @@ function adrotate_stats_graph($type, $id, $chartid, $start, $end) {
271
$impressions = trim($impressions, ",");
272
273
$output = '';
274
- if($adrotate_debug['stats'] == true) {
275
- $output .= "<p><strong>[DEBUG] Dates</strong><pre>".$dates."</pre></p>";
276
- $output .= "<p><strong>[DEBUG] Clicks</strong><pre>".$clicks."</pre></p>";
277
- $output .= "<p><strong>[DEBUG] Impressions</strong><pre>".$impressions."</pre></p>";
278
- }
279
-
280
$output .= '<div id="chart-1" style="height:300px; width:100%;"></div>';
281
$output .= adrotate_draw_graph($chartid, $dates, $clicks, $impressions);
282
unset($stats, $dates, $clicks, $impressions);
236
Since: 3.8
237
-------------------------------------------------------------*/
238
function adrotate_stats_graph($type, $id, $chartid, $start, $end) {
239
+ global $wpdb;
240
241
if($type == 'ads' OR $type == 'advertiser') {
242
$stats = $wpdb->get_results($wpdb->prepare("SELECT `thetime`, SUM(`clicks`) as `clicks`, SUM(`impressions`) as `impressions` FROM `".$wpdb->prefix."adrotate_stats` WHERE `ad` = %d AND `thetime` >= %d AND `thetime` <= %d GROUP BY `thetime` ASC;", $id, $start, $end), ARRAY_A);
271
$impressions = trim($impressions, ",");
272
273
$output = '';
274
$output .= '<div id="chart-1" style="height:300px; width:100%;"></div>';
275
$output .= adrotate_draw_graph($chartid, $dates, $clicks, $impressions);
276
unset($stats, $dates, $clicks, $impressions);
adrotate-widget.php CHANGED
@@ -24,7 +24,7 @@ class adrotate_widgets extends WP_Widget {
24
-------------------------------------------------------------*/
25
function adrotate_widgets() {
26
27
- parent::WP_Widget(false, 'AdRotate', array('description' => "Show unlimited ads in the sidebar."));
28
29
}
30
24
-------------------------------------------------------------*/
25
function adrotate_widgets() {
26
27
+ parent::__construct(false, 'AdRotate', array('description' => "Show unlimited ads in the sidebar."));
28
29
}
30
adrotate.php CHANGED
@@ -1,11 +1,11 @@
1
<?php
2
/*
3
Plugin Name: AdRotate
4
- Plugin URI: https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-pluginpage&pk_kwd=pluginurl
5
Author: Arnan de Gans of AJdG Solutions
6
- Author URI: http://ajdg.solutions/?pk_campaign=adrotatefree-pluginpage&pk_kwd=authorurl
7
Description: Used on over a hundred thousand websites and by even more people! AdRotate is the popular choice for monetizing your website with adverts while keeping things simple.
8
- Version: 3.11.7
9
License: GPLv3
10
*/
11
@@ -20,8 +20,8 @@ License: GPLv3
20
------------------------------------------------------------------------------------ */
21
22
/*--- AdRotate values ---------------------------------------*/
23
- define("ADROTATE_DISPLAY", '3.11.7');
24
- define("ADROTATE_VERSION", 379);
25
define("ADROTATE_DB_VERSION", 51);
26
/*-----------------------------------------------------------*/
27
@@ -39,7 +39,6 @@ include_once(WP_CONTENT_DIR.'/plugins/adrotate/adrotate-widget.php');
39
load_plugin_textdomain('adrotate', false, basename(dirname(__FILE__)) . '/language');
40
$adrotate_config = get_option('adrotate_config');
41
$adrotate_crawlers = get_option('adrotate_crawlers');
42
- $adrotate_roles = get_option('adrotate_roles');
43
$adrotate_version = get_option("adrotate_version");
44
$adrotate_db_version = get_option("adrotate_db_version");
45
$adrotate_debug = get_option("adrotate_debug");
@@ -131,11 +130,11 @@ function adrotate_info() {
131
global $wpdb, $adrotate_advert_status;
132
?>
133
<div class="wrap">
134
- <h2><?php _e('AdRotate Info', 'adrotate'); ?></h2>
135
136
<br class="clear" />
137
138
- <?php include("dashboard/adrotate-info.php"); ?>
139
140
<br class="clear" />
141
</div>
@@ -152,11 +151,11 @@ function adrotate_info() {
152
function adrotate_pro() {
153
?>
154
<div class="wrap">
155
- <h2><?php _e('AdRotate Professional', 'adrotate'); ?></h2>
156
157
<br class="clear" />
158
159
- <?php include("dashboard/adrotate-pro.php"); ?>
160
161
<br class="clear" />
162
</div>
@@ -173,11 +172,11 @@ function adrotate_pro() {
173
function adrotate_manage() {
174
global $wpdb, $current_user, $userdata, $adrotate_config, $adrotate_debug;
175
176
- $message = $view = $ad_edit_id = '';
177
- if(isset($_GET['message'])) $message = esc_attr($_GET['message']);
178
if(isset($_GET['view'])) $view = esc_attr($_GET['view']);
179
if(isset($_GET['ad'])) $ad_edit_id = esc_attr($_GET['ad']);
180
- if(isset($_GET['file'])) $file = esc_attr($_GET['file']);
181
$now = adrotate_now();
182
$today = adrotate_date_start('day');
183
$in2days = $now + 172800;
@@ -195,31 +194,9 @@ function adrotate_manage() {
195
$monthend = mktime(0, 0, 0, $month+1, 0, $year);
196
?>
197
<div class="wrap">
198
- <h2><?php _e('Ad Management', 'adrotate'); ?></h2>
199
-
200
- <?php if ($message == 'new') { ?>
201
- <div id="message" class="updated"><p><?php _e('Ad created', 'adrotate'); ?></p></div>
202
- <?php } else if ($message == 'updated') { ?>
203
- <div id="message" class="updated"><p><?php _e('Ad updated', 'adrotate'); ?></p></div>
204
- <?php } else if ($message == 'deleted') { ?>
205
- <div id="message" class="updated"><p><?php _e('Ad(s) deleted', 'adrotate'); ?></p></div>
206
- <?php } else if ($message == 'reset') { ?>
207
- <div id="message" class="updated"><p><?php _e('Ad(s) statistics reset', 'adrotate'); ?></p></div>
208
- <?php } else if ($message == 'renew') { ?>
209
- <div id="message" class="updated"><p><?php _e('Ad(s) renewed', 'adrotate'); ?></p></div>
210
- <?php } else if ($message == 'deactivate') { ?>
211
- <div id="message" class="updated"><p><?php _e('Ad(s) deactivated', 'adrotate'); ?></p></div>
212
- <?php } else if ($message == 'activate') { ?>
213
- <div id="message" class="updated"><p><?php _e('Ad(s) activated', 'adrotate'); ?></p></div>
214
- <?php } else if ($message == 'field_error') { ?>
215
- <div id="message" class="updated"><p><?php _e('The ad was saved but has an issue which might prevent it from working properly. Review the yellow marked ad.', 'adrotate'); ?></p></div>
216
- <?php } else if ($message == 'exported') { ?>
217
- <div id="message" class="updated"><p><?php _e('Export created', 'adrotate'); ?> <a href="<?php echo WP_CONTENT_URL; ?>/reports/<?php echo $file; ?>">Download</a>.</p></div>
218
- <?php } else if ($message == 'no_access') { ?>
219
- <div id="message" class="updated"><p><?php _e('Action prohibited', 'adrotate'); ?></p></div>
220
- <?php } else if ($message == 'nodata') { ?>
221
- <div id="message" class="updated"><p><?php _e('No data found in selected time period', 'adrotate'); ?></p></div>
222
- <?php } ?>
223
224
<?php if($wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_groups';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_schedule';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_linkmeta';")) { ?>
225
@@ -286,14 +263,14 @@ function adrotate_manage() {
286
<?php
287
// Show list of errorous ads if any
288
if ($errorbanners) {
289
- include("dashboard/publisher/adrotate-ads-main-error.php");
290
}
291
292
- include("dashboard/publisher/adrotate-ads-main.php");
293
294
// Show disabled ads, if any
295
if ($disabledbanners) {
296
- include("dashboard/publisher/adrotate-ads-main-disabled.php");
297
}
298
?>
299
@@ -302,13 +279,13 @@ function adrotate_manage() {
302
?>
303
304
<?php
305
- include("dashboard/publisher/adrotate-ads-edit.php");
306
?>
307
308
<?php } else if($view == "report") { ?>
309
310
<?php
311
- include("dashboard/publisher/adrotate-ads-report.php");
312
?>
313
314
<?php } ?>
@@ -333,8 +310,8 @@ function adrotate_manage() {
333
function adrotate_manage_group() {
334
global $wpdb, $adrotate_config, $adrotate_debug;
335
336
- $message = $view = $group_edit_id = '';
337
- if(isset($_GET['message'])) $message = esc_attr($_GET['message']);
338
if(isset($_GET['view'])) $view = esc_attr($_GET['view']);
339
if(isset($_GET['group'])) $group_edit_id = esc_attr($_GET['group']);
340
@@ -355,19 +332,9 @@ function adrotate_manage_group() {
355
$in7days = $now + 604800;
356
?>
357
<div class="wrap">
358
- <h2><?php _e('Group Management', 'adrotate'); ?></h2>
359
-
360
- <?php if ($message == 'created') { ?>
361
- <div id="message" class="updated fade"><p><?php _e('Group created', 'adrotate'); ?></p></div>
362
- <?php } else if ($message == 'updated') { ?>
363
- <div id="message" class="updated fade"><p><?php _e('Group updated', 'adrotate'); ?></p></div>
364
- <?php } else if ($message == 'deleted') { ?>
365
- <div id="message" class="updated fade"><p><?php _e('Group deleted', 'adrotate'); ?></p></div>
366
- <?php } else if ($message == 'deleted_banners') { ?>
367
- <div id="message" class="updated fade"><p><?php _e('Group including it\'s Ads deleted', 'adrotate'); ?></p></div>
368
- <?php } else if ($message == 'nodata') { ?>
369
- <div id="message" class="updated fade"><p><?php _e('No data found in selected time period', 'adrotate'); ?></p></div>
370
- <?php } ?>
371
372
<?php if($wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_groups';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_linkmeta';")) { ?>
373
<div class="tablenav">
@@ -383,19 +350,19 @@ function adrotate_manage_group() {
383
<?php if ($view == "" OR $view == "manage") { ?>
384
385
<?php
386
- include("dashboard/publisher/adrotate-groups-main.php");
387
?>
388
389
<?php } else if($view == "addnew" OR $view == "edit") { ?>
390
391
<?php
392
- include("dashboard/publisher/adrotate-groups-edit.php");
393
?>
394
395
<?php } else if($view == "report") { ?>
396
397
<?php
398
- include("dashboard/publisher/adrotate-groups-report.php");
399
?>
400
401
<?php } ?>
@@ -418,7 +385,7 @@ function adrotate_manage_group() {
418
Return: -none-
419
-------------------------------------------------------------*/
420
function adrotate_manage_schedules() {
421
- global $wpdb, $adrotate_config, $adrotate_debug;
422
423
$now = adrotate_now();
424
$today = adrotate_date_start('day');
@@ -427,7 +394,7 @@ function adrotate_manage_schedules() {
427
$in84days = $now + 7257600;
428
?>
429
<div class="wrap">
430
- <h2><?php _e('Schedule Management available in AdRotate Pro', 'adrotate'); ?></h2>
431
432
<div class="tablenav">
433
<div class="alignleft actions">
@@ -522,9 +489,9 @@ function adrotate_manage_media() {
522
?>
523
524
<div class="wrap">
525
- <h2><?php _e('Media Management available in AdRotate Pro', 'adrotate'); ?></h2>
526
527
- <p><?php _e('Upload images to the AdRotate Pro banners folder from here. This is useful if you use responsive adverts with multiple images or have HTML5 adverts containing multiple files.', 'adrotate'); ?><br /><?php _e('Media uploading and management is available in AdRotate Pro.', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('More information', 'adrotate'); ?></a>.</p>
528
529
<h3><?php _e('Upload new file', 'adrotate'); ?></h3>
530
<label for="adrotate_image"><input tabindex="1" type="file" name="adrotate_image" disabled /><br /><em><strong><?php _e('Accepted files:', 'adrotate'); ?></strong> jpg, jpeg, gif, png, swf and flv. <?php _e('For HTML5 ads you can also upload html and javascript files.', 'adrotate'); ?> <?php _e('Maximum size is 512Kb.', 'adrotate'); ?></em><br /><em><strong><?php _e('Important:', 'adrotate'); ?></strong> <?php _e('Make sure your file has no spaces or special characters in the name. Replace spaces with a - or _.', 'adrotate'); ?><br /><?php _e('If you remove spaces from filenames for HTML5 adverts also edit the html file so it knows about the changed name. For example for the javascript file.', 'adrotate'); ?></em></label>
@@ -583,298 +550,86 @@ function adrotate_manage_media() {
583
function adrotate_options() {
584
global $wpdb, $wp_roles;
585
586
- $adrotate_config = get_option('adrotate_config');
587
- $adrotate_crawlers = get_option('adrotate_crawlers');
588
- $adrotate_roles = get_option('adrotate_roles');
589
- $adrotate_debug = get_option('adrotate_debug');
590
- $adrotate_version = get_option('adrotate_version');
591
- $adrotate_db_version = get_option('adrotate_db_version');
592
- $adrotate_advert_status = get_option("adrotate_advert_status");
593
-
594
- $crawlers = '';
595
- if(is_array($adrotate_crawlers)) {
596
- $crawlers = implode(', ', $adrotate_crawlers);
597
- }
598
-
599
- $message = $corrected = $converted = '';
600
- if(isset($_GET['message'])) $message = esc_attr($_GET['message']);
601
602
- $converted = base64_decode($converted);
603
- $adevaluate = wp_next_scheduled('adrotate_evaluate_ads');
604
- $adtracker = wp_next_scheduled('adrotate_clean_trackerdata');
605
- ?>
606
<div class="wrap">
607
- <h2><?php _e('AdRotate Settings', 'adrotate'); ?></h2>
608
-
609
- <?php if ($message == 'updated') { ?>
610
- <div id="message" class="updated fade"><p><?php _e('Settings saved', 'adrotate'); ?></p></div>
611
- <?php } else if ($message == 'db_optimized') { ?>
612
- <div id="message" class="updated fade"><p><?php _e('Database optimized', 'adrotate'); ?></p></div>
613
- <?php } else if ($message == 'db_repaired') { ?>
614
- <div id="message" class="updated fade"><p><?php _e('Database repaired', 'adrotate'); ?></p></div>
615
- <?php } else if ($message == 'db_evaluated') { ?>
616
- <div id="message" class="updated fade"><p><?php _e('Ads evaluated and statuses have been corrected where required', 'adrotate'); ?></p></div>
617
- <?php } else if ($message == 'db_cleaned') { ?>
618
- <div id="message" class="updated fade"><p><?php _e('Empty database records removed', 'adrotate'); ?></p></div>
619
- <?php } else if ($message == 'db_timer') { ?>
620
- <div id="message" class="updated fade"><p><?php _e('Database can only be optimized or cleaned once every hour', 'adrotate'); ?></p></div>
621
- <?php } ?>
622
623
<form name="settings" id="post" method="post" action="admin.php?page=adrotate-settings">
624
625
<?php wp_nonce_field('adrotate_email_test','adrotate_nonce'); ?>
626
<?php wp_nonce_field('adrotate_settings','adrotate_nonce_settings'); ?>
627
628
- <h3><?php _e('Access Rights', 'adrotate'); ?></h3>
629
- <span class="description"><?php _e('Who has access to what?', 'adrotate'); ?></span>
630
- <table class="form-table">
631
- <tr>
632
- <th valign="top"><?php _e('Manage/Add/Edit adverts', 'adrotate'); ?></th>
633
- <td>
634
- <label for="adrotate_ad_manage"><select name="adrotate_ad_manage">
635
- <?php wp_dropdown_roles($adrotate_config['ad_manage']); ?>
636
- </select> <?php _e('Role to see and add/edit ads.', 'adrotate'); ?></label>
637
- </td>
638
- </tr>
639
- <tr>
640
- <th valign="top"><?php _e('Delete/Reset adverts', 'adrotate'); ?></th>
641
- <td>
642
- <label for="adrotate_ad_delete"><select name="adrotate_ad_delete">
643
- <?php wp_dropdown_roles($adrotate_config['ad_delete']); ?>
644
- </select> <?php _e('Role to delete ads and reset stats.', 'adrotate'); ?></label>
645
- </td>
646
- </tr>
647
- <tr>
648
- <th valign="top"><?php _e('Manage/Add/Edit groups', 'adrotate'); ?></th>
649
- <td>
650
- <label for="adrotate_group_manage"><select name="adrotate_group_manage">
651
- <?php wp_dropdown_roles($adrotate_config['group_manage']); ?>
652
- </select> <?php _e('Role to see and add/edit groups.', 'adrotate'); ?></label>
653
- </td>
654
- </tr>
655
- <tr>
656
- <th valign="top"><?php _e('Delete groups', 'adrotate'); ?></th>
657
- <td>
658
- <label for="adrotate_group_delete"><select name="adrotate_group_delete">
659
- <?php wp_dropdown_roles($adrotate_config['group_delete']); ?>
660
- </select> <?php _e('Role to delete groups.', 'adrotate'); ?></label>
661
- </td>
662
- </tr>
663
-
664
- <?php if($adrotate_debug['userroles'] == true) { ?>
665
- <tr>
666
- <td colspan="2">
667
- <?php
668
- echo "<p><strong>[DEBUG] AdRotate Advertiser role enabled? (0 = no, 1 = yes)</strong><pre>";
669
- print_r($adrotate_roles);
670
- echo "</pre></p>";
671
- echo "<p><strong>[DEBUG] Current User Capabilities</strong><pre>";
672
- print_r($wp_roles);
673
- echo "</pre></p>";
674
- ?>
675
- </td>
676
- </tr>
677
- <?php } ?>
678
- </table>
679
-
680
- <p class="submit">
681
- <input type="submit" name="adrotate_options_submit" class="button-primary" value="<?php _e('Update Options', 'adrotate'); ?>" />
682
- </p>
683
-
684
<?php
685
- if($adrotate_debug['dashboard'] == true) {
686
- echo "<p><strong>[DEBUG] Globalized Config</strong><pre>";
687
- print_r($adrotate_config);
688
- echo "</pre></p>";
689
- }
690
- ?>
691
692
- <h3><?php _e('Statistics', 'adrotate'); ?></h3></td>
693
- <table class="form-table">
694
- <tr>
695
- <th valign="top"><?php _e('How to track stats', 'adrotate'); ?></th>
696
- <td>
697
- <select name="adrotate_stats">
698
- <option value="0" <?php if($adrotate_config['stats'] == 0) { echo 'selected'; } ?>><?php _e('Disabled', 'adrotate'); ?></option>
699
- <option value="1" <?php if($adrotate_config['stats'] == 1) { echo 'selected'; } ?>>AdRotate (Default)</option>
700
- <option value="0" disabled>Piwik Analytics (Advanced, Faster)</option>
701
- <option value="0" disabled>Google Analytics (Advanced)</option>
702
- </select><br />
703
- <span class="description">
704
- <strong>Disabled</strong> - <?php _e('No impressions and clicks are recorded for any of your adverts.', 'adrotate'); ?><br /><br />
705
- <strong>AdRotate</strong> - <?php _e('Tracks impressions and clicks internally.', 'adrotate'); ?><br />
706
- <strong>Supports:</strong> <em><?php _e('Click and Impression recording, Click and impression limits, impression spread for schedules, local stats display.', 'adrotate'); ?></em><br /><br />
707
- <strong>Piwik Analytics</strong> - <?php _e('Requires Piwik Analytics tracker installed in your sites footer! Uses data attributes.', 'adrotate'); ?> <?php _e('Available in AdRotate Pro!', 'adrotate'); ?><br />
708
- <strong>Supports:</strong> <em><?php _e('Click and Impression recording via Cookie, stats are displayed in Actions > Contents.', 'adrotate'); ?></em><br /><br />
709
- <strong>Google Analytics</strong> - <?php _e('Requires Google Analytics tracker installed in your sites footer! uses onClick() in adverts.', 'adrotate'); ?> <?php _e('Available in AdRotate Pro!', 'adrotate'); ?><br />
710
- <strong>Supports:</strong> <em><?php _e('Click and Impression recording via Cookie, stats are displayed in Events.', 'adrotate'); ?></em>
711
- </span>
712
- </td>
713
- </tr>
714
- <tr>
715
- <th valign="top"><?php _e('Impressions timer', 'adrotate'); ?></th>
716
- <td>
717
- <input name="adrotate_impression_timer" type="text" class="search-input" size="5" value="<?php echo $adrotate_config['impression_timer']; ?>" autocomplete="off" /> <?php _e('Seconds.', 'adrotate'); ?><br />
718
- <span class="description"><?php _e('Default: 60.', 'adrotate'); ?><br /><?php _e('This number may not be empty, be lower than 10 or exceed 3600 (1 hour).', 'adrotate'); ?></span>
719
- </td>
720
- </tr>
721
- <tr>
722
- <th valign="top"><?php _e('Clicks timer', 'adrotate'); ?></th>
723
- <td>
724
- <input name="adrotate_click_timer" type="text" class="search-input" size="5" value="<?php echo $adrotate_config['click_timer']; ?>" autocomplete="off" /> <?php _e('Seconds.', 'adrotate'); ?><br />
725
- <span class="description"><?php _e('Default: 86400.', 'adrotate'); ?><br /><?php _e('This number may not be empty, be lower than 60 or exceed 86400 (24 hours).', 'adrotate'); ?></span>
726
- </td>
727
- </tr>
728
- </table>
729
-
730
- <h3><?php _e('Bot filter', 'adrotate'); ?></h3></td>
731
- <table class="form-table">
732
- <tr>
733
- <th valign="top"><?php _e('User-Agent Filter', 'adrotate'); ?></th>
734
- <td>
735
- <textarea name="adrotate_crawlers" cols="90" rows="15"><?php echo $crawlers; ?></textarea><br />
736
- <span class="description"><?php _e('A comma separated list of keywords. Filter out bots/crawlers/user-agents. To prevent impressions and clicks counted on them.', 'adrotate'); ?><br />
737
- <?php _e('Keep in mind that this might give false positives. The word \'google\' also matches \'googlebot\', but not vice-versa. So be careful!', 'adrotate'); ?>. <?php _e('Keep your list up-to-date', 'adrotate'); ?> <a href="http://www.robotstxt.org/db.html" target="_blank">robotstxt.org/db.html</a>.<br />
738
- <?php _e('Use only words with alphanumeric characters, [ - _ ] are allowed too. All other characters are stripped out.', 'adrotate'); ?><br />
739
- <?php _e('Additionally to the list specified here, empty User-Agents are blocked as well.', 'adrotate'); ?> (<?php _e('Learn more about', 'adrotate'); ?> <a href="http://en.wikipedia.org/wiki/User_agent" title="User Agents" target="_blank"><?php _e('user-agents', 'adrotate'); ?></a>.)</span>
740
- </td>
741
- </tr>
742
- </table>
743
744
- <p class="submit">
745
- <input type="submit" name="adrotate_options_submit" class="button-primary" value="<?php _e('Update Options', 'adrotate'); ?>" />
746
- </p>
747
-
748
- <h3><?php _e('Miscellaneous', 'adrotate'); ?></h3>
749
- <table class="form-table">
750
- <tr>
751
- <th valign="top"><?php _e('Widget alignment', 'adrotate'); ?></th>
752
- <td><label for="adrotate_widgetalign"><input type="checkbox" name="adrotate_widgetalign" <?php if($adrotate_config['widgetalign'] == 'Y') { ?>checked="checked" <?php } ?> /> <?php _e('Check this box if your widgets do not align in your themes sidebar. (Does not always help!)', 'adrotate'); ?></label></td>
753
- </tr>
754
- <tr>
755
- <th valign="top"><?php _e('Widget padding', 'adrotate'); ?></th>
756
- <td><label for="adrotate_widgetpadding"><input type="checkbox" name="adrotate_widgetpadding" <?php if($adrotate_config['widgetpadding'] == 'Y') { ?>checked="checked" <?php } ?> /> <?php _e('Enable this to remove the padding (blank space) around ads in widgets. (Does not always work!)', 'adrotate'); ?></label></td>
757
- </tr>
758
- <tr>
759
- <th valign="top"><?php _e('NOTICE:', 'adrotate'); ?></th>
760
- <td><span style="color:#f00;"><?php _e('You have enabled W3 Total Caching support but not defined the security hash. You need to add the following line to your wp-config.php near the bottom or below line 52 (which defines another hash.) Using the "late init" function needs to be enabled in W3 Total Cache as well too.', 'adrotate'); ?></span><br /><pre>define('W3TC_DYNAMIC_SECURITY', '<?php echo md5(rand(0,999)); ?>');</pre></td>
761
- </tr>
762
- <tr>
763
- <th valign="top"><?php _e('W3 Total Caching', 'adrotate'); ?></th>
764
- <td><label for="adrotate_w3caching"><input type="checkbox" name="adrotate_w3caching" <?php if($adrotate_config['w3caching'] == 'Y') { ?>checked="checked" <?php } ?> /> <?php _e('Check this box if you use W3 Total Caching on your site.', 'adrotate'); ?></label></td>
765
- </tr>
766
- <tr>
767
- <th valign="top">&nbsp;</th>
768
- <td><span class="description"><?php _e('It may take a while for the ad to start rotating. The caching plugin needs to refresh the cache. This can take up to a week if not done manually.', 'adrotate'); ?> <?php _e('Caching support only works for [shortcodes] and the AdRotate Widget. If you use a PHP Snippet you need to wrap your PHP in the exclusion code yourself.', 'adrotate'); ?></span></td>
769
- </tr>
770
- </table>
771
-
772
- <h3><?php _e('Javascript', 'adrotate'); ?></h3>
773
- <table class="form-table">
774
- <tr>
775
- <th valign="top"><?php _e('Load jQuery', 'adrotate'); ?></th>
776
- <td><label for="adrotate_jquery"><input type="checkbox" name="adrotate_jquery" <?php if($adrotate_config['jquery'] == 'Y') { ?>checked="checked" <?php } ?> /> <?php _e('jQuery is required for all Javascript features below. Enable this if your theme does not load jQuery already.', 'adrotate'); ?></label></td>
777
- </tr>
778
- <tr>
779
- <th valign="top"><?php _e('Load in footer?', 'adrotate'); ?></th>
780
- <td><label for="adrotate_jsfooter"><input type="checkbox" name="adrotate_jsfooter" <?php if($adrotate_config['jsfooter'] == 'Y') { ?>checked="checked" <?php } ?> /><?php _e('Enable if you want to load the above libraries in the footer. Your theme needs to call wp_footer() for this to work.', 'adrotate'); ?></label></td>
781
- </tr>
782
- </table>
783
-
784
- <p class="submit">
785
- <input type="submit" name="adrotate_options_submit" class="button-primary" value="<?php _e('Update Options', 'adrotate'); ?>" />
786
- </p>
787
788
- <h3><?php _e('Maintenance', 'adrotate'); ?></h3>
789
- <span class="description"><?php _e('NOTE: The below 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! These functions are to be used when you feel or notice your database is slow, unresponsive and sluggish.', 'adrotate'); ?></span>
790
- <?php
791
- if($adrotate_debug['dashboard'] == true) {
792
- echo "<p><strong>[DEBUG] List of tables</strong><pre>";
793
- $tables = adrotate_list_tables();
794
- print_r($tables);
795
- echo "</pre></p>";
796
-
797
- echo "<p><strong>[DEBUG] Current ad states</strong><pre>";
798
- print_r(get_option("adrotate_advert_status"));
799
- echo "</pre></p>";
800
- }
801
?>
802
- <table class="form-table">
803
- <tr>
804
- <th valign="top"><?php _e('Optimize Database', 'adrotate'); ?></th>
805
- <td>
806
- <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 />
807
- <span class="description"><?php _e('Cleans up overhead data in the AdRotate tables.', 'adrotate'); ?><br />
808
- <?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>
809
- </td>
810
- </tr>
811
- <tr>
812
- <th valign="top"><?php _e('Clean-up Database', 'adrotate'); ?></th>
813
- <td>
814
- <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 and older statistics.', 'adrotate'); ?>\n\n<?php _e('Are you sure you want to continue?', '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 />
815
- <label for="adrotate_db_cleanup_statistics"><input type="checkbox" name="adrotate_db_cleanup_statistics" value="1" /> <?php _e('Delete stats older than 356 days (Optional).', 'adrotate'); ?></label><br />
816
- <span class="description"><?php _e('AdRotate creates empty records when you start making ads or groups. In rare occasions these records are faulty.', 'adrotate'); ?><br /><?php _e('If you made an ad or group that does not save when you make it use this button to delete those empty records.', 'adrotate'); ?><br /><?php _e('Additionally you can clean up old statistics. This will improve the speed of your site.', 'adrotate'); ?></span>
817
- </td>
818
- </tr>
819
- <tr>
820
- <th valign="top"><?php _e('Re-evaluate Ads', 'adrotate'); ?></th>
821
- <td>
822
- <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 />
823
- <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>
824
- </td>
825
- </tr>
826
- <tr>
827
- <td colspan="2"><span class="description"><?php _e('DISCLAIMER: 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, your database likely was beyond repair already. Claiming it worked before clicking these buttons is not a valid point in any case.', 'adrotate'); ?></span></td>
828
- </tr>
829
- </table>
830
-
831
- <p class="submit">
832
- <input type="submit" name="adrotate_options_submit" class="button-primary" value="<?php _e('Update Options', 'adrotate'); ?>" />
833
- </p>
834
835
- <h3><?php _e('Troubleshooting', 'adrotate'); ?></h3>
836
- <table class="form-table">
837
- <tr>
838
- <td><?php _e('Current version:', 'adrotate'); ?> <?php echo $adrotate_version['current']; ?></td>
839
- <td><?php _e('Previous version:', 'adrotate'); ?> <?php echo $adrotate_version['previous']; ?></td>
840
- </tr>
841
- <tr>
842
- <td><?php _e('Current database version:', 'adrotate'); ?> <?php echo $adrotate_db_version['current']; ?></td>
843
- <td><?php _e('Previous database version:', 'adrotate'); ?> <?php echo $adrotate_db_version['previous']; ?></td>
844
- </tr>
845
- <tr>
846
- <td><?php _e('Ad evaluation next run:', 'adrotate'); ?></td>
847
- <td><?php if(!$adevaluate) _e('Not scheduled!', 'adrotate'); else echo date_i18n(get_option('date_format')." H:i", $adevaluate); ?></td>
848
- </tr>
849
- <tr>
850
- <td><?php _e('Clean Trackerdata next run:', 'adrotate'); ?></td>
851
- <td><?php if(!$adtracker) _e('Not scheduled!', 'adrotate'); else echo date_i18n(get_option('date_format')." H:i", $adtracker); ?></td>
852
- </tr>
853
- <tr>
854
- <th valign="top"><?php _e('Current status of adverts', 'adrotate'); ?></th>
855
- <td><?php _e('Normal', 'adrotate'); ?>: <?php echo $adrotate_advert_status['normal']; ?>, <?php _e('Error', 'adrotate'); ?>: <?php echo $adrotate_advert_status['error']; ?>, <?php _e('Expired', 'adrotate'); ?>: <?php echo $adrotate_advert_status['expired']; ?>, <?php _e('Expires Soon', 'adrotate'); ?>: <?php echo $adrotate_advert_status['expiressoon']; ?>, <?php _e('Unknown Status', 'adrotate'); ?>: <?php echo $adrotate_advert_status['unknown']; ?>.</td>
856
- </tr>
857
- <tr>
858
- <td colspan="2"><span class="description"><?php _e('NOTE: 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></td>
859
- </tr>
860
-
861
- <tr>
862
- <th valign="top"><?php _e('Developer Debug', 'adrotate'); ?></th>
863
- <td>
864
- <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 (if) they are selected, has front-end output.', 'adrotate'); ?></span><br />
865
- <input type="checkbox" name="adrotate_debug_dashboard" <?php if($adrotate_debug['dashboard'] == true) { ?>checked="checked" <?php } ?> /> Dashboard - <span class="description"><?php _e('Show all settings, dashboard routines and related values.', 'adrotate'); ?></span><br />
866
- <input type="checkbox" name="adrotate_debug_userroles" <?php if($adrotate_debug['userroles'] == true) { ?>checked="checked" <?php } ?> /> User Roles - <span class="description"><?php _e('Show array of all userroles and capabilities.', 'adrotate'); ?></span><br />
867
- <input type="checkbox" name="adrotate_debug_userstats" <?php if($adrotate_debug['userstats'] == true) { ?>checked="checked" <?php } ?> /> Userstats - <span class="description"><?php _e('Review saved advertisers! Visible to advertisers.', 'adrotate'); ?></span><br />
868
- <input type="checkbox" name="adrotate_debug_stats" <?php if($adrotate_debug['stats'] == true) { ?>checked="checked" <?php } ?> /> Stats - <span class="description"><?php _e('Review global stats, per ad/group stats. Visible only to publishers.', 'adrotate'); ?></span><br />
869
- <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 and enable a alert window for clicktracking.', 'adrotate'); ?></span><br />
870
- <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 />
871
- </td>
872
- </tr>
873
- </table>
874
-
875
<p class="submit">
876
<input type="submit" name="adrotate_options_submit" class="button-primary" value="<?php _e('Update Options', 'adrotate'); ?>" />
877
</p>
878
</form>
879
</div>
880
<?php
1
<?php
2
/*
3
Plugin Name: AdRotate
4
+ Plugin URI: https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-pluginpage
5
Author: Arnan de Gans of AJdG Solutions
6
+ Author URI: http://ajdg.solutions/?pk_campaign=adrotatefree-pluginpage
7
Description: Used on over a hundred thousand websites and by even more people! AdRotate is the popular choice for monetizing your website with adverts while keeping things simple.
8
+ Version: 3.12
9
License: GPLv3
10
*/
11
20
------------------------------------------------------------------------------------ */
21
22
/*--- AdRotate values ---------------------------------------*/
23
+ define("ADROTATE_DISPLAY", '3.12');
24
+ define("ADROTATE_VERSION", 380);
25
define("ADROTATE_DB_VERSION", 51);
26
/*-----------------------------------------------------------*/
27
39
load_plugin_textdomain('adrotate', false, basename(dirname(__FILE__)) . '/language');
40
$adrotate_config = get_option('adrotate_config');
41
$adrotate_crawlers = get_option('adrotate_crawlers');
42
$adrotate_version = get_option("adrotate_version");
43
$adrotate_db_version = get_option("adrotate_db_version");
44
$adrotate_debug = get_option("adrotate_debug");
130
global $wpdb, $adrotate_advert_status;
131
?>
132
<div class="wrap">
133
+ <h1><?php _e('AdRotate Info', 'adrotate'); ?></h1>
134
135
<br class="clear" />
136
137
+ <?php include("dashboard/info.php"); ?>
138
139
<br class="clear" />
140
</div>
151
function adrotate_pro() {
152
?>
153
<div class="wrap">
154
+ <h1><?php _e('AdRotate Professional', 'adrotate'); ?></h1>
155
156
<br class="clear" />
157
158
+ <?php include("dashboard/adrotatepro.php"); ?>
159
160
<br class="clear" />
161
</div>
172
function adrotate_manage() {
173
global $wpdb, $current_user, $userdata, $adrotate_config, $adrotate_debug;
174
175
+ $status = $file = $view = $ad_edit_id = '';
176
+ if(isset($_GET['status'])) $status = esc_attr($_GET['status']);
177
+ if(isset($_GET['file'])) $file = esc_attr($_GET['file']);
178
if(isset($_GET['view'])) $view = esc_attr($_GET['view']);
179
if(isset($_GET['ad'])) $ad_edit_id = esc_attr($_GET['ad']);
180
$now = adrotate_now();
181
$today = adrotate_date_start('day');
182
$in2days = $now + 172800;
194
$monthend = mktime(0, 0, 0, $month+1, 0, $year);
195
?>
196
<div class="wrap">
197
+ <h1><?php _e('Ad Management', 'adrotate'); ?></h1>
198
+
199
+ <?php if($status > 0) adrotate_status($status, array('file' => $file)); ?>
200
201
<?php if($wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_groups';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_schedule';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_linkmeta';")) { ?>
202
263
<?php
264
// Show list of errorous ads if any
265
if ($errorbanners) {
266
+ include("dashboard/publisher/adverts-error.php");
267
}
268
269
+ include("dashboard/publisher/adverts-main.php");
270
271
// Show disabled ads, if any
272
if ($disabledbanners) {
273
+ include("dashboard/publisher/adverts-disabled.php");
274
}
275
?>
276
279
?>
280
281
<?php
282
+ include("dashboard/publisher/adverts-edit.php");
283
?>
284
285
<?php } else if($view == "report") { ?>
286
287
<?php
288
+ include("dashboard/publisher/adverts-report.php");
289
?>
290
291
<?php } ?>
310
function adrotate_manage_group() {
311
global $wpdb, $adrotate_config, $adrotate_debug;
312
313
+ $status = $view = $group_edit_id = '';
314
+ if(isset($_GET['status'])) $status = esc_attr($_GET['status']);
315
if(isset($_GET['view'])) $view = esc_attr($_GET['view']);
316
if(isset($_GET['group'])) $group_edit_id = esc_attr($_GET['group']);
317
332
$in7days = $now + 604800;
333
?>
334
<div class="wrap">
335
+ <h1><?php _e('Group Management', 'adrotate'); ?></h1>
336
+
337
+ <?php if($status > 0) adrotate_status($status); ?>
338
339
<?php if($wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_groups';") AND $wpdb->get_var("SHOW TABLES LIKE '".$wpdb->prefix."adrotate_linkmeta';")) { ?>
340
<div class="tablenav">
350
<?php if ($view == "" OR $view == "manage") { ?>
351
352
<?php
353
+ include("dashboard/publisher/groups-main.php");
354
?>
355
356
<?php } else if($view == "addnew" OR $view == "edit") { ?>
357
358
<?php
359
+ include("dashboard/publisher/groups-edit.php");
360
?>
361
362
<?php } else if($view == "report") { ?>
363
364
<?php
365
+ include("dashboard/publisher/groups-report.php");
366
?>
367
368
<?php } ?>
385
Return: -none-
386
-------------------------------------------------------------*/
387
function adrotate_manage_schedules() {
388
+ global $wpdb;
389
390
$now = adrotate_now();
391
$today = adrotate_date_start('day');
394
$in84days = $now + 7257600;
395
?>
396
<div class="wrap">
397
+ <h1><?php _e('Schedule Management available in AdRotate Pro', 'adrotate'); ?></h1>
398
399
<div class="tablenav">
400
<div class="alignleft actions">
489
?>
490
491
<div class="wrap">
492
+ <h1><?php _e('Media Management available in AdRotate Pro', 'adrotate'); ?></h1>
493
494
+ <p><?php _e('Upload images to the AdRotate Pro banners folder from here.', 'adrotate'); ?> <br /> <?php _e('This is useful if you use responsive adverts with multiple images or have HTML5 adverts containing multiple files.', 'adrotate'); ?><br /><?php _e('Media uploading and management is available in AdRotate Pro.', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('More information', 'adrotate'); ?></a>.</p>
495
496
<h3><?php _e('Upload new file', 'adrotate'); ?></h3>
497
<label for="adrotate_image"><input tabindex="1" type="file" name="adrotate_image" disabled /><br /><em><strong><?php _e('Accepted files:', 'adrotate'); ?></strong> jpg, jpeg, gif, png, swf and flv. <?php _e('For HTML5 ads you can also upload html and javascript files.', 'adrotate'); ?> <?php _e('Maximum size is 512Kb.', 'adrotate'); ?></em><br /><em><strong><?php _e('Important:', 'adrotate'); ?></strong> <?php _e('Make sure your file has no spaces or special characters in the name. Replace spaces with a - or _.', 'adrotate'); ?><br /><?php _e('If you remove spaces from filenames for HTML5 adverts also edit the html file so it knows about the changed name. For example for the javascript file.', 'adrotate'); ?></em></label>
550
function adrotate_options() {
551
global $wpdb, $wp_roles;
552
553
+ $active_tab = (isset($_GET['tab'])) ? esc_attr($_GET['tab']) : 'general';
554
+ $status = (isset($_GET['status'])) ? esc_attr($_GET['status']) : '';
555
+ $error = (isset($_GET['error'])) ? esc_attr($_GET['error']) : '';
556
+ ?>
557
558
<div class="wrap">
559
+ <h1><?php _e('AdRotate Settings', 'adrotate'); ?></h1>
560
+
561
+ <?php if($status > 0) adrotate_status($status, array('error' => $error)); ?>
562
+
563
+ <h2 class="nav-tab-wrapper">
564
+ <a href="?page=adrotate-settings&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?>">General</a>
565
+ <a href="?page=adrotate-settings&tab=notifications" class="nav-tab <?php echo $active_tab == 'notifications' ? 'nav-tab-active' : ''; ?>">Notifications</a>
566
+ <a href="?page=adrotate-settings&tab=stats" class="nav-tab <?php echo $active_tab == 'stats' ? 'nav-tab-active' : ''; ?>">Stats</a>
567
+ <a href="?page=adrotate-settings&tab=geo" class="nav-tab <?php echo $active_tab == 'geo' ? 'nav-tab-active' : ''; ?>">Geo Targeting</a>
568
+ <a href="?page=adrotate-settings&tab=advertisers" class="nav-tab <?php echo $active_tab == 'advertisers' ? 'nav-tab-active' : ''; ?>">Advertisers</a>
569
+ <a href="?page=adrotate-settings&tab=roles" class="nav-tab <?php echo $active_tab == 'roles' ? 'nav-tab-active' : ''; ?>">Roles</a>
570
+ <a href="?page=adrotate-settings&tab=misc" class="nav-tab <?php echo $active_tab == 'misc' ? 'nav-tab-active' : ''; ?>">Misc</a>
571
+ <a href="?page=adrotate-settings&tab=maintenance" class="nav-tab <?php echo $active_tab == 'maintenance' ? 'nav-tab-active' : ''; ?>">Maintenance</a>
572
+ </h2>
573
574
<form name="settings" id="post" method="post" action="admin.php?page=adrotate-settings">
575
+ <input type="hidden" name="adrotate_settings_tab" value="<?php echo $active_tab; ?>" />
576
577
<?php wp_nonce_field('adrotate_email_test','adrotate_nonce'); ?>
578
<?php wp_nonce_field('adrotate_settings','adrotate_nonce_settings'); ?>
579
580
<?php
581
+ $adrotate_config = get_option('adrotate_config');
582
583
+ if($active_tab == 'general') {
584
+ $adrotate_crawlers = get_option('adrotate_crawlers');
585
586
+ $crawlers = '';
587
+ if(is_array($adrotate_crawlers)) {
588
+ $crawlers = implode(', ', $adrotate_crawlers);
589
+ }
590
591
+ include("dashboard/settings/general.php");
592
+ } elseif($active_tab == 'notifications') {
593
+ include("dashboard/settings/notifications.php");
594
+ } elseif($active_tab == 'stats') {
595
+ include("dashboard/settings/statistics.php");
596
+ } elseif($active_tab == 'geo') {
597
+ include("dashboard/settings/geotargeting.php");
598
+ } elseif($active_tab == 'advertisers') {
599
+ include("dashboard/settings/advertisers.php");
600
+ } elseif($active_tab == 'roles') {
601
+ include("dashboard/settings/roles.php");
602
+ } elseif($active_tab == 'misc') {
603
+ include("dashboard/settings/misc.php");
604
+ } elseif($active_tab == 'maintenance') {
605
+ $adrotate_debug = get_option('adrotate_debug');
606
+ $adrotate_version = get_option('adrotate_version');
607
+ $adrotate_db_version = get_option('adrotate_db_version');
608
+ $adrotate_advert_status = get_option("adrotate_advert_status");
609
+
610
+ $adevaluate = wp_next_scheduled('adrotate_evaluate_ads');
611
+ $adschedule = wp_next_scheduled('adrotate_notification');
612
+ $adtracker = wp_next_scheduled('adrotate_clean_trackerdata');
613
+
614
+ include("dashboard/settings/maintenance.php");
615
+ } elseif($active_tab == 'license') {
616
+ $adrotate_is_networked = adrotate_is_networked();
617
+ $adrotate_hide_license = get_option('adrotate_hide_license');
618
+ if($adrotate_is_networked) {
619
+ $adrotate_activate = get_site_option('adrotate_activate');
620
+ } else {
621
+ $adrotate_activate = get_option('adrotate_activate');
622
+ }
623
+
624
+ include("dashboard/settings/license.php");
625
+ }
626
?>
627
628
+ <?php if($active_tab != 'license') { ?>
629
<p class="submit">
630
<input type="submit" name="adrotate_options_submit" class="button-primary" value="<?php _e('Update Options', 'adrotate'); ?>" />
631
</p>
632
+ <?php } ?>
633
</form>
634
</div>
635
<?php
dashboard/{adrotate-pro.php → adrotatepro.php} RENAMED
@@ -41,8 +41,8 @@
41
<h3><?php _e('AdRotate is brought to you by', 'adrotate'); ?></h3>
42
<div class="postbox-adrotate">
43
<div class="inside">
44
- <p><a href="https://ajdg.solutions/" title="AJdG Solutions"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/ajdg-logo-100x60.png" alt="ajdg-logo-100x60" width="100" height="60" align="left" style="padding: 0 10px 10px 0;" /></a>
45
- <a href="https://ajdg.solutions/" title="AJdG Solutions">AJdG Solutions</a> - <?php _e('Your one stop for Webdevelopment, consultancy and anything WordPress! If you need a custom plugin. Theme customizations or have your site moved/migrated entirely. Visit my website for details!', 'adrotate'); ?> <a href="https://ajdg.solutions/" title="AJdG Solutions"><?php _e('Find out more', 'adrotate'); ?></a>!</p>
46
47
<p><center><a href="https://twitter.com/AJdGSolutions" class="twitter-follow-button" data-show-count="false" data-size="large" data-dnt="true">Follow @AJdGSolutions</a>
48
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></center></p>
@@ -72,15 +72,28 @@
72
<h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
73
<div class="postbox-adrotate">
74
<div class="inside">
75
- <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-propage&pk_kwd=compare_license"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/adrotate-product.png" alt="adrotate-product" width="150" height="150" align="right" style="padding: 0 0 10px 10px;" /></a>
76
- <p><h4><?php _e('Single License', 'adrotate'); ?> (&euro; 29.00)</h4><?php _e('For one WordPress installation.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1124&pk_campaign=adrotatefree-propage&pk_kwd=buy_single" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
77
- <p><h4><?php _e('Duo License', 'adrotate'); ?> (&euro; 39.00)</h4><?php _e('For two WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1126&pk_campaign=adrotatefree-propage&pk_kwd=buy_duo" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
78
- <p><h4><?php _e('Multi License', 'adrotate'); ?> (&euro; 99.00)</h4><?php _e(' For up to five WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1128&pk_campaign=adrotatefree-propage&pk_kwd=buy_multi" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
79
- <p><h4><?php _e('Developer License', 'adrotate'); ?> (&euro; 299.00)</h4><?php _e('Unlimited WordPress installations and/or networks.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1130&pk_campaign=adrotatefree-propage&pk_kwd=buy_developer" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
80
- <p><h4><?php _e('Network License', 'adrotate'); ?> (&euro; 199.00)</h4><?php _e('Set up your own advertising network on a WordPress Multisite.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1132&pk_campaign=adrotatefree-propage&pk_kwd=buy_network" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
81
- <p><h4><?php _e('Compare licenses', 'adrotate'); ?></h4> <?php _e("Not sure which license is for you? Compare them...", 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-propage&pk_kwd=compare_license" target="_blank"><?php _e('All Licenses', 'adrotate'); ?> &raquo;</a></p>
82
</div>
83
</div>
84
85
</div>
86
</div>
@@ -89,6 +102,6 @@
89
90
<div class="clear"></div>
91
92
- <p><center>A grasp of the features AdRotate Pro has to offer over the free version. Check out the <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-propage&pk_kwd=upgrade_adrotatefree" target="_blank">AdRotate website</a> for more information.<br />All prices are in Euros and inclusive of tax/VAT in the European Union. The amount will be converted to Euros automagically.</center></p>
93
<p><?php echo adrotate_trademark(); ?></p>
94
</div>
41
<h3><?php _e('AdRotate is brought to you by', 'adrotate'); ?></h3>
42
<div class="postbox-adrotate">
43
<div class="inside">
44
+ <p><a href="https://ajdg.solutions/?pk_campaign=adrotatefree-propage&pk_kwd=ajdg_logo" title="AJdG Solutions"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/ajdg-logo-100x60.png" alt="ajdg-logo-100x60" width="100" height="60" align="left" style="padding: 0 10px 10px 0;" /></a>
45
+ <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-propage&pk_kwd=ajdg_link" title="AJdG Solutions">AJdG Solutions</a> - <?php _e('Premium plugins, consultancy and anything WordPress! Visit my website for details!', 'adrotate'); ?> <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-propage&pk_kwd=ajdg_link" title="AJdG Solutions"><?php _e('Find out more', 'adrotate'); ?></a>!</p>
46
47
<p><center><a href="https://twitter.com/AJdGSolutions" class="twitter-follow-button" data-show-count="false" data-size="large" data-dnt="true">Follow @AJdGSolutions</a>
48
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></center></p>
72
<h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
73
<div class="postbox-adrotate">
74
<div class="inside">
75
+ <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=compare_license"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/adrotate-product.png" alt="adrotate-product" width="150" height="150" align="right" style="padding: 0 0 10px 10px;" /></a>
76
+ <p><h4><?php _e('Single License', 'adrotate'); ?> (&euro; 29.00)</h4><?php _e('For one WordPress installation.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1124&pk_campaign=adrotatefree-infopage&pk_kwd=buy_single" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
77
+ <p><h4><?php _e('Duo License', 'adrotate'); ?> (&euro; 39.00)</h4><?php _e('For two WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1126&pk_campaign=adrotatefree-infopage&pk_kwd=buy_duo" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
78
+ <p><h4><?php _e('Multi License', 'adrotate'); ?> (&euro; 99.00)</h4><?php _e(' For up to five WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1128&pk_campaign=adrotatefree-infopage&pk_kwd=buy_multi" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
79
+ <p><h4><?php _e('Developer License', 'adrotate'); ?> (&euro; 299.00)</h4><?php _e('Unlimited WordPress installations and/or networks.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1130&pk_campaign=adrotatefree-infopage&pk_kwd=buy_developer" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
80
+ <p><h4><?php _e('Compare licenses', 'adrotate'); ?></h4> <?php _e("Not sure which license is for you? Compare them...", 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=compare_license" target="_blank"><?php _e('All Licenses', 'adrotate'); ?> &raquo;</a></p>
81
</div>
82
</div>
83
+ <!--
84
+ <h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
85
+ <div class="postbox-adrotate">
86
+ <div class="inside">
87
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/adrotate-product.png" alt="adrotate-product" width="150" height="150" align="right" style="padding: 0 0 10px 10px;" />
88
+ <p><h4><?php _e('Lifetime License', 'adrotate'); ?> (&euro; 59.00)</h4><?php _e('Single installation.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1124&pk_campaign=adrotatefree-propage&pk_kwd=buy_single" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
89
+ <p><h4><?php _e('Duo License', 'adrotate'); ?> (&euro; 29.00 p/year)</h4><?php _e('Up to 2 installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1126&pk_campaign=adrotatefree-propage&pk_kwd=buy_duo" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
90
+ <p><h4><?php _e('Multi License', 'adrotate'); ?> (&euro; 99.00 p/year)</h4><?php _e('Up to 10 installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1128&pk_campaign=adrotatefree-propage&pk_kwd=buy_multi" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
91
+ <p><h4><?php _e('Developer License', 'adrotate'); ?> (&euro; 199.00 p/year)</h4><?php _e('Up to 25 installations or multisite networks.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1130&pk_campaign=adrotatefree-propage&pk_kwd=buy_developer" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
92
+ <p><em><?php _e('Subscriptions get 1 year access to updates, email support & AdRotate Geo.', 'adrotate'); ?></em></p>
93
+ <p><h4><?php _e('Compare licenses', 'adrotate'); ?></h4> <?php _e("Not sure which license is for you?", 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-propage&pk_kwd=compare_license" target="_blank"><?php _e('Compare Licenses', 'adrotate'); ?> &raquo;</a></p>
94
+ </div>
95
+ </div>
96
+ -->
97
98
</div>
99
</div>
102
103
<div class="clear"></div>
104
105
+ <p><center>A grasp of the features AdRotate Pro has to offer over the free version. Check out the <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-propage&pk_kwd=upgrade_adrotatefree" target="_blank">AdRotate website</a> for more information.</center></p>
106
<p><?php echo adrotate_trademark(); ?></p>
107
</div>
dashboard/{adrotate-info.php → info.php} RENAMED
@@ -49,10 +49,9 @@
49
</style>
50
51
<?php
52
- $banners = $groups = $queued = 0;
53
$banners = $wpdb->get_var("SELECT COUNT(*) FROM `".$wpdb->prefix."adrotate` WHERE `type` != 'empty' AND `type` != 'a_empty';");
54
$groups = $wpdb->get_var("SELECT COUNT(*) FROM `".$wpdb->prefix."adrotate_groups` WHERE `name` != '';");
55
- $queued = $wpdb->get_var("SELECT COUNT(*) FROM `".$wpdb->prefix."adrotate` WHERE `type` = 'queue';");
56
$data = get_option("adrotate_advert_status");
57
$adrotate_config = get_option('adrotate_config');
58
?>
@@ -83,52 +82,7 @@ $adrotate_config = get_option('adrotate_config');
83
<td class="first b"><a href="admin.php?page=adrotate-groups"><?php echo $groups; ?> <?php _e('Groups', 'adrotate'); ?></a></td>
84
<td class="b"><a href="admin.php?page=adrotate-ads"><?php echo $data['error']; ?> <?php _e('Have errors', 'adrotate'); ?></a></td>
85
</tr>
86
- <tr>
87
- <td class="first b">&nbsp;</td>
88
- <td class="b"><a href="admin.php?page=adrotate-moderate"><?php echo $queued; ?> <?php _e('Queued', 'adrotate'); ?></a></td>
89
- </tr>
90
- </tbody>
91
-
92
- <?php if($adrotate_config['stats'] == 1) { ?>
93
- <thead>
94
- <tr class="first">
95
- <td colspan="2"><strong><?php _e('The last few days', 'adrotate'); ?></strong></td>
96
- </tr>
97
- </thead>
98
-
99
- <tbody>
100
- <tr class="first">
101
- <td colspan="2">
102
- <?php
103
- $adstats = $wpdb->get_results("SELECT `thetime`, SUM(`clicks`) as `clicks`, SUM(`impressions`) as `impressions` FROM `".$wpdb->prefix."adrotate_stats` GROUP BY `thetime` DESC LIMIT 5;");
104
-
105
- if($adstats) {
106
- $adstats = array_reverse($adstats);
107
- $dates = $clicks = $impressions = 0;
108
-
109
- foreach($adstats as $result) {
110
- if($result->clicks == null) $result->clicks = '0';
111
- if($result->impressions == null) $result->impressions = '0';
112
-
113
- $dates .= ',"'.date_i18n("d M", $result->thetime).'"';
114
- $clicks .= ','.$result->clicks;
115
- $impressions .= ','.$result->impressions;
116
- }
117
-
118
- $dates = trim($dates, ",");
119
- $clicks = trim($clicks, ",");
120
- $impressions = trim($impressions, ",");
121
-
122
- echo '<div id="chart-1" style="height:150px; width:100%;"></div>';
123
- adrotate_draw_graph(1, $dates, $clicks, $impressions);
124
- } else {
125
- _e('No data to show!', 'adrotate');
126
- }
127
- ?>
128
- </td>
129
- </tr>
130
</tbody>
131
- <?php } ?>
132
133
<thead>
134
<tr class="first">
@@ -153,29 +107,14 @@ $adrotate_config = get_option('adrotate_config');
153
<div class="inside">
154
<?php
155
wp_widget_rss_output(array(
156
- 'url' => array('http://meandmymac.net/feed/', 'http://www.floatingcoconut.net/feed/', 'http://ajdg.solutions/feed/',),
157
- 'title' => 'AdRotate Development News',
158
'items' => 4,
159
'show_summary' => 1,
160
'show_author' => 0,
161
'show_date' => 1)
162
);
163
?>
164
-
165
- <table width="100%">
166
- <thead>
167
- <tr class="first">
168
- <td colspan="2"><strong><?php _e('Get notified of AdRotate updates via Pushover', 'adrotate'); ?></strong></td>
169
- </tr>
170
- </thead>
171
-
172
- <tbody>
173
- <tr class="first">
174
- <td width="50%" class="first b"><p><center><a class="pushover-button" target="_blank" href="https://pushover.net/subscribe/AdRotateUpdates-R5GYqJtGHNcwsQY">Subscribe with Pushover</a></center></p></td>
175
- <td class="b"><p><?php _e('Pushover is a push notification service for iOS and Android!', 'adrotate'); ?> <a href="https://www.pushover.net/" target="_blank">Pushover website</a>.</p></td>
176
- </tr>
177
- </tbody>
178
- </table>
179
</div>
180
</div>
181
@@ -188,7 +127,7 @@ $adrotate_config = get_option('adrotate_config');
188
<h3><?php _e('Get more features with AdRotate Pro', 'adrotate'); ?></h3>
189
<div class="postbox-adrotate">
190
<div class="inside">
191
- <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=adrotate_logo" title="AdRotate plugin for WordPress"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/adrotate-logo-60x60.png" alt="adrotate-logo-60x60" width="60" height="60" align="left" style="padding: 0 10px 10px 0;" /></a><?php _e('Benefit from extra features to reinforce your income with advertising campaigns. Make the most of your website with the powerful tools AdRotate Pro offers on top of the trusted features included in the free version.', 'adrotate'); ?> <?php _e('Want to know more about', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro">AdRotate Pro</a>? <?php _e('Visit the', 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=adrotate_link" target="_blank">AdRotate <?php _e('website', 'adrotate'); ?></a>.</p>
192
</div>
193
</div>
194
@@ -200,16 +139,29 @@ $adrotate_config = get_option('adrotate_config');
200
<p><h4><?php _e('Duo License', 'adrotate'); ?> (&euro; 39.00)</h4><?php _e('For two WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1126&pk_campaign=adrotatefree-infopage&pk_kwd=buy_duo" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
201
<p><h4><?php _e('Multi License', 'adrotate'); ?> (&euro; 99.00)</h4><?php _e(' For up to five WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1128&pk_campaign=adrotatefree-infopage&pk_kwd=buy_multi" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
202
<p><h4><?php _e('Developer License', 'adrotate'); ?> (&euro; 299.00)</h4><?php _e('Unlimited WordPress installations and/or networks.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1130&pk_campaign=adrotatefree-infopage&pk_kwd=buy_developer" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
203
- <p><h4><?php _e('Network License', 'adrotate'); ?> (&euro; 199.00)</h4><?php _e('Set up your own advertising network on a WordPress Multisite.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1132&pk_campaign=adrotatefree-infopage&pk_kwd=buy_network" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
204
<p><h4><?php _e('Compare licenses', 'adrotate'); ?></h4> <?php _e("Not sure which license is for you? Compare them...", 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=compare_license" target="_blank"><?php _e('All Licenses', 'adrotate'); ?> &raquo;</a></p>
205
</div>
206
</div>
207
208
<h3><?php _e('AdRotate is brought to you by', 'adrotate'); ?></h3>
209
<div class="postbox-adrotate">
210
<div class="inside">
211
- <p><a href="https://ajdg.solutions/?pk_campaign=adrotatefree-infopage&pk_kwd=ajdg_logo" title="AJdG Solutions"><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/ajdg-logo-100x60.png" alt="ajdg-logo-100x60" width="100" height="60" align="left" style="padding: 0 10px 10px 0;" /></a>
212
- <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-infopage&pk_kwd=ajdg_link" title="AJdG Solutions">AJdG Solutions</a> - <?php _e('Your one stop for Webdevelopment, consultancy and anything WordPress! If you need a custom plugin. Theme customizations or have your site moved/migrated entirely. Visit my website for details!', 'adrotate'); ?> <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-infopage&pk_kwd=ajdg_link" title="AJdG Solutions"><?php _e('Find out more', 'adrotate'); ?></a>!</p>
213
214
<p><center><a href="https://twitter.com/AJdGSolutions" class="twitter-follow-button" data-show-count="false" data-size="large" data-dnt="true"><?php _e('Follow', 'adrotate'); ?> @AJdGSolutions</a>
215
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></center></p>
49
</style>
50
51
<?php
52
+ $banners = $groups = 0;
53
$banners = $wpdb->get_var("SELECT COUNT(*) FROM `".$wpdb->prefix."adrotate` WHERE `type` != 'empty' AND `type` != 'a_empty';");
54
$groups = $wpdb->get_var("SELECT COUNT(*) FROM `".$wpdb->prefix."adrotate_groups` WHERE `name` != '';");
55
$data = get_option("adrotate_advert_status");
56
$adrotate_config = get_option('adrotate_config');
57
?>
82
<td class="first b"><a href="admin.php?page=adrotate-groups"><?php echo $groups; ?> <?php _e('Groups', 'adrotate'); ?></a></td>
83
<td class="b"><a href="admin.php?page=adrotate-ads"><?php echo $data['error']; ?> <?php _e('Have errors', 'adrotate'); ?></a></td>
84
</tr>
85
</tbody>
86
87
<thead>
88
<tr class="first">
107
<div class="inside">
108
<?php
109
wp_widget_rss_output(array(
110
+ 'url' => array('http://meandmymac.net/feed/', 'http://www.floatingcoconut.net/feed/', 'http://ajdg.solutions/feed/'),
111
+ 'title' => 'News',
112
'items' => 4,
113
'show_summary' => 1,
114
'show_author' => 0,
115
'show_date' => 1)
116
);
117
?>
118
</div>
119
</div>
120
127
<h3><?php _e('Get more features with AdRotate Pro', 'adrotate'); ?></h3>
128
<div class="postbox-adrotate">
129
<div class="inside">
130
+ <p><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/adrotate-logo-60x60.png" alt="adrotate-logo-60x60" width="60" height="60" align="left" style="padding: 0 10px 10px 0;" /><?php _e('Benefit from extra features to reinforce your income with advertising campaigns. Make the most of your website with the powerful tools AdRotate Pro offers on top of the trusted features included in the free version.', 'adrotate'); ?> <?php _e('Want to know more about', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro">AdRotate Pro</a>? <?php _e('Visit the', 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=adrotate_link" target="_blank">AdRotate <?php _e('website', 'adrotate'); ?></a>.</p>
131
</div>
132
</div>
133
139
<p><h4><?php _e('Duo License', 'adrotate'); ?> (&euro; 39.00)</h4><?php _e('For two WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1126&pk_campaign=adrotatefree-infopage&pk_kwd=buy_duo" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
140
<p><h4><?php _e('Multi License', 'adrotate'); ?> (&euro; 99.00)</h4><?php _e(' For up to five WordPress installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1128&pk_campaign=adrotatefree-infopage&pk_kwd=buy_multi" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
141
<p><h4><?php _e('Developer License', 'adrotate'); ?> (&euro; 299.00)</h4><?php _e('Unlimited WordPress installations and/or networks.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1130&pk_campaign=adrotatefree-infopage&pk_kwd=buy_developer" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
142
<p><h4><?php _e('Compare licenses', 'adrotate'); ?></h4> <?php _e("Not sure which license is for you? Compare them...", 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=compare_license" target="_blank"><?php _e('All Licenses', 'adrotate'); ?> &raquo;</a></p>
143
</div>
144
</div>
145
+ <!--
146
+ <h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
147
+ <div class="postbox-adrotate">
148
+ <div class="inside">
149
+ <img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/adrotate-product.png" alt="adrotate-product" width="150" height="150" align="right" style="padding: 0 0 10px 10px;" />
150
+ <p><h4><?php _e('Lifetime License', 'adrotate'); ?> (&euro; 59.00)</h4><?php _e('Single installation.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1124&pk_campaign=adrotatefree-infopage&pk_kwd=buy_single" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
151
+ <p><h4><?php _e('Duo License', 'adrotate'); ?> (&euro; 29.00 p/year)</h4><?php _e('Up to 2 installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1126&pk_campaign=adrotatefree-infopage&pk_kwd=buy_duo" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
152
+ <p><h4><?php _e('Multi License', 'adrotate'); ?> (&euro; 99.00 p/year)</h4><?php _e('Up to 10 installations.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1128&pk_campaign=adrotatefree-infopage&pk_kwd=buy_multi" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
153
+ <p><h4><?php _e('Developer License', 'adrotate'); ?> (&euro; 199.00 p/year)</h4><?php _e('Up to 25 installations or multisite networks.', 'adrotate'); ?> <a href="https://ajdg.solutions/cart/?add-to-cart=1130&pk_campaign=adrotatefree-infopage&pk_kwd=buy_developer" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
154
+ <p><em><?php _e('Subscriptions get 1 year access to updates, email support & AdRotate Geo.', 'adrotate'); ?></em></p>
155
+ <p><h4><?php _e('Compare licenses', 'adrotate'); ?></h4> <?php _e("Not sure which license is for you?", 'adrotate'); ?> <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?pk_campaign=adrotatefree-infopage&pk_kwd=compare_license" target="_blank"><?php _e('Compare Licenses', 'adrotate'); ?> &raquo;</a></p>
156
+ </div>
157
+ </div>
158
+ -->
159
160
<h3><?php _e('AdRotate is brought to you by', 'adrotate'); ?></h3>
161
<div class="postbox-adrotate">
162
<div class="inside">
163
+ <p><img src="<?php echo WP_CONTENT_URL; ?>/plugins/adrotate/images/ajdg-logo-100x60.png" alt="ajdg-logo-100x60" width="100" height="60" align="left" style="padding: 0 10px 10px 0;" />
164
+ <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-infopage&pk_kwd=ajdg_link" title="AJdG Solutions">AJdG Solutions</a> - <?php _e('Premium plugins, consultancy and anything WordPress! Visit my website for details!', 'adrotate'); ?> <a href="https://ajdg.solutions/?pk_campaign=adrotatefree-infopage&pk_kwd=ajdg_link" title="AJdG Solutions"><?php _e('Find out more', 'adrotate'); ?></a>!</p>
165
166
<p><center><a href="https://twitter.com/AJdGSolutions" class="twitter-follow-button" data-show-count="false" data-size="large" data-dnt="true"><?php _e('Follow', 'adrotate'); ?> @AJdGSolutions</a>
167
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></center></p>
dashboard/publisher/{adrotate-ads-main-disabled.php → adverts-disabled.php} RENAMED
@@ -49,7 +49,7 @@
49
// Prevent gaps in display
50
$ctr = adrotate_ctr($stats['clicks'], $stats['impressions']);
51
52
- if($adrotate_debug['dashboard'] == true) {
53
echo "<tr><td>&nbsp;</td><td><strong>[DEBUG]</strong></td><td colspan='9'><pre>";
54
echo "Ad Specs: <pre>";
55
print_r($disbanner);
49
// Prevent gaps in display
50
$ctr = adrotate_ctr($stats['clicks'], $stats['impressions']);
51
52
+ if($adrotate_debug['publisher'] == true) {
53
echo "<tr><td>&nbsp;</td><td><strong>[DEBUG]</strong></td><td colspan='9'><pre>";
54
echo "Ad Specs: <pre>";
55
print_r($disbanner);
dashboard/publisher/{adrotate-ads-edit.php → adverts-edit.php} RENAMED
@@ -124,8 +124,8 @@ if($edit_banner->imagetype == "field") {
124
</td>
125
<td width="40%">
126
<p><strong><?php _e('Basic Examples:', 'adrotate'); ?></strong></p>
127
- <p><em><a href="#" onclick="textatcursor('adrotate_bannercode','&lt;a href=&quot;http://www.floatingcoconut.net&quot;&gt;&lt;img src=&quot;%image%&quot; /&gt;&lt;/a&gt;');return false;">&lt;a href="http://www.floatingcoconut.net"&gt;&lt;img src="%image%" /&gt;&lt;/a&gt;</a></em></p>
128
- <p><em><a href="#" onclick="textatcursor('adrotate_bannercode','&lt;span class=&quot;ad-%id%&quot;&gt;&lt;a href=&quot;http://www.ajdg.net&quot;&gt;Text Link Ad!&lt;/a&gt;&lt;/span&gt;');return false;">&lt;span class="ad-%id%"&gt;&lt;a href="http://www.ajdg.net"&gt;Text Link Ad!&lt;/a&gt;&lt;/span&gt;</a></em></p>
129
<p><em><a href="#" onclick="textatcursor('adrotate_bannercode','&lt;iframe src=&quot;%image%&quot; height=&quot;250&quot; frameborder=&quot;0&quot; style=&quot;border:none;&quot;&gt;&lt;/iframe&gt;');return false;">&lt;iframe src=&quot;%image%&quot; height=&quot;250&quot; frameborder=&quot;0&quot; style=&quot;border:none;&quot;&gt;&lt;/iframe&gt;</a></em></p>
130
</td>
131
</tr>
124
</td>
125
<td width="40%">
126
<p><strong><?php _e('Basic Examples:', 'adrotate'); ?></strong></p>
127
+ <p><em><a href="#" onclick="textatcursor('adrotate_bannercode','&lt;a href=&quot;http://www.adrotateforwordpress.com&quot;&gt;&lt;img src=&quot;%image%&quot; /&gt;&lt;/a&gt;');return false;">&lt;a href="http://www.adrotateforwordpress.com"&gt;&lt;img src="%image%" /&gt;&lt;/a&gt;</a></em></p>
128
+ <p><em><a href="#" onclick="textatcursor('adrotate_bannercode','&lt;span class=&quot;ad-%id%&quot;&gt;&lt;a href=&quot;http://www.adrotateforwordpress.com&quot;&gt;Text Link Ad!&lt;/a&gt;&lt;/span&gt;');return false;">&lt;span class="ad-%id%"&gt;&lt;a href="http://www.adrotateforwordpress.com"&gt;Text Link Ad!&lt;/a&gt;&lt;/span&gt;</a></em></p>
129
<p><em><a href="#" onclick="textatcursor('adrotate_bannercode','&lt;iframe src=&quot;%image%&quot; height=&quot;250&quot; frameborder=&quot;0&quot; style=&quot;border:none;&quot;&gt;&lt;/iframe&gt;');return false;">&lt;iframe src=&quot;%image%&quot; height=&quot;250&quot; frameborder=&quot;0&quot; style=&quot;border:none;&quot;&gt;&lt;/iframe&gt;</a></em></p>
130
</td>
131
</tr>
dashboard/publisher/{adrotate-ads-main-error.php → adverts-error.php} RENAMED
@@ -45,7 +45,7 @@
45
<?php foreach($errorbanners as $errbanner) {
46
$grouplist = adrotate_ad_is_in_groups($errbanner['id']);
47
48
- if($adrotate_debug['dashboard'] == true) {
49
echo "<tr><td>&nbsp;</td><td><strong>[DEBUG]</strong></td><td colspan='9'>";
50
echo "Ad Specs: <pre>";
51
print_r($errbanner);
45
<?php foreach($errorbanners as $errbanner) {
46
$grouplist = adrotate_ad_is_in_groups($errbanner['id']);
47
48
+ if($adrotate_debug['publisher'] == true) {
49
echo "<tr><td>&nbsp;</td><td><strong>[DEBUG]</strong></td><td colspan='9'>";
50
echo "Ad Specs: <pre>";
51
print_r($errbanner);
dashboard/publisher/{adrotate-ads-main.php → adverts-main.php} RENAMED
@@ -60,7 +60,7 @@
60
61
$ctr = adrotate_ctr($stats['clicks'], $stats['impressions']);
62
63
- if($adrotate_debug['dashboard'] == true) {
64
echo "<tr><td>&nbsp;</td><td><strong>[DEBUG]</strong></td><td colspan='9'><pre>";
65
echo "Ad Specs: <pre>";
66
print_r($banner);
60
61
$ctr = adrotate_ctr($stats['clicks'], $stats['impressions']);
62
63
+ if($adrotate_debug['publisher'] == true) {
64
echo "<tr><td>&nbsp;</td><td><strong>[DEBUG]</strong></td><td colspan='9'><pre>";
65
echo "Ad Specs: <pre>";
66
print_r($banner);
dashboard/publisher/{adrotate-ads-report.php → adverts-report.php} RENAMED
@@ -16,7 +16,7 @@ $stats_today = adrotate_stats($ad_edit_id, $today);
16
// Get Click Through Rate
17
$ctr = adrotate_ctr($stats['clicks'], $stats['impressions']);
18
19
- if($adrotate_debug['stats'] == true) {
20
echo "<p><strong>[DEBUG] Ad Stats (all time)</strong><pre>";
21
print_r($stats);
22
echo "</pre></p>";
16
// Get Click Through Rate
17
$ctr = adrotate_ctr($stats['clicks'], $stats['impressions']);
18
19