-
Notifications
You must be signed in to change notification settings - Fork 0
/
billplz-for-wpsmartpay.php
64 lines (56 loc) · 1.92 KB
/
billplz-for-wpsmartpay.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
<?php
/**
* @link https://alvindcaesar.com/
* @since 1.0.0
* @package Billplz_for_WPSmartPay
*
* @wordpress-plugin
* Plugin Name: FPX Payment for WPSmartPay (Billplz)
* Plugin URI: https://wpkartel.com/fpx-payment-for-wpsmartpay
* Description: Accept payment in WPSmartPay by using Billplz.
* Version: 1.0.5
* Author: Alvind Caesar (WPKartel)
* Author URI: https://wpkartel.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: billplz-for-smartpay
* Domain Path: /languages
*/
if (!defined('ABSPATH')) {
die;
}
if (!function_exists('is_plugin_active')) {
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
if (! is_plugin_active('smartpay/smartpay.php') || ( is_plugin_active('fpx-payment-smartpay/fpx-payment-smartpay.php'))) {
return;
}
}
if (!class_exists('Billplz_WPSP')) {
class Billplz_WPSP
{
private static $instance;
public static function instance()
{
if (!isset(self::$instance) && !(self::$instance instanceof Billplz_WPSP)) {
self::$instance = new Billplz_WPSP();
self::$instance->define_constants();
self::$instance->includes();
}
return self::$instance;
}
private function define_constants()
{
define('BILLPLZ_WPSP_PLUGIN_PATH', plugin_dir_path(__FILE__));
define('BILLPLZ_WPSP_PLUGIN_URL', plugin_dir_url(__FILE__));
define('BILLPLZ_WPSP_PLUGIN_FILE', plugin_basename(__FILE__));
define('BILLPLZ_WPSP_PLUGIN_NAME', 'Billplz for WPSmartPay');
define('BILLPLZ_WPSP_PLUGIN_VERSION', '1.0.3');
}
private function includes()
{
require_once BILLPLZ_WPSP_PLUGIN_PATH . 'includes/billplz-helper.php';
require_once BILLPLZ_WPSP_PLUGIN_PATH . 'includes/billplz.php';
}
}
}
add_action( 'plugins_loaded', array( 'Billplz_WPSP', 'instance'));