-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkb-addon-for-visual-composer.php
More file actions
91 lines (76 loc) · 2.45 KB
/
kb-addon-for-visual-composer.php
File metadata and controls
91 lines (76 loc) · 2.45 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
85
86
87
88
89
90
91
<?php
/**
* Plugin Name: KB Addon For WPBakery Page Builder
* Plugin URI: https://1.envato.market/bkbm-wp
* Description: Manage KB categories, tags, ask a question form, search box, tabs from WPBakery Page Builder.
* Author: Mahbub Alam Khan
* Version: 2.1.0
* Author URI: https://bluewindlab.net
* WP Requires at least: 6.0+
* Text Domain: bkb_vc
* Domain Path: /languages/
*
* @package KAFWPB
* @author Mahbub Alam Khan
* @license GPL-2.0+
* @link https://codecanyon.net/user/xenioushk
* @copyright 2025 BlueWindLab
*/
namespace KAFWPB;
// security check.
defined( 'ABSPATH' ) || die( 'Unauthorized access' );
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
// Load the plugin constants
if ( file_exists( __DIR__ . '/includes/Helpers/DependencyManager.php' ) ) {
require_once __DIR__ . '/includes/Helpers/DependencyManager.php';
Helpers\DependencyManager::register();
}
use KAFWPB\Base\Activate;
use KAFWPB\Base\Deactivate;
/**
* Function to handle the activation of the plugin.
*
* @return void
*/
function activate_plugin() { // phpcs:ignore
$activate = new Activate();
$activate->activate();
}
/**
* Function to handle the deactivation of the plugin.
*
* @return void
*/
function deactivate_plugin() { // phpcs:ignore
Deactivate::deactivate();
}
register_activation_hook( __FILE__, __NAMESPACE__ . '\\activate_plugin' );
register_deactivation_hook( __FILE__, __NAMESPACE__ . '\\deactivate_plugin' );
/**
* Function to handle the initialization of the plugin.
*
* @return void
*/
function init_kafwpb() {
// Check if the parent plugin installed.
if ( ! class_exists( 'BwlKbManager\\Init' ) ) {
add_action( 'admin_notices', [ Helpers\DependencyManager::class, 'notice_missing_main_plugin' ] );
return;
}
// Check if the wp bakery page builder plugin installed.
if ( ! defined( 'WPB_VC_VERSION' ) ) {
add_action( 'admin_notices', [ Helpers\DependencyManager::class, 'notice_missing_wpb_plugin' ] );
return;
}
if ( class_exists( 'KAFWPB\\Init' ) ) {
// Check the required minimum version of the parent plugin.
if ( ! ( Helpers\DependencyManager::check_minimum_version_requirement_status() ) ) {
add_action( 'admin_notices', [ Helpers\DependencyManager::class, 'notice_min_version_main_plugin' ] );
return;
}
Init::register_services();
}
}
add_action( 'init', __NAMESPACE__ . '\\init_kafwpb' );