errors ) ) { return $notices; } return array_merge( $notices, $this->errors ); } /** * Conditionally run the test tool. * * @param bool $can_save A boolean value if the test has passed or failed. * @param string $content The content being modified. * * @return bool|mixed|null */ public function maybe_perform_test( $can_save, $content ) { // If another addon has determined the file can not be saved, bail early. if ( ! $can_save ) { return $can_save; } // Do not perform a smart scan if the option for it is disabled. if ( ! isset( $_POST['string-locator-validate-serialized-data'] ) ) { return $can_save; } return $this->run( $content ); } /** * Output a checkbox to enable or disable this feature from within the editor interface. * * @return void */ public function print_checks_option() { if ( ! isset( $_GET['file-type'] ) || 'sql' !== $_GET['file-type'] ) { return; } ?>