| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: HollerBox |
| 4 |
* Plugin URI: https://hollerwp.com |
| 5 |
* Description: Powerful Popups & Lead Generation for Small Businesses & Agencies using WordPress |
| 6 |
* Version: 2.3.8 |
| 7 |
* Author: Groundhogg Inc. |
| 8 |
* Author URI: https://groundhogg.io |
| 9 |
* Text Domain: holler-box |
| 10 |
* |
| 11 |
* @author Groundhogg Inc. |
| 12 |
* @copyright Copyright (c) Groundhogg Inc 2022 |
| 13 |
* |
| 14 |
*/ |
| 15 |
|
| 16 |
|
| 17 |
// Exit if accessed directly |
| 18 |
if ( ! defined( 'ABSPATH' ) ) { |
| 19 |
exit; |
| 20 |
} |
| 21 |
|
| 22 |
define( 'HOLLERBOX_VERSION', '2.3.8' ); |
| 23 |
|
| 24 |
if ( ! class_exists( 'Holler_Box' ) ) { |
| 25 |
|
| 26 |
/** |
| 27 |
* Main Holler_Box class |
| 28 |
* |
| 29 |
*/ |
| 30 |
class Holler_Box { |
| 31 |
|
| 32 |
/** |
| 33 |
* @var Holler_Box $instance The one true Holler_Box |
| 34 |
*/ |
| 35 |
private static $instance; |
| 36 |
|
| 37 |
|
| 38 |
/** |
| 39 |
* Get active instance |
| 40 |
* |
| 41 |
* @access public |
| 42 |
* @since 0.1.0 |
| 43 |
* @return self The one true Holler_Box |
| 44 |
*/ |
| 45 |
public static function instance() { |
| 46 |
if ( ! self::$instance ) { |
| 47 |
self::$instance = new Holler_Box(); |
| 48 |
} |
| 49 |
|
| 50 |
return self::$instance; |
| 51 |
} |
| 52 |
|
| 53 |
public function __construct() { |
| 54 |
|
| 55 |
if ( self::$instance ) { |
| 56 |
return; |
| 57 |
} |
| 58 |
|
| 59 |
$this->setup_constants(); |
| 60 |
$this->includes(); |
| 61 |
$this->load_textdomain(); |
| 62 |
$this->hooks(); |
| 63 |
|
| 64 |
Holler_Admin::instance(); |
| 65 |
new Holler_Api(); |
| 66 |
new Holler_Frontend(); |
| 67 |
new Holler_Telemetry(); |
| 68 |
new Holler_Updater(); |
| 69 |
|
| 70 |
Holler_Licensing::instance(); |
| 71 |
} |
| 72 |
|
| 73 |
/** |
| 74 |
* Setup plugin constants |
| 75 |
* |
| 76 |
* @access private |
| 77 |
* @since 0.1.0 |
| 78 |
* @return void |
| 79 |
*/ |
| 80 |
private function setup_constants() { |
| 81 |
|
| 82 |
// Plugin version |
| 83 |
define( 'Holler_Box_VER', HOLLERBOX_VERSION ); |
| 84 |
|
| 85 |
// Plugin path |
| 86 |
define( 'Holler_Box_DIR', plugin_dir_path( __FILE__ ) ); |
| 87 |
|
| 88 |
// Plugin URL |
| 89 |
define( 'Holler_Box_URL', plugin_dir_url( __FILE__ ) ); |
| 90 |
} |
| 91 |
|
| 92 |
|
| 93 |
/** |
| 94 |
* Include necessary files |
| 95 |
* |
| 96 |
* @access private |
| 97 |
* @since 0.1.0 |
| 98 |
* @return void |
| 99 |
*/ |
| 100 |
private function includes() { |
| 101 |
require_once __DIR__ . '/includes/class-holler-api.php'; |
| 102 |
require_once __DIR__ . '/includes/class-holler-admin.php'; |
| 103 |
require_once __DIR__ . '/includes/class-holler-popup.php'; |
| 104 |
require_once __DIR__ . '/includes/class-holler-frontend.php'; |
| 105 |
require_once __DIR__ . '/includes/class-holler-lead.php'; |
| 106 |
require_once __DIR__ . '/includes/class-holler-integrations.php'; |
| 107 |
require_once __DIR__ . '/includes/class-holler-reporting.php'; |
| 108 |
require_once __DIR__ . '/includes/class-holler-settings.php'; |
| 109 |
require_once __DIR__ . '/includes/class-holler-licensing.php'; |
| 110 |
require_once __DIR__ . '/includes/class-holler-telemetry.php'; |
| 111 |
require_once __DIR__ . '/includes/class-holler-updater.php'; |
| 112 |
require_once __DIR__ . '/includes/Holler_EDD_SL_Plugin_Updater.php'; |
| 113 |
} |
| 114 |
|
| 115 |
|
| 116 |
/** |
| 117 |
* Run action and filter hooks |
| 118 |
* |
| 119 |
* @access private |
| 120 |
* @since 0.1.0 |
| 121 |
* @return void |
| 122 |
* |
| 123 |
* |
| 124 |
*/ |
| 125 |
private function hooks() { |
| 126 |
} |
| 127 |
|
| 128 |
/** |
| 129 |
* Internationalization |
| 130 |
* |
| 131 |
* @access public |
| 132 |
* @since 0.1.0 |
| 133 |
* @return void |
| 134 |
*/ |
| 135 |
public function load_textdomain() { |
| 136 |
|
| 137 |
load_plugin_textdomain( 'holler-box' ); |
| 138 |
|
| 139 |
} |
| 140 |
|
| 141 |
} |
| 142 |
} // End if class_exists check |
| 143 |
|
| 144 |
|
| 145 |
/** |
| 146 |
* The main function responsible for returning the one true EDD_Metrics |
| 147 |
* instance to functions everywhere |
| 148 |
* |
| 149 |
* @since 0.1.0 |
| 150 |
* @return \Holler_Box The one true Holler_Box |
| 151 |
* |
| 152 |
*/ |
| 153 |
function holler_box_load() { |
| 154 |
Holler_Box::instance(); |
| 155 |
|
| 156 |
do_action( 'hollerbox/loaded' ); |
| 157 |
} |
| 158 |
|
| 159 |
add_action( 'plugins_loaded', 'holler_box_load' ); |
| 160 |
|
| 161 |
/** |
| 162 |
* The activation hook is called outside of the singleton because WordPress doesn't |
| 163 |
* register the call from within the class, since we are preferring the plugins_loaded |
| 164 |
* hook for compatibility, we also can't reference a function inside the plugin class |
| 165 |
* for the activation function. If you need an activation function, put it here. |
| 166 |
* |
| 167 |
* @since 0.1.0 |
| 168 |
* @return void |
| 169 |
*/ |
| 170 |
function holler_box_activation() { |
| 171 |
/* Activation functions here */ |
| 172 |
|
| 173 |
holler_box_load(); |
| 174 |
|
| 175 |
Holler_Reporting::instance()->create_table(); |
| 176 |
} |
| 177 |
|
| 178 |
register_activation_hook( __FILE__, 'holler_box_activation' ); |
| 179 |
|