question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement Thank with Google PHP module foundation

See original GitHub issue

We 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_Google class and any related names (also the related Settings class namespace) should be renamed to Thank_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-google should be consistently changed to thank-with-google in 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-google module slug in PHP should be changed to reference the thank-with-google module slug (e.g. also the WordPress option name).
  • The @since annotations for these classes, methods, etc. should be changed to n.e.x.t, since they are basically new classes (even though we technically changed them from the Subscribe with Google classes.
  • The feature flag swgModule should be changed to be called twgModule.

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.php
    • includes/Modules/Subscribe_With_Google/Settings.php
  • Update the usage in the following classes:
    • Google\Site_Kit\Core\Authentication\Authentication
    • Google\Site_Kit\Core\Modules\Modules
  • Change swgModule feature flag to twgModule in the feature-flags.json.
    • Also change all swgModule in the PHP files.
  • 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 swgModule feature flag should no longer exist.
  • Instead, there will be twgModule feature flag.
  • Enabling the feature flag will bring up Thank with Google module 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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kuasha420commented, Jun 21, 2022

@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 👍

0reactions
felixarntzcommented, Jun 27, 2022

@kuasha420 Excellent, thanks for the quick PR! No need to go through QA again since this is literally just the single text string change 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Login to Drupal 8 using your Google account - GitHub
Create an application in your google developer console. · Enter http://your-site.com/google-authenticate into the "Authorized redirect URIs" field, and click " ...
Read more >
PHP: Hypertext Preprocessor
PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.
Read more >
5 Ways to Make HTTP Requests in PHP - Twilio
There's more than one way to make a HTTP request in PHP. In this post I'll introduce you to five of the most...
Read more >
PHP modules, limits and extensions on shared hosting servers
PHP modules, limits and extensions on shared hosting servers. PHP is an open-source scripting language that is mainly used to create dynamic web...
Read more >
Login with Google Account using PHP - CodexWorld
Our example Google login script uses the API PHP Client Library to implement Login with Google using PHP in the web application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found