-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcocart-beta-tester.php
70 lines (62 loc) · 1.96 KB
/
cocart-beta-tester.php
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
<?php
/**
* Plugin Name: CoCart - Beta Tester
* Plugin URI: https://github.com/cocart-headless/cocart-beta-tester
* Description: Easily update to prerelease versions of CoCart for testing and development purposes.
* Author: CoCart
* Author URI: https://cocartapi.com
* Version: 2.3.0
* Text Domain: cocart-beta-tester
* Domain Path: /languages/
* Requires at least: 5.6
* Requires PHP: 7.4
*
* Copyright: CoCart Headless, LLC
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* GitHub Plugin URI: https://github.com/cocart-headless/cocart-beta-tester
*
* @package CoCart_Beta_Tester
*/
defined( 'ABSPATH' ) || exit;
if ( ! defined( 'COCART_BETA_TESTER_FILE' ) ) {
define( 'COCART_BETA_TESTER_FILE', __FILE__ );
}
if ( ! defined( 'COCART_BETA_TESTER_VERSION' ) ) {
define( 'COCART_BETA_TESTER_VERSION', '2.3.0' );
}
/**
* Load text domain before all other code.
*
* @since 2.0.0
*/
function _ccbt_load_text_domain() {
load_plugin_textdomain( 'cocart-beta-tester', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action( 'plugins_loaded', '_ccbt_load_text_domain' );
/**
* Returns the main instance of CoCart Beta Tester and only runs if it does not already exists.
*
* @since 2.0.0
*
* @return CoCart_Beta_Tester
*/
if ( ! function_exists( 'cocart_beta_tester' ) ) {
/**
* Initialize CoCart Beta Tester.
*/
function cocart_beta_tester() {
if ( ! defined( 'COCART_VERSION' ) ) {
add_action( 'admin_notices', function () {
include_once untrailingslashit( plugin_dir_path( COCART_BETA_TESTER_FILE ) ) . '/includes/views/html-admin-notice-missing-cocart.php';
} );
} elseif ( ! class_exists( 'CoCart_Beta_Tester' ) ) {
include_once untrailingslashit( plugin_dir_path( COCART_BETA_TESTER_FILE ) ) . '/includes/class-cocart-beta-tester.php';
CoCart_Beta_Tester::instance();
}
}
add_action( 'plugins_loaded', function () {
cocart_beta_tester();
}, 99 );
}