{"id":34638696,"url":"https://github.com/generoi/wp-paywall","last_synced_at":"2026-06-01T07:31:33.228Z","repository":{"id":252288894,"uuid":"839984015","full_name":"generoi/wp-paywall","owner":"generoi","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-20T17:01:22.000Z","size":750,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-26T06:15:45.926Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generoi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-08T18:11:10.000Z","updated_at":"2024-09-20T17:01:25.000Z","dependencies_parsed_at":"2024-09-10T12:01:37.423Z","dependency_job_id":"d84f93b9-000d-440a-af54-faff24bedd0e","html_url":"https://github.com/generoi/wp-paywall","commit_stats":null,"previous_names":["generoi/wp-paywall"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/generoi/wp-paywall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-paywall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-paywall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-paywall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-paywall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generoi","download_url":"https://codeload.github.com/generoi/wp-paywall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generoi%2Fwp-paywall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33765378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T17:12:45.638Z","updated_at":"2026-06-01T07:31:33.192Z","avatar_url":"https://github.com/generoi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wp-paywall\n\n\u003e A paywall plugin\n\nBy 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.\n\nIf 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.\n\nOut of the box paywalled content will show the login form but you can override this template in your theme.\n\nAdditionally 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._\n\nThere'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.\n\nTo 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.\n\n## Environment variables\n\n- `PAYWALL_JWT_PRIVATE_KEY` should be set to the absolute of path of a private key used to sign JWT payloads.\n\n## Constants\n\n- `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.\n\n## Hooks\n\n```php\n/**\n * Hook in early to return a header passed on from a reverse proxy.\n */\nadd_filter('wp-paywall/has-access', function (?bool $hasAccess, ?int $postId) {\n    $proxyAuth = $_SERVER['X-Proxy-Valid-Auth'] ?? null;\n    return $proxyAuth === '1';\n}, 10, 2);\n\n/**\n * Remove default access rules and set your own.\n */\nadd_filter('wp-paywall/access-rules', function (array $rules, ?int $postId) {\n    $rules = [];\n    $rules[] = CustomAccess::class;\n    return $rules;\n}, 10, 2);\n\n/**\n * Hook in early to return if paywall is applied or not.\n */\nadd_filter('wp-paywall/is-applied', function (?bool $isApplied = null, ?int $postId) {\n    if ($postId === 1234) {\n        return true;\n    }\n    return $isApplied;\n}, 10, 2);\n```\n\n## Development\n\nInstall dependencies\n\n    composer install\n    npm install\n\nRun the tests\n\n    npm run lint\n    composer lint\n\n    # Setup WP-ENV\n    npm -g i @wordpress/env\n    wp-env start\n\n    # Run unit tests\n    wp-env run tests-cli --env-cwd=wp-content/plugins/wp-paywall ./vendor/bin/phpunit\n\n    # With Xdebug\n    wp-env stop\n    wp-env start --xdebug\n    wp-env run tests-cli --env-cwd=wp-content/plugins/wp-paywall ./vendor/bin/phpunit\n\nBuild assets\n\n    # Minified assets which are to be committed to git\n    npm run build:production\n\n    # Watch for changes and re-compile while developing the plugin\n    npm run start\n\n## Translations\n\n    wp i18n make-pot . languages/wp-paywall.pot\n    wp i18n make-mo languages/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fwp-paywall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeneroi%2Fwp-paywall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeneroi%2Fwp-paywall/lists"}