-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvoize.php
91 lines (89 loc) · 3.09 KB
/
invoize.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
<?php
use Invoize\Features\Admin\Admin;
use Invoize\Features\Front\Front;
use Invoize\InvoizePlugin;
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @wordpress-plugin
* Plugin Name: Invoize
* Plugin URI: https://wpsora.com
* Description: Simplifies the process of creating, managing, and sending professional invoice
* Version: 1.5.2
* Author: Dede Nugroho
* Author URI: https://www.facebook.com/thisnugroho/
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Requires PHP: 7.4
*
*/
if ( !function_exists( 'invoize' ) ) {
// Create a helper function for easy SDK access.
function invoize() {
global $invoize;
if ( !isset( $invoize ) ) {
// Include Freemius SDK.
require_once dirname( __FILE__ ) . '/vendor/freemius/wordpress-sdk/start.php';
$invoize = fs_dynamic_init( array(
'id' => '16134',
'slug' => 'invoize',
'premium_slug' => 'invoize-pro',
'type' => 'plugin',
'public_key' => 'pk_35932ea57247ebc4c8a4329274adb',
'is_premium' => false,
'has_paid_plans' => true,
'menu' => array(
'slug' => 'invoize',
'first-path' => 'admin.php?page=invoize-welcome',
'pricing' => true,
),
'is_live' => true,
) );
}
return $invoize;
}
// Init Freemius.
invoize();
// Signal that SDK was initiated.
do_action( 'ivz_loaded' );
}
// If this file is called directly, abort.
if ( !defined( 'WPINC' ) ) {
die;
}
if ( !defined( 'ABSPATH' ) ) {
exit;
}
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this plugin. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
$pluginName = 'Invoize';
$pluginVersion = get_plugin_data( __FILE__ )['Version'];
$pluginDirectory = __DIR__;
$pluginUrl = plugin_dir_url( __FILE__ );
$plugin = new InvoizePlugin(
$pluginName,
$pluginVersion,
$pluginDirectory,
$pluginUrl
);
$features = [Admin::class, Front::class];
if ( is_wc_actived() ) {
$features[] = \Invoize\Features\Integrations\Woocommerce\Woocommerce::class;
}
$plugin->registerFeatures( $features )->run();
register_activation_hook( __FILE__, [$plugin, 'onPluginActivated'] );
register_deactivation_hook( __FILE__, [$plugin, 'onPluginDeactivated'] );