-
Notifications
You must be signed in to change notification settings - Fork 17
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
chore: remove Lightweight API and client ID handling #1166
Conversation
|
||
if ( ! empty( $events_to_add ) ) { | ||
$api->save_reader_events( $client_id, $events_to_add ); | ||
// TODO: set donation status in the Reader Data store. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's been done in Automattic/newspack-plugin#2539
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right—this file only checks subscription/donation status upon user login, but that's already handled by Automattic/newspack-plugin#2539. 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this file in 6c97c16
], | ||
]; | ||
|
||
// TODO: set subscription status in the Reader Data store. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also resolved in Automattic/newspack-plugin#2539
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, thanks for pointing it out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this file in 6c97c16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a beautiful changeset ❤️
I think we can also remove includes/class-newspack-popups-donations.php
and includes/class-newspack-popups-newsletters.php
, wdyt?
Removed those files in 6c97c16. You're right that they're no longer needed since the new reader data library API handles the newsletter/donation status updates on reader login. |
Realized there were still a couple of failing PHPunit tests that will no longer be needed (since the decision on which segments match the reader will no longer be executed in PHP). Removed in c08b6bc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM!
* feat: segmentation criteria system (#1155) * chore: remove Lightweight API and client ID handling (#1166) * chore: remove Lightweight API and client ID handling * chore: remove data pruning cron job and clear future instances * fix: script dependencies * fix: remove unused method refs * test: remove tests using deprecated features * chore: remove more unneeded files * test: remove other failing tests * fix(criteria): warn when criteria value is not available (#1167) * feat: integrate criteria with segments (#1159) Co-authored-by: Leo Germani <leogermani@automattic.com> * fix(criteria): allow async matching configuration (#1175) * feat: segmentation match logic (#1169) * feat: segmentation criteria system * chore: refactor default criteria and implement utils * chore: api tweaks * fix: range logic * chore: isolate segment matching example * fix: ras dependency placement * fix: add referrer sources category * fix: api tweaks for consistency * chore: file structure * chore: inline docs * chore: api tweaks * fix: schema tweaks * feat: add schema and migration helper * fix: rename newsletter subscriber store item * fix: send segment config instead of value * chore: move default criteria registration * fix: class name * fix: change criteria options values * fix: tweak migration * fix: remove referrer creation * fix: remove referrer creation * test: dont enqueue scripts on tests * test: add criteria * test: add required * test: add criteria * fix: logic typo * test: frontend matching * fix: range config * fix: missing range can be any range * test: php criteria registration * test: fix php test * test: fix typo * chore: improve inline docs * fix: update segment criteria schema * fix: configuration migration * feat: use criteria to match prompt segments * feat: fix schema and tests * refactor: file structure * chore: remove AMP polyfill JS * feat: implement scroll triggers and frequency * fix: add .phpunit.result.cache to .gitignore * refactor: use prompt and segment config via JSON instead of DOM * test: remove unit tests related to AMP Access and GA3 analytics * fix: only show one overlay per page * revert: use prompt and segment config via JSON instead of DOM * test: re-fix failing tests * fix: close overlay on background tap * fix: src should not be added to release packages * test: unit tests for segmetnation API * test: actual unit tests for segmentation API * chore: fix inline comment for accuracy * fix: race condition when using perfmatters * refactor: trigger seen GA4 event based on prompt_seen activity * refactor: make the 1x overlay at a time rule testable * refactor: overlay display check according to new unit test * test: update test assertion for accuracy * fix(criteria): allow async matching configuration * fix: ensure global * fix: logic for one-at-a-time overlays * Revert "fix: race condition when using perfmatters" This reverts commit c9fab16. * fix: remove defaultCriteria.js * fix: race condition with reader library JS --------- Co-authored-by: Miguel Peixe <miguel.peixe@a8c.com> Co-authored-by: Leo Germani <leogermani@automattic.com> * feat: favorite categories segmentation logic (#1177) * feat: logic for favorite categories * fix: top-ranked category must actually have more views than the other categories * fix: simplify logic and account for undefined countsArray * fix: account for multiple views in one category; simplify logic a bit * fix: correct indexOf comparison * feat: migrate reader data (#1176) * fix: a PHP warning when migrating a user to the new data schema (#1180) * Refactor/segments relationship (#1168) * feat: refactor segment relationship * feat: refactor complete and tests updated * fix: popup exporter * fix: popup analytics events * fix: avoid warning in the schema This is actually a bug in core. see https://core.trac.wordpress.org/ticket/56494 * fix: do not return disabled segments on REST --------- Co-authored-by: Miguel Peixe <miguel.peixe@a8c.com> * feat: Update/remove category cleanup (#1185) * fix: remove old category cleanup It was looking at deprecated configuration meta After the refactor having a non existent cat should not be a problem * test: remove test * chore: remove lightweight api setup (#1183) * fix: fallback if no newspack plugin (#1179) * fix: allow prompts to be displayed without segmentation if no Newspack Plugin * refactor: avoid use of negative variable name * fix: newspack_popups_view.segments is not an array * fix: hide segments taxonomy --------- Co-authored-by: Leo Germani <leogermani@automattic.com> Co-authored-by: dkoo <derrick.koo@10up.com> * fix: restore support for plugin settings (#1181) * fix: support segmentation on donor landing page * fix: support Mailchimp donor merge fields for segmentation --------- Co-authored-by: Leo Germani <leogermani@automattic.com> * fix: lines added by accident in last merge * feat: move migration methods (#1184) Co-authored-by: Derrick Koo <derrick.koo@automattic.com> * fix: auto-fill segment (#1188) * feat: remove non interactive mode (#1190) * fix: missing release files (#1191) * fix: distignore should include some src subfolders * fix: segments admin URL localized key name * fix: previews (#1178) * fix: allow manual prompts to be displayed in previews * fix: previewing as a segment * feat: use temporary reader data sessions for previews * fix: single-prompt previews * refactor: use helper function for determining override * test: add tests for view_as and pid overrides * test: fix query string in test --------- Co-authored-by: Miguel Peixe <miguel.peixe@automattic.com> Co-authored-by: Leo Germani <leogermani@automattic.com> Co-authored-by: Miguel Peixe <miguel.peixe@a8c.com> Co-authored-by: dkoo <derrick.koo@10up.com>
# [2.23.0-alpha.1](v2.22.0...v2.23.0-alpha.1) (2023-08-17) ### Bug Fixes * move the close button when Hide Padding is enabled ([#1165](#1165)) ([20d17d9](20d17d9)) ### Features * campaigns segmentation API rearchitecture ([#1192](#1192)) ([d554151](d554151)), closes [#1155](#1155) [#1166](#1166) [#1167](#1167) [#1159](#1159) [#1175](#1175) [#1169](#1169)
# [2.23.0](v2.22.0...v2.23.0) (2023-08-24) ### Bug Fixes * account for frequency presets in printed config ([#1203](#1203)) ([a97bc8f](a97bc8f)) * add .hidden styles for above header prompts ([#1207](#1207)) ([a19d64d](a19d64d)) * ensure url param segment is set ([#1197](#1197)) ([dc6c130](dc6c130)) * eslint new rule declaration-block-no-redundant-longhand-properties ([d1bf215](d1bf215)) * include missing file ([#1194](#1194)) ([d5fe344](d5fe344)) * move the close button when Hide Padding is enabled ([#1165](#1165)) ([20d17d9](20d17d9)) * remove string from overlay prompt ([#1204](#1204)) ([232f05a](232f05a)) ### Features * add segmentation README and more useful info to debug object ([#1195](#1195)) ([b501d9a](b501d9a)) * campaigns segmentation API rearchitecture ([#1192](#1192)) ([d554151](d554151)), closes [#1155](#1155) [#1166](#1166) [#1167](#1167) [#1159](#1159) [#1175](#1175) [#1169](#1169)
All Submissions:
Changes proposed in this Pull Request:
Removes the lightweight PHP API and associated unit tests. Also removes other major features that will no longer be needed after the rearchitecture:
localStorage
, or to a WP userNote that this PR does extensive cleanup that will intentionally result in broken functionality. The following features are broken and will need to be reimplemented in separate PRs using the criteria system introduced in #1155:
newspack-plugin
will need to deprecate this feature in that plugin.This PR also doesn't do some further cleanup which will be done after we have a means to migrate legacy reader data to the new system. Notably, we're not cleaning up any reader data in the custom tables (although we're no longer writing any new data to those tables). There may also be methods related to AMP cookies and client IDs across our other repos that we can delete, too, but I'm choosing to leave the client ID handling in other repos intact until we're sure they're no longer needed in those plugins.
Note also that some changes are required in other Newspack plugins to remove references to methods that will no longer exist after this changeset. Automattic/newspack-plugin#2558 and Automattic/newspack-blocks#1498 are works-in-progress which we can add more changes to if necessary for the rearchitecture.
Closes
1204751246381647/1205010980866823
.How to test the changes in this Pull Request:
Other information: