SILENT KILLERPanel

Current Path: > home > transcarter > > www > > wp-content > plugins > contact-form-7 > includes >


Operation   : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Software     : Apache
Server IP    : 198.54.126.42 | Your IP: 216.73.216.135
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/transcarter//www//wp-content/plugins/contact-form-7/includes/

NameTypeSizeLast ModifiedActions
block-editor Directory - -
config-validator Directory - -
css Directory - -
js Directory - -
swv Directory - -
capabilities.php File 834 bytes January 21 2025 20:36:08.
contact-form-functions.php File 10497 bytes January 21 2025 20:36:08.
contact-form-template.php File 5826 bytes January 21 2025 20:36:08.
contact-form.php File 31318 bytes January 21 2025 20:36:08.
controller.php File 3269 bytes January 21 2025 20:36:08.
file.php File 10398 bytes January 21 2025 20:36:08.
form-tag.php File 13741 bytes January 21 2025 20:36:08.
form-tags-manager.php File 14572 bytes January 21 2025 20:36:08.
formatting.php File 13827 bytes January 21 2025 20:36:08.
functions.php File 15913 bytes January 21 2025 20:36:08.
html-formatter.php File 16713 bytes January 21 2025 20:36:08.
integration.php File 8955 bytes January 21 2025 20:36:08.
l10n.php File 3454 bytes January 21 2025 20:36:08.
mail-tag.php File 4194 bytes January 21 2025 20:36:08.
mail.php File 14876 bytes January 21 2025 20:36:08.
pipe.php File 2622 bytes January 21 2025 20:36:08.
pocket-holder.php File 325 bytes January 21 2025 20:36:08.
rest-api.php File 13194 bytes January 21 2025 20:36:08.
shortcodes.php File 2710 bytes January 21 2025 20:36:08.
special-mail-tags.php File 6661 bytes January 21 2025 20:36:08.
submission.php File 20797 bytes January 21 2025 20:36:08.
upgrade.php File 3071 bytes January 21 2025 20:36:08.
validation-functions.php File 6821 bytes January 21 2025 20:36:08.
validation.php File 3297 bytes January 21 2025 20:36:08.

Reading File: /home/transcarter//www//wp-content/plugins/contact-form-7/includes//upgrade.php

<?php

add_action( 'wpcf7_upgrade', 'wpcf7_upgrade_58', 10, 2 );

/**
 * Runs functions necessary when upgrading from old plugin versions before 5.8.
 *
 * @since 5.8.0 New `_config_validation` post meta is introduced.
 */
function wpcf7_upgrade_58( $new_ver, $old_ver ) {
	if ( ! version_compare( $old_ver, '5.8-dev', '<' ) ) {
		return;
	}

	$posts = WPCF7_ContactForm::find( array(
		'post_status' => 'any',
		'posts_per_page' => -1,
	) );

	foreach ( $posts as $post ) {
		$post_id = $post->id();

		// Delete the old post meta for config-validation results.
		delete_post_meta( $post_id, '_config_errors' );

		// Add the contact form hash.
		add_post_meta( $post_id, '_hash',
			wpcf7_generate_contact_form_hash( $post_id ),
			true // Unique
		);
	}
}


add_action( 'wpcf7_upgrade', 'wpcf7_convert_to_cpt', 10, 2 );

/**
 * Converts old data in the dedicated database table to custom posts.
 *
 * @since 3.0.0 `wpcf7_contact_form` CPT is introduced.
 */
function wpcf7_convert_to_cpt( $new_ver, $old_ver ) {
	global $wpdb;

	if ( ! version_compare( $old_ver, '3.0-dev', '<' ) ) {
		return;
	}

	$old_rows = array();

	$table_name = $wpdb->prefix . "contact_form_7";

	if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) ) {
		$old_rows = $wpdb->get_results( "SELECT * FROM $table_name" );
	} elseif ( $opt = get_option( 'wpcf7' )
	and ! empty( $opt['contact_forms'] ) ) {
		foreach ( (array) $opt['contact_forms'] as $key => $value ) {
			$old_rows[] = (object) array_merge(
				$value,
				array( 'cf7_unit_id' => $key )
			);
		}
	}

	foreach ( (array) $old_rows as $row ) {
		$q = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_old_cf7_unit_id'"
			. $wpdb->prepare( " AND meta_value = %d", $row->cf7_unit_id );

		if ( $wpdb->get_var( $q ) ) {
			continue;
		}

		$postarr = array(
			'post_type' => 'wpcf7_contact_form',
			'post_status' => 'publish',
			'post_title' => maybe_unserialize( $row->title ),
		);

		$post_id = wp_insert_post( $postarr );

		if ( $post_id ) {
			update_post_meta( $post_id, '_old_cf7_unit_id', $row->cf7_unit_id );

			$metas = array(
				'form',
				'mail',
				'mail_2',
				'messages',
				'additional_settings',
			);

			foreach ( $metas as $meta ) {
				update_post_meta( $post_id, '_' . $meta,
					wpcf7_normalize_newline_deep( maybe_unserialize( $row->{$meta} ) )
				);
			}
		}
	}
}


add_action( 'wpcf7_upgrade', 'wpcf7_prepend_underscore', 10, 2 );

/**
 * Prepends an underscore to post meta keys.
 */
function wpcf7_prepend_underscore( $new_ver, $old_ver ) {
	if ( version_compare( $old_ver, '3.0-dev', '<' ) ) {
		return;
	}

	if ( ! version_compare( $old_ver, '3.3-dev', '<' ) ) {
		return;
	}

	$posts = WPCF7_ContactForm::find( array(
		'post_status' => 'any',
		'posts_per_page' => -1,
	) );

	foreach ( $posts as $post ) {
		$props = $post->get_properties();

		foreach ( $props as $prop => $value ) {
			if ( metadata_exists( 'post', $post->id(), '_' . $prop ) ) {
				continue;
			}

			update_post_meta( $post->id(), '_' . $prop, $value );
			delete_post_meta( $post->id(), $prop );
		}
	}
}

SILENT KILLER Tool