-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdubinc.php
More file actions
executable file
·47 lines (40 loc) · 1.69 KB
/
dubinc.php
File metadata and controls
executable file
·47 lines (40 loc) · 1.69 KB
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
<?php
/**
* Plugin Name: Dub - Short Links With Superpowers
* Plugin URI: https://dub.co
* Description: Official WordPress integration for Dub Technologies, Inc.
* Version: 1.0.1
* Requires at least: 5.5
* Requires PHP: 7.4
* Author: Dub Technologies, Inc.
* Author URI: https://dub.co
* License: AGPLv3
* License URI: https://www.gnu.org/licenses/agpl-3.0.en.html
* Text Domain: dubinc
* Domain Path: /languages
*
* @package DubTechnologiesInc
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
// Useful global constants.
define( 'DUBCO_PLUGIN_VERSION', '1.0.1' );
define( 'DUBCO_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'DUBCO_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
define( 'DUBCO_PLUGIN_INC', DUBCO_PLUGIN_PATH . 'includes/' );
define( 'DUBCO_PLUGIN_DIST_URL', DUBCO_PLUGIN_URL . 'dist/' );
define( 'DUBCO_PLUGIN_DIST_PATH', DUBCO_PLUGIN_PATH . 'dist/' );
$is_local_env = in_array( wp_get_environment_type(), [ 'local', 'development' ], true );
$is_local_url = strpos( home_url(), '.test' ) || strpos( home_url(), '.local' );
$is_local = $is_local_env || $is_local_url;
// Require Composer autoloader if it exists.
if ( file_exists( DUBCO_PLUGIN_PATH . 'vendor/autoload.php' ) ) {
require_once DUBCO_PLUGIN_PATH . 'vendor/autoload.php';
}
// Include files.
require_once DUBCO_PLUGIN_INC . '/utility.php';
require_once DUBCO_PLUGIN_INC . '/core.php';
// Activation/Deactivation.
register_activation_hook( __FILE__, '\DubTechnologiesInc\Core\activate' );
register_deactivation_hook( __FILE__, '\DubTechnologiesInc\Core\deactivate' );
// Bootstrap.
DubTechnologiesInc\Core\setup();