Skip to content

feat: v2.3.0#10

Open
rivanuff wants to merge 4 commits into
mainfrom
feat/stricter-testing-splitting
Open

feat: v2.3.0#10
rivanuff wants to merge 4 commits into
mainfrom
feat/stricter-testing-splitting

Conversation

@rivanuff

@rivanuff rivanuff commented May 12, 2026

Copy link
Copy Markdown
Contributor

Wijzigingen samengevat:

  • Email log
  • Verbeteren van instellingen pagina
  • Unit testing
  • Opschonen, stricter en duidelijker maken van code
  • .gitattributes toegevoegd

@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown
Composer package changes
Dev Packages Operation Base Target Link License
eftec/bladeone Removed 3.52 - Compare MIT
gettext/gettext Removed v4.8.12 - Compare MIT
gettext/languages Removed 2.12.2 - Compare MIT
mck89/peast Removed v1.17.6 - Compare BSD-3-Clause
wp-cli/i18n-command Removed v2.7.0 - Compare MIT
wp-cli/mustache Removed v2.14.99 - Compare MIT
wp-cli/mustangostang-spyc Removed 0.6.6 - Compare MIT
wp-cli/php-cli-tools Removed v0.12.9 - Compare MIT
wp-cli/wp-cli Removed v2.12.0 - Compare MIT

@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch 2 times, most recently from 0b6724b to 0857188 Compare May 12, 2026 12:15
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch 8 times, most recently from b097303 to ec47013 Compare May 23, 2026 09:15
@rivanuff
rivanuff marked this pull request as draft May 29, 2026 11:06
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch 13 times, most recently from 9ee1e91 to e363840 Compare May 29, 2026 19:52
@rivanuff rivanuff changed the title feat: stricter testing splitting feat: v2.2 Jun 2, 2026
@rivanuff
rivanuff marked this pull request as ready for review June 2, 2026 10:29
@rivanuff
rivanuff requested review from a team and ShunLuk and removed request for a team June 2, 2026 10:29
@rivanuff rivanuff added help wanted Extra attention is needed javascript Pull requests that update javascript code labels Jun 2, 2026
ShunLuk
ShunLuk previously approved these changes Jun 3, 2026
Comment thread src/PageGuard/Admin/Views/AdminSettingsPage.php Outdated
Comment thread src/PageGuard/Admin/Views/AdminSettingsPage.php
<?php

<?php
$cronLastRun = \Yard\PageGuard\WPCron\WPCronServiceProvider::lastRun();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zou ook mooi vanuit een controller kunnen komen.

Comment thread src/PageGuard/Admin/EmailPlaceholderMigration.php
Comment thread src/PageGuard/EmailLog/EmailLog.php Outdated
Comment thread src/PageGuard/Metabox/InternalDataSync.php
Comment thread src/PageGuard/Metabox/MetaboxRenderer.php Outdated
Comment thread src/PageGuard/Traits/Date.php Outdated
Comment thread src/PageGuard/Traits/Email.php
Comment thread src/PageGuard/Traits/Token.php Outdated
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch 7 times, most recently from 228d3d0 to e0a7400 Compare June 5, 2026 14:08

@SimonvanWijhe SimonvanWijhe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moeten het even hebben over de TipTap editor..

Heb je dat echt nodig? Ik zit er een beetje mee dat dit onderhouden moet worden en we het verder nergens gebruiken. Wat kan er niet met wisywig?

Copilot AI review requested due to automatic review settings July 7, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps Yard Page Guard to v2.2.0, focusing on modernising the admin experience (settings page + rich editor), adding an admin-visible email log, and tightening core logic around scheduling, tokens, and content-owner handling—backed by a new PHPUnit suite and CI.

Changes:

  • Adds an Email log CPT + recorder + retention purge, and extends email sending to emit structured context for logging.
  • Rebuilds the settings page UI and replaces the WYSIWYG with a Tiptap editor (incl. placeholder/button migrations and cron status UI).
  • Refactors metabox logic (access/renderer/saver), introduces a dedicated admin capability granted on activation, and adds extensive unit tests + PHP CI.

Reviewed changes

