-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
84 lines (61 loc) · 2.84 KB
/
plugin.php
File metadata and controls
84 lines (61 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* Plugin Name: CM Theme — Addon: Ticketpool
* Plugin URI: https://github.com/mdibella-dev/cm-theme-addon-ticketpool
* Description: A system to participate from a pool of sponsored tickets.
* Author: Marco Di Bella
* Author URI: https://www.marcodibella.de
* License: MIT License
* Requires at least: 5
* Tested up to: 6.8
* Requires PHP: 7
* Version: 2.0.2
* Text Domain: cm-theme-addon-ticketpool
*
*
* @author Marco Di Bella
* @package cm-theme-addon-ticketpool
*/
namespace cm_theme_addon_ticketpool;
/** Prevent direct access */
defined( 'ABSPATH' ) or exit;
/** Variables and definitions */
define( __NAMESPACE__ . '\PLUGIN_VERSION', '2.0.2' );
define( __NAMESPACE__ . '\PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( __NAMESPACE__ . '\PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Database table names
define( __NAMESPACE__ . '\TABLE_POOL', 'cmkk_contingent_pool' );
define( __NAMESPACE__ . '\TABLE_USER', 'cmkk_contingent_user' );
// WordPress options
define( 'OPTION_MAIL_SUBJECT', 'cm_theme_addon_ticketpool_mail_subject' );
define( 'OPTION_MAIL_MESSAGE', 'cm_theme_addon_ticketpool_mail_message' );
// Status codes
define( __NAMESPACE__ . '\STATUS_USER_ADDED', 100 );
define( __NAMESPACE__ . '\STATUS_NOTHING_FREE', 200 );
define( __NAMESPACE__ . '\STATUS_USER_FIELDS_EMPTY', 201 );
define( __NAMESPACE__ . '\STATUS_USER_EMAIL_MALFORMED', 202 );
define( __NAMESPACE__ . '\STATUS_USER_EMAIL_IN_USE', 203 );
define( __NAMESPACE__ . '\STATUS_CANT_STORE_USER', 204 );
// Notice codes
define( __NAMESPACE__ . '\NOTICE_EMAIL_TEMPLATE_UPDATED', 100 );
define( __NAMESPACE__ . '\NOTICE_EMAIL_TEMPLATE_RESET', 101 );
define( __NAMESPACE__ . '\NOTICE_TICKET_CONTINGENT_ADDED', 102 );
define( __NAMESPACE__ . '\NOTICE_TABLE_RESET', 103 );
define( __NAMESPACE__ . '\NOTICE_EMPTY_FIELDS', 104 );
// Folder to store export files
define( __NAMESPACE__ . '\EXPORT_FOLDER', 'cm-kk' );
// Workaround: currently the plugin supports only the CM event with the number 1 (Q&D)
define( __NAMESPACE__ . '\EVENT_ID', '1' );
// Workaround
define( __NAMESPACE__ . '\TARGET_MAIL', 'kongress@pwg-seminare.de' );
/** Include files */
require_once PLUGIN_DIR . 'includes/shortcodes/shortcode-form.php';
require_once PLUGIN_DIR . 'includes/classes/index.php';
require_once PLUGIN_DIR . 'includes/backend/index.php';
require_once PLUGIN_DIR . 'includes/core.php';
require_once PLUGIN_DIR . 'includes/backend.php';
require_once PLUGIN_DIR . 'includes/setup.php';
/** Add hooks */
register_activation_hook( __FILE__, __NAMESPACE__ . '\plugin_activation' );
register_deactivation_hook( __FILE__, __NAMESPACE__ . '\plugin_deactivation' );
register_uninstall_hook( __FILE__, __NAMESPACE__ . '\plugin_uninstall' );