PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 3.3.8
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v3.3.8
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / supportcandy.php

supportcandy.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 3.3.8, at supportcandy.php

177 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // phpcs:ignore
2 /**
3 * Plugin Name: SupportCandy
4 * Plugin URI: https://supportcandy.net/
5 * Description: Easy & Powerful support ticket system for WordPress
6 * Version: 3.3.8
7 * Author: SupportCandy
8 * Author URI: https://wordpress.org/plugins/supportcandy/
9 * Requires at least: 5.6
10 * Requires PHP: 7.4
11 * Tested up to: 6.8
12 * Text Domain: supportcandy
13 * Domain Path: /i18n
14 * License: GPLv3 or later
15 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
16 */
17
18 if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
19 return;
20 }
21
22 if ( ! defined( 'ABSPATH' ) ) {
23 exit; // Exit if accessed directly!
24 }
25
26 if ( ! class_exists( 'PSM_Support_Candy' ) ) :
27
28 final class PSM_Support_Candy {
29
30 /**
31 * Plugin version
32 *
33 * @var string
34 */
35 public static $version = '3.3.8';
36
37 /**
38 * Database version
39 *
40 * @var string
41 */
42 public static $db_version = '3.0';
43
44 /**
45 * Constructor for main class
46 */
47 public static function init() {
48
49 self::define_constants();
50 add_action( 'init', array( __CLASS__, 'load_textdomain' ), 1 );
51 self::load_files();
52 }
53
54 /**
55 * Defines global constants that can be availabel anywhere in WordPress
56 *
57 * @return void
58 */
59 public static function define_constants() {
60
61 self::define( 'WPSC_STORE_URL', 'https://supportcandy.net' );
62 self::define( 'WPSC_PLUGIN_FILE', __FILE__ );
63 self::define( 'WPSC_ABSPATH', __DIR__ . '/' );
64 self::define( 'WPSC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
65 self::define( 'WPSC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
66 self::define( 'WPSC_VERSION', self::$version );
67 self::define( 'WPSC_DB_VERSION', self::$db_version );
68 }
69
70 /**
71 * Loads internationalization strings
72 *
73 * @return void
74 */
75 public static function load_textdomain() {
76
77 $locale = apply_filters( 'plugin_locale', get_locale(), 'supportcandy' );
78 load_textdomain( 'supportcandy', WP_LANG_DIR . '/supportcandy/supportcandy-' . $locale . '.mo' );
79 load_plugin_textdomain( 'supportcandy', false, plugin_basename( __DIR__ ) . '/i18n' );
80 }
81
82 /**
83 * Load all classes
84 *
85 * @return void
86 */
87 private static function load_files() {
88
89 // Load installation.
90 include_once WPSC_ABSPATH . 'class-wpsc-installation.php';
91 include_once WPSC_ABSPATH . 'global-functions.php';
92
93 // Return if installation is in progress.
94 if ( defined( 'WPSC_INSTALLING' ) ) {
95 return;
96 }
97
98 // Database upgrade functionality.
99 if ( defined( 'WPSC_DB_UPGRADING' ) ) {
100
101 include_once WPSC_ABSPATH . 'includes/class-wpsc-sc-upgrade.php';
102
103 switch ( WPSC_Installation::$current_db_version ) {
104
105 case '1.0':
106 include_once WPSC_ABSPATH . 'upgrade/class-wpsc-upgrade-db-v1.php';
107 break;
108
109 case '2.0':
110 include_once WPSC_ABSPATH . 'upgrade/class-wpsc-upgrade-db-v2.php';
111 break;
112 }
113
114 // do not load further files.
115 return;
116 }
117
118 $advanced = get_option( 'wpsc-ms-advanced-settings' );
119
120 // Load common classes.
121 foreach ( glob( WPSC_ABSPATH . 'includes/*.php' ) as $filename ) {
122 include_once $filename;
123 }
124
125 // Load custom field types.
126 foreach ( glob( WPSC_ABSPATH . 'includes/custom-field-types/*.php' ) as $filename ) {
127 include_once $filename;
128 }
129
130 // Load models.
131 foreach ( glob( WPSC_ABSPATH . 'includes/models/*.php' ) as $filename ) {
132 include_once $filename;
133 }
134
135 // Load rest api classes.
136 if ( $advanced['rest-api'] ) {
137 foreach ( glob( WPSC_ABSPATH . 'includes/rest-api/*.php' ) as $filename ) {
138 include_once $filename;
139 }
140 }
141
142 // Load framework.
143 if ( ! ( defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) ) {
144 foreach ( glob( WPSC_ABSPATH . 'framework/*.php' ) as $filename ) {
145 include_once $filename;
146 }
147 }
148
149 // Load classes that is related to admin section.
150 foreach ( glob( WPSC_ABSPATH . 'includes/admin/*.php' ) as $filename ) {
151 include_once $filename;
152 }
153
154 // Load classes that is related to frontend section.
155 foreach ( glob( WPSC_ABSPATH . 'includes/frontend/*.php' ) as $filename ) {
156 include_once $filename;
157 }
158 }
159
160 /**
161 * Define constants
162 *
163 * @param string $name - name of global constant.
164 * @param string $value - value of constant.
165 * @return void
166 */
167 private static function define( $name, $value ) {
168
169 if ( ! defined( $name ) ) {
170 define( $name, $value );
171 }
172 }
173 }
174 endif;
175
176 PSM_Support_Candy::init();
177