| Server IP : 89.39.208.18 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : User : ( ) PHP Version : 7.4.33 Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home3/././mahyarcake/./www/wp-content/plugins/duplicator-pro/src/Pro/ |
Upload File : |
<?php
/**
* Class that collects the functions of initial checks on the requirements to run the plugin
*
* Standard: PSR-2
*
* @link http://www.php-fig.org/psr/psr-2
*
* @package Duplicator
* @copyright (c) 2022, Snap Creek LLC
*/
namespace Duplicator\Pro;
class Requirements implements \Duplicator\Core\RequirementsInterface
{
const DUP_LITE_PLUGIN_KEY = 'duplicator/duplicator.php';
/**
*
* @var string // curent plugin file full path
*/
protected static $pluginFile = '';
/**
*
* @var string // message on deactivation
*/
protected static $deactivationMessage = '';
/**
* This function checks the requirements to run Duplicator.
* At this point WordPress is not yet completely initialized so functionality is limited.
* It need to hook into "admin_init" to get the full functionality of WordPress.
*
* @param string $pluginFile main plugin file path
*
* @return boolean true if plugin can be exectued
*/
public static function canRun($pluginFile)
{
$result = true;
self::$pluginFile = $pluginFile;
if (self::isPluginActive(self::DUP_LITE_PLUGIN_KEY)) {
add_action('admin_init', array(__CLASS__, 'addLiteEnableNotice'));
$pluginUrl = (is_multisite() ? network_admin_url('plugins.php') : admin_url('plugins.php'));
self::$deactivationMessage = sprintf(
_x(
'Sorry, you cannot activate the Duplicator PRO plugin while the Duplicator LITE version is active. <br>
Please deactivate the Duplicator LITE plugin, then reactivate the Duplicator PRO Plugin from the %1$splugins page%2$s.',
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
'duplicator-pro'
),
'<a href="' . esc_url($pluginUrl) . '">',
'</a>'
);
$result = false;
}
if ($result === false) {
register_activation_hook($pluginFile, array(__CLASS__, 'deactivateOnActivation'));
}
return $result;
}
/**
* Return plugin hash
*
* @return string
*/
public static function getAddsHash()
{
//return '7b2272223a5b2250726f42617365222c224f74686572506c7567225d2c226664223a5b224c69746542617365225d7d';
return '7b2272223a5b2250726f42617365225d2c226664223a5b224c69746542617365225d7d';
}
/**
*
* @param string $plugin plugin key
*
* @return boolean // return strue if plugin key is active and plugin file exists
*/
protected static function isPluginActive($plugin)
{
$isActive = false;
if (in_array($plugin, (array) get_option('active_plugins', array()))) {
$isActive = true;
}
if (is_multisite()) {
$plugins = get_site_option('active_sitewide_plugins');
if (isset($plugins[$plugin])) {
$isActive = true;
}
}
return ($isActive && file_exists(WP_PLUGIN_DIR . '/' . $plugin));
}
/**
* Display admin notice only if user can manage plugins.
*
* @return void
*/
public static function addLiteEnableNotice()
{
if (current_user_can('activate_plugins')) {
add_action('admin_notices', array(__CLASS__, 'liteEnabledNotice'));
}
}
/**
* deactivate current plugin on activation
*
* @return void
*/
public static function deactivateOnActivation()
{
deactivate_plugins(plugin_basename(self::$pluginFile));
wp_die(
wp_kses(
self::$deactivationMessage,
[
'br' => [],
'a' => ['href' => []],
]
)
);
}
/**
* diplay admin notice if duplicator pro is enabled
*
* @return void
*/
public static function liteEnabledNotice()
{
$pluginUrl = (is_multisite() ? network_admin_url('plugins.php') : admin_url('plugins.php'));
?>
<div class="error notice">
<p>
<span class="dashicons dashicons-warning"></span>
<b><?php esc_html_e('Duplicator Pro Notice:', 'duplicator-pro'); ?></b>
<?php esc_html_e('The "Duplicator Lite" and "Duplicator Pro" plugins cannot both be active at the same time. ', 'duplicator-pro'); ?>
</p>
<p>
<?php
printf(
esc_html_x(
'To use "Duplicator PRO" please deactivate "Duplicator LITE" from the %1$splugins page%2$s.',
'%1$s and %2$s represents the opening and closing HTML tags for an anchor or link',
'duplicator-pro'
),
'<a href="' . esc_url($pluginUrl) . '">',
'</a>'
);
?>
</p>
</div>
<?php
}
}