403Webshell
Server IP : 45.162.171.154  /  Your IP : 216.73.216.5
Web Server : Apache
System : Linux vxct2015.avnam.net 5.4.106-1-pve #1 SMP PVE 5.4.106-1 (Fri, 19 Mar 2021 11:08:47 +0100) x86_64
User : lpg.com.ar ( 1041)
PHP Version : 8.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lpg.com.ar/public_html/wp-content/plugins/check-email/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/lpg.com.ar/public_html/wp-content/plugins/check-email/include/install.php
 <?php
/**
 * Handle installation and db table creation
 */

defined( 'ABSPATH' ) || exit; // Exit if accessed directly
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound
class Check_Email_Log_Init {

	public static function on_activate( $network_wide ) {
		global $wpdb;

		if ( is_multisite() && $network_wide ) {
			foreach ( get_sites() as $site ) {
                switch_to_blog( $site->blog_id );
                self::create_checkemaillog_table();
				restore_current_blog();
            }
		} else {
			self::create_checkemaillog_table();
		}
	}

	public static function on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
		if ( is_plugin_active_for_network( 'check-email-log/check-email.php' ) ) {
			switch_to_blog( $blog_id );
			self::create_checkemaillog_table();
			restore_current_blog();
		}
	}


	public static function on_delete_blog( $tables ) {
		global $wpdb;
		$tables[] = $wpdb->prefix . Check_Email_Log::TABLE_NAME;
		return $tables;
	}

	private static function create_checkemaillog_table() {
		global $wpdb;

		$table_name = $wpdb->prefix . Check_Email_Log::TABLE_NAME;
		$charset_collate = $wpdb->get_charset_collate();
		// phpcs:disable.
		if ( $wpdb->get_var( $wpdb->prepare( "show tables like %s",$wpdb->esc_like( $table_name )) ) != $table_name ) {

			$sql = 'CREATE TABLE ' . $table_name . ' (
				id mediumint(9) NOT NULL AUTO_INCREMENT,
				to_email VARCHAR(100) NOT NULL,
				subject VARCHAR(250) NOT NULL,
				message TEXT NOT NULL,
				backtrace_segment TEXT NOT NULL,
				open_tracking_id VARCHAR(250) NOT NULL,
				open_count VARCHAR(250) NOT NULL,
				headers TEXT NOT NULL,
				attachments TEXT NOT NULL,
				sent_date timestamp NOT NULL,
				PRIMARY KEY  (id)
			) ' . $charset_collate . ' ;';

			require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
			dbDelta( $sql );

			add_option( Check_Email_Log::DB_OPTION_NAME, Check_Email_Log::DB_VERSION );
		}
		// phpcs:enable.
	}
}

// When the Plugin installed
register_activation_hook( EMAIL_LOG_PLUGIN_FILE, array( 'Check_Email_Log_Init', 'on_activate' ) );

// when a new blog is created in multisite
add_action( 'wpmu_new_blog', array( 'Check_Email_Log_Init', 'on_create_blog' ), 10, 6 );

// when a blog is deleted in multisite
add_filter( 'wpmu_drop_tables', array( 'Check_Email_Log_Init', 'on_delete_blog' ) );
?>

Youez - 2016 - github.com/yon3zu
LinuXploit