Exemple #1
0
 public function saveUsageStat($code)
 {
     $query = '';
     $update = dbGmp::exist('@__usage_stat', 'code', $code);
     if ($update) {
         $query .= 'UPDATE';
     } else {
         $query .= 'INSERT INTO';
     }
     $query .= ' @__usage_stat SET code = "' . $code . '", visits = visits + 1';
     if ($update) {
         $query .= ' WHERE code = "' . $code . '"';
     }
     return dbGmp::query($query);
 }
Exemple #2
0
 public static function init()
 {
     global $wpdb;
     $wpPrefix = $wpdb->prefix;
     /* add to 0.0.3 Versiom */
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     $current_version = get_option($wpPrefix . GMP_DB_PREF . 'db_version', 0);
     $installed = (int) get_option($wpPrefix . GMP_DB_PREF . 'db_installed', 0);
     /**
      * modules 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "modules")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "modules` (\r\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t  `code` varchar(64) NOT NULL,\r\n\t\t\t  `active` tinyint(1) NOT NULL DEFAULT '0',\r\n\t\t\t  `type_id` smallint(3) NOT NULL DEFAULT '0',\r\n\t\t\t  `params` text,\r\n\t\t\t  `has_tab` tinyint(1) NOT NULL DEFAULT '0',\r\n\t\t\t  `label` varchar(128) DEFAULT NULL,\r\n\t\t\t  `description` text,\r\n\t\t\t  `ex_plug_dir` varchar(255) DEFAULT NULL,\r\n\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t  UNIQUE INDEX `code` (`code`)\r\n\t\t\t) DEFAULT CHARSET=utf8;");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "modules` (id, code, active, type_id, params, has_tab, label, description) VALUES\r\n\t\t\t\t(NULL, 'adminmenu',1,1,'',0,'Admin Menu',''),\r\n\t\t\t\t(NULL, 'options',1,1,'',1,'Options',''),\r\n\t\t\t\t(NULL, 'user',1,1,'',1,'Users',''),\r\n\t\t\t\t(NULL, 'templates',1,1,'',1,'Templates for Plugin',''),\r\n\r\n\t\t\t\t(NULL, 'shortcodes', 1, 6, '', 0, 'Shortcodes', 'Shortcodes data'),\r\n\t\t\t\t(NULL, 'gmap', 1, 1, '',1, 'Gmap', 'Gmap'),\r\n\t\t\t\t(NULL, 'marker', 1, 1, '', 0, 'Markers', 'Google Maps Markers'),\r\n\t\t\t\t(NULL, 'marker_groups', 1, 1, '', 0, 'Marker Gropus', 'Marker Groups'),                  \r\n\t\t\t\t(NULL, 'supsystic_promo', 1, 1, '', 0, 'Promo', 'Promo'),\r\n\t\t\t\t(NULL, 'icons', 1, 1, '', 1, 'Marker Icons', 'Marker Icons'),\r\n\t\t\t\t(NULL, 'mail', 1, 1, '', 1, 'mail', 'mail');");
     }
     if (dbGmp::exist('@__modules', 'code', 'promo')) {
         dbGmp::query('UPDATE @__modules SET code = "supsystic_promo" WHERE code = "promo"');
     }
     if (!dbGmp::exist('@__modules', 'code', 'mail')) {
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "modules` (id, code, active, type_id, params, has_tab, label, description) VALUES\r\n\t\t\t\t(NULL, 'mail', 1, 1, '', 1, 'mail', 'mail');");
     }
     if (!dbGmp::exist('@__modules', 'code', 'supsystic_promo')) {
         dbGmp::query("INSERT INTO `@__modules` (id, code, active, type_id, params, has_tab, label, description) VALUES\r\n\t\t\t\t(NULL, 'supsystic_promo', 1, 1, '', 1, 'supsystic_promo', 'supsystic_promo');");
     }
     /**
      *  modules_type 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "modules_type")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "modules_type` (\r\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t  `label` varchar(64) NOT NULL,\r\n\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t) AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "modules_type` VALUES\r\n\t\t\t  (1,'system'),\r\n\t\t\t  (4,'widget'),\r\n\t\t\t  (6,'addons'),\r\n\t\t\t  (7,'template')");
     }
     /**
      * options 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "options")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "options` (\r\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t  `code` varchar(64) CHARACTER SET latin1 NOT NULL,\r\n\t\t\t  `value` text NULL,\r\n\t\t\t  `label` varchar(128) CHARACTER SET latin1 DEFAULT NULL,\r\n\t\t\t  `description` text CHARACTER SET latin1,\r\n\t\t\t  `htmltype_id` smallint(2) NOT NULL DEFAULT '1',\r\n\t\t\t  `params` text NULL,\r\n\t\t\t  `cat_id` mediumint(3) DEFAULT '0',\r\n\t\t\t  `sort_order` mediumint(3) DEFAULT '0',\r\n\t\t\t  `value_type` varchar(16) CHARACTER SET latin1 DEFAULT NULL,\r\n\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t  KEY `id` (`id`),\r\n\t\t\t  UNIQUE INDEX `code` (`code`)\r\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("insert into `" . $wpPrefix . GMP_DB_PREF . "options` (  `code` ,  `value` ,  `label` ) \r\n\t\t\t\t\tVALUES ( 'save_statistic',  '0',  'Send statistic')");
         dbGmp::query("insert into `@__options` (`code`,`value`,`label`) VALUES\r\n\t\t\t('infowindow_size','" . utilsGmp::serialize(array('width' => '100', 'height' => '100')) . "','Info Window Size')");
     }
     /* options categories */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "options_categories")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "options_categories` (\r\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t  `label` varchar(128) NOT NULL,\r\n\t\t\t  PRIMARY KEY (`id`),\r\n\t\t\t  KEY `id` (`id`)\r\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "options_categories` VALUES\r\n\t\t\t\t(1, 'General'),\r\n\t\t\t\t(2, 'Template'),\r\n\t\t\t\t(3, 'Subscribe'),\r\n\t\t\t\t(4, 'Social');");
     }
     /*
      * Create table for map
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "maps")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "maps` (\r\n\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t`title` varchar(125) CHARACTER SET utf8  NOT NULL,\r\n\t\t\t\t`description` text CHARACTER SET utf8 NULL,\r\n\t\t\t\t`params` text NULL,\r\n\t\t\t\t`html_options` text NOT NULL,\r\n\t\t\t\t`create_date` datetime,\r\n\t\t\t\tPRIMARY KEY (`id`),\r\n\t\t\t\tUNIQUE INDEX `id` (`id`)\r\n\t\t\t  ) DEFAULT CHARSET=utf8");
     }
     /**
      * Create table for markers    
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "markers")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "markers" . "` (\r\n\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t`title` varchar(125) CHARACTER SET utf8 NOT NULL,\r\n\t\t\t\t\t`description` text CHARACTER SET utf8 NULL,\r\n\t\t\t\t\t`coord_x` varchar(30) CHARACTER SET utf8 NOT NULL,\r\n\t\t\t\t\t`coord_y` varchar(30) CHARACTER SET utf8 NOT NULL,\r\n\t\t\t\t\t`icon` int(11),\r\n\t\t\t\t\t`map_id` int(11),\r\n\t\t\t\t\t`marker_group_id` int(11),\r\n\t\t\t\t\t`address` text CHARACTER SET utf8,\r\n\t\t\t\t\t`animation` int(1),\r\n\t\t\t\t\t`create_date` datetime,\r\n\t\t\t\t\t`params` text  CHARACTER SET utf8 NOT NULL,\r\n\t\t\t\t\t`sort_order` tinyint(1) NOT NULL DEFAULT '0',\r\n\t\t\t\t\tPRIMARY KEY (`id`)\r\n\t\t\t\t) DEFAULT CHARSET=utf8");
     }
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "markers", 'sort_order')) {
         dbGmp::query("ALTER TABLE `@__markers` ADD COLUMN `sort_order` tinyint(1) NOT NULL DEFAULT '0';");
     }
     /**
      * Create table for marker Icons
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "icons")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "icons" . "` (\r\n\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t`title` varchar(100) CHARACTER SET utf8,   \r\n\t\t\t\t`description` text CHARACTER SET utf8,   \r\n\t\t\t\t`path` varchar(250) CHARACTER SET utf8,   \r\n\t\t\t\t PRIMARY KEY (`id`)\r\n\t\t\t) DEFAULT CHARSET=utf8");
     }
     /**
      * Create table for marker groups
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "marker_groups")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "marker_groups" . "` (\r\n\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t`title` varchar(250) CHARACTER SET utf8,\r\n\t\t\t\t\t`description` text CHARACTER SET utf8,\r\n\t\t\t\t PRIMARY KEY (`id`)\r\n\t\t\t\t  ) DEFAULT CHARSET=utf8");
     }
     $markerGroupsClearedInvalid = get_option($wpPrefix . GMP_DB_PREF . 'mg_cleared_inv', 0);
     if (!$markerGroupsClearedInvalid) {
         dbGmp::query('UPDATE @__markers SET marker_group_id = 0 WHERE marker_group_id = 1');
         // This was wrong update in markers table before - fix this one time before update plugin
         update_option($wpPrefix . GMP_DB_PREF . 'mg_cleared_inv', 1);
     }
     /**
      * Plugin usage statistics
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "usage_stat")) {
         dbDelta("CREATE TABLE `" . $wpPrefix . GMP_DB_PREF . "usage_stat` (\r\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\r\n\t\t\t  `code` varchar(64) NOT NULL,\r\n\t\t\t  `visits` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t  `spent_time` int(11) NOT NULL DEFAULT '0',\r\n\t\t\t  `modify_timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\r\n\t\t\t  UNIQUE INDEX `code` (`code`),\r\n\t\t\t  PRIMARY KEY (`id`)\r\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "usage_stat` (code, visits) VALUES ('installed', 1)");
     }
     update_option($wpPrefix . GMP_DB_PREF . 'db_version', GMP_VERSION_PLUGIN);
     add_option($wpPrefix . GMP_DB_PREF . 'db_installed', 1);
     installerDbUpdaterGmp::runUpdate();
 }
Exemple #3
0
 public static function init()
 {
     global $wpdb;
     $wpPrefix = $wpdb->prefix;
     /* add to 0.0.3 Versiom */
     //$start = microtime(true);					// Speed debug info
     //$queriesCountStart = $wpdb->num_queries;	// Speed debug info
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     $current_version = get_option($wpPrefix . GMP_DB_PREF . 'db_version', 0);
     $installed = (int) get_option($wpPrefix . GMP_DB_PREF . 'db_installed', 0);
     /**
      * htmltype 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "htmltype")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "htmltype` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `label` varchar(32) NOT NULL,\n\t\t\t  `description` varchar(255) NOT NULL,\n\t\t\t  PRIMARY KEY (`id`),\n\t\t\t  UNIQUE INDEX `label` (`label`)\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "htmltype` VALUES\n\t\t\t\t(1, 'text', 'Text'),\n\t\t\t\t(2, 'password', 'Password'),\n\t\t\t\t(3, 'hidden', 'Hidden'),\n\t\t\t\t(4, 'checkbox', 'Checkbox'),\n\t\t\t\t(5, 'checkboxlist', 'Checkboxes'),\n\t\t\t\t(6, 'datepicker', 'Date Picker'),\n\t\t\t\t(7, 'submit', 'Button'),\n\t\t\t\t(8, 'img', 'Image'),\n\t\t\t\t(9, 'selectbox', 'Drop Down'),\n\t\t\t\t(10, 'radiobuttons', 'Radio Buttons'),\n\t\t\t\t(11, 'countryList', 'Countries List'),\n\t\t\t\t(12, 'selectlist', 'List'),\n\t\t\t\t(13, 'countryListMultiple', 'Country List with posibility to select multiple countries'),\n\t\t\t\t(14, 'block', 'Will show only value as text'),\n\t\t\t\t(15, 'statesList', 'States List'),\n\t\t\t\t(16, 'textFieldsDynamicTable', 'Dynamic table - multiple text options set'),\n\t\t\t\t(17, 'textarea', 'Textarea'),\n\t\t\t\t(18, 'checkboxHiddenVal', 'Checkbox with Hidden field')");
     }
     /**
      * modules 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "modules")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "modules` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `code` varchar(64) NOT NULL,\n\t\t\t  `active` tinyint(1) NOT NULL DEFAULT '0',\n\t\t\t  `type_id` smallint(3) NOT NULL DEFAULT '0',\n\t\t\t  `params` text,\n\t\t\t  `has_tab` tinyint(1) NOT NULL DEFAULT '0',\n\t\t\t  `label` varchar(128) DEFAULT NULL,\n\t\t\t  `description` text,\n\t\t\t  `ex_plug_dir` varchar(255) DEFAULT NULL,\n\t\t\t  PRIMARY KEY (`id`),\n\t\t\t  UNIQUE INDEX `code` (`code`)\n\t\t\t) DEFAULT CHARSET=utf8;");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "modules` (id, code, active, type_id, params, has_tab, label, description) VALUES\n\t\t\t\t(NULL, 'adminmenu',1,1,'',0,'Admin Menu',''),\n\t\t\t\t(NULL, 'options',1,1,'',1,'Options',''),\n\t\t\t\t(NULL, 'user',1,1,'',1,'Users',''),\n\t\t\t\t(NULL, 'templates',1,1,'',1,'Templates for Plugin',''),\n\n\t\t\t\t(NULL, 'shortcodes', 1, 6, '', 0, 'Shortcodes', 'Shortcodes data'),\n\t\t\t\t(NULL, 'gmap', 1, 1, '',1, 'Gmap', 'Gmap'),\n\t\t\t\t(NULL, 'marker', 1, 1, '', 0, 'Markers', 'Google Maps Markers'),\n\t\t\t\t(NULL, 'marker_groups', 1, 1, '', 0, 'Marker Gropus', 'Marker Groups'),                  \n\t\t\t\t(NULL, 'promo_ready', 1, 1, '', 0, 'Promo Ready', 'Promo Ready'),                  \n\t\t\t\t(NULL, 'icons', 1, 1, '', 1, 'Marker Icons', 'Marker Icons');");
     }
     /**
      *  modules_type 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "modules_type")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "modules_type` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `label` varchar(64) NOT NULL,\n\t\t\t  PRIMARY KEY (`id`)\n\t\t\t) AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "modules_type` VALUES\n\t\t\t  (1,'system'),\n\t\t\t  (2,'payment'),\n\t\t\t  (3,'shipping'),\n\t\t\t  (4,'widget'),\n\t\t\t  (5,'product_extra'),\n\t\t\t  (6,'addons'),\n\t\t\t  (7,'template')");
     }
     /**
      * options 
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "options")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "options` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `code` varchar(64) CHARACTER SET latin1 NOT NULL,\n\t\t\t  `value` text NULL,\n\t\t\t  `label` varchar(128) CHARACTER SET latin1 DEFAULT NULL,\n\t\t\t  `description` text CHARACTER SET latin1,\n\t\t\t  `htmltype_id` smallint(2) NOT NULL DEFAULT '1',\n\t\t\t  `params` text NULL,\n\t\t\t  `cat_id` mediumint(3) DEFAULT '0',\n\t\t\t  `sort_order` mediumint(3) DEFAULT '0',\n\t\t\t  `value_type` varchar(16) CHARACTER SET latin1 DEFAULT NULL,\n\t\t\t  PRIMARY KEY (`id`),\n\t\t\t  KEY `id` (`id`),\n\t\t\t  UNIQUE INDEX `code` (`code`)\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("`" . $wpPrefix . GMP_DB_PREF . "options` (  `code` ,  `value` ,  `label` ) \n\t\t\t\t\tVALUES ( 'save_statistic',  '0',  'Send statistic')");
     }
     $eol = "\n";
     /* options categories */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "options_categories")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "options_categories` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `label` varchar(128) NOT NULL,\n\t\t\t  PRIMARY KEY (`id`),\n\t\t\t  KEY `id` (`id`)\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "options_categories` VALUES\n\t\t\t\t(1, 'General'),\n\t\t\t\t(2, 'Template'),\n\t\t\t\t(3, 'Subscribe'),\n\t\t\t\t(4, 'Social');");
     }
     /*
      * Create table for map
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "maps")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "maps` (\n\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t`title` varchar(125) CHARACTER SET utf8  NOT NULL,\n\t\t\t\t`description` text CHARACTER SET utf8 NULL,\n\t\t\t\t`params` text NULL,\n\t\t\t\t`html_options` text NOT NULL,\n\t\t\t\t`create_date` datetime,\n\t\t\t\tPRIMARY KEY (`id`),\n\t\t\t\tUNIQUE INDEX `id` (`id`)\n\t\t\t  ) DEFAULT CHARSET=utf8");
     }
     /**
      * Create table for markers    
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "markers")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "markers" . "` (\n\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t`title` varchar(125) CHARACTER SET utf8  NOT NULL,\n\t\t\t\t\t`description` text CHARACTER SET utf8 NULL,\n\t\t\t\t\t`coord_x` varchar(30) NOT NULL,\n\t\t\t\t\t`coord_y` varchar(30) NOT NULL,\n\t\t\t\t\t`icon` int(11),\n\t\t\t\t\t`map_id` int(11),\n\t\t\t\t\t`marker_group_id` int(11),\n\t\t\t\t\t`address` text,\n\t\t\t\t\t`animation` int(1),\n\t\t\t\t\t`create_date` datetime,\n\t\t\t\t\t`params` text  CHARACTER SET utf8  NOT NULL,\n\t\t\t\t\tPRIMARY KEY (`id`)\n\t\t\t\t\t)");
     }
     /**
      * Create table for marker Icons
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "icons")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "icons" . "` (\n\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t`title` varchar(100) CHARACTER SET utf8,   \n\t\t\t\t\t`description` text CHARACTER SET utf8,   \n\t\t\t\t\t`path` varchar(250) CHARACTER SET utf8,   \n\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t)");
     }
     /**
      * Create table for marker groups
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "marker_groups")) {
         dbDelta("CREATE TABLE IF NOT EXISTS `" . $wpPrefix . GMP_DB_PREF . "marker_groups" . "` (\n\t\t\t\t\t`id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t`title` varchar(250) CHARACTER SET utf8,\n\t\t\t\t\t`description` text CHARACTER SET utf8,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t  )");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "marker_groups` VALUES('null', 'Default Group','Default Group');");
     }
     /*
      * Create table for statistic
      * 
      */
     /**
      * Plugin usage statistics
      */
     if (!dbGmp::exist($wpPrefix . GMP_DB_PREF . "usage_stat")) {
         dbDelta("CREATE TABLE `" . $wpPrefix . GMP_DB_PREF . "usage_stat` (\n\t\t\t  `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t  `code` varchar(64) NOT NULL,\n\t\t\t  `visits` int(11) NOT NULL DEFAULT '0',\n\t\t\t  `spent_time` int(11) NOT NULL DEFAULT '0',\n\t\t\t  `modify_timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n\t\t\t  UNIQUE INDEX `code` (`code`),\n\t\t\t  PRIMARY KEY (`id`)\n\t\t\t) DEFAULT CHARSET=utf8");
         dbGmp::query("INSERT INTO `" . $wpPrefix . GMP_DB_PREF . "usage_stat` (code, visits) VALUES ('installed', 1)");
     }
     update_option($wpPrefix . GMP_DB_PREF . 'db_version', GMP_VERSION);
     add_option($wpPrefix . GMP_DB_PREF . 'db_installed', 1);
     dbGmp::query("UPDATE `" . $wpPrefix . GMP_DB_PREF . "options` SET value = '" . GMP_VERSION . "' WHERE code = 'version' LIMIT 1");
     installerDbUpdaterGmp::runUpdate();
     //$time = microtime(true) - $start;	// Speed debug info
 }
 public static function update_109()
 {
     if (!dbGmp::exist('@__modules', 'code', 'gmap_widget')) {
         dbGmp::query("INSERT INTO `@__modules` (id, code, active, type_id, params, has_tab, label, description)\n\t\t\t\tVALUES (NULL, 'gmap_widget', 1, 1, '', 0, 'gmap_widget', 'gmap_widget')");
     }
 }