EthPress – Web3 Login

Plugin Banner

EthPress – Web3 Login

by lynn999

Download
Description

The EthPress Web3 Login WordPress Plugin adds a capability to connect with cryptocurrency wallets such as MetaMask for Ethereum, Binance Smart Chain (BSC), Polygon (MATIC) or any other EVM-compatible blockchain, and wallets that support Reown QR code. Adds a button to WordPress login screen that will let users securely log in with their crypto wallet.

Add the capability to log in with cryptocurrency wallets such as MetaMask for Ethereum, and wallets that support Reown 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.

The EthPress NFT Access Add-On can be used to control access for WooCommerce products, simple pages and posts.

Supported Languages

The plugin is translated into the following languages:

  • German (de_DE)
  • Spanish (es_ES)
  • French (fr_FR)
  • Hindi (hi_IN)
  • Italian (it_IT)
  • Japanese (ja_JP)
  • Portuguese (Brazil) (pt_BR)
  • Portuguese (pt_PT)
  • Russian (ru_RU)
  • Chinese (Simplified) (zh_CN)
  • Chinese (Traditional) (zh_TW)

Features

  • A web3 login button is added to your login screen automatically
  • The Reown Settings section holds your own Reown Project ID (from dashboard.reown.com) and the wallet modal Theme Mode (Dark Mode or Light Mode)
  • The Hide on the WordPress login page setting can hide the wallet login and register buttons on wp-login.php, while buttons added with the shortcodes or the widget keep working
  • The Terms & Conditions settings (in Login Settings) show a required “I agree to the Terms & Conditions” checkbox next to the wallet login button. The text can link to a Terms & Conditions page URL
  • A wallet without an account gets a message explaining why: the site does not accept registrations (the Anyone can register setting) and the visitor should contact the site administrator. The wording is filterable with ethpress_registration_closed_message and ethpress_unregistered_message
  • Use the EthPress widget for maximum ease
  • A shortcode [ethpress_login_button] can be used to display the Login button anywhere
  • A shortcode [ethpress_link_button] can be used to display the Link accounts button anywhere. The new account linked address will be put in all HTML elements with the eth-address-field class present.
  • Local signature verification with the php-gmp/php-bcmath extensions, or by a verification service you can host yourself. The Diagnostics section of the plugin settings tells you which of the two is in use
  • The Diagnostics section of the plugin settings reports what a wallet login depends on: the PHP signature support (php-gmp/php-bcmath) of your server, a signature self-test that runs through whichever path the logins actually take (this server or the verification service), the verification service that would be used instead, whether your own Reown Project ID is set, and whether new wallets can still register

Features PRO

The EthPress PRO version is required to use these features. Free 7 days Trial is available!

  • Managed Verification Service.
  • EthPress login button on a WooCommerce Login, Register and Checkout Forms.
  • The [ethpress_account] short code can be used to display the current user’s address logged with.
  • A shortcode [ethpress_unlink_button] can be used to display the Unlink wallet button anywhere. It removes the wallet association and disconnects the connected wallet. The account itself is kept, so signing in with the same wallet again links it back to that account instead of creating a second one (see the “What happens to the account when a wallet is unlinked?” question)
  • The Login button label, Register button label, Link button label and Unlink button label settings can be changed in the plugin settings
  • The The login signing message and The account link signing message settings can be used to change the message a user signs in the wallet when logging in or linking an account
  • The The account link success message and The account unlink message settings can be used to change the messages shown after a wallet is linked or unlinked
  • WooCommerce Account Details show Link Wallet button setting
  • The Redirect URL setting can be used to set an URL of a page to redirect after a successful login
  • The Disable standard redirect setting (in Login Settings) stops the automatic redirect to the WordPress dashboard or the configured Redirect URL after a successful login, returning the user to the page where the login started instead
  • The Remember me setting (in Login Settings) controls whether wallet users stay logged in across browser restarts instead of having to connect their wallet on every visit. It is enabled by default and can be changed in PRO only
  • The Profile completion setting (in Login Settings) collects the email and name of new wallet users. The Inline form next to the login button mode shows the fields with the button, so they are filled in before the account is created; the Redirect to the profile after login mode sends users who registered without an email address to their profile after the first login
  • The Supported networks setting (in Reown Settings) chooses which EVM chains and testnets are offered to the user
  • The Custom CSS setting (in Reown Settings) can style the login buttons and the wallet modal, including the AppKit CSS variables such as --w3m-accent
  • The noredirect and redirect_to attributes of the [ethpress_login_button] shortcode control the redirect per button. [ethpress_login_button noredirect="1"] disables the standard redirect for that button, and redirect_to="current" returns the user to the page where the login started. Any other value of redirect_to is used as an explicit redirect URL
  • The label attribute of the [ethpress_login_button], [ethpress_link_button] and [ethpress_unlink_button] shortcodes changes the button text for that button only, for example [ethpress_login_button label="Sign in"]

