{"id":19001451,"url":"https://github.com/bumi/wp-lightning","last_synced_at":"2025-07-02T17:02:26.802Z","repository":{"id":37075917,"uuid":"268524982","full_name":"bumi/wp-lightning","owner":"bumi","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-05T21:22:38.000Z","size":2577,"stargazers_count":0,"open_issues_count":7,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T22:03:12.880Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bumi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-01T13:08:42.000Z","updated_at":"2022-01-05T20:02:05.000Z","dependencies_parsed_at":"2022-08-19T08:00:52.245Z","dependency_job_id":null,"html_url":"https://github.com/bumi/wp-lightning","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bumi/wp-lightning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fwp-lightning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fwp-lightning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fwp-lightning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fwp-lightning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bumi","download_url":"https://codeload.github.com/bumi/wp-lightning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fwp-lightning/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263181949,"owners_count":23426619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-08T18:11:16.987Z","updated_at":"2025-07-02T17:02:26.652Z","avatar_url":"https://github.com/bumi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightning Publisher for WordPress\n\nLightning Publisher is a Bitcoin Lightning Paywall and Donation plugin for Wordpress. It allows you to receive Bitcoin Lightning payments with your WordPress website.\n\n## Demo\n\nHere quick Demo videos showing how to setup and use the plugin:\n+ [Quck Start - setup + paywall setup](https://www.loom.com/share/095b49a87e444442ac7b297f9483dfa7)\n+ [Admin Panel](https://www.loom.com/share/dbe501fe9d91445082a2c5c07a1a8ce8)\n\n## Installation\n\nClone the repository and install the dependency\n\n```bash\ngit clone https://github.com/getAlby/lightning-publisher-wordpress.git\ncd lightning-publisher-wordpress\ncomposer install # (maybe you need to add `--ignore-platform-reqs`)\n```\nTo build a .zip file of the WordPress plugin run:\n```bash\n./build.sh # this builds a `wordpress-lightning-publisher.zip`\n```\n\nThen upload and activate the plugin.\n\n## Paywall\n\n### Paywall options\n\n* Fixed amount\n* Free once a certrain amount is collected\n* Free after a certain time\n* Free until a certain time\n\n#### Paywall Hook to have custom logic when to enable/disable the paywall\n\nTo integrate with other plugins or to write custom conditions on when the paywall should be enabled a hook can be used. This means you can use a custom PHP function to decide if content should be behind the paywall or not.\n\nThis for example allows you to make the content available for all users/subscribers but enable the paywall for all other users.\n\n##### Example\n\n```php\n\n// your function receives two arguments:\n// 1. a boolean with the current check (true if the full content would be shown)\n// 2. the ID of the post the user accesses\n//\n// return true if the full content should be shown or false to enable the paywall\nfunction show_full_content_for_post($show_full_content, $post_id) {\n  // Add your logic to check if the current user can see the post with ID $post_id\n\n  return true; // return true to show the full content (disable the paywall)\n}\n\n// Check out the `add_filter` documentation for more information: https://developer.wordpress.org/reference/functions/add_filter/\nadd_filter('wp_lnp_has_paid_for_post', 'show_full_content_for_post', 10, 2);\n\n```\n\nAlternatively you can define a global function `wp_lnp_has_paid_for_post` which gets called. Return `true` to disable the paywall and show the full content.\n\n```php\n\nfunction wp_lnp_has_paid_for_post($show_full_content, $post_id) {\n  return true; // show full content - disable the paywall\n}\n\n```\n\n### Usage\n\nUse the plugin as a shortcode/widget/block.\n\n## Plugin Folder Structure\n\nFolder structure is based on https://github.com/DevinVinson/WordPress-Plugin-Boilerplate\n\n- `wp-lightning.php` is the entrypoint of the plugin\n- `includes` is where functionality shared between the admin area and the public-facing parts of the site reside\n- `admin` is for all admin-specific functionality\n- `public` is for all public-facing functionality\n- `includes/class-wp-lightning.php` is the main plugin class which handles including all the related classes.\n- `includes/class-wp-lightning-loader.php` is responsible for registering the action and filter hooks, and shortcodes.\n\n## REST API\n\nThe plugin also provides a set of REST API Endpoints for handling payments and donations.\n\n#### Intiate Payment for Paywall\n\n- URL: `/lnp-alby/v1/paywall/pay`\n- Method: `POST`\n- Auth Required: No\n- Data example\n\n```\n{\n    post_id: \"xxx\"\n}\n```\n\n#### Verify Payment for Paywall\n\n- URL: `/lnp-alby/v1/paywall/verify`\n- Method: `POST`\n- Auth Required: No\n- Data example\n\n```\n{\n    post_id: \"xxx\",\n    token: \"xxx\",\n    preimage: \"xxx\"\n}\n```\n\n#### Initiate Donation\n\n- URL: `/lnp-alby/v1/donate`\n- Method: `POST`\n- Auth Required: No\n- Data example\n\n```\n{\n    post_id: \"xxx\",\n    amount: \"xxx\"\n}\n```\n\n#### Verify Donation\n\n- URL: `/lnp-alby/v1/verify`\n- Method: `POST`\n- Auth Required: No\n- Data example\n\n```\n{\n    amount: \"xxx\",\n    token: \"xxx\",\n    preimage: \"xxx\"\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbumi%2Fwp-lightning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbumi%2Fwp-lightning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbumi%2Fwp-lightning/lists"}