Passed
Push — master ( 3984cd...e619e9 )
by Brian
04:26
created

getpaid_deactivation_hook()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * Plugin Name: GetPaid
4
 * Plugin URI: https://wpinvoicing.com/
5
 * Description: A lightweight and VAT compliant payments and invoicing plugin.
6
 * Version: 2.0.7
7
 * Author: AyeCode Ltd
8
 * Author URI: https://wpinvoicing.com
9
 * Text Domain: invoicing
10
 * Domain Path: /languages
11
 * License: GPLv3
12
 * Requires at least: 4.9
13
 * Requires PHP: 5.3
14
 *
15
 * @package GetPaid
16
 */
17
18
defined( 'ABSPATH' ) || exit;
19
20
// Define constants.
21
if ( ! defined( 'WPINV_PLUGIN_FILE' ) ) {
22
	define( 'WPINV_PLUGIN_FILE', __FILE__ );
23
}
24
25
if ( ! defined( 'WPINV_VERSION' ) ) {
26
	define( 'WPINV_VERSION', '2.0.7' );
27
}
28
29
// Include the main Invoicing class.
30
if ( ! class_exists( 'WPInv_Plugin', false ) ) {
31
	require_once plugin_dir_path( WPINV_PLUGIN_FILE ) . 'includes/class-wpinv.php';
32
}
33
34
/**
35
 * Returns the main instance of Invoicing.
36
 *
37
 * @since  1.0.19
38
 * @return WPInv_Plugin
39
 */
40
function getpaid() {
41
42
    if ( empty( $GLOBALS['invoicing'] ) ) {
43
        $GLOBALS['invoicing'] = new WPInv_Plugin();
44
    }
45
46
	return $GLOBALS['invoicing'];
47
}
48
49
/**
50
 * Deactivation hook.
51
 *
52
 * @since  2.0.8
53
 */
54
function getpaid_deactivation_hook() {
55
    update_option( 'wpinv_flush_permalinks', 1 );
56
}
57
register_deactivation_hook( __FILE__, 'getpaid_deactivation_hook' );
58
59
/**
60
 * @deprecated
61
 */
62
function wpinv_run() {
63
    return getpaid();
64
}
65
66
// Kickstart the plugin.
67
add_action( 'plugins_loaded', 'getpaid', -100 );
68