PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 3.5.4
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v3.5.4
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 / deactivation-feedback / class-psm-dfr.php

class-psm-dfr.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 3.5.4, at deactivation-feedback/class-psm-dfr.php

77 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PSM Deactivation Feedback Framework
4 *
5 * @package PSM_DFR
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 if ( class_exists( 'PSM_DFR', false ) ) {
13 return;
14 }
15
16 final class PSM_DFR {
17
18 /**
19 * Registered plugins.
20 *
21 * @var array
22 */
23 private static $plugins = array();
24
25 /**
26 * Framework booted.
27 *
28 * @var bool
29 */
30 private static $booted = false;
31
32 /**
33 * Register plugin.
34 *
35 * @param array $config Plugin configuration.
36 *
37 * @return void
38 */
39 public static function init( $config ) {
40
41 $defaults = array(
42 'plugin_file' => '',
43 'plugin_name' => '',
44 'plugin_version' => '',
45 'endpoint' => '',
46 'api_key' => '',
47 'reasons' => array(),
48 );
49
50 $config = wp_parse_args( $config, $defaults );
51
52 if ( empty( $config['plugin_file'] ) ) {
53 return;
54 }
55
56 self::$plugins[ $config['plugin_file'] ] = $config;
57
58 if ( self::$booted ) {
59 return;
60 }
61
62 self::$booted = true;
63
64 require_once __DIR__ . '/class-psm-dfr-admin.php';
65 require_once __DIR__ . '/class-psm-dfr-ajax.php';
66 }
67
68 /**
69 * Get plugins.
70 *
71 * @return array
72 */
73 public static function get_plugins() {
74 return self::$plugins;
75 }
76 }
77