PluginProbe
MakeCommerce for WooCommerce / 4.0.3
MakeCommerce for WooCommerce v4.0.3
4.1.0 4.0.8 trunk 1.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 All 96 releases
makecommerce / includes / activator.php

activator.php in MakeCommerce for WooCommerce 4.0.3, at includes/activator.php

63 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MakeCommerce;
4
5 /**
6 * Fired during plugin activation.
7 *
8 * This class defines all code necessary to run during the plugin's activation.
9 *
10 * @since 3.0.0
11 * @package Makecommerce
12 * @subpackage Makecommerce/includes
13 * @author Maksekeskus AS <support@maksekeskus.ee>
14 */
15
16 class Activator {
17
18 /**
19 * Short Description. (use period)
20 *
21 * Long Description.
22 *
23 * @since 3.0.0
24 */
25 public static function activate() {
26
27 self::create_tables();
28
29 }
30
31 /**
32 * Creates db tables.
33 *
34 * @since 3.0.12
35 */
36 public static function create_tables() {
37 global $wpdb;
38
39 //Create table if it doesn't already exist
40 $wpdb->query
41 ("
42 CREATE TABLE IF NOT EXISTS
43 `" . $wpdb->prefix . MAKECOMMERCE_TABLENAME . "`
44 (
45 `id` mediumint(9) NOT NULL AUTO_INCREMENT,
46 `type` varchar(10) NOT NULL,
47 `country` char(2) NOT NULL,
48 `name` varchar(25) NOT NULL,
49 `url` varchar(250) NOT NULL,
50 `logo_url` varchar(250),
51 `channel` varchar(250),
52 `display_name` varchar(250),
53 `min_amount` mediumint(9),
54 `max_amount` mediumint(9),
55 PRIMARY KEY `id` (`id`)
56 )
57 " . $wpdb->get_charset_collate() . ";
58 ");
59
60 }
61
62 }
63