How can we help?

Search for answers or browse our knowledge base.

Table of Contents

List of hooks in Melapress Login Security

Melapress Login Security hooks allow you to hook into the plugin’s functionality and modify its behavior. This knowledge base article documents all hooks and parameters found in Melapress Login Security.

Index of hooks:

Melapress Login Security hooks

ppwmp_filter_allowed_special_chars

Function

This hook allows you to alter the list of special characters used in password policies. With this hook, you could, for instance, allow the hash character to be used by users when setting their passwords. It offers a single parameter which is the string of default characters and an example of its use can be seen below

Parameters

$chars – Special characters you want to allow

Example code


add_filter( 'ppwmp_filter_allowed_special_chars', array( $this,
'special_chars_custom' ), 15, 1 );

// From here we can modify the string as we see fit with the following

function special_chars_custom( $chars ) {
return str_replace( '#', '', $chars );
}

ppm_enable_custom_forms_array

Function

This hook allows you to apply any Melapress Login Security policy validations to custom front-end forms. Forms inputs/fields can be targeted using CSS selectors.

In the code example given below, we first add the filter and then assign our custom function. Then, we pass the parameters through the $args array, to which we append our parameters.

Parameters

$args – An array of parameters that includes:

    • form_selector – The unique class or ID given to the overall form element itself; the following items are child objects of this form.
      • pw_field_selector – The selector of the form element you wish to apply the PPMWP JS to.
      • form_submit_selector – The selector for the “submit” button of your form, which is used to apply “disable.” This stops the form from being submitted whilst an invalid password is present.
      • elements_to_hide – The selector for any elements you wish to remove from the user’s view. This is ideal for hiding unwanted “password hints,” leaving just the hints provided by our plugin in their place

Example code


add_filter( 'ppm_enable_custom_forms_array', 'example_ppm_enable_custom_form' );
function example_ppm_enable_custom_form_array( $args ) {
$new = array(
array(
'form_selector' => '.lost_reset_password',
'pw_field_selector' => '#password_1',
'form_submit_selector' => '#submit_password',
'elements_to_hide' => '#old_pw_hints',
),
);
return array_merge( $args, $new );
}

mls_override_has_expired_priority”

Function

This hook allows you to set the priority of the has_expired function within WordPress’ login processes. The hook runs on WordPress’ own ‘wp_authenticate_user’ hook. The default priority is 10; however, this hook allows you to change that.

Parameters

Default – 10. The lower the number the higher the priority.

Example code


add_filter( 'mls_override_has_expired_priority', 'override_has_expired_priority' );
function override_has_expired_priority() {
return 10;
}

 Boost your sites’ security and management! Download our free eBook on WordPress oversight.

Uploading WP 2FA as a zip file in WordPress
WP 2FA in the WordPress plugin repository
Close

Installing WP 2FA Free

Congratulations on taking the first step towards enhancing your WordPress site's security with WP 2FA Free! You're now on your way to protecting your valuable data and ensuring peace of mind. No coding or technical knowledge is required.

 

Below are two ways to install WP 2FA on your website:

Go to your plugin dashboard on your site, then go to "Add New", and then search for WP 2FA.

Download the WP 2FA plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2

Uploading CAPTCHA 4WP as a zip file in WordPress
CAPTCHA 4WP in the WordPress plugin repository
Close

Installing CAPTCHA 4WP Free

Well done you. You're one step closer to safeguarding your WordPress website from spam and automated attacks with CAPTCHA 4WP. You'll be able to effortlessly integrate CAPTCHA into your forms and enjoy a website with enhanced security.

 

Below are two ways to install CAPTCHA 4WP on your website:

Go to your plugin dashboard on your site, then go to "Add New", and then search for CAPTCHA 4WP.

Download the CAPTCHA 4WP plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2

Uploading WP Activity Log as a zip file in WordPress
WP Activity Log in the WordPress plugin repository
Close

Installing WP Activity Log Free on your website

You deserve a pat on the back for choosing to record user actions and changes on your website. That is the first step towards better user accountability, easier troubleshooting of website security, and many other benefits of issues.

 

Below are the two ways to install WP Activity Log on your website:

Go to your plugin dashboard on your site, then go to "Add New" and then search for WP Activity Log.

Download the WP Activity Log plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2

Uploading Melapress Login Security as a zip file in WordPress
Melapress Login Security in the WordPress plugin repository
Close

Installing Melapress Login Security Free

Congratulations on taking control of your WordPress website's security by implementing robust login and password policies with Melapress Login Security. You can change your login page URL, limit failed login attempts, and reset passwords.

 

Below are two ways to install Melapress Login Security on your website:

Go to your plugin dashboard on your site, then go to "Add New" and then search for Melapress Login Security.

Download the Melapress Login Security plugin zip, then select upload in your plugin dashboard under "Add New".

OPTION 1

OPTION 2