set_basename( false, __FILE__ ); return; } require_once __DIR__ . '/vendor/autoload.php'; if ( !function_exists( 'all_in_one_invite_codes_plugin_dependencies_slug' ) ) { /** * Let the running copy of All in One Invite Codes satisfy "Requires Plugins: all-in-one-invite-codes". * * WordPress (6.5+) matches plugin dependencies by folder name, and the premium * build lives in `all-in-one-invite-codes-premium`. Without this, add-ons that * declare All in One Invite Codes as a dependency could not be activated next * to the premium build. * * @param string $slug Dependency slug from a plugin's "Requires Plugins" header. * * @return string */ function all_in_one_invite_codes_plugin_dependencies_slug( $slug ) { if ( 'all-in-one-invite-codes' === $slug ) { return basename( __DIR__ ); } return $slug; } add_filter( 'wp_plugin_dependencies_slug', 'all_in_one_invite_codes_plugin_dependencies_slug' ); } if ( !class_exists( 'AllinOneInviteCodes' ) ) { /** * Class AllinOneInviteCodes */ class AllinOneInviteCodes { /** * @var string */ public static $version = '1.3.6'; /** * Instance of this class * * @var $instance AllinOneInviteCodes */ protected static $instance = null; /** * @var string Assets URL */ public static $assets; public static $include_assets = array(); public static $slug = 'all-in-one-invite-codes'; /** * Initiate the class * * @package All in One Invite Codes * @since 0.1 */ public function __construct() { register_activation_hook( __FILE__, array($this, 'plugin_activation') ); $this->load_constants(); add_action( 'init', array($this, 'init_hook'), 1 ); add_action( 'init', array($this, 'includes'), 4 ); add_action( 'admin_menu', array($this, 'all_in_one_invite_codes_bundle_screen_menu'), 9999 ); add_action( 'admin_enqueue_scripts', array($this, 'admin_styles'), 102 ); add_action( 'admin_enqueue_scripts', array($this, 'admin_js'), 102 ); add_action( 'wp_footer', array($this, 'front_js_loader') ); register_deactivation_hook( __FILE__, array($this, 'plugin_deactivation') ); } /** * Add the bundle screen menu. */ public function all_in_one_invite_codes_bundle_screen_menu() { $fs = all_in_one_invite_codes_core_fs(); // Bundle licenses activate on the hidden Professional plan, which makes the // install paying; the plan is never sold on its own. if ( $fs->is_not_paying() ) { add_submenu_page( 'edit.php?post_type=tk_invite_codes', __( 'Bundle', 'all-in-one-invite-codes' ), __( 'Go Pro!', 'all-in-one-invite-codes' ), 'manage_options', 'tk_invite_codes_bundle_screen', 'tk_pricing_page_render', 99 ); } } /** * Defines constants needed throughout AllinOneInviteCodes * * @package All in One Invite Codes * @since 0.1 */ public function load_constants() { /** * Define the plugin version */ define( 'TK_ALL_IN_ONE_INVITE_CODES_VERSION', self::getVersion() ); if ( !defined( 'TK_ALL_IN_ONE_INVITE_CODES_PLUGIN_URL' ) ) { /** * Define the plugin url */ define( 'TK_ALL_IN_ONE_INVITE_CODES_PLUGIN_URL', plugins_url( '/', __FILE__ ) ); } if ( !defined( 'TK_ALL_IN_ONE_INVITE_CODES_INSTALL_PATH' ) ) { /** * Define the install path */ define( 'TK_ALL_IN_ONE_INVITE_CODES_INSTALL_PATH', dirname( __FILE__ ) . '/' ); } if ( !defined( 'TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH' ) ) { /** * Define the include path */ define( 'TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH', TK_ALL_IN_ONE_INVITE_CODES_INSTALL_PATH . 'includes/' ); } if ( !defined( 'TK_ALL_IN_ONE_INVITE_CODES_TEMPLATE_PATH' ) ) { /** * Define the template path */ define( 'TK_ALL_IN_ONE_INVITE_CODES_TEMPLATE_PATH', TK_ALL_IN_ONE_INVITE_CODES_INSTALL_PATH . 'templates/' ); } } /** * Defines all_in_one_invite_codes_init action * * This action fires on WP's init action and provides a way for the rest of WP, * as well as other dependent plugins, to hook into the loading process in an * orderly fashion. * * @package All in One Invite Codes * @since 0.1 */ public function init_hook() { $this->set_globals(); do_action( 'all_in_one_invite_codes_init' ); } /** * Setup all globals * * @package All in One Invite Codes * @since 0.1 */ static function set_globals() { global $all_in_one_invite_codes; /* * Get AllinOneInviteCodes options * * @filter: all_in_one_invite_codes_set_globals * */ $all_in_one_invite_codes = apply_filters( 'tk_all_in_one_invite_codes_set_globals', get_option( 'tk_all_in_one_invite_codes_options' ) ); return $all_in_one_invite_codes; } /** * Include files needed by AllinOneInviteCodes * * @package All in One Invite Codes * @since 0.1 */ public function includes() { require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'functions.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'default-registration.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'process-invite-code.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'generate-invite-codes.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'shortcodes.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'send-invite-email.php'; if ( is_admin() ) { require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/admin-settings.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/tree.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/invite-codes-bulk.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/admin-ajax.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/invite-codes-post-type.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/invite-codes-options.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . 'admin/pricing-page/pricing-page.php'; require_once TK_ALL_IN_ONE_INVITE_CODES_INCLUDES_PATH . '/admin/pricing-page-config.php'; } } /** * Enqueue the needed CSS for the admin screen * * @param $hook_suffix * * @since 0.1 * * @package All in One Invite Codes */ function admin_styles( $hook_suffix ) { } /** * Enqueue the needed JS for the admin screen * * @param $hook_suffix * * @since 0.1 * * @package All in One Invite Codes */ function admin_js( $hook_suffix ) { wp_enqueue_script( 'all-in-one-invite_codes-admin-js', TK_ALL_IN_ONE_INVITE_CODES_PLUGIN_URL . 'assets/admin/js/admin.js', array(), self::getVersion(), true ); wp_localize_script( 'all-in-one-invite_codes-admin-js', 'allInOneInviteCodesAdminJs', array( 'nonce' => wp_create_nonce( 'all_in_one_invite_code_nonce' ), ) ); } /** * Check if a all_in_one_invite_codes view is displayed and load the needed styles and scripts * * @package All in One Invite Codes * @since 0.1 */ function front_js_loader() { if ( defined( 'DOING_AJAX' ) && DOING_AJAX && defined( 'DOING_CRON' ) && DOING_CRON ) { return; } if ( self::getNeedAssets() ) { wp_enqueue_script( 'all-in-one-invite_codes-front-js', TK_ALL_IN_ONE_INVITE_CODES_PLUGIN_URL . 'assets/js/front.js', array('jquery'), self::getVersion(), true ); wp_localize_script( 'all-in-one-invite_codes-front-js', 'allInOneInviteCodesFrontJs', array( 'nonce' => wp_create_nonce( 'all_in_one_invite_code_nonce' ), ) ); add_thickbox(); } } public static function error_log( $message ) { if ( !empty( $message ) && defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- guarded behind WP_DEBUG/WP_DEBUG_LOG. error_log( self::getSlug() . ' -- ' . $message ); } } /** * @return string */ public static function getNeedAssets() { if ( empty( self::$include_assets ) ) { return false; } return in_array( true, self::$include_assets, true ); } /** * @param string $include_assets * @param string $form_slug */ public static function setNeedAssets( $include_assets, $form_slug ) { self::$include_assets[$form_slug] = $include_assets; } /** * Get plugin version * * @return string */ static function getVersion() { return self::$version; } /** * Get plugins slug * * @return string */ static function getSlug() { return self::$slug; } /** * Enqueue the needed JS for the form in the frontend * * @package All in One Invite Codes * @since 0.1 */ function front_js_css() { } /** * Update form 1.x version * * @package All in One Invite Codes * @since 0.1 */ function update_db_check() { if ( !is_admin() ) { return; } } /** * Plugin activation * * @since 0.1 */ function plugin_activation() { } /** * Plugin deactivation * * @since 0.1 */ function plugin_deactivation() { } /** * Return an instance of this class. * * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if ( null == self::$instance ) { self::$instance = new self(); } return self::$instance; } } /** * Create a helper function for easy SDK access. * * @return Freemius */ if ( !function_exists( 'all_in_one_invite_codes_core_fs' ) ) { function all_in_one_invite_codes_core_fs() { global $all_in_one_invite_codes_core_fs; if ( !isset( $all_in_one_invite_codes_core_fs ) ) { $all_in_one_invite_codes_core_fs = fs_dynamic_init( array( 'id' => '3322', 'slug' => 'all-in-one-invite-codes', 'type' => 'plugin', 'public_key' => 'pk_955be38b0c4d2a2914a9f4bc98355', 'is_premium' => false, 'has_addons' => true, 'has_paid_plans' => true, 'is_org_compliant' => true, 'menu' => array( 'slug' => 'edit.php?post_type=tk_invite_codes', 'support' => false, 'pricing' => false, ), 'bundle_id' => '8013', 'bundle_public_key' => 'pk_b8b8e319fd537d6d44d73a448f64e', 'bundle_license_auto_activation' => true, 'is_live' => true, ) ); } return $all_in_one_invite_codes_core_fs; } all_in_one_invite_codes_core_fs(); do_action( 'all_in_one_invite_codes_core_fs_loaded' ); } function all_in_one_invite_codes_php_version_admin_notice() { ?>

add_filter( 'handle_gdpr_admin_notice', '__return_true' ); } } activate_all_in_one_invite_codes_at_plugin_loader(); }