impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
345 stars 191 forks source link

Form Consumer should limit hooks and instantiated classes #5665

Closed kjohnson closed 2 years ago

kjohnson commented 3 years ago

Currently, the Service Provider for the Form\LegacyConsumer is instantiating classes for callbacks whose hooks never fire.

We are supporting 19 deprecated hooks which are paired with 19 new hooks, each of which are run multiple times in multiple contexts. This creates a problem when each feature spins up a bunch of classes and hooks that aren't necessary.

As an example, the new hooks are used to update the Donation Receipt, which is only need when the donation receipt is being show. Currently, we are setting up each of those hooks when the Donation Receipt isn't even being show. The same goes for the Legacy Template donation confirmation, the email tags, the donation details, the field validation, etc. This adds up very quickly.

Acceptance Criteria

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days.

kjohnson commented 2 years ago

Closed by https://github.com/impress-org/givewp/pull/5670.