Membership & User Roles for WooCommerce (Automatic Role Changer)

Descripción

Sync user roles with memberships and subscriptions. Grant access on purchase, revoke on expiry, and restrict your store by role.

Resumen

The Membership & User Roles for WooCommerce plugin automates the assignment of user roles based on product purchases. This powerful tool streamlines store management by ensuring users are automatically assigned the appropriate roles, enhancing membership sites, subscription-based models, and more.

It also bridges MemberPress to WordPress roles: a membership’s state drives the role, continuously, so access granted in MemberPress is reflected wherever your site checks roles.

Características

  • Asigna automáticamente perfiles a los usuarios al comprar productos.

  • Funciona a la perfección con WooCommerce.

  • Syncs MemberPress membership state to WordPress roles, continuously — the direction other integrations don’t cover. The free version syncs one membership level.

  • Premium: Supports the definition of different roles for variations in variable products.

  • Premium: Permite definir, por producto, un periodo de validez del perfil en días tras la compra, de forma que el perfil otorgado en la compra se eliminará automáticamente tras ese periodo.

  • Premium: Supports role management tied to subscription products, supporting WooCommerce Subscriptions, YITH WooCommerce Subscription and WP Swings Subscriptions for WooCommerce.

  • Premium: Permite definir varios perfiles de usuario por producto.

  • Premium: Unlimited MemberPress levels, several roles per membership, and mapping of every membership state (pending, active, suspended, cancelled, expired).

  • Premium: Restricts your store by role — hides products and categories from the catalog and search, denies direct URL access, blocks add-to-cart, and sets per-role prices, payment gateways and shipping methods.

  • Premium: Retroactive sync — a batched admin tool that aligns the roles of members who already existed before the mapping was configured. Safe to re-run.

Configuración

Configurar la asignación de perfiles

  • Edita un producto de tu catálogo.Selecciona un producto de tu catálogo.

  • Elige el perfíl (o varios perfiles PREMIUM) a asignar cuando se adquiera el producto.

  • Premium: Define un período de validez del perfil en días después de la compra.

  • In WooCommerce > Settings > Role Changer you can configure advanced settings to fine-tune role assignments, such as defining if the new role must be added to the user, or if the new role should just replace the previous one.

  • Guardar cambios

Características Premium

Definir períodos de validez de perfil de usuario

La versión premium permite definir un período de validez del perfil de usuario, en días después de la compra. El perfil otorgado en la compra se eliminará automáticamente tras ese período.

Gestiona perfiles de usuario siguiendo el ciclo de vida de productos de suscripción

The premium version supports advanced functionality for subscription products, supporting WooCommerce Subscriptions, YITH WooCommerce Subscription and WP Swings Subscriptions for WooCommerce, assigning roles based on subscription status:

  • Activo: Asigna un perfil cuando una suscripción está activa.** Activo: Asigna un perfil cuando una suscripción se activa.

  • Suspendida: Actualiza el perfil de usuario si una suscripción está suspendida, o está esperando renovación.

  • ** Cancelado: Elimina o cambia los perfiles cuando finaliza una suscripción.

Cómo activar

  • Adquiere la versión premium del plugin a través del sitio oficial.

  • Sube y activa el plugin premium.

  • Navega hasta WooCommerce > Ajustes > Role Changer.

  • Activa la asignación de perfiles basados en suscripciones.

Preguntas frecuentes (FAQ)

1. ¿Qué ocurre si un usuario compra varios productos con diferentes asignaciones de perfiles?

El plugin puede configurarse bien para añadir perfiles, bien para reemplazarlos.

  • Si el plugin se configura para reemplazar perfiles, el usuario quedará con el último perfil asignado.
  • Si el plugin se configura para añadir perfiles, todos los perfiles se asignarán al usuario. Recomendamos el uso de un plugin como “Members” para la gestión de múltiples perfiles por usuario.

2. ¿Qué ocurre si un usuario compra varias veces un producto que concede el mismo perfil de usuario?

En la versión Premium, el período de validez correspondiente a una compra se añade al anteriormente existente.

3. ¿Puedo asignar varios perfiles a un mismo producto?2. ¿Puedo asignar varios perfiles a un mismo producto?

En la versión Premium se pueden asignar varios perfiles. Los usuarios obtendrán todos los perfiles asignados en el momento de la compra.

4. ¿Cómo actualizo a la versión Premium?3. ¿Cómo actualizo a la versión Premium?

Visita la página oficial del plugin para comprar la versión premium. Después de comprarla, instálala y actívala como la versión gratuita.

Diagnóstico

Problemas habituales

Problema: Los cambios de perfil no se aplican después de las compras.

Solución: Asegúrate de que el plugin está activado y configurado correctamente en WooCommerce > Ajustes > Role Changer.

Problema: Los cambios de perfil por suscripción no funcionan.

Solución: Comprueba que la versión Premium está instalada y activa.

Problema: Conflictos con otros plugins.

Solución: Desactiva otros plugins de gestión de perfiles para comprobar si hay problemas de compatibilidad.

Soporte

Para obtener soporte, visita el foro de soporte del plugin.

Licencia

Este plugin se distribuye bajo la Licencia Pública General GNU (GPL) v3. Para más detalles, consulta el archivo de licencia incluido con el plugin.

Acreditaciones

Autor: David Marín Carreño

Página web: https://davefx.com/es/plugins-de-wordpress/

Instalación

Requisitos previos

  • WordPress 6.2 or higher.

  • WooCommerce 8.0 or higher (tested up to version 11.0).

Pasos

  • Descarga el plugin desde el repositorio de plugins de WordPress.

  • Accede a tu escritorio de administración de WordPress.

  • Navega a “Plugins > Agregar nuevo”

  • Haz clic en Subir plugin y selecciona el archivo del plugin.

  • Haz clic en “Instalar ahora” y luego en “Activar plugin”.

Reseñas

4 de Enero de 2023
This plugin is both simple and efficient if you need an automatic system in adding a second user role. Thank you for making this solution!
10 de Marzo de 2021 1 respuesta
I looked a time for a plugin like this. Its short, nice and work well. Should be up to date with WP-versions…
19 de Enero de 2021
The DFX Automatic Role Changer for Woocommerce plugin does very well what it says. A very useful plugin if you know what to do with it. 🙂 A big thanks to the author!
Leer los 6 comentarios

Colaboradores & Desarrolladores

“Membership & User Roles for WooCommerce (Automatic Role Changer)” es software de código abierto. Las siguientes personas han contribuido a este plugin.

Colaboradores

“Membership & User Roles for WooCommerce (Automatic Role Changer)” ha sido traducido en 2 idiomas. Gracias a los traductores por sus contribuciones.

Traduce “Membership & User Roles for WooCommerce (Automatic Role Changer)” a tu idioma.

¿Interesado en el desarrollo?

Revisa el código, echa un vistazo al repositorio SVN, o suscríbete al registro de desarrollo por RSS .

Historial de cambios

20260828

  • No changes to the plugin itself. Development tooling only: tests and releases now run on the developer’s machine while the CI service is unavailable.

20260827

  • Premium: restricting a product category now hides the category itself, not only the products in it. Until now a restricted category still appeared in category widgets, menus and any other listing, and its archive URL still opened — to a page with no products, but a real page carrying the category name. Restricted categories are now excluded from category listings and their archive is denied the same way a restricted product URL is, honouring the same 404-or-redirect setting.

  • This makes a “members-only catalogue” work as expected: give the category a role, and everyone else stops seeing both the products and the category.

20260826

Behaviour change in “Replace Roles” mode. Read this if you use that mode.

What changed: until now, granting a role in Replace Roles mode wiped every role the user had. From this version it replaces only the roles this plugin granted, plus the role the user had when the plugin first acted on them. Any role a different plugin gave the user is kept.

Why: wiping everything destroyed roles other plugins were actively managing — WooCommerce Subscriptions’ subscriber role, Members, MemberPress, anything that assigns roles. The other plugin restored its role on its next event, this one wiped it again on the next grant, and the two fought indefinitely. The user’s role ended up depending on which plugin ran last.

