PHPackages                             remp/crm-wordpress-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. remp/crm-wordpress-module

ActiveLibrary

remp/crm-wordpress-module
=========================

CRM Wordpress Module

2.0.0(3y ago)019MITPHPPHP ^8.0

Since Mar 16Pushed 3y ago7 watchersCompare

[ Source](https://github.com/remp2020/crm-wordpress-module)[ Packagist](https://packagist.org/packages/remp/crm-wordpress-module)[ Docs](https://remp2020.com)[ RSS](/packages/remp-crm-wordpress-module/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (5)DependenciesVersions (35)Used By (0)

CRM Wordpress Module
====================

[](#crm-wordpress-module)

[![Translation status @ Weblate](https://camo.githubusercontent.com/edc463fdd85abc488ad85deb8b4a0a905fe6a812814b23434d63ceef5c393638/68747470733a2f2f686f737465642e7765626c6174652e6f72672f776964676574732f72656d702d63726d2f2d2f776f726470726573732d6d6f64756c652f7376672d62616467652e737667)](https://hosted.weblate.org/projects/remp-crm/wordpress-module/)

User authentication
-------------------

[](#user-authentication)

CRM supports user authentication against configured Wordpress instance. To enable this feature,

### Installation

[](#installation)

1. Install our [Wordpress plugin](https://github.com/remp2020/dn-remp-wp-auth) exposing API to validate credentials.
2. Configure Wordpress CMS URL and Wordpress auth token in CRM admin settings (`/admin/config-admin` - Integrations)
3. Register the authenticator in your own module:

```
class DemoModule extends \Crm\ApplicationModule\CrmModule
{
    // ...
    public function registerAuthenticators(\Crm\ApplicationModule\Authenticator\AuthenticatorManagerInterface $authenticatorManager)
    {
        $authenticatorManager->registerAuthenticator(
            $this->getInstance(\Crm\WordpressModule\Authenticator\WordpressAuthenticator::class),
            100
        );
    }
// ...
}
```

Once enabled, every time user tries to log in, following will happen:

- First CRM will use the default set of authenticators with higher priority. Among others, it tries to log user in against local `users` table.
- If all authenticators with higher priority fail, CRM tries to use `WordpressAuthenticator` and validates the credentials against Wordpress instance you configured.
- If it's successful, CRM will create the user locally and set the same password that user just validated against Wordpress, so CRM is able to validate the password itself in the future.

We recommend to have this authenticator enabled only for some transition period (couple of months). When disabled, users who didn't authenticate within the transition period will have to create the account / reset the password (depending on whether you migrated the users before or not).

### Configuration

[](#configuration)

When `WordpressAuthenticator` creates new user in CRM, it sets the password validated in Wordpress so people can log in to CRM with the same password.

However if the account already exists in CRM and it has different password, `WordpressAuthenticator` **doesn't change password** of the user by default. If you want to set validated Wordpress passwords even for existing CRM accounts, please add following snippet to your `app/config/config.neon`.

```
# enable WordressModule extension
extensions:
    wordpress: Crm\WordpressModule\DI\WordpressModuleExtension

wordpress:
    # configure authenticator
    authenticator:
        passwordReset: true
```

Security and user migration
---------------------------

[](#security-and-user-migration)

By default, it's not a good idea to have two user bases at the same time and we recommend the CRM to be your primary source of truth. That way you can prevent account hijacking and other vulnerabilities that come with multiple authentication mechanisms. We've thought of two scenarios that could help you with the migration.

### Migrate first, authenticate later

[](#migrate-first-authenticate-later)

To prevent any kind of ambiguity, both Wordpress and CRM users should be connected. The best way to achieve this is to migrate/synchronize WP users to CRM first - see sync user API endpoint below.

If you don't expect users to come from any other source, you could make hard link via `users.ext_id` column. `WordpressModule` can handle this for you, just configure the following flag in your `app/config/config.neon`. Otherwise there will only be soft link between `wordpress_users` table and `users` table.

```
# enable WordressModule extension
extensions:
    wordpress: Crm\WordpressModule\DI\WordpressModuleExtension

wordpress:
    # enable ext ID referencing
    extIdReferencing: true
```

API documentation
-----------------

[](#api-documentation)

All examples use `http://crm.press` as a base domain. Please change the host to the one you use before executing the examples.

All examples use `XXX` as a default value for authorization token, please replace it with the real tokens:

- *API tokens.* Standard API keys for server-server communication. It identifies the calling application as a whole. They can be generated in CRM Admin (`/api/api-tokens-admin/`) and each API key has to be whitelisted to access specific API endpoints. By default the API key has access to no endpoint.

API responses can contain following HTTP codes:

ValueDescription200 OKSuccessful response, default value400 Bad RequestInvalid request (missing required parameters)403 ForbiddenThe authorization failed (provided token was not valid)404 Not foundReferenced resource wasn't found409 ConflictRequested resource is in conflict with current server stateIf possible, the response includes `application/json` encoded payload with message explaining the error further.

---

#### GET `/api/v1/wordpress/sync-user`

[](#get-apiv1wordpresssync-user)

API call creates/updates user in CRM based on the information provided from Wordpress. Scenarios are handled as follows:

- If user doesn't exist in CRM, it's created and linked to the Wordpress user.
- If user already exists in CRM, and the provided Wordpress ID matches with the one linked in CRM, user is updated.
- If user already exists in CRM and the provided Wordpress ID doesn't match or it isn't set on CRM user, API returns HTTP 409 conflict.

##### *Headers:*

[](#headers)

NameValueRequiredDescriptionAuthorizationBearer *String*yesAPI token.##### *Payload*

[](#payload)

```
{
    "wordpress_id": 123, // required; ID of user in Wordpress.
    "email": "admin@example.com", // required; Email of user in Wordpress.
    "registered_at": "2020-03-13T14:02:44+00:00", // required; RFC3339-formatted time of user registration in Wordpress.
    "user_login": "admin", // required; Login of user in Wordpress .
    "user_nicename": "admin", // optional; Nicename of user in Wordpress.
    "user_url": "http://www.example.com", // optional; User's URL in Wordpress .
    "display_name": "Example Admin", // optional; Display name of user in Wordpress.
    "first_name": "Example", // optional; First name of user in Wordpress
    "last_name": "Admin" // optional; Last name of user in Wordpress
}
```

##### *Example:*

[](#example)

```
curl -request POST 'http://crm.press/api/v1/wordpress/sync-user' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer XXX' \
--data-raw '{
    "wordpress_id": 145,
    "email": "admin@example.fu",
    "registered_at": "2020-03-13T14:02:44+00:00",
    "user_login": "admin",
    "user_nicename": "admin",
    "user_url": "http://www.example.com",
    "display_name": "Example Admin",
    "first_name": "Example",
    "last_name": "vcvc"
}'
```

Response:

```
{
    "user_id": 374513,
    "wordpress_id": 145,
    "email": "admin@example.fu",
    "login": "admin",
    "registered_at": "2020-03-13T14:02:44+01:00",
    "nicename": "admin",
    "url": "http://www.example.com",
    "display_name": "Example Admin",
    "first_name": "Example",
    "last_name": "vcvc"
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 56.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~43 days

Total

34

Last Release

1362d ago

Major Versions

0.37.0 → 1.0.0-beta12022-01-03

0.38.0 → 1.0.0-beta22022-02-03

0.39.0 → 1.0.02022-03-29

1.2.0 → 2.0.02022-08-25

PHP version history (3 changes)0.29.0PHP ^7.3

0.37.0PHP ^7.4

2.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c733f9bd683c3814197d8a532b7da1ba1f631bb1efe1cde5f064feab1e24877?d=identicon)[rootpd](/maintainers/rootpd)

![](https://www.gravatar.com/avatar/a05541c0b35f43d95db5342210e1d9e64242888812d13f5b096df48b6aabd863?d=identicon)[msvitok](/maintainers/msvitok)

![](https://www.gravatar.com/avatar/2c30fdbc85cda35b94f7f59399918193a0289152281abcef344ec9ee82864177?d=identicon)[markoph](/maintainers/markoph)

---

Top Contributors

[![markoph](https://avatars.githubusercontent.com/u/6843562?v=4)](https://github.com/markoph "markoph (21 commits)")[![rootpd](https://avatars.githubusercontent.com/u/812909?v=4)](https://github.com/rootpd "rootpd (13 commits)")[![miroc](https://avatars.githubusercontent.com/u/1230714?v=4)](https://github.com/miroc "miroc (2 commits)")[![Matefko](https://avatars.githubusercontent.com/u/22897457?v=4)](https://github.com/Matefko "Matefko (1 commits)")

### Embed Badge

![Health badge](/badges/remp-crm-wordpress-module/health.svg)

```
[![Health](https://phpackages.com/badges/remp-crm-wordpress-module/health.svg)](https://phpackages.com/packages/remp-crm-wordpress-module)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
