-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add post meta setting to store post-level RRM settings #9955
Comments
Thank you for drafting the IB, @ankitrox. Please take a look at my comments below:
I say, let's get rid of the
Any failing tests should also be fixed due to changes in the I have updated the PoC to include most of these changes. Please let me know if you have any questions, thank you! |
Thanks for reviewing the IB @nfmohit , I've made the suggested changes in the IB. |
Thank you, @ankitrox ! IB ✅ |
QA Update ⚠@ankitrox On the "Add New Post" editor screen, I ran the command After this, I deleted the "footnotes" meta key from the database and reset the SK plugin. I then reconnected the plugin, set up RRM, and ran the same command again on the "Add New Post" screen. While I received the expected result in the console, the "footnotes" meta key was not added to the Is this behavior expected? PASS CASE
|
QA Update ✅
|
Feature Description
As part of RRM Phase 2, the WordPress post editor will allow users to override the snippet configuration at the post level. To facilitate this, a post meta setting should be added to store the post-level configuration.
A
Modules\Reader_Revenue_Manager\Post_Product_ID
class extending theCore\Storage\Post_Meta_Setting
class should be created to register a post meta setting to store the post-level snippet options. It should hold an empty string as the value by default. The meta key can begooglesitekit_rrm_{Publication ID}:productID
.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
rrmModuleV2
feature flag is enabled:Implementation Brief
In
includes/Modules/Reader_Revenue_Manager.php
register
method, check ifrrmModuleV2
feature is enabled usingFeature_Flags::enabled( 'rrmModuleV2' )
. If feature is enabled and module is connected, do the following.Core\Storage\Post_Meta
class.Post_Product_ID
and pass instance ofCore\Storage\Post_Meta
and the publication ID to it's constructor.register
method of thePost_Product_ID
class.In
includes/Core/Storage/Post_Meta_Setting.php
get_meta_key
which should return an empty string by default.META_KEY
constant in the class and replace it's usage with the above method such as$this->get_meta_key()
.Create a class
Post_Product_ID
insideincludes/Modules/Reader_Revenue_Manager
.Core\Storage\Post_Meta
and the publication ID in it's constructor. The publication ID can be assigned to a private class property which would then be utilised to form the meta key.Google\Site_Kit\Core\Storage\Post_Meta_Setting
class.get_meta_key
which should returngooglesitekit_rrm_{publication_id}:productID
. Note to replace the{Publication ID}
with the value of publication Id property.get_show_in_rest
method which should returntrue
. This is essential as this value needs to be set by post being edited using block editor.Test Coverage
Post_Product_ID
class.Post_Meta_Setting
class.QA Brief
Enable
rrmModuleV2
feature.Enable the RRM module in Site Kit and connect to a publication. Note the publication ID which should be available in dropdown or it can be retrieved using the following command in SK dashboard.
Posts > Add New post
, open browser console and run following command.There must be the
googlesitekit_rrm_{publicationID}:productID
key present in the list of meta keys, where{publicationID}
is the one which we noted above.Changelog entry
The text was updated successfully, but these errors were encountered: