Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: changed

Plugin Conflicts Guardian: pcg_guard_activation now defaults to true, enabling the activation probe and install/update parse-error gate by default.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Pre-flight plugin-activation check. When an admin clicks Activate (or finishes an Upload Plugin install), this feature loads the plugin in an isolated HTTP request and refuses the activation if that probe captures a fatal — the site stays up instead of entering recovery mode.

Ships dark. Three independent filters, all default `false`:
Two independent filters:

- `pcg_guard_activation` — enables the activation probe and the syntax-only install/update gate.
- `pcg_guard_updates` — enables the post-update health check + rollback flow.
- `pcg_guard_activation` — enables the activation probe and the syntax-only install/update gate. Defaults `true`.
- `pcg_guard_updates` — enables the post-update health check + rollback flow. Defaults `false`.

## Files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* plugin being activated and redirects with a notice on any failure.
*/
function pcg_guard_maybe_block_activation() {
if ( ! apply_filters( 'pcg_guard_activation', false ) ) {
if ( ! apply_filters( 'pcg_guard_activation', true ) ) {
return;
}
if ( ! current_user_can( 'activate_plugins' ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ function pcg_maybe_handle_probe() {
// Gate per mode: activation probes need pcg_guard_activation, update
// probes need pcg_guard_updates. Otherwise enabling either flow would
// pull in the other as an unintended dependency.
$gate_filter = PCG_Load_Tester::MODE_UPDATE === $mode ? 'pcg_guard_updates' : 'pcg_guard_activation';
if ( ! apply_filters( $gate_filter, false ) ) {
$is_update_mode = PCG_Load_Tester::MODE_UPDATE === $mode;
$gate_filter = $is_update_mode ? 'pcg_guard_updates' : 'pcg_guard_activation';
$gate_default = ! $is_update_mode;
if ( ! apply_filters( $gate_filter, $gate_default ) ) {
pcg_probe_bail_error( 'Plugin Conflicts Guardian is disabled.', 403 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function pcg_update_guard_check( $source, $remote_source, $upgrader, $hook_extra
if ( is_wp_error( $source ) ) {
return $source;
}
if ( ! apply_filters( 'pcg_guard_activation', false ) ) {
if ( ! apply_filters( 'pcg_guard_activation', true ) ) {
return $source;
}
$type = $hook_extra['type'] ?? '';
Expand Down
Loading