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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

namespace DeliciousBrains\WPMDB\Common;

use DeliciousBrains\WPMDB\Common\FormData\FormData;
use DeliciousBrains\WPMDB\WPMDBDI;

class Helpers
{
    /**
     * User meta key for storing licence key.
     */
    const USER_LICENCE_META_KEY = 'wpmdb_licence_key';

    public static function getFormData()
    {
        return WPMDBDI::getInstance()->get(FormData::class)->getFormData();
    }

    /**
     * Get transient key used for storing licence response.
     *
     * @param bool|int  $initial_user_id    Get transient key for a specific user.
     * @param bool      $user_fallback      Whether to fallback to finding current or first users with licence key.
     *
     * @return string
     */
    public static function get_licence_response_transient_key($initial_user_id = false, $user_fallback = true)
    {
        $key = 'wpmdb_licence_response';

        if ($initial_user_id) {
            $user = get_user_by('id', $initial_user_id);
            if ($user) {
                return "{$key}_{$initial_user_id}";
            }
        }

        if ($user_fallback) {
            $user_id = self::get_current_or_first_user_id_with_licence_key();
            if ($user_id) {
                return "{$key}_{$user_id}";
            }
        }

        return $key;
    }

    /**
     * Get current user ID.
     * If not logged in, looks for first user with a licence key.
     *
     * @return false|int
     */
    public static function get_current_or_first_user_id_with_licence_key()
    {
        if ((defined('DOING_AJAX') && DOING_AJAX) || (defined('REST_REQUEST') && REST_REQUEST) || (defined('WP_CLI') && WP_CLI) || is_admin()) {

            if (is_user_logged_in()) {
                return get_current_user_id();
            }

            $user_query = new \WP_User_Query([
                'number' => 1,
                'meta_key' => self::USER_LICENCE_META_KEY,
                'meta_value' => '',
                'meta_compare' => '!=',
            ]);

            $users = $user_query->get_results();

            if ( ! empty($users) && ! is_wp_error($users)) {
                return $users[0]->ID;
            }
        }
        return false;
    }

    /**
     * Get user defined licence key.
     *
     * @param bool $user_id User ID to which retrieve licence for.
     * @return false|string
     */
    public static function get_user_licence_key($user_id = false)
    {
        if (! $user_id) {
            $user_id = get_current_user_id();
        }
        $licence = get_user_meta($user_id, self::USER_LICENCE_META_KEY, true);

        if (! $licence || empty($licence)) {
            return false;
        }

        return $licence;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit