HEX
Server: Apache
System: Linux uws7-179.cafe24.com 3.10.0-1160.119.1p.el7.x86_64 #1 SMP Thu Sep 11 14:15:01 KST 2025 x86_64
User: medikors (1589)
PHP: 7.3.1p1
Disabled: mysql_pconnect
Upload Files
File: /medikors/www/wp-content/plugins/happy-elementor-addons-pro/classes/assets-manager.php
<?php
namespace Happy_Addons_Pro;

defined( 'ABSPATH' ) || die();

class Assets_Manager {

    /**
     * Bind hook and run internal methods here
     */
    public static function init() {
        if ( ! hapro_has_valid_license() ) {
            return;
        }
        // Frontend scripts
        add_action( 'wp_enqueue_scripts', [ __CLASS__, 'frontend_register' ] );
        add_action( 'happyaddons_enqueue_assets', [ __CLASS__, 'frontend_enqueue' ] );

        add_filter( 'happyaddons_get_styles_file_path', [ __CLASS__, 'set_styles_file_path' ], 10, 3 );
    }

    public static function set_styles_file_path( $file_path, $file_name, $is_pro ) {
        if ( $is_pro ) {
            $file_path = HAPPY_ADDONS_PRO_DIR_PATH . "assets/css/widgets/{$file_name}.min.css";
        }
        return $file_path;
    }

    public static function frontend_register() {
        $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '.min' : '';

	    // Prism
	    wp_register_style(
		    'prism',
		    HAPPY_ADDONS_PRO_ASSETS . 'vendor/prism/css/prism.min.css',
		    [],
		    HAPPY_ADDONS_PRO_VERSION
	    );
	    wp_register_script(
		    'prism',
		    HAPPY_ADDONS_PRO_ASSETS . 'vendor/prism/js/prism.js',
		    [ 'jquery' ],
		    HAPPY_ADDONS_PRO_VERSION,
		    true
	    );

	    //Countdown
	    //deregister to avoid same handler conflict.
	    wp_deregister_script('jquery-countdown');
	    wp_register_script(
		    'jquery-countdown',
		    HAPPY_ADDONS_PRO_ASSETS . 'vendor/countdown/js/countdown' . $suffix . '.js',
		    [ 'jquery' ],
		    HAPPY_ADDONS_PRO_VERSION,
		    true
	    );

	    //Animated Text
	    wp_register_script(
		    'animated-text',
		    HAPPY_ADDONS_PRO_ASSETS . 'vendor/animated-text/js/animated-text.js',
		    [ 'jquery' ],
		    HAPPY_ADDONS_PRO_VERSION,
		    true
	    );

	    //Keyframes
	    wp_register_script(
		    'jquery-keyframes',
		    HAPPY_ADDONS_PRO_ASSETS . 'vendor/keyframes/js/jquery.keyframes.min.js',
		    [ 'jquery' ],
		    HAPPY_ADDONS_PRO_VERSION,
		    true
	    );

	    // HappyAddons Pro
	    wp_register_style(
		    'happy-addons-pro',
		    HAPPY_ADDONS_PRO_ASSETS . 'css/main' . $suffix . '.css',
		    [],
		    HAPPY_ADDONS_PRO_VERSION
	    );
	    wp_register_script(
		    'happy-addons-pro',
		    HAPPY_ADDONS_PRO_ASSETS . 'js/happy-addons-pro' . $suffix . '.js',
		    [ 'jquery' ],
		    HAPPY_ADDONS_PRO_VERSION,
		    true
	    );

	    //Localize scripts
	    wp_localize_script( 'happy-addons-pro', 'HappyProLocalize', [
		    'ajax_url' => admin_url( 'admin-ajax.php' ),
		    'nonce' => wp_create_nonce( 'happy_addons_pro_nonce' ),
	    ] );
    }

    public static function frontend_enqueue( $is_cache ) {
        if ( ! $is_cache ) {
            wp_enqueue_style( 'happy-addons-pro' );
            wp_enqueue_script( 'happy-addons-pro' );
        } else {
            wp_enqueue_script( 'happy-addons-pro' );
        }
    }
}