Repository navigation
Description
Summary
The cron docs state unconditionally that scheduled jobs are cleaned up on deactivation. That is only true when Blockstudio is installed as its own plugin. Bundled inside another plugin (or a theme) via Composer, there is no deactivation event for Blockstudio, so the jobs stay scheduled.
Current behavior / evidence
The cron page says, in its intro, in “How it works” step 6, and again in the Deactivation section, that all Blockstudio cron events are unscheduled on plugin deactivation.
In code, cleanup is:
register_deactivation_hook( __FILE__, array( 'Blockstudio\\Cron', 'unschedule_all' ) );in blockstudio.php. That hook fires only when blockstudio.php itself is deactivated. The wp bs teardown command's own docblock states it plainly: only the plugin case has a deactivation hook, so a Composer consumer has no lifecycle event that could unschedule cron jobs.
Correction to an earlier reading of this issue
The cron page does now mention teardown: its Deactivation section says a Composer installation inside a theme or another plugin has no deactivation hook of its own, so removing it leaves the events scheduled, and to run wp bs teardown before removing Blockstudio. That section was updated Oct 14, 2026. This issue is therefore not “the page never mentions teardown” — it's that the unconditional statements at the top of the page still contradict the caveat buried below.
What should change
- Qualify the intro and “How it works” step 6: cleanup on deactivation applies to the standalone-plugin install only.
- Clarify that the gap is not just “removal” — deactivating the host plugin, or switching away from a theme that bundles Blockstudio, also leaves the events scheduled, and
wp bs teardownhas to run before the code is gone, because thewp bscommand goes with it. - Document the host-side cleanup path: e.g. a host plugin calling
Cron::unschedule_all()from its own deactivation hook, or a supported helper for that, so bundled users have something to do besides remembering a manual CLI step.
Impact
Orphaned recurring events persist in the cron array. After Blockstudio is removed they have no callback to run; if it is reinstalled, schedule_all() sees the existing event and does not reschedule, so the old job can silently resume. At minimum, the docs should not promise cleanup that does not happen.
Activity
Fix cached API credentials and add signed page context and extension …
dnnsjsk commentedon Oct 24, 2026
The documentation correction is included in Blockstudio 7.7.8. It now distinguishes standalone plugin deactivation from bundled installations, explains when to run
wp bs teardown, and gives host-plugin and theme cleanup hooks. This corrects the documentation rather than changing cron's runtime behavior.