I think you’e are only registering it with:
$scripts->add( 'user-profile-validator', ...)
but not enqueueing it.
Check e.g. how wp_register_script()
is a wrapper for the WP_Scripts::add()
method.
Additionally add:
wp_enqueue_script( 'user-profile-validator' );
in the relevant admin file to enqueue it or add it as a dependency for another enqueued script.
Note that password-strength-meter
is a dependency for the user-profile
script:
$scripts->add(
'user-profile',
"/wp-admin/js/user-profile$suffix.js",
array( 'jquery', 'password-strength-meter', 'wp-util' ),
false,
1
);
that’s enqueued with :
wp_enqueue_script( 'user-profile' );
in the backend.