<commit_before><?php
/**
 * Uninstall AMP For wp
 *
 */// if uninstall.php is not called by WordPress, die
if (!defined('WP_UNINSTALL_PLUGIN')) {
    die;
}
$redux_builder_amp = get_option('redux_builder_amp',true);
if(isset($redux_builder_amp['ampforwp-delete-on-uninstall']) && $redux_builder_amp['ampforwp-delete-on-uninstall']==1){
		
	$option_name = 'redux_builder_amp';
	
	$optionsArray = array(
						'ampforwp_rewrite_flush_option',
						'AMPforwp_db_version',
						'AMP-category-base-removal-status',
						'redux_support_hash',
						'ampforwp_exclude_post',
						'ampforwp_cpt_generated_post_types',
						'ampforwp_custom_post_types',
						'amp_customizer',
						'ampforwp_design',
						'ampforwp_default_pages_to',
						'ampforwp_installer_completed',
						'redux_builder_amp-transients',

						);
	if ( is_multisite() ) {

		// for site options in Multisite
		delete_site_option($option_name);
		if(is_array($optionsArray)){
			foreach ($optionsArray as $key => $optionName) {
				delete_site_option($optionName);
			}
		}

	}else{
		
		delete_option($option_name);
		if(is_array($optionsArray)){
			foreach ($optionsArray as $key => $optionName) {
				delete_option($optionName);
			}
		}
	}
	 
	
	// drop a custom database table
	/*global $wpdb;
	$wpdb->query("");*/

}
<commit_msg>#1903 Delete all post metas as well<commit_after><?php
/**
 * Uninstall AMP For wp
 *
 */// if uninstall.php is not called by WordPress, die
if (!defined('WP_UNINSTALL_PLUGIN')) {
    die;
}
$redux_builder_amp = get_option('redux_builder_amp',true);
if(isset($redux_builder_amp['ampforwp-delete-on-uninstall']) && $redux_builder_amp['ampforwp-delete-on-uninstall']==1){
		
	$option_name = 'redux_builder_amp';
	
	$optionsArray = array(
						'ampforwp_rewrite_flush_option',
						'AMPforwp_db_version',
						'AMP-category-base-removal-status',
						'redux_support_hash',
						'ampforwp_exclude_post',
						'ampforwp_cpt_generated_post_types',
						'ampforwp_custom_post_types',
						'amp_customizer',
						'ampforwp_design',
						'ampforwp_default_pages_to',
						'ampforwp_installer_completed',
						'redux_builder_amp-transients',

						);
	$post_meta_array = array(
							'use_ampforwp_page_builder',
							'ampforwp_page_builder_enable',
							'amp-page-builder',
							'ampforwp_custom_content_editor',
							'ampforwp_custom_content_editor_checkbox',
							'ampforwp_custom_sidebar_select',
							'ampforwp-amp-on-off',
							'ampforwp-redirection-on-off',
							'ampforwp-wpautop',
							);

	if ( is_multisite() ) {

		// for site options in Multisite
		delete_site_option($option_name);
		if(is_array($optionsArray)){
			foreach ($optionsArray as $key => $optionName) {
				delete_site_option($optionName);
			}
		}

		// Post Meta
		if(is_array($post_meta_array)){
			foreach ($post_meta_array as $post_meta ) {
				delete_post_meta_by_key( $post_meta ); 
			}
		}

	}else{
		
		delete_option($option_name);
		if(is_array($optionsArray)){
			foreach ($optionsArray as $key => $optionName) {
				delete_option($optionName);
			}
		}

		// Post Meta
		if(is_array($post_meta_array)){
			foreach ($post_meta_array as $post_meta ) {
				delete_post_meta_by_key( $post_meta ); 
			}
		}
	}
	 
	
	// drop a custom database table
	/*global $wpdb;
	$wpdb->query("");*/

}

{'fraction_non_alphanumeric': 0.1362397820163488, 'fraction_numerical': 0.0018165304268846503, 'mean_word_length': 3.7676767676767677, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2074591', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1179, 'n_words': 171}