| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/hello-plus/modules/admin/components/ |
Upload File : |
<?php
namespace HelloPlus\Modules\Admin\Components;
use HelloPlus\Includes\Utils;
use HelloPlus\Modules\Admin\Classes\Menu\Pages\Setup_Wizard;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
class Scripts_Controller {
public function enqueue_hello_plus_onboarding_scripts() {
$screen = get_current_screen();
if ( ! Utils::ends_with( $screen->id, Setup_Wizard::SETUP_WIZARD_PAGE_SLUG ) ) {
return;
}
$handle = 'helloplus-onboarding';
$asset_path = HELLOPLUS_SCRIPTS_PATH . 'helloplus-onboarding.asset.php';
$asset_url = HELLOPLUS_SCRIPTS_URL;
if ( ! file_exists( $asset_path ) ) {
throw new \Exception( 'You need to run `npm run build` for the "hello-plus" first.' );
}
$script_asset = require $asset_path;
$script_asset['dependencies'][] = 'wp-util';
wp_enqueue_script(
$handle,
HELLOPLUS_SCRIPTS_URL . "$handle.js",
$script_asset['dependencies'],
$script_asset['version'],
true
);
wp_set_script_translations( $handle, 'hello-plus' );
}
public function enqueue_whats_new_onboarding_scripts() {
$screen = get_current_screen();
if ( 'plugins' !== $screen->id ) {
return;
}
$handle = 'helloplus-whats-new';
$asset_path = HELLOPLUS_SCRIPTS_PATH . $handle . '.asset.php';
$asset_url = HELLOPLUS_SCRIPTS_URL;
if ( ! file_exists( $asset_path ) ) {
throw new \Exception( 'You need to run `npm run build` for the "hello-plus" first.' );
}
$script_asset = require $asset_path;
$script_asset['dependencies'][] = 'wp-util';
wp_enqueue_script(
$handle,
HELLOPLUS_SCRIPTS_URL . "$handle.js",
$script_asset['dependencies'],
$script_asset['version'],
true
);
wp_set_script_translations( $handle, 'hello-plus' );
}
public function __construct() {
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_hello_plus_onboarding_scripts' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_whats_new_onboarding_scripts' ] );
}
}