*/ class adfoxly_Public { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; /** * The settings of this plugin. * * @since 1.2.4 * @access private * @var string $settings The current settings from wp_options table. */ private $settings; /** * Initialize the class and set its properties. * * @since 1.0.0 * * @param string $plugin_name The name of the plugin. * @param string $version The version of this plugin. */ public function __construct( $plugin_name, $version ) { $this->plugin_name = $plugin_name; $this->version = $version; $this->settings = get_option( 'adfoxly_settings' ); $this->load_dependencies(); } private function load_dependencies() { /** * The class responsible for defining all actions that occur in the public-facing * side of the site. */ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/adfoxly-public-display.php'; } /** * Register the stylesheets for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in adfoxly_Loader as all of the hooks are defined * in that particular class. * * The adfoxly_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ // wp_enqueue_style( $this->plugin_name . '-adfoxly-jquery-confirm', plugin_dir_url( __FILE__ ) . 'vendor/jquery-confirm/jquery-confirm.min.css', array(), $this->version, 'all' ); wp_enqueue_style( $this->plugin_name . '-adfoxly-public', plugin_dir_url( __FILE__ ) . 'css/adfoxly-public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in adfoxly_Loader as all of the hooks are defined * in that particular class. * * The adfoxly_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ // wp_enqueue_script( $this->plugin_name . '-adfoxly-jquery-confirm', plugin_dir_url( __FILE__ ) . 'vendor/jquery-confirm/jquery-confirm.min.js', array( 'jquery' ), $this->version, false ); if ( ( defined( 'ADFOXLY_SENTRY_OPTIN' ) && ADFOXLY_SENTRY_OPTIN === true ) || ( isset( $this->settings[ 'adfoxly-privacy-sentry' ] ) && $this->settings[ 'adfoxly-privacy-sentry' ] === 'yes' ) ) { wp_enqueue_script( $this->plugin_name . '-adfoxly-sentry', 'https://browser.sentry-cdn.com/5.2.1/bundle.min.js' ); wp_enqueue_script( $this->plugin_name . '-adfoxly-sentry-inline', plugin_dir_url( __FILE__ ) . 'js/adfoxly-public-sentry.js' ); wp_add_inline_script( $this->plugin_name . '-adfoxly-sentry-inline', 'Sentry.init({ dsn: "https://5e3adf76e9e84f85ad5ca390cde350b0@sentry.io/1428644" });' ); } wp_enqueue_script( $this->plugin_name . '-public', plugin_dir_url( __FILE__ ) . 'js/adfoxly-public.js', array( 'jquery' ), $this->version, false ); wp_enqueue_script( $this->plugin_name . "+ajax", plugin_dir_url( __FILE__ ) . 'js/adfoxly-public-ajax.js', array( 'jquery' ), $this->version, false ); } }