PluginProbe
CBX Bookmark & Favorite / 2.0.4
CBX Bookmark & Favorite v2.0.4
2.0.10 2.0.9 trunk 1.7.22 1.7.24 1.7.25 1.7.26 1.7.27 1.7.28 1.7.29 1.7.31 1.8.0 1.8.1 1.8.10 1.8.11 1.8.12 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.8 1.8.9 1.9.0 1.9.1 All 42 releases
cbxwpbookmark / cbxwpbookmark.php

cbxwpbookmark.php in CBX Bookmark & Favorite 2.0.4, at cbxwpbookmark.php

164 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The plugin bootstrap file
4 *
5 * This file is read by WordPress to generate the plugin information in the plugin
6 * admin area. This file also includes all of the dependencies used by the plugin,
7 * registers the activation and deactivation functions, and defines a function
8 * that starts the plugin.
9 *
10 * @link codeboxr.com
11 * @since 1.0.0
12 * @package Cbxwpbookmark
13 *
14 * @wordpress-plugin
15 * Plugin Name: CBX Bookmark & Favorite
16 * Plugin URI: https://codeboxr.com/product/cbx-wordpress-bookmark
17 * Description: List/category based bookmark for WordPress, create your own private or public list of favorite posts, page, custom object
18 * Version: 2.0.4
19 * Author: Codeboxr Team
20 * Author URI: https://codeboxr.com
21 * License: GPL-2.0+
22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
23 * Text Domain: cbxwpbookmark
24 * Domain Path: /languages
25 */
26
27 // If this file is called directly, abort.
28 if ( ! defined( 'WPINC' ) ) {
29 die;
30 }
31
32
33 defined( 'CBXWPBOOKMARK_PLUGIN_NAME' ) or define( 'CBXWPBOOKMARK_PLUGIN_NAME', 'cbxwpbookmark' );
34 defined( 'CBXWPBOOKMARK_PLUGIN_VERSION' ) or define( 'CBXWPBOOKMARK_PLUGIN_VERSION', '2.0.4' );
35 defined( 'CBXWPBOOKMARK_BASE_NAME' ) or define( 'CBXWPBOOKMARK_BASE_NAME', plugin_basename( __FILE__ ) );
36 defined( 'CBXWPBOOKMARK_ROOT_PATH' ) or define( 'CBXWPBOOKMARK_ROOT_PATH', plugin_dir_path( __FILE__ ) );
37 defined( 'CBXWPBOOKMARK_ROOT_URL' ) or define( 'CBXWPBOOKMARK_ROOT_URL', plugin_dir_url( __FILE__ ) );
38
39
40 defined( 'CBXWPBOOKMARK_DEV_MODE' ) or define( 'CBXWPBOOKMARK_DEV_MODE', false );
41
42 defined( 'CBXWPBOOKMARK_PHP_MIN_VERSION' ) or define( 'CBXWPBOOKMARK_PHP_MIN_VERSION', '7.4' );
43 defined( 'CBXWPBOOKMARK_WP_MIN_VERSION' ) or define( 'CBXWPBOOKMARK_WP_MIN_VERSION', '5.3' );
44 defined( 'CBXWPBOOKMARK_PRO_VERSION' ) or define( 'CBXWPBOOKMARK_PRO_VERSION', '2.0.4' );
45
46
47 // Include the main Bookmark class.
48 if ( ! class_exists( 'CBXWPBookmark', false ) ) {
49 include_once CBXWPBOOKMARK_ROOT_PATH . 'includes/CBXWPBookmark.php';
50 }
51
52 register_activation_hook( __FILE__, 'cbxwpbookmark_activate' );
53 register_deactivation_hook( __FILE__, 'cbxwpbookmark_deactivate' );
54
55 /**
56 * The code that runs during plugin activation.
57 * This action is documented in includes/class-cbxwpbookmark-activator.php
58 */
59 function cbxwpbookmark_activate() {
60 $wp_version = CBXWPBOOKMARK_WP_MIN_VERSION;
61 $php_version = CBXWPBOOKMARK_PHP_MIN_VERSION;
62
63 if ( ! cbxwpbookmark_compatible_wp_version( $wp_version ) ) {
64 deactivate_plugins( plugin_basename( __FILE__ ) );
65 /* translators: %s: wordpress version */
66 wp_die( sprintf( esc_html__( 'CBX Bookmark plugin requires WordPress %s or higher!', 'cbxwpbookmark' ), esc_attr($wp_version) ) );
67 }
68
69 if ( ! cbxwpbookmark_compatible_php_version( $php_version ) ) {
70 deactivate_plugins( plugin_basename( __FILE__ ) );
71 /* translators: %s: php version */
72 wp_die( sprintf( esc_html__( 'CBX Bookmark plugin requires PHP %s or higher!', 'cbxwpbookmark' ), esc_attr($php_version) ) );
73 }
74
75 cbxwpbookmark_core();
76
77 //load orm
78 CBXWPBookmarkHelper::load_orm();
79
80 //do some extra on plugin activation
81 CBXWPBookmarkHelper::activate();
82
83 CBXWPBookmarkHelper::customizer_default_adjust( true );
84 }//end memthod cbxwpbookmark_activate
85
86 /**
87 * The code that runs during plugin deactivation.
88 * This action is documented in includes/class-cbxwpbookmark-deactivator.php
89 */
90 function cbxwpbookmark_deactivate() {
91 //require_once plugin_dir_path( __FILE__ ) . 'includes/class-cbxwpbookmark-deactivator.php';
92 CBXWPBookmarkHelper::deactivate();
93 }//end method cbxwpbookmark_deactivate
94
95 /**
96 * Checking wp version
97 *
98 * @param $version
99 *
100 * @return bool
101 * @since 1.0.0
102 */
103 function cbxwpbookmark_compatible_wp_version( $version = CBXWPBOOKMARK_WP_MIN_VERSION ) {
104 if ( version_compare( $GLOBALS['wp_version'], $version, '<' ) ) {
105 return false;
106 }
107
108 // Add sanity checks for other version requirements here
109 return true;
110 }//end function cbxwpbookmark_compatible_wp_version
111
112 /**
113 * Checking php version
114 *
115 * @param $version
116 *
117 * @return bool
118 * @since 1.0.0
119 */
120 function cbxwpbookmark_compatible_php_version( $version = CBXWPBOOKMARK_PHP_MIN_VERSION ) {
121 if ( version_compare( PHP_VERSION, $version, '<' ) ) {
122 return false;
123 }
124
125 return true;
126 }//end function cbxwpbookmark_compatible_php_version
127
128 /**
129 * Returns the main instance of CBXWPBookmark.
130 *
131 * @since 1.0.0
132 */
133 function cbxwpbookmark_core() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
134 global $cbxwpbookmark_core;
135
136 if ( ! isset( $cbxwpbookmark_core ) ) {
137 $cbxwpbookmark_core = cbxwpbookmark_run_core();
138 }
139
140 return $cbxwpbookmark_core;
141 }//end method cbxwpbookmark_core
142
143
144
145 /**
146 * The core plugin class that is used to define internationalization,
147 * admin-specific hooks, and public-facing site hooks.
148 */
149 //require plugin_dir_path( __FILE__ ) . 'includes/class-cbxwpbookmark.php';
150
151 /**
152 * Begins execution of the plugin.
153 *
154 * Since everything within the plugin is registered via hooks,
155 * then kicking off the plugin from this point in the file does
156 * not affect the page life cycle.
157 *
158 * @since 1.7.13
159 */
160 function cbxwpbookmark_run_core() {
161 return CBXWPBookmark::instance();
162 }//end function cbxwpbookmark_run_core
163
164 $GLOBALS['cbxwpbookmark_core'] = cbxwpbookmark_run_core();