-
Notifications
You must be signed in to change notification settings - Fork 10
/
wbounce.php
97 lines (81 loc) · 2.65 KB
/
wbounce.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
92
93
94
95
96
97
<?php
/*
Plugin Name: wBounce
Plugin URI: https://www.kweber.com/wbounce/
Description: wBounce improves bounce rate to boost conversions and sales. The free alternative to Bounce Exchange for WordPress.
Version: 1.8.1
Author: Kevin Weber
Author URI: https://www.kweber.com/
License: MIT
Text Domain: wbounce
Domain Path: /languages
*/
if ( !defined( 'WBOUNCE_OPTION_KEY' ) ) {
define( 'WBOUNCE_OPTION_KEY', 'wbounce' );
}
if (!defined('WBOUNCE_VERSION_NUM'))
define('WBOUNCE_VERSION_NUM', '1.8.1');
if (!defined('WBOUNCE_VERSION_KEY'))
define('WBOUNCE_VERSION_KEY', WBOUNCE_OPTION_KEY.'_version');
// Store the plugin version for upgrades
add_option( WBOUNCE_VERSION_KEY, WBOUNCE_VERSION_NUM );
if ( !defined( 'WBOUNCE_PLUGIN_NAME' ) ) {
define( 'WBOUNCE_PLUGIN_NAME', 'wBounce' );
}
if ( !defined( 'WBOUNCE_TD' ) ) {
define( 'WBOUNCE_TD', 'wbounce' ); // = text domain (used for translations)
}
if ( !defined( 'WBOUNCE_FILE' ) ) {
define( 'WBOUNCE_FILE', __FILE__ );
}
if ( !defined( 'WBOUNCE_PATH' ) )
define( 'WBOUNCE_PATH', plugin_dir_path( __FILE__ ) );
require_once( WBOUNCE_PATH . 'admin/class-register.php' );
require_once( WBOUNCE_PATH . 'admin/inc/class-setup.php' );
////////////////////////////////////////////////////////////////////////////////
/**
* Framework by Kevin Weber (kevinw.de)
*/
$kevinw_framework_setup_arr = array(
'option_page_url_name' => WBOUNCE_OPTION_KEY,
'option_key' => WBOUNCE_OPTION_KEY,
'version_current' => WBOUNCE_VERSION_NUM
);
// Don't edit the following code //
if ( !defined( 'KEVINW_FRAMEWORK' ) )
define( 'KEVINW_FRAMEWORK', true );
if ( defined( 'KEVINW_FRAMEWORK' ) ) {
if ( is_admin() ) {
require_once( 'kevinw_framework/class-kevinw-admin.php' );
$kevinw_admin_init = new Kevinw_Admin( $kevinw_framework_setup_arr );
}
}
////////////////////////////////////////////////////////////////////////////////
class Wbounce_Init {
function __construct() {
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
if ( is_admin() ) {
add_action( 'plugins_loaded', array( $this, 'admin_init' ), 14 );
}
else {
add_action( 'plugins_loaded', array( $this, 'frontend_init' ), 14 );
}
}
/**
* Load plugin textdomain.
* @since 1.5
*/
function load_textdomain() {
load_plugin_textdomain( WBOUNCE_TD, false, dirname( plugin_basename( WBOUNCE_FILE ) ) . '/languages/' );
}
function admin_init() {
require_once( WBOUNCE_PATH . 'admin/class-admin-options.php' );
require_once( WBOUNCE_PATH . 'admin/class-meta.php' );
}
function frontend_init() {
require_once( WBOUNCE_PATH . 'frontend/class-frontend.php' );
}
}
new Wbounce_Init();
/***** Plugin by Kevin Weber || kevinw.de *****/
?>