Skip to content

Update all eCash related references to more generic names#38

Merged
Klakurka merged 1 commit intomasterfrom
fix/make-ecash-related-references-generic
Mar 15, 2025
Merged

Update all eCash related references to more generic names#38
Klakurka merged 1 commit intomasterfrom
fix/make-ecash-related-references-generic

Conversation

@xecdev
Copy link
Collaborator

@xecdev xecdev commented Mar 12, 2025

This PR refactors the codebase to replace all eCash-specific references (including variable names, CSS class names, and general mentions) with more generic terms. This refactoring not only improves code quality but also lays the groundwork for supporting additional cryptocurrencies like BCH, DOGE, and BTC.

Key Changes:

  • Refactoring: All eCash-related identifiers have been renamed to generic terms.
  • Migration Plan: A detailed migration strategy is implemented to ensure existing plugin users keep their data. For example, the database column ecash_address in the wp_paybutton_paywall_unlocked table is now renamed to pb_paywall_user_wallet_address.
  • Bug Fixes: Minor bugs introduced during the renaming process across files have been resolved.

Test plan:
1. Existing WordPress Site:

  • Install the plugin on your existing WP site
  • Make sure your old options such as Admin wallet address is still there
  • Open the database (via the WP Adminer plugin) and hover over to the wp_paybutton_paywall_unlocked table, select the data and see if the column ecash_address name has changed to pb_paywall_user_wallet_address
  • Go to the Customers page from dashboard and confirm that the data is loaded correctly
  • Test the paywall functionality of the plugin from the front-end and make sure it works correctly

2. New WordPress Site:

  • Install the plugin on a fresh WP installation to confirm that it functions correctly from the start.

@xecdev xecdev added enhancement (UI/UX/feature) New feature or request enhancement (behind the scenes) Stuff that users won't see labels Mar 12, 2025
@xecdev xecdev requested a review from Klakurka March 12, 2025 18:31
@xecdev xecdev self-assigned this Mar 12, 2025
$old_value = get_option( 'paybutton_paywall_ecash_address', '' );
$new_value = get_option( 'pb_paywall_admin_wallet_address', '' );

// If old_value is present and new_value is empty, copy old to new and remove old.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments explaining the 'what' are usually pretty useless and this is a good example. Comments should cover the 'why' and then the code itself should be relatively easy to read.

@Klakurka Klakurka merged commit 454295d into master Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement (behind the scenes) Stuff that users won't see enhancement (UI/UX/feature) New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants