pronamic / wp-pay-core

Core components for the WordPress payment processing library. This library is used in the WordPress plugin Pronamic Pay: https://www.pronamicpay.com/, but also allows other plugin developers to set up a payment plugin.
https://www.wp-pay.org/
GNU General Public License v3.0
27 stars 3 forks source link

Simplify data store cpt #159

Closed remcotolsma closed 10 months ago

remcotolsma commented 10 months ago

This PR may solve this issue:

It also improves/removes these comments:

https://github.com/pronamic/wp-pay-core/blob/68e947335aaf02544109862c4f3c685bfa8df9a9/src/Payments/PaymentsDataStoreCPT.php#L276-L295

https://github.com/pronamic/wp-pay-core/blob/68e947335aaf02544109862c4f3c685bfa8df9a9/src/Subscriptions/SubscriptionsDataStoreCPT.php#L301-L319

And it removes some admin controller code from the data store classes:

https://github.com/pronamic/wp-pay-core/blob/68e947335aaf02544109862c4f3c685bfa8df9a9/src/Payments/PaymentsDataStoreCPT.php#L199-L219

https://github.com/pronamic/wp-pay-core/blob/68e947335aaf02544109862c4f3c685bfa8df9a9/src/Subscriptions/SubscriptionsDataStoreCPT.php#L200-L255

I still have to check payments and subscriptions posts with WordPress post status draft or trash.

codecov-commenter commented 10 months ago

Codecov Report

Attention: 137 lines in your changes are missing coverage. Please review.

Comparison is base (2378651) 22.38% compared to head (683bfb7) 22.13%. Report is 13 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #159 +/- ## ============================================ - Coverage 22.38% 22.13% -0.26% + Complexity 2553 2537 -16 ============================================ Files 108 107 -1 Lines 10197 10187 -10 ============================================ - Hits 2283 2255 -28 - Misses 7914 7932 +18 ``` | [Files](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic) | Coverage Δ | | |---|---|---| | [src/ContactNameHelper.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL0NvbnRhY3ROYW1lSGVscGVyLnBocA==) | `75.51% <ø> (ø)` | | | [src/CustomerHelper.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL0N1c3RvbWVySGVscGVyLnBocA==) | `48.51% <ø> (ø)` | | | [src/Plugin.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL1BsdWdpbi5waHA=) | `19.27% <ø> (+0.09%)` | :arrow_up: | | [src/Subscriptions/SubscriptionsModule.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL1N1YnNjcmlwdGlvbnMvU3Vic2NyaXB0aW9uc01vZHVsZS5waHA=) | `9.97% <ø> (ø)` | | | [src/Webhooks/WebhookLogger.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL1dlYmhvb2tzL1dlYmhvb2tMb2dnZXIucGhw) | `0.00% <0.00%> (ø)` | | | [src/Webhooks/WebhookRequestInfo.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL1dlYmhvb2tzL1dlYmhvb2tSZXF1ZXN0SW5mby5waHA=) | `0.00% <0.00%> (ø)` | | | [src/Admin/AdminModule.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL0FkbWluL0FkbWluTW9kdWxlLnBocA==) | `0.00% <0.00%> (ø)` | | | [src/Admin/AdminAboutPage.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL0FkbWluL0FkbWluQWJvdXRQYWdlLnBocA==) | `0.00% <0.00%> (ø)` | | | [src/Payments/PaymentsDataStoreCPT.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL1BheW1lbnRzL1BheW1lbnRzRGF0YVN0b3JlQ1BULnBocA==) | `21.94% <75.00%> (-2.36%)` | :arrow_down: | | [src/Subscriptions/SubscriptionsDataStoreCPT.php](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic#diff-c3JjL1N1YnNjcmlwdGlvbnMvU3Vic2NyaXB0aW9uc0RhdGFTdG9yZUNQVC5waHA=) | `32.28% <73.46%> (+1.19%)` | :arrow_up: | | ... and [3 more](https://app.codecov.io/gh/pronamic/wp-pay-core/pull/159?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pronamic) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

remcotolsma commented 10 months ago

I still have to check payments and subscriptions posts with WordPress post status draft or trash.

Just tested this, seems ok.