Ad Inserter – WordPress Ads Management with AdSense Header Integration - Version 1.6.2

Version Description

  • Removed deprecated code (fixes PHP Fatal error Call to a member function get_display_type)
  • Added support to change plugin processing priority
Download this release

Release Info

Developer spacetime
Plugin Icon 128x128 Ad Inserter – WordPress Ads Management with AdSense Header Integration
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

ad-inserter.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
- Version: 1.6.1
5
  Description: A simple solution to insert any code into Wordpress. Simply enter any HTML, Javascript or PHP code and select where and how you want to display it.
6
  Author: Spacetime
7
  Author URI: http://igorfuna.com/
@@ -11,6 +11,10 @@ Plugin URI: http://igorfuna.com/software/web/ad-inserter-wordpress-plugin
11
  /*
12
  Change Log
13
 
 
 
 
 
14
  Ad Inserter 1.6.1 - 28 February 2016
15
  - Fixed bug: For shortcodes in posts the date was not checked
16
  - Fixed error with some templates "Call to undefined method is_main_query()"
@@ -211,10 +215,12 @@ for ($counter = 1; $counter <= AD_INSERTER_BLOCKS; $counter ++) {
211
  $block_object [$counter] = $obj;
212
  }
213
 
 
 
214
  // Set hooks
215
  add_action ('admin_menu', 'ai_admin_menu_hook');
216
- add_filter ('the_content', 'ai_content_hook', 99999);
217
- add_filter ('the_excerpt', 'ai_excerpt_hook', 99999);
218
  add_action ('loop_start', 'ai_loop_start_hook');
219
  add_action ('init', 'ai_init_hook');
220
  add_action ('admin_notices', 'ai_admin_notice_hook');
@@ -232,17 +238,17 @@ function ai_init_hook() {
232
  global $block_object;
233
 
234
  // OLD WIDGETS - DEPRECATED
235
- for ($counter = 1; $counter <= AD_INSERTER_BLOCKS; $counter ++) {
236
- $obj = $block_object [$counter];
237
- if($obj->get_display_type() == AD_SELECT_WIDGET){
238
- // register widget
239
- $widget_options = array ('classname' => 'ad-inserter-widget', 'description' => "DEPRECATED - Use 'Ad Inserter' widget instead.");
240
- $widget_parameters = array ('block' => $counter);
241
- // Different callback functions because widgets that share callback functions don't get displayed
242
- if ($counter <= 16)
243
- wp_register_sidebar_widget ('ai_widget'.$counter, $obj->get_ad_name().' - DEPRECATED', 'ai_widget'.$counter, $widget_options, $widget_parameters);
244
- }
245
- }
246
 
247
  add_shortcode ('adinserter', 'process_shortcodes');
248
  }
@@ -276,28 +282,28 @@ function ai_enqueue_scripts_hook () {
276
  function ai_admin_notice_hook () {
277
  global $current_screen, $ai_db_options;
278
 
279
- $sidebar_widgets = wp_get_sidebars_widgets();
280
- $sidebars_with_deprecated_widgets = array ();
281
-
282
- foreach ($sidebar_widgets as $sidebar_widget_index => $sidebar_widget) {
283
- if (is_array ($sidebar_widget))
284
- foreach ($sidebar_widget as $widget) {
285
- if (preg_match ("/ai_widget([\d]+)/", $widget, $widget_number)) {
286
- if (isset ($widget_number [1]) && is_numeric ($widget_number [1])) {
287
- $is_widget = $ai_db_options [$widget_number [1]][AI_OPTION_DISPLAY_TYPE] == AD_SELECT_WIDGET;
288
- } else $is_widget = false;
289
- $sidebar_name = $GLOBALS ['wp_registered_sidebars'][$sidebar_widget_index]['name'];
290
- if ($is_widget && $sidebar_name != "")
291
- $sidebars_with_deprecated_widgets [$sidebar_widget_index] = $sidebar_name;
292
- }
293
- }
294
- }
295
-
296
- if (!empty ($sidebars_with_deprecated_widgets)) {
297
- echo "<div class='error' style='padding: 11px 15px; font-size: 14px;'><strong>Warning</strong>: You are using deprecated Ad Inserter widgets in the following sidebars: ",
298
- implode (", ", $sidebars_with_deprecated_widgets),
299
- ". Please replace them with the new 'Ad Inserter' code block widget. See <a href='https://wordpress.org/plugins/ad-inserter/faq/' target='_blank'>FAQ</a> for details.</div>";
300
- }
301
  }
302
 
303
  function ai_plugin_action_links ($links) {
@@ -500,7 +506,7 @@ function ai_wp_footer_hook () {
500
  }
501
  }
502
 
503
- function ai_plugin_options ($syntax_highlighter_theme = DEFAULT_SYNTAX_HIGHLIGHTER_THEME, $block_class_name = DEFAULT_BLOCK_CLASS_NAME, $minimum_user_role = DEFAULT_MINIMUM_USER_ROLE){
504
  $plugin_options = array ();
505
 
506
  $version_array = explode (".", AD_INSERTER_VERSION);
@@ -515,6 +521,18 @@ function ai_plugin_options ($syntax_highlighter_theme = DEFAULT_SYNTAX_HIGHLIGHT
515
  $plugin_options ['BLOCK_CLASS_NAME'] = $block_class_name;
516
  $plugin_options ['MINIMUM_USER_ROLE'] = $minimum_user_role;
517
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  return ($plugin_options);
519
  }
520
 
@@ -584,6 +602,19 @@ function get_minimum_user_role () {
584
  return ($plugin_db_options ['MINIMUM_USER_ROLE']);
585
  }
586
 
 
 
 
 
 
 
 
 
 
 
 
 
 
587
  function filter_html_class ($str){
588
 
589
  $str = str_replace (array ("\\\""), array ("\""), $str);
@@ -739,7 +770,7 @@ function ai_settings () {
739
 
740
  $ai_options [AI_HEADER_OPTION_NAME] = $adH->wp_options;
741
  $ai_options [AI_FOOTER_OPTION_NAME] = $adF->wp_options;
742
- $ai_options [AI_GLOBAL_OPTION_NAME] = ai_plugin_options (filter_string ($_POST ['syntax-highlighter-theme']), filter_html_class ($_POST ['block-class-name']), filter_string ($_POST ['minimum-user-role']));
743
  }
744
 
745
  if (!empty ($invalid_blocks)) {
@@ -972,7 +1003,7 @@ function ai_content_hook ($content = ''){
972
  } else continue;
973
 
974
  // Deprecated
975
- if ($obj->display_disabled ($content)) continue;
976
 
977
  if (!$obj->check_category ()) continue;
978
 
@@ -987,26 +1018,18 @@ function ai_content_hook ($content = ''){
987
  if (!$obj->check_block_counter ()) continue;
988
 
989
  if ($display_type == AD_SELECT_BEFORE_PARAGRAPH) {
990
- // $content = ai_generateBeforeParagraph ($counter, $content, $obj);
991
  $content = $obj->before_paragraph ($content);
992
  } elseif ($display_type == AD_SELECT_AFTER_PARAGRAPH) {
993
- // $content = ai_generateAfterParagraph ($counter, $content, $obj);
994
  $content = $obj->after_paragraph ($content);
995
  } elseif ($display_type == AD_SELECT_BEFORE_CONTENT) {
996
- // $content = ai_generateDivBefore ($counter, $content, $obj);
997
  $content = $obj->before_content ($content);
998
  } elseif ($display_type == AD_SELECT_AFTER_CONTENT) {
999
- // $content = ai_generateDivAfter ($counter, $content, $obj);
1000
  $content = $obj->after_content ($content);
1001
  }
1002
-
1003
- // Deprecated
1004
- // if ($manual_insert) $content = ai_generateDivManual ($counter, $content, $obj, $counter);
1005
- // if ($manual_insert) $content = $obj->manual ($content);
1006
  }
1007
 
1008
  // Clean remaining deprecated tags
1009
- $content = preg_replace ("/{adinserter (.*)}/", "", $content);
1010
 
1011
  return $content;
1012
  }
@@ -1069,7 +1092,8 @@ function ai_excerpt_hook ($content = ''){
1069
  continue;
1070
  }
1071
 
1072
- if ($obj->display_disabled ($content)) continue;
 
1073
 
1074
  if (!$obj->check_category ()) continue;
1075
 
@@ -1880,13 +1904,14 @@ class ai_widget extends WP_Widget {
1880
 
1881
  // OLD WIDGETS - DEPRECATED
1882
 
1883
- function ai_widget ($args, $parameters) {
1884
- global $block_object;
 
 
 
 
 
1885
 
1886
- $block = $parameters ['block'];
1887
- $ad = $block_object [$block];
1888
- ai_widget_draw ($block, $ad, $args);
1889
- }
1890
 
1891
  // Fix because widgets that share callback functions don't get displayed
1892
 
1
  <?php
2
  /*
3
  Plugin Name: Ad Inserter
4
+ Version: 1.6.2
5
  Description: A simple solution to insert any code into Wordpress. Simply enter any HTML, Javascript or PHP code and select where and how you want to display it.
6
  Author: Spacetime
7
  Author URI: http://igorfuna.com/
11
  /*
12
  Change Log
13
 
14
+ Ad Inserter 1.6.2 - 2 April 2016
15
+ - Removed deprecated code (fixes PHP Fatal error Call to a member function get_display_type)
16
+ - Added support to change plugin processing priority
17
+
18
  Ad Inserter 1.6.1 - 28 February 2016
19
  - Fixed bug: For shortcodes in posts the date was not checked
20
  - Fixed error with some templates "Call to undefined method is_main_query()"
215
  $block_object [$counter] = $obj;
216
  }
217
 
218
+ $plugin_priority = get_plugin_priority ();
219
+
220
  // Set hooks
221
  add_action ('admin_menu', 'ai_admin_menu_hook');
222
+ add_filter ('the_content', 'ai_content_hook', $plugin_priority);
223
+ add_filter ('the_excerpt', 'ai_excerpt_hook', $plugin_priority);
224
  add_action ('loop_start', 'ai_loop_start_hook');
225
  add_action ('init', 'ai_init_hook');
226
  add_action ('admin_notices', 'ai_admin_notice_hook');
238
  global $block_object;
239
 
240
  // OLD WIDGETS - DEPRECATED
241
+ // for ($counter = 1; $counter <= AD_INSERTER_BLOCKS; $counter ++) {
242
+ // $obj = $block_object [$counter];
243
+ // if($obj->get_display_type() == AD_SELECT_WIDGET){
244
+ // // register widget
245
+ // $widget_options = array ('classname' => 'ad-inserter-widget', 'description' => "DEPRECATED - Use 'Ad Inserter' widget instead.");
246
+ // $widget_parameters = array ('block' => $counter);
247
+ // // Different callback functions because widgets that share callback functions don't get displayed
248
+ // if ($counter <= 16)
249
+ // wp_register_sidebar_widget ('ai_widget'.$counter, $obj->get_ad_name().' - DEPRECATED', 'ai_widget'.$counter, $widget_options, $widget_parameters);
250
+ // }
251
+ // }
252
 
253
  add_shortcode ('adinserter', 'process_shortcodes');
254
  }
282
  function ai_admin_notice_hook () {
283
  global $current_screen, $ai_db_options;
284
 
285
+ // $sidebar_widgets = wp_get_sidebars_widgets();
286
+ // $sidebars_with_deprecated_widgets = array ();
287
+
288
+ // foreach ($sidebar_widgets as $sidebar_widget_index => $sidebar_widget) {
289
+ // if (is_array ($sidebar_widget))
290
+ // foreach ($sidebar_widget as $widget) {
291
+ // if (preg_match ("/ai_widget([\d]+)/", $widget, $widget_number)) {
292
+ // if (isset ($widget_number [1]) && is_numeric ($widget_number [1])) {
293
+ // $is_widget = $ai_db_options [$widget_number [1]][AI_OPTION_DISPLAY_TYPE] == AD_SELECT_WIDGET;
294
+ // } else $is_widget = false;
295
+ // $sidebar_name = $GLOBALS ['wp_registered_sidebars'][$sidebar_widget_index]['name'];
296
+ // if ($is_widget && $sidebar_name != "")
297
+ // $sidebars_with_deprecated_widgets [$sidebar_widget_index] = $sidebar_name;
298
+ // }
299
+ // }
300
+ // }
301
+
302
+ // if (!empty ($sidebars_with_deprecated_widgets)) {
303
+ // echo "<div class='error' style='padding: 11px 15px; font-size: 14px;'><strong>Warning</strong>: You are using deprecated Ad Inserter widgets in the following sidebars: ",
304
+ // implode (", ", $sidebars_with_deprecated_widgets),
305
+ // ". Please replace them with the new 'Ad Inserter' code block widget. See <a href='https://wordpress.org/plugins/ad-inserter/faq/' target='_blank'>FAQ</a> for details.</div>";
306
+ // }
307
  }
308
 
309
  function ai_plugin_action_links ($links) {
506
  }
507
  }
508
 
509
+ function ai_plugin_options ($syntax_highlighter_theme = DEFAULT_SYNTAX_HIGHLIGHTER_THEME, $block_class_name = DEFAULT_BLOCK_CLASS_NAME, $minimum_user_role = DEFAULT_MINIMUM_USER_ROLE, $plugin_priority = DEFAULT_PLUGIN_PRIORITY){
510
  $plugin_options = array ();
511
 
512
  $version_array = explode (".", AD_INSERTER_VERSION);
521
  $plugin_options ['BLOCK_CLASS_NAME'] = $block_class_name;
522
  $plugin_options ['MINIMUM_USER_ROLE'] = $minimum_user_role;
523
 
524
+ if (!is_numeric ($plugin_priority)) {
525
+ $plugin_priority = DEFAULT_PLUGIN_PRIORITY;
526
+ }
527
+ $plugin_priority = intval ($plugin_priority);
528
+ if ($plugin_priority < 0) {
529
+ $plugin_priority = 0;
530
+ }
531
+ if ($plugin_priority > 999999) {
532
+ $plugin_priority = 999999;
533
+ }
534
+ $plugin_options ['PLUGIN_PRIORITY'] = $plugin_priority;
535
+
536
  return ($plugin_options);
537
  }
538
 
602
  return ($plugin_db_options ['MINIMUM_USER_ROLE']);
603
  }
604
 
605
+ function get_plugin_priority () {
606
+ global $ai_db_options;
607
+
608
+ if (isset ($ai_db_options [AI_GLOBAL_OPTION_NAME])) $plugin_db_options = $ai_db_options [AI_GLOBAL_OPTION_NAME]; else $plugin_db_options = '';
609
+ if (!$plugin_db_options) $plugin_db_options = get_option (AD_OPTIONS);
610
+
611
+ if (!isset ($plugin_db_options ['PLUGIN_PRIORITY']) || $plugin_db_options ['PLUGIN_PRIORITY'] == '') {
612
+ $plugin_db_options ['PLUGIN_PRIORITY'] = DEFAULT_PLUGIN_PRIORITY;
613
+ }
614
+
615
+ return ($plugin_db_options ['PLUGIN_PRIORITY']);
616
+ }
617
+
618
  function filter_html_class ($str){
619
 
620
  $str = str_replace (array ("\\\""), array ("\""), $str);
770
 
771
  $ai_options [AI_HEADER_OPTION_NAME] = $adH->wp_options;
772
  $ai_options [AI_FOOTER_OPTION_NAME] = $adF->wp_options;
773
+ $ai_options [AI_GLOBAL_OPTION_NAME] = ai_plugin_options (filter_string ($_POST ['syntax-highlighter-theme']), filter_html_class ($_POST ['block-class-name']), filter_string ($_POST ['minimum-user-role']), filter_option ('plugin_priority', $_POST ['plugin_priority']));
774
  }
775
 
776
  if (!empty ($invalid_blocks)) {
1003
  } else continue;
1004
 
1005
  // Deprecated
1006
+ // if ($obj->display_disabled ($content)) continue;
1007
 
1008
  if (!$obj->check_category ()) continue;
1009
 
1018
  if (!$obj->check_block_counter ()) continue;
1019
 
1020
  if ($display_type == AD_SELECT_BEFORE_PARAGRAPH) {
 
1021
  $content = $obj->before_paragraph ($content);
1022
  } elseif ($display_type == AD_SELECT_AFTER_PARAGRAPH) {
 
1023
  $content = $obj->after_paragraph ($content);
1024
  } elseif ($display_type == AD_SELECT_BEFORE_CONTENT) {
 
1025
  $content = $obj->before_content ($content);
1026
  } elseif ($display_type == AD_SELECT_AFTER_CONTENT) {
 
1027
  $content = $obj->after_content ($content);
1028
  }
 
 
 
 
1029
  }
1030
 
1031
  // Clean remaining deprecated tags
1032
+ // $content = preg_replace ("/{adinserter (.*)}/", "", $content);
1033
 
1034
  return $content;
1035
  }
1092
  continue;
1093
  }
1094
 
1095
+ // Deprecated
1096
+ // if ($obj->display_disabled ($content)) continue;
1097
 
1098
  if (!$obj->check_category ()) continue;
1099
 
1904
 
1905
  // OLD WIDGETS - DEPRECATED
1906
 
1907
+ //function ai_widget ($args, $parameters) {
1908
+ // global $block_object;
1909
+
1910
+ // $block = $parameters ['block'];
1911
+ // $ad = $block_object [$block];
1912
+ // ai_widget_draw ($block, $ad, $args);
1913
+ //}
1914
 
 
 
 
 
1915
 
1916
  // Fix because widgets that share callback functions don't get displayed
1917
 
class.php CHANGED
@@ -1020,20 +1020,20 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1020
  }
1021
 
1022
  // Deprecated
1023
- function display_disabled ($content){
1024
 
1025
- $ad_name = $this->get_ad_name();
1026
 
1027
- if (preg_match ("/<!-- +Ad +Inserter +Ad +".($this->number)." +Disabled +-->/i", $content)) return true;
1028
 
1029
- if (preg_match ("/<!-- +disable +adinserter +\* +-->/i", $content)) return true;
1030
 
1031
- if (preg_match ("/<!-- +disable +adinserter +".($this->number)." +-->/i", $content)) return true;
1032
 
1033
- if (strpos ($content, "<!-- disable adinserter " . $ad_name . " -->") != false) return true;
1034
 
1035
- return false;
1036
- }
1037
 
1038
  function check_category () {
1039
 
1020
  }
1021
 
1022
  // Deprecated
1023
+ // function display_disabled ($content){
1024
 
1025
+ // $ad_name = $this->get_ad_name();
1026
 
1027
+ // if (preg_match ("/<!-- +Ad +Inserter +Ad +".($this->number)." +Disabled +-->/i", $content)) return true;
1028
 
1029
+ // if (preg_match ("/<!-- +disable +adinserter +\* +-->/i", $content)) return true;
1030
 
1031
+ // if (preg_match ("/<!-- +disable +adinserter +".($this->number)." +-->/i", $content)) return true;
1032
 
1033
+ // if (strpos ($content, "<!-- disable adinserter " . $ad_name . " -->") != false) return true;
1034
 
1035
+ // return false;
1036
+ // }
1037
 
1038
  function check_category () {
1039
 
constants.php CHANGED
@@ -11,7 +11,7 @@ if (!defined( 'AD_INSERTER_TITLE'))
11
  define ('AD_INSERTER_TITLE', 'Ad Inserter');
12
 
13
  if (!defined( 'AD_INSERTER_VERSION'))
14
- define ('AD_INSERTER_VERSION', '1.6.1');
15
 
16
  if (!defined ('AD_INSERTER_BLOCKS'))
17
  define ('AD_INSERTER_BLOCKS', 16);
@@ -46,6 +46,7 @@ if (!defined ('WP_PLUGIN_DIR'))
46
  define ('DEFAULT_SYNTAX_HIGHLIGHTER_THEME', 'ad_inserter');
47
  define ('DEFAULT_BLOCK_CLASS_NAME', 'code-block');
48
  define ('DEFAULT_MINIMUM_USER_ROLE', 'administrator');
 
49
 
50
  define ('AD_EMPTY_DATA', '');
51
  define ('AD_ZERO', '0');
11
  define ('AD_INSERTER_TITLE', 'Ad Inserter');
12
 
13
  if (!defined( 'AD_INSERTER_VERSION'))
14
+ define ('AD_INSERTER_VERSION', '1.6.2');
15
 
16
  if (!defined ('AD_INSERTER_BLOCKS'))
17
  define ('AD_INSERTER_BLOCKS', 16);
46
  define ('DEFAULT_SYNTAX_HIGHLIGHTER_THEME', 'ad_inserter');
47
  define ('DEFAULT_BLOCK_CLASS_NAME', 'code-block');
48
  define ('DEFAULT_MINIMUM_USER_ROLE', 'administrator');
49
+ define ('DEFAULT_PLUGIN_PRIORITY', 99999);
50
 
51
  define ('AD_EMPTY_DATA', '');
52
  define ('AD_ZERO', '0');
includes/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.17
26
  */
27
 
28
  class ai_Mobile_Detect
@@ -66,7 +66,7 @@ class ai_Mobile_Detect
66
  /**
67
  * Stores the version number of the current release.
68
  */
69
- const VERSION = '2.8.17';
70
 
71
  /**
72
  * A type for the version() method indicating a string return value.
@@ -175,7 +175,7 @@ class ai_Mobile_Detect
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
@@ -219,7 +219,7 @@ class ai_Mobile_Detect
219
  // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$
220
  // @see #442
221
  'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)',
222
- '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|SM-T533', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
223
  // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
224
  'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI)\b',
225
  // Only the Surface tablets with Windows RT are considered mobile.
@@ -435,6 +435,7 @@ class ai_Mobile_Detect
435
  'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b',
436
  // @todo http://www.lavamobiles.com/tablets-data-cards
437
  'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b',
 
438
  // https://www.celkonmobiles.com/?_a=categoryphones&sid=2
439
  'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b',
440
  // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab
@@ -453,7 +454,7 @@ class ai_Mobile_Detect
453
  // http://www.pocketbook-int.com/ru/support
454
  'PocketBookTablet' => 'Pocketbook',
455
  // http://www.tesco.com/direct/hudl/
456
- 'Hudl' => 'Hudl HT7S3',
457
  // http://www.telstra.com.au/home-phone/thub-2/
458
  'TelstraTablet' => 'T-Hub2',
459
  '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'
@@ -475,7 +476,8 @@ class ai_Mobile_Detect
475
  // http://wifeng.cn/?r=blog&a=view&id=106
476
  // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx
477
  // http://msdn.microsoft.com/library/ms537503.aspx
478
- 'WindowsPhoneOS' => 'Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
 
479
  'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
480
  // http://en.wikipedia.org/wiki/MeeGo
481
  // @todo: research MeeGo in UAs
@@ -1075,7 +1077,7 @@ class ai_Mobile_Detect
1075
 
1076
  /**
1077
  * Search for a certain key in the rules array.
1078
- * If the key is found the try to match the corresponding
1079
  * regex against the User-Agent.
1080
  *
1081
  * @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.19
26
  */
27
 
28
  class ai_Mobile_Detect
66
  /**
67
  * Stores the version number of the current release.
68
  */
69
+ const VERSION = '2.8.19';
70
 
71
  /**
72
  * A type for the version() method indicating a string return value.
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|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
  // http://www.micromaxinfo.com/mobiles/smartphones
219
  // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$
220
  // @see #442
221
  'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)',
222
+ '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|SM-T533|SM-T113|SM-T335|SM-T715', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone.
223
  // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html
224
  'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI)\b',
225
  // Only the Surface tablets with Windows RT are considered mobile.
435
  'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b',
436
  // @todo http://www.lavamobiles.com/tablets-data-cards
437
  'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b',
438
+ 'AocTablet' => 'MW0811|MW0812|MW0922|MTK8382',
439
  // https://www.celkonmobiles.com/?_a=categoryphones&sid=2
440
  'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b',
441
  // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab
454
  // http://www.pocketbook-int.com/ru/support
455
  'PocketBookTablet' => 'Pocketbook',
456
  // http://www.tesco.com/direct/hudl/
457
+ 'Hudl' => 'Hudl HT7S3|Hudl 2',
458
  // http://www.telstra.com.au/home-phone/thub-2/
459
  'TelstraTablet' => 'T-Hub2',
460
  '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'
476
  // http://wifeng.cn/?r=blog&a=view&id=106
477
  // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx
478
  // http://msdn.microsoft.com/library/ms537503.aspx
479
+ // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
480
+ 'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;',
481
  'iOS' => '\biPhone.*Mobile|\biPod|\biPad',
482
  // http://en.wikipedia.org/wiki/MeeGo
483
  // @todo: research MeeGo in UAs
1077
 
1078
  /**
1079
  * Search for a certain key in the rules array.
1080
+ * If the key is found then try to match the corresponding
1081
  * regex against the User-Agent.
1082
  *
1083
  * @param string $key
js/ad-inserter.js CHANGED
@@ -79,7 +79,7 @@ jQuery(document).ready(function($) {
79
  $("#paragraph-settings-"+block).hide();
80
 
81
  $("#excerpt-settings-"+block).hide();
82
- $("#enabled-pages-"+block).hide();
83
 
84
  var display_type = '';
85
  $("select#display-type-"+block+" option:selected").each(function() {
@@ -92,9 +92,9 @@ jQuery(document).ready(function($) {
92
  $("#paragraph-settings-"+block).hide();
93
  $("#excerpt-settings-"+block).show();
94
  }
95
- if (display_type == "Before Excerpt" || display_type == "After Excerpt" || display_type == "Before Title" || display_type == "Widget" || $("#enable-php-call-"+block).is(":checked") || $("#enable-manual-"+block).is(":checked")) {
96
- $("#enabled-pages-"+block).show();
97
- }
98
 
99
  var display_for_devices = '';
100
  $("select#display-for-devices-"+block+" option:selected").each(function() {
79
  $("#paragraph-settings-"+block).hide();
80
 
81
  $("#excerpt-settings-"+block).hide();
82
+ // $("#enabled-pages-"+block).hide();
83
 
84
  var display_type = '';
85
  $("select#display-type-"+block+" option:selected").each(function() {
92
  $("#paragraph-settings-"+block).hide();
93
  $("#excerpt-settings-"+block).show();
94
  }
95
+ // if (display_type == "Before Excerpt" || display_type == "After Excerpt" || display_type == "Before Title" || display_type == "Widget" || $("#enable-php-call-"+block).is(":checked") || $("#enable-manual-"+block).is(":checked")) {
96
+ // $("#enabled-pages-"+block).show();
97
+ // }
98
 
99
  var display_for_devices = '';
100
  $("select#display-for-devices-"+block+" option:selected").each(function() {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: adsense, amazon, clickbank, ad, ads, html, javascript, php, code, widget, sidebar, responsive, rotating, banner, banner rotation, contextual, shortcodes, widgets, header, footer, users, logged in, not logged in, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, skip
5
  Requires at least: 3.0
6
  Tested up to: 4.4.2
7
- Stable tag: 1.6.0
8
  License: GPLv3
9
 
10
  Insert any HTML/Javascript/PHP code into Wordpress. Perfect for AdSense or contextual Amazon ads. 16 code blocks, many display options.
@@ -147,6 +147,8 @@ You can also copy complete Ad Inserter settings from one website to another. Go
147
 
148
  By default Ad Inserter exceptions on posts/pages are enabled only for administrators. You can define minimum user role for page/post Ad Inserter exceptions editing in Ad Inserter Settings (tab #).
149
 
 
 
150
  **WARNING:** Text selection, Copy and Paste functions with the syntax highlighting editor do not work on mobile devices. If you need these functions you can temporarily swich to **Simple editor** using the checkbox above the code box.
151
 
152
  == Installation ==
@@ -421,6 +423,10 @@ AD CODE RIGHT
421
 
422
  == Changelog ==
423
 
 
 
 
 
424
  = 1.6.1 =
425
  * Fixed bug: For shortcodes in posts the date was not checked
426
  * Fixed error with some templates "Call to undefined method is_main_query()"
@@ -582,6 +588,10 @@ AD CODE RIGHT
582
 
583
  == Upgrade Notice ==
584
 
 
 
 
 
585
  = 1.6.1 =
586
  Fixed bug: For shortcodes in posts the date was not checked;
587
  Fixed error with some templates "Call to undefined method is_main_query()";
4
  Tags: adsense, amazon, clickbank, ad, ads, html, javascript, php, code, widget, sidebar, responsive, rotating, banner, banner rotation, contextual, shortcodes, widgets, header, footer, users, logged in, not logged in, mobile, desktop, phone, tablet, custom css, category, tag, filter, url, skip
5
  Requires at least: 3.0
6
  Tested up to: 4.4.2
7
+ Stable tag: 1.6.1
8
  License: GPLv3
9
 
10
  Insert any HTML/Javascript/PHP code into Wordpress. Perfect for AdSense or contextual Amazon ads. 16 code blocks, many display options.
147
 
148
  By default Ad Inserter exceptions on posts/pages are enabled only for administrators. You can define minimum user role for page/post Ad Inserter exceptions editing in Ad Inserter Settings (tab #).
149
 
150
+ Default Ad Inserter plugin processing order is 99999. It is used to specify the order in which the plugin functions are executed. Lower numbers correspond with earlier execution. You can change this value if you have problems with the processing order of other plugins.
151
+
152
  **WARNING:** Text selection, Copy and Paste functions with the syntax highlighting editor do not work on mobile devices. If you need these functions you can temporarily swich to **Simple editor** using the checkbox above the code box.
153
 
154
  == Installation ==
423
 
424
  == Changelog ==
425
 
426
+ = 1.6.2 =
427
+ * Removed deprecated code (fixes PHP Fatal error Call to a member function get_display_type)
428
+ * Added support to change plugin processing priority
429
+
430
  = 1.6.1 =
431
  * Fixed bug: For shortcodes in posts the date was not checked
432
  * Fixed error with some templates "Call to undefined method is_main_query()"
588
 
589
  == Upgrade Notice ==
590
 
591
+ = 1.6.2 =
592
+ Removed deprecated code (fixes PHP Fatal error Call to a member function get_display_type);
593
+ Added support to change plugin processing priority
594
+
595
  = 1.6.1 =
596
  Fixed bug: For shortcodes in posts the date was not checked;
597
  Fixed error with some templates "Call to undefined method is_main_query()";
settings.php CHANGED
@@ -527,6 +527,10 @@ function print_settings_form (){
527
  </select>
528
  </div>
529
 
 
 
 
 
530
  <hr />
531
 
532
  <div style="padding: 0;">
527
  </select>
528
  </div>
529
 
530
+ <div style="padding:0px 0px 8px 16px;">
531
+ Plugin priority <input style="border-radius: 5px;" type="text" name="plugin_priority" value="<?php echo get_plugin_priority (); ?>" size="6" maxlength="6" />
532
+ </div>
533
+
534
  <hr />
535
 
536
  <div style="padding: 0;">