Security hardening, WPCS fixes, and WP 7.0 compatibility confirmation (v1.0.1) - #1
Open
miyanialkesh7 wants to merge 1 commit into
Open
Security hardening, WPCS fixes, and WP 7.0 compatibility confirmation (v1.0.1)#1miyanialkesh7 wants to merge 1 commit into
miyanialkesh7 wants to merge 1 commit into
Conversation
…support - Reject Stripe webhook signatures older than 5 minutes to close a replay window where a previously captured, validly-signed payload could be resubmitted to mark other payments as paid. - Wrap the default payment/refund email subject and body strings in __() so the initial admin-facing template text is translatable before an admin customizes it. - Apply WordPress Coding Standards (WordPress-Extra) formatting fixes across includes/ via phpcbf, plus manual fixes for short-ternary usage and a false-positive base64_encode() obfuscation warning (used for PayPal OAuth2 HTTP Basic Auth, not obfuscation). Verified 0 errors/warnings against WordPress-Extra and PHPCompatibilityWP (PHP 7.4-8.3). - Add PHPDoc blocks to previously undocumented public/private methods across all includes/ classes for readability. - Confirm WordPress 7.0 compatibility, bump plugin version to 1.0.1, expand the readme.txt short/long description, and add alkesh7 as a contributor. No functional/UX changes; load_textdomain() was already absent so there was nothing to remove for the WP 5.8 deprecation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security hardening, coding-standards cleanup, and documentation improvements for CommentGate, with no functional or UX changes.
__()so they're translatable.WordPress-Extra(0 errors/0 warnings) andPHPCompatibilityWPfor PHP 7.4–8.3 (0 errors), viaphpcbfauto-fixes plus a couple of manual fixes (short ternaries, a false-positivebase64_encode()obfuscation warning — that call is PayPal's required OAuth2 HTTP Basic Auth encoding, not obfuscation, now annotated accordingly).includes/classes.readme.txtalready declaredTested up to: 7.0and needed no change there.1.0.1(plugin header,COMMENTGATE_VERSION,readme.txtStable tag, changelog/upgrade notice) and expanded thereadme.txtshort and long descriptions.load_textdomain()was already absent from the codebase, so there was nothing to remove for the WP 5.8 deprecation. Thelanguages/directory (with its standardindex.phpstub) is unrelated to that call — it exists to match theDomain Path: /languagesplugin header and is left as-is.No test files or editor/tooling folders are included in this diff.
Files changed
commentgate.php— version bumpreadme.txt,README.md— version, contributor, compatibility, and description updatesincludes/class-commentgate-stripe-gateway.php— webhook replay-window fix + docblocksincludes/class-commentgate-settings.php— i18n fix for default email strings + docblocksincludes/class-commentgate-payments-table.php,class-commentgate-paypal-gateway.php,class-commentgate-comment-gate.php,class-commentgate-admin-payments.php,class-commentgate-webhooks.php,class-commentgate-plugin.php,class-commentgate-cli.php— formatting/docblock-only changesTest plan
php -lon every changed PHP file — no syntax errorsphpcs --standard=WordPress-Extraacross the plugin — 0 errors, 0 warningsphpcs --standard=PHPCompatibilityWP --runtime-set testVersion 7.4-8.3— 0 errorswp_commentgate_paymentstable is created with the expected schema andcommentgate_db_versionupdates correctlycheckout.session.completedpayload correctly marks a payment paid; replaying the same payload with a signature timestamp 10 minutes old is now correctly rejected (400 Invalid signature) instead of being processed again; a payload signed with the wrong secret is rejectedwp commentgate status/settings/paymentsCLI commands