Givewp: Fix non-donation / ecommerce terminology in actions and filters

Created on 16 Aug 2016  路  12Comments  路  Source: impress-org/givewp

There are many actions and filters throughout the plugin which use ecommmerce terminology such as give_purchase_form, give_purchase_form_wrap_bottom, give_purchase_form_before_submit, etc.

We should deprecate them and replace with donation based terminology. give_purchase_form --> give_donation_form, give_purchase_form_wrap_bottom -> give_donation_form_wrap_bottom

Task list:

  • [x] Rename directories
  • [ ] Rename variables
  • [ ] Rename hooks (actions + filters)
  • [x] Rename classes
  • [x] Rename db tables w/ upgrade routine

All items above with backwards compatibility

Most helpful comment

Agree, we need to consolidate Give terminology.

Here is another example for three different names for the same thing:

ternimology

I think we need to fix the front-end first, and only then the classes/functions/hooks names.

All 12 comments

Agree, we need to consolidate Give terminology.

Here is another example for three different names for the same thing:

ternimology

I think we need to fix the front-end first, and only then the classes/functions/hooks names.

As for the purchase, it is deeply embedded in the code. We have function names using this word, class properties and methods, and maybe even options (not sure about the last one - I need to check that).

It's a backwards-compatibility nightmare.

Yeah I know, that's why I've been resisting it. This is an ongoing gradual task.

Link for reference to _deprecated_hook function new to WP 4.6

Changeset: https://core.trac.wordpress.org/changeset/37861

Ticket: https://core.trac.wordpress.org/ticket/10441

@DevinWalker Translations strings updates are simpler and faster. I can do it in 1.7 , I just need know which word is preferred?

"Transactions" -> "Donations"

"Payment" -> "Donation"

@mathetos thoughts?

@DevinWalker @mathetos

One more terminology suggestion: Donators > Donors

Ref: https://github.com/WordImpress/Give/blob/master/includes/class-give-gravatars.php

Do you agree?

@ramiy yes definitely, that class isn't being used yet though :(

@DevinWalker Can you suggest what will be name of this action hook.
give_checkout_form_top

because will already have give_purchase_form_top --> give_donation_form_top
https://github.com/WordImpress/Give/blob/release/1.7/includes/deprecated/deprecated-actions.php#L42

I've been thinking about the usage of the word payment and I think it's applicable and relevant to our plugin in certain circumstances. For example, give_payment_gateways should remain as such and NOT change to give_donation_gateways. Reasoning being a donation is still a _payment_. From a development perspective it is less confusing to continue referring it as a payment.

I will update with this comment a complete like of hooks where the work payment is permitted.

I'm not sure I agree. You can argue that when you are talking about gateways, you are talking only about payment gateways, there is no other type of gateway.

So, we can change give_payment_gateways to give_gateways.

This bulk of this task is done. As we continue to refactor we can take care of the remaining hooks and variables.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathetos picture mathetos  路  4Comments

ravinderk picture ravinderk  路  4Comments

emgk picture emgk  路  3Comments

vukvukovich picture vukvukovich  路  4Comments

DevinWalker picture DevinWalker  路  3Comments