-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopbounce.php
76 lines (61 loc) · 1.78 KB
/
popbounce.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
<?php
/*
Plugin Name: popBounce
Plugin URI: http://coldturkeygroup.com/
Description: popBounce is a WordPress plugin build on ouiBounce to help increase conversion rates.
Version: 1.0.4
Author: Cold Turkey Group
Author URI: http://coldturkeygroup.com/
Text Domain: popbounce
*/
if ( ! defined( 'POPBOUNCE_OPTION_KEY' ) )
define( 'POPBOUNCE_OPTION_KEY', 'popbounce' );
if ( ! defined( 'POPBOUNCE_VERSION_NUM' ) )
define( 'POPBOUNCE_VERSION_NUM', '1.0.4' );
if ( ! defined( 'POPBOUNCE_VERSION_KEY' ) )
define( 'POPBOUNCE_VERSION_KEY', POPBOUNCE_OPTION_KEY . '_version' );
// Store the plugin version for upgrades
add_option( POPBOUNCE_VERSION_KEY, POPBOUNCE_VERSION_NUM );
if ( ! defined( 'POPBOUNCE_PLUGIN_NAME' ) )
define( 'POPBOUNCE_PLUGIN_NAME', 'popBounce' );
if ( ! defined( 'POPBOUNCE_TD' ) )
define( 'POPBOUNCE_TD', 'popbounce' );
if ( ! defined( 'POPBOUNCE_FILE' ) )
define( 'POPBOUNCE_FILE', __FILE__ );
if ( ! defined( 'POPBOUNCE_PATH' ) )
define( 'POPBOUNCE_PATH', plugin_dir_path( __FILE__ ) );
require_once( POPBOUNCE_PATH . 'admin/class-register.php' );
/**
* Class Popbounce_Init
*
* Basic initializer class for popBounce
*/
class Popbounce_Init {
/**
* Load required functions based on admin or frontend
*/
function __construct()
{
if ( is_admin() ) {
add_action( 'plugins_loaded', [ $this, 'admin_init' ], 14 );
} else {
add_action( 'plugins_loaded', [ $this, 'frontend_init' ], 14 );
}
}
/**
* Initialize required admin classes
*/
function admin_init()
{
require_once( POPBOUNCE_PATH . 'admin/class-admin-options.php' );
require_once( POPBOUNCE_PATH . 'admin/class-meta.php' );
}
/**
* Initialize required frontend classes
*/
function frontend_init()
{
require_once( POPBOUNCE_PATH . 'frontend/class-frontend.php' );
}
}
new Popbounce_Init();