diagnosis = $diagnosis; $this->dropin = $dropin; } public function register() { /* Read-only diagnostics: no external-plugin mutations or REST repair routes. */ } public function issues() { $issues = array(); if ( (bool) get_option( 'nbh_performance_cache_enabled', 0 ) ) { $ownership = $this->dropin->reconcile(); if ( in_array( $ownership, array( 'foreign', 'unreadable' ), true ) ) { $issues[] = array( 'id' => 'advanced-cache-dropin', 'tone' => 'warning', 'title' => __( 'Another cache system owns advanced-cache.php', 'nbh-performance' ), 'message' => __( 'NBH Performance will not overwrite another plugin\'s cache drop-in or change its settings. Disable the conflicting cache manually before enabling NBH page caching.', 'nbh-performance' ), 'actions' => array(), ); } } return $issues; } public function preflight_toggles( array $values ) { if ( ! empty( $values['nbh_performance_cache_enabled'] ) && in_array( $this->dropin->reconcile(), array( 'foreign', 'unreadable' ), true ) ) { return new \WP_Error( 'nbh_performance_foreign_cache_dropin', __( 'Another caching system owns advanced-cache.php. Resolve the conflict manually; NBH Performance will not modify other plugins.', 'nbh-performance' ), array( 'status' => 409 ) ); } return true; } public function consume_result() { return false; } }