403Webshell
Server IP : 31.214.179.3  /  Your IP : 216.73.216.114
Web Server : Apache
System : Linux hostingsrv125.dondominio.com 6.12.96+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.96-1 (2026-07-20) x86_64
User :  ( 1156851)
PHP Version : 8.5.8
Disable Function : system,passthru,popen,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,exec,ini_alter,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,mail,eval
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /hosting/www/thermatron.es/public/wp-content/themes/betheme/functions/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /hosting/www/thermatron.es/public/wp-content/themes/betheme/functions/admin//class-mfn-update.php
<?php
if( ! defined( 'ABSPATH' ) ){
	exit; // Exit if accessed directly
}

class Mfn_Update extends Mfn_API {

	protected $code = '';

	/**
	 * Mfn_Update constructor
	 */

	public function __construct(){

		$this->code = mfn_get_purchase_code();

		// It runs when wordpress check for updates
		add_filter( 'pre_set_site_transient_update_themes', array( $this, 'pre_set_site_transient_update_themes' ) );

		// Prepares themes for JavaScript
		// add_filter( 'wp_prepare_themes_for_js', array( $this, 'autoupdate' ), 10, 2 );

		// This action runs when WordPress completes its upgrade process
		add_action( 'upgrader_process_complete', array( $this, 'upgrader_process_complete' ), 10, 2 );

	}

	/**
	 * Filter WP Update transient
	 *
	 * @param unknown $transient
	 * @return unknown
	 */

	public function pre_set_site_transient_update_themes( $transient ) {

		if( ! mfn_is_registered() ){
			return $transient;
		}

		$new_version = $this->remote_get_version();
		$theme_template = get_template();

		if( version_compare( wp_get_theme( $theme_template )->get( 'Version' ), $new_version, '<' ) ) {

			$args = array(
				'code' => $this->code,
			);

			$transient->response[ $theme_template ] = array(
				'theme' => $theme_template,
				'new_version' => $new_version,
				'url' => $this->get_url( 'changelog' ),
				'package' => add_query_arg( $args, $this->get_url( 'theme_download' ) ),
			);

		}

		return $transient;
	}

	/**
	 * This function runs when WordPress completes its upgrade process
	 * It iterates through each plugin updated to see if ours is included
	 * @param $upgrader_object Array
	 * @param $options Array
	 */

	function upgrader_process_complete( $upgrader_object, $options ) {

		// print_r( [$upgrader_object, $options] );

		if( $options['action'] == 'update' && $options['type'] == 'theme' && isset( $options['themes'] ) ) {
			foreach( $options['themes'] as $theme ) {

				if( 'betheme' == $theme ){

					$version = MFN_THEME_VERSION;
					$updates = get_site_option( 'betheme_updates_history' );

					if( empty($updates) ){
						$updates = [];
					}

					$updates[] = [
						'time' => time(),
						'version' => $version,
					];

					update_site_option( 'betheme_updates_history', $updates );

				}

			}
		}

	}

	/**
	 * Auto-updates, iterate throu the themes to enable or disable auto-updates
	 */

	public static function autoupdate( $prepared_themes ){

		$customized_themes = [];

		foreach ( $prepared_themes as $theme ) {

			if( 'betheme' == $theme['id'] ){

				$enable_or_disable = mfn_opts_get('automatic-updates');

				$auto_update = $enable_or_disable ? true : false;
				$auto_update_action = $enable_or_disable ? 'enable-auto-update' : 'disable-auto-update';

				$theme['autoupdate']['supported'] = $auto_update;
				$theme['autoupdate']['enabled'] = $auto_update;

				$theme['actions']['autoupdate'] = current_user_can( 'update_themes' )
					? wp_nonce_url( admin_url( 'themes.php?action=' . $auto_update_action . '&amp;theme=' . $theme['id'] ), 'updates' )
					: null;

			}

			$customized_themes[] = $theme;
		}

		return $customized_themes;

	}

}

$mfn_update = new Mfn_Update();

Youez - 2016 - github.com/yon3zu
LinuXploit