Coder Social home page Coder Social logo

candygirl24 / btcpaywall Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supertestnet/btcpaywall

0.0 0.0 0.0 3.75 MB

A wordpress plugin that creates a paywall for almost any wordpress content, payable in bitcoin over the lightning network

License: Creative Commons Zero v1.0 Universal

PHP 58.77% JavaScript 41.23%

btcpaywall's Introduction

BTC Paywall

A wordpress plugin that creates a paywall for almost any wordpress content, payable in bitcoin over the lightning network

The files in the btcpaywall subdirectory of this git repository are the source code of the plugin. You can download the btcpaywall subdirectory, zip it, and upload it to your wordpress directory, or -- if you don't want to do the zipping -- you can download a prezipped version here:

https://drive.google.com/file/d/1Q8RXafLklKCifXvo0OxQt-qhlDwkzZap/view?usp=sharing

Watch the guide

Installation

Install and activate the plugin through the plugins page in the backend of your wordpress installation. Just select Add new and upload the zip file.

Lnbits

After you install and activate BTC Paywall, but before you can use it, you'll have to connect it to an lnbits wallet. Lnbits is, among other things, an abstraction layer that allows programs built for bitcoin's lightning network to communicate in a standardized way with most popular lightning network implementations, such as clightning and lnd, as well as custodial lightning wallets like opennode, lnpay, and lntxbot. You can either self-host lnbits in order to do everything with minimized trust (see github.com/lnbits/lnbits for more details) or get a custodial lnbits wallet at lnbits.com.

To connect BTC Paywall to lnbits, use the BTCPaywall Settings menu. It is located in the backend of your wordpress website > Settings > BTC Paywall. Visit the Settings menu and take the url of your lnbits host as well as your wallet api key and add them to the settings menu of BTC Paywall. The hostname will be https://lnbits.com if that is the site you are using or, if you are self-hosting lnbits on the same server that hosts your wordpress site, it may be something like http://localhost:5000. As for your api key, obtain that by creating an lnbits wallet and looking at the righthand sidebar. "Invoice/read key" is the one you want.

Screenshot showcasing api key

Syntax

Once the plugin is installed and your lnbits url and api key are saved in Settings, create a paywall on any wordpress page or post using this syntax: [paywall price="1"]any wordpress content[/paywall]

The price, by default, is denominated in sats. In the above example, you will sell access to your content for 1 sat, or 0.00000001 bitcoins. In settings, you can change the denomination to US dollars if you want, which will cause the plugin to pull a price feed from coinbase. If you do that, [paywall price="1"]any wordpress content[/paywall] will cost the equivalent of 1 US dollar in bitcoin. You can also use decimalization if you select USD as your currency -- price="0.01" is a valid way to charge someone a penny for your content.

Details

BTC Paywall uses server-side software to conceal the content of your paywall. That means the user does not have the content in their browser if they just de-obfuscate it. Instead, the server simply doesn't serve the content until the paywall is paid.

You are not limited to paywalling your written content. You can paywall your videos, your podcasts, your pictures, your livestreams -- almost anything you want to charge money for. If you can embed it on a wordpress page, you can paywall it.

When a user pays for a piece of content, their browser will store some data about their payment in a cookie. (Actually it's in the browser's local storage, but meh.) If they visit the page containing that content in the future, their browser will share that payment data with the server which will then use it to look up their old invoice. Since it is paid, the server will then show them the content they paid for.

btcpaywall's People

Contributors

supertestnet avatar

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.