. * * @package Booktics * @category Core * @author Arraytics * @version 1.0.19 */ use Booktics\Booktics; use Booktics\Providers\Global_Service_Provider; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; require_once __DIR__ . '/vendor/autoload.php'; // Define constant for the Plugin file. define( 'BOOKTICS_PLUGIN_NAME', "Booktics"); defined( 'BOOKTICS_FILE' ) || define( 'BOOKTICS_FILE', __FILE__ ); defined( 'BOOKTICS_DIR' ) || define( 'BOOKTICS_DIR', __DIR__ ); defined( 'BOOKTICS_VERSION' ) || define( 'BOOKTICS_VERSION', '1.0.19' ); global $booktics_container; $booktics_container = new \Booktics\Container\Container(); $booktics_container->addServiceProvider( 'global', Global_Service_Provider::class ); /** * Booktics container * * @return \Booktics\Container\Container */ function booktics_container() { global $booktics_container; return $booktics_container; } /** * Registers the uninstaller form backend. * * @return void */ function booktics_register_uninstaller_form() { try { if ( class_exists( 'UninstallerForm\UninstallerForm' ) && is_callable( [ '\UninstallerForm\UninstallerForm', 'init' ] ) ) { $reflection = new ReflectionMethod( '\UninstallerForm\UninstallerForm', 'init' ); $totalParams = $reflection->getNumberOfParameters(); // Maximum number of parameters allowed if( 6 === $totalParams ) { $uninstaller_form = new \UninstallerForm\UninstallerForm(); $uninstaller_form->init( 'Booktics', // Plugin name 'booktics', // Plugin Slug __FILE__, 'booktics', // Text Domain Name 'booktics-feedback-modal', // plugins-admin-script-handler 'https://arraytics.com/?fluentcrm=1&route=contact&hash=09343e4f-30f7-4bda-b8b6-d4b6f90754ad' // web hook for booktics ); } else { // For compatibility with older versions of uninstaller form $uninstaller_form = new \UninstallerForm\UninstallerForm(); $uninstaller_form->init( 'Booktics', // Plugin name 'booktics', // Plugin Slug __FILE__, 'booktics', // Text Domain Name 'booktics-feedback-modal' ); } } } catch ( \Throwable $e ) { if ( defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log( sprintf( 'Booktics: Error in initiating uninstaller form – %s (Line %d, File %s)', $e->getMessage(), $e->getLine(), $e->getFile() ) ); } } } /** * Add a "Go Pro" action link on the Plugins page. * Hidden when the pro plugin is active. */ if ( ! function_exists( 'booktics_add_go_pro_action_link' ) ) { function booktics_add_go_pro_action_link( $links ) { if ( function_exists( 'booktics_pro' ) ) { return $links; } $go_pro = sprintf( '%2$s', esc_url( 'https://arraytics.com/booktics/pricing/' ), esc_html__( 'Go Pro', 'booktics' ) ); $links[] = $go_pro; return $links; } } add_filter( 'plugin_action_links_' . plugin_basename( BOOKTICS_FILE ), 'booktics_add_go_pro_action_link' ); /** * Load Booktics Plugin when all plugins loaded. * * @return Booktics The singleton instance of Booktics. */ function booktics() { add_action( 'admin_init', 'booktics_handle_conflicting_plugins' ); add_action( 'admin_notices', 'booktics_show_conflict_deactivation_notice' ); booktics_register_uninstaller_form(); return Booktics::instance(); } // Let's go. booktics();