<commit_before><?php
/**
 * Created by PhpStorm.
 * User: alpipego
 * Date: 31.10.2017
 * Time: 10:42
 */

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit();
}

// simple uninstallation for now
$options = get_option( 'resizefly_options' );

global $wp_filesystem;

foreach ( [ $options['cache']['path'], $options['duplicates']['path'] ] as $dir ) {
	if ( is_dir( $dir ) ) {
		$wp_filesystem->rmdir( $dir, true );
	}
}

// delete database options
delete_option( 'resizefly_options' );
delete_option( 'resizefly_restrict_sizes' );
delete_option( 'resizefly_sizes' );
delete_option( 'resizefly_user_sizes' );
delete_option( 'resizefly_resized_path' );
delete_option( 'resizefly_version' );<commit_msg>delete all options prefixed with resizefly_<commit_after><?php
/**
 * Created by PhpStorm.
 * User: alpipego
 * Date: 31.10.2017
 * Time: 10:42
 */

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit();
}

// simple uninstallation for now
$options = get_option( 'resizefly_options' );

global $wp_filesystem, $wpdb;

foreach ( [ $options['cache']['path'], $options['duplicates']['path'] ] as $dir ) {
	if ( is_dir( $dir ) ) {
		$wp_filesystem->rmdir( $dir, true );
	}
}

// delete database options
$options = $wpdb->get_col("SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE 'resizefly_%';");
foreach ($options as $option) {
	delete_option($option);
}
{'fraction_non_alphanumeric': 0.17228739002932553, 'fraction_numerical': 0.017595307917888565, 'mean_word_length': 5.121076233183857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '1492103', 'n_tokens_mistral': 516, 'n_tokens_neox': 513, 'n_words': 106}