-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinteers.php
More file actions
48 lines (42 loc) · 1.45 KB
/
printeers.php
File metadata and controls
48 lines (42 loc) · 1.45 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
48
<?php
/**
* Plugin Name: Printeers
* Plugin URI: https://printeers.com
* Description: Connect your WooCommerce store to Printeers for print-on-demand fulfillment.
* Version: 1.0.0
* Author: Printeers
* Author URI: https://printeers.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: printeers
* Requires at least: 6.0
* Requires PHP: 7.4
* WC requires at least: 10.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'PRINTEERS_VERSION', '1.0.0' );
define( 'PRINTEERS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'PRINTEERS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// URLs — hardcoded for production. Override via wp-config.php defines for dev/test.
if ( ! defined( 'PRINTEERS_DASHBOARD_URL' ) ) {
define( 'PRINTEERS_DASHBOARD_URL', 'https://dashboard.printeers.com' );
}
if ( ! defined( 'PRINTEERS_CALLBACK_URL' ) ) {
define( 'PRINTEERS_CALLBACK_URL', 'https://woocommerce-callback-api.printeers.com' );
}
require_once PRINTEERS_PLUGIN_DIR . 'includes/Admin.php';
require_once PRINTEERS_PLUGIN_DIR . 'includes/Connect.php';
require_once PRINTEERS_PLUGIN_DIR . 'includes/Api.php';
function printeers_init() {
if ( ! class_exists( 'WooCommerce' ) ) {
add_action( 'admin_notices', function () {
include PRINTEERS_PLUGIN_DIR . 'templates/notice-woocommerce-required.php';
} );
return;
}
Printeers\Admin::init();
Printeers\Api::init();
}
add_action( 'plugins_loaded', 'printeers_init' );