Sindbad~EG File Manager
<?php
/*
* Security : blocking direct access
* Source : http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
/*
* Auto Updater
*
*/
define( 'MWP_MOBILE_THEME_UPDATER', 'http://store.mwordpress.net/api-1/');
define( 'MWP_MOBILE_THEME_BASE', 'newsbt-mobile');
$get_theme = wp_get_theme( MWP_MOBILE_THEME_BASE );
$theme_version = $get_theme->get( 'Version' );
function mwp_mobile_check_for_update($checked_data) {
global $wp_version, $theme_version;
$theme_base = MWP_MOBILE_THEME_BASE;
$request = array(
'slug' => MWP_MOBILE_THEME_BASE,
'version' => $theme_version
);
$send_for_check = array(
'body' => array(
'action' => 'theme_update',
'request' => serialize($request),
'api-key' => md5(get_bloginfo('url'))
),
'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url')
);
$raw_response = wp_remote_post(MWP_MOBILE_THEME_UPDATER, $send_for_check);
if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200))
$response = unserialize($raw_response['body']);
if (!empty($response))
$checked_data->response[$theme_base] = $response;
return $checked_data;
}
function mwp_mobile_auto_update_call($def, $action, $args) {
global $theme_version;
$theme_base = MWP_MOBILE_THEME_BASE;
if (isset($args->slug) && ($args->slug != $theme_base))
return false;
$args->version = $theme_version;
$request_string = prepare_request($action, $args);
$request = wp_remote_post(MWP_MOBILE_THEME_UPDATER, $request_string);
if (is_wp_error($request)) {
$res = new WP_Error('themes_api_failed', 'An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>', $request->get_error_message());
} else {
$res = unserialize($request['body']);
if ($res === false)
$res = new WP_Error('themes_api_failed', 'An unknown error occurred', $request['body']);
}
return $res;
}
global $pagenow;
if ( $pagenow == 'themes.php' || $pagenow == 'update-core.php') {
if ( $get_theme->exists() ) {
add_filter('pre_set_site_transient_update_themes', 'mwp_mobile_check_for_update');
add_filter('themes_api', 'mwp_mobile_auto_update_call', 10, 3);
}
}
if (is_admin()) {
$current = get_transient('update_themes');
}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists