*/ class Wpvr { /** * The loader that's responsible for maintaining and registering all hooks that power * the plugin. * * @since 8.0.0 * @access protected * @var Wpvr_Loader $loader Maintains and registers all hooks for the plugin. */ protected $loader; /** * The unique identifier of this plugin. * * @since 8.0.0 * @access protected * @var string $plugin_name The string used to uniquely identify this plugin. */ protected $plugin_name; /** * The current version of the plugin. * * @since 8.0.0 * @access protected * @var string $version The current version of the plugin. */ protected $version; /** * The post type for the plugin * * @since 8.0.0 * @var string $version The current version of the plugin. */ protected $post_type; /** * Instacne of WPVR_Post_Type * * @var object * @since 8.0.0 */ protected $wpvr_post_type; /** * Instance of Wpvr_Admin class * * @var object * @since 8.0.0 */ protected $plugin_admin; /** * Holds instances or information about the DIVI modules used in the builder. * * This property may store an array of module instances or configurations, depending * on how it's utilized within the class. It's used to manage and reference DIVI modules * effectively within custom builder implementations. * * @var array */ protected $divi_modules; /** * Define the core functionality of the plugin. * * Set the plugin name and the plugin version that can be used throughout the plugin. * Load the dependencies, define the locale, and set the hooks for the admin area and * the public-facing side of the site. * * @since 8.0.0 */ public function __construct() { if (defined('WPVR_VERSION')) { $this->version = WPVR_VERSION; } else { $this->version = '8.0.0'; } $this->plugin_name = 'wpvr'; $this->post_type = 'wpvr_item'; $this->load_dependencies(); $this->set_locale(); $this->define_admin_hooks(); $this->define_public_hooks(); add_action('plugins_loaded', array($this, 'load_plugin'), 99); add_action('init', array($this, 'register_wpvr_setup_wizard')); add_action('admin_init', array($this, 'admin_redirects')); } /** * Initializes and loads the DIVI modules into the class property. * * This method sets up the DIVI modules by fetching an instance of the WPVR_Divi_modules class * and storing it in the divi_modules property. It ensures that the modules are ready to be * used within the plugin. * * @since 8.4.8 This method was introduced in version 8.4.8 to streamline the initialization of DIVI modules. */ public function load_plugin() { $this->divi_modules = WPVR_Divi_modules::instance(); } /** * Load the required dependencies for this plugin. * * Include the following files that make up the plugin: * * - Wpvr_Loader. Orchestrates the hooks of the plugin. * - Wpvr_i18n. Defines internationalization functionality. * - Wpvr_Admin. Defines all hooks for the admin area. * - Wpvr_Public. Defines all hooks for the public side of the site. * * Create an instance of the loader which will be used to register the hooks * with WordPress. * * @since 8.0.0 * @access private */ private function load_dependencies() { /** * The class responsible for auto loading all files of the core plugin. */ require_once plugin_dir_path(__DIR__) . 'vendor/autoload.php'; /** * The class responsible for orchestrating the actions and filters of the core plugin. */ require_once plugin_dir_path(__DIR__) . 'includes/class-wpvr-loader.php'; /** * The class responsible for defining internationalization functionality of the plugin. */ require_once plugin_dir_path(__DIR__) . 'includes/class-wpvr-i18n.php'; $this->loader = new Wpvr_Loader(); } /** * Define the locale for this plugin for internationalization. * * Uses the Wpvr_i18n class in order to set the domain and to register the hook * with WordPress. * * @since 8.0.0 * @access private */ private function set_locale() { $plugin_i18n = new Wpvr_i18n(); $this->loader->add_action('init', $plugin_i18n, 'load_plugin_textdomain'); } /** * Register all of the hooks related to the admin area functionality * of the plugin. * * @since 8.0.0 * @access private */ private function define_admin_hooks() { if ( ! function_exists( 'is_plugin_active' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $this->plugin_admin = new Wpvr_Admin($this->get_plugin_name(), $this->get_version(), $this->get_post_type()); $this->loader->add_filter('plugin_action_links_' . WPVR_BASE, $this->plugin_admin, 'plugin_action_links_wpvr', 10, 4); $this->loader->add_action('admin_enqueue_scripts', $this->plugin_admin, 'enqueue_styles'); $this->loader->add_action('admin_enqueue_scripts', $this->plugin_admin, 'enqueue_scripts'); $this->loader->add_action('publish_wpvr_item', $this->plugin_admin, 'show_review_request_markups', 99999); $this->loader->add_action('admin_init', $this->plugin_admin, 'wpvr_trigger_based_review_helper', 99999); $high_res_image = get_option('high_res_image'); if ($high_res_image == 'true') { //phpcs:ignore add_filter('big_image_size_threshold', '__return_false'); } $this->loader->add_action('admin_init', $this->plugin_admin, 'trigger_rollback'); if (!is_plugin_active('wpvr-pro/wpvr-pro.php')){ $this->loader->add_action('include_floor_plan_meta_content', $this, 'include_floor_plan_meta_content', 10, 1); $this->loader->add_action('include_background_tour_meta_content', $this, 'include_background_tour_meta_content', 10, 1); $this->loader->add_action('include_street_view_meta_content', $this, 'include_street_view_meta_content', 10, 1); $this->loader->add_action('include_export_meta_content', $this, 'include_export_meta_content', 10, 2); } } public function include_floor_plan_meta_content($post_data) { ?>