Description
Add the capability to log in with cryptocurrency wallets such as MetaMask for Ethereum, and wallets that support WalletConnect QR code. Adds a button to WordPress login screen that will let users securely log in with their crypto wallet.
In the background, a regular WordPress user account is created, so existing plugins and customizations will have no problem working along.
PRO Features
- Managed Verification Service. To verify signatures locally with JavaScript, see details: https://gitlab.com/losnappas/verify-eth-signature.
- EthPress login button on a WooCommerce Login Form
- The
[ethpress_account]
short code can be used to display the current user’s address logged with.
Hooks
These hooks can be used to add your custom logic after user logged in or linked an account using the EthPress plugin functionality.
The login_redirect
hook is a standard WordPress hook you can use to customize the page user should be redirected after login.
/**
* Fires after every login attempt.
*
* @param WP_User|WP_Error $user WP_User on success, WP_Error on failure.
* @param (string|false) $provider One of 'metamask', 'walletconnect', false.
*/
do_action( 'ethpress_login', $user, $provider );
/**
* Fires after every user account linking success.
*
* @param WP_User|WP_Error $user WP_User on success, WP_Error on failure.
* @param (string|false) $provider One of 'metamask', 'walletconnect', false.
*/
do_action( 'ethpress_linked', $user, $provider );
/**
* Filters the login redirect URL.
*
* @param string $redirect_to The redirect destination URL.
* @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
* @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise.
*/
$redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user );
Details
A web3 login button is added to your login screen automatically.
Premium plugins!
Premium plugins will be worked on by new maintainer soon~ish (before 2022, hoping), check back then.
Plugins include:
- EthPress Tokens: Checks users’ token balance, block them if they don’t own it.
- …More to come. Taking ideas. Good idea = get the plugin for free.
Widgets
Use the EthPress widget for maximum ease. Alternatively, a shortcode is “[ethpress_login_button]”.
Example
Eth (ERC-20) and BSC donations: 0x106417f7265e15c1aae52f76809f171578e982a9
Subscribe to this plugin’s support forum, I post feedback requests on the regular!
Installation
Use WordPress’ Add New Plugin feature, search “EthPress”,
or
- Upload this folder (on WordPress.org, not GitLab) to the
/wp-content/plugins/
directory - Activate the plugin through the ‘Plugins’ menu in WordPress
FAQ
-
“Cannot log you in; you have not registered”
-
EthPress 0.7.1+ respects the “Anyone can register” WordPress setting, so you have to enable that in Settings->General.
-
The modal classes keep changing
-
Use selectors like
#web3-login-root button.web3login-metamask
, instead of thesvelte-12345
. -
How does it work?
-
The outline is described in this TopTal post by Amaury Martiny.
Instead of using databased nonces, we use WordPress nonces with a lifetime of 5 minutes, and append the user IP to the login message to prevent replays from elsewhere.
Fore more details, check out the extra readme.
-
Signature verification
-
When user submits a signature, it needs to be verified on server-side.
Read the “How does it work?” question.
Firstly, if you have php-gmp or php-bcmath extension installed, we’ll do it with PHP, and you can ignore the rest of this. To check, go to the EthPress settings page.
Otherwise, we do it with JavaScript. EthPress Premium comes configured with a Managed Verification Service. To verify signatures locally with JavaScript, see details: https://gitlab.com/losnappas/verify-eth-signature.
-
Are my coins safe?
-
Yes. A wallet (e.g. MetaMask) does/should not leak your private keys out into the wild, that would be madness.
-
What about mobile?
-
Mobile integration is in good condition, with WalletConnect QR code reading from wallets such as MetaMask Mobile, there is very little friction!
-
GDPR?
-
Ethpress does not store anything other than the wallet address, on your server. It will be deleted if you delete the associated user account or remove the plugin entirely.
If you’re using the default, pre-set signature verification service: it is hosted on the ethereumico.io. No data is stored here.
Check EthPress Settings page for more information.
-
Source code and contributing
-
Contributions on GitLab only, thank you.
Plugin’s source code: https://gitlab.com/losnappas/ethpress.
WordPress plugin page: https://wordpress.org/plugins/ethpress/.
Signature verifier’s, which is used if no php-gmp or php-bcmath, source code: https://gitlab.com/losnappas/verify-eth-signature.
The modal is a Svelte component. Source code: https://gitlab.com/losnappas/web3-login.
-
Further support
-
On the wordpress.org support page, or on the ethereumico.io support forum.
Reviews
Contributors & Developers
“EthPress – Web3 Login” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “EthPress – Web3 Login” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.5.1
- New freemius.com library version
1.5.0
- The
ethpress_linked
hook is added.
1.4.0
- Managed WalletConnect bridge used
wp_usermeta
table usage instead of thewp_ethpress_addresses
- The
[ethpress_account]
shortcode is added
1.3.0
- EthPress register button on a WooCommerce Register Form
- EthPress register button on a WooCommerce Checkout page
1.2.2
- Affiliation program enabled
1.2.1
- Activation hook namespace usage fix
1.2.0
- freemius.com based licensing
- New Managed Verification Service API URL
- EthPress login button on a WooCommerce Login Form
1.1.1
Released 8/2021.
No longer taking the minimum of nonce lifetimes for the login nonce, instead the lifetime is static 5min.
1.1.0
Released 8/2021.
Updated WalletConnect libraries.
No longer removing database table on plugin uninstall.
Added Spanish translations (made by a contributor, forgot who).
1.0.3
Released 10/2020.
Another css fix on the z-index.
1.0.2
Released 9/2020.
Updated z-index and font color on modal.
1.0.1
Released 9/2020.
Little bug fix with address deletion.
The dialog now holds a span element instead of h2.
1.0.0
Released 8/2020.
Removed trust wallet deep link.
Changed walletconnect to show QR in the Account Linker, every time.
Releasing premium plugins, to fund development! Visit ethpress.imlynn.xyz.
0.7.0
Released 8/2020.
Added a Widget.
The widget has an extra feature compared to the shortcode. The widget allows users to link more addresses to their account. You should prefer the widget over the shortcode now.
The new EthPress widget was added to the profile.php landing page.
If you’ve disabled registration by unchecking Settings->General->”Anyone can register”, then EthPress will no longer register new users automatically. This was not the case before.
0.6.0
Released 4/2020.
Added PHP versions for signature recovery. It requires one of php-gmp or php-bcmath extensions. The JavaScript way still exists, but the PHP way is now preferred.
Added method for telling which login method user used.
0.5.0
Released 2/2020.
Added WalletConnect support.
Added shortcode [ethpress_login_button]
.
Changed the login flow. Login button now opens a modal.
Removed events from javascript. Since the modal, events are quite useless.
0.4.0
Released 11/2019.
Added Trust Wallet support and a deep link. Deeplinks can be printed with echo \losnappas\Ethpress\TrustWallet::get_deeplink();
.
0.3.0
Released 9/2019.
Added events to javascript. You can now use ethpress.on('status', console.log)
.
Added options page and changed from wp_options to wp_site_meta for multisite, so all sites use same options.
0.2.4
Released 7/2019.
Added multisite support.
Added better instructions for wp_login_form.
Modified database table from {$wpdb->prefix}
to {$wpdb->base_prefix}
for multisite support. Single site should see no difference here.
0.1.0
Initial release 6/2019.