Update Ultimate Member plugin honeypot CSS and JS

Removed wp_add_inline_script/style and used `um_request` as default honeypot key in um-styles.css and um-scripts.js.
This commit is contained in:
Mykyta Synelnikov
2025-02-19 12:36:26 +02:00
parent a0d19b7ab6
commit 959bd82cdc
5 changed files with 16 additions and 15 deletions
+5
View File
@@ -1152,3 +1152,8 @@ small.um-max-filesize span{
float: none;
height: auto;
}
/*Makes the honeypot invisible.*/
.um_request_name {
display: none !important;
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+9
View File
@@ -698,3 +698,12 @@ jQuery(document).ready(function() {
}
});
});
// Makes the honeypot.
jQuery( window ).on( 'load', function() {
let $honeypotField = jQuery('input[name="um_request"]');
if ( $honeypotField.length ) {
$honeypotField.val('');
}
});
+1 -1
View File
File diff suppressed because one or more lines are too long
-13
View File
@@ -144,16 +144,6 @@ final class Enqueue extends \um\common\Enqueue {
$localize_data = apply_filters( 'um_enqueue_localize_data', $localize_data );
wp_localize_script( 'um_scripts', 'um_scripts', $localize_data );
// Makes the honeypot.
ob_start();
?>
jQuery( window ).on( 'load', function() {
jQuery('input[name="<?php echo esc_js( UM()->honeypot ); ?>"]').val('');
});
<?php
$inline_script = ob_get_clean();
wp_add_inline_script( 'um_scripts', $inline_script );
wp_register_script( 'um_dropdown', $js_url . 'dropdown' . $suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_members', $js_url . 'um-members' . $suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks', 'jquery-masonry', 'um_scripts' ), UM_VERSION, true );
@@ -204,9 +194,6 @@ final class Enqueue extends \um\common\Enqueue {
$deps = array_merge( array( 'um_ui', 'um_tipsy', 'um_raty', 'select2', 'um_fileupload', 'um_common', 'um_responsive', 'um_modal' ), self::$fonticons_handlers );
wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', $deps, UM_VERSION );
// Makes the honeypot invisible.
wp_add_inline_style( 'um_styles', '.' . esc_attr( UM()->honeypot ) . '_name { display: none !important; }' );
wp_register_style( 'um_members', $css_url . 'um-members' . $suffix . '.css', array( 'um_styles' ), UM_VERSION );
// RTL styles.
if ( is_rtl() ) {