| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Hydra Booking — Appointment Scheduling & Booking Calendar |
| 4 |
* Plugin URI: https://hydrabooking.com/ |
| 5 |
* Description: Appointment Booking Plugin with Automated Scheduling - Apple/Outlook/ Google Calendar, WooCommerce, Zoom, Fluent Forms, Zapier, Mailchimp & CRM Integration. |
| 6 |
* Version: 1.2.1 |
| 7 |
* Tested up to: 7.0 |
| 8 |
* Author: Themefic |
| 9 |
* Author URI: https://themefic.com/ |
| 10 |
* License: GPL-2.0+ |
| 11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 12 |
* Text Domain: hydra-booking |
| 13 |
* Domain Path: /languages |
| 14 |
*/ |
| 15 |
|
| 16 |
// don't load directly |
| 17 |
defined('ABSPATH') || exit; |
| 18 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 19 |
|
| 20 |
use HydraBooking\Admin\Controller\Enqueue; |
| 21 |
|
| 22 |
class THB_INIT |
| 23 |
{ |
| 24 |
// CONSTARACT |
| 25 |
public function __construct() |
| 26 |
{ |
| 27 |
// DEFINE PATH |
| 28 |
|
| 29 |
define('TFHB_PATH', plugin_dir_path(__FILE__)); |
| 30 |
define('TFHB_URL', plugin_dir_url(__FILE__)); |
| 31 |
|
| 32 |
define( 'TFHB_VERSION', '1.2.1' ); |
| 33 |
define( 'TFHB_BASE_FILE', __FILE__); |
| 34 |
define( 'TFHB_DEV_MODE', false ); // Set true to enable dev mode |
| 35 |
|
| 36 |
|
| 37 |
// Load Vendor Auto Load |
| 38 |
if (file_exists(TFHB_PATH . '/vendor/autoload.php')) { |
| 39 |
require_once TFHB_PATH . '/vendor/autoload.php'; |
| 40 |
} |
| 41 |
|
| 42 |
// Helper Functions |
| 43 |
if (file_exists(TFHB_PATH . '/includes/Includes.php')) { |
| 44 |
|
| 45 |
require_once TFHB_PATH . '/includes/Includes.php'; |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
add_action('init', array($this, 'init')); |
| 50 |
add_action('current_screen', array($this, 'tfhb_get_plugin_screen')); |
| 51 |
|
| 52 |
add_action('plugins_loaded', array($this, 'tfhb_load_textdomain')); |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
function tfhb_load_textdomain() |
| 57 |
{ |
| 58 |
load_plugin_textdomain('hydra-booking', false, dirname(plugin_basename(__FILE__)) . '/languages/'); |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
public function init() |
| 63 |
{ |
| 64 |
|
| 65 |
|
| 66 |
//Register text domain |
| 67 |
load_plugin_textdomain('hydra-booking', false, basename(dirname(__FILE__)) . '/languages'); |
| 68 |
|
| 69 |
// Load Appsero Tracker |
| 70 |
$this->tfhb_appsero_init_tracker_hydra_booking(); |
| 71 |
|
| 72 |
new HydraBooking\Admin\Controller\ScheduleController(); |
| 73 |
|
| 74 |
// Post Type |
| 75 |
new HydraBooking\PostType\Meeting\Meeting_CPT(); |
| 76 |
new HydraBooking\PostType\Booking\Booking_CPT(); |
| 77 |
|
| 78 |
// enqueue |
| 79 |
new Enqueue(); |
| 80 |
|
| 81 |
// Create a New host Role |
| 82 |
new HydraBooking\Admin\Controller\RouteController(); |
| 83 |
if (is_admin()) { |
| 84 |
// Load Admin Class |
| 85 |
new HydraBooking\Admin\Admin(); |
| 86 |
} |
| 87 |
|
| 88 |
// Load iCalendar Controller |
| 89 |
new HydraBooking\Admin\Controller\iCalendarController(); |
| 90 |
|
| 91 |
// load Promo Notice |
| 92 |
new HydraBooking\Admin\Controller\PromoNotice(); |
| 93 |
new HydraBooking\Admin\Controller\DashboardWidget(); |
| 94 |
|
| 95 |
// Load App Class |
| 96 |
new HydraBooking\App\App(); |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
public function tfhb_get_plugin_screen() |
| 103 |
{ |
| 104 |
$current_screen = get_current_screen(); |
| 105 |
if (isset($_GET['page']) && $_GET['page'] === 'hydra-booking') { |
| 106 |
// remove admin notice |
| 107 |
add_action('in_admin_header', array($this, 'tfhb_hide_notices'), 99); |
| 108 |
} |
| 109 |
} |
| 110 |
|
| 111 |
public function tfhb_hide_notices() |
| 112 |
{ |
| 113 |
remove_all_actions('user_admin_notices'); |
| 114 |
remove_all_actions('admin_notices'); |
| 115 |
} |
| 116 |
|
| 117 |
|
| 118 |
/** |
| 119 |
* Initialize the plugin tracker |
| 120 |
* |
| 121 |
* @return void |
| 122 |
*/ |
| 123 |
function tfhb_appsero_init_tracker_hydra_booking() |
| 124 |
{ |
| 125 |
|
| 126 |
if (! class_exists('Appsero\Client')) { |
| 127 |
require_once __DIR__ . '/appsero/src/Client.php'; |
| 128 |
} |
| 129 |
|
| 130 |
$client = new Appsero\Client('685ed86d-9a98-46e2-9f07-79206f5fd69b', 'Hydra Booking – All-in-One Appointment Management Solution', __FILE__); |
| 131 |
$notice = sprintf($client->__trans('Want to help make <strong>%1$s</strong> even more awesome? Allow %1$s to collect non-sensitive diagnostic data and usage information. I agree to get Important Product Updates & Discount related information on my email from %1$s (I can unsubscribe anytime).'), $client->name); |
| 132 |
$client->insights()->notice($notice); |
| 133 |
// Active insights |
| 134 |
$client->insights()->init(); |
| 135 |
} |
| 136 |
} |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
new THB_INIT(); |
| 141 |
|