| @@ -2,12 +2,12 @@ | ||
| 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.5.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: 1.7.1 | |
| 8 | 8 | * Author: WPDeveloper |
| 9 | - * Author URI: https://wpdeveloper.com | |
| 9 | + * Author URI: https://wpdeveloper.net | |
| 10 | 10 | * License: GPL-3.0+ |
| 11 | 11 | * License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 12 | 12 | * Text Domain: betterdocs |
| 13 | 13 | * Domain Path: /languages |
| @@ -13,41 +13,66 @@ | ||
| 13 | 13 | * Domain Path: /languages |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | // If this file is called directly, abort. |
| 17 | -use WPDeveloper\BetterDocs\Plugin; | |
| 17 | +if (!defined('WPINC')) { | |
| 18 | + die; | |
| 19 | +} | |
| 18 | 20 | |
| 19 | -defined( 'ABSPATH' ) || exit; | |
| 21 | +define('BETTERDOCS_VERSION', '1.7.1'); | |
| 22 | +define('BETTERDOCS_DIR_PATH', plugin_dir_path(__FILE__)); | |
| 23 | +define('BETTERDOCS_URL', plugin_dir_url(__FILE__)); | |
| 24 | +define('BETTERDOCS_PUBLIC_URL', BETTERDOCS_URL . 'public/'); | |
| 25 | +define('BETTERDOCS_ADMIN_URL', BETTERDOCS_URL . 'admin/'); | |
| 26 | +define('BETTERDOCS_FILE', __FILE__); | |
| 27 | +define('BETTERDOCS_BASENAME', plugin_basename(__FILE__)); | |
| 20 | 28 | |
| 21 | -define( 'BETTERDOCS_PLUGIN_FILE', __FILE__ ); | |
| 29 | +define('BETTERDOCS_ROOT_DIR_PATH', plugin_dir_path(__FILE__)); | |
| 30 | +define('BETTERDOCS_ADMIN_DIR_PATH', BETTERDOCS_ROOT_DIR_PATH . 'admin/'); | |
| 31 | +define('BETTERDOCS_PUBLIC_PATH', BETTERDOCS_ROOT_DIR_PATH . 'public/'); | |
| 32 | +/** | |
| 33 | + * The code that runs during plugin activation. | |
| 34 | + * This action is documented in includes/class-betterdocs-activator.php | |
| 35 | + */ | |
| 36 | +function activate_betterdocs() | |
| 37 | +{ | |
| 38 | + require_once plugin_dir_path(__FILE__) . 'includes/class-betterdocs-activator.php'; | |
| 39 | + BetterDocs_Activator::activate(); | |
| 40 | +} | |
| 41 | +add_action('activate_' . plugin_basename(__FILE__), 'activate_betterdocs'); | |
| 22 | 42 | |
| 23 | -require_once __DIR__ . '/includes/v2x-compatibility.php'; | |
| 24 | -require_once __DIR__ . '/vendor/autoload.php'; | |
| 25 | 43 | |
| 26 | 44 | /** |
| 27 | - * Initiate the BetterDocs Plugin | |
| 28 | - * | |
| 29 | - * @return Plugin | |
| 30 | - * @since 2.5.0 | |
| 45 | + * The code that runs during plugin deactivation. | |
| 46 | + * This action is documented in includes/class-betterdocs-deactivator.php | |
| 31 | 47 | */ |
| 32 | -function betterdocs(): Plugin { | |
| 33 | - /** | |
| 34 | - * Remove PRO Functionalities if pro is not updated. | |
| 35 | - */ | |
| 36 | - if ( ! function_exists( 'betterdocs_pro' ) ) { | |
| 37 | - remove_action( 'betterdocs_init', 'run_betterdocs_pro' ); | |
| 38 | - } | |
| 48 | +function deactivate_betterdocs() | |
| 49 | +{ | |
| 50 | + require_once plugin_dir_path(__FILE__) . 'includes/class-betterdocs-deactivator.php'; | |
| 51 | + BetterDocs_Deactivator::deactivate(); | |
| 52 | +} | |
| 39 | 53 | |
| 40 | - return Plugin::get_instance(); | |
| 41 | -} | |
| 54 | +register_deactivation_hook(__FILE__, 'deactivate_betterdocs'); | |
| 42 | 55 | |
| 43 | 56 | /** |
| 44 | - * Initialize BetterDocs (Free) | |
| 45 | - * Here, begins the execution of the plugin. | |
| 57 | + * The core plugin class that is used to define internationalization, | |
| 58 | + * admin-specific hooks, and public-facing site hooks. | |
| 59 | + */ | |
| 60 | +require plugin_dir_path(__FILE__) . 'includes/class-betterdocs.php'; | |
| 61 | + | |
| 62 | +/** | |
| 63 | + * Begins execution of the plugin. | |
| 46 | 64 | * |
| 47 | - * Returns the main instance of BetterDocs. | |
| 65 | + * Since everything within the plugin is registered via hooks, | |
| 66 | + * then kicking off the plugin from this point in the file does | |
| 67 | + * not affect the page life cycle. | |
| 48 | 68 | * |
| 49 | - * @return Plugin | |
| 50 | - * @since 3.0 | |
| 69 | + * @since 1.0.0 | |
| 51 | 70 | */ |
| 71 | +function run_betterdocs() | |
| 72 | +{ | |
| 52 | 73 | |
| 53 | -betterdocs(); | |
| 74 | + $plugin = new BetterDocs(); | |
| 75 | + $plugin->run(); | |
| 76 | + do_action('betterdocs_init'); | |
| 77 | +} | |
| 78 | +run_betterdocs(); | |