Copilot reviewed 64 out of 75 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
yard-page-guard.php Version bump and adds activation hook wiring.
activate.php Grants the plugin admin capability on activation.
deactivate.php Unschedules cron and removes the plugin admin capability on deactivation.
vite.config.js Switches to isolated per-entry IIFE builds to avoid WP global collisions.
package.json Updates build script to run two builds; adds Tiptap deps.
composer.json Adds platform config, expands translate script scope, adds dev stubs.
composer.lock Locks updated dependencies/platform override.
config/core.php Registers the new EmailLog service provider.
README.md Major documentation refresh (configuration, security, architecture, testing).
LICENSE.md Removes the MIT license file.
.gitattributes Adds export-ignore rules to keep archives lean.
.gitignore Stops ignoring sourcemaps; ensures .gitattributes is tracked.
.prettierignore Ignores generated translation JSON files.
.github/workflows/test-php.yml Adds PHPUnit CI matrix (PHP 7.4 + 8.3).
.github/workflows/npm-lock-diff.yml Adds lockfile diff workflow reuse.
.github/workflows/format-php.yml Pins PHP version for formatting workflow.
languages/yard-page-guard-en_GB-4a13f87bb595e0a1be4d755d78dacc88.json Adds admin.js translation JSON output.
resources/js/admin.js Adds Tiptap mounting, time input masking, and cron countdown.
resources/js/tiptap-editor.js New Tiptap editor implementation for settings page fields.
resources/js/button-mark.js Adds a custom “button link” mark for Tiptap output.
resources/css/admin.css New settings page styling, editor UI styling, and email log styling.
resources/css/frontend.css Updates CTA/button styling for footer buttons.
build/admin.css Rebuilt compiled admin CSS output.
build/frontend.css Rebuilt compiled frontend CSS output.
src/PageGuard/Foundation/AdminCapability.php Introduces a plugin-specific capability gate with filters + role grant helpers.
src/PageGuard/Admin/AdminServiceProvider.php Adds migrations, script translations handling, and email log screen asset loading.
src/PageGuard/Admin/Controllers/AdminSettingsController.php Gates settings behind AdminCapability; adds cron send time option sanitization.
src/PageGuard/Admin/Controllers/AdminOverviewController.php Gates overview/menu; adds submenu entries for Email log + Settings.
src/PageGuard/Admin/Services/AdminOverviewService.php Updates bulk-edit parsing to use the new ContentOwner value object.
src/PageGuard/Admin/Views/AdminSettingsPage.php Replaces old table layout with card UI + Tiptap editor mounts + cron status.
src/PageGuard/Admin/EmailPlaceholderMigration.php Migrates {1}/{2} placeholders to {name}/{item_list} in stored templates.
src/PageGuard/Admin/FooterButtonMigration.php Migrates legacy “bold-link button” markup to <a class="ypg-button">…</a>.
src/PageGuard/EmailLog/EmailLogServiceProvider.php Registers email log post type, recorder, and retention.
src/PageGuard/EmailLog/EmailLog.php Implements the ypg_email_log CPT, UI columns, filters, and read-only behaviours.
src/PageGuard/EmailLog/EmailLogRecorder.php Records each outgoing mail into the CPT (via ypg/email_sent).
src/PageGuard/EmailLog/EmailLogRetention.php Purges email log entries older than the retention window on daily cron.
src/PageGuard/WPCron/WPCronServiceProvider.php Adds configurable send time, last-run tracking, and rescheduling logic.
src/PageGuard/WPCron/Events/ReviewNotification.php Uses named placeholders and passes items context into email logging.
src/PageGuard/WPCron/Events/ReminderNotification.php Uses named placeholders, passes items context, and advances reminder dates robustly.
src/PageGuard/Traits/Email.php Adds ypg/email_sent action + logging context; adds item flattening helper.
src/PageGuard/Traits/Text.php Switches to named placeholders and parses owners via ContentOwner::fromString().
src/PageGuard/Traits/Token.php Tightens query parsing and requires YPG_AUTH_SALT for token generation.
src/PageGuard/Traits/Date.php Refactors date logic, adds validation, unit resolution, and “advanceToFuture” behaviour.
src/PageGuard/Enums/DateUnit.php Adds a closed set enum-like helper for date units.
src/PageGuard/Enums/ContentOwnerType.php Adds enum-like helpers (cases/tryFrom/from) with validation.
src/PageGuard/Models/ContentOwner.php Converts owner to an immutable validated value object with factories.
src/PageGuard/Models/ReviewItem.php Uses ContentOwner::fromPostMeta() for reconstruction.
src/PageGuard/Metabox/MetaboxServiceProvider.php Splits metabox responsibilities and registers migration.
src/PageGuard/Metabox/MetaboxAccess.php Centralises auth/save gating for metabox-related handlers.
src/PageGuard/Metabox/MetaboxRenderer.php Renders metabox UI using the new access checks.
src/PageGuard/Metabox/MetaboxSaver.php Persists metabox fields using ContentOwner + updated date logic.
src/PageGuard/Metabox/InternalDataSync.php Extracts third-party “internal data” mirroring into a dedicated class.
src/PageGuard/Metabox/InternalDataSyncMigration.php One-off migration to rewrite legacy internal-data title keys.
src/PageGuard/Metabox/Metabox.php Removes the old monolithic Metabox implementation.
src/PageGuard/Taxonomy/ExternalOwnerTaxonomy.php Triggers post updates when external owner details change.
src/PageGuard/Frontend/FrontendServiceProvider.php Uses plugin version for frontend asset cache-busting.
tests/bootstrap.php Improves test bootstrapping stubs for WP classes.
tests/TestCase.php Adds WP_Mock lifecycle wiring and modernises reflection helper behaviour.
tests/Traits/TokenTest.php Adds unit tests for token generation/verification and query parsing.
tests/Traits/TextTest.php Adds tests for placeholder replacement, HTML minify, and owner parsing.
tests/Traits/DateTest.php Adds tests covering date validation, recompute rules, and recurrence logic.
tests/Models/ContentOwnerTest.php Adds tests for ContentOwner invariants and factories.
tests/Metabox/MetaboxAccessTest.php Adds tests for save gating and access rules.
tests/Foundation/AdminCapabilityTest.php Adds tests for capability name/roles behaviour and role grants.
tests/Enums/DateUnitTest.php Adds tests for DateUnit validation helpers.
tests/Enums/ContentOwnerTypeTest.php Adds tests for ContentOwnerType validation helpers.
Files not reviewed (2)
  • build/admin.css: Generated file
  • build/frontend.css: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PageGuard/WPCron/WPCronServiceProvider.php
Comment on lines +17 to +20
public function register(): void
{
add_action('ypg/email_sent', [$this, 'record'], 10, 6);
}
Comment thread resources/js/tiptap-editor.js Outdated
Comment on lines +166 to +171
makeButton(
'<u>U</u>',
'Onderlijnd (Ctrl+U)',
() => editor.chain().focus().toggleUnderline().run(),
{ isActive: () => editor.isActive('underline') }
),
Comment on lines +147 to +150
<div class="ypg-field">
<label for="ypg_review_email_subject"><?= esc_html(__('Onderwerp', 'yard-page-guard')) ?></label>
<input type="text" id="ypg_review_email_subject" name="ypg_review_email_subject" value="<?= esc_attr(get_option('ypg_review_email_subject', __('Controleer jouw webpagina(\'s)', 'yard-page-guard'))); ?>" />
</div>
Comment on lines +169 to +172
<div class="ypg-field">
<label for="ypg_reminder_email_subject"><?= esc_html(__('Onderwerp', 'yard-page-guard')) ?></label>
<input type="text" id="ypg_reminder_email_subject" name="ypg_reminder_email_subject" value="<?= esc_attr(get_option('ypg_reminder_email_subject', __('Herinnering controle webpagina(\'s)', 'yard-page-guard'))); ?>" />
</div>
Comment on lines +50 to +52
if (! $this->access->currentUserHasAccess($postId)) {
return $html . sprintf('<p><b>%s</b></p>', __('U heeft geen toestemming om de houdbaarsheids module te bewerken.', 'yard-page-guard'));
}
Comment on lines 41 to +44
add_menu_page(
__('Houdbaarheids Overzicht', 'yard-page-guard'),
__('Houdbaarheids Overzicht', 'yard-page-guard'),
apply_filters('yard::page-guard/capability/admin', 'edit_pages'),
AdminCapability::name(),
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch from dc959ac to 9345c4b Compare July 7, 2026 14:25
@rivanuff rivanuff changed the title feat: v2.2 feat: v2.3.0 Jul 7, 2026
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch 3 times, most recently from dbfe023 to eba663f Compare July 7, 2026 14:52
@rivanuff
rivanuff requested a review from SimonvanWijhe July 7, 2026 15:01
rivanuff added 2 commits July 9, 2026 12:22
Rebase the v2.2 feature work onto the open-sourced main (which took the
2.2 release), squashed and released as 2.3.0.

Feature work brought over:
- Email log CPT (ypg_email_log) with recorder + daily retention sweep
- Settings-page rich editing via WordPress' bundled TinyMCE (wp.editor),
  replacing the earlier Tiptap/ProseMirror editor; custom {name}/{item_list}
  placeholder buttons and a styled ypg-button CTA
- Metabox monolith split into Access / Renderer / Saver / InternalDataSync
- Stricter review-token query handling + immutable ContentOwner value object
- PHPUnit suite (wp_mock)

Reconciled with main's open-source hardening:
- Kept generateKeyedHash salt cascade (YPG_AUTH_SALT/AUTH_SALT wp-config
  constants + env fallback) and wp-config endpoint constants in Token
- Kept the filterable review-user login (ReviewUser trait, FrontendServiceProvider)
- Ported main's internal-data-sync changes into the new InternalDataSync:
  OWC-host detection, enable-internal-data-sync filter, and the
  after-internal-data-synced / -removed actions
- Kept EUPL-1.2 license, newer devDeps (Vite 8), README open-source docs
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch from 4dccab3 to a358c66 Compare July 9, 2026 10:25
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch 2 times, most recently from b9e3946 to 278c50f Compare July 10, 2026 09:50
@rivanuff
rivanuff force-pushed the feat/stricter-testing-splitting branch from 278c50f to 734323d Compare July 10, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants