Implement Thank with Google PHP module foundation
See original GitHub issueWe should implement the PHP module foundation for Thank with Google, for a new thank-with-google module. We do currently have a subscribe-with-google module, which however is now indefinitely on hold, and the Thank with Google module has taken over as a priority. Furthermore, the foundation requirements for the two modules are quite similar.
Therefore, we should implement the foundation for Thank with Google by essentially tweaking the Subscribe with Google foundation to become Thank with Google.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
Subscribe_With_Googleclass and any related names (also the relatedSettingsclass namespace) should be renamed toThank_With_Google.- The currently available settings should remain untouched as part of this issue, i.e. we should not tweak the setting keys available, just rename everything on the PHP side to match “Thank with Google”.
- The module slug
subscribe-with-googleshould be consistently changed tothank-with-googlein PHP, but not in JS, which is part of the separate #5365 issue.- The file name of the JS asset for the module should also not be changed.
- The module name “Subscribe with Google” should also be changed accordingly to “Thank with Google”.
- Any references to the
subscribe-with-googlemodule slug in PHP should be changed to reference thethank-with-googlemodule slug (e.g. also the WordPress option name). - The
@sinceannotations for these classes, methods, etc. should be changed ton.e.x.t, since they are basically new classes (even though we technically changed them from the Subscribe with Google classes. - The feature flag
swgModuleshould be changed to be calledtwgModule.
Additional acceptance criteria (update)
- The new module description should be: Let your supporters show appreciation of your work through virtual stickers and personal messages
Implementation Brief
Note: The ACs are very close to code here already, so no need to rehash all of this. Please review the ACs closely together with the relevant code and point out any more complex changes necessary or follow-up questions.
- Rename The following files and classes in accordance with the AC.
includes/Modules/Subscribe_With_Google.phpincludes/Modules/Subscribe_With_Google/Settings.php
- Update the usage in the following classes:
Google\Site_Kit\Core\Authentication\AuthenticationGoogle\Site_Kit\Core\Modules\Modules
- Change
swgModulefeature flag totwgModulein thefeature-flags.json.- Also change all
swgModulein the PHP files.
- Also change all
- Finish and merge #5391
- Fix failing tests.
Test Coverage
- Update the PHP Test file names and classes to to be
Thank_With_Google.
QA Brief
- In the tester plugin, the
swgModulefeature flag should no longer exist. - Instead, there will be
twgModulefeature flag. - Enabling the feature flag will bring up
Thank with Googlemodule in the Settings > Connect more services screen. - Clicking connect will not do anything and throw an error, this is expected.
- Update: The Module description in the Settings Page should match the description from updated AC.
Changelog entry
- Add foundation for new Thank with Google feature (PHP).
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)

Top Related StackOverflow Question
@eugene-manuilov Great point. I didn’t really intend to include the PR in the IB and I was just going through the AC to see if there’s anything additional that needs to be done. Added the draft PR as I already had done the initial changes and thought it could be a starting point. This one and #5365 was tricky as the AC was basically a high level IB.
I will keep that in mind for future! Thanks 👍
@kuasha420 Excellent, thanks for the quick PR! No need to go through QA again since this is literally just the single text string change 😃