What you will notice: if this is the only plugin managing roles on your site, nothing changes at all. If another one is, its roles now survive instead of disappearing.

If you actually want a single role and nothing else, a site can restore the old behaviour with the new dfx_woo_role_changer_foreign_roles filter, returning an empty array.

No provider is detected or named: a role counts as foreign simply because this plugin never granted it.

20260824

  • Premium: the retroactive sync now covers subscriptions, not just MemberPress. If you configure a role on a subscription product today, your existing subscribers get it on the next run instead of waiting for their subscription to change status, which on an annual plan can be months away. Works with WooCommerce Subscriptions, YITH WooCommerce Subscription and Subscriptions for WooCommerce.

  • Premium: the retroactive sync screen no longer requires MemberPress. It lists whichever sources are present and syncs from those.

20260822

  • No functional changes. Tested with WooCommerce 11, so WooCommerce no longer shows its “untested with your version” notice.

  • The test suite now runs against WooCommerce 11 as well, across the four supported PHP versions, so the declaration stays backed by CI rather than by a single run.

20260817

  • The settings screen now describes what the premium version adds, including the store restriction by role and the retroactive sync. Those two live in premium-only files, so nothing about them was visible from the free version’s admin.

  • Spanish (es_ES and es_CL) translations updated for the new strings; both remain complete.

20260813

  • No functional changes. This release only updates the compatibility declarations.

  • Tested with WordPress 7.1.

  • Raised the declared minimum WordPress version from 5.0 to 6.2. This is not a new restriction: the plugin already required WooCommerce 8.0, and WooCommerce 8.0 itself requires WordPress 6.2, so no install below 6.2 could ever have run it. The old value simply advertised a combination that does not exist.

  • Added the Requires Plugins: woocommerce header, so WordPress 6.5 and later refuses activation when WooCommerce is missing instead of activating and failing later.

  • Presentation fixes in this readme: paragraphs that were wrapped across several lines rendered as broken lines on the plugin page, MemberPress is now linked on first mention, and the MemberPress sync is listed with the free features rather than among the premium ones.

20260728

  • Renamed the plugin to “Membership & User Roles for WooCommerce (Automatic Role Changer)”. The slug, text domain and settings are unchanged, so nothing needs reconfiguring on update.

  • New: syncs MemberPress membership state to WordPress roles, continuously. This is the direction the existing WooCommerce/MemberPress integrations don’t cover. The free version syncs a single membership level while the membership is active.

  • Premium: unlimited MemberPress levels, several roles per membership, and a mapping for every membership state (pending, active, suspended, cancelled, expired). Roles are granted when a membership enters a state and revoked when it leaves it. A role the user earned through an order is never revoked by the bridge.

  • Premium: restrict your store by role. Restricted products and categories are hidden from the catalog and from search, their URLs are denied (404 or a redirect to the shop, configurable), add-to-cart is blocked, and prices, payment gateways and shipping methods can each be limited per role. Users who can manage WooCommerce are never restricted.

  • Premium: retroactive sync. An admin tool under WooCommerce that aligns the roles of members who already existed before the mapping was configured. It runs in batches with a progress bar, resumes where it left off if the page is reloaded, and is safe to run more than once.

  • Added Spanish (es_ES and es_CL) translations, complete for every string.

  • Fixed a translatable string that carried no text domain, so its translation was never applied.

  • Numbered the placeholders in three order-note strings that had unnumbered ones, so translators can reorder them.

  • Added an end-to-end test suite driven against a real WordPress with MemberPress installed, alongside the existing unit tests.

20260522.3

  • Widened the supported WooCommerce range: now works on WC 8.0+ (previously implicitly required WC 9.5+). Inlined the Automattic\WooCommerce\Enums\OrderStatus constants to plain strings and gated Automattic\WooCommerce\Utilities\OrderUtil with class_exists, so older WooCommerce installs no longer fatal-error.

  • CI now also runs the test suite against WooCommerce 8.0, 9.5, and 10.7 in addition to the four PHP versions.

20260522.2

  • Bumped the declared WooCommerce requirement to match the code: now requires WC 9.4+ (was 3.0, but the plugin uses the Automattic\WooCommerce\Enums\OrderStatus enum which only exists in WC 9.x+). Tested up to WC 10.7.

  • Premium: Guarded the role-assignment $_POST read with isset() so saving a product without the role field no longer throws a PHP 8 warning.

  • Premium: Removed unreachable code in extract_validity_from_role (multi-grant aggregation actually happens upstream in add_expiration_to_roles).

  • Removed the unused add_settings_tab() method.

  • CI now runs the test suite across PHP 8.0, 8.1, 8.2, and 8.3.

20260522.1

  • Premium: Fixed the “Multiple expiration mode” setting that was silently non-functional in the admin UI (the setting array was missing the id field, so WooCommerce never persisted it). The min/max option labels were also swapped — they now match the underlying behavior.

  • Fixed a race in replace_roles mode when a single user has two or more active role-granting orders. The plugin now tracks managed roles separately so subsequent grants don’t overwrite the user’s original roles, and refunds restore the right state regardless of the order in which they happen.

  • Declared a minimum PHP version (8.0) in the plugin header.

  • Fixed the Domain Path plugin header (was /lang, the directory is /languages).

  • Premium: User display names and URLs are now HTML-escaped in order notes.

  • Declared previously-dynamic properties on the premium class (avoids the PHP 8.2 deprecation notice).

20260522

  • Fixed a deprecated Action Scheduler API call (next() get_date()).

  • Defensive iteration over the user subscription list returned by YITH WooCommerce Subscription, preventing rare fatal errors on role unassignment.

  • Null-order guard in the internal dfx_woo_role_changer_role_maybe_assigned action so subscription paths no longer fatal when the associated order isn’t available.

  • Premium: Fixed the Subscriptions For WooCommerce (WP Swings) integration under HPOS. Subscription status changes weren’t triggering role assignments because the plugin was listening on hooks that don’t fire under HPOS; switched to woocommerce_new_order / woocommerce_update_order.

  • Added a PHPUnit integration test suite covering the free and premium paths, including all three supported subscription providers.

20260521

  • Upgraded Freemius SDK from 2.11.0 to 2.13.1.

  • Marked plugin as tested with WordPress 7.0.

20250325

  • Premium: Added support for definition of roles in variations of variable products.

  • Premium: In case of having one order with several products granting the same role, we can now select how to calculate the validity period (if defined).

20250204

  • El selector de perfiles de usuario se muestra ahora como un desplegable Select2, lo que permite una selección más sencilla de los perfiles.

  • Premium: Añadido soporte para perfiles con un periodo de validez. El perfil otorgado en la compra se eliminará automáticamente tras ese periodo.

  • Premium: Permite definir varios perfiles de usuario por producto.

20250203

20250130

  • If the plugin is configured to replace roles (not adding them), now we won’t ever replace the administrator role after a purchase if the user had this role before the purchase.

20250127

  • SDK de Freemius actualizado

20250122

  • Cambiada la ruta de instalación de Freemius.

20250121

  • Característica Premium Agregadas nuevas características premium para permitir que el perfil se asigne/desasigne según un ciclo de vida de una suscripción de WooCommerce Subscriptions.
  • Se agregaron mensajes para promocionar las características premium.

20240616

  • Agregada nueva página de ajustes dentro de la página de administración de productos WooCommerce.
  • Agregando nueva funcionalidad para seleccionar cuándo debe agregarse el perfil al usuario.
  • Agregando nueva selección de modo, para determinar si el nuevo perfil debe agregarse al usuario o si el nuevo perfil debería reemplazar cualquier perfil anterior.
  • Agregado un código para que se ejecute si el pedido se cancela o devuelve, eliminando el perfil del usuario.

20240319

  • Marcando compatibilidad con HPOS.

20201115

  • Versión inicial