PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 2.3.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v2.3.5
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
← All changes | betterdocs.php +82 -62 4.9.02.3.5 View file →
@@ -2,12 +2,10 @@
2 2
3 3 /**
4 4 * Plugin Name: BetterDocs
5 5 * Plugin URI: https://betterdocs.co/
6 - * Description: Create stunning Knowledge base & FAQs for your WordPress website and reduce support pressure with the help of BetterDocs. Get access to amazing templates and create fully customizable KB with AI Write.
7 - * Version: 4.9.0
8 - * Requires at least: 6.4
9 - * Requires PHP: 7.4
6 + * Description: Create stunning Knowledge base for your WordPress website and reduce support pressure with the help of BetterDocs. Get access to amazing templates and create fully customizable KB within minutes.
7 + * Version: 2.3.5
10 8 * Author: WPDeveloper
11 9 * Author URI: https://wpdeveloper.com
12 10 * License: GPL-3.0+
13 11 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -15,80 +13,102 @@
15 13 * Domain Path: /languages
16 14 */
17 15
18 16 // If this file is called directly, abort.
19 -use WPDeveloper\BetterDocs\Plugin;
17 +if (!defined('WPINC')) {
18 + die;
19 +}
20 20
21 -defined( 'ABSPATH' ) || exit;
21 +define('BETTERDOCS_VERSION', '2.3.5');
22 +define('BETTERDOCS_DB_VERSION', '1.0');
23 +define('BETTERDOCS_DIR_PATH', plugin_dir_path(__FILE__));
24 +define('BETTERDOCS_URL', plugin_dir_url(__FILE__));
25 +define('BETTERDOCS_PUBLIC_URL', BETTERDOCS_URL . 'public/');
26 +define('BETTERDOCS_ADMIN_URL', BETTERDOCS_URL . 'admin/');
27 +define('BETTERDOCS_FILE', __FILE__);
28 +define('BETTERDOCS_BASENAME', plugin_basename(__FILE__));
22 29
23 -define( 'BETTERDOCS_PLUGIN_FILE', __FILE__ );
30 +define('BETTERDOCS_ROOT_DIR_PATH', plugin_dir_path(__FILE__));
31 +define('BETTERDOCS_ADMIN_DIR_PATH', BETTERDOCS_ROOT_DIR_PATH . 'admin/');
32 +define('BETTERDOCS_PUBLIC_PATH', BETTERDOCS_ROOT_DIR_PATH . 'public/');
33 +define(
34 + 'BETTERDOCS_KSES_ALLOWED_HTML',
35 + array(
36 + 'span' => array(
37 + 'class' => array(),
38 + 'style' => array()
39 + ),
40 + 'p' => array(
41 + 'class' => array(),
42 + 'style' => array()
43 + ),
44 + 'strong' => array(),
45 + 'a' => array(
46 + 'href' => array(),
47 + 'title' => array()
48 + ),
49 + 'h1' => array(),
50 + 'h2' => array(),
51 + 'h3' => array(),
52 + 'h4' => array(),
53 + 'h5' => array(),
54 + 'h6' => array(),
55 + 'div' => array(
56 + 'class' => array(),
57 + 'style' => array()
58 + )
59 + )
60 +);
24 61
25 -require_once __DIR__ . '/includes/v2x-compatibility.php';
26 -require_once __DIR__ . '/vendor/autoload.php';
62 +/**
63 + * WPML compatibility with Polylang
64 + */
65 +include_once(ABSPATH . 'wp-admin/includes/plugin.php');
66 +if (is_plugin_active('polylang/polylang.php')) {
67 + define('PLL_WPML_COMPAT', false);
68 +}
27 69
70 +require_once plugin_dir_path(__FILE__) . 'includes/class-betterdocs-activator.php';
28 71 /**
29 - * Bundled MCP runtime (WordPress Abilities API + Parsedown).
30 - *
31 - * Loaded through the Jetpack Autoloader so that if the same library is also
32 - * shipped by another plugin — or lands in WordPress core — the newest copy
33 - * wins and loads once, with no fatal class collisions. This lets BetterDocs
34 - * serve its MCP connector out of the box, without the standalone Abilities
35 - * API plugin. See docs/mcp-server.md for the update procedure.
36 - *
37 - * On WordPress 7.1+, where core ships the Abilities API itself, Runtime::init()
38 - * stands the bundled copy down so it stops duplicating core's REST routes and
39 - * admin assets; on 6.4-7.0 the bundle is the only API and is left untouched.
40 - *
41 - * @since 4.9.0
72 + * The code that runs during plugin activation.
73 + * This action is documented in includes/class-betterdocs-activator.php
42 74 */
43 -$betterdocs_mcp_runtime = __DIR__ . '/dependencies/vendor/autoload_packages.php';
44 -if ( is_readable( $betterdocs_mcp_runtime ) ) {
45 - require_once $betterdocs_mcp_runtime;
46 -
47 - \WPDeveloper\BetterDocs\Abilities\Runtime::init();
75 +function activate_betterdocs()
76 +{
77 + BetterDocs_Activator::activate();
48 78 }
49 -unset( $betterdocs_mcp_runtime );
79 +add_action('activate_' . plugin_basename(__FILE__), 'activate_betterdocs');
50 80
51 81 /**
52 - * Declare WooCommerce HPOS (custom order tables) compatibility. BetterDocs
53 - * never touches order storage, so this is a pure compatibility flag. Must run
54 - * on before_woocommerce_init — the Plugin bootstraps on `init`, which is too
55 - * late for WooCommerce to read the declaration.
82 + * The code that runs during plugin deactivation.
83 + * This action is documented in includes/class-betterdocs-deactivator.php
56 84 */
57 -add_action( 'before_woocommerce_init', function () {
58 - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
59 - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility(
60 - 'custom_order_tables',
61 - BETTERDOCS_PLUGIN_FILE,
62 - true
63 - );
64 - }
65 -} );
85 +function deactivate_betterdocs()
86 +{
87 + require_once plugin_dir_path(__FILE__) . 'includes/class-betterdocs-deactivator.php';
88 + BetterDocs_Deactivator::deactivate();
89 +}
66 90
91 +register_deactivation_hook(__FILE__, 'deactivate_betterdocs');
92 +
67 93 /**
68 - * Initiate the BetterDocs Plugin
69 - *
70 - * @return Plugin
71 - * @since 2.5.0
94 + * The core plugin class that is used to define internationalization,
95 + * admin-specific hooks, and public-facing site hooks.
72 96 */
73 -function betterdocs(): Plugin {
74 - /**
75 - * Remove PRO Functionalities if pro is not updated.
76 - */
77 - if ( ! function_exists( 'betterdocs_pro' ) ) {
78 - remove_action( 'betterdocs_init', 'run_betterdocs_pro' );
79 - }
97 +require plugin_dir_path(__FILE__) . 'includes/class-betterdocs.php';
80 98
81 - return Plugin::get_instance();
82 -}
83 -
84 99 /**
85 - * Initialize BetterDocs (Free)
86 - * Here, begins the execution of the plugin.
100 + * Begins execution of the plugin.
87 101 *
88 - * Returns the main instance of BetterDocs.
102 + * Since everything within the plugin is registered via hooks,
103 + * then kicking off the plugin from this point in the file does
104 + * not affect the page life cycle.
89 105 *
90 - * @return Plugin
91 - * @since 3.0
106 + * @since 1.0.0
92 107 */
93 -
94 -betterdocs();
108 +function run_betterdocs()
109 +{
110 + $plugin = new BetterDocs();
111 + $plugin->run();
112 + do_action('betterdocs_init');
113 +}
114 +run_betterdocs();