Skip to content

refactor(sybgo): trim Sybgo to 7 lifecycle methods — EPIC #93 complete#110

Merged
MathieuLamiot merged 2 commits into
developfrom
feat/trim-sybgo-100
May 19, 2026
Merged

refactor(sybgo): trim Sybgo to 7 lifecycle methods — EPIC #93 complete#110
MathieuLamiot merged 2 commits into
developfrom
feat/trim-sybgo-100

Conversation

@MathieuLamiot

Copy link
Copy Markdown
Owner

Description

Removes Sybgo::get_cron_hooks() — the last non-lifecycle method on the class. Uninstaller and deactivate() now call Cron_Manager::get_hooks() directly as the canonical source. Sybgo is reduced to its target 7 methods: get_instance, __construct, get_library_config, init, build_modules, activate, deactivate. EPIC #93 is complete.

Closes #100

Type of change

  • New feature (non-breaking change which adds functionality).
  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Sub-task of Introduce Feature Modules to own WP integration by domain #93
  • Chore
  • Release

Detailed scenario

What was tested

No manual testing required — this is a pure identifier redirection. Sybgo::get_cron_hooks() was already delegating to Cron_Manager::get_hooks() in the previous sub-issue (#99), so the hook list returned is identical. The only observable behavior change is that Sybgo::get_cron_hooks() no longer exists as a callable method.

Verified manually by running vendor/bin/phpunit --testsuite Unit after the change: 77 tests executed with the same 5 pre-existing DashboardWidgetTest failures and no new regressions.

How to test

  1. Activate the plugin on a WordPress install.
  2. Deactivate the plugin — verify all four cron events are unscheduled:
    wp cron event list | grep sybgo
    Expected: no sybgo cron events listed.
  3. Uninstall the plugin (delete from WP Admin) — verify no errors in the PHP log.
  4. Re-install and run the full unit suite:
    cd wp-plugin && vendor/bin/phpunit --testsuite Unit
    Expected: same pass/fail count as the parent branch (5 pre-existing DashboardWidgetTest failures, all others green).

Affected Features & Quality Assurance Scope

  • Plugin deactivation (cron cleanup)
  • Plugin uninstall (full data cleanup via Uninstaller)

Technical description

Sybgo::get_cron_hooks() introduced in an earlier sub-issue already delegated entirely to Cron_Manager::get_hooks(). This PR removes the wrapper and updates its two callers:

  • Sybgo::deactivate()Cron_Manager::get_hooks()
  • Uninstaller::clear_cron_hooks()Cron_Manager::get_hooks() (swap use Sybgo\Sybgo for use Sybgo\Cron_Manager)
  • UninstallerTest updated to match the new import.

Cron_Manager::get_hooks() was already the canonical source (static method returning all four hook names). The development.md Plugin Uninstall section is updated to reference Cron_Manager::get_hooks() instead of the removed method.

See wp-plugin/docs/development.md.

New dependencies

None.

Risks

None identified. The hook list is identical — the method being removed was a one-line delegation that added no logic.

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionable.

Unticked items justification

N/A — all items apply and are satisfied. No new tests were written because the existing UninstallerTest (updated to use Cron_Manager) already exercises the affected code path.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@MathieuLamiot MathieuLamiot force-pushed the feat/settings-module-99 branch from a0b43b7 to 16ff43b Compare May 19, 2026 17:24
Base automatically changed from feat/settings-module-99 to develop May 19, 2026 17:34
MathieuLamiot and others added 2 commits May 19, 2026 19:49
#100)

Removes Sybgo::get_cron_hooks() — callers (deactivate() and Uninstaller)
now call Cron_Manager::get_hooks() directly as the canonical source.
Updates Uninstaller and its tests to import Cron_Manager instead of Sybgo.

Sybgo now contains exactly 7 methods: get_instance, __construct,
get_library_config, init, build_modules, activate, deactivate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…now canonical

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MathieuLamiot MathieuLamiot force-pushed the feat/trim-sybgo-100 branch from a084980 to f884ae5 Compare May 19, 2026 17:49
@MathieuLamiot MathieuLamiot merged commit c5f1c1a into develop May 19, 2026
15 checks passed
@MathieuLamiot MathieuLamiot deleted the feat/trim-sybgo-100 branch May 19, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trim Sybgo to 7 methods and migrate tests after all modules are implemented

1 participant