<commit_before><?php
/**
 * Plugin Name: E2E Tests Reset Plugin
 * Plugin URI:  https://github.com/google/site-kit-wp
 * Description: Utility plugin for resetting Site Kit during E2E tests.
 * Author:      Google
 * Author URI:  https://opensource.google.com
 *
 * @package   Google\Site_Kit
 * @copyright 2019 Google LLC
 * @license   https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
 * @link      https://sitekit.withgoogle.com
 */

use Google\Site_Kit\Context;
use Google\Site_Kit\Core\Util\Reset;

register_activation_hook( __FILE__, static function () {
	( new Reset( new Context( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) )->all();

	/**
	 * Remove anything left behind.
	 * @link https://github.com/google/site-kit-wp/issues/351
	 */
	global $wpdb;

	$wpdb->query(
		"DELETE FROM $wpdb->options WHERE option_name LIKE '%googlesitekit%'"
	);
	$wpdb->query(
		"DELETE FROM $wpdb->usermeta WHERE meta_key LIKE '%googlesitekit%'"
	);
} );
<commit_msg>fail with message if reset when SK not active<commit_after><?php
/**
 * Plugin Name: E2E Tests Reset Plugin
 * Plugin URI:  https://github.com/google/site-kit-wp
 * Description: Utility plugin for resetting Site Kit during E2E tests.
 * Author:      Google
 * Author URI:  https://opensource.google.com
 *
 * @package   Google\Site_Kit
 * @copyright 2019 Google LLC
 * @license   https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
 * @link      https://sitekit.withgoogle.com
 */

use Google\Site_Kit\Context;
use Google\Site_Kit\Core\Util\Reset;

register_activation_hook( __FILE__, static function () {
	if ( ! defined( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE' ) ) {
		wp_die( 'Site Kit must be active to reset! Check the error log.' );
	}

	( new Reset( new Context( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) ) )->all();

	/**
	 * Remove anything left behind.
	 * @link https://github.com/google/site-kit-wp/issues/351
	 */
	global $wpdb;

	$wpdb->query(
		"DELETE FROM $wpdb->options WHERE option_name LIKE '%googlesitekit%'"
	);
	$wpdb->query(
		"DELETE FROM $wpdb->usermeta WHERE meta_key LIKE '%googlesitekit%'"
	);
} );

{'fraction_non_alphanumeric': 0.13915547024952016, 'fraction_numerical': 0.012476007677543186, 'mean_word_length': 3.7711670480549198, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2239146', 'n_tokens_mistral': 745, 'n_tokens_neox': 701, 'n_words': 175}