benhuson / expire-users Goto Github PK
View Code? Open in Web Editor NEWSet expiry dates for users in WordPress
Home Page: http://wordpress.org/plugins/expire-users/
Set expiry dates for users in WordPress
Home Page: http://wordpress.org/plugins/expire-users/
=== Expire Users === Contributors: husobj Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MW3TJNHM283LU Tags: users, password, expire, login, roles Requires at least: 5.4 Tested up to: 6.2 Stable tag: 1.2.1 Requires PHP: 7.4 License: GPLv2 or later Set expiry dates for user logins. == Description == > Important security update - if you are using version 0.2 or earlier please upgrade This plugin allows you to set expiry dates for user logins. You can set a user to: * Never expire (default) * Expire in X days, weeks, moths or years * Expire on a specific date When a user expires you can: * Change the role of that user * Replace the user's password with a randomly generated one * Send an email notification to the user * Send an email notification to the site administrator * Remove expiry details and allow user to continue to login * Perform you own actions using an [`expire_users_expired`](https://github.com/benhuson/expire-users/wiki/expire_users_expired) hook You can automatically assign expiry details to users who sign up via the register form. The email notification messages can be configured in the admin settings. Please post in the [support forum](http://wordpress.org/support/plugin/expire-users) if you have any questions, or refer to the [documentation](https://github.com/benhuson/expire-users/wiki), [report bugs](https://github.com/benhuson/expire-users/issues) and [submit translations](https://github.com/benhuson/expire-users/issues) at the plugin's [GitHub page](https://github.com/benhuson/expire-users/). == Installation == To install and configure this plugin... 1. Upload or install the plugin through your WordPress admin. 2. Activate the plugin via the 'Plugins' admin menu. 3. Edit a user to set password expiry options. = Upgrading = If you are upgrading manually via FTP rather that through the WordPress automatic upgrade link, please de-activate and re-activate the plugin to ensure the plugin upgrades correctly. == Frequently Asked Questions == None at present. == Screenshots == 1. Expire Date column in users admin. 2. Edit a user's expiry date and expiry actions. 3. Edit email notification messages. 4. User login expired error. == Changelog == = 1.2.1 = * Tested up to WordPress 6.2 * Tested up to PHP 8.2 = 1.2 = * Tested up to WordPress 5.6 * Added `expire_users_current_user_expire_countdown` shortcode. * Fix `expire_users_email_notification_{string}` and `expire_users_email_admin_notification_{string}` being applied in the inverse contexts. Props [@Chaddles23](https://github.com/Chaddles23/) = 1.1 = * Make Expire Date column sortable in admin panel. Props @loreboldo. * Fix error when user tries to reset password. * Fix issue when expiry check on login happens too early. * Fix translation of "ERROR:". = 1.0.4 = * On expiry, remove expiry date and continue to allow login if set. Props @loreboldo. = 1.0.3 = * If user logged in, check expiration while browsing. * Prepare for translation. = 1.0.2 = * Rollback changes causing multiple emails to be sent! = 1.0.1 = * Fix PHP7 class constructor warnings. * Check and expire users if needed when displaying in the admin. * Check if cron needs setting up when in admin. = 1.0 = * Add expiry fields to new user admin page. * Add 'expire_users_admin_email' filter to allow admin notifications to be sent to a different email address. * Add French translation. Props ateruel. * Add Italian translation. Props Marco Chiesi. * Tested up to WordPress 4.2 = 0.9 = * Expired dates are displayed as red in admin. * Dates are correctly internationalized. * JavaScript and CSS files are only loaded on the required pages in admin. * Email notifications checkboxes grouped together under new heading. * Improved expired users database query. * Added Expire_User->is_expired() method. * Added version constants. = 0.8 = * Added [expire_users_current_user_expire_date] shortcode. * Force check if user expired on login. * Fix static method warnings. = 0.7 = * Fix expiry dates to work with site's timezone. * Use date formats from WordPress settings. * Use user's real name in notification emails if available. * Ensure custom roles are listed in drop down menu. * Add option to remove user expiry details and continue to allow user to login when they expire. * Add admin help. = 0.6 = * Added support for translations. Submissions welcome. = 0.5 = * Added option to automatically set expiry details for users who register via the register form. = 0.4 = * Enables email notifications to users and administrators. * Add a settings page where you can configure email notification messages. * Perform you own actions on user expiry using an `expire_users_expired` hook. * Only allow users with user editing capabilities (administrators) to edit expiration dates. = 0.3 = **Important Security Update!** * Fix authenticate() and login issue. = 0.2 = * Prepare for translation. * Fix 'Expire Date In…' settings. = 0.1 = * First Release. If you spot any bugs or issues please [log them here](https://github.com/benhuson/expire-users/issues). == Upgrade Notice == = 1.2.1 = Tested up to WordPress 6.2 and PHP 8.2 = 1.2 = Added `expire_users_current_user_expire_countdown` shortcode. = 1.1 = Sort users by expiry date in admin and fix some login issues. = 1.0.4 = On expiry, remove expiry date and continue to allow login if set. = 1.0.3 = If user logged in, check expiration while browsing. = 1.0.2 = Rollback changes causing multiple emails to be sent! = 1.0.1 = Fix PHP7 class constructor warnings and beter checking for expire users when displaying them in the admin. = 1.0 = Added expiry fields to new user admin page and 'expire_users_admin_email' filter. = 0.9 = Expired dates are displayed as red. Dates are internationalized and JavaScript/CSS files are only loaded on the required admin pages. = 0.8 = Added [expire_users_current_user_expire_date] shortcode and force check if user expired on login. = 0.7 = Fix expiry dates to work with site's timezone. = 0.6 = Added support for translations. = 0.5 = Assign expiry details to users when they register via the register form. = 0.4 = Option to enable email notifications and perform custom actions on user expiry. = 0.3 = Important security update! = 0.2 = Ready for translation. Fixed "Expire Date In..." settings. = 0.1 = First release.
It’s possible make sortable column of the users list by order expiration date?
thank you
Currently uses an hourly cron job
http://wordpress.org/support/topic/cant-get-it-to-work-46
For example, if changing a role you don't want to disable the user.
http://wordpress.org/support/topic/expire_users_expired-hook?replies=6#post-4955489
I took your code to hook to WooCommerce registration/purchase, I slightly modified the code to work with Easy Digital Downloads
/**
* Set expire
*/
function prefix_user_expire( $payment_id = 0 ) {
global $expire_users;
if ( ! class_exists( 'Expire_User' ) ) {
return;
}
$expire_settings = $expire_users->admin->settings->get_default_expire_settings();
$expire_data = array(
'expire_user_date_type' => $expire_settings['expire_user_date_type'],
'expire_user_date_in_num' => $expire_settings['expire_user_date_in_num'],
'expire_user_date_in_block' => $expire_settings['expire_user_date_in_block'],
'expire_user_date_on_timestamp' => $expire_settings['expire_timestamp'],
'expire_user_role' => $expire_settings['expire_user_role'],
'expire_user_reset_password' => $expire_settings['expire_user_reset_password'],
'expire_user_email' => $expire_settings['expire_user_email'],
'expire_user_email_admin' => $expire_settings['expire_user_email_admin'],
'expire_user_remove_expiry' => $expire_settings['expire_user_remove_expiry']
);
$user_id = edd_get_payment_user_id( $payment_id );
$user = new Expire_User( $user_id );
$user->set_expire_data( $expire_data );
$user->save_user();
}
add_action( 'edd_complete_purchase', 'prefix_user_expire', 10, 3 );
It worked perfectly, but do you know how to expire the login form?
Hey there,
Great plugin. The only issue is that I'm using the Theme My Login plugin to display profile fields on the frontend. With both this plugin and TML active the submit button is removed from the page.
To reproduce, download TML https://wordpress.org/plugins/theme-my-login/ and enable profile module. Next, install and activate Expire Users. You will see that an update Profile button is present when Expire Users is deactivated, but once activate it is removed.
Any help/insight is appreciated.
Hi there,
I made an italian translation for the plugin (see commit 7f27faf).
To which branch should I send a pull request?
See support request:
http://wordpress.org/support/topic/all-user-expire-in-1month
Functionality is sort of built but current just firing on init for testing.
If current date is higher than expiry date, can you change the color of that expiry date into red (also in the expire date column in the user tab) so it becomes clear some action is needed.
Hi
I made an french translation for your plugin
msgid ""
msgstr ""
"Project-Id-Version: Expire Users 0.5\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/expire-users\n"
"POT-Creation-Date: 2014-05-15 10:31-0000\n"
"PO-Revision-Date: 2015-03-08 10:47+0100\n"
"Last-Translator: Ben Huson [email protected]\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.7.4\n"
"X-Poedit-KeywordsList: __;_e;_n;_x;_nx;_ex\n"
"X-Poedit-Basepath: ./\n"
"Language-Team: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr_FR\n"
"X-Poedit-SearchPath-0: ..\n"
msgid "Expire Date"
msgstr "Date de fin de validité"
msgid "(expired)"
msgstr "(Expiré)"
msgid "User Expiry Information"
msgstr "Informations sur la date d'expiration"
msgid "Edit"
msgstr "Modifier"
msgid "Expiry Date"
msgstr "Date de fin de validité"
msgid "Never"
msgstr "Jamais"
msgid "In"
msgstr "Dans"
msgid "On"
msgstr "Le"
msgid "On Expire, Default to Role"
msgstr "Rôle par défaut à la date de fin de validité"
msgid "Don't change role"
msgstr "Ne pas modifier le rôle"
msgid "Expire Actions"
msgstr "Règles d'expiration"
msgid "Replace user's password with a randomly generated one"
msgstr ""
"Remplacer le mot de passe de l'utilisateur avec un nouveau mot de passe "
"généré aléatoirement"
msgid "Remove expiry details and allow user to continue to login"
msgstr ""
"Effacer la date de fin de validité et permettre à l'utilisateur de continuer "
"à s'identifier"
msgid "Email Notifications"
msgstr "Notifications par email"
msgid "View and configure messages"
msgstr "Voir et configurer les messages"
msgid "days"
msgstr "jours"
msgid "weeks"
msgstr "semaines"
msgid "months"
msgstr "mois"
msgid "years"
msgstr "années"
msgid "Jan"
msgstr "Jan"
msgid "Feb"
msgstr "Fév"
msgid "Mar"
msgstr "Mars"
msgid "Apr"
msgstr "Avr"
msgid "May"
msgstr "Mai"
msgid "Jun"
msgstr "Juin"
msgid "Jul"
msgstr "Juil"
msgid "Aug"
msgstr "Août"
msgid "Sep"
msgstr "Sept"
msgid "Oct"
msgstr "Oct"
msgid "Nov"
msgstr "Nov"
msgid "Dec"
msgstr "Déc"
msgid "Cancel"
msgstr "Annuler"
msgid ""
"
Activate and configure default expiry settings for users who register via "
"the registration form.
Activer et configurer les paramètres d'expiration par défaut pour les "
"utilisateurs qui se inscrivent via le formulaire d'inscription.
msgid ""
"
Expiry Date
Set a user to nevr expire, expire after "
"a period of time or on a specific date.
Date de fin de validité
Définir un utilisateur à "
"expiration nevr, expire après une période de temps ou à une date précise. </"
"p>"
msgid ""
"
Default to Role
When a user expires, you can assign "
"them a different role.
Rôle par défaut
Quand un utilisateur expire, vous "
"pouvez leur attribuer un rôle différent.
msgid ""
"
Expire Actions
Other actions to trigger when a user "
"expires:
Règles d'expiration
Autres actions à déclencher "
"quand la date de fin de validité est atteinte :
msgid "
msgid "
msgid ""
"
Notification Emails
These emails are sent if you "
"have checked the checkboxes on a user's profile. Notification messages are "
"configured on the <a href="%s">Expire Users settings page.
Notification par email
Des emails seront envoyés en "
"fonction des cases cochées sur le profil des utilisateurs. Les messages de "
"notification sont configurés sur la page <a href="%s">Paramètres "
"d'expiration des utilisateurs.
msgid "Expiry Settings"
msgstr "Paramètres d'expiration"
msgid ""
"
Notification Emails
These emails are sent if you "
"have checked the checkboxes on a user's profile.
Notification par email
Des emails seront envoyés en "
"fonction des cases cochées sur le profil des utilisateurs.
msgid "Expire Users Plugin"
msgstr "Politique d'expiration"
msgid "Documentation"
msgstr "Documentation"
msgid "Support Forum"
msgstr "Forum d'aide"
msgid "Contribute at Github"
msgstr "Contribuer à GitHub"
msgid "Submit an Issue"
msgstr "Soumettre un commentaire"
msgid "User Expired Notification"
msgstr "Activer la notification par email à l'utilisateur"
msgid "This email is sent to a user when their login details expire."
msgstr ""
"Cet email est automatiquement envoyé à l'utilisateur lorsque la date de fin "
"de validité de son compte est atteinte."
msgid "User Expired Admin Notification"
msgstr "Activer la notification par email à l'administrateur"
msgid ""
"This email is sent to the WordPress admin email address when a user expires."
msgstr ""
"Cet email est automatiquement envoyé à l'administrateur lorsque le compte "
"d'un utilisateur a atteint la date de fin de validité."
msgid "Notification"
msgstr "Notification"
msgid "Message"
msgstr "Message"
msgid "No notification defined."
msgstr "Aucune notification définie."
msgid "https://github.com/benhuson/expire-users"
msgstr "https://github.com/benhuson/expire-users"
msgid "GitHub"
msgstr "GitHub"
msgid "https://github.com/benhuson/expire-users/wiki"
msgstr "https://github.com/benhuson/expire-users/wiki"
msgid "Settings"
msgstr "Paramètres"
msgid "Expire Settings"
msgstr "Règles d'expiration"
msgid "Expire Users Settings"
msgstr "Règles d'expiration des comptes utilisateur"
msgid "Options saved"
msgstr "Les paramètres ont été enregistrés."
msgid "Registered User Expiry Settings"
msgstr "Réglages des paramètres d'expiration"
msgid ""
"Automatically set expiry date for new users who register via the "
"registration form."
msgstr ""
"Calculer automatiquement la date de fin de validité pour les nouveaux "
"utilisateurs qui s'inscrivent via le formulaire d'inscription."
msgid "Notification Emails"
msgstr "Réglages des notifications par email"
msgid ""
"These emails are sent if you have checked the checkboxes on a user's profile."
msgstr ""
"Des emails seront envoyés en fonction des cases cochées sur le profil des "
"utilisateurs."
msgid ""
"You may use the following placeholders in the notification email messages "
"below:"
msgstr ""
"Vous pouvez utiliser les variables suivantes dans les messages de "
"notification définis ci-dessous :"
msgid "Save Options"
msgstr "Enregistrer les paramètres"
msgid " @ "
msgstr " @ "
msgid "Expires: %s"
msgstr "Expire : %s"
msgid "Expired: <strong class="expire-user-expired">%s"
msgstr "Expiré : <strong class="expire-user-expired">%s"
msgid "Expire: Never"
msgstr "Expiration : Jamais"
msgid "Your login details to %%sitename%% have expired"
msgstr "Votre accès au site %%sitename%% a expiré"
msgid "Login details to %%sitename%% have expired (%%username%%)"
msgstr "L'accès au site %%sitename%% a expiré pour l'utilisateur %%username%%"
msgid "Your access to %%sitename%% has expired."
msgstr "Votre accès au site %%sitename%% a expiré."
msgid ""
"Access to %%sitename%% has expired for %%name%% (%%username%%) on "
"%%expirydate%%"
msgstr ""
"L'accès au site %%sitename%% a expiré pour l'utilisateur %%name%% (%%username"
"%%) le %%expirydate%%."
msgid "ERROR: Your user details have expired."
msgstr "Erreur :votre compte utilisateur a expiré !"
msgid ""
"ERROR: Your user details have expired so you are no longer "
"able to reset your password."
msgstr ""
"Erreur :votre compte utilisateur a expiré, c'est pour cela "
"que vous n'êtes plus en mesure de réinitialiser votre mot de passe."
msgid "M d, Y"
msgstr "d/m/Y"
msgid "Expires %s"
msgstr "Expire %s"
msgid "Expired %s"
msgstr "Expiré %s"
msgid "Never Expire"
msgstr "N'expire jamais"
Important that only admins can change expiry settings.
Maybe needs a new capability?
%%name%% displaying with lowercase first name
http://wordpress.org/support/topic/not-receiving-email-role-not-adjusting?replies=11#post-4978709
Text links exist in the UI but currently don't do anything.
In two places You use wrong translation texdomain name "expired-users".
The correct name is "expire-users".
File: expire-users.php
Send notification email when user expires
AND
Send admin notification email when user expires
Please can anybody tell me how to import even through direct mysql database my entire users expiration dates
Hello i am using AR member plugin for user registration. How can i add an expiry date field in the signup form. Kindly help me. Thanks in advance
Hi.
i'm trying to remove the expire date on user by php (like setting "none" in the setting of a user)
for do this i rite something like this 👍
$expireUser = new Expire_User( $user->user_id); $expireUser->remove_expiry(); $expireUser->save_user();
but when the date is reach, the user keep the date in red...
how i can do this ?
thanks.
and thanks for you work on this plugin
So you can easily see users who will be expiring.
Or maybe just sortable will suffice?
Check a user's expiry when a user tries to login and expire them if needed.
Just a considerate thing to do.
Hi Ben,
This plugin seems to have several issues at the moment and it appears that development / maintenance is sadly dead.
Firstly I just wanted to say thanks for all your hard work on this plugin, it's used by a lot of people and provides functionality that no other plugin appears to provide.
Secondly, I'd like to BEG you to pick this plugin up again and please get this back to it's former glory.
Lastly, if you aren't able / willing to resume this thing, then I'd just like to say a final thank you for all your work on it, before asking if you know of any alternative plugin that offers similar functionality?
Thanks.
It looks like now emails are send every time when a user login after the account expires. Is it possible to limit sending emails only the first time they try to login. I think it was like that earlier, started noticing it after last update.
Will no capabilities.
You could assign capabilities to the expired users
When a user expires there should be an option to email the user and email the administrator.
Checkbox UI in place but currently greyed out.
Maybe use Heartbeat API?
See: https://wordpress.org/support/topic/it-doesnt-work-at-all-in-wordpress-4-6-1/#post-8525517
Should this be configurable based on role perhaps?
Hi admin, i want to expire user on same day and change password by random one but i did observe its not expire on same day it take action on next day at 6 am. so what should i do to expire user as per time given.
This plugin does exactly what I need, but is not working with WooCommerce. I have WC configured to register new users when they place their first order. Is there a simple way to connect expire-users to this or other custom forms that use the register-user class? Thanks.
The plugin is not working in medicate theme of wordpress
please tell me why it is not working.
(Originally posted by @ShakeelMureed)
Seems like the authenticate hook calling Expire_User->authenticate(...) has too low priority. Changing it to 30 blocks expired users again. I made a temporary solution by chaining another call to it in my functions.php.
function call_expire_users_authenticate($user, $username, $password) {
global $expire_users;
return $expire_users->authenticate($user, $username, $password);
}
add_filter('authenticate', 'call_expire_users_authenticate', 30, 3);
It should be nice if the notification mail can be sent a few days / weeks before the expiry date to get notified some action is needed.
See: https://wordpress.org/support/topic/expire-immediately-option
I envisage this would be an action link in the admin.
Where you hover over a user in the admin list view, next to the edit and delete links we would add an "Expire Now" link. This would only show for relevant users that had not yet expired.
Add a link to view all expired users in the admin. Sortable by date?
At WordPress 4.9.8 and above, this plugin no longer adds an expiry date to a subscriber created via Gravity Forms membership. All expiry dates now have to be added manually. (Previously it worked fine.)
When an administrator tries to edit a user's profile from the bbPress front-end (/forums/users/username/edit/) there is an error:
Fatal error: Call to undefined function wp_dropdown_roles() in \wp-content\plugins\expire-users\admin\expire-user.php on line 182
Non-administrators don't get this error (i.e when a regular user tries to update their own profile).
Could be related to this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.