-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsnapwp-helper.php
94 lines (83 loc) · 2.04 KB
/
snapwp-helper.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* Plugin Name: SnapWP - Helper
* Plugin URI: https://github.com/rtCamp/snapwp-helper
* GitHub Plugin URI: https://github.com/rtCamp/snapwp-helper
* Description: Manages WPGraphQL extensions updates and discovery.
* Author: rtCamp
* Author URI: https://github.com/rtCamp
* Update URI: https://github.com/rtCamp/snapwp-helper
* Version: 0.0.1
* Text Domain: snapwp-helper
* Domain Path: /languages
* Requires at least: 6.7
* Tested up to: 6.7.1
* Requires PHP: 7.4
* Requires WPGraphQL: 1.28.0
* WPGraphQL tested up to: 1.31.1
* License: GPL-3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
* @package SnapWP\Helper
* @author rtCamp
* @license GPL-3
* @version 0.0.1
*/
declare(strict_types=1);
namespace SnapWP\Helper;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Load the autoloader.
require_once __DIR__ . '/src/Autoloader.php';
if ( ! \SnapWP\Helper\Autoloader::autoload() ) {
return;
}
/**
* Define the plugin constants.
*/
function constants(): void {
if ( ! defined( 'SNAPWP_HELPER_VERSION' ) ) {
/**
* The plugin version.
*
* @const string
*/
define( 'SNAPWP_HELPER_VERSION', '0.0.1' );
}
if ( ! defined( 'SNAPWP_HELPER_PLUGIN_DIR' ) ) {
/**
* The plugin directory path.
*
* @const string
*/
define( 'SNAPWP_HELPER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'SNAPWP_HELPER_PLUGIN_URL' ) ) {
/**
* The plugin directory URL.
*
* @const string
*/
define( 'SNAPWP_HELPER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'SNAPWP_HELPER_PLUGIN_FILE' ) ) {
/**
* The plugin file.
*
* @const string
*/
define( 'SNAPWP_HELPER_PLUGIN_FILE', __FILE__ );
}
}
// Run this function when the plugin is activated.
if ( file_exists( __DIR__ . '/activation.php' ) ) {
require_once __DIR__ . '/activation.php';
register_activation_hook( __FILE__, 'SnapWP\Helper\activation_callback' );
}
// Load the plugin.
if ( class_exists( 'SnapWP\Helper\Main' ) ) {
constants();
\SnapWP\Helper\Main::instance();
}