<commit_before><?php
/**
 * Plugin Name: WP Engine Cache Flush
 * Plugin URI: https://github.org/a7/wpe-cache-flush/
 * Description: Programmatically flush the WP Engine Cache
 * Version: 0.1.0
 * Author: A7
 * Author URI: http://github.org/a7/
 */

namespace A7\WPE_Cache_Flush;

function get_flush_token() {
	$flush_token = getenv( 'WPE_CACHE_FLUSH' );

	if ( ! empty( $flush_token ) ) {
		return $flush_token;
	}

	if ( defined( 'WPE_CACHE_FLUSH' ) ) {
		return WPE_CACHE_FLUSH;
	}

	return apply_filters( __NAMESPACE__ . '/wpe_cache_flush_token', false );
}

add_action( 'init', function () {

	$key = 'wpe-cache-flush';

	if ( empty( $_GET[ $key ] ) ) {
		return;
	}

	$flush_token = get_flush_token();

	if ( false === $flush_token ) {
		return;
	}

	if ( $flush_token !== $_GET[ $key ] ) {
		return;
	}

	// Don't cause a fatal if there is no WpeCommon class
	if ( class_exists( 'WpeCommon' ) ) {
		return;
	}

	if ( function_exists( 'WpeCommon::purge_memcached' ) ) {
		\WpeCommon::purge_memcached();
	}

	if ( function_exists( 'WpeCommon::clear_maxcdn_cache' ) ) {
		\WpeCommon::clear_maxcdn_cache();
	}

	if ( function_exists( 'WpeCommon::purge_varnish_cache' ) ) {
		\WpeCommon::purge_varnish_cache();
	}

	global $wp_object_cache;<commit_msg>Create wpe-cache-flush.php<commit_after><?php
/**
 * Plugin Name: WP Engine Cache Flush
 * Plugin URI: https://github.org/a7/wpe-cache-flush/
 * Description: Programmatically flush the WP Engine Cache
 * Version: 0.1.0
 * Author: A7
 * Author URI: http://github.org/a7/
 */

namespace A7\WPE_Cache_Flush;

function get_flush_token() {
	$flush_token = getenv( 'WPE_CACHE_FLUSH' );

	if ( ! empty( $flush_token ) ) {
		return $flush_token;
	}

	if ( defined( 'WPE_CACHE_FLUSH' ) ) {
		return WPE_CACHE_FLUSH;
	}

	return apply_filters( __NAMESPACE__ . '/wpe_cache_flush_token', false );
}

add_action( 'init', function () {

	$key = 'wpe-cache-flush';

	if ( empty( $_GET[ $key ] ) ) {
		return;
	}

	$flush_token = get_flush_token();

	if ( false === $flush_token ) {
		return;
	}

	if ( $flush_token !== $_GET[ $key ] ) {
		return;
	}

	// Don't cause a fatal if there is no WpeCommon class
	if ( ! class_exists( 'WpeCommon' ) ) {
		return;
	}

	if ( function_exists( 'WpeCommon::purge_memcached' ) ) {
		\WpeCommon::purge_memcached();
	}

	if ( function_exists( 'WpeCommon::clear_maxcdn_cache' ) ) {
		\WpeCommon::clear_maxcdn_cache();
	}

	if ( function_exists( 'WpeCommon::purge_varnish_cache' ) ) {
		\WpeCommon::purge_varnish_cache();
	}

	global $wp_object_cache;
{'fraction_non_alphanumeric': 0.1545778834720571, 'fraction_numerical': 0.005548949663099485, 'mean_word_length': 3.9296875, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, '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': '192293', 'n_tokens_mistral': 1038, 'n_tokens_neox': 978, 'n_words': 190}