PluginProbe
WDesignKit – AI Templates, Widget Builder & MCP Workflow / 1.0.21
WDesignKit – AI Templates, Widget Builder & MCP Workflow v1.0.21
2.6.6 2.6.5 2.6.4 2.6.3 2.6.2 2.6.1 2.6.0 2.5.5 2.5.4 2.5.3 2.5.2 2.5.1 2.5.0 2.4.0 2.3.3 2.3.2 2.3.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 All 128 releases
wdesignkit / includes / class-wdkit-wdesignkit.php

class-wdkit-wdesignkit.php in WDesignKit – AI Templates, Widget Builder & MCP Workflow 1.0.21, at includes/class-wdkit-wdesignkit.php

171 lines 4.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The file that defines the core plugin class
4 *
5 * A class definition that includes attributes and functions used across both the
6 * public-facing side of the site and the admin area.
7 *
8 * @link https://posimyth.com/
9 * @since 1.0.0
10 *
11 * @package Wdesignkit
12 * @subpackage Wdesignkit/includes
13 */
14
15 namespace wdkit;
16
17 /**
18 * Exit if accessed directly.
19 * */
20 if ( ! defined( 'ABSPATH' ) ) {
21 exit;
22 }
23
24 if ( ! class_exists( 'Wdkit_Wdesignkit' ) ) {
25
26 /**
27 * It is wdesignkit Main Class
28 *
29 * @since 1.0.0
30 */
31 class Wdkit_Wdesignkit {
32
33 /**
34 * Member Variable
35 *
36 * @var instance
37 */
38 private static $instance;
39
40 /**
41 * Initiator
42 */
43 public static function get_instance() {
44 if ( ! isset( self::$instance ) ) {
45 self::$instance = new self();
46 }
47 return self::$instance;
48 }
49
50 /**
51 * Define the core functionality of the plugin.
52 */
53 public function __construct() {
54 /**Dont Move File Used For Create OWN WDkit Hooks*/
55 require_once WDKIT_INCLUDES . 'admin/class-wdkit-data-hooks.php';
56
57 register_activation_hook( WDKIT_FILE, array( __CLASS__, 'wdkit_activation' ) );
58 register_deactivation_hook( WDKIT_FILE, array( __CLASS__, 'wdkit_deactivation' ) );
59
60 add_action( 'plugins_loaded', array( $this, 'wdkit_plugin_loaded' ) );
61 }
62
63 /**
64 * Check Setting Panal switch On off
65 *
66 * @since 1.0.0
67 *
68 * @param string $type check builder type.
69 */
70 public static function wdkit_is_compatible( $type, $features_manager = '' ) {
71 $wkit_settings_panel = get_option( 'wkit_settings_panel', false );
72
73 if ( empty( $wkit_settings_panel ) ) {
74 do_action( 'wdkit_admin_create_default' );
75
76 return false;
77 }
78
79 $builder = ! empty( $wkit_settings_panel['builder'] ) ? $wkit_settings_panel['builder'] : false;
80 $template = ! empty( $wkit_settings_panel['template'] ) ? $wkit_settings_panel['template'] : false;
81 $b_d_type = false;
82 if ( 'elementor' === $type ) {
83 $b_d_type = ! empty( $wkit_settings_panel['elementor_builder'] ) ? $wkit_settings_panel['elementor_builder'] : false;
84 } elseif ( 'gutenberg' === $type ) {
85 $b_d_type = ! empty( $wkit_settings_panel['gutenberg_builder'] ) ? $wkit_settings_panel['gutenberg_builder'] : false;
86 } elseif ( 'bricks' === $type ) {
87 $b_d_type = ! empty( $wkit_settings_panel['bricks_builder'] ) ? $wkit_settings_panel['bricks_builder'] : false;
88 } elseif ( 'builder' === $type ) {
89 $b_d_type = $builder;
90 } elseif ( 'template' === $type ) {
91 $b_d_type = ! empty( $wkit_settings_panel['template'] ) ? $wkit_settings_panel['template'] : false;
92 } elseif ( 'gutenberg_template' === $type ) {
93 $b_d_type = ! empty( $wkit_settings_panel['gutenberg_template'] ) ? $wkit_settings_panel['gutenberg_template'] : false;
94 } elseif ( 'elementor_template' === $type ) {
95 $b_d_type = ! empty( $wkit_settings_panel['elementor_template'] ) ? $wkit_settings_panel['elementor_template'] : false;
96 } else {
97 $b_d_type = false;
98 }
99
100 if ( 'widget' === $features_manager && empty( $builder ) || empty( $b_d_type ) ) {
101 return false;
102 }else if( 'template' === $features_manager && empty( $template ) || empty( $b_d_type ) ){
103 return false;
104 }
105
106 return true;
107 }
108
109 /**
110 * Plugin Activation.
111 *
112 * @return void
113 */
114 public static function wdkit_activation() {
115 do_action( 'wdkit_admin_create_default' );
116 }
117
118 /**
119 * Plugin deactivation.
120 *
121 * @return void
122 */
123 public static function wdkit_deactivation() {
124 }
125
126 /**
127 * Files load plugin loaded.
128 *
129 * @return void
130 */
131 public function wdkit_plugin_loaded() {
132 $this->load_textdomain();
133 $this->wdkit_load_dependencies();
134 }
135
136 /**
137 * Load Text Domain.
138 * Text Domain : wdkit
139 */
140 public function load_textdomain() {
141 load_plugin_textdomain( 'wdesignkit', false, WDKIT_BDNAME . '/languages/' );
142 }
143
144 /**
145 * Load the required dependencies for this plugin.
146 *
147 * - Wdesignkit_Admin. Defines all hooks for the admin area.
148 * - Wdesignkit_Public. Defines all hooks for the public side of the site.
149 *
150 * @since 1.0.0
151 */
152 private function wdkit_load_dependencies() {
153
154 /**
155 * The class responsible for defining all actions that occur in the admin area.
156 */
157 require_once WDKIT_INCLUDES . 'admin/notices/class-wdkit-notice-main.php';
158
159 require_once WDKIT_INCLUDES . 'admin/class-wdkit-enqueue.php';
160 require_once WDKIT_INCLUDES . 'admin/class-wdesignkit-data-query.php';
161 require_once WDKIT_INCLUDES . 'admin/class-wdkit-depends-installer.php';
162 require_once WDKIT_INCLUDES . 'admin/class-api.php';
163
164 require_once WDKIT_INCLUDES . 'widget-load/widget-load-files.php';
165 }
166
167 }
168
169 Wdkit_Wdesignkit::get_instance();
170 }
171