The NFT Token based access control for the WooCommerce products, simple pages and posts can be done with the EthPress NFT Access Add-On. Free 7 days Trial is available!

Integrations

EthPress NFT Access Add-On Features

Check user NFT authentication control (non-fungible token, erc-721 and erc-1155) ownership.
The EthPress NFT Access Add-On is perfect for blocking users access to a Page, a Post and a WooCommerce Product page, if they don’t own a certain NFT token.

Free 7 days Trial is available

  • Site wide NFT verification requirement to register or login
  • Restrict access to a Page to some NFT token owners only
  • Restrict access to a Post to some NFT token owners only
  • Restrict access to a WooCommerce Product to some NFT token owners only
  • Shortcode to display your access level: [ethpress_nft_access_addon_nft product_id=”1337″]
  • ERC721 and ERC1155 non-fungible token standards are supported

Integrations

  • LearnPress LMS courses access can be granted with NFT token
  • Tutor LMS courses access can be granted with NFT token
  • Ethereum Wallet plugin generated accounts are also tested
  • The ethpress_nft_access_get_user_accounts filter can be used to add wallets for testing:

    add_filter('ethpress_nft_access_get_user_accounts', function($accounts) {
        $more_accounts = get_more_accounts();
        return array_merge($accounts, $more_accounts);
    });
    

Disclaimer

By using this free plugin you accept all responsibility for handling the account balances for all your users.

Under no circumstances is ethereumico.io or any of its affiliates responsible for any damages incurred by the use of this plugin.

Every effort has been made to harden the security of this plugin, but its safe operation depends on your site being secure overall. You, the site administrator, must take all necessary precautions to secure your WordPress installation before you connect it to any live wallets.

You are strongly advised to take the following actions (at a minimum):

By continuing to use the EthPress plugin, you indicate that you have understood and agreed to this disclaimer.

Hooks

The full list of the plugin actions and filters is documented in the
extra readme.

The EthPress PRO version is required to use the PRO hooks. Free 7 days Trial is available!

Use WordPress’ Add New Plugin feature, search “EthPress”,

or

  1. Upload this folder (on WordPress.org, not GitLab) to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  1. Login flow.

    Login flow.

  2. Widget included.

    Widget included.

  3. WooCommerce Login Form display.

    WooCommerce Login Form display.

  4. WooCommerce Login Form display settings.

    WooCommerce Login Form display settings.

  5. The EthPress NFT Access Add-On page settings.

    The EthPress NFT Access Add-On page settings.

  6. The EthPress NFT Access Add-On settings.

    The EthPress NFT Access Add-On settings.

  7. The EthPress NFT Access Add-On site wide settings.

    The EthPress NFT Access Add-On site wide settings.

  8. NFT Access Granted message on the All cources page LearnPress LMS

    NFT Access Granted message on the All cources page LearnPress LMS

  9. Buy NFT token to access message on a cource page LearnPress LMS

    Buy NFT token to access message on a cource page LearnPress LMS

  10. NFT Access Granted message on a cource page LearnPress LMS

    NFT Access Granted message on a cource page LearnPress LMS

  11. NFT Access settings on a cource page LearnPress LMS

    NFT Access settings on a cource page LearnPress LMS

  12. NFT Access settings for LearnPress LMS

    NFT Access settings for LearnPress LMS

  13. NFT Access Granted message on the All cources page Tutor LMS

    NFT Access Granted message on the All cources page Tutor LMS

  14. NFT Access Granted message on a cource page Tutor LMS

    NFT Access Granted message on a cource page Tutor LMS

  15. NFT Access settings for Tutor LMS

    NFT Access settings for Tutor LMS

  16. The Ultimate Member EthPress Button support

    The Ultimate Member EthPress Button support

  17. The Ultimate Member EthPress Button edit dialog

    The Ultimate Member EthPress Button edit dialog

  18. The Ultimate Member EthPress Button on the Login page

    The Ultimate Member EthPress Button on the Login page

  19. The Ultimate Member EthPress Button on the Register page

    The Ultimate Member EthPress Button on the Register page

  20. The Ultimate Member EthPress Link Account Button on the Profile Edit page

    The Ultimate Member EthPress Link Account Button on the Profile Edit page

  21. The Ultimate Member EthPress Account display on the Profile page

    The Ultimate Member EthPress Account display on the Profile page

Can NFT token ownerhip restriction be applied?

The NFT Token based access control for the WooCommerce products, simple pages and posts can be done with the EthPress NFT Access Add-On. Free 7 days Trial is available!

The modal classes keep changing

The wallet modal is drawn by Reown AppKit inside a shadow root, so page CSS and class selectors cannot reach it at all (the old #web3-login-root element and its per-build svelte-* classes are gone). Style it with the Custom CSS setting (PRO, in Reown Settings) and the AppKit CSS variables such as --w3m-accent.

How does it work?

The outline is described in this TopTal post by Amaury Martiny.

A one-time nonce is stored for the wallet address and consumed when the signature is verified, so a signed message cannot be replayed. Its lifetime is 15 minutes by default and can be changed with the ethpress_nonce_lifetime filter. The IP the message was requested from is stored with it for troubleshooting, but it is not part of the check, because a mobile wallet can switch networks between requesting the message and signing it.

For 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 the php-gmp or php-bcmath extension installed, we do it with PHP, and you can ignore the rest of this. The Diagnostics section of the EthPress settings page proves it with a known message and signature.

Otherwise the verification is done by a verification service. EthPress PRO comes configured with a Managed Verification Service. You can also host that service yourself and set its URL in the Verification Service API URL setting; its source code is here: 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 Reown QR code reading from wallets such as MetaMask Mobile, there is very little friction!

What happens to the account when a wallet is unlinked?

Unlinking is a soft detach: only the association is removed, the WordPress account stays.

  • The ethpress user meta of the account is deleted, so the wallet no longer resolves to it: [ethpress_account], the eth-address-field elements and the unlink button show nothing until a wallet is linked again.
  • A user who signed in with the wallet as their login name is logged out, because the wallet was their only way in. A regular WordPress user (who linked a wallet to an existing account) stays logged in.
  • The account itself is not deleted, and neither is its login name. For wallet users the login name is the wallet address, so signing in again with the same wallet finds that account through it and links the address back to it. This is why a freshly unlinked wallet does not get a second account, and why an unlinked wallet cannot be used to register a new one.
  • Unlinking from the account page and then signing in with the same wallet therefore ends up in the same account, with the wallet linked again.

To dissociate them for good, delete the WordPress user as well (Users > All Users). Deleting a user removes their wallet address with them.

GDPR?

This is everything EthPress keeps on your server for a wallet:

  • the wallet address, as the ethpress user meta of the WordPress user the wallet is linked to. Unlinking the wallet deletes that meta; the user account itself and its login name (the address) stay until the account is deleted;
  • the WordPress user account itself: its login name and its display name are the wallet address, and its email is a placeholder derived from that address – unless the visitor typed a real email and name, which the registration form, the WooCommerce checkout or the Inline form next to the login button mode collect;
  • two flags on that user, ethpress_generated_email and ethpress_profile_incomplete, which let the plugin replace the placeholder email with a real one;
  • the one-time login nonce: a transient keyed by the wallet address that also records the IP the login message was requested from. The IP is kept for troubleshooting only and is never checked. The nonce is deleted as soon as the signature is verified, and expires after 15 minutes at the latest;
  • debugging lines, when the plugin writes them (a failed verification, or any login verified by the service). They go to the WooCommerce log file, wp-content/uploads/wc-logs/ethpress-*.log, or to the PHP error log when WooCommerce is not installed, and they contain the wallet address, the message that was signed and its signature. Clear those files when the addresses have to be gone.

Nothing is sent anywhere, with two exceptions:

  • the verification service, when it is the one verifying the signatures on your site (see the “Signature verification” question). Only the message and the signature are posted; the wallet address is recovered from the signature there, not sent. The default (managed) service is hosted on ethereumico.io and stores nothing, and you can host that service yourself instead.
  • opening the wallet modal talks to Reown: its API provides the wallet list, and mobile wallets are connected through the WalletConnect relay. EthPress itself sends neither the signature nor the wallet address there.

Deleting a user deletes their wallet address with them. Removing the plugin deletes the plugin settings, but the wallet addresses stay in wp_usermeta until those users are deleted themselves – search for the ethpress meta key if you need to remove them by hand.

Check the Diagnostics section of the EthPress settings page to see which verification path your site uses.

Source code and contributing

Contributions on GitLab only, thank you.

Plugin’s source code: https://gitlab.com/losnappas/ethpress.

Signature verifier’s, which is used if no php-gmp or php-bcmath, source code: https://gitlab.com/losnappas/verify-eth-signature.

The wallet modal is a React component built on the Reown AppKit library. Its source code is part of the plugin repository, in the reown/ directory: https://gitlab.com/losnappas/ethpress.

Further support

On the wordpress.org support page, or on the ethereumico.io support forum.

Works like a charm!

By Kookidooki on March 30, 2023

This great plugin works like a charm!

I got one question:

Can you make a stand-alone "Connect with Wallet" button or link, not integrated in login form or Woocommerce. I don't want users login into my website to buy our crypto tokens.

Thank you!

Many time this plugin not work.

By pariskan on June 12, 2022

Can't make sure when not work. but many time when login will show Error: cannot detect crypto wallet and Bad nonce, please refresh. Recommend find better plugin

Great work

By felix9607 on January 19, 2022

Very great plugin to enable the web3 for wordpress! Anyways it seems like a lot of users have trouble using the shortcode (me included). The widget is the only thing that enables he capabilities so far. Hope to see improvments here so the pro version might be a buy.

Thanks

By pabelpm on January 1, 2022

Esperemos que incorporen el login mediante NFT

Very promising

By Pascal (pascalcab) on December 13, 2021

Very cool plugin with a very promising setup. The connection to Ledger Nano X is currently not working but apart from that it works incredibly well.

great plugin

By willsorr on December 4, 2021

works really well.

103290392/10 Would Recommend

By 42three on November 7, 2021

Does exactly what it promises to do. Only thing to dislike is that the username generated is taken from the wallet address. Easily can be changed after some tweaking however. Lynn is a genius and so great #lynnfanforlife

Great plugin

By jordanbg on October 29, 2021

Really useful plugin hope a new maintainer will appear soon and the premium version will be available

I have some business offer

By cutesvg on April 10, 2021

Is it possible to contact you, I have some business offer Regards, Alex

Best Web3 Auth

By graemeconradie on May 20, 2020

If you need to allow for web3 login and authentication, Ethpress is the way to go. Lynn is very helpful, and always responds to questions very quickly. Thanks for developing Ethpress Lynn !

3.0.0

  • The login modal is rewritten on Reown AppKit (the successor of WalletConnect v2). The old web3modal based front end is removed
  • The new Reown settings section is added: Reown Project ID, Theme mode and Supported networks
  • Multichain support: the new Supported networks setting lets you choose which networks are offered to users – the EVM chains (Ethereum, Polygon, Arbitrum, Optimism, Base, BNB Smart Chain, Avalanche, Fantom, Gnosis, zkSync, Linea, Scroll, Celo, Polygon zkEVM, Mantle, Blast, Cronos, Moonbeam) and testnets
  • Multisite support: the plugin options are now stored network wide
  • The [ethpress_unlink_button] shortcode is added to display the Unlink wallet button anywhere. Unlinking removes the wallet association and keeps the account: signing in again with the same wallet links it back to that account, and the wallet cannot be used to register a second one
  • A confirmation message is shown to the user after the account is linked
  • The Freemius SDK is updated and bundled via Composer
  • olegabr/keccak is replaced with kornrunner/keccak
  • Requires PHP 8.1
  • The Disable standard redirect login setting is added. When enabled, a successful login no longer redirects to the WordPress dashboard or the Redirect URL, but returns the user to the page where the login started
  • The noredirect and redirect_to attributes are added to the [ethpress_login_button] shortcode, so the redirect can be controlled per button
  • The label attribute is added to the [ethpress_login_button], [ethpress_link_button] and [ethpress_unlink_button] shortcodes, so the button text can be changed per button (PRO)
  • The Remember me login setting is added. Wallet users now stay logged in across browser restarts instead of having to connect their wallet on every visit. The Free version always keeps it enabled
  • Wallet users are now registered with an email address, collected from the login form, the WooCommerce checkout, or a placeholder derived from the wallet address, so their profile is editable
  • The Profile completion login setting is added. When enabled (PRO), new wallet users who registered without an email address are sent to their profile after the first login to add an email and a name. It also has an Inline form next to the login button mode, which collects the email and name before the account is created. The values are remembered for the current browser tab, so a reload does not lose them
  • The Hide on the WordPress login page setting is added. When enabled, the wallet login and register buttons are not displayed on wp-login.php. Buttons added with the shortcodes or the widget are not affected
  • The Custom CSS setting is added (PRO). It styles the login buttons and the wallet modal
  • The Terms & Conditions text and Terms & Conditions URL login settings are added. They show a required “I agree to the Terms & Conditions” checkbox next to the wallet login button; the text links to the given URL when set. The login is blocked until the box is ticked, and the acceptance is checked on the server as well
  • The Diagnostics section is added to the plugin settings. It answers the “why does nothing work here” questions without support: whether php-gmp/php-bcmath verify signatures on this server, whether a known message and signature really recover the expected address (checked with this server, or with the verification service when that is the path the logins take), which verification service is used instead, whether your own Reown Project ID is set, and whether new wallets can create an account
  • A signature verification that is done by the verification service now fails cleanly when the service is unreachable, if your site blocks outbound requests, or when it answers with an HTML error page or a different JSON shape. Such answers used to raise PHP warnings inside the login request instead of a normal “failed to verify” error. The signature self-test in the Diagnostics section reports exactly that: it probes the service when the service is the path the logins take, and it waits at most 5 seconds
  • The [ethpress_login_button] shortcode no longer prints nothing for a logged-in visitor. It prints a hint explaining that the button is hidden because the user is already logged in (notice="1" forces it for every visitor, notice="0" switches it off); site owners see the hint by default
  • A wallet without an account is no longer answered with the bare “You have not registered on this site; we cannot log you in”. When the site does not accept registrations (the default), the message now says so, names the Anyone can register setting and tells the visitor to contact the site administrator – something they can forward as is. Both messages are filterable with ethpress_registration_closed_message and ethpress_unregistered_message
  • Fixed wallet login on sites where another active plugin (for example BuddyPress) prints output, or renders a login form, while the login request is being processed. Such output used to be prepended to the AJAX response, which broke it with the Unexpected token < in JSON at position 0 error and left the user logged in on the server but not in the browser
  • A malformed signature that cannot be recovered no longer returns an HTTP 500 error page. The failure is caught and reported as a regular JSON error response
  • Fixed the renewed AJAX nonces that a successful login returns in its response. They were created for a session token that the browser did not have yet, so using them right after logging in failed with Bad nonce, please refresh. The renewed nonces are now valid on the session the login just created
  • Wallet login nonces are now one-time. The nonce is issued when the login message is requested and consumed when the signature is verified, so a signed message cannot be replayed. Its lifetime is configurable with the ethpress_nonce_lifetime filter (15 minutes by default) instead of the fixed five minutes, and it no longer depends on the session token, which fixes Bad nonce, please refresh on slow mobile wallet flows
Back to top