Completed
Push — master ( 3ad42c...16627f )
by Brian
25s queued 14s
created

getpaid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 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: 1.0.19
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', '1.0.19' );
27
}
28
29
// Include the main Invoicing class.
30
if ( ! class_exists( 'WPInv_Plugin', false ) ) {
31
	include_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
 * @deprecated
51
 */
52
function wpinv_run() {
53
    return getpaid();
54
}
55
56
// Kickstart the plugin.
57
getpaid();
58