Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

_checkout_reference_xxxx meta key removal with a filter? #99

Open
nviitala opened this issue Jul 29, 2023 · 0 comments
Open

_checkout_reference_xxxx meta key removal with a filter? #99

nviitala opened this issue Jul 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nviitala
Copy link

nviitala commented Jul 29, 2023

Improvement suggestion
Hi,

I noticed that this plugin generates new meta_key names for every order (_checkout_reference_XXXXX) in addition to the global key _checkout_reference. It is generated in \Paytrail\WooCommercePaymentGateway\Gateway::process_payment, line 939.

I would consider this as bloat and would like to use only the _checkout_reference meta_key instead. It also affects to the database performance, since it is the only key which changes for every order and the same value is also stored to _checkout_reference.

Describe the solution you'd like
Would it be possible to disable the _checkout_reference_XXXXX metas with a filter? If it is disabled, the search could be done from the _checkout_reference value.

Describe alternatives you've considered
Are the _checkout_reference_x keys really needed at all? Or are reference key searches in some environment really slow without it? If the searches with the general _checkout_reference key aren't currently too slow the _checkout_reference_x keys could be dropped altogether?

Additional context
We are using an analytics service (Metorik), which allows to filter and segment order statistics by the meta keys and now it is full of _checkout_reference_xxxxx keys. It seems that Klarna's, Stripe's and other Paytrail plugins don't add extra key names for each order like this.

@nviitala nviitala added the enhancement New feature or request label Jul 29, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant