PHPackages                             generoi/wp-paywall - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. generoi/wp-paywall

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

generoi/wp-paywall
==================

A paywall plugin

0104PHP

Since Sep 20Pushed 1y ago2 watchersCompare

[ Source](https://github.com/generoi/wp-paywall)[ Packagist](https://packagist.org/packages/generoi/wp-paywall)[ RSS](/packages/generoi-wp-paywall/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

wp-paywall
==========

[](#wp-paywall)

> A paywall plugin

By default article content is behind the paywall but can be manually *opted-out* on a per-post setting. Pages are public but like article they can be *opted-in* manually.

If a page/post has manually configured a setting it will take precedence over everything else but categories can also set a default state for all content tagged with the category. This rule is inherited so if you tag a child-term it traverse ancestors until a preference is found. If nothing is found it defaults to the post-type rules where `post` is paywalled and `page` is not.

Out of the box paywalled content will show the login form but you can override this template in your theme.

Additionally there is a *Paywalled content* block which can be used to manually tailor which section of a page is behind the paywall while everything outside of it will be public. *Note that using this block does NOT mark a page as paywalled, it only adjusts the content IF paywalled.*

There's a integration with Yoast to output rich schema data according to [Google's specifications](https://developers.google.com/search/docs/appearance/structured-data/paywalled-content). There's also a `X-Robots-Tag: noarchive` HTTP header sent.

To allow reverse proxies to differentiate paywelled content there's a `Vary: X-Paywall-Accepted` header and a `X-Paywall-Access: 0|1` added to the response. For now this is also where bot whitelisting would happen for now.

Environment variables
---------------------

[](#environment-variables)

- `PAYWALL_JWT_PRIVATE_KEY` should be set to the absolute of path of a private key used to sign JWT payloads.

Constants
---------

[](#constants)

- `WP_PAYWALL_JWT_ENABLED` can be set to `false` to disable adding the JWT auth cookie, for example if you need it regardless if the plugin is enabled or not. Defaults to enabled `true` *if* there is a `PAYWALL_JWT_PRIVATE_KEY` environment variable set.

Hooks
-----

[](#hooks)

```
/**
 * Hook in early to return a header passed on from a reverse proxy.
 */
add_filter('wp-paywall/has-access', function (?bool $hasAccess, ?int $postId) {
    $proxyAuth = $_SERVER['X-Proxy-Valid-Auth'] ?? null;
    return $proxyAuth === '1';
}, 10, 2);

/**
 * Remove default access rules and set your own.
 */
add_filter('wp-paywall/access-rules', function (array $rules, ?int $postId) {
    $rules = [];
    $rules[] = CustomAccess::class;
    return $rules;
}, 10, 2);

/**
 * Hook in early to return if paywall is applied or not.
 */
add_filter('wp-paywall/is-applied', function (?bool $isApplied = null, ?int $postId) {
    if ($postId === 1234) {
        return true;
    }
    return $isApplied;
}, 10, 2);
```

Development
-----------

[](#development)

Install dependencies

```
composer install
npm install

```

Run the tests

```
npm run lint
composer lint

# Setup WP-ENV
npm -g i @wordpress/env
wp-env start

# Run unit tests
wp-env run tests-cli --env-cwd=wp-content/plugins/wp-paywall ./vendor/bin/phpunit

# With Xdebug
wp-env stop
wp-env start --xdebug
wp-env run tests-cli --env-cwd=wp-content/plugins/wp-paywall ./vendor/bin/phpunit

```

Build assets

```
# Minified assets which are to be committed to git
npm run build:production

# Watch for changes and re-compile while developing the plugin
npm run start

```

Translations
------------

[](#translations)

```
wp i18n make-pot . languages/wp-paywall.pot
wp i18n make-mo languages/

```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/302736?v=4)[oxyc](/maintainers/oxyc)[@oxyc](https://github.com/oxyc)

---

Top Contributors

[![oxyc](https://avatars.githubusercontent.com/u/302736?v=4)](https://github.com/oxyc "oxyc (27 commits)")

### Embed Badge

![Health badge](/badges/generoi-wp-paywall/health.svg)

```
[![Health](https://phpackages.com/badges/generoi-wp-paywall/health.svg)](https://phpackages.com/packages/generoi-wp-paywall)
```

###  Alternatives

[mult1mate/cron-manager

Flexible cron tasks manager for MVC-type applications

40338.5k3](/packages/mult1mate-cron-manager)[michielkempen/nova-polymorphic-field

A Laravel Nova field container allowing to depend on other fields values

6781.9k1](/packages/michielkempen-nova-polymorphic-field)[fomvasss/laravel-meta-tags

A package to manage SEO (meta-tags, xml-fields, etc.)

3028.9k](/packages/fomvasss-laravel-meta-tags)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)[sherlockode/configuration-bundle

Symfony bundle for user-defined configuration values

3118.7k](/packages/sherlockode-configuration-bundle)[digitalcloud/nova-address-field

A Laravel Nova Address field.

1019.5k](/packages/digitalcloud-nova-address-field)

PHPackages © 2026

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