AdRotate Banner Manager - Version 3.16

Version Description

FREE = * [fix] Click tracking not always working if your HTML is in uppercase * [fix] Maintenance tasks not always properly set up * [change] AdRotate menu re-done and updated

Download this release

Release Info

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

Code changes from version 3.15.7 to 3.16

adrotate-manage-publisher.php CHANGED
@@ -19,7 +19,7 @@ function adrotate_insert_input() {
19
 
20
  if(wp_verify_nonce($_POST['adrotate_nonce'], 'adrotate_save_ad')) {
21
  // Mandatory
22
- $id = $schedule_id = $author = $title = $bannercode = $active = $sortorder = '';
23
  if(isset($_POST['adrotate_id'])) $id = $_POST['adrotate_id'];
24
  if(isset($_POST['adrotate_schedule'])) $schedule_id = $_POST['adrotate_schedule'];
25
  if(isset($_POST['adrotate_username'])) $author = $_POST['adrotate_username'];
@@ -27,7 +27,6 @@ function adrotate_insert_input() {
27
  if(isset($_POST['adrotate_bannercode'])) $bannercode = htmlspecialchars(trim($_POST['adrotate_bannercode'], "\t\n "), ENT_QUOTES);
28
  $thetime = adrotate_now();
29
  if(isset($_POST['adrotate_active'])) $active = strip_tags(htmlspecialchars(trim($_POST['adrotate_active'], "\t\n "), ENT_QUOTES));
30
- if(isset($_POST['adrotate_sortorder'])) $sortorder = strip_tags(htmlspecialchars(trim($_POST['adrotate_sortorder'], "\t\n "), ENT_QUOTES));
31
 
32
  // Schedules
33
  $sday = $smonth = $syear = $shour = $sminute = '';
@@ -106,9 +105,6 @@ function adrotate_insert_input() {
106
  // Enddate is too early, reset to default
107
  if($enddate <= $startdate) $enddate = $startdate + 7257600; // 84 days (12 weeks)
108
 
109
- // Validate sort order
110
- if(strlen($sortorder) < 1 OR !is_numeric($sortorder) AND ($sortorder < 1 OR $sortorder > 99999)) $sortorder = 0;
111
-
112
  // Sort out click and impressions restrictions
113
  if(strlen($maxclicks) < 1 OR !is_numeric($maxclicks)) $maxclicks = 0;
114
  if(strlen($maxshown) < 1 OR !is_numeric($maxshown)) $maxshown = 0;
@@ -140,7 +136,7 @@ function adrotate_insert_input() {
140
  $wpdb->update($wpdb->prefix.'adrotate_schedule', array('starttime' => $startdate, 'stoptime' => $enddate, 'maxclicks' => $maxclicks, 'maximpressions' => $maxshown), array('id' => $schedule_id));
141
 
142
  // Save the ad to the DB
143
- $wpdb->update($wpdb->prefix.'adrotate', array('title' => $title, 'bannercode' => $bannercode, 'updated' => $thetime, 'author' => $author, 'imagetype' => $imagetype, 'image' => $image, 'tracker' => $tracker, 'responsive' => $responsive, 'type' => $active, 'sortorder' => $sortorder), array('id' => $id));
144
 
145
  // Determine Responsive requirement
146
  $responsive_count = $wpdb->get_var("SELECT COUNT(*) as `total` FROM `{$wpdb->prefix}adrotate` WHERE `responsive` = 'Y';");
@@ -214,11 +210,10 @@ function adrotate_insert_group() {
214
  if(isset($_POST['adrotate_adheight'])) $adheight = strip_tags(trim($_POST['adrotate_adheight'], "\t\n "));
215
  if(isset($_POST['adrotate_adspeed'])) $adspeed = strip_tags(trim($_POST['adrotate_adspeed'], "\t\n "));
216
 
217
- $ads = $admargin = $align = $sortorder = '';
218
  if(isset($_POST['adselect'])) $ads = $_POST['adselect'];
219
  if(isset($_POST['adrotate_admargin'])) $admargin = strip_tags(trim($_POST['adrotate_admargin'], "\t\n "));
220
  if(isset($_POST['adrotate_align'])) $align = strip_tags(trim($_POST['adrotate_align'], "\t\n "));
221
- if(isset($_POST['adrotate_sortorder'])) $sortorder = strip_tags(htmlspecialchars(trim($_POST['adrotate_sortorder'], "\t\n "), ENT_QUOTES));
222
 
223
  $categories = $category_loc = $category_par = $pages = $page_loc = $page_par = '';
224
  if(isset($_POST['adrotate_categories'])) $categories = $_POST['adrotate_categories'];
@@ -246,9 +241,6 @@ function adrotate_insert_group() {
246
  if((is_numeric($adheight) AND $adheight < 1 OR $adheight > 9999) OR $adheight == '' OR (!is_numeric($adheight) AND $adheight != 'auto')) $adheight = '125';
247
  if($admargin < 0 OR $admargin > 99 OR $admargin == '' OR !is_numeric($admargin)) $admargin = 0;
248
 
249
- // Validate sort order
250
- if(strlen($sortorder) < 1 OR !is_numeric($sortorder) AND ($sortorder < 1 OR $sortorder > 99999)) $sortorder = $id;
251
-
252
  // Categories
253
  if(!is_array($categories)) $categories = array();
254
  $category = '';
@@ -297,7 +289,7 @@ function adrotate_insert_group() {
297
  unset($value);
298
 
299
  // Update the group itself
300
- $wpdb->update($wpdb->prefix.'adrotate_groups', array('name' => $name, 'modus' => $modus, 'fallback' => 0, 'sortorder' => $sortorder, 'cat' => $category, 'cat_loc' => $category_loc, 'cat_par' => $category_par, 'page' => $page, 'page_loc' => $page_loc, 'page_par' => $page_par, 'wrapper_before' => $wrapper_before, 'wrapper_after' => $wrapper_after, 'align' => $align, 'gridrows' => $rows, 'gridcolumns' => $columns, 'admargin' => $admargin, 'adwidth' => $adwidth, 'adheight' => $adheight, 'adspeed' => $adspeed), array('id' => $id));
301
 
302
  // Determine Dynamic Library requirement
303
  $dynamic_count = $wpdb->get_var("SELECT COUNT(*) as `total` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` != '' AND `modus` = 1;");
19
 
20
  if(wp_verify_nonce($_POST['adrotate_nonce'], 'adrotate_save_ad')) {
21
  // Mandatory
22
+ $id = $schedule_id = $author = $title = $bannercode = $active = '';
23
  if(isset($_POST['adrotate_id'])) $id = $_POST['adrotate_id'];
24
  if(isset($_POST['adrotate_schedule'])) $schedule_id = $_POST['adrotate_schedule'];
25
  if(isset($_POST['adrotate_username'])) $author = $_POST['adrotate_username'];
27
  if(isset($_POST['adrotate_bannercode'])) $bannercode = htmlspecialchars(trim($_POST['adrotate_bannercode'], "\t\n "), ENT_QUOTES);
28
  $thetime = adrotate_now();
29
  if(isset($_POST['adrotate_active'])) $active = strip_tags(htmlspecialchars(trim($_POST['adrotate_active'], "\t\n "), ENT_QUOTES));
 
30
 
31
  // Schedules
32
  $sday = $smonth = $syear = $shour = $sminute = '';
105
  // Enddate is too early, reset to default
106
  if($enddate <= $startdate) $enddate = $startdate + 7257600; // 84 days (12 weeks)
107
 
 
 
 
108
  // Sort out click and impressions restrictions
109
  if(strlen($maxclicks) < 1 OR !is_numeric($maxclicks)) $maxclicks = 0;
110
  if(strlen($maxshown) < 1 OR !is_numeric($maxshown)) $maxshown = 0;
136
  $wpdb->update($wpdb->prefix.'adrotate_schedule', array('starttime' => $startdate, 'stoptime' => $enddate, 'maxclicks' => $maxclicks, 'maximpressions' => $maxshown), array('id' => $schedule_id));
137
 
138
  // Save the ad to the DB
139
+ $wpdb->update($wpdb->prefix.'adrotate', array('title' => $title, 'bannercode' => $bannercode, 'updated' => $thetime, 'author' => $author, 'imagetype' => $imagetype, 'image' => $image, 'tracker' => $tracker, 'responsive' => $responsive, 'type' => $active), array('id' => $id));
140
 
141
  // Determine Responsive requirement
142
  $responsive_count = $wpdb->get_var("SELECT COUNT(*) as `total` FROM `{$wpdb->prefix}adrotate` WHERE `responsive` = 'Y';");
210
  if(isset($_POST['adrotate_adheight'])) $adheight = strip_tags(trim($_POST['adrotate_adheight'], "\t\n "));
211
  if(isset($_POST['adrotate_adspeed'])) $adspeed = strip_tags(trim($_POST['adrotate_adspeed'], "\t\n "));
212
 
213
+ $ads = $admargin = $align = '';
214
  if(isset($_POST['adselect'])) $ads = $_POST['adselect'];
215
  if(isset($_POST['adrotate_admargin'])) $admargin = strip_tags(trim($_POST['adrotate_admargin'], "\t\n "));
216
  if(isset($_POST['adrotate_align'])) $align = strip_tags(trim($_POST['adrotate_align'], "\t\n "));
 
217
 
218
  $categories = $category_loc = $category_par = $pages = $page_loc = $page_par = '';
219
  if(isset($_POST['adrotate_categories'])) $categories = $_POST['adrotate_categories'];
241
  if((is_numeric($adheight) AND $adheight < 1 OR $adheight > 9999) OR $adheight == '' OR (!is_numeric($adheight) AND $adheight != 'auto')) $adheight = '125';
242
  if($admargin < 0 OR $admargin > 99 OR $admargin == '' OR !is_numeric($admargin)) $admargin = 0;
243
 
 
 
 
244
  // Categories
245
  if(!is_array($categories)) $categories = array();
246
  $category = '';
289
  unset($value);
290
 
291
  // Update the group itself
292
+ $wpdb->update($wpdb->prefix.'adrotate_groups', array('name' => $name, 'modus' => $modus, 'fallback' => 0, 'cat' => $category, 'cat_loc' => $category_loc, 'cat_par' => $category_par, 'page' => $page, 'page_loc' => $page_loc, 'page_par' => $page_par, 'wrapper_before' => $wrapper_before, 'wrapper_after' => $wrapper_after, 'align' => $align, 'gridrows' => $rows, 'gridcolumns' => $columns, 'admargin' => $admargin, 'adwidth' => $adwidth, 'adheight' => $adheight, 'adspeed' => $adspeed), array('id' => $id));
293
 
294
  // Determine Dynamic Library requirement
295
  $dynamic_count = $wpdb->get_var("SELECT COUNT(*) as `total` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` != '' AND `modus` = 1;");
adrotate-output.php CHANGED
@@ -369,15 +369,15 @@ function adrotate_ad_output($id, $group = 0, $name, $bannercode, $tracker, $imag
369
  foreach($matches[0] as $value) {
370
  if(preg_match('/<a[^>]+class=\"(.+?)\"[^>]*>/i', $value, $regs)) {
371
  $result = $regs[1]." gofollow";
372
- $banner_output = str_replace('class="'.$regs[1].'"', 'class="'.$result.'"', $banner_output);
373
  } else {
374
- $banner_output = str_replace('<a ', '<a class="gofollow" ', $banner_output);
375
  }
376
  unset($value, $regs, $result);
377
  }
378
  }
379
  if($adrotate_debug['timers'] == true) {
380
- $banner_output = str_replace('<a ', '<a data-debug="1" ', $banner_output);
381
  }
382
  }
383
  }
@@ -390,13 +390,13 @@ function adrotate_ad_output($id, $group = 0, $name, $bannercode, $tracker, $imag
390
  $result = $regs[1];
391
  if($responsive == 'Y') $result .= " responsive";
392
  $result = trim($result);
393
- $banner_output = str_replace('class="'.$regs[1].'"', 'class="'.$result.'"', $banner_output);
394
  } else {
395
  $result = '';
396
  if($responsive == 'Y') $result .= " responsive";
397
  $result = trim($result);
398
  if(strlen($result) > 0) {
399
- $banner_output = str_replace('<img ', '<img class="'.$result.'" ', $banner_output);
400
  }
401
  }
402
  unset($value, $regs, $result);
369
  foreach($matches[0] as $value) {
370
  if(preg_match('/<a[^>]+class=\"(.+?)\"[^>]*>/i', $value, $regs)) {
371
  $result = $regs[1]." gofollow";
372
+ $banner_output = str_ireplace('class="'.$regs[1].'"', 'class="'.$result.'"', $banner_output);
373
  } else {
374
+ $banner_output = str_ireplace('<a ', '<a class="gofollow" ', $banner_output);
375
  }
376
  unset($value, $regs, $result);
377
  }
378
  }
379
  if($adrotate_debug['timers'] == true) {
380
+ $banner_output = str_ireplace('<a ', '<a data-debug="1" ', $banner_output);
381
  }
382
  }
383
  }
390
  $result = $regs[1];
391
  if($responsive == 'Y') $result .= " responsive";
392
  $result = trim($result);
393
+ $banner_output = str_ireplace('class="'.$regs[1].'"', 'class="'.$result.'"', $banner_output);
394
  } else {
395
  $result = '';
396
  if($responsive == 'Y') $result .= " responsive";
397
  $result = trim($result);
398
  if(strlen($result) > 0) {
399
+ $banner_output = str_ireplace('<img ', '<img class="'.$result.'" ', $banner_output);
400
  }
401
  }
402
  unset($value, $regs, $result);
adrotate-setup.php CHANGED
@@ -18,14 +18,12 @@ function adrotate_activate($network_wide) {
18
  if(is_multisite() && $network_wide) {
19
  global $wpdb;
20
 
21
- $current_blog = $wpdb->blogid;
22
- $activated = array();
23
-
24
  $blog_ids = $wpdb->get_col("SELECT `blog_id` FROM $wpdb->blogs;");
 
25
  foreach($blog_ids as $blog_id) {
26
  switch_to_blog($blog_id);
27
  adrotate_activate_setup();
28
- $activated[] = $blog_id;
29
  }
30
 
31
  switch_to_blog($current_blog);
@@ -94,7 +92,7 @@ function adrotate_activate_setup() {
94
  }
95
 
96
  if(!wp_next_scheduled('adrotate_evaluate_ads')) {// Periodically check ads
97
- wp_schedule_event($firstrun + 1800, 'twicedaily', 'adrotate_evaluate_ads');
98
  }
99
 
100
  // Attempt to make the some folders
@@ -167,6 +165,7 @@ function adrotate_uninstall_setup() {
167
  $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_stats`");
168
  $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_stats_archive`");
169
  $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_schedule`");
 
170
 
171
  // Delete Options
172
  delete_option('adrotate_activate');
@@ -212,6 +211,22 @@ function adrotate_network_propagate($pfunction, $network_wide) {
212
  call_user_func($pfunction, $network_wide);
213
  }
214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  /*-------------------------------------------------------------
216
  Name: adrotate_check_config
217
  Purpose: Update the options
@@ -343,7 +358,7 @@ function adrotate_dummy_data() {
343
 
344
  if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
345
  // Demo ad 1
346
- $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' => '', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
347
  $ad_id = $wpdb->insert_id;
348
  $wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'hourimpressions' => 0, 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
349
  $schedule_id = $wpdb->insert_id;
@@ -351,7 +366,7 @@ function adrotate_dummy_data() {
351
  unset($ad_id, $schedule_id);
352
 
353
  // Demo ad 2
354
- $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' => '', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
355
  $ad_id = $wpdb->insert_id;
356
  $wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'hourimpressions' => 0, 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
357
  $schedule_id = $wpdb->insert_id;
@@ -402,14 +417,17 @@ function adrotate_database_install() {
402
  `author` varchar(60) NOT NULL default '',
403
  `imagetype` varchar(10) NOT NULL,
404
  `image` varchar(255) NOT NULL,
405
- `tracker` varchar(2) NOT NULL default 'N',
406
- `desktop` varchar(2) NOT NULL default 'Y',
407
- `mobile` varchar(2) NOT NULL default 'Y',
408
- `tablet` varchar(2) NOT NULL default 'Y',
409
- `responsive` varchar(2) NOT NULL default 'N',
 
 
 
 
410
  `type` varchar(10) NOT NULL default '0',
411
  `weight` int(3) NOT NULL default '6',
412
- `sortorder` int(5) NOT NULL default '0',
413
  `budget` double NOT NULL default '0',
414
  `crate` double NOT NULL default '0',
415
  `irate` double NOT NULL default '0',
@@ -425,7 +443,6 @@ function adrotate_database_install() {
425
  `name` varchar(255) NOT NULL default '',
426
  `modus` tinyint(1) NOT NULL default '0',
427
  `fallback` varchar(5) NOT NULL default '0',
428
- `sortorder` int(5) NOT NULL default '0',
429
  `cat` longtext NOT NULL,
430
  `cat_loc` tinyint(1) NOT NULL default '0',
431
  `cat_par` tinyint(2) NOT NULL default '0',
@@ -527,6 +544,22 @@ function adrotate_database_install() {
527
  KEY `timer` (`timer`)
528
  ) ".$charset_collate.$engine.";");
529
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
530
  }
531
 
532
 
@@ -546,19 +579,19 @@ function adrotate_check_upgrade() {
546
  wp_die('AdRotate 3.10.8 and up requires PHP 5.3 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to plugins</a>.');
547
  return;
548
  } else {
549
- // Old version? Upgrade
550
  $adrotate_db_version = get_option("adrotate_db_version");
551
  if($adrotate_db_version['current'] < ADROTATE_DB_VERSION) {
552
  adrotate_database_upgrade();
553
- // Verify all ads
554
- adrotate_prepare_evaluate_ads(false);
555
  }
556
 
557
- // Check if there are changes to core that need upgrading
558
  $adrotate_version = get_option("adrotate_version");
559
  if($adrotate_version['current'] < ADROTATE_VERSION) {
560
  adrotate_core_upgrade();
561
  }
 
 
 
 
562
  }
563
  }
564
 
@@ -864,6 +897,50 @@ function adrotate_database_upgrade() {
864
  $wpdb->query("ALTER TABLE `{$wpdb->prefix}adrotate_schedule` CHANGE `dayimpressions` `hourimpressions` int(15) NOT NULL default '0';");
865
  }
866
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
867
  update_option("adrotate_db_version", array('current' => ADROTATE_DB_VERSION, 'previous' => $adrotate_db_version['current']));
868
  }
869
 
@@ -997,9 +1074,8 @@ function adrotate_core_upgrade() {
997
  // 3.11.2
998
  if($adrotate_version['current'] < 378) {
999
  // Reset wp-cron tasks
1000
- if(!wp_next_scheduled('adrotate_notification')) wp_schedule_event($firstrun, 'daily', 'adrotate_notification');
1001
- if(!wp_next_scheduled('adrotate_clean_trackerdata')) wp_schedule_event($firstrun + 1800, 'twicedaily', 'adrotate_clean_trackerdata');
1002
- if(!wp_next_scheduled('adrotate_evaluate_ads')) wp_schedule_event($firstrun + 3600, 'twicedaily', 'adrotate_evaluate_ads');
1003
  }
1004
 
1005
  // 3.11.4
@@ -1021,6 +1097,13 @@ function adrotate_core_upgrade() {
1021
  if(get_option('adrotate_hide_banner') == 1) update_option('adrotate_hide_banner', adrotate_now());
1022
  }
1023
 
 
 
 
 
 
 
 
1024
  update_option("adrotate_version", array('current' => ADROTATE_VERSION, 'previous' => $adrotate_version['current']));
1025
  }
1026
 
@@ -1038,8 +1121,8 @@ function adrotate_optimize_database() {
1038
  $now = adrotate_now();
1039
 
1040
  if($adrotate_db_timer < ($now - 86400)) {
1041
- dbDelta("OPTIMIZE TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_stats_archive`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`;");
1042
- dbDelta("REPAIR TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_stats_archive`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`;");
1043
  update_option('adrotate_db_timer', $now);
1044
  adrotate_return('adrotate-settings', 403, array('tab' => 'maintenance'));
1045
  } else {
@@ -1075,6 +1158,8 @@ function adrotate_cleanup_database() {
1075
  // Delete empty ads, groups and schedules
1076
  $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' OR `type` = 'a_empty';");
1077
  $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '';");
 
 
1078
 
1079
  // Clean up meta data
1080
  $ads = $wpdb->get_results("SELECT `id` FROM `{$wpdb->prefix}adrotate` ORDER BY `id`;");
18
  if(is_multisite() && $network_wide) {
19
  global $wpdb;
20
 
21
+ $current_blog = $wpdb->blogid;
 
 
22
  $blog_ids = $wpdb->get_col("SELECT `blog_id` FROM $wpdb->blogs;");
23
+
24
  foreach($blog_ids as $blog_id) {
25
  switch_to_blog($blog_id);
26
  adrotate_activate_setup();
 
27
  }
28
 
29
  switch_to_blog($current_blog);
92
  }
93
 
94
  if(!wp_next_scheduled('adrotate_evaluate_ads')) {// Periodically check ads
95
+ wp_schedule_event($firstrun + 900, 'twicedaily', 'adrotate_evaluate_ads');
96
  }
97
 
98
  // Attempt to make the some folders
165
  $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_stats`");
166
  $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_stats_archive`");
167
  $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_schedule`");
168
+ $wpdb->query("DROP TABLE IF EXISTS `{$wpdb->prefix}adrotate_transactions`");
169
 
170
  // Delete Options
171
  delete_option('adrotate_activate');
211
  call_user_func($pfunction, $network_wide);
212
  }
213
 
214
+ /*-------------------------------------------------------------
215
+ Name: adrotate_check_schedules
216
+ Purpose: Set or reset maintenance schedules for AdRotate
217
+ Since: 3.12.5
218
+ -------------------------------------------------------------*/
219
+ function adrotate_check_schedules() {
220
+ $firstrun = adrotate_now();
221
+ if(!wp_next_scheduled('adrotate_clean_trackerdata')) { // Periodically clean trackerdata
222
+ wp_schedule_event($firstrun, 'twicedaily', 'adrotate_clean_trackerdata');
223
+ }
224
+
225
+ if(!wp_next_scheduled('adrotate_evaluate_ads')) { // Periodically check ads
226
+ wp_schedule_event($firstrun + 900, 'twicedaily', 'adrotate_evaluate_ads');
227
+ }
228
+ }
229
+
230
  /*-------------------------------------------------------------
231
  Name: adrotate_check_config
232
  Purpose: Update the options
358
 
359
  if(is_null($no_ads) AND is_null($no_schedules) AND is_null($no_linkmeta)) {
360
  // Demo ad 1
361
+ $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' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
362
  $ad_id = $wpdb->insert_id;
363
  $wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'hourimpressions' => 0, 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
364
  $schedule_id = $wpdb->insert_id;
366
  unset($ad_id, $schedule_id);
367
 
368
  // Demo ad 2
369
+ $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' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'active', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
370
  $ad_id = $wpdb->insert_id;
371
  $wpdb->insert("{$wpdb->prefix}adrotate_schedule", array('name' => 'Schedule for ad '.$ad_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'hourimpressions' => 0, 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
372
  $schedule_id = $wpdb->insert_id;
417
  `author` varchar(60) NOT NULL default '',
418
  `imagetype` varchar(10) NOT NULL,
419
  `image` varchar(255) NOT NULL,
420
+ `paid` char(1) NOT NULL default 'U',
421
+ `tracker` char(1) NOT NULL default 'N',
422
+ `desktop` char(1) NOT NULL default 'Y',
423
+ `mobile` char(1) NOT NULL default 'Y',
424
+ `tablet` char(1) NOT NULL default 'Y',
425
+ `os_ios` char(1) NOT NULL default 'Y',
426
+ `os_android` char(1) NOT NULL default 'Y',
427
+ `os_other` char(1) NOT NULL default 'Y',
428
+ `responsive` char(1) NOT NULL default 'N',
429
  `type` varchar(10) NOT NULL default '0',
430
  `weight` int(3) NOT NULL default '6',
 
431
  `budget` double NOT NULL default '0',
432
  `crate` double NOT NULL default '0',
433
  `irate` double NOT NULL default '0',
443
  `name` varchar(255) NOT NULL default '',
444
  `modus` tinyint(1) NOT NULL default '0',
445
  `fallback` varchar(5) NOT NULL default '0',
 
446
  `cat` longtext NOT NULL,
447
  `cat_loc` tinyint(1) NOT NULL default '0',
448
  `cat_par` tinyint(2) NOT NULL default '0',
544
  KEY `timer` (`timer`)
545
  ) ".$charset_collate.$engine.";");
546
  }
547
+
548
+ if(!in_array("{$wpdb->prefix}adrotate_transactions", $found_tables)) {
549
+ dbDelta("CREATE TABLE `{$wpdb->prefix}adrotate_transactions` (
550
+ `id` mediumint(8) unsigned NOT NULL auto_increment,
551
+ `ad` mediumint(8) unsigned NOT NULL default '0',
552
+ `user` mediumint(8) unsigned NOT NULL default '0',
553
+ `reference` varchar(100) NOT NULL,
554
+ `note` longtext NOT NULL,
555
+ `billed` int(15) unsigned NOT NULL default '0',
556
+ `paid` int(15) unsigned NOT NULL default '0',
557
+ `amount` double NOT NULL default '0',
558
+ `budget` char(1) NOT NULL default 'U',
559
+ PRIMARY KEY (`id`),
560
+ KEY `ad` (`ad`)
561
+ ) ".$charset_collate.$engine.";");
562
+ }
563
  }
564
 
565
 
579
  wp_die('AdRotate 3.10.8 and up requires PHP 5.3 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to plugins</a>.');
580
  return;
581
  } else {
 
582
  $adrotate_db_version = get_option("adrotate_db_version");
583
  if($adrotate_db_version['current'] < ADROTATE_DB_VERSION) {
584
  adrotate_database_upgrade();
 
 
585
  }
586
 
 
587
  $adrotate_version = get_option("adrotate_version");
588
  if($adrotate_version['current'] < ADROTATE_VERSION) {
589
  adrotate_core_upgrade();
590
  }
591
+
592
+ adrotate_check_config();
593
+ adrotate_check_schedules();
594
+ adrotate_evaluate_ads();
595
  }
596
  }
597
 
897
  $wpdb->query("ALTER TABLE `{$wpdb->prefix}adrotate_schedule` CHANGE `dayimpressions` `hourimpressions` int(15) NOT NULL default '0';");
898
  }
899
 
900
+ // Database: 59
901
+ // AdRotate: 3.16
902
+ if($adrotate_db_version['current'] < 59) {
903
+ adrotate_add_column("{$wpdb->prefix}adrotate", 'paid', 'char(1) NOT NULL default \'U\' AFTER `image`');
904
+ adrotate_add_column("{$wpdb->prefix}adrotate", 'os_ios', 'char(1) NOT NULL default \'Y\' AFTER `tablet`');
905
+ adrotate_add_column("{$wpdb->prefix}adrotate", 'os_android', 'char(1) NOT NULL default \'Y\' AFTER `os_ios`');
906
+ adrotate_add_column("{$wpdb->prefix}adrotate", 'os_other', 'char(1) NOT NULL default \'Y\' AFTER `os_android`');
907
+
908
+ adrotate_del_column("{$wpdb->prefix}adrotate", 'sortorder');
909
+ adrotate_del_column("{$wpdb->prefix}adrotate_groups", 'sortorder');
910
+
911
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
912
+
913
+ $charset_collate = $engine = '';
914
+ $found_tables = $wpdb->get_col("SHOW TABLES LIKE '{$wpdb->prefix}adrotate%';");
915
+ if(!empty($wpdb->charset)) {
916
+ $charset_collate .= " DEFAULT CHARACTER SET {$wpdb->charset}";
917
+ }
918
+ if($wpdb->has_cap('collation') AND !empty($wpdb->collate)) {
919
+ $charset_collate .= " COLLATE {$wpdb->collate}";
920
+ }
921
+
922
+ $found_engine = $wpdb->get_var("SELECT ENGINE FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = '".DB_NAME."' AND `TABLE_NAME` = '{$wpdb->prefix}posts';");
923
+ if(strtolower($found_engine) == 'innodb') {
924
+ $engine = ' ENGINE=InnoDB';
925
+ }
926
+
927
+ if(!in_array("{$wpdb->prefix}adrotate_transactions", $found_tables)) {
928
+ dbDelta("CREATE TABLE `{$wpdb->prefix}adrotate_transactions` (
929
+ `id` mediumint(8) unsigned NOT NULL auto_increment,
930
+ `ad` mediumint(8) unsigned NOT NULL default '0',
931
+ `user` mediumint(8) unsigned NOT NULL default '0',
932
+ `reference` varchar(100) NOT NULL,
933
+ `note` longtext NOT NULL,
934
+ `billed` int(15) unsigned NOT NULL default '0',
935
+ `paid` int(15) unsigned NOT NULL default '0',
936
+ `amount` double NOT NULL default '0',
937
+ `budget` char(1) NOT NULL default 'U',
938
+ PRIMARY KEY (`id`),
939
+ KEY `ad` (`ad`)
940
+ ) ".$charset_collate.$engine.";");
941
+ }
942
+ }
943
+
944
  update_option("adrotate_db_version", array('current' => ADROTATE_DB_VERSION, 'previous' => $adrotate_db_version['current']));
945
  }
946
 
1074
  // 3.11.2
1075
  if($adrotate_version['current'] < 378) {
1076
  // Reset wp-cron tasks
1077
+ if(!wp_next_scheduled('adrotate_clean_trackerdata')) wp_schedule_event($firstrun, 'twicedaily', 'adrotate_clean_trackerdata');
1078
+ if(!wp_next_scheduled('adrotate_evaluate_ads')) wp_schedule_event($firstrun + 900, 'twicedaily', 'adrotate_evaluate_ads');
 
1079
  }
1080
 
1081
  // 3.11.4
1097
  if(get_option('adrotate_hide_banner') == 1) update_option('adrotate_hide_banner', adrotate_now());
1098
  }
1099
 
1100
+ // 3.16
1101
+ if($adrotate_version['current'] < 384) {
1102
+ if(!wp_next_scheduled('adrotate_clean_trackerdata')) wp_schedule_event($firstrun, 'twicedaily', 'adrotate_clean_trackerdata');
1103
+ if(!wp_next_scheduled('adrotate_evaluate_ads')) wp_schedule_event($firstrun + 900, 'twicedaily', 'adrotate_evaluate_ads');
1104
+ if(get_option('adrotate_hide_banner') == 1) update_option('adrotate_hide_banner', adrotate_now());
1105
+ }
1106
+
1107
  update_option("adrotate_version", array('current' => ADROTATE_VERSION, 'previous' => $adrotate_version['current']));
1108
  }
1109
 
1121
  $now = adrotate_now();
1122
 
1123
  if($adrotate_db_timer < ($now - 86400)) {
1124
+ dbDelta("OPTIMIZE TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_stats_archive`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_transactions`;");
1125
+ dbDelta("REPAIR TABLE `{$wpdb->prefix}adrotate`, `{$wpdb->prefix}adrotate_groups`, `{$wpdb->prefix}adrotate_linkmeta`, `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_stats_archive`, `{$wpdb->prefix}adrotate_tracker`, `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_transactions`;");
1126
  update_option('adrotate_db_timer', $now);
1127
  adrotate_return('adrotate-settings', 403, array('tab' => 'maintenance'));
1128
  } else {
1158
  // Delete empty ads, groups and schedules
1159
  $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' OR `type` = 'a_empty';");
1160
  $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '';");
1161
+ $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_schedule` WHERE `name` = '';");
1162
+ $wpdb->query("DELETE FROM `{$wpdb->prefix}adrotate_transactions` WHERE `reference` = '';");
1163
 
1164
  // Clean up meta data
1165
  $ads = $wpdb->get_results("SELECT `id` FROM `{$wpdb->prefix}adrotate` ORDER BY `id`;");
adrotate.php CHANGED
@@ -7,7 +7,7 @@ Author URI: http://ajdg.solutions/?utm_campaign=homepage&utm_medium=plugin-info&
7
  Description: The popular choice for monetizing your website with adverts while keeping things simple. Start making money today!
8
  Text Domain: adrotate
9
  Domain Path: /languages/
10
- Version: 3.15.7
11
  License: GPLv3
12
  */
13
 
@@ -22,9 +22,9 @@ License: GPLv3
22
  ------------------------------------------------------------------------------------ */
23
 
24
  /*--- AdRotate values ---------------------------------------*/
25
- define("ADROTATE_DISPLAY", '3.15.7');
26
- define("ADROTATE_VERSION", 383);
27
- define("ADROTATE_DB_VERSION", 58);
28
  /*-----------------------------------------------------------*/
29
 
30
  /*--- Load Files --------------------------------------------*/
@@ -101,10 +101,8 @@ function adrotate_dashboard() {
101
  $adrotate_page = add_menu_page('AdRotate', 'AdRotate', 'adrotate_ad_manage', 'adrotate', 'adrotate_info', plugins_url('/images/icon-menu.png', __FILE__), '25.8');
102
  $adrotate_page = add_submenu_page('adrotate', 'AdRotate · '.__('General Info', 'adrotate'), __('General Info', 'adrotate'), 'adrotate_ad_manage', 'adrotate', 'adrotate_info');
103
  $adrotate_pro = add_submenu_page('adrotate', 'AdRotate · '.__('AdRotate Pro', 'adrotate'), __('AdRotate Pro', 'adrotate'), 'adrotate_ad_manage', 'adrotate-pro', 'adrotate_pro');
104
- $adrotate_adverts = add_submenu_page('adrotate', 'AdRotate · '.__('Manage Adverts', 'adrotate'), __('Manage Adverts', 'adrotate'), 'adrotate_ad_manage', 'adrotate-ads', 'adrotate_manage');
105
- $adrotate_groups = add_submenu_page('adrotate', 'AdRotate · '.__('Manage Groups', 'adrotate'), __('Manage Groups', 'adrotate'), 'adrotate_group_manage', 'adrotate-groups', 'adrotate_manage_group');
106
- $adrotate_schedules = add_submenu_page('adrotate', 'AdRotate · '.__('Manage Schedules', 'adrotate'), __('Manage Schedules', 'adrotate'), 'adrotate_ad_manage', 'adrotate-schedules', 'adrotate_manage_schedules');
107
- $adrotate_media = add_submenu_page('adrotate', 'AdRotate · '.__('Manage Media', 'adrotate'), __('Manage Media', 'adrotate'), 'adrotate_ad_manage', 'adrotate-media', 'adrotate_manage_media');
108
  $adrotate_settings = add_submenu_page('adrotate', 'AdRotate · '.__('Settings', 'adrotate'), __('Settings', 'adrotate'), 'manage_options', 'adrotate-settings', 'adrotate_options');
109
 
110
  // Add help tabs
@@ -112,8 +110,6 @@ function adrotate_dashboard() {
112
  add_action('load-'.$adrotate_pro, 'adrotate_help_info');
113
  add_action('load-'.$adrotate_adverts, 'adrotate_help_info');
114
  add_action('load-'.$adrotate_groups, 'adrotate_help_info');
115
- add_action('load-'.$adrotate_schedules, 'adrotate_help_info');
116
- add_action('load-'.$adrotate_media, 'adrotate_help_info');
117
  add_action('load-'.$adrotate_settings, 'adrotate_help_info');
118
  }
119
 
@@ -188,7 +184,7 @@ function adrotate_manage() {
188
  <?php
189
  if($status > 0) adrotate_status($status, array('file' => $file));
190
 
191
- $allbanners = $wpdb->get_results("SELECT `id`, `title`, `type`, `tracker`, `weight` FROM `{$wpdb->prefix}adrotate` WHERE (`type` != 'empty' OR `type` != 'a_empty' OR `type` != 'queue') ORDER BY `sortorder` ASC, `id` ASC;");
192
 
193
  $activebanners = $errorbanners = $disabledbanners = false;
194
  foreach($allbanners as $singlebanner) {
@@ -343,163 +339,6 @@ function adrotate_manage_group() {
343
  <?php
344
  }
345
 
346
- /*-------------------------------------------------------------
347
- Name: adrotate_manage_schedules
348
- Purpose: Manage schedules for ads
349
- -------------------------------------------------------------*/
350
- function adrotate_manage_schedules() {
351
- global $wpdb;
352
-
353
- $now = adrotate_now();
354
- $today = adrotate_date_start('day');
355
- $in2days = $now + 172800;
356
- $in7days = $now + 604800;
357
- $in84days = $now + 7257600;
358
- ?>
359
- <div class="wrap">
360
- <h1><?php _e('Schedule Management available in AdRotate Pro', 'adrotate'); ?></h1>
361
-
362
- <div class="tablenav">
363
- <div class="alignleft actions">
364
- <strong><?php _e('Manage', 'adrotate'); ?></strong> |
365
- <strong><?php _e('Add New', 'adrotate'); ?></strong>
366
- </div>
367
- </div>
368
-
369
- <h3><?php _e('Manage Schedules', 'adrotate'); ?></h3>
370
- <p><?php _e('Schedule management and multiple schedules per advert is available in AdRotate Pro.', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('More information', 'adrotate'); ?></a>.</p>
371
-
372
- <?php wp_nonce_field('adrotate_bulk_schedules','adrotate_nonce'); ?>
373
-
374
- <div class="tablenav top">
375
- <div class="alignleft actions">
376
- <select name="adrotate_action" id="cat" class="postform" disabled>
377
- <option value=""><?php _e('Bulk Actions', 'adrotate'); ?></option>
378
- </select> <input type="submit" id="post-action-submit" name="adrotate_action_submit" value="<?php _e('Go', 'adrotate'); ?>" class="button-secondary" disabled />
379
- </div>
380
- <br class="clear" />
381
- </div>
382
-
383
- <table class="widefat" style="margin-top: .5em">
384
- <thead>
385
- <tr>
386
- <td scope="col" class="manage-column column-cb check-column"><input type="checkbox" disabled/></td>
387
- <th width="4%"><center><?php _e('ID', 'adrotate'); ?></center></th>
388
- <th width="20%"><?php _e('Start', 'adrotate'); ?> / <?php _e('End', 'adrotate'); ?></th>
389
- <th width="4%"><center><?php _e('Ads', 'adrotate'); ?></center></th>
390
- <th>&nbsp;</th>
391
- <th width="15%"><center><?php _e('Max Impressions', 'adrotate'); ?></center></th>
392
- <th width="10%"><center><?php _e('Max Clicks', 'adrotate'); ?></center></th>
393
- </tr>
394
- </thead>
395
- <tbody>
396
- <?php
397
- $schedules = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}adrotate_schedule` WHERE `name` != '' ORDER BY `id` ASC;");
398
- if($schedules) {
399
- $class = '';
400
- foreach($schedules as $schedule) {
401
- $schedulesmeta = $wpdb->get_results("SELECT `ad` FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `group` = 0 AND `user` = 0 AND `schedule` = ".$schedule->id.";");
402
- if($schedule->maxclicks == 0) $schedule->maxclicks = '&infin;';
403
- if($schedule->maximpressions == 0) $schedule->maximpressions = '&infin;';
404
-
405
- ($class != 'alternate') ? $class = 'alternate' : $class = '';
406
- if($schedule->stoptime < $in2days) $class = 'row_urgent';
407
- if($schedule->stoptime < $now) $class = 'row_inactive';
408
- ?>
409
- <tr id='adrotateindex' class='<?php echo $class; ?>'>
410
- <th class="check-column"><input type="checkbox" name="schedulecheck[]" value="" disabled /></th>
411
- <td><center><?php echo $schedule->id;?></center></td>
412
- <td><?php echo date_i18n("F d, Y H:i", $schedule->starttime);?><br /><span style="color: <?php echo adrotate_prepare_color($schedule->stoptime);?>;"><?php echo date_i18n("F d, Y H:i", $schedule->stoptime);?></span></td>
413
- <td><center><?php echo count($schedulesmeta); ?></center></td>
414
- <td><?php echo stripslashes(html_entity_decode($schedule->name)); ?></td>
415
- <td><center><?php echo $schedule->maximpressions; ?></center></td>
416
- <td><center><?php echo $schedule->maxclicks; ?></center></td>
417
- </tr>
418
- <?php } ?>
419
- <?php } else { ?>
420
- <tr id='no-schedules'>
421
- <th class="check-column">&nbsp;</th>
422
- <td colspan="7"><em><?php _e('No schedules created yet!', 'adrotate'); ?></em></td>
423
- </tr>
424
- <?php } ?>
425
- </tbody>
426
- </table>
427
- <center><?php _e('Easily manage your schedules from here with AdRotate Pro.', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('Upgrade today!', 'adrotate'); ?></a></center>
428
-
429
- <p><center>
430
- <span style="border: 1px solid #c00; height: 12px; width: 12px; background-color: #ffebe8">&nbsp;&nbsp;&nbsp;&nbsp;</span> <?php _e("Expires soon.", "adrotate"); ?>
431
- &nbsp;&nbsp;&nbsp;&nbsp;<span style="border: 1px solid #466f82; height: 12px; width: 12px; background-color: #8dcede">&nbsp;&nbsp;&nbsp;&nbsp;</span> <?php _e("Has expired.", "adrotate"); ?>
432
- </center></p>
433
-
434
- <br class="clear" />
435
-
436
- <?php adrotate_credits(); ?>
437
-
438
- <br class="clear" />
439
- </div>
440
- <?php
441
- }
442
-
443
- /*-------------------------------------------------------------
444
- Name: adrotate_manage_images
445
- Purpose: Manage banner images for ads
446
- -------------------------------------------------------------*/
447
- function adrotate_manage_media() {
448
- global $adrotate_config;
449
- ?>
450
-
451
- <div class="wrap">
452
- <h1><?php _e('Media Management available in AdRotate Pro', 'adrotate'); ?></h1>
453
-
454
- <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>
455
-
456
- <h3><?php _e('Upload new file', 'adrotate'); ?></h3>
457
- <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>
458
-
459
- <?php if(get_option('adrotate_responsive_required') > 0) { ?>
460
- <p><em><?php _e('For responsive adverts make sure the filename is in the following format; "imagename.full.ext". A full set of sized images is strongly recommended.', 'adrotate'); ?></em><br />
461
- <em><?php _e('For smaller size images use ".320", ".480", ".768" or ".1024" in the filename instead of ".full" for the various viewports.', 'adrotate'); ?></em><br />
462
- <em><strong><?php _e('Example:', 'adrotate'); ?></strong> <?php _e('image.full.jpg, image.320.jpg and image.768.jpg will serve the same advert for different viewports.', 'adrotate'); ?></em></p>
463
- <?php } ?>
464
-
465
- <p class="submit">
466
- <input tabindex="2" type="submit" name="adrotate_media_submit" class="button-primary" value="<?php _e('Upload file', 'adrotate'); ?>" disabled /> <em><?php _e('Click only once per file!', 'adrotate'); ?></em>
467
- </p>
468
-
469
- <h3><?php _e('Available files in', 'adrotate'); ?> '<?php echo $adrotate_config['banner_folder']; ?>'</h3>
470
- <table class="widefat" style="margin-top: .5em">
471
-
472
- <thead>
473
- <tr>
474
- <th><?php _e('Name', 'adrotate'); ?></th>
475
- <th width="12%"><center><?php _e('Actions', 'adrotate'); ?></center></th>
476
- </tr>
477
- </thead>
478
-
479
- <tbody>
480
- <tr><td>your-awesome-campaign.jpg</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
481
- <tr class="alternate"><td>728x90-advert.jpg</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
482
- <tr><td>adrotate-468x60.jpg</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
483
- <tr class="alternate"><td>html5-468x60-blue_edge.js</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
484
- <tr><td>html5-468x60-blue.html</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
485
- <tr class="alternate"><td>adrotate-200x200-blue.jpg</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
486
- <tr><td>advertising-campaign.jpg</td><td><center><?php _e('Delete', 'adrotate'); ?></center></td></tr>
487
- </tbody>
488
- </table>
489
- <p><center>
490
- <?php _e("Make sure the banner images are not in use by adverts when you delete them!", "adrotate"); ?><br /><?php _e('Manage your banner folder from here with AdRotate Pro.', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('Upgrade today!', 'adrotate'); ?></a>
491
-
492
- </center></p>
493
-
494
- <br class="clear" />
495
-
496
- <?php adrotate_credits(); ?>
497
-
498
- <br class="clear" />
499
- </div>
500
- <?php
501
- }
502
-
503
  /*-------------------------------------------------------------
504
  Name: adrotate_options
505
  Purpose: Admin options page
7
  Description: The popular choice for monetizing your website with adverts while keeping things simple. Start making money today!
8
  Text Domain: adrotate
9
  Domain Path: /languages/
10
+ Version: 3.16
11
  License: GPLv3
12
  */
13
 
22
  ------------------------------------------------------------------------------------ */
23
 
24
  /*--- AdRotate values ---------------------------------------*/
25
+ define("ADROTATE_DISPLAY", '3.16');
26
+ define("ADROTATE_VERSION", 384);
27
+ define("ADROTATE_DB_VERSION", 59);
28
  /*-----------------------------------------------------------*/
29
 
30
  /*--- Load Files --------------------------------------------*/
101
  $adrotate_page = add_menu_page('AdRotate', 'AdRotate', 'adrotate_ad_manage', 'adrotate', 'adrotate_info', plugins_url('/images/icon-menu.png', __FILE__), '25.8');
102
  $adrotate_page = add_submenu_page('adrotate', 'AdRotate · '.__('General Info', 'adrotate'), __('General Info', 'adrotate'), 'adrotate_ad_manage', 'adrotate', 'adrotate_info');
103
  $adrotate_pro = add_submenu_page('adrotate', 'AdRotate · '.__('AdRotate Pro', 'adrotate'), __('AdRotate Pro', 'adrotate'), 'adrotate_ad_manage', 'adrotate-pro', 'adrotate_pro');
104
+ $adrotate_adverts = add_submenu_page('adrotate', 'AdRotate · '.__('Adverts', 'adrotate'), __('Adverts', 'adrotate'), 'adrotate_ad_manage', 'adrotate-ads', 'adrotate_manage');
105
+ $adrotate_groups = add_submenu_page('adrotate', 'AdRotate · '.__('Groups', 'adrotate'), __('Groups', 'adrotate'), 'adrotate_group_manage', 'adrotate-groups', 'adrotate_manage_group');
 
 
106
  $adrotate_settings = add_submenu_page('adrotate', 'AdRotate · '.__('Settings', 'adrotate'), __('Settings', 'adrotate'), 'manage_options', 'adrotate-settings', 'adrotate_options');
107
 
108
  // Add help tabs
110
  add_action('load-'.$adrotate_pro, 'adrotate_help_info');
111
  add_action('load-'.$adrotate_adverts, 'adrotate_help_info');
112
  add_action('load-'.$adrotate_groups, 'adrotate_help_info');
 
 
113
  add_action('load-'.$adrotate_settings, 'adrotate_help_info');
114
  }
115
 
184
  <?php
185
  if($status > 0) adrotate_status($status, array('file' => $file));
186
 
187
+ $allbanners = $wpdb->get_results("SELECT `id`, `title`, `type`, `tracker`, `weight` FROM `{$wpdb->prefix}adrotate` WHERE (`type` != 'empty' OR `type` != 'a_empty' OR `type` != 'queue') ORDER BY `id` ASC;");
188
 
189
  $activebanners = $errorbanners = $disabledbanners = false;
190
  foreach($allbanners as $singlebanner) {
339
  <?php
340
  }
341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  /*-------------------------------------------------------------
343
  Name: adrotate_options
344
  Purpose: Admin options page
dashboard/adrotatepro.php CHANGED
@@ -18,35 +18,35 @@
18
  <div id="normal-sortables" class="meta-box-sortables ui-sortable">
19
 
20
  <h3><?php _e('Satisfy your advertisers', 'adrotate'); ?></h3>
21
- <div class="postbox-adrotate">
22
  <div class="inside">
23
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-satisfy.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Set up advertisers and let them log in to their statistics or even create their own adverts. Created adverts go into a moderation queue for your staff to review. Advertisers have access to their own little dashboard where they can see their adverts performance.', 'adrotate'); ?></p>
24
  </div>
25
  </div>
26
 
27
  <h3><?php _e('Mobile campaigns', 'adrotate'); ?></h3>
28
- <div class="postbox-adrotate">
29
  <div class="inside">
30
- <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-mobile.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Target mobile users with ease and show the right adverts to smartphones, tablets and computers. Mix and match as you please and offer adverts that suit the device. Create as many mobile adverts as you want without effort and with a few easy to use options they show up where you want them to!', 'adrotate'); ?></p>
31
  </div>
32
  </div>
33
 
34
  <h3><?php _e('Localize your ad campaigns with Geo Targeting', 'adrotate'); ?></h3>
35
- <div class="postbox-adrotate">
36
  <div class="inside">
37
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-geo-targeting.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Go nationwide or global with localized adverts for your various audiences. Set up adverts for countries and cities and sell impressions per general area. Connect your site to MaxMind GeoIP2: Precision or AdRotate Geo. AdRotate Geo is an exclusive Geo Lookup service for AdRotate Pro users.', 'adrotate'); ?></p>
38
  </div>
39
  </div>
40
 
41
  <h3><?php _e('Get Premium Support almost all year round', 'adrotate'); ?></h3>
42
- <div class="postbox-adrotate">
43
  <div class="inside">
44
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-support.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('When you activate your AdRotate Pro license you can use fast and personal email support. No more queueing up in the forums. AdRotate premium support takes priority over the forums and is checked much more often than the forum. Get a solution (usually) within one business day.', 'adrotate'); ?></p>
45
  </div>
46
  </div>
47
 
48
  <h3><?php _e('AdRotate is brought to you by', 'adrotate'); ?></h3>
49
- <div class="postbox-adrotate">
50
  <div class="inside">
51
  <script>(function(d, s, id) {
52
  var js, fjs = d.getElementsByTagName(s)[0];
@@ -72,28 +72,28 @@
72
  <div id="side-sortables" class="meta-box-sortables ui-sortable">
73
 
74
  <h3><?php _e('Schedule all campaigns with ease', 'adrotate'); ?></h3>
75
- <div class="postbox-adrotate">
76
  <div class="inside">
77
- <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-schedule.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Schedule your adverts and set up advertising campaigns based on dates you or your advertisers specify without hassle. Seasonal adverts, weekly adverts. You name it, AdRotate schedules it. This makes planning your revenue stream much more easy. You can set one or many schedules for adverts.', 'adrotate'); ?></p>
78
  </div>
79
  </div>
80
 
81
  <h3><?php _e('Avoid adblockers', 'adrotate'); ?></h3>
82
- <div class="postbox-adrotate">
83
  <div class="inside">
84
- <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-adblock.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Try and avoid adblockers so you adverts get the exposure you want them to have. AdRotate Pro offers some advanced tools to deceive adblockers so your adverts are less likely to be removed. Of-course make sure you create your adverts smartly so these features reach their full potential!', 'adrotate'); ?></p>
85
  </div>
86
  </div>
87
 
88
  <h3><?php _e('Stay up-to-date with notifications', 'adrotate'); ?></h3>
89
- <div class="postbox-adrotate">
90
  <div class="inside">
91
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-notifications.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Stay in touch with Email notifications. Have AdRotate send you an alert when adverts expire or need your attention. Additionally, send push notifications to your iOS or Android device. Get notified when adverts expire, have errors or when advertisers create new adverts. Never miss an expiration date again.', 'adrotate'); ?></p>
92
  </div>
93
  </div>
94
 
95
  <h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
96
- <div class="postbox-adrotate">
97
  <div class="inside">
98
  <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=compare-licenses&utm_medium=pro-page&utm_source=adrotate-free"><img src="<?php echo plugins_url('/images/adrotate-product.png', dirname(__FILE__)); ?>" alt="adrotate-product" width="150" height="150" align="right" style="padding: 0 0 10px 10px;" /></a>
99
  <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&utm_campaign=buy-single&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
@@ -105,7 +105,7 @@
105
  </div>
106
  <!--
107
  <h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
108
- <div class="postbox-adrotate">
109
  <div class="inside">
110
  <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;" />
111
  <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&utm_campaign=buy-single&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
18
  <div id="normal-sortables" class="meta-box-sortables ui-sortable">
19
 
20
  <h3><?php _e('Satisfy your advertisers', 'adrotate'); ?></h3>
21
+ <div class="postbox-ajdg">
22
  <div class="inside">
23
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-satisfy.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Set up advertisers and let them log in to their statistics or even create their own adverts. Created adverts go into a moderation queue for your staff to review. Advertisers have access to their own little dashboard where they can see their adverts performance.', 'adrotate'); ?></p>
24
  </div>
25
  </div>
26
 
27
  <h3><?php _e('Mobile campaigns', 'adrotate'); ?></h3>
28
+ <div class="postbox-ajdg">
29
  <div class="inside">
30
+ <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-mobile.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Target mobile users with ease and show the right adverts to smartphones, tablets and computers. Mix and match as you please and offer adverts that suit the device or mobile operating system. Create as many mobile adverts as you want without effort and with a few easy to use options they show up where you want them to!', 'adrotate'); ?></p>
31
  </div>
32
  </div>
33
 
34
  <h3><?php _e('Localize your ad campaigns with Geo Targeting', 'adrotate'); ?></h3>
35
+ <div class="postbox-ajdg">
36
  <div class="inside">
37
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-geo-targeting.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Go nationwide or global with localized adverts for your various audiences. Set up adverts for countries and cities and sell impressions per general area. Connect your site to MaxMind GeoIP2: Precision or AdRotate Geo. AdRotate Geo is an exclusive Geo Lookup service for AdRotate Pro users.', 'adrotate'); ?></p>
38
  </div>
39
  </div>
40
 
41
  <h3><?php _e('Get Premium Support almost all year round', 'adrotate'); ?></h3>
42
+ <div class="postbox-ajdg">
43
  <div class="inside">
44
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-support.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('When you activate your AdRotate Pro license you can use fast and personal email support. No more queueing up in the forums. AdRotate premium support takes priority over the forums and is checked much more often than the forum. Get a solution (usually) within one business day.', 'adrotate'); ?></p>
45
  </div>
46
  </div>
47
 
48
  <h3><?php _e('AdRotate is brought to you by', 'adrotate'); ?></h3>
49
+ <div class="postbox-ajdg">
50
  <div class="inside">
51
  <script>(function(d, s, id) {
52
  var js, fjs = d.getElementsByTagName(s)[0];
72
  <div id="side-sortables" class="meta-box-sortables ui-sortable">
73
 
74
  <h3><?php _e('Schedule all campaigns with ease', 'adrotate'); ?></h3>
75
+ <div class="postbox-ajdg">
76
  <div class="inside">
77
+ <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-schedule.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Schedule your adverts and set up advertising campaigns based on dates you or your advertisers specify without hassle. Seasonal adverts, weekly adverts, specific days in the week. You name it, AdRotate schedules it. This makes planning your revenue stream very flexible. You can set one or many schedules for adverts.', 'adrotate'); ?></p>
78
  </div>
79
  </div>
80
 
81
  <h3><?php _e('Avoid adblockers', 'adrotate'); ?></h3>
82
+ <div class="postbox-ajdg">
83
  <div class="inside">
84
+ <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-adblock.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Try and avoid adblockers so your adverts get the exposure you want them to have. AdRotate Pro offers some advanced tools to deceive adblockers so your adverts are less likely to be removed. Of-course make sure you create your adverts smartly so these features reach their full potential!', 'adrotate'); ?></p>
85
  </div>
86
  </div>
87
 
88
  <h3><?php _e('Stay up-to-date with notifications', 'adrotate'); ?></h3>
89
+ <div class="postbox-ajdg">
90
  <div class="inside">
91
  <p><a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><img src="<?php echo plugins_url('/images/demo-notifications.png', dirname(__FILE__)); ?>" class="alignleft pro-image" /></a><?php _e('Stay in touch with Email notifications. Have AdRotate send you an alert when adverts expire or need your attention. Additionally, send push notifications to your iOS or Android device. Get notified when adverts expire, have errors or when advertisers create new adverts. Never miss an expiration date again.', 'adrotate'); ?></p>
92
  </div>
93
  </div>
94
 
95
  <h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
96
+ <div class="postbox-ajdg">
97
  <div class="inside">
98
  <a href="https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=compare-licenses&utm_medium=pro-page&utm_source=adrotate-free"><img src="<?php echo plugins_url('/images/adrotate-product.png', dirname(__FILE__)); ?>" alt="adrotate-product" width="150" height="150" align="right" style="padding: 0 0 10px 10px;" /></a>
99
  <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&utm_campaign=buy-single&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
105
  </div>
106
  <!--
107
  <h3><?php _e('Buy AdRotate Professional', 'adrotate'); ?></h3>
108
+ <div class="postbox-ajdg">
109
  <div class="inside">
110
  <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;" />
111
  <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&utm_campaign=buy-single&utm_medium=pro-page&utm_source=adrotate-free" target="_blank"><?php _e('Buy now', 'adrotate'); ?> &raquo;</a></p>
dashboard/publisher/adverts-edit.php CHANGED
@@ -12,7 +12,7 @@
12
  if(!$ad_edit_id) {
13
  $edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;");
14
  if($edit_id == 0) {
15
- $wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'responsive' => 'N', 'type' => 'empty', 'weight' => 6, 'sortorder' => 0, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
16
  $edit_id = $wpdb->insert_id;
17
 
18
  $wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'hourimpressions' => 0, 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
@@ -24,7 +24,7 @@ if(!$ad_edit_id) {
24
  }
25
 
26
  $edit_banner = $wpdb->get_row("SELECT * FROM `{$wpdb->prefix}adrotate` WHERE `id` = {$ad_edit_id};");
27
- $groups = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` != '' ORDER BY `sortorder` ASC, `id` ASC;");
28
  $schedules = $wpdb->get_row("SELECT `{$wpdb->prefix}adrotate_schedule`.`id`, `starttime`, `stoptime`, `maxclicks`, `maximpressions` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = {$edit_banner->id} AND `group` = 0 AND `user` = 0 AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `{$wpdb->prefix}adrotate_schedule`.`id` ASC LIMIT 1;");
29
  $linkmeta = $wpdb->get_results("SELECT `group` FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = {$edit_banner->id} AND `user` = 0 AND `schedule` = 0;");
30
 
@@ -330,19 +330,25 @@ if($edit_banner->imagetype == "field") {
330
  <td>
331
  <label for="adrotate_tablet"><center><input disabled type="checkbox" name="adrotate_tablet" checked="1" /><br /><?php _e('Tablets', 'adrotate'); ?></center></label>
332
  </td>
333
- <td colspan="2">
334
- <em><?php _e('Also enable mobile support in the group this advert goes in or these are ignored.', 'adrotate'); ?></em>
 
 
 
 
 
 
 
 
 
 
 
 
335
  </td>
336
  </tr>
337
- <tr>
338
- <th><?php _e('Sortorder', 'adrotate'); ?></th>
339
- <td colspan="5">
340
- <label for="adrotate_sortorder"><input tabindex="23" name="adrotate_sortorder" type="text" size="5" class="search-input" autocomplete="off" value="<?php echo $edit_banner->sortorder;?>" /> <em><?php _e('For administrative purposes set a sortorder.', 'adrotate'); ?> <?php _e('Leave empty or 0 to skip this. Will default to ad id.', 'adrotate'); ?></em></label>
341
- </td>
342
- </tr>
343
  </tbody>
344
  </table>
345
- <center><?php _e('With AdRotate Pro you can easily select which devices the advert should show on!', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('Upgrade today', 'adrotate'); ?></a>!</center>
346
 
347
  <h3><?php _e('Geo Targeting in AdRotate Pro', 'adrotate'); ?></h3>
348
  <p><em><?php _e('Assign the advert to a group and enable that group to use Geo Targeting.', 'adrotate'); ?></em></p>
12
  if(!$ad_edit_id) {
13
  $edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;");
14
  if($edit_id == 0) {
15
+ $wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'empty', 'weight' => 6, 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array())));
16
  $edit_id = $wpdb->insert_id;
17
 
18
  $wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'hourimpressions' => 0, 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y'));
24
  }
25
 
26
  $edit_banner = $wpdb->get_row("SELECT * FROM `{$wpdb->prefix}adrotate` WHERE `id` = {$ad_edit_id};");
27
+ $groups = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` != '' ORDER BY `id` ASC;");
28
  $schedules = $wpdb->get_row("SELECT `{$wpdb->prefix}adrotate_schedule`.`id`, `starttime`, `stoptime`, `maxclicks`, `maximpressions` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = {$edit_banner->id} AND `group` = 0 AND `user` = 0 AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `{$wpdb->prefix}adrotate_schedule`.`id` ASC LIMIT 1;");
29
  $linkmeta = $wpdb->get_results("SELECT `group` FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = {$edit_banner->id} AND `user` = 0 AND `schedule` = 0;");
30
 
330
  <td>
331
  <label for="adrotate_tablet"><center><input disabled type="checkbox" name="adrotate_tablet" checked="1" /><br /><?php _e('Tablets', 'adrotate'); ?></center></label>
332
  </td>
333
+ <td colspan="2" rowspan="2">
334
+ <em><?php _e('Also enable mobile support in the group this advert goes in or these are ignored.', 'adrotate-pro'); ?><br /><?php _e('Operating system detection only detects iOS/Android/Others or neither. Only works if Smartphones and/or Tablets is enabled.', 'adrotate-pro'); ?></em>
335
+ </td>
336
+ </tr>
337
+ <tr>
338
+ <th width="15%" valign="top"><?php _e('Mobile OS', 'adrotate-pro'); ?></th>
339
+ <td>
340
+ <label for="adrotate_ios"><center><input disabled type="checkbox" name="adrotate_ios" checked="1" /><br /><?php _e('iOS', 'adrotate-pro'); ?></center></label>
341
+ </td>
342
+ <td>
343
+ <label for="adrotate_android"><center><input disabled type="checkbox" name="adrotate_android" checked="1" /><br /><?php _e('Android', 'adrotate-pro'); ?></center></label>
344
+ </td>
345
+ <td>
346
+ <label for="adrotate_other"><center><input disabled type="checkbox" name="adrotate_other" checked="1" /><br /><?php _e('Others', 'adrotate-pro'); ?></center></label>
347
  </td>
348
  </tr>
 
 
 
 
 
 
349
  </tbody>
350
  </table>
351
+ <center><?php _e('With AdRotate Pro you can easily select which devices and mobile operating systems the advert should show on!', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('Upgrade today', 'adrotate'); ?></a>!</center>
352
 
353
  <h3><?php _e('Geo Targeting in AdRotate Pro', 'adrotate'); ?></h3>
354
  <p><em><?php _e('Assign the advert to a group and enable that group to use Geo Targeting.', 'adrotate'); ?></em></p>
dashboard/publisher/groups-edit.php CHANGED
@@ -13,7 +13,7 @@
13
  $action = "group_new";
14
  $edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '' ORDER BY `id` DESC LIMIT 1;");
15
  if($edit_id == 0) {
16
- $wpdb->insert($wpdb->prefix.'adrotate_groups', array('name' => '', 'modus' => 0, 'fallback' => '0', 'sortorder' => 0, 'cat' => '', 'cat_loc' => 0, 'cat_par' => 0, 'page' => '', 'page_loc' => 0, 'page_par' => 0, 'mobile' => 0, 'geo' => 0, 'wrapper_before' => '', 'wrapper_after' => '', 'gridrows' => 2, 'gridcolumns' => 2, 'admargin' => 0, 'admargin_bottom' => 0, 'admargin_left' => 0, 'admargin_right' => 0, 'adwidth' => '125', 'adheight' => '125', 'adspeed' => 6000));
17
  $edit_id = $wpdb->insert_id;
18
  }
19
  $group_edit_id = $edit_id;
@@ -186,11 +186,6 @@ if(!is_array($meta_array)) $meta_array = array();
186
  <td width="35%"><label for="adrotate_mobile"><input type="checkbox" name="adrotate_mobile" value="1" disabled /> <?php _e('Enable mobile support for this group.', 'adrotate'); ?></label></td>
187
  <td><p><em><?php _e('Do not forget to put at least one mobile advert in this group.', 'adrotate'); ?></em></p></td>
188
  </tr>
189
- <tr>
190
- <th valign="top"><?php _e('Sortorder', 'adrotate'); ?></th>
191
- <td><label for="adrotate_sortorder"><input tabindex="11" name="adrotate_sortorder" type="text" size="5" class="search-input" autocomplete="off" value="<?php echo $edit_group->sortorder;?>" /></label></td>
192
- <td><em><?php _e('For administrative purposes set a sortorder.', 'adrotate'); ?> <?php _e('Leave empty or 0 to skip this. Will default to group id.', 'adrotate'); ?></em></td>
193
- </tr>
194
  </tbody>
195
  </table>
196
  <center><?php _e('Set up mobile support and use Geo Targeting in AdRotate Pro', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('Upgrade today', 'adrotate'); ?></a>.</center>
13
  $action = "group_new";
14
  $edit_id = $wpdb->get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` = '' ORDER BY `id` DESC LIMIT 1;");
15
  if($edit_id == 0) {
16
+ $wpdb->insert($wpdb->prefix.'adrotate_groups', array('name' => '', 'modus' => 0, 'fallback' => '0', 'cat' => '', 'cat_loc' => 0, 'cat_par' => 0, 'page' => '', 'page_loc' => 0, 'page_par' => 0, 'mobile' => 0, 'geo' => 0, 'wrapper_before' => '', 'wrapper_after' => '', 'gridrows' => 2, 'gridcolumns' => 2, 'admargin' => 0, 'admargin_bottom' => 0, 'admargin_left' => 0, 'admargin_right' => 0, 'adwidth' => '125', 'adheight' => '125', 'adspeed' => 6000));
17
  $edit_id = $wpdb->insert_id;
18
  }
19
  $group_edit_id = $edit_id;
186
  <td width="35%"><label for="adrotate_mobile"><input type="checkbox" name="adrotate_mobile" value="1" disabled /> <?php _e('Enable mobile support for this group.', 'adrotate'); ?></label></td>
187
  <td><p><em><?php _e('Do not forget to put at least one mobile advert in this group.', 'adrotate'); ?></em></p></td>
188
  </tr>
 
 
 
 
 
189
  </tbody>
190
  </table>
191
  <center><?php _e('Set up mobile support and use Geo Targeting in AdRotate Pro', 'adrotate'); ?> <a href="admin.php?page=adrotate-pro"><?php _e('Upgrade today', 'adrotate'); ?></a>.</center>
dashboard/publisher/groups-main.php CHANGED
@@ -42,7 +42,7 @@
42
  </thead>
43
  <tbody>
44
 
45
- <?php $groups = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix . "adrotate_groups` WHERE `name` != '' ORDER BY `sortorder` ASC, `id` ASC;");
46
  if($groups) {
47
  $class = '';
48
  $modus = array();
42
  </thead>
43
  <tbody>
44
 
45
+ <?php $groups = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix . "adrotate_groups` WHERE `name` != '' ORDER BY `id` ASC;");
46
  if($groups) {
47
  $class = '';
48
  $modus = array();
library/dashboard.css CHANGED
@@ -1,12 +1,14 @@
1
  /* styles for graphs */
2
- .adrotate-label { font-size: 12px; margin: auto 0; padding:5px; font-weight: bold }
3
- .adrotate-clicks { color: #5Af; font-weight: normal }
4
- .adrotate-impressions { color: #F80; font-weight: normal }
5
 
6
  /* styles for advert statuses and stats */
7
- .row_urgent { background-color:#ffebe8; border-color:#c00; }
8
- .row_error { background-color:#ffffe0; border-color:#e6db55; }
9
- .row_inactive { background-color:#ebf3fa; border-color:#466f82; }
 
 
10
  .stats_large { display: block; margin-bottom: 10px; margin-top: 10px; text-align: center; font-weight: bold; }
11
  .number_large { margin: 20px; font-size: 28px; }
12
 
@@ -33,4 +35,4 @@
33
  .ajdg-photo { border-radius: 5px; }
34
 
35
  /* Tablesorter */
36
- table.tablesorter thead tr .header { text-decoration: underline; cursor: pointer; }
1
  /* styles for graphs */
2
+ .adrotate_label { font-size: 12px; margin: auto 0; padding:5px; font-weight: bold }
3
+ .adrotate_clicks { color: #5Af; font-weight: normal }
4
+ .adrotate_impressions { color: #F80; font-weight: normal }
5
 
6
  /* styles for advert statuses and stats */
7
+ .row_urgent, .row_red { background-color:#ffebe8; border-color:#c00; }
8
+ .row_orange { background-color: #fdefc3; border-color: #c80; }
9
+ .row_error, .row_yellow { background-color:#ffffe0; border-color:#e6db55; }
10
+ .row_inactive, .row_blue { background-color:#ebf3fa; border-color:#466f82; }
11
+ .row_active, .row_green { background-color: #e5faee; border-color: #518257; }
12
  .stats_large { display: block; margin-bottom: 10px; margin-top: 10px; text-align: center; font-weight: bold; }
13
  .number_large { margin: 20px; font-size: 28px; }
14
 
35
  .ajdg-photo { border-radius: 5px; }
36
 
37
  /* Tablesorter */
38
+ table.tablesorter thead tr .header { text-decoration: underline; cursor: pointer; }
library/mobile-detect.php CHANGED
@@ -22,7 +22,7 @@
22
  * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
23
  * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
24
  *
25
- * @version 2.8.16
26
  */
27
 
28
  class Mobile_Detect
@@ -66,7 +66,7 @@ class Mobile_Detect
66
  /**
67
  * Stores the version number of the current release.
68
  */
69
- const VERSION = '2.8.16';
70
 
71
  /**
72
  * A type for the version() method indicating a string return value.
@@ -174,10 +174,11 @@ class Mobile_Detect
174
  // @todo: Is 'Dell Streak' a tablet or a phone? ;)
175
  'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b',
176
  'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b',
177
- 'Samsung' => 'Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205',
178
- 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802)',
179
  'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533',
180
  'Asus' => 'Asus.*Galaxy|PadFone.*Mobile',
 
181
  // http://www.micromaxinfo.com/mobiles/smartphones
182
  // Added because the codes might conflict with Acer Tablets.
183
  'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b',
@@ -190,7 +191,7 @@ class Mobile_Detect
190
  // http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones.
191
  'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250',
192
  // http://fr.wikomobile.com
193
- 'Wiko' => 'KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM',
194
  'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)',
195
  // Added simvalley mobile just for fun. They have some interesting devices.
196
  // http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html
@@ -214,11 +215,14 @@ class Mobile_Detect
214
  * @var array
215
  */
216
  protected static $tabletDevices = array(
217
- 'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic.
218
- 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)|^.*Android.*Nexus(?:(?!Mobile).)*$',
219
- 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T360', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
 
 
 
220
  // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
221
- 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI)\b',
222
  // Only the Surface tablets with Windows RT are considered mobile.
223
  // http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx
224
  'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)',
@@ -226,7 +230,7 @@ class Mobile_Detect
226
  'HPTablet' => 'HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10',
227
  // Watch out for PadFone, see #132.
228
  // http://www.asus.com/de/Tablets_Mobile/Memo_Pad_Products/
229
- 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|\bK00C\b|\bK00E\b|\bK00L\b|TX201LA|ME176C|ME102A|\bM80TA\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K017 |ME572C|ME103K|ME170C|ME171C|\bME70C\b|ME581C|ME581CL|ME8510C|ME181C',
230
  'BlackBerryTablet' => 'PlayBook|RIM Tablet',
231
  'HTCtablet' => 'HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410',
232
  'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617',
@@ -236,7 +240,7 @@ class Mobile_Detect
236
  // http://us.acer.com/ac/en/US/content/group/tablets
237
  // http://www.acer.de/ac/de/DE/content/models/tablets/
238
  // Can conflict with Micromax and Motorola phones codes.
239
- 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\b|W3-810|\bA3-A10\b|\bA3-A11\b',
240
  // http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/
241
  // http://us.toshiba.com/tablets/tablet-finder
242
  // http://www.toshiba.co.jp/regza/tablet/
@@ -246,9 +250,9 @@ class Mobile_Detect
246
  'LGTablet' => '\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b',
247
  'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b',
248
  // Prestigio Tablets http://www.prestigio.com/support
249
- 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD',
250
  // http://support.lenovo.com/en_GB/downloads/default.page?#
251
- 'LenovoTablet' => 'Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)',
252
  // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets
253
  'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7',
254
  // http://www.yarvik.com/en/matrix/tablets/
@@ -269,10 +273,11 @@ class Mobile_Detect
269
  'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b',
270
  // http://www.ainol.com/plugin.php?identifier=ainol&module=product
271
  'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark',
 
272
  // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER
273
  // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser
274
  // http://www.sony.jp/support/tablet/
275
- 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612',
276
  // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8
277
  'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b',
278
  // db + http://www.cube-tablet.com/buy-products.html
@@ -280,7 +285,7 @@ class Mobile_Detect
280
  // http://www.cobyusa.com/?p=pcat&pcat_id=3001
281
  'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010',
282
  // http://www.match.net.cn/products.asp
283
- 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733',
284
  // http://www.msi.com/support
285
  // @todo Research the Windows Tablets.
286
  'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b',
@@ -296,7 +301,7 @@ class Mobile_Detect
296
  // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/
297
  'FlyTablet' => 'IQ310|Fly Vision',
298
  // http://www.bqreaders.com/gb/tablets-prices-sale.html
299
- 'bqTablet' => '(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris E10)|Maxwell.*Lite|Maxwell.*Plus',
300
  // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290
301
  // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets)
302
  'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim',
@@ -401,7 +406,7 @@ class Mobile_Detect
401
  // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1
402
  'TecnoTablet' => 'TECNO P9',
403
  // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3
404
- 'JXDTablet' => 'Android.*\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b',
405
  // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/
406
  'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)',
407
  // http://www.intracon.eu/tablet
@@ -432,6 +437,10 @@ class Mobile_Detect
432
  'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b',
433
  // @todo http://www.lavamobiles.com/tablets-data-cards
434
  'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b',
 
 
 
 
435
  // https://www.celkonmobiles.com/?_a=categoryphones&sid=2
436
  'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b',
437
  // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab
@@ -449,8 +458,10 @@ class Mobile_Detect
449
  'UbislateTablet' => 'UbiSlate[\s]?7C',
450
  // http://www.pocketbook-int.com/ru/support
451
  'PocketBookTablet' => 'Pocketbook',
 
 
452
  // http://www.tesco.com/direct/hudl/
453
- 'Hudl' => 'Hudl HT7S3',
454
  // http://www.telstra.com.au/home-phone/thub-2/
455
  'TelstraTablet' => 'T-Hub2',
456
  'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\bM6pro\b|CT1020W|arc 10HD|\bJolla\b|\bTP750\b'
@@ -472,7 +483,8 @@ class Mobile_Detect
472
  // http://wifeng.cn/?r=blog&a=view&id=106
473
  // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx
474
  // http://msdn.microsoft.com/library/ms537503.aspx
475
- 'WindowsPhoneOS' => 'Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
 
476
  'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
477
  // http://en.wikipedia.org/wiki/MeeGo
478
  // @todo: research MeeGo in UAs
@@ -523,6 +535,8 @@ class Mobile_Detect
523
  // @reference: http://en.wikipedia.org/wiki/Minimo
524
  // http://en.wikipedia.org/wiki/Vision_Mobile_Browser
525
  'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger',
 
 
526
  );
527
 
528
  /**
@@ -614,11 +628,13 @@ class Mobile_Detect
614
  'Skyfire' => 'Skyfire/[VER]',
615
  'Tizen' => 'Tizen/[VER]',
616
  'Webkit' => 'webkit[ /][VER]',
 
617
 
618
  // Engine
619
  'Gecko' => 'Gecko/[VER]',
620
  'Trident' => 'Trident/[VER]',
621
  'Presto' => 'Presto/[VER]',
 
622
 
623
  // OS
624
  'iOS' => ' \bi?OS\b [VER][ ;]{1}',
@@ -670,7 +686,7 @@ class Mobile_Detect
670
  * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers.
671
  *
672
  * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract
673
- * the headers. The default null is left for backwards compatibilty.
674
  */
675
  public function setHttpHeaders($httpHeaders = null)
676
  {
@@ -751,11 +767,11 @@ class Mobile_Detect
751
  return self::$uaHttpHeaders;
752
  }
753
 
754
-
755
  /**
756
  * Set CloudFront headers
757
  * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device
758
- *
759
  * @param array $cfHeaders List of HTTP headers
760
  *
761
  * @return boolean If there were CloudFront headers to be set
@@ -1072,7 +1088,7 @@ class Mobile_Detect
1072
 
1073
  /**
1074
  * Search for a certain key in the rules array.
1075
- * If the key is found the try to match the corresponding
1076
  * regex against the User-Agent.
1077
  *
1078
  * @param string $key
22
  * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md
23
  * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples
24
  *
25
+ * @version 2.8.22
26
  */
27
 
28
  class Mobile_Detect
66
  /**
67
  * Stores the version number of the current release.
68
  */
69
+ const VERSION = '2.8.22';
70
 
71
  /**
72
  * A type for the version() method indicating a string return value.
174
  // @todo: Is 'Dell Streak' a tablet or a phone? ;)
175
  'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b',
176
  'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b',
177
+ 'Samsung' => 'Samsung|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F',
178
+ 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)',
179
  'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533',
180
  'Asus' => 'Asus.*Galaxy|PadFone.*Mobile',
181
+ 'NokiaLumia' => 'Lumia [0-9]{3,4}',
182
  // http://www.micromaxinfo.com/mobiles/smartphones
183
  // Added because the codes might conflict with Acer Tablets.
184
  'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b',
191
  // http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones.
192
  'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250',
193
  // http://fr.wikomobile.com
194
+ 'Wiko' => 'KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM',
195
  'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)',
196
  // Added simvalley mobile just for fun. They have some interesting devices.
197
  // http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html
215
  * @var array
216
  */
217
  protected static $tabletDevices = array(
218
+ // @todo: check for mobile friendly emails topic.
219
+ 'iPad' => 'iPad|iPad.*Mobile',
220
+ // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$
221
+ // @see #442
222
+ 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)',
223
+ 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
224
  // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
225
+ 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI)\b',
226
  // Only the Surface tablets with Windows RT are considered mobile.
227
  // http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx
228
  'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)',
230
  'HPTablet' => 'HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10',
231
  // Watch out for PadFone, see #132.
232
  // http://www.asus.com/de/Tablets_Mobile/Memo_Pad_Products/
233
+ 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|\bK00C\b|\bK00E\b|\bK00L\b|TX201LA|ME176C|ME102A|\bM80TA\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K017 |ME572C|ME103K|ME170C|ME171C|\bME70C\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA',
234
  'BlackBerryTablet' => 'PlayBook|RIM Tablet',
235
  'HTCtablet' => 'HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410',
236
  'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617',
240
  // http://us.acer.com/ac/en/US/content/group/tablets
241
  // http://www.acer.de/ac/de/DE/content/models/tablets/
242
  // Can conflict with Micromax and Motorola phones codes.
243
+ 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\b|W3-810|\bA3-A10\b|\bA3-A11\b|\bA3-A20',
244
  // http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/
245
  // http://us.toshiba.com/tablets/tablet-finder
246
  // http://www.toshiba.co.jp/regza/tablet/
250
  'LGTablet' => '\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b',
251
  'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b',
252
  // Prestigio Tablets http://www.prestigio.com/support
253
+ 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002',
254
  // http://support.lenovo.com/en_GB/downloads/default.page?#
255
+ 'LenovoTablet' => 'Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)',
256
  // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets
257
  'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7',
258
  // http://www.yarvik.com/en/matrix/tablets/
273
  'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b',
274
  // http://www.ainol.com/plugin.php?identifier=ainol&module=product
275
  'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark',
276
+ 'NokiaLumiaTablet' => 'Lumia 2520',
277
  // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER
278
  // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser
279
  // http://www.sony.jp/support/tablet/
280
+ 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31',
281
  // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8
282
  'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b',
283
  // db + http://www.cube-tablet.com/buy-products.html
285
  // http://www.cobyusa.com/?p=pcat&pcat_id=3001
286
  'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010',
287
  // http://www.match.net.cn/products.asp
288
+ 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10',
289
  // http://www.msi.com/support
290
  // @todo Research the Windows Tablets.
291
  'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b',
301
  // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/
302
  'FlyTablet' => 'IQ310|Fly Vision',
303
  // http://www.bqreaders.com/gb/tablets-prices-sale.html
304
+ 'bqTablet' => 'Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris E10)|Maxwell.*Lite|Maxwell.*Plus',
305
  // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290
306
  // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets)
307
  'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim',
406
  // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1
407
  'TecnoTablet' => 'TECNO P9',
408
  // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3
409
+ 'JXDTablet' => 'Android.* \b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b',
410
  // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/
411
  'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)',
412
  // http://www.intracon.eu/tablet
437
  'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b',
438
  // @todo http://www.lavamobiles.com/tablets-data-cards
439
  'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b',
440
+ // http://www.breezetablet.com/
441
+ 'AocTablet' => 'MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712',
442
+ // http://www.mpmaneurope.com/en/products/internet-tablets-14/android-tablets-14/
443
+ 'MpmanTablet' => 'MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\bMPG7\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010',
444
  // https://www.celkonmobiles.com/?_a=categoryphones&sid=2
445
  'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b',
446
  // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab
458
  'UbislateTablet' => 'UbiSlate[\s]?7C',
459
  // http://www.pocketbook-int.com/ru/support
460
  'PocketBookTablet' => 'Pocketbook',
461
+ // http://www.kocaso.com/product_tablet.html
462
+ 'KocasoTablet' => '\b(TB-1207)\b',
463
  // http://www.tesco.com/direct/hudl/
464
+ 'Hudl' => 'Hudl HT7S3|Hudl 2',
465
  // http://www.telstra.com.au/home-phone/thub-2/
466
  'TelstraTablet' => 'T-Hub2',
467
  'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\bM6pro\b|CT1020W|arc 10HD|\bJolla\b|\bTP750\b'
483
  // http://wifeng.cn/?r=blog&a=view&id=106
484
  // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx
485
  // http://msdn.microsoft.com/library/ms537503.aspx
486
+ // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
487
+ 'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
488
  'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
489
  // http://en.wikipedia.org/wiki/MeeGo
490
  // @todo: research MeeGo in UAs
535
  // @reference: http://en.wikipedia.org/wiki/Minimo
536
  // http://en.wikipedia.org/wiki/Vision_Mobile_Browser
537
  'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger',
538
+ // @reference: https://en.wikipedia.org/wiki/Pale_Moon_(web_browser)
539
+ 'PaleMoon' => 'Android.*PaleMoon|Mobile.*PaleMoon',
540
  );
541
 
542
  /**
628
  'Skyfire' => 'Skyfire/[VER]',
629
  'Tizen' => 'Tizen/[VER]',
630
  'Webkit' => 'webkit[ /][VER]',
631
+ 'PaleMoon' => 'PaleMoon/[VER]',
632
 
633
  // Engine
634
  'Gecko' => 'Gecko/[VER]',
635
  'Trident' => 'Trident/[VER]',
636
  'Presto' => 'Presto/[VER]',
637
+ 'Goanna' => 'Goanna/[VER]',
638
 
639
  // OS
640
  'iOS' => ' \bi?OS\b [VER][ ;]{1}',
686
  * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers.
687
  *
688
  * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract
689
+ * the headers. The default null is left for backwards compatibility.
690
  */
691
  public function setHttpHeaders($httpHeaders = null)
692
  {
767
  return self::$uaHttpHeaders;
768
  }
769
 
770
+
771
  /**
772
  * Set CloudFront headers
773
  * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device
774
+ *
775
  * @param array $cfHeaders List of HTTP headers
776
  *
777
  * @return boolean If there were CloudFront headers to be set
1088
 
1089
  /**
1090
  * Search for a certain key in the rules array.
1091
+ * If the key is found then try to match the corresponding
1092
  * regex against the User-Agent.
1093
  *
1094
  * @param string $key
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: adegans
3
  Donate link: http://meandmymac.net/donate/?utm_campaign=donations&utm_medium=readme&utm_source=adrotate-free
4
  Tags: ads, banner, commercial, admin, advertise, adrotator, plugin, random, rotator, ad, advertising, advertisement, block, blocks, advertiser, publisher, adsense, geo, geolocation, geotarget, chitika, clickbank, broadstreet, banner manager,advert manager, campaign manager, export, import, telize, maxmind, referrer, email, menu, statistics, stats, report, advert, adverts, popular, best, great, 2014, geoselect, geobytes, schedules, schedule, monetize, header, widget, javascript, jquery, tracking, clicks, impressions, rotate, zone, zones, sidebar, footer, content, posts, pages, 2015
5
  Requires at least: 3.8
6
- Tested up to: 4.6
7
- Stable tag: 3.15.7
8
  License: GPLv3
9
 
10
  The popular choice for monetizing your website with adverts while keeping things simple. Start making money today!
@@ -23,6 +23,9 @@ Geo Targeting, Avoid adblockers, Mobile adverts, Media management and much more!
23
  > I do not always provide active support for the AdRotate Free plugin on the WordPress.org forums. Personal, one-on-one support via email is available to people who bought [AdRotate Pro](https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=premium_support&utm_medium=readme&utm_source=adrotate-free) only.
24
  > Also know that AdRotate Pro has a lot of extra features that make managing campaigns even easier. Features like Geo Targeting, Adblocker disguise, Advertisers and Scheduling your campaigns! These valuable tools will be worth your investment if you're serious about advertising!
25
  >
 
 
 
26
  > <strong>Support and Bug Reports</strong><br>
27
  > All support questions can be posted on my support [Support Forums](https://ajdg.solutions/forums/?utm_campaign=forums&utm_medium=readme&utm_source=adrotate-free).<br>
28
  > Please post bug reports for AdRotate Pro on [the support forum for bug reports](https://ajdg.solutions/forums/forum/adrotate-for-wordpress/bug-reports/).<br>
@@ -93,17 +96,31 @@ You can also post your questions on the [forum](https://ajdg.solutions/forums/?u
93
 
94
  Be a Pro and go Pro. With [AdRotate Pro](https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate-free)!
95
 
96
- = 3.15.7 FREE =
97
- * [fix] Editing empty adverts losing settings before saving
98
- * [fix] Dashboard notifications not formatted properly
99
-
100
- = 3.15.6 FREE =
101
- * [new] Manually run internal updater from maintenance
102
- * [change] Dashboard tweaks
103
- * [change] More distinct style for update banner and button
104
-
105
- = 4.0.2 PRO =
106
- * [fix] Dashboard notifications not formatted properly
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
  All recent changes are available on the [AdRotate website](https://ajdg.solutions/products/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
109
 
@@ -111,9 +128,10 @@ NOTE: Unsolicited offers, parnterships, job offers, promotional emails or produc
111
 
112
  == Upgrade Notice ==
113
 
114
- = 3.15.7 FREE =
115
- * [fix] Editing empty adverts losing settings before saving
116
- * [fix] Dashboard notifications not formatted properly
 
117
 
118
  All recent changes are available on the [AdRotate website](https://ajdg.solutions/products/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
119
 
3
  Donate link: http://meandmymac.net/donate/?utm_campaign=donations&utm_medium=readme&utm_source=adrotate-free
4
  Tags: ads, banner, commercial, admin, advertise, adrotator, plugin, random, rotator, ad, advertising, advertisement, block, blocks, advertiser, publisher, adsense, geo, geolocation, geotarget, chitika, clickbank, broadstreet, banner manager,advert manager, campaign manager, export, import, telize, maxmind, referrer, email, menu, statistics, stats, report, advert, adverts, popular, best, great, 2014, geoselect, geobytes, schedules, schedule, monetize, header, widget, javascript, jquery, tracking, clicks, impressions, rotate, zone, zones, sidebar, footer, content, posts, pages, 2015
5
  Requires at least: 3.8
6
+ Tested up to: 4.6.1
7
+ Stable tag: 3.16
8
  License: GPLv3
9
 
10
  The popular choice for monetizing your website with adverts while keeping things simple. Start making money today!
23
  > I do not always provide active support for the AdRotate Free plugin on the WordPress.org forums. Personal, one-on-one support via email is available to people who bought [AdRotate Pro](https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=premium_support&utm_medium=readme&utm_source=adrotate-free) only.
24
  > Also know that AdRotate Pro has a lot of extra features that make managing campaigns even easier. Features like Geo Targeting, Adblocker disguise, Advertisers and Scheduling your campaigns! These valuable tools will be worth your investment if you're serious about advertising!
25
  >
26
+ > <strong>Help getting started</strong><br>
27
+ > If you need some help installing AdRotate or you want someone to handle the initial setup. Take a look at these [services](https://ajdg.solutions/pricing/?utm_campaign=installation_services&utm_medium=readme&utm_source=adrotate-free).
28
+ >
29
  > <strong>Support and Bug Reports</strong><br>
30
  > All support questions can be posted on my support [Support Forums](https://ajdg.solutions/forums/?utm_campaign=forums&utm_medium=readme&utm_source=adrotate-free).<br>
31
  > Please post bug reports for AdRotate Pro on [the support forum for bug reports](https://ajdg.solutions/forums/forum/adrotate-for-wordpress/bug-reports/).<br>
96
 
97
  Be a Pro and go Pro. With [AdRotate Pro](https://ajdg.solutions/products/adrotate-for-wordpress/?utm_campaign=adrotate-page&utm_medium=readme&utm_source=adrotate-free)!
98
 
99
+ = 3.16 FREE =
100
+ * [fix] Click tracking not always working if your HTML is in uppercase
101
+ * [fix] Maintenance tasks not always properly set up
102
+ * [change] AdRotate menu re-done and updated
103
+
104
+ = 4.1 PRO =
105
+ * Network license no longer supported - Get a free upgrade!
106
+ * [new] Widget wrapper option
107
+ * [new] Widget now auto-detects Network adverts and groups
108
+ * [new] Enable/disable dashboard for Network Sites
109
+ * [new] Set up a primary site to control the network
110
+ * [new] Transactions menu item and relevant dashboard
111
+ * [new] Mobile OS detection and filtering
112
+ * [new] Paypal payments for campaigns
113
+ * [fix] Group settings not loaded if group is from another site_id
114
+ * [fix] Click tracking not always working if your HTML is in uppercase
115
+ * [fix] Hourly impressions limit now properly filtered
116
+ * [change] AdRotate Pro menu re-done and updated
117
+ * [change] 'Moderation Queue' now a tab in 'Adverts'
118
+ * [change] 'Rejected Adverts' merged with 'Queue' tab
119
+ * [change] 'Full Report' moved to it's own menu item
120
+ * [change] 'Stats' from Adverts moved to new 'Statistics' menu
121
+ * [change] 'Stats' from Groups moved to new 'Statistics' menu
122
+ * [change] 'Network' license no longer supported
123
+ * [change] 'site' variable now acts as switch, not a selector
124
 
125
  All recent changes are available on the [AdRotate website](https://ajdg.solutions/products/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
126
 
128
 
129
  == Upgrade Notice ==
130
 
131
+ = 3.16 FREE =
132
+ * [fix] Click tracking not always working if your HTML is in uppercase
133
+ * [fix] Maintenance tasks not always properly set up
134
+ * [change] AdRotate menu re-done and updated
135
 
136
  All recent changes are available on the [AdRotate website](https://ajdg.solutions/products/adrotate-for-wordpress/development/?utm_campaign=development&utm_medium=readme&utm_source=adrotate-free).
137