Links from backend.ab#796
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (33.33%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #796 +/- ##
============================================
+ Coverage 25.86% 25.98% +0.11%
- Complexity 5604 5606 +2
============================================
Files 264 264
Lines 24116 24128 +12
============================================
+ Hits 6238 6269 +31
+ Misses 17878 17859 -19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Centralizes construction of CleanTalk “blacklists” links (including UTM parameters) on the PHP backend and passes the resulting URL templates to admin edit-screen scripts via localized data, replacing hardcoded URL building in JavaScript.
Changes:
- Added a new
LinkConstructorUTM preset (admin_blacklists_avatar_link) and tests covering it. - Extended
CtPublicLocalize::getData()to expose alinksarray containing{TARGET}URL templates. - Updated users/comments edit-screen JS (and minified artifacts) to use localized link templates instead of concatenating URLs/UTM params.
Reviewed changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ApbctWP/TestCleanTalkLinks.php | Adds unit tests for the new backend link preset and generated URL. |
| tests/ApbctWP/Localize/TestCtPublicLocalize.php | Adds tests asserting links exist in localized public data and match expected templates. |
| lib/Cleantalk/ApbctWP/Localize/CtPublicLocalize.php | Adds backend-generated link templates to localized data. |
| lib/Cleantalk/ApbctWP/LinkConstructor.php | Introduces the new UTM preset used to build blacklists links. |
| js/src/cleantalk-users-editscreen.js | Switches to backend-provided link templates for blacklists links. |
| js/src/cleantalk-comments-editscreen.js | Switches to backend-provided link templates for blacklists links. |
| js/cleantalk-users-editscreen.min.js.map | Updates sourcemap to reflect the new JS logic. |
| js/cleantalk-users-editscreen.min.js | Updates minified bundle to reflect the new JS logic. |
| js/cleantalk-comments-editscreen.min.js.map | Updates sourcemap to reflect the new JS logic. |
| js/cleantalk-comments-editscreen.min.js | Updates minified bundle to reflect the new JS logic. |
| inc/cleantalk-admin.php | Localizes the backend-provided link templates into ctCommentsScreen/ctUsersScreen. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://app.doboard.com/1/task/35781