Code Monkey home page Code Monkey logo

wordpress-lightning-publisher's Introduction

Lightning Publisher for WordPress

MIT license Pull Requests Welcome IRC

Lightning Publisher for WordPress allows you to offer previews of your blog posts and require a Lightning Network payment to release the rest.

Powered by โšก Lightning Charge.

Publisher demo

Installation

  1. Setup Lightning Charge.

  2. Install the Lightning Publisher for WordPress plugin from the WordPress.org plugin directory.

    Alternatively, you can download wordpress-lightning-publisher.zip and install it manually.

  3. Under the WordPress administration panel, go to Settings -> Lightning Publisher to configure your Lightning Charge server URL and API token.

Note that Lightning Publisher uses Lightning Charge's built-in checkout page (as an iframe), meaning that the Lightning Charge server has to be publicly accessible to users. If users need to access it using a different URL than the one used for communicating with the API, set this under "Public URL" in the settings page.

Usage

Add [ifpaid AMOUNT CURRENCY] in the place that marks the beginning of paid access to the post. All text prior to that point will be available as a preview to everyone, while all text after that point will only be available to patrons.

For example: [ifpaid 0.0005 USD] or [ifpaid 0.00000005 BTC]. All the currencies on BitcoinAverage are supported. BTC amounts can have up to 11 decimal places (milli-satoshis precision).

Editor example

You may also specify a custom message and button text, as follows: [ifpaid 0.005 ILS text="Please pay to continue reading." button="Alright, I'll pay!"]. This will show up as:

Custom pay form example

Once the user makes the payment, the page will automatically refresh and the access token will be appended to the URL. The user can bookmark this patron-only URL to return to the content later. The token does not currently ever expire.

This will look something like: http://some.blog/trusted-third-parties-are-security-holes/?publisher_access=2bgduhk48gkk480sksoowkssggc0wcokwws0c8k8k8s04wc0gs

Note that anyone with this URL will be able to access the content. There are currently no restrictions in place to prevent links from being shared.

License

MIT

wordpress-lightning-publisher's People

Contributors

shesek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-lightning-publisher's Issues

Add lightning-network as a topic to this repository

Hello,

This repository is listed on the Awesome Lightning-Network list, which is a collection of useful lightning-network projects. However, it seems that the 'lightning-network' topic is missing from this repository's topics.

Adding the 'lightning-network' topic will help users discover your project more easily and recognize its relevance to the lightning-network ecosystem. To add the topic, please follow these steps:

  1. Navigate to the main page of the repository.
  2. Click on the gear icon next to "About" on the right side of the page.
  3. In the "Topics" section, type 'lightning-network' and press Enter.
  4. Click "Save changes."

Thank you for your attention and for contributing to the lightning-network community!

Custom "pay" text and button don't show complete sentence.

Using the example from your "Usage" section
[ifpaid 0.005 ILS text="Please pay to continue reading." button="Alright, I'll pay!"]

Only the first word in the quotes becomes visible (and also the first quote, which shouldn't be like that):
2018-07-22_15-26-40

"Pay with wallet" button does not work on Safari

When users clicks on pay with wallet in Safari, the button should open a wallet, or prompt the user which wallet should be opened, but it doesn't. Instead, the user has to hold the button, open a wallet. Maybe it should be made on click, makes more sense.

Lightning Wordpress Publisher and BTCPay -Fatal error: Uncaught Error: Class 'LightningChargeClient' not found

Hi, I have changed the setting from 'lnd' to 'clightning' to test out the LApps. I am on a LunaNode plan. Have enabled the Spark service. Under Manage Store, have also completed the Test Connection and is ok and saved the changes.

Downloaded Lightning Publisher in Word Press and updated the Lightning Publisher settings (server url, public url and API token) and saved changes.

I received an error message when firing up the website (website is working when the Lightning Publisher is deactivated) :

Fatal error: Uncaught Error: Class 'LightningChargeClient' not found in /home/domainname/public_html/wp-content/plugins/lightning-publisher/lightning-publisher.php:19 Stack trace: #0 /home/domainname/public_html/wp-content/plugins/lightning-publisher/lightning-publisher.php(195): Lightning_Publisher->__construct() #1 /home/domainname/public_html/wp-settings.php(322): include_once('/home/domainname/...') #2 /home/domainname/public_html/wp-config.php(90): require_once('/home/domainname/...') #3 /home/domainname/public_html/wp-load.php(37): require_once('/home/domainname/...') #4 /home/domainname/public_html/wp-blog-header.php(13): require_once('/home/domainname/...') #5 /home/domainname/public_html/index.php(17): require('/home/domainname/...') #6 {main} thrown in /home/domainname/public_html/wp-content/plugins/lightning-publisher/lightning-publisher.php on line 19.

Would appreciate help to resolve the issue. Thanks.

After successful payment redirects to /undefined

I setup a page (and a publication if that matters, I tried both) and added the [ifpaid 0.05 USD] attribute. The "Pay" button shows and after clicking it an invoice is created which I am able to successfully pay.

The problem occurs after I pay, the page refreshes but no token is appended to the url, rather the url changes from sondaji.com/test-publication/ to sondaji.com/test-publication/undefined which in result gives me the Wordpress 404 page

I can create a video demonstrating the process, but it's pretty straightforward. In my c-lightning log I see that the payment is successful:
lightningd(15538): Resolving invoice 'iVvfFzu~OmsWELQSUYq0z' with HTLC 5

lightning-charge also indicates success:
GET /checkout/iVvfFzu~OmsWELQSUYq0z/wait 204 8915.376 ms - -
GET /invoice/iVvfFzu%7EOmsWELQSUYq0z 200 2.333 ms - 816

Picture 1: Qr Code
2018-04-24_13-56-46

Picture 2: Redirected page after successful payment:
2018-04-24_13-58-50

This plugin is great but Lightning Charge installation and configuration is way to complicated

This plugin is great but Lightning Charge installation and configuration is way to complicated for the average Wordpress admin.

Could third parties provide Lightning Charge servers and charge a small fee for this service? No one is going to install this if they have to run, secure and maintain a complicated Linux node.

This plugin is still a huge step forward, history being made.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.