Beispiel #1
0
 /**
  * @access protected
  *
  * @return bool
  */
 public function _retrieve_data()
 {
     require_once ABSPATH . 'wp-admin/includes/theme.php';
     $args = array('author' => $this->options['username'], 'per_page' => 30, 'fields' => array('description' => false, 'compatibility' => false, 'icons' => true, 'downloaded' => true, 'last_updated' => true));
     $data = themes_api('query_themes', $args);
     if ($data && isset($data->themes)) {
         $data = array('data' => $data->themes, 'expiration' => time() + $this->expiration);
         update_post_meta($this->post->ID, '_themes', $data);
         return $data;
     }
     return false;
 }
Beispiel #2
0
/**
 * AJAX handler for installing a theme.
 *
 * @since 4.X.0
 */
function wp_ajax_install_theme()
{
    check_ajax_referer('updates');
    if (empty($_POST['slug'])) {
        wp_send_json_error(array('errorCode' => 'no_theme_specified'));
    }
    $status = array('install' => 'theme', 'slug' => sanitize_key($_POST['slug']));
    if (!current_user_can('install_themes')) {
        $status['error'] = __('You do not have sufficient permissions to install themes on this site.');
        wp_send_json_error($status);
    }
    include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    include_once ABSPATH . 'wp-admin/includes/theme.php';
    $api = themes_api('theme_information', array('slug' => $status['slug'], 'fields' => array('sections' => false)));
    if (is_wp_error($api)) {
        $status['error'] = $api->get_error_message();
        wp_send_json_error($status);
    }
    $upgrader = new Theme_Upgrader(new Automatic_Upgrader_Skin());
    $result = $upgrader->install($api->download_link);
    if (defined('WP_DEBUG') && WP_DEBUG) {
        $status['debug'] = $upgrader->skin->get_upgrade_messages();
    }
    if (is_wp_error($result)) {
        $status['error'] = $result->get_error_message();
        wp_send_json_error($status);
    } else {
        if (is_null($result)) {
            global $wp_filesystem;
            $status['errorCode'] = 'unable_to_connect_to_filesystem';
            $status['error'] = __('Unable to connect to the filesystem. Please confirm your credentials.');
            // Pass through the error from WP_Filesystem if one was raised.
            if ($wp_filesystem instanceof WP_Filesystem_Base && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
                $status['error'] = $wp_filesystem->errors->get_error_message();
            }
            wp_send_json_error($status);
        }
    }
    // Never switch to theme (unlike plugin activation).
    // See WP_Theme_Install_List_Table::_get_theme_status() if we wanted to check on post-install status.
    wp_send_json_success($status);
}
Beispiel #3
0
/**
 * Install a theme
 *
 * @param  mixed $theme
 * @param array $args
 * @return array|bool
 */
function _wprp_install_theme($theme, $args = array())
{
    if (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS) {
        return new WP_Error('disallow-file-mods', __("File modification is disabled with the DISALLOW_FILE_MODS constant.", 'wpremote'));
    }
    if (wp_get_theme($theme)->exists()) {
        return new WP_Error('theme-installed', __('Theme is already installed.'));
    }
    include_once ABSPATH . 'wp-admin/includes/admin.php';
    include_once ABSPATH . 'wp-admin/includes/upgrade.php';
    include_once ABSPATH . 'wp-includes/update.php';
    require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    require_once WPRP_PLUGIN_PATH . 'inc/class-wprp-theme-upgrader-skin.php';
    // Access the themes_api() helper function
    include_once ABSPATH . 'wp-admin/includes/theme-install.php';
    $api_args = array('slug' => $theme, 'fields' => array('sections' => false));
    $api = themes_api('theme_information', $api_args);
    if (is_wp_error($api)) {
        return $api;
    }
    $skin = new WPRP_Theme_Upgrader_Skin();
    $upgrader = new Theme_Upgrader($skin);
    // The best way to get a download link for a specific version :(
    // Fortunately, we can depend on a relatively consistent naming pattern
    if (!empty($args['version']) && 'stable' != $args['version']) {
        $api->download_link = str_replace($api->version . '.zip', $args['version'] . '.zip', $api->download_link);
    }
    $result = $upgrader->install($api->download_link);
    if (is_wp_error($result)) {
        return $result;
    } else {
        if (!$result) {
            return new WP_Error('unknown-install-error', __('Unknown error installing theme.', 'wpremote'));
        }
    }
    return array('status' => 'success');
}
 public static function prepareInstall()
 {
     include_once ABSPATH . '/wp-admin/includes/plugin-install.php';
     if (!isset($_POST['url'])) {
         if ($_POST['type'] == 'plugin') {
             $api = plugins_api('plugin_information', array('slug' => $_POST['slug'], 'fields' => array('sections' => false)));
             //Save on a bit of bandwidth.
         } else {
             $api = themes_api('theme_information', array('slug' => $_POST['slug'], 'fields' => array('sections' => false)));
             //Save on a bit of bandwidth.
         }
         $url = $api->download_link;
     } else {
         $url = $_POST['url'];
         $mwpDir = MainWPUtility::getMainWPDir();
         $mwpUrl = $mwpDir[1];
         if (stristr($url, $mwpUrl)) {
             $fullFile = $mwpDir[0] . str_replace($mwpUrl, '', $url);
             $url = admin_url('?sig=' . md5(filesize($fullFile)) . '&mwpdl=' . rawurlencode(str_replace($mwpDir[0], "", $fullFile)));
         }
     }
     $output = array();
     $output['url'] = $url;
     $output['sites'] = array();
     if ($_POST['selected_by'] == 'site') {
         //Get sites
         foreach ($_POST['selected_sites'] as $enc_id) {
             $websiteid = $enc_id;
             if (MainWPUtility::ctype_digit($websiteid)) {
                 $website = MainWPDB::Instance()->getWebsiteById($websiteid);
                 $output['sites'][$website->id] = MainWPUtility::mapSite($website, array('id', 'url', 'name'));
             }
         }
     } else {
         //Get sites from group
         foreach ($_POST['selected_groups'] as $enc_id) {
             $groupid = $enc_id;
             if (MainWPUtility::ctype_digit($groupid)) {
                 $websites = MainWPDB::Instance()->query(MainWPDB::Instance()->getSQLWebsitesByGroupId($groupid));
                 while ($websites && ($website = @MainWPDB::fetch_object($websites))) {
                     if ($website->sync_errors != '') {
                         continue;
                     }
                     $output['sites'][$website->id] = MainWPUtility::mapSite($website, array('id', 'url', 'name'));
                 }
                 @MainWPDB::free_result($websites);
             }
         }
     }
     die(json_encode($output));
 }
     $themes = array_map('urldecode', $themes);
     $url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes));
     $nonce = 'bulk-update-themes';
     wp_enqueue_script('updates');
     iframe_header();
     $upgrader = new Theme_Upgrader(new Bulk_Theme_Upgrader_Skin(compact('nonce', 'url')));
     $upgrader->bulk_upgrade($themes);
     iframe_footer();
 } elseif ('install-theme' == $action) {
     if (!current_user_can('install_themes')) {
         wp_die(__('You do not have sufficient permissions to install themes on this site.'));
     }
     include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     //for themes_api..
     check_admin_referer('install-theme_' . $theme);
     $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false)));
     //Save on a bit of bandwidth.
     if (is_wp_error($api)) {
         wp_die($api);
     }
     wp_enqueue_script('customize-loader');
     $title = __('Install Themes');
     $parent_file = 'themes.php';
     $submenu_file = 'themes.php';
     require_once ABSPATH . 'wp-admin/admin-header.php';
     $title = sprintf(__('Installing Theme: %s'), $api->name . ' ' . $api->version);
     $nonce = 'install-theme_' . $theme;
     $url = 'update.php?action=install-theme&theme=' . urlencode($theme);
     $type = 'web';
     //Install theme type, From Web or an Upload.
     $upgrader = new Theme_Upgrader(new Theme_Installer_Skin(compact('title', 'url', 'nonce', 'plugin', 'api')));
	function prepare_items() {
		include( ABSPATH . 'wp-admin/includes/theme-install.php' );

		global $tabs, $tab, $paged, $type, $term, $theme_field_defaults;

		wp_reset_vars( array( 'tab' ) );

		$paged = $this->get_pagenum();

		$per_page = 30;

		// These are the tabs which are shown on the page,
		$tabs = array();
		$tabs['dashboard'] = __( 'Search' );
		if ( 'search' == $tab )
			$tabs['search']	= __( 'Search Results' );
		$tabs['upload'] = __( 'Upload' );
		$tabs['featured'] = _x( 'Featured','Theme Installer' );
		//$tabs['popular']  = _x( 'Popular','Theme Installer' );
		$tabs['new']      = _x( 'Newest','Theme Installer' );
		$tabs['updated']  = _x( 'Recently Updated','Theme Installer' );

		$nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.

		$tabs = apply_filters( 'install_themes_tabs', $tabs );
		$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );

		// If a non-valid menu tab has been selected, And its not a non-menu action.
		if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) )
			$tab = key( $tabs );

		$args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults );

		switch ( $tab ) {
			case 'search':
				$type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
				$term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';

				switch ( $type ) {
					case 'tag':
						$terms = explode( ',', $term );
						$terms = array_map( 'trim', $terms );
						$terms = array_map( 'sanitize_title_with_dashes', $terms );
						$args['tag'] = $terms;
						break;
					case 'term':
						$args['search'] = $term;
						break;
					case 'author':
						$args['author'] = $term;
						break;
				}

				if ( !empty( $_POST['features'] ) ) {
					$terms = $_POST['features'];
					$terms = array_map( 'trim', $terms );
					$terms = array_map( 'sanitize_title_with_dashes', $terms );
					$args['tag'] = $terms;
					$_REQUEST['s'] = implode( ',', $terms );
					$_REQUEST['type'] = 'tag';
				}

				add_action( 'install_themes_table_header', 'install_theme_search_form' );
				break;

			case 'featured':
			//case 'popular':
			case 'new':
			case 'updated':
				$args['browse'] = $tab;
				break;

			default:
				$args = false;
		}

		if ( !$args )
			return;

		$api = themes_api( 'query_themes', $args );

		if ( is_wp_error( $api ) )
			wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );

		$this->items = $api->themes;

		$this->set_pagination_args( array(
			'total_items' => $api->info['results'],
			'per_page' => $per_page,
		) );
	}
 /**
  * Search wordpress.org repo.
  *
  * @param  array $args       A arguments array containing the search term in the first element.
  * @param  array $assoc_args Data passed in from command.
  */
 protected function _search($args, $assoc_args)
 {
     $term = $args[0];
     $defaults = array('per-page' => 10, 'page' => 1, 'fields' => implode(',', array('name', 'slug', 'rating')));
     $assoc_args = array_merge($defaults, $assoc_args);
     $fields = array();
     foreach (explode(',', $assoc_args['fields']) as $field) {
         $fields[$field] = true;
     }
     $formatter = $this->get_formatter($assoc_args);
     $api_args = array('per_page' => (int) $assoc_args['per-page'], 'page' => (int) $assoc_args['page'], 'search' => $term, 'fields' => $fields);
     if ('plugin' == $this->item_type) {
         $api = plugins_api('query_plugins', $api_args);
     } else {
         $api = themes_api('query_themes', $api_args);
     }
     if (is_wp_error($api)) {
         \WP_CLI::error($api->get_error_message() . __(' Try again'));
     }
     $plural = $this->item_type . 's';
     if (!isset($api->{$plural})) {
         \WP_CLI::error(__('API error. Try Again.'));
     }
     $items = $api->{$plural};
     $count = \WP_CLI\Utils\get_flag_value($api->info, 'results', 'unknown');
     \WP_CLI::success(sprintf('Showing %s of %s %s.', count($items), $count, $plural));
     $formatter->display_items($items);
 }
 /**
  * Check if a child theme is being installed and we need to install its parent.
  *
  * Hooked to the {@see 'upgrader_post_install'} filter by {@see Theme_Upgrader::install()}.
  *
  * @since 3.4.0
  */
 public function check_parent_theme_filter($install_result, $hook_extra, $child_result)
 {
     // Check to see if we need to install a parent theme
     $theme_info = $this->theme_info();
     if (!$theme_info->parent()) {
         return $install_result;
     }
     $this->skin->feedback('parent_theme_search');
     if (!$theme_info->parent()->errors()) {
         $this->skin->feedback('parent_theme_currently_installed', $theme_info->parent()->display('Name'), $theme_info->parent()->display('Version'));
         // We already have the theme, fall through.
         return $install_result;
     }
     // We don't have the parent theme, let's install it.
     $api = themes_api('theme_information', array('slug' => $theme_info->get('Template'), 'fields' => array('sections' => false, 'tags' => false)));
     //Save on a bit of bandwidth.
     if (!$api || is_wp_error($api)) {
         $this->skin->feedback('parent_theme_not_found', $theme_info->get('Template'));
         // Don't show activate or preview actions after install
         add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions'));
         return $install_result;
     }
     // Backup required data we're going to override:
     $child_api = $this->skin->api;
     $child_success_message = $this->strings['process_success'];
     // Override them
     $this->skin->api = $api;
     $this->strings['process_success_specific'] = $this->strings['parent_theme_install_success'];
     //, $api->name, $api->version);
     $this->skin->feedback('parent_theme_prepare_install', $api->name, $api->version);
     add_filter('install_theme_complete_actions', '__return_false', 999);
     // Don't show any actions after installing the theme.
     // Install the parent theme
     $parent_result = $this->run(array('package' => $api->download_link, 'destination' => get_theme_root(), 'clear_destination' => false, 'clear_working' => true));
     if (is_wp_error($parent_result)) {
         add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions'));
     }
     // Start cleaning up after the parents installation
     remove_filter('install_theme_complete_actions', '__return_false', 999);
     // Reset child's result and data
     $this->result = $child_result;
     $this->skin->api = $child_api;
     $this->strings['process_success'] = $child_success_message;
     return $install_result;
 }
function wp3sixty_ping_theme_api($theme_slug)
{
    require_once ABSPATH . '/wp-admin/includes/theme.php';
    return themes_api('theme_information', array('slug' => wp_unslash($theme_slug)));
}
/**
 * Get themes from themes_api().
 *
 * @since 3.9.0
 */
function wp_ajax_query_themes() {
	global $themes_allowedtags, $theme_field_defaults;

	if ( ! current_user_can( 'install_themes' ) ) {
		wp_send_json_error();
	}

	$args = wp_parse_args( wp_unslash( $_REQUEST['request'] ), array(
		'per_page' => 20,
		'fields'   => $theme_field_defaults
	) );

	$old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';

	/** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */
	$args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );

	$api = themes_api( 'query_themes', $args );

	if ( is_wp_error( $api ) ) {
		wp_send_json_error();
	}

	$update_php = network_admin_url( 'update.php?action=install-theme' );
	foreach ( $api->themes as &$theme ) {
		$theme->install_url = add_query_arg( array(
			'theme'    => $theme->slug,
			'_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug )
		), $update_php );

		$theme->name        = wp_kses( $theme->name, $themes_allowedtags );
		$theme->author      = wp_kses( $theme->author, $themes_allowedtags );
		$theme->version     = wp_kses( $theme->version, $themes_allowedtags );
		$theme->description = wp_kses( $theme->description, $themes_allowedtags );
		$theme->num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
	}

	wp_send_json_success( $api );
}
/**
 * Ajax handler for installing a theme.
 *
 * @since 4.6.0
 *
 * @see Theme_Upgrader
 */
function wp_ajax_install_theme()
{
    check_ajax_referer('updates');
    if (empty($_POST['slug'])) {
        wp_send_json_error(array('slug' => '', 'errorCode' => 'no_theme_specified', 'errorMessage' => __('No theme specified.')));
    }
    $slug = sanitize_key(wp_unslash($_POST['slug']));
    $status = array('install' => 'theme', 'slug' => $slug);
    if (!current_user_can('install_themes')) {
        $status['errorMessage'] = __('Sorry, you are not allowed to install themes on this site.');
        wp_send_json_error($status);
    }
    include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    include_once ABSPATH . 'wp-admin/includes/theme.php';
    $api = themes_api('theme_information', array('slug' => $slug, 'fields' => array('sections' => false)));
    if (is_wp_error($api)) {
        $status['errorMessage'] = $api->get_error_message();
        wp_send_json_error($status);
    }
    $skin = new WP_Ajax_Upgrader_Skin();
    $upgrader = new Theme_Upgrader($skin);
    $result = $upgrader->install($api->download_link);
    if (defined('WP_DEBUG') && WP_DEBUG) {
        $status['debug'] = $skin->get_upgrade_messages();
    }
    if (is_wp_error($result)) {
        $status['errorCode'] = $result->get_error_code();
        $status['errorMessage'] = $result->get_error_message();
        wp_send_json_error($status);
    } elseif (is_wp_error($skin->result)) {
        $status['errorCode'] = $skin->result->get_error_code();
        $status['errorMessage'] = $skin->result->get_error_message();
        wp_send_json_error($status);
    } elseif ($skin->get_errors()->get_error_code()) {
        $status['errorMessage'] = $skin->get_error_messages();
        wp_send_json_error($status);
    } elseif (is_null($result)) {
        global $wp_filesystem;
        $status['errorCode'] = 'unable_to_connect_to_filesystem';
        $status['errorMessage'] = __('Unable to connect to the filesystem. Please confirm your credentials.');
        // Pass through the error from WP_Filesystem if one was raised.
        if ($wp_filesystem instanceof WP_Filesystem_Base && is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) {
            $status['errorMessage'] = esc_html($wp_filesystem->errors->get_error_message());
        }
        wp_send_json_error($status);
    }
    $status['themeName'] = wp_get_theme($slug)->get('Name');
    if (current_user_can('switch_themes')) {
        if (is_multisite()) {
            $status['activateUrl'] = add_query_arg(array('action' => 'enable', '_wpnonce' => wp_create_nonce('enable-theme_' . $slug), 'theme' => $slug), network_admin_url('themes.php'));
        } else {
            $status['activateUrl'] = add_query_arg(array('action' => 'activate', '_wpnonce' => wp_create_nonce('switch-theme_' . $slug), 'stylesheet' => $slug), admin_url('themes.php'));
        }
    }
    if (!is_multisite() && current_user_can('edit_theme_options') && current_user_can('customize')) {
        $status['customizeUrl'] = add_query_arg(array('return' => urlencode(network_admin_url('theme-install.php', 'relative'))), wp_customize_url($slug));
    }
    /*
     * See WP_Theme_Install_List_Table::_get_theme_status() if we wanted to check
     * on post-install status.
     */
    wp_send_json_success($status);
}
        public static function set_content()
        {
            ?>

			<div class="wrap">
				<div id="sc-settings">
					<div id="sc-settings-content">

						<h1><?php 
            _e('System Report', 'stripe');
            ?>
</h1>

						<div id="sc-system-status-report">
							<p>
								<?php 
            _e('Please copy and paste this information when contacting support:', 'stripe');
            ?>
							</p>

							<textarea readonly="readonly" onclick="this.select();"></textarea>

							<p>
								<?php 
            _e('You can also download your information as a text file to attach, or simply view it below.', 'stripe');
            ?>
							</p>
							<p>
								<a href="#" id="sc-system-status-report-download"
								   class="button button-primary"><?php 
            _e('Download System Report', 'stripe');
            ?>
</a>
							</p>
						</div>
						<hr>
						<?php 
            global $wpdb, $wp_version;
            $sections = array();
            $panels = array('wordpress' => array('label' => __('WordPress Installation', 'stripe'), 'export' => 'WordPress Installation'), 'simple_pay' => array('label' => __('Simple Pay Settings', 'stripe'), 'export' => 'Simple Pay Settings'), 'theme' => array('label' => __('Active Theme', 'stripe'), 'export' => 'Active Theme'), 'plugins' => array('label' => __('Active Plugins', 'stripe'), 'export' => 'Active Plugins'), 'server' => array('label' => __('Server Environment', 'stripe'), 'export' => 'Server Environment'), 'client' => array('label' => __('Client Information', 'stripe'), 'export' => 'Client Information'));
            global $sc_options;
            global $base_class;
            $simple_pay_settings = $sc_options->get_settings();
            $sections['simple_pay'] = array();
            // Show version from base class.
            $sections['simple_pay']['sc_version'] = array('label' => __('Plugin Version', 'stripe'), 'label_export' => 'Plugin Version', 'result' => $base_class->version);
            // Show Stripe TLS check.
            $sections['simple_pay']['stripe_tls'] = array('label' => __('Stripe TLS', 'stripe'), 'label_export' => 'Stripe TLS', 'result' => self::stripe_tls_check(false), 'result_export' => self::stripe_tls_check(true));
            foreach ($simple_pay_settings as $key => $value) {
                // Check to see if it's a live key. If it is then we want to hide it in the export.
                if ($key === 'live_secret_key' || $key === 'live_publish_key') {
                    $sections['simple_pay'][$key] = array('label' => $key, 'label_export' => '', 'result' => $value . ' ' . __('(hidden in downloadable report)', 'stripe'), 'result_export' => '');
                } else {
                    $sections['simple_pay'][$key] = array('label' => $key, 'label_export' => $key, 'result' => $value);
                }
            }
            /**
             * WordPress Installation
             * ======================
             */
            $debug_mode = $script_debug = __('No', 'stripe');
            if (defined('WP_DEBUG')) {
                $debug_mode = true === WP_DEBUG ? __('Yes', 'stripe') : $debug_mode;
            }
            if (defined('SCRIPT_DEBUG')) {
                $script_debug = true === SCRIPT_DEBUG ? __('Yes', 'stripe') : $script_debug;
            }
            $memory = self::let_to_num(WP_MEMORY_LIMIT);
            $memory_export = size_format($memory);
            if ($memory < 41943040) {
                $memory = '<mark class="error">' . sprintf(__('%1$s - It is recommendend to set memory to at least 40MB. See: <a href="%2$s" target="_blank">Increasing memory allocated to PHP</a>', 'stripe'), $memory_export, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP') . '</mark>';
            } else {
                $memory = '<mark class="ok">' . $memory_export . '</mark>';
            }
            $permalinks = get_option('permalink_structure');
            $permalinks = empty($permalinks) ? '/?' : $permalinks;
            $is_multisite = is_multisite();
            $sections['wordpress'] = array('name' => array('label' => __('Site Name', 'stripe'), 'label_export' => 'Site Name', 'result' => get_bloginfo('name')), 'home_url' => array('label' => __('Home URL', 'stripe'), 'label_export' => 'Home URL', 'result' => home_url()), 'site_url' => array('label' => __('Site URL', 'stripe'), 'label_export' => 'Site URL', 'result' => site_url()), 'version' => array('label' => __('Version', 'stripe'), 'label_export' => 'Version', 'result' => $wp_version), 'locale' => array('label' => __('Locale', 'stripe'), 'label_export' => 'Locale', 'result' => get_locale()), 'multisite' => array('label' => __('Multisite', 'stripe'), 'label_export' => 'Multisite', 'result' => $is_multisite ? __('Yes', 'stripe') : __('No', 'stripe'), 'result_export' => $is_multisite ? 'Yes' : 'No'), 'permalink' => array('label' => __('Permalinks', 'stripe'), 'label_export' => 'Permalinks', 'result' => '<code>' . $permalinks . '</code>', 'result_export' => $permalinks), 'memory_limit' => array('label' => __('WP Memory Limit', 'stripe'), 'result' => $memory, 'result_export' => $memory_export), 'debug_mode' => array('label' => __('WP Debug Mode', 'stripe'), 'result' => $debug_mode), 'script_debug' => array('label' => 'Script Debug', 'result' => $script_debug));
            /**
             * Active Theme
             * ============
             */
            include_once ABSPATH . 'wp-admin/includes/theme-install.php';
            if (version_compare($wp_version, '3.4', '<')) {
                $active_theme = get_theme_data(get_stylesheet_directory() . '/style.css');
                $theme_name = '<a href="' . $active_theme['URI'] . '" target="_blank">' . $active_theme['Name'] . '</a>';
                $theme_version = $active_theme['Version'];
                $theme_author = '<a href="' . $active_theme['AuthorURI'] . '" target="_blank">' . $active_theme['Author'] . '</a>';
                $theme_export = $active_theme['Name'] . ' - ' . $theme_version;
            } else {
                $active_theme = wp_get_theme();
                $theme_name = '<a href="' . $active_theme->ThemeURI . '" target="_blank">' . $active_theme->Name . '</a>';
                $theme_version = $active_theme->Version;
                $theme_author = $active_theme->Author;
                $theme_export = $active_theme->Name . ' - ' . $theme_version;
            }
            $theme_update_version = $theme_version;
            $api = themes_api('theme_information', array('slug' => get_template(), 'fields' => array('sections' => false, 'tags' => false)));
            if ($api && !is_wp_error($api)) {
                $theme_update_version = $api->version;
            }
            if (version_compare($theme_version, $theme_update_version, '<')) {
                $theme_version = '<mark class="error">' . $theme_version . ' (' . sprintf(__('%s is available', 'stripe'), esc_html($theme_update_version)) . '</mark>';
            } else {
                $theme_version = '<mark class="ok">' . $theme_version . '</mark>';
            }
            $theme = '<dl>';
            $theme .= '<dt>' . __('Name', 'stripe') . '</dt>';
            $theme .= '<dd>' . $theme_name . '</dd>';
            $theme .= '<dt>' . __('Author', 'stripe') . '</dt>';
            $theme .= '<dd>' . $theme_author . '</dd>';
            $theme .= '<dt>' . __('Version', 'stripe') . '</dt>';
            $theme .= '<dd>' . $theme_version . '</dd>';
            $theme .= '</dl>';
            $is_child_theme = is_child_theme();
            $parent_theme = $parent_theme_export = '-';
            if ($is_child_theme) {
                if (version_compare($wp_version, '3.4', '<')) {
                    $parent_theme = $parent_theme_export = $active_theme['Template'];
                } else {
                    $parent = wp_get_theme($active_theme->Template);
                    $parent_theme = '<dl>';
                    $parent_theme .= '<dt>' . __('Name', 'stripe') . '</dt>';
                    $parent_theme .= '<dd>' . $parent->Name . '</dd>';
                    $parent_theme .= '<dt>' . __('Author', 'stripe') . '</dt>';
                    $parent_theme .= '<dd>' . $parent->Author . '</dd>';
                    $parent_theme .= '<dt>' . __('Version', 'stripe') . '</dt>';
                    $parent_theme .= '<dd>' . $parent->Version . '</dd>';
                    $parent_theme .= '</dl>';
                    $parent_theme_export = strip_tags($parent->Name) . ' - ' . $parent->Version;
                }
            }
            $sections['theme'] = array('theme' => array('label' => __('Theme Information', 'stripe'), 'label_export' => 'Theme', 'result' => $theme, 'result_export' => $theme_export), 'theme_child' => array('label' => __('Child Theme', 'stripe'), 'label_export' => 'Child Theme', 'result' => $is_child_theme ? __('Yes', 'stripe') : __('No', 'stripe'), 'result_export' => $is_child_theme ? 'Yes' : 'No'), 'theme_parent' => array('label' => __('Parent Theme', 'stripe'), 'label_export' => 'Parent Theme', 'result' => $parent_theme, 'result_export' => $parent_theme_export));
            /**
             * Active Plugins
             * ==============
             */
            include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
            $active_plugins = (array) get_option('active_plugins', array());
            if (is_multisite()) {
                $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
            }
            foreach ($active_plugins as $plugin) {
                $plugin_data = @get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin);
                if (!empty($plugin_data['Name'])) {
                    $plugin_name = $plugin_data['Title'];
                    $plugin_author = $plugin_data['Author'];
                    $plugin_version = $plugin_update_version = $plugin_data['Version'];
                    // Afraid that querying many plugins may risk a timeout.
                    if (count($active_plugins) <= 10) {
                        $api = plugins_api('plugin_information', array('slug' => $plugin_data['Name'], 'fields' => array('version' => true)));
                        if ($api && !is_wp_error($api)) {
                            if (!empty($api->version)) {
                                $plugin_update_version = $api->version;
                                if (version_compare($plugin_version, $plugin_update_version, '<')) {
                                    $plugin_version = '<mark class="error">' . $plugin_version . ' (' . sprintf(__('%s is available', 'stripe'), esc_html($plugin_update_version)) . '</mark>';
                                } else {
                                    $plugin_version = '<mark class="ok">' . $plugin_version . '</mark>';
                                }
                            }
                        }
                    }
                    $plugin = '<dl>';
                    $plugin .= '<dt>' . __('Author', 'stripe') . '</dt>';
                    $plugin .= '<dd>' . $plugin_author . '</dd>';
                    $plugin .= '<dt>' . __('Version', 'stripe') . '</dt>';
                    $plugin .= '<dd>' . $plugin_version . '</dd>';
                    $plugin .= '</dl>';
                    $sections['plugins'][sanitize_key(strip_tags($plugin_name))] = array('label' => $plugin_name, 'label_export' => strip_tags($plugin_data['Title']), 'result' => $plugin, 'result_export' => $plugin_data['Version']);
                }
            }
            if (isset($sections['plugins'])) {
                rsort($sections['plugins']);
            }
            /**
             * Server Environment
             * ==================
             */
            if (version_compare(PHP_VERSION, '5.5.19', '<')) {
                $php = '<mark class="error">' . sprintf(__('%1$s - It is recommendend to upgrade at least to PHP version 5.5.19 for security reasons. <a href="%2$s" target="_blank">Read more</a>', 'stripe'), PHP_VERSION, 'https://wordpress.org/about/requirements/') . '</mark>';
            } else {
                $php = '<mark class="ok">' . PHP_VERSION . '</mark>';
            }
            if ($wpdb->use_mysqli) {
                $mysql = @mysqli_get_server_info($wpdb->dbh);
            } else {
                $mysql = @mysql_get_server_info();
            }
            $host = $_SERVER['SERVER_SOFTWARE'];
            if (defined('WPE_APIKEY')) {
                $host .= ' (WP Engine)';
            } elseif (defined('PAGELYBIN')) {
                $host .= ' (Pagely)';
            }
            $default_timezone = $server_timezone_export = date_default_timezone_get();
            if ('UTC' !== $default_timezone) {
                $server_timezone = '<mark class="error">' . sprintf(__('Server default timezone is %s - it should be UTC', 'stripe'), $default_timezone) . '</mark>';
            } else {
                $server_timezone = '<mark class="ok">UTC</mark>';
            }
            // WP Remote POST test.
            $response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array('timeout' => 60, 'body' => array('cmd' => '_notify-validate')));
            if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
                $wp_post_export = 'Yes';
                $wp_post = '<mark class="ok">' . __('Yes', 'stripe') . '</mark>';
            } else {
                $wp_post_export = 'No';
                $wp_post = '<mark class="error">' . __('No', 'stripe');
                if (is_wp_error($response)) {
                    $error = ' (' . $response->get_error_message() . ')';
                    $wp_post .= $error;
                    $wp_post_export .= $error;
                } else {
                    $error = ' (' . $response['response']['code'] . ')';
                    $wp_post .= $error;
                    $wp_post_export .= $error;
                }
                $wp_post .= '</mark>';
            }
            // WP Remote GET test.
            $response = wp_safe_remote_get(get_home_url('/?p=1'));
            if (!is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) {
                $wp_get_export = 'Yes';
                $wp_get = '<mark class="ok">' . __('Yes', 'stripe') . '</mark>';
            } else {
                $wp_get_export = 'No';
                $wp_get = '<mark class="error">' . __('No', 'stripe');
                if (is_wp_error($response)) {
                    $error = ' (' . $response->get_error_message() . ')';
                    $wp_get .= $error;
                    $wp_get_export .= $error;
                } else {
                    $error = ' (' . $response['response']['code'] . ')';
                    $wp_get .= $error;
                    $wp_get_export .= $error;
                }
                $wp_get .= '</mark>';
            }
            $php_memory_limit = ini_get('memory_limit');
            $php_max_upload_filesize = ini_get('upload_max_filesize');
            $php_post_max_size = ini_get('post_max_size');
            $php_max_execution_time = ini_get('max_execution_time');
            $php_max_input_vars = ini_get('max_input_vars');
            $curl_info = '';
            if (function_exists('curl_version')) {
                $curl_info = curl_version();
            }
            $sections['server'] = array('host' => array('label' => __('Web Server', 'stripe'), 'label_export' => 'Web Server', 'result' => $host), 'php_version' => array('label' => __('PHP Version', 'stripe'), 'label_export' => 'PHP Version', 'result' => $php, 'result_export' => PHP_VERSION), 'mysql_version' => array('label' => __('MySQL Version', 'stripe'), 'label_export' => 'MySQL Version', 'result' => version_compare($mysql, '5.5', '>') ? '<mark class="ok">' . $mysql . '</mark>' : $mysql, 'result_export' => $mysql), 'server_timezone' => array('label' => __('Server Timezone', 'stripe'), 'label_export' => 'Server Timezone', 'result' => $server_timezone, 'result_export' => $server_timezone_export), 'display_errors' => array('label' => __('Display Errors', 'stripe'), 'result' => ini_get('display_errors') ? __('Yes', 'stripe') . ' (' . ini_get('display_errors') . ')' : '-', 'result_export' => ini_get('display_errors') ? 'Yes' : 'No'), 'php_memory_limit' => array('label' => __('Memory Limit', 'stripe'), 'result' => $php_memory_limit ? $php_memory_limit : '-'), 'upload_max_filesize' => array('label' => __('Upload Max Filesize', 'stripe'), 'result' => $php_max_upload_filesize ? $php_max_upload_filesize : '-'), 'post_max_size' => array('label' => __('Post Max Size', 'stripe'), 'result' => $php_post_max_size ? $php_post_max_size : '-'), 'max_execution_time' => array('label' => __('Max Execution Time', 'stripe'), 'result' => $php_max_execution_time ? $php_max_execution_time : '-'), 'max_input_vars' => array('label' => __('Max Input Vars', 'stripe'), 'result' => $php_max_input_vars ? $php_max_input_vars : '-'), 'fsockopen' => array('label' => 'fsockopen', 'result' => function_exists('fsockopen') ? __('Yes', 'stripe') : __('No', 'stripe'), 'result_export' => function_exists('fsockopen') ? 'Yes' : 'No'), 'curl_init' => array('label' => 'cURL', 'result' => !empty($curl_info) ? $curl_info['version'] . ', ' . $curl_info['ssl_version'] : __('No version found.', 'stripe'), 'result_export' => !empty($curl_info) ? $curl_info['version'] . ', ' . $curl_info['ssl_version'] : 'No version found.'), 'soap' => array('label' => 'SOAP', 'result' => class_exists('SoapClient') ? __('Yes', 'stripe') : __('No', 'stripe'), 'result_export' => class_exists('SoapClient') ? 'Yes' : 'No'), 'suhosin' => array('label' => 'SUHOSIN', 'result' => extension_loaded('suhosin') ? __('Yes', 'stripe') : __('No', 'stripe'), 'result_export' => extension_loaded('suhosin') ? 'Yes' : 'No'), 'wp_remote_post' => array('label' => __('WP Remote POST', 'stripe'), 'result' => $wp_post, 'result_export' => $wp_post_export), 'wp_remote_get' => array('label' => __('WP Remote GET', 'stripe'), 'result' => $wp_get, 'result_export' => $wp_get_export));
            /**
             * Client Information
             * ==================
             */
            if (!class_exists('SimPay_Browser')) {
                include_once SC_DIR_PATH . 'classes/browser.php';
                $user_client = new SimPay_Browser();
                $browser = '<dl>';
                $browser .= '<dt>' . __('Name:', 'stripe') . '</dt>';
                $browser .= '<dd>' . $user_client->getBrowser() . '</dd>';
                $browser .= '<dt>' . __('Version:', 'stripe') . '</dt>';
                $browser .= '<dd>' . $user_client->getVersion() . '</dd>';
                $browser .= '<dt>' . __('User Agent:', 'stripe') . '</dt>';
                $browser .= '<dd>' . $user_client->getUserAgent() . '</dd>';
                $browser .= '<dt>' . __('Platform:', 'stripe') . '</dt>';
                $browser .= '<dd>' . $user_client->getPlatform() . '</dd>';
                $browser .= '</dl>';
                $browser_export = $user_client->getBrowser() . ' ' . $user_client->getVersion() . ' (' . $user_client->getPlatform() . ')';
            } else {
                $browser = '<dl>';
                $browser .= '<dt>' . __('User Agent:', 'stripe') . '</dt>';
                $browser .= '<dd>' . $_SERVER['HTTP_USER_AGENT'] . '</dd>';
                $browser .= '</dl>';
                $browser_export = $_SERVER['HTTP_USER_AGENT'];
            }
            $sections['client'] = array('user_ip' => array('label' => __('IP Address', 'stripe'), 'label_export' => 'IP Address', 'result' => $_SERVER['SERVER_ADDR']), 'browser' => array('label' => __('Browser', 'stripe'), 'result' => $browser, 'result_export' => $browser_export));
            /**
             * Final Output
             * ============
             */
            $panels = apply_filters('sc_system_status_report_panels', $panels);
            $sections = apply_filters('sc_system_status_report_sections', $sections);
            foreach ($panels as $panel => $v) {
                if (isset($sections[$panel])) {
                    ?>
								<table class="widefat sc-system-status-report-panel">
									<thead class="<?php 
                    echo $panel;
                    ?>
">
									<tr>
										<th colspan="3" data-export="<?php 
                    echo $v['export'];
                    ?>
"><?php 
                    echo $v['label'];
                    ?>
</th>
									</tr>
									</thead>
									<tbody>
									<?php 
                    foreach ($sections[$panel] as $row => $cell) {
                        ?>
										<tr>
											<?php 
                        $label_export = isset($cell['label_export']) ? $cell['label_export'] : $cell['label'];
                        $result_export = isset($cell['result_export']) ? $cell['result_export'] : $cell['result'];
                        ?>
											<td class="tooltip"><?php 
                        echo isset($cell['tooltip']) ? ' <i class="sc-icon-help sc-help-tip" data-tip="' . $cell['tooltip'] . '"></i> ' : '';
                        ?>
</td>
											<td class="label" data-export="<?php 
                        echo trim($label_export);
                        ?>
"><?php 
                        echo $cell['label'];
                        ?>
</td>
											<td class="result" data-export="<?php 
                        echo trim($result_export);
                        ?>
"><?php 
                        echo $cell['result'];
                        ?>
</td>
										</tr>
									<?php 
                    }
                    ?>
									</tbody>
								</table>
								<?php 
                }
            }
            do_action('sc_system_status_report');
            ?>
						<script type="text/javascript">

							var report = '';

							jQuery( '.sc-system-status-report-panel thead, .sc-system-status-report-panel tbody' ).each( function() {

								if ( jQuery( this ).is( 'thead' ) ) {

									var label = jQuery( this ).find( 'th' ).data( 'export' );
									report = report + '\n### ' + jQuery.trim( label ) + ' ###\n\n';

								} else {

									jQuery( 'tr', jQuery( this ) ).each( function() {

										var label = jQuery( this ).find( 'td:eq(1)' ).data( 'export' );
										var the_name = jQuery.trim( label ).replace( /(<([^>]+)>)/ig, '' ); // Remove HTML
										var image = jQuery( this ).find( 'td:eq(2)' ).find( 'img' ); // Get WP 4.2 emojis
										var prefix = ( undefined === image.attr( 'alt' ) ) ? '' : image.attr( 'alt' ) + ' '; // Remove WP 4.2 emojis
										var the_value = jQuery.trim( prefix + jQuery( this ).find( 'td:eq(2)' ).data( 'export' ) );
										var value_array = the_value.split( ', ' );
										if ( value_array.length > 1 ) {
											var temp_line = '';
											jQuery.each( value_array, function( key, line ) {
												temp_line = temp_line + line + '\n';
											} );
											the_value = temp_line;
										}

										if ( the_name.trim() !== '' ) {
											report = report + '' + the_name.trim() + ': ' + the_value.trim() + '\n';
										}
									} );

								}

							} );

							try {
								jQuery( '#sc-system-status-report textarea' ).val( report ).focus().select();
							} catch ( e ) {
								console.log( e );
							}

							function downloadReport( text, name, type ) {
								var a = document.getElementById( 'sc-system-status-report-download' );
								var file = new Blob( [ text ], { type: type } );
								a.href = URL.createObjectURL( file );
								a.download = name;
							}

							jQuery( '#sc-system-status-report-download' ).on( 'click', function() {
								var file = new Blob( [ report ], { type: 'text/plain' } );
								jQuery( this ).attr( 'href', URL.createObjectURL( file ) );
								jQuery( this ).attr( 'download', '<?php 
            echo sanitize_title(str_replace(array('http://', 'https://'), '', get_bloginfo('url')) . '-system-report-' . date('Y-m-d', time()));
            ?>
' );
							} );

						</script>
					</div>
				</div>
			</div>
			<?php 
        }
</table>
<table class="wc_status_table widefat" cellspacing="0">
	<thead>
		<tr>
			<th colspan="3" data-export-label="Theme"><?php 
_e('Theme', 'woocommerce');
?>
</th>
		</tr>
	</thead>
		<?php 
include_once ABSPATH . 'wp-admin/includes/theme-install.php';
$active_theme = wp_get_theme();
$theme_version = $active_theme->Version;
$update_theme_version = $active_theme->Version;
$api = themes_api('theme_information', array('slug' => get_template(), 'fields' => array('sections' => false, 'tags' => false)));
// Check .org
if ($api && !is_wp_error($api)) {
    $update_theme_version = $api->version;
    // Check WooThemes Theme Version
} elseif (strstr($active_theme->{'Author URI'}, 'woothemes')) {
    $theme_dir = substr(strtolower(str_replace(' ', '', $active_theme->Name)), 0, 45);
    if (false === ($theme_version_data = get_transient($theme_dir . '_version_data'))) {
        $theme_changelog = wp_safe_remote_get('http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt');
        $cl_lines = explode("\n", wp_remote_retrieve_body($theme_changelog));
        if (!empty($cl_lines)) {
            foreach ($cl_lines as $line_num => $cl_line) {
                if (preg_match('/^[0-9]/', $cl_line)) {
                    $theme_date = str_replace('.', '-', trim(substr($cl_line, 0, strpos($cl_line, '-'))));
                    $theme_version = preg_replace('~[^0-9,.]~', '', stristr($cl_line, "version"));
                    $theme_update = trim(str_replace("*", "", $cl_lines[$line_num + 1]));
Beispiel #14
0
/**
 * Display theme information in dialog box form.
 *
 * @since 2.8.0
 */
function install_theme_information()
{
    global $tab, $themes_allowedtags, $wp_list_table;
    $theme = themes_api('theme_information', array('slug' => wp_unslash($_REQUEST['theme'])));
    if (is_wp_error($theme)) {
        wp_die($theme);
    }
    iframe_header(__('Theme Install'));
    $wp_list_table->theme_installer_single($theme);
    iframe_footer();
    exit;
}
Beispiel #15
0
    function bws_add_menu_render()
    {
        global $wpdb, $wp_version, $bws_plugin_info;
        $error = $message = $bwsmn_form_email = '';
        $bws_donate_link = 'http://bestwebsoft.com/donate/';
        if (!function_exists('is_plugin_active_for_network')) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php';
        }
        if (function_exists('is_multisite')) {
            $admin_url = !is_multisite() ? admin_url('/') : network_admin_url('/');
        } else {
            $admin_url = admin_url('/');
        }
        $bws_plugins = array('captcha/captcha.php' => array('name' => 'Captcha', 'description' => 'Plugin intended to prove that the visitor is a human being and not a spam robot.', 'link' => 'http://bestwebsoft.com/products/captcha/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/captcha/download/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Captcha+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=captcha.php', 'pro_version' => 'captcha-pro/captcha_pro.php', 'purchase' => 'http://bestwebsoft.com/products/captcha/buy/?k=ff7d65e55e5e7f98f219be9ed711094e&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=captcha_pro.php'), 'contact-form-plugin/contact_form.php' => array('name' => 'Contact Form', 'description' => 'Add Contact Form to your WordPress website.', 'link' => 'http://bestwebsoft.com/products/contact-form/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/contact-form/download/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Contact+Form+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=contact_form.php', 'pro_version' => 'contact-form-pro/contact_form_pro.php', 'purchase' => 'http://bestwebsoft.com/products/contact-form/buy/?k=773dc97bb3551975db0e32edca1a6d71&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=contact_form_pro.php'), 'facebook-button-plugin/facebook-button-plugin.php' => array('name' => 'Facebook Like Button', 'description' => 'Allows you to add the Follow and Like buttons the easiest way.', 'link' => 'http://bestwebsoft.com/products/facebook-like-button/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/facebook-like-button/download/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Facebook+Like+Button+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=facebook-button-plugin.php', 'pro_version' => 'facebook-button-pro/facebook-button-pro.php', 'purchase' => 'http://bestwebsoft.com/products/facebook-like-button/buy/?k=8da168e60a831cfb3525417c333ad275&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=facebook-button-pro.php'), 'twitter-plugin/twitter.php' => array('name' => 'Twitter', 'description' => 'Allows you to add the Twitter "Follow" and "Like" buttons the easiest way.', 'link' => 'http://bestwebsoft.com/products/twitter/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/twitter/download/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Twitter+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=twitter.php', 'pro_version' => 'twitter-pro/twitter-pro.php', 'purchase' => 'http://bestwebsoft.com/products/twitter/buy/?k=63ecbf0cc9cebf060b5a3c9362299700&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=twitter-pro.php'), 'portfolio/portfolio.php' => array('name' => 'Portfolio', 'description' => 'Allows you to create a page with the information about your past projects.', 'link' => 'http://bestwebsoft.com/products/portfolio/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/portfolio/download/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Portfolio+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=portfolio.php', 'pro_version' => 'portfolio-pro/portfolio-pro.php', 'purchase' => 'http://bestwebsoft.com/products/portfolio/buy/?k=2cc716026197d36538a414b728e49fdd&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=portfolio-pro.php'), 'gallery-plugin/gallery-plugin.php' => array('name' => 'Gallery', 'description' => 'Allows you to implement a Gallery page into your website.', 'link' => 'http://bestwebsoft.com/products/gallery/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/gallery/download/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Gallery+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=gallery-plugin.php', 'pro_version' => 'gallery-plugin-pro/gallery-plugin-pro.php', 'purchase' => 'http://bestwebsoft.com/products/gallery/buy/?k=382e5ce7c96a6391f5ffa5e116b37fe0&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=gallery-plugin-pro.php'), 'adsense-plugin/adsense-plugin.php' => array('name' => 'Google AdSense by BestWebSoft', 'description' => 'Allows Google AdSense implementation to your website.', 'link' => 'http://bestwebsoft.com/products/google-adsense/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/google-adsense/download/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Adsense+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=adsense-plugin.php'), 'custom-search-plugin/custom-search-plugin.php' => array('name' => 'Custom Search', 'description' => 'Allows to extend your website search functionality by adding a custom post type.', 'link' => 'http://bestwebsoft.com/products/custom-search/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/custom-search/download/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Custom+Search+plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=custom_search.php', 'pro_version' => 'custom-search-pro/custom-search-pro.php', 'purchase' => 'http://bestwebsoft.com/products/custom-search/buy/?k=062b652ac6ac8ba863c9f30fc21d62c6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=custom_search_pro.php'), 'quotes-and-tips/quotes-and-tips.php' => array('name' => 'Quotes and Tips', 'description' => 'Allows you to implement quotes & tips block into your web site.', 'link' => 'http://bestwebsoft.com/products/quotes-and-tips/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/quotes-and-tips/download/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Quotes+and+Tips+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=quotes-and-tips.php'), 'google-sitemap-plugin/google-sitemap-plugin.php' => array('name' => 'Google Sitemap by BestWebSoft', 'description' => 'Allows you to add sitemap file to Google Webmaster Tools.', 'link' => 'http://bestwebsoft.com/products/google-sitemap/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/google-sitemap/download/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Google+sitemap+plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=google-sitemap-plugin.php', 'pro_version' => 'google-sitemap-pro/google-sitemap-pro.php', 'purchase' => 'http://bestwebsoft.com/products/google-sitemap/buy/?k=7ea384a5cc36cb4c22741caa20dcd56d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=google-sitemap-pro.php'), 'updater/updater.php' => array('name' => 'Updater', 'description' => 'Allows you to update plugins and WP core.', 'link' => 'http://bestwebsoft.com/products/updater/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/updater/download/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=updater+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=updater-options', 'pro_version' => 'updater-pro/updater_pro.php', 'purchase' => 'http://bestwebsoft.com/products/updater/buy/?k=cf633acbefbdff78545347fe08a3aecb&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=updater-pro-options'), 'custom-fields-search/custom-fields-search.php' => array('name' => 'Custom Fields Search', 'description' => 'Allows you to add website search any existing custom fields.', 'link' => 'http://bestwebsoft.com/products/custom-fields-search/?k=f3f8285bb069250c42c6ffac95ed3284&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/custom-fields-search/download/?k=f3f8285bb069250c42c6ffac95ed3284&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Custom+Fields+Search+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=custom_fields_search.php'), 'google-one/google-plus-one.php' => array('name' => 'Google +1 by BestWebSoft', 'description' => 'Allows you to see how many times your page has been liked on Google Search Engine as well as who has liked the article.', 'link' => 'http://bestwebsoft.com/products/google-plus-one/?k=ce7a88837f0a857b3a2bb142f470853c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/google-plus-one/download/?k=ce7a88837f0a857b3a2bb142f470853c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Google+%2B1+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=google-plus-one.php', 'pro_version' => 'google-one-pro/google-plus-one-pro.php', 'purchase' => 'http://bestwebsoft.com/products/google-plus-one/buy/?k=f4b0a62d155c9df9601a0531ad5bd832&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=google-plus-one-pro.php'), 'relevant/related-posts-plugin.php' => array('name' => 'Relevant - Related Posts', 'description' => 'Allows you to display related posts with similar words in category, tags, title or by adding special meta key for posts.', 'link' => 'http://bestwebsoft.com/products/related-posts/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/related-posts/download/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Related+Posts+Plugin+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=related-posts-plugin.php'), 'contact-form-to-db/contact_form_to_db.php' => array('name' => 'Contact Form To DB', 'description' => 'Allows you to manage the messages that have been sent from your site.', 'link' => 'http://bestwebsoft.com/products/contact-form-to-db/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/contact-form-to-db/download/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Contact+Form+to+DB+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=cntctfrmtdb_settings', 'pro_version' => 'contact-form-to-db-pro/contact_form_to_db_pro.php', 'purchase' => 'http://bestwebsoft.com/products/contact-form-to-db/buy/?k=6ce5f4a9006ec906e4db643669246c6a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=cntctfrmtdbpr_settings'), 'pdf-print/pdf-print.php' => array('name' => 'PDF & Print', 'description' => 'Allows you to create PDF and Print page with adding appropriate buttons to the content.', 'link' => 'http://bestwebsoft.com/products/pdf-print/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/pdf-print/download/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=PDF+Print+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=pdf-print.php', 'pro_version' => 'pdf-print-pro/pdf-print-pro.php', 'purchase' => 'http://bestwebsoft.com/products/pdf-print/buy/?k=fd43a0e659ddc170a9060027cbfdcc3a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=pdf-print-pro.php'), 'donate-button/donate.php' => array('name' => 'Donate', 'description' => 'Makes it possible to place donation buttons of various payment systems on your web page.', 'link' => 'http://bestwebsoft.com/products/donate/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/donate/download/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Donate+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=donate.php'), 'post-to-csv/post-to-csv.php' => array('name' => 'Post To CSV', 'description' => 'The plugin allows to export posts of any types to a csv file.', 'link' => 'http://bestwebsoft.com/products/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/post-to-csv/download/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Post+To+CSV+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=post-to-csv.php'), 'google-shortlink/google-shortlink.php' => array('name' => 'Google Shortlink by BestWebSoft', 'description' => 'Allows you to get short links from goo.gl servise without leaving your site.', 'link' => 'http://bestwebsoft.com/products/google-shortlink/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/google-shortlink/download/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Google+Shortlink+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=gglshrtlnk_options'), 'htaccess/htaccess.php' => array('name' => 'Htaccess', 'description' => 'Allows controlling access to your website using the directives Allow and Deny.', 'link' => 'http://bestwebsoft.com/products/htaccess/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/htaccess/download/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Htaccess+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=htaccess.php', 'pro_version' => 'htaccess-pro/htaccess-pro.php', 'purchase' => 'http://bestwebsoft.com/products/htaccess/buy/?k=59e9209a32864be534fda77d5e591c15&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=htaccess-pro.php'), 'google-captcha/google-captcha.php' => array('name' => 'Google Captcha (reCAPTCHA) by BestWebSoft', 'description' => 'Plugin intended to prove that the visitor is a human being and not a spam robot.', 'link' => 'http://bestwebsoft.com/products/google-captcha/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/google-captcha/download/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Google+Captcha+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=google-captcha.php'), 'sender/sender.php' => array('name' => 'Sender', 'description' => 'You can send mails to all users or to certain categories of users.', 'link' => 'http://bestwebsoft.com/products/sender/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/sender/download/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Sender+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=sndr_settings', 'pro_version' => 'sender-pro/sender-pro.php', 'purchase' => 'http://bestwebsoft.com/products/sender/buy/?k=dc5d1a87bdc8aeab2de40ffb99b38054&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=sndrpr_settings'), 'subscriber/subscriber.php' => array('name' => 'Subscriber', 'description' => 'This plugin allows you to subscribe users for newsletters from your website.', 'link' => 'http://bestwebsoft.com/products/subscriber/?k=a4ecc1b7800bae7329fbe8b4b04e9c88&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/subscriber/download/?k=a4ecc1b7800bae7329fbe8b4b04e9c88&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Subscriber+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=sbscrbr_settings_page', 'pro_version' => 'subscriber-pro/subscriber-pro.php', 'purchase' => 'http://bestwebsoft.com/products/subscriber/buy/?k=02dbb8b549925d9b74e70adc2a7282e4&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=sbscrbrpr_settings_page'), 'contact-form-multi/contact-form-multi.php' => array('name' => 'Contact Form Multi', 'description' => 'Add-on to the Contact Form plugin that allows to create and implement multiple contact forms.', 'link' => 'http://bestwebsoft.com/products/contact-form-multi/?k=83cdd9e72a9f4061122ad28a67293c72&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/contact-form-multi/download/?k=83cdd9e72a9f4061122ad28a67293c72&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Contact+Form+Multi+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => '', 'pro_version' => 'contact-form-multi-pro/contact-form-multi-pro.php', 'purchase' => 'http://bestwebsoft.com/products/contact-form-multi/buy/?k=fde3a18581c143654f060c398b07e8ac&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => ''), 'bws-google-maps/bws-google-maps.php' => array('name' => 'Google Maps by BestWebSoft', 'description' => 'Easy to set up and insert Google Maps to your website.', 'link' => 'http://bestwebsoft.com/products/bws-google-maps/?k=d8fac412d7359ebaa4ff53b46572f9f7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/bws-google-maps/download/?k=d8fac412d7359ebaa4ff53b46572f9f7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Google+Maps+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=bws-google-maps.php', 'pro_version' => 'bws-google-maps-pro/bws-google-maps-pro.php', 'purchase' => 'http://bestwebsoft.com/products/bws-google-maps/buy/?k=117c3f9fc17f2c83ef430a8a9dc06f56&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=bws-google-maps-pro.php'), 'bws-google-analytics/bws-google-analytics.php' => array('name' => 'Google Analytics by BestWebSoft', 'description' => 'Allows you to retrieve basic stats from Google Analytics account and add the tracking code to your blog.', 'link' => 'http://bestwebsoft.com/products/bws-google-analytics/?k=261c74cad753fb279cdf5a5db63fbd43&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/bws-google-analytics/download/?k=261c74cad753fb279cdf5a5db63fbd43&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Google+Analytics+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=bws-google-analytics.php', 'pro_version' => 'bws-google-analytics-pro/bws-google-analytics-pro.php', 'purchase' => 'http://bestwebsoft.com/products/bws-google-analytics/buy/?k=83796e84fec3f70ecfcc8894a73a6c4a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=bws-google-analytics-pro.php'), 'db-manager/db-manager.php' => array('name' => 'DB manager', 'description' => 'Allows you to download the latest version of PhpMyadmin and Dumper and manage your site.', 'link' => 'http://bestwebsoft.com/products/db-manager/?k=01ed9731780d87f85f5901064b7d76d8&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/db-manager/download/?k=01ed9731780d87f85f5901064b7d76d8&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => 'http://bestwebsoft.com/products/db-manager/download/?k=01ed9731780d87f85f5901064b7d76d8&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'settings' => 'admin.php?page=db-manager.php'), 'user-role/user-role.php' => array('name' => 'User Role', 'description' => 'Allows to change wordpress user role capabilities.', 'link' => 'http://bestwebsoft.com/products/user-role/?k=dfe2244835c6fbf601523964b3f34ccc&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/user-role/download/?k=dfe2244835c6fbf601523964b3f34ccc&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=User+Role+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=user-role.php', 'pro_version' => 'user-role-pro/user-role-pro.php', 'purchase' => 'http://bestwebsoft.com/products/user-role/buy/?k=cfa9cea6613fb3d7c0a3622fa2faaf46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=user-role-pro.php'), 'email-queue/email-queue.php' => array('name' => 'Email Queue', 'description' => 'Allows to manage email massages sent by BestWebSoft plugins.', 'link' => 'http://bestwebsoft.com/products/email-queue/?k=e345e1b6623f0dca119bc2d9433b130b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/email-queue/download/?k=e345e1b6623f0dca119bc2d9433b130b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Email+Queue+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=mlq_settings'), 'limit-attempts/limit-attempts.php' => array('name' => 'Limit Attempts', 'description' => 'Allows you to limit rate of login attempts by the ip, and create whitelist and blacklist.', 'link' => 'http://bestwebsoft.com/products/limit-attempts/?k=b14e1697ee4d008abcd4bd34d492573a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/limit-attempts/download/?k=b14e1697ee4d008abcd4bd34d492573a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&s=Limit+Attempts+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=limit-attempts.php', 'pro_version' => 'limit-attempts-pro/limit-attempts-pro.php', 'purchase' => 'http://bestwebsoft.com/products/limit-attempts/buy/?k=9d42cdf22c7fce2c4b6b447e6a2856e0&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=limit-attempts-pro.php'), 'job-board/job-board.php' => array('name' => 'Job board', 'description' => 'Allows to create a job-board page on your site.', 'link' => 'http://bestwebsoft.com/products/job-board/?k=b0c504c9ce6edd6692e04222af3fed6f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/job-board/download/?k=b0c504c9ce6edd6692e04222af3fed6f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Job+board+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=job-board.php'), 'multilanguage/multilanguage.php' => array('name' => 'Multilanguage', 'description' => 'Allows to create content on a Wordpress site in different languages.', 'link' => 'http://bestwebsoft.com/products/multilanguage/?k=7d68c7bfec2486dc350c67fff57ad433&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/multilanguage/download/?k=7d68c7bfec2486dc350c67fff57ad433&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Multilanguage+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=mltlngg_settings'), 'bws-popular-posts/bws-popular-posts.php' => array('name' => 'Popular Posts by BestWebSoft', 'description' => 'This plugin will help you can display the most popular posts on your blog in the widget.', 'link' => 'http://bestwebsoft.com/products/popular-posts/?k=4d529f116d2b7f7df3a78018c383f975&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/popular-posts/download/?k=4d529f116d2b7f7df3a78018c383f975&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Popular+Posts+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=popular-posts.php'), 'bws-testimonials/bws-testimonials.php' => array('name' => 'Testimonials by BestWebSoft', 'description' => 'Allows creating and displaying a Testimonial on your website.', 'link' => 'http://bestwebsoft.com/products/testimonials/?k=3fe4bb89dc901c98e43a113e08f8db73&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/testimonials/download/?k=3fe4bb89dc901c98e43a113e08f8db73&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Testimonials+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=testimonials.php'), 'bws-featured-posts/bws-featured-posts.php' => array('name' => 'Featured Posts by BestWebSoft', 'description' => 'Displays featured posts randomly on any website page.', 'link' => 'http://bestwebsoft.com/products/featured-posts/?k=f0afb31185ba7c7d6d598528d69f6d97&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/featured-posts/download/?k=f0afb31185ba7c7d6d598528d69f6d97&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Featured+Posts+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=featured-posts.php'), 'gallery-categories/gallery-categories.php' => array('name' => 'Gallery Categories', 'description' => 'Add-on for Gallery Plugin by BestWebSoft', 'link' => 'http://bestwebsoft.com/products/gallery-categories/?k=7d68c7bfec2486dc350c67fff57ad433&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/gallery-categories/download/?k=7d68c7bfec2486dc350c67fff57ad433&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Gallery+Categories+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => ''), 're-attacher/re-attacher.php' => array('name' => 'Re-attacher', 'description' => 'This plugin allows to attach, unattach or reattach media item in different post.', 'link' => 'http://bestwebsoft.com/products/re-attacher/?k=4d529f116d2b7f7df3a78018c383f975&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/re-attacher/download/?k=4d529f116d2b7f7df3a78018c383f975&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Re-attacher+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=re-attacher.php'), 'bws-smtp/bws-smtp.php' => array('name' => 'SMTP by BesWebSoft', 'description' => 'This plugin introduces an easy way to configure sending email messages via SMTP.', 'link' => 'http://bestwebsoft.com/products/bws-smtp/?k=0546419f962704429ad2d9b88567752f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/bws-smtp/download/?k=0546419f962704429ad2d9b88567752f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=SMTP+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=bwssmtp_settings'), 'promobar/promobar.php' => array('name' => 'PromoBar', 'description' => 'This plugin allows placing banners with any data on your website.', 'link' => 'http://bestwebsoft.com/products/promobar/?k=619eac2232d9cfa382c4e678c3b14766&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/promobar/download/?k=619eac2232d9cfa382c4e678c3b14766&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=PromoBar+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=promobar.php', 'pro_version' => 'promobar-pro/promobar-pro.php', 'purchase' => 'http://bestwebsoft.com/products/promobar/buy/?k=a9b09708502f12a1483532ba12fe2103&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=promobar-pro.php'), 'realty/realty.php' => array('name' => 'Realty', 'description' => 'A convenient plugin that adds Real Estate functionality.', 'link' => 'http://bestwebsoft.com/products/realty/?k=d55de979dbbbb7af0b2ff1d7f43884fa&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/realty/download/?k=d55de979dbbbb7af0b2ff1d7f43884fa&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Realty+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=realty_settings', 'pro_version' => 'realty-pro/realty-pro.php', 'purchase' => 'http://bestwebsoft.com/products/realty/buy/?k=c7791f0a72acfb36f564a614dbccb474&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=realty_pro_settings'), 'zendesk-help-center/zendesk-help-center.php' => array('name' => 'Zendesk Help Center Backup', 'description' => 'This plugin allows to backup Zendesk Help Center.', 'link' => 'http://bestwebsoft.com/products/zendesk-help-center/?k=2a5fd2f4b2f4bde46f2ca44b8d15846d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/zendesk-help-center/download/?k=2a5fd2f4b2f4bde46f2ca44b8d15846d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Zendesk+Help+Center+Backup+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=zendesk_hc.php&tab=settings'), 'social-buttons-pack/social-buttons-pack.php' => array('name' => 'Social Buttons Pack', 'description' => 'Add Social buttons to your WordPress website.', 'link' => 'http://bestwebsoft.com/products/social-buttons-pack/?k=b6440fad9f54274429e536b0c61b42da&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/social-buttons-pack/download/?k=b6440fad9f54274429e536b0c61b42da&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Social+Buttons+Pack+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=social-buttons.php'), 'pagination/pagination.php' => array('name' => 'Pagination', 'description' => 'Add pagination block to your WordPress website.', 'link' => 'http://bestwebsoft.com/products/pagination/?k=22adb940256f149559ba8fedcd728ac8&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/pagination/download/?k=22adb940256f149559ba8fedcd728ac8&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Pagination+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=pagination.php'), 'visitors-online/visitors-online.php' => array('name' => 'Visitors online', 'description' => 'See how many users, guests and bots are online at the website.', 'link' => 'http://bestwebsoft.com/products/visitors-online/?k=93c28013a4f830671b3bba9502ed5177&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/products/visitors-online/download/?k=93c28013a4f830671b3bba9502ed5177&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'wp_install' => $admin_url . 'plugin-install.php?tab=search&type=term&s=Visitors+online+BestWebSoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=visitors-online.php', 'pro_version' => 'visitors-online-pro/visitors-online-pro.php', 'purchase' => 'http://bestwebsoft.com/products/visitors-online/buy/?k=f9a746075ff8a0a6cb192cb46526afd2&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'pro_settings' => 'admin.php?page=visitors-online-pro.php'));
        $all_plugins = get_plugins();
        $active_plugins = get_option('active_plugins');
        $recommend_plugins = array_diff_key($bws_plugins, $all_plugins);
        $bws_plugins_pro = array();
        foreach ($bws_plugins as $key_plugin => $value_plugin) {
            if (!isset($all_plugins[$key_plugin]) && isset($bws_plugins[$key_plugin]['pro_version']) && isset($all_plugins[$bws_plugins[$key_plugin]['pro_version']])) {
                unset($recommend_plugins[$key_plugin]);
            }
        }
        foreach ($all_plugins as $key_plugin => $value_plugin) {
            if (isset($value_plugin['Author']) && $value_plugin['Author'] != "BestWebSoft") {
                unset($all_plugins[$key_plugin]);
            } elseif ('-plus.php' == substr($key_plugin, -9, 9)) {
                unset($all_plugins[$key_plugin]);
            } else {
                foreach ($bws_plugins as $key => $value) {
                    if (isset($value['pro_version']) && $value['pro_version'] == $key_plugin) {
                        $bws_plugins_pro[$key_plugin] = $key;
                        unset($all_plugins[$key]);
                    }
                }
            }
        }
        if (isset($_GET['action']) && 'system_status' == $_GET['action']) {
            $all_plugins = get_plugins();
            $active_plugins = get_option('active_plugins');
            $mysql_info = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
            if (is_array($mysql_info)) {
                $sql_mode = $mysql_info[0]->Value;
            }
            if (empty($sql_mode)) {
                $sql_mode = __('Not set', 'bestwebsoft');
            }
            $safe_mode = ini_get('safe_mode') ? __('On', 'bestwebsoft') : __('Off', 'bestwebsoft');
            $allow_url_fopen = ini_get('allow_url_fopen') ? __('On', 'bestwebsoft') : __('Off', 'bestwebsoft');
            $upload_max_filesize = ini_get('upload_max_filesize') ? ini_get('upload_max_filesize') : __('N/A', 'bestwebsoft');
            $post_max_size = ini_get('post_max_size') ? ini_get('post_max_size') : __('N/A', 'bestwebsoft');
            $max_execution_time = ini_get('max_execution_time') ? ini_get('max_execution_time') : __('N/A', 'bestwebsoft');
            $memory_limit = ini_get('memory_limit') ? ini_get('memory_limit') : __('N/A', 'bestwebsoft');
            $memory_usage = function_exists('memory_get_usage') ? round(memory_get_usage() / 1024 / 1024, 2) . __(' Mb', 'bestwebsoft') : __('N/A', 'bestwebsoft');
            $exif_read_data = is_callable('exif_read_data') ? __('Yes', 'bestwebsoft') . " ( V" . substr(phpversion('exif'), 0, 4) . ")" : __('No', 'bestwebsoft');
            $iptcparse = is_callable('iptcparse') ? __('Yes', 'bestwebsoft') : __('No', 'bestwebsoft');
            $xml_parser_create = is_callable('xml_parser_create') ? __('Yes', 'bestwebsoft') : __('No', 'bestwebsoft');
            $theme = function_exists('wp_get_theme') ? wp_get_theme() : get_theme(get_current_theme());
            if (function_exists('is_multisite')) {
                if (is_multisite()) {
                    $multisite = __('Yes', 'bestwebsoft');
                } else {
                    $multisite = __('No', 'bestwebsoft');
                }
            } else {
                $multisite = __('N/A', 'bestwebsoft');
            }
            $system_info = array('system_info' => '', 'active_plugins' => '', 'inactive_plugins' => '');
            $system_info['system_info'] = array(__('Operating System', 'bestwebsoft') => PHP_OS, __('Server', 'bestwebsoft') => $_SERVER["SERVER_SOFTWARE"], __('Memory usage', 'bestwebsoft') => $memory_usage, __('MYSQL Version', 'bestwebsoft') => $wpdb->get_var("SELECT VERSION() AS version"), __('SQL Mode', 'bestwebsoft') => $sql_mode, __('PHP Version', 'bestwebsoft') => PHP_VERSION, __('PHP Safe Mode', 'bestwebsoft') => $safe_mode, __('PHP Allow URL fopen', 'bestwebsoft') => $allow_url_fopen, __('PHP Memory Limit', 'bestwebsoft') => $memory_limit, __('PHP Max Upload Size', 'bestwebsoft') => $upload_max_filesize, __('PHP Max Post Size', 'bestwebsoft') => $post_max_size, __('PHP Max Script Execute Time', 'bestwebsoft') => $max_execution_time, __('PHP Exif support', 'bestwebsoft') => $exif_read_data, __('PHP IPTC support', 'bestwebsoft') => $iptcparse, __('PHP XML support', 'bestwebsoft') => $xml_parser_create, __('Site URL', 'bestwebsoft') => get_option('siteurl'), __('Home URL', 'bestwebsoft') => home_url(), '$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'], '$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'], __('WordPress Version', 'bestwebsoft') => $wp_version, __('WordPress DB Version', 'bestwebsoft') => get_option('db_version'), __('Multisite', 'bestwebsoft') => $multisite, __('Active Theme', 'bestwebsoft') => $theme['Name'] . ' ' . $theme['Version']);
            foreach ($all_plugins as $path => $plugin) {
                if (is_plugin_active($path)) {
                    $system_info['active_plugins'][$plugin['Name']] = $plugin['Version'];
                } else {
                    $system_info['inactive_plugins'][$plugin['Name']] = $plugin['Version'];
                }
            }
        }
        if (isset($_REQUEST['bwsmn_form_submit']) && check_admin_referer(plugin_basename(__FILE__), 'bwsmn_nonce_submit') || isset($_REQUEST['bwsmn_form_submit_custom_email']) && check_admin_referer(plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email')) {
            if (isset($_REQUEST['bwsmn_form_email'])) {
                $bwsmn_form_email = esc_html(trim($_REQUEST['bwsmn_form_email']));
                if ($bwsmn_form_email == "" || !is_email($bwsmn_form_email)) {
                    $error = __("Please enter a valid email address.", 'bestwebsoft');
                } else {
                    $email = $bwsmn_form_email;
                    $bwsmn_form_email = '';
                    $message = __('Email with system info is sent to ', 'bestwebsoft') . $email;
                }
            } else {
                $email = '*****@*****.**';
                $message = __('Thank you for contacting us.', 'bestwebsoft');
            }
            if ($error == '') {
                $headers = 'MIME-Version: 1.0' . "\n";
                $headers .= 'Content-type: text/html; charset=utf-8' . "\n";
                $headers .= 'From: ' . get_option('admin_email');
                $message_text = '<html><head><title>System Info From ' . home_url() . '</title></head><body>
				<h4>Environment</h4>
				<table>';
                foreach ($system_info['system_info'] as $key => $value) {
                    $message_text .= '<tr><td>' . $key . '</td><td>' . $value . '</td></tr>';
                }
                $message_text .= '</table>';
                if (!empty($system_info['active_plugins'])) {
                    $message_text .= '<h4>Active Plugins</h4>
					<table>';
                    foreach ($system_info['active_plugins'] as $key => $value) {
                        $message_text .= '<tr><td scope="row">' . $key . '</td><td scope="row">' . $value . '</td></tr>';
                    }
                    $message_text .= '</table>';
                }
                if (!empty($system_info['inactive_plugins'])) {
                    $message_text .= '<h4>Inactive Plugins</h4>
					<table>';
                    foreach ($system_info['inactive_plugins'] as $key => $value) {
                        $message_text .= '<tr><td scope="row">' . $key . '</td><td scope="row">' . $value . '</td></tr>';
                    }
                    $message_text .= '</table>';
                }
                $message_text .= '</body></html>';
                $result = wp_mail($email, 'System Info From ' . home_url(), $message_text, $headers);
                if ($result != true) {
                    $error = __("Sorry, email message could not be delivered.", 'bestwebsoft');
                }
            }
        }
        ?>
		<div class="wrap">
			<div class="icon32 icon32-bws" id="icon-options-general"></div>
			<h2>
				<span class="bws_main title">BestWebSoft</span>
				<ul class="subsubsub bws_title_menu">
					<li><a href="<?php 
        echo esc_url('http://support.bestwebsoft.com/home');
        ?>
" target="_blank"><?php 
        _e('Need help?', 'bestwebsoft');
        ?>
</a></li> |
					<li><a href="<?php 
        echo esc_url('http://bestwebsoft.com/wp-login.php');
        ?>
" target="_blank"><?php 
        _e('Client area', 'bestwebsoft');
        ?>
</a></li>
					<li><a class="bws_system_status <?php 
        if (isset($_GET['action']) && 'system_status' == $_GET['action']) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=bws_plugins&amp;action=system_status"><?php 
        _e('System status', 'bestwebsoft');
        ?>
</a></li>
				</ul>
				<div class="clear"></div>
			</h2>
			<h2 class="nav-tab-wrapper">
				<a class="nav-tab<?php 
        if (!isset($_GET['action'])) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=bws_plugins"><?php 
        _e('Plugins', 'bestwebsoft');
        ?>
</a>
				<?php 
        if ($wp_version >= '3.4') {
            ?>
					<a class="nav-tab<?php 
            if (isset($_GET['action']) && 'themes' == $_GET['action']) {
                echo ' nav-tab-active';
            }
            ?>
" href="admin.php?page=bws_plugins&amp;action=themes"><?php 
            _e('Themes', 'bestwebsoft');
            ?>
</a>
				<?php 
        }
        ?>
			</h2>
			<?php 
        if (!isset($_GET['action'])) {
            ?>
				<ul class="subsubsub">
					<li><a <?php 
            if (!isset($_GET['sub'])) {
                echo 'class="current" ';
            }
            ?>
href="admin.php?page=bws_plugins"><?php 
            _e('All', 'bestwebsoft');
            ?>
</a></li> |
					<li><a <?php 
            if (isset($_GET['sub']) && 'installed' == $_GET['sub']) {
                echo 'class="current" ';
            }
            ?>
href="admin.php?page=bws_plugins&amp;sub=installed"><?php 
            _e('Installed', 'bestwebsoft');
            ?>
</a></li> |
					<li><a <?php 
            if (isset($_GET['sub']) && 'recommended' == $_GET['sub']) {
                echo 'class="current" ';
            }
            ?>
href="admin.php?page=bws_plugins&amp;sub=recommended"><?php 
            _e('Recommended', 'bestwebsoft');
            ?>
</a></li>
				</ul>
				<div class="clear"></div>
				<?php 
            if (isset($_GET['sub']) && 'installed' == $_GET['sub'] || !isset($_GET['sub'])) {
                ?>
					<h4 class="bws_installed"><?php 
                _e('Installed plugins', 'bestwebsoft');
                ?>
</h4>
					<?php 
                foreach ($all_plugins as $key_plugin => $value_plugin) {
                    if (isset($bws_plugins_pro[$key_plugin])) {
                        $key_plugin = $bws_plugins_pro[$key_plugin];
                    }
                    if (isset($bws_plugins[$key_plugin])) {
                        $key_plugin_explode = explode('-plugin/', $key_plugin);
                        if (isset($key_plugin_explode[1])) {
                            $icon = $key_plugin_explode[0];
                        } else {
                            $key_plugin_explode = explode('/', $key_plugin);
                            $icon = $key_plugin_explode[0];
                        }
                    }
                    if (isset($bws_plugins[$key_plugin]['pro_version']) && (in_array($bws_plugins[$key_plugin]['pro_version'], $active_plugins) || is_plugin_active_for_network($bws_plugins[$key_plugin]['pro_version']))) {
                        ?>
							<div class="bws_product_box bws_exist_overlay">
								<div class="bws_product">
									<div class="bws_product_title"><?php 
                        echo $value_plugin["Name"];
                        ?>
</div>
									<div class="bws_product_content">
										<div class="bws_product_icon">
											<div class="bws_product_icon_pro">PRO</div>
											<img src="<?php 
                        echo plugins_url("icons/", __FILE__) . $icon . '.png';
                        ?>
"/>
										</div>
										<div class="bws_product_description"><?php 
                        echo $value_plugin["Description"];
                        ?>
</div>
									</div>
									<div class="clear"></div>
								</div>
								<div class="bws_product_links">
									<a href="<?php 
                        echo $bws_plugins[$key_plugin]["link"];
                        ?>
" target="_blank"><?php 
                        _e("Learn more", 'bestwebsoft');
                        ?>
</a>
									<?php 
                        if ('' != $bws_plugins[$key_plugin]["pro_settings"]) {
                            ?>
										<span> | </span>
										<a href="<?php 
                            echo $bws_plugins[$key_plugin]["pro_settings"];
                            ?>
" target="_blank"><?php 
                            _e("Settings", 'bestwebsoft');
                            ?>
</a>
									<?php 
                        }
                        ?>
								</div>
							</div>
						<?php 
                    } elseif (isset($bws_plugins[$key_plugin]) && (in_array($key_plugin, $active_plugins) || is_plugin_active_for_network($key_plugin))) {
                        if (isset($bws_plugins[$key_plugin]['pro_version']) && isset($all_plugins[$bws_plugins[$key_plugin]['pro_version']])) {
                            ?>
								<div class="bws_product_box bws_product_deactivated">
									<div class="bws_product">
										<div class="bws_product_title"><?php 
                            echo $value_plugin["Name"];
                            ?>
</div>
										<div class="bws_product_content">
											<div class="bws_product_icon">
												<div class="bws_product_icon_pro">PRO</div>
												<img src="<?php 
                            echo plugins_url("icons/", __FILE__) . $icon . '.png';
                            ?>
"/>
											</div>
											<div class="bws_product_description"><?php 
                            echo $bws_plugins[$key_plugin]["description"];
                            ?>
</div>
										</div>
										<div class="clear"></div>
									</div>
									<div class="bws_product_links">
										<a href="<?php 
                            echo $bws_plugins[$key_plugin]["link"];
                            ?>
" target="_blank"><?php 
                            _e("Learn more", 'bestwebsoft');
                            ?>
</a>
										<span> | </span>
										<a class="bws_activate" href="plugins.php" title="<?php 
                            _e("Activate this plugin", 'bestwebsoft');
                            ?>
" target="_blank"><?php 
                            _e("Activate", 'bestwebsoft');
                            ?>
</a>
									</div>
								</div>
							<?php 
                        } else {
                            ?>
								<div class="bws_product_box bws_product_free">
									<div class="bws_product">
										<div class="bws_product_title"><?php 
                            echo $value_plugin["Name"];
                            ?>
</div>
										<div class="bws_product_content">
											<div class="bws_product_icon">
												<img src="<?php 
                            echo plugins_url("icons/", __FILE__) . $icon . '.png';
                            ?>
"/>
											</div>
											<div class="bws_product_description"><?php 
                            echo $bws_plugins[$key_plugin]["description"];
                            ?>
</div>
										</div>
										<?php 
                            if (isset($bws_plugins[$key_plugin]["purchase"])) {
                                ?>
											<a class="bws_product_button" href="<?php 
                                echo $bws_plugins[$key_plugin]["purchase"];
                                ?>
" target="_blank">
												<?php 
                                _e('Go', 'bestwebsoft');
                                ?>
 <strong>PRO</strong>
											</a>
										<?php 
                            } else {
                                ?>
											<a class="bws_product_button bws_donate_button" href="<?php 
                                echo $bws_donate_link;
                                ?>
" target="_blank">
												<strong><?php 
                                _e('DONATE', 'bestwebsoft');
                                ?>
</strong>
											</a>
										<?php 
                            }
                            ?>
										<div class="clear"></div>
									</div>
									<div class="bws_product_links">
										<a href="<?php 
                            echo $bws_plugins[$key_plugin]["link"];
                            ?>
" target="_blank"><?php 
                            _e("Learn more", 'bestwebsoft');
                            ?>
</a>
										<?php 
                            if ('' != $bws_plugins[$key_plugin]["settings"]) {
                                ?>
											<span> | </span>
											<a href="<?php 
                                echo $bws_plugins[$key_plugin]["settings"];
                                ?>
" target="_blank"><?php 
                                _e("Settings", 'bestwebsoft');
                                ?>
</a>
										<?php 
                            }
                            ?>
									</div>
								</div>
							<?php 
                        }
                    } elseif (isset($bws_plugins[$key_plugin])) {
                        ?>
							<div class="bws_product_box bws_product_deactivated bws_product_free">
								<div class="bws_product">
									<div class="bws_product_title"><?php 
                        echo $value_plugin["Name"];
                        ?>
</div>
									<div class="bws_product_content">
										<div class="bws_product_icon">
											<img src="<?php 
                        echo plugins_url("icons/", __FILE__) . $icon . '.png';
                        ?>
"/>
										</div>
										<div class="bws_product_description"><?php 
                        echo $bws_plugins[$key_plugin]["description"];
                        ?>
</div>
									</div>
									<?php 
                        if (isset($bws_plugins[$key_plugin]["purchase"])) {
                            ?>
										<a class="bws_product_button" href="<?php 
                            echo $bws_plugins[$key_plugin]["purchase"];
                            ?>
" target="_blank">
											<?php 
                            _e('Go', 'bestwebsoft');
                            ?>
 <strong>PRO</strong>
										</a>
									<?php 
                        } else {
                            ?>
										<a class="bws_product_button bws_donate_button" href="<?php 
                            echo $bws_donate_link;
                            ?>
" target="_blank">
											<strong><?php 
                            _e('DONATE', 'bestwebsoft');
                            ?>
</strong>
										</a>
									<?php 
                        }
                        ?>
									<div class="clear"></div>
								</div>
								<div class="bws_product_links">
									<a href="<?php 
                        echo $bws_plugins[$key_plugin]["link"];
                        ?>
" target="_blank"><?php 
                        _e("Learn more", 'bestwebsoft');
                        ?>
</a>
									<span> | </span>
									<a class="bws_activate" href="plugins.php" title="<?php 
                        _e("Activate this plugin", 'bestwebsoft');
                        ?>
" target="_blank"><?php 
                        _e("Activate", 'bestwebsoft');
                        ?>
</a>
								</div>
							</div>
						<?php 
                    }
                }
            }
            ?>
				<div class="clear"></div>
				<?php 
            if (isset($_GET['sub']) && 'recommended' == $_GET['sub'] || !isset($_GET['sub'])) {
                ?>
					<h4 class="bws_recommended"><?php 
                _e('Recommended plugins', 'bestwebsoft');
                ?>
</h4>
					<?php 
                foreach ($recommend_plugins as $key_plugin => $value_plugin) {
                    if (isset($bws_plugins[$key_plugin])) {
                        $key_plugin_explode = explode('-plugin/', $key_plugin);
                        if (isset($key_plugin_explode[1])) {
                            $icon = $key_plugin_explode[0];
                        } else {
                            $key_plugin_explode = explode('/', $key_plugin);
                            $icon = $key_plugin_explode[0];
                        }
                    }
                    ?>
						<div class="bws_product_box">
							<div class="bws_product">
								<div class="bws_product_title"><?php 
                    echo $value_plugin["name"];
                    ?>
</div>
								<div class="bws_product_content">
									<div class="bws_product_icon">
										<?php 
                    if (isset($bws_plugins[$key_plugin]['pro_version'])) {
                        ?>
											<div class="bws_product_icon_pro">PRO</div>
										<?php 
                    }
                    ?>
										<img src="<?php 
                    echo plugins_url("icons/", __FILE__) . $icon . '.png';
                    ?>
"/>
									</div>
									<div class="bws_product_description"><?php 
                    echo $bws_plugins[$key_plugin]["description"];
                    ?>
</div>
								</div>
								<?php 
                    if (isset($bws_plugins[$key_plugin]["pro_version"])) {
                        ?>
									<a class="bws_product_button" href="<?php 
                        echo $bws_plugins[$key_plugin]["purchase"];
                        ?>
" target="_blank">
										<?php 
                        _e('Go', 'bestwebsoft');
                        ?>
 <strong>PRO</strong>
									</a>
								<?php 
                    } else {
                        ?>
									<a class="bws_product_button bws_donate_button" href="<?php 
                        echo $bws_donate_link;
                        ?>
" target="_blank">
										<strong><?php 
                        _e('DONATE', 'bestwebsoft');
                        ?>
</strong>
									</a>
								<?php 
                    }
                    ?>
							</div>
							<div class="clear"></div>
							<div class="bws_product_links">
								<a href="<?php 
                    echo $bws_plugins[$key_plugin]["link"];
                    ?>
" target="_blank"><?php 
                    _e("Learn more", 'bestwebsoft');
                    ?>
</a>
								<span> | </span>
								<a href="<?php 
                    echo $bws_plugins[$key_plugin]["wp_install"];
                    ?>
" target="_blank"><?php 
                    _e("Install now", 'bestwebsoft');
                    ?>
</a>
							</div>
						</div>
					<?php 
                }
            }
            ?>
			<?php 
        } elseif ('themes' == $_GET['action']) {
            ?>
				<div id="availablethemes">
					<?php 
            global $tabs, $tab, $paged, $type, $theme_field_defaults;
            include ABSPATH . 'wp-admin/includes/theme-install.php';
            include ABSPATH . 'wp-admin/includes/class-wp-themes-list-table.php';
            include ABSPATH . 'wp-admin/includes/class-wp-theme-install-list-table.php';
            $theme_class = new WP_Theme_Install_List_Table();
            $paged = $theme_class->get_pagenum();
            $per_page = 36;
            $args = array('page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults);
            $args['author'] = 'bestwebsoft';
            $args = apply_filters('install_themes_table_api_args_search', $args);
            $api = themes_api('query_themes', $args);
            if (is_wp_error($api)) {
                wp_die($api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __('Try again', 'bestwebsoft') . '</a>');
            }
            $theme_class->items = $api->themes;
            $theme_class->set_pagination_args(array('total_items' => $api->info['results'], 'per_page' => $per_page, 'infinite_scroll' => true));
            $themes = $theme_class->items;
            if ($wp_version < '3.9') {
                foreach ($themes as $theme) {
                    ?>
							<div class="available-theme installable-theme"><?php 
                    global $themes_allowedtags;
                    if (empty($theme)) {
                        return;
                    }
                    $name = wp_kses($theme->name, $themes_allowedtags);
                    $author = wp_kses($theme->author, $themes_allowedtags);
                    $preview_title = sprintf(__('Preview &#8220;%s&#8221;', 'bestwebsoft'), $name);
                    $preview_url = add_query_arg(array('tab' => 'theme-information', 'theme' => $theme->slug), self_admin_url('theme-install.php'));
                    $actions = array();
                    $install_url = add_query_arg(array('action' => 'install-theme', 'theme' => $theme->slug), self_admin_url('update.php'));
                    $update_url = add_query_arg(array('action' => 'upgrade-theme', 'theme' => $theme->slug), self_admin_url('update.php'));
                    $status = 'install';
                    $installed_theme = wp_get_theme($theme->slug);
                    if ($installed_theme->exists()) {
                        if (version_compare($installed_theme->get('Version'), $theme->version, '=')) {
                            $status = 'latest_installed';
                        } elseif (version_compare($installed_theme->get('Version'), $theme->version, '>')) {
                            $status = 'newer_installed';
                        } else {
                            $status = 'update_available';
                        }
                    }
                    switch ($status) {
                        default:
                        case 'install':
                            $actions[] = '<a class="install-now" href="' . esc_url(wp_nonce_url($install_url, 'install-theme_' . $theme->slug)) . '" title="' . esc_attr(sprintf(__('Install %s', 'bestwebsoft'), $name)) . '">' . __('Install Now', 'bestwebsoft') . '</a>';
                            break;
                        case 'update_available':
                            $actions[] = '<a class="install-now" href="' . esc_url(wp_nonce_url($update_url, 'upgrade-theme_' . $theme->slug)) . '" title="' . esc_attr(sprintf(__('Update to version %s', 'bestwebsoft'), $theme->version)) . '">' . __('Update', 'bestwebsoft') . '</a>';
                            break;
                        case 'newer_installed':
                        case 'latest_installed':
                            $actions[] = '<span class="install-now" title="' . esc_attr__('This theme is already installed and is up to date') . '">' . _x('Installed', 'theme', 'bestwebsoft') . '</span>';
                            break;
                    }
                    $actions[] = '<a class="install-theme-preview" href="' . esc_url($preview_url) . '" title="' . esc_attr(sprintf(__('Preview %s', 'bestwebsoft'), $name)) . '">' . __('Preview', 'bestwebsoft') . '</a>';
                    $actions = apply_filters('theme_install_actions', $actions, $theme);
                    ?>
								<a class="screenshot install-theme-preview" href="<?php 
                    echo esc_url($preview_url);
                    ?>
" title="<?php 
                    echo esc_attr($preview_title);
                    ?>
">
									<img src='<?php 
                    echo esc_url($theme->screenshot_url);
                    ?>
' width='150' />
								</a>
								<h3><?php 
                    echo $name;
                    ?>
</h3>
								<div class="theme-author"><?php 
                    printf(__('By %s', 'bestwebsoft'), $author);
                    ?>
</div>
								<div class="action-links">
									<ul>
										<?php 
                    foreach ($actions as $action) {
                        ?>
											<li><?php 
                        echo $action;
                        ?>
</li>
										<?php 
                    }
                    ?>
										<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php 
                    _e('Details', 'bestwebsoft');
                    ?>
</a></li>
									</ul>
								</div>
								<?php 
                    $theme_class->install_theme_info($theme);
                    ?>
							</div>
						<?php 
                }
                // end foreach $theme_names
                $theme_class->theme_installer();
            } else {
                ?>
						<div class="theme-browser">
							<div class="themes">
						<?php 
                foreach ($themes as $key => $theme) {
                    $installed_theme = wp_get_theme($theme->slug);
                    if ($installed_theme->exists()) {
                        $theme->installed = true;
                    } else {
                        $theme->installed = false;
                    }
                    ?>
							<div class="theme" tabindex="0">
								<?php 
                    if ($theme->screenshot_url) {
                        ?>
									<div class="theme-screenshot">
										<img src="<?php 
                        echo $theme->screenshot_url;
                        ?>
" alt="" />
									</div>
								<?php 
                    } else {
                        ?>
									<div class="theme-screenshot blank"></div>
								<?php 
                    }
                    ?>
								<div class="theme-author"><?php 
                    printf(__('By %s', 'bestwebsoft'), $theme->author);
                    ?>
</div>
								<h3 class="theme-name"><?php 
                    echo $theme->name;
                    ?>
</h3>
								<div class="theme-actions">
									<a class="button button-secondary preview install-theme-preview" href="theme-install.php?theme=<?php 
                    echo $theme->slug;
                    ?>
"><?php 
                    esc_html_e('Learn More', 'bestwebsoft');
                    ?>
</a>
								</div>
								<?php 
                    if ($theme->installed) {
                        ?>
									<div class="theme-installed"><?php 
                        _e('Already Installed', 'bestwebsoft');
                        ?>
</div>
								<?php 
                    }
                    ?>
							</div>
						<?php 
                }
                ?>
							<br class="clear" />
							</div>
						</div>
						<div class="theme-overlay"></div>
					<?php 
            }
            ?>
				</div>
			<?php 
        } elseif ('system_status' == $_GET['action']) {
            ?>
				<div class="updated fade" <?php 
            if (!(isset($_REQUEST['bwsmn_form_submit']) || isset($_REQUEST['bwsmn_form_submit_custom_email'])) || $error != "") {
                echo "style=\"display:none\"";
            }
            ?>
><p><strong><?php 
            echo $message;
            ?>
</strong></p></div>
				<div class="error" <?php 
            if ("" == $error) {
                echo "style=\"display:none\"";
            }
            ?>
><p><strong><?php 
            echo $error;
            ?>
</strong></p></div>
				<h3><?php 
            _e('System status', 'bestwebsoft');
            ?>
</h3>
				<div class="inside">
					<table class="bws_system_info">
						<thead><tr><th><?php 
            _e('Environment', 'bestwebsoft');
            ?>
</th><td></td></tr></thead>
						<tbody>
						<?php 
            foreach ($system_info['system_info'] as $key => $value) {
                ?>
							<tr>
								<td scope="row"><?php 
                echo $key;
                ?>
</td>
								<td scope="row"><?php 
                echo $value;
                ?>
</td>
							</tr>
						<?php 
            }
            ?>
						</tbody>
					</table>
					<table class="bws_system_info">
						<thead><tr><th><?php 
            _e('Active Plugins', 'bestwebsoft');
            ?>
</th><th></th></tr></thead>
						<tbody>
						<?php 
            if (!empty($system_info['active_plugins'])) {
                foreach ($system_info['active_plugins'] as $key => $value) {
                    ?>
								<tr>
									<td scope="row"><?php 
                    echo $key;
                    ?>
</td>
									<td scope="row"><?php 
                    echo $value;
                    ?>
</td>
								</tr>
							<?php 
                }
            }
            ?>
						</tbody>
					</table>
					<table class="bws_system_info">
						<thead><tr><th><?php 
            _e('Inactive Plugins', 'bestwebsoft');
            ?>
</th><th></th></tr></thead>
						<tbody>
						<?php 
            if (!empty($system_info['inactive_plugins'])) {
                foreach ($system_info['inactive_plugins'] as $key => $value) {
                    ?>
								<tr>
									<td scope="row"><?php 
                    echo $key;
                    ?>
</td>
									<td scope="row"><?php 
                    echo $value;
                    ?>
</td>
								</tr>
							<?php 
                }
            }
            ?>
						</tbody>
					</table>
					<div class="clear"></div>
					<form method="post" action="admin.php?page=bws_plugins&amp;action=system_status">
						<p>
							<input type="hidden" name="bwsmn_form_submit" value="submit" />
							<input type="submit" class="button-primary" value="<?php 
            _e('Send to support', 'bestwebsoft');
            ?>
" />
							<?php 
            wp_nonce_field(plugin_basename(__FILE__), 'bwsmn_nonce_submit');
            ?>
						</p>
					</form>
					<form method="post" action="admin.php?page=bws_plugins&amp;action=system_status">
						<p>
							<input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />
							<input type="submit" class="button" value="<?php 
            _e('Send to custom email &#187;', 'bestwebsoft');
            ?>
" />
							<input type="text" maxlength="250" value="<?php 
            echo $bwsmn_form_email;
            ?>
" name="bwsmn_form_email" />
							<?php 
            wp_nonce_field(plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email');
            ?>
						</p>
					</form>
				</div>
			<?php 
        }
        ?>
		</div>
	<?php 
    }
/**
 * Display theme information in dialog box form.
 *
 * @since 2.8.0
 */
function install_theme_information()
{
    //TODO: This function needs a LOT of UI work :)
    global $tab, $themes_allowedtags;
    $api = themes_api('theme_information', array('slug' => stripslashes($_REQUEST['theme'])));
    if (is_wp_error($api)) {
        wp_die($api);
    }
    // Sanitize HTML
    foreach ((array) $api->sections as $section_name => $content) {
        $api->sections[$section_name] = wp_kses($content, $themes_allowedtags);
    }
    foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) {
        if (isset($api->{$key})) {
            $api->{$key} = wp_kses($api->{$key}, $themes_allowedtags);
        }
    }
    iframe_header(__('Theme Install'));
    if (empty($api->download_link)) {
        echo '<div id="message" class="error"><p>' . __('<strong>ERROR:</strong> This theme is currently not available. Please try again later.') . '</p></div>';
        iframe_footer();
        exit;
    }
    if (!empty($api->tested) && version_compare($GLOBALS['wp_version'], $api->tested, '>')) {
        echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
    } else {
        if (!empty($api->requires) && version_compare($GLOBALS['wp_version'], $api->requires, '<')) {
            echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of WordPress.') . '</p></div>';
        }
    }
    // Default to a "new" theme
    $type = 'install';
    // Check to see if this theme is known to be installed, and has an update awaiting it.
    $update_themes = get_site_transient('update_themes');
    if (is_object($update_themes) && isset($update_themes->response)) {
        foreach ((array) $update_themes->response as $theme_slug => $theme_info) {
            if ($theme_slug === $api->slug) {
                $type = 'update_available';
                $update_file = $theme_slug;
                break;
            }
        }
    }
    $themes = get_themes();
    foreach ((array) $themes as $this_theme) {
        if (is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug) {
            if ($this_theme['Version'] == $api->version) {
                $type = 'latest_installed';
            } elseif ($this_theme['Version'] > $api->version) {
                $type = 'newer_installed';
                $newer_version = $this_theme['Version'];
            }
            break;
        }
    }
    ?>

<div class='available-theme'>
<img src='<?php 
    echo esc_url($api->screenshot_url);
    ?>
' width='300' class="theme-preview-img" />
<h3><?php 
    echo $api->name;
    ?>
</h3>
<p><?php 
    printf(__('by %s'), $api->author);
    ?>
</p>
<p><?php 
    printf(__('Version: %s'), $api->version);
    ?>
</p>

<?php 
    $buttons = '<a class="button" id="cancel" href="#" onclick="tb_close();return false;">' . __('Cancel') . '</a> ';
    switch ($type) {
        default:
        case 'install':
            if (current_user_can('install_themes')) {
                $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
            }
            break;
        case 'update_available':
            if (current_user_can('update_themes')) {
                $buttons .= '<a class="button-primary" id="install"	href="' . wp_nonce_url(self_admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
            }
            break;
        case 'newer_installed':
            if (current_user_can('install_themes') || current_user_can('update_themes')) {
                ?>
<p><?php 
                printf(__('Newer version (%s) is installed.'), $newer_version);
                ?>
</p><?php 
            }
            break;
        case 'latest_installed':
            if (current_user_can('install_themes') || current_user_can('update_themes')) {
                ?>
<p><?php 
                _e('This version is already installed.');
                ?>
</p><?php 
            }
            break;
    }
    ?>
<br class="clear" />
</div>

<p class="action-button">
<?php 
    echo $buttons;
    ?>
<br class="clear" />
</p>

<?php 
    iframe_footer();
    exit;
}
 public function prepare_items()
 {
     include ABSPATH . 'wp-admin/includes/theme-install.php';
     global $tabs, $tab, $paged, $type, $theme_field_defaults;
     wp_reset_vars(array('tab'));
     $search_terms = array();
     $search_string = '';
     if (!empty($_REQUEST['s'])) {
         $search_string = strtolower(wp_unslash($_REQUEST['s']));
         $search_terms = array_unique(array_filter(array_map('trim', explode(',', $search_string))));
     }
     if (!empty($_REQUEST['features'])) {
         $this->features = $_REQUEST['features'];
     }
     $paged = $this->get_pagenum();
     $per_page = 36;
     // These are the tabs which are shown on the page,
     $tabs = array();
     $tabs['dashboard'] = __('Search');
     if ('search' == $tab) {
         $tabs['search'] = __('Search Results');
     }
     $tabs['upload'] = __('Upload');
     $tabs['featured'] = _x('Featured', 'themes');
     //$tabs['popular']  = _x( 'Popular', 'themes' );
     $tabs['new'] = _x('Latest', 'themes');
     $tabs['updated'] = _x('Recently Updated', 'themes');
     $nonmenu_tabs = array('theme-information');
     // Valid actions to perform which do not have a Menu item.
     /** This filter is documented in wp-admin/theme-install.php */
     $tabs = apply_filters('install_themes_tabs', $tabs);
     /**
      * Filter tabs not associated with a menu item on the Install Themes screen.
      *
      * @since 2.8.0
      *
      * @param array $nonmenu_tabs The tabs that don't have a menu item on
      *                            the Install Themes screen.
      */
     $nonmenu_tabs = apply_filters('install_themes_nonmenu_tabs', $nonmenu_tabs);
     // If a non-valid menu tab has been selected, And it's not a non-menu action.
     if (empty($tab) || !isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs)) {
         $tab = key($tabs);
     }
     $args = array('page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults);
     switch ($tab) {
         case 'search':
             $type = isset($_REQUEST['type']) ? wp_unslash($_REQUEST['type']) : 'term';
             switch ($type) {
                 case 'tag':
                     $args['tag'] = array_map('sanitize_key', $search_terms);
                     break;
                 case 'term':
                     $args['search'] = $search_string;
                     break;
                 case 'author':
                     $args['author'] = $search_string;
                     break;
             }
             if (!empty($this->features)) {
                 $args['tag'] = $this->features;
                 $_REQUEST['s'] = implode(',', $this->features);
                 $_REQUEST['type'] = 'tag';
             }
             add_action('install_themes_table_header', 'install_theme_search_form', 10, 0);
             break;
         case 'featured':
             // case 'popular':
         // case 'popular':
         case 'new':
         case 'updated':
             $args['browse'] = $tab;
             break;
         default:
             $args = false;
             break;
     }
     /**
      * Filter API request arguments for each Install Themes screen tab.
      *
      * The dynamic portion of the hook name, `$tab`, refers to the theme install
      * tabs. Default tabs are 'dashboard', 'search', 'upload', 'featured',
      * 'new', and 'updated'.
      *
      * @since 3.7.0
      *
      * @param array $args An array of themes API arguments.
      */
     $args = apply_filters('install_themes_table_api_args_' . $tab, $args);
     if (!$args) {
         return;
     }
     $api = themes_api('query_themes', $args);
     if (is_wp_error($api)) {
         wp_die($api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
     }
     $this->items = $api->themes;
     $this->set_pagination_args(array('total_items' => $api->info['results'], 'per_page' => $args['per_page'], 'infinite_scroll' => true));
 }
Beispiel #18
0
/**
 * Display theme information in dialog box form.
 *
 * @since 2.8.0
 */
function install_theme_information()
{
    global $tab, $themes_allowedtags, $wp_list_table;
    $theme = themes_api('theme_information', array('slug' => stripslashes($_REQUEST['theme'])));
    if (is_wp_error($theme)) {
        wp_die($theme);
    }
    $wp_list_table->theme_installer_single($theme);
}
Beispiel #19
0
 function install($args)
 {
     $this->_escape($args);
     $username = $args[0];
     $password = $args[1];
     $theme = $args[2];
     $activate = (bool) $args[3];
     if ($password != get_option('wpr_cron')) {
         if (!($user = $this->login($username, $password))) {
             return $this->error;
         }
         if (!current_user_can('install_themes')) {
             return new IXR_Error(401, 'Sorry, you are not allowed to install themes on the remote blog.');
         }
     }
     ob_start();
     include_once ABSPATH . 'wp-admin/includes/theme-install.php';
     $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false)));
     if (is_wp_error($api)) {
         return new IXR_Error(401, 'Could not install theme. ' . $api->get_error_message());
     }
     $upgrader = new Wpr_Theme_Upgrader();
     $result = $upgrader->install($api->download_link);
     if (is_wp_error($result)) {
         return new IXR_Error(401, 'Theme could not be installed. ' . $result->get_error_message());
     }
     if ($activate && ($theme_info = $upgrader->theme_info())) {
         $stylesheet = $upgrader->result['destination_name'];
         $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
         $this->activate(array($username, $password, $template, $stylesheet));
     }
     ob_end_clean();
     return $this->get_list($args);
 }
 /**
  * Get latest version of a theme by slug.
  * @param  object $theme WP_Theme object.
  * @return string Version number if found.
  */
 public static function get_latest_theme_version($theme)
 {
     $api = themes_api('theme_information', array('slug' => $theme->get_stylesheet(), 'fields' => array('sections' => false, 'tags' => false)));
     $update_theme_version = 0;
     // Check .org for updates.
     if (is_object($api) && !is_wp_error($api)) {
         $update_theme_version = $api->version;
         // Check WooThemes Theme Version.
     } elseif (strstr($theme->{'Author URI'}, 'woothemes')) {
         $theme_dir = substr(strtolower(str_replace(' ', '', $theme->Name)), 0, 45);
         if (false === ($theme_version_data = get_transient($theme_dir . '_version_data'))) {
             $theme_changelog = wp_safe_remote_get('http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt');
             $cl_lines = explode("\n", wp_remote_retrieve_body($theme_changelog));
             if (!empty($cl_lines)) {
                 foreach ($cl_lines as $line_num => $cl_line) {
                     if (preg_match('/^[0-9]/', $cl_line)) {
                         $theme_date = str_replace('.', '-', trim(substr($cl_line, 0, strpos($cl_line, '-'))));
                         $theme_version = preg_replace('~[^0-9,.]~', '', stristr($cl_line, "version"));
                         $theme_update = trim(str_replace("*", "", $cl_lines[$line_num + 1]));
                         $theme_version_data = array('date' => $theme_date, 'version' => $theme_version, 'update' => $theme_update, 'changelog' => $theme_changelog);
                         set_transient($theme_dir . '_version_data', $theme_version_data, DAY_IN_SECONDS);
                         break;
                     }
                 }
             }
         }
         if (!empty($theme_version_data['version'])) {
             $update_theme_version = $theme_version_data['version'];
         }
     }
     return $update_theme_version;
 }
Beispiel #21
0
/**
 * Retrieve list of WordPress theme features (aka theme tags)
 *
 * @since 3.1.0
 *
 * @param bool $api Optional. Whether try to fetch tags from the WP.org API. Defaults to true.
 * @return array Array of features keyed by category with translations keyed by slug.
 */
function get_theme_feature_list($api = true)
{
    // Hard-coded list is used if api not accessible.
    $features = array(__('Colors') => array('black' => __('Black'), 'blue' => __('Blue'), 'brown' => __('Brown'), 'gray' => __('Gray'), 'green' => __('Green'), 'orange' => __('Orange'), 'pink' => __('Pink'), 'purple' => __('Purple'), 'red' => __('Red'), 'silver' => __('Silver'), 'tan' => __('Tan'), 'white' => __('White'), 'yellow' => __('Yellow'), 'dark' => __('Dark'), 'light' => __('Light')), __('Layout') => array('fixed-layout' => __('Fixed Layout'), 'fluid-layout' => __('Fluid Layout'), 'responsive-layout' => __('Responsive Layout'), 'one-column' => __('One Column'), 'two-columns' => __('Two Columns'), 'three-columns' => __('Three Columns'), 'four-columns' => __('Four Columns'), 'left-sidebar' => __('Left Sidebar'), 'right-sidebar' => __('Right Sidebar')), __('Features') => array('accessibility-ready' => __('Accessibility Ready'), 'blavatar' => __('Blavatar'), 'buddypress' => __('BuddyPress'), 'custom-background' => __('Custom Background'), 'custom-colors' => __('Custom Colors'), 'custom-header' => __('Custom Header'), 'custom-menu' => __('Custom Menu'), 'editor-style' => __('Editor Style'), 'featured-image-header' => __('Featured Image Header'), 'featured-images' => __('Featured Images'), 'flexible-header' => __('Flexible Header'), 'front-page-post-form' => __('Front Page Posting'), 'full-width-template' => __('Full Width Template'), 'microformats' => __('Microformats'), 'post-formats' => __('Post Formats'), 'rtl-language-support' => __('RTL Language Support'), 'sticky-post' => __('Sticky Post'), 'theme-options' => __('Theme Options'), 'threaded-comments' => __('Threaded Comments'), 'translation-ready' => __('Translation Ready')), __('Subject') => array('holiday' => __('Holiday'), 'photoblogging' => __('Photoblogging'), 'seasonal' => __('Seasonal')));
    if (!$api || !current_user_can('install_themes')) {
        return $features;
    }
    if (!($feature_list = get_site_transient('wporg_theme_feature_list'))) {
        set_site_transient('wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS);
    }
    if (!$feature_list) {
        $feature_list = themes_api('feature_list', array());
        if (is_wp_error($feature_list)) {
            return $features;
        }
    }
    if (!$feature_list) {
        return $features;
    }
    set_site_transient('wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS);
    $category_translations = array('Colors' => __('Colors'), 'Layout' => __('Layout'), 'Features' => __('Features'), 'Subject' => __('Subject'));
    // Loop over the wporg canonical list and apply translations
    $wporg_features = array();
    foreach ((array) $feature_list as $feature_category => $feature_items) {
        if (isset($category_translations[$feature_category])) {
            $feature_category = $category_translations[$feature_category];
        }
        $wporg_features[$feature_category] = array();
        foreach ($feature_items as $feature) {
            if (isset($features[$feature_category][$feature])) {
                $wporg_features[$feature_category][$feature] = $features[$feature_category][$feature];
            } else {
                $wporg_features[$feature_category][$feature] = $feature;
            }
        }
    }
    return $wporg_features;
}
</table>
<table class="wc_status_table widefat" cellspacing="0">
	<thead>
		<tr>
			<th colspan="3" data-export-label="Theme"><?php 
_e('Theme', 'woocommerce');
?>
</th>
		</tr>
	</thead>
		<?php 
include_once ABSPATH . 'wp-admin/includes/theme-install.php';
$active_theme = wp_get_theme();
$theme_version = $active_theme->Version;
$update_theme_version = $active_theme->Version;
$api = themes_api('theme_information', array('slug' => get_stylesheet(), 'fields' => array('sections' => false, 'tags' => false)));
// Check .org
if ($api && !is_wp_error($api)) {
    $update_theme_version = $api->version;
    // Check WooThemes Theme Version
} elseif (strstr($active_theme->{'Author URI'}, 'woothemes')) {
    $theme_dir = substr(strtolower(str_replace(' ', '', $active_theme->Name)), 0, 45);
    if (false === ($theme_version_data = get_transient($theme_dir . '_version_data'))) {
        $theme_changelog = wp_safe_remote_get('http://dzv365zjfbd8v.cloudfront.net/changelogs/' . $theme_dir . '/changelog.txt');
        $cl_lines = explode("\n", wp_remote_retrieve_body($theme_changelog));
        if (!empty($cl_lines)) {
            foreach ($cl_lines as $line_num => $cl_line) {
                if (preg_match('/^[0-9]/', $cl_line)) {
                    $theme_date = str_replace('.', '-', trim(substr($cl_line, 0, strpos($cl_line, '-'))));
                    $theme_version = preg_replace('~[^0-9,.]~', '', stristr($cl_line, "version"));
                    $theme_update = trim(str_replace("*", "", $cl_lines[$line_num + 1]));
    public static function wprc_install_theme_information()
    {
        global $tab, $themes_allowedtags, $wp_list_table, $wp_version;
        if (version_compare($wp_version, '3.4', '>=')) {
            $theme = themes_api('theme_information', array('slug' => stripslashes($_REQUEST['theme'])));
            if (is_wp_error($theme)) {
                wp_die($theme);
            }
            $wp_list_table = WPRC_Loader::getListTable('theme-install');
            iframe_header(__('Theme Install', 'installer'));
            $wp_list_table->theme_installer_single($theme);
            iframe_footer();
            exit;
        } else {
            $api = themes_api('theme_information', array('slug' => stripslashes($_REQUEST['theme'])));
            if (is_wp_error($api)) {
                wp_die($api);
            }
            // Sanitize HTML
            foreach ((array) $api->sections as $section_name => $content) {
                $api->sections[$section_name] = wp_kses($content, $themes_allowedtags);
            }
            foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) {
                if (isset($api->{$key})) {
                    $api->{$key} = wp_kses($api->{$key}, $themes_allowedtags);
                }
            }
            iframe_header(__('Theme Install', 'installer'));
            /*if ( empty($api->download_link) ) {
            			echo '<div id="message" class="error"><p>' . __('<strong>ERROR:</strong> This theme is currently not available. Please try again later.') . '</p></div>';
            			iframe_footer();
            			exit;
            		}*/
            if (!empty($api->tested) && version_compare($GLOBALS['wp_version'], $api->tested, '>')) {
                echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of WordPress.', 'installer') . '</p></div>';
            } else {
                if (!empty($api->requires) && version_compare($GLOBALS['wp_version'], $api->requires, '<')) {
                    echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of WordPress.', 'installer') . '</p></div>';
                }
            }
            // Default to a "new" theme
            $type = 'install';
            // Check to see if this theme is known to be installed, and has an update awaiting it.
            $update_themes = get_site_transient('update_themes');
            if (false != $update_themes && is_object($update_themes) && isset($update_themes->response)) {
                foreach ((array) $update_themes->response as $theme_slug => $theme_info) {
                    if ($theme_slug === $api->slug && $theme_info['new_version'] == $api->version && (isset($api->download_link) && !empty($api->download_link) || isset($api->package) && !empty($api->package))) {
                        if (isset($api->download_link) && !empty($api->download_link)) {
                            $update_themes->response[$theme_slug]['package'] = $api->download_link;
                            set_site_transient('update_themes', $update_themes);
                            $theme_info['package'] = $update_themes->response[$theme_slug]['package'];
                        } else {
                            if (isset($api->package) && !empty($api->package)) {
                                $update_themes->response[$theme_slug]['package'] = $api->package;
                                set_site_transient('update_themes', $update_themes);
                                $theme_info['package'] = $update_themes->response[$theme_slug]['package'];
                            }
                        }
                    }
                    if ($theme_slug === $api->slug && (isset($theme_info['package']) && !empty($theme_info['package']))) {
                        $type = 'update_available';
                        $update_file = $theme_slug;
                        break;
                    }
                }
            }
            $themes = get_themes();
            foreach ((array) $themes as $this_theme) {
                if (is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug) {
                    if ($this_theme['Version'] == $api->version) {
                        $type = 'latest_installed';
                    } elseif ($this_theme['Version'] > $api->version) {
                        $type = 'newer_installed';
                        $newer_version = $this_theme['Version'];
                    }
                    break;
                }
            }
            ?>

		<div class='available-theme'>
		<img src='<?php 
            echo esc_url($api->screenshot_url);
            ?>
' width='300' class="theme-preview-img" />
		<h3><?php 
            echo $api->name;
            ?>
</h3>
		<p><?php 
            printf(__('by %s', 'installer'), $api->author);
            ?>
</p>
		<p><?php 
            printf(__('Version: %s', 'installer'), $api->version);
            ?>
</p>

		<?php 
            $buttons = '<a class="button" id="cancel" href="#" onclick="tb_close();return false;">' . __('Cancel', 'installer') . '</a> ';
            if ($type == 'newer_installed' || ($type = 'latest_installed') || !empty($api->download_link)) {
                switch ($type) {
                    default:
                    case 'install':
                        if (current_user_can('install_themes')) {
                            $theme_url = wp_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug);
                            if (isset($api->repository_id)) {
                                $theme_url = add_query_arg(array('repository_id' => $api->repository_id), $theme_url);
                            }
                            $buttons .= '<a class="button-primary" id="install" href="' . $theme_url . '" target="_parent">' . __('Install Now', 'installer') . '</a>';
                        }
                        break;
                    case 'update_available':
                        if (current_user_can('update_themes')) {
                            $theme_url = wp_nonce_url(self_admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file);
                            if (isset($api->repository_id)) {
                                $theme_url = add_query_arg(array('repository_id' => $api->repository_id), $theme_url);
                            }
                            $buttons .= '<a class="button-primary" id="install"	href="' . $theme_url . '" target="_parent">' . __('Install Update Now', 'installer') . '</a>';
                        }
                        break;
                    case 'newer_installed':
                        if (current_user_can('install_themes') || current_user_can('update_themes')) {
                            ?>
<p><?php 
                            printf(__('Newer version (%s) is installed.', 'installer'), $newer_version);
                            ?>
</p><?php 
                        }
                        break;
                    case 'latest_installed':
                        if (current_user_can('install_themes') || current_user_can('update_themes')) {
                            ?>
<p><?php 
                            _e('This version is already installed.', 'installer');
                            ?>
</p><?php 
                        }
                        break;
                }
            }
            /*elseif (isset($api->message) && !empty($api->message))
            		{
            			echo wp_kses($api->message, $themes_allowedtags);
            		}*/
            if (isset($api->message) && !empty($api->message) && (current_user_can('install_themes') || current_user_can('update_themes'))) {
                //echo wp_kses($api->message, $plugins_allowedtags);
                $message = WPRC_Functions::formatMessage($api->message);
                if (isset($api->message_type) && $api->message_type == 'notify') {
                    WPRC_AdminNotifier::addMessage('wprc-theme-info-' . $api->slug, $message);
                } else {
                    echo $message;
                }
            } elseif (!($type == 'newer_installed' || ($type = 'latest_installed')) && (isset($api->purchase_link) && !empty($api->purchase_link) && isset($api->price) && !empty($api->price))) {
                if (current_user_can('install_themes')) {
                    $purl = WPRC_Functions::sanitizeURL($api->purchase_link);
                    $return_url = rawurlencode(admin_url('theme-install.php?tab=theme-information&repository_id=' . $api->repository_id . '&theme=' . $api->slug));
                    $salt = rawurlencode($api->salt);
                    if (strpos($purl, '?')) {
                        $url_glue = '&';
                    } else {
                        $url_glue = '?';
                    }
                    $purl .= $url_glue . 'return_to=' . $return_url . '&rsalt=' . $salt;
                    $buttons .= '<a class="button-primary" id="install" href="' . $purl . '">' . sprintf(__('Buy %s', 'installer'), '(' . $api->currency->symbol . $api->price . ' ' . $api->currency->name . ')') . '</a>';
                }
            }
            ?>
		<br class="clear" />
		</div>

		<p class="action-button">
		<?php 
            echo $buttons;
            ?>
		<br class="clear" />
		</p>
		<?php 
            if (isset($api->rauth) && $api->rauth == false) {
                ?>
		<p><?php 
                _e('Authorization Failed!', 'installer');
                ?>
</p>
		<?php 
            }
            ?>

		<?php 
            iframe_footer();
            exit;
        }
    }
Beispiel #24
0
            $stylesheet = $broken_theme->get_stylesheet();
            $delete_url = add_query_arg(array('action' => 'delete', 'stylesheet' => urlencode($stylesheet)), admin_url('themes.php'));
            $delete_url = wp_nonce_url($delete_url, 'delete-theme_' . $stylesheet);
            ?>
				<td><a href="<?php 
            echo esc_url($delete_url);
            ?>
" class="button button-secondary delete-theme"><?php 
            _e('Delete');
            ?>
</a></td>
				<?php 
        }
        if ($can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code()) {
            $parent_theme_name = $broken_theme->get('Template');
            $parent_theme = themes_api('theme_information', array('slug' => urlencode($parent_theme_name)));
            if (!is_wp_error($parent_theme)) {
                $install_url = add_query_arg(array('action' => 'install-theme', 'theme' => urlencode($parent_theme_name)), admin_url('update.php'));
                $install_url = wp_nonce_url($install_url, 'install-theme_' . $parent_theme_name);
                ?>
					<td><a href="<?php 
                echo esc_url($install_url);
                ?>
" class="button button-secondary install-theme"><?php 
                _e('Install Parent Theme');
                ?>
</a></td>
					<?php 
            }
        }
        ?>
Beispiel #25
0
 protected function install_from_repo($slug, $assoc_args)
 {
     $api = themes_api('theme_information', array('slug' => $slug));
     if (is_wp_error($api)) {
         return $api;
     }
     if (isset($assoc_args['version'])) {
         self::alter_api_response($api, $assoc_args['version']);
     }
     if (!isset($assoc_args['force']) && wp_get_theme($slug)->exists()) {
         // We know this will fail, so avoid a needless download of the package.
         return new WP_Error('already_installed', 'Theme already installed.');
     }
     WP_CLI::log(sprintf('Installing %s (%s)', $api->name, $api->version));
     if (!isset($assoc_args['version']) || 'dev' !== $assoc_args['version']) {
         WP_CLI::get_http_cache_manager()->whitelist_package($api->download_link, $this->item_type, $api->slug, $api->version);
     }
     $result = $this->get_upgrader($assoc_args)->install($api->download_link);
     return $result;
 }
/**
 * Display theme information in dialog box form.
 *
 * @since 2.8.0
 *
 * @global WP_Theme_Install_List_Table $wp_list_table
 */
function install_theme_information()
{
    global $wp_list_table;
    $theme = themes_api('theme_information', array('slug' => wp_unslash($_REQUEST['theme'])));
    if (is_wp_error($theme)) {
        wp_die($theme);
    }
    iframe_header(__('Theme Install'));
    if (!isset($wp_list_table)) {
        $wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
    }
    $wp_list_table->theme_installer_single($theme);
    iframe_footer();
    exit;
}
    function bws_add_menu_render()
    {
        global $wpdb, $wpmu, $wp_version, $bws_plugin_info;
        $error = $message = $bwsmn_form_email = '';
        $bws_donate_link = 'https://www.2checkout.com/checkout/purchase?sid=1430388&quantity=10&product_id=13';
        if (!function_exists('is_plugin_active_for_network')) {
            require_once ABSPATH . 'wp-admin/includes/plugin.php';
        }
        $bws_plugins = array('captcha/captcha.php' => array('name' => 'Captcha', 'description' => 'Plugin intended to prove that the visitor is a human being and not a spam robot.', 'link' => 'http://bestwebsoft.com/plugin/captcha-plugin/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/captcha-plugin/?k=d678516c0990e781edfb6a6c874f0b8a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Captcha+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=captcha.php', 'pro_version' => 'captcha-pro/captcha_pro.php'), 'contact-form-plugin/contact_form.php' => array('name' => 'Contact form', 'description' => 'Add Contact Form to your WordPress website.', 'link' => 'http://bestwebsoft.com/plugin/contact-form/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/contact-form/?k=012327ef413e5b527883e031d43b088b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Contact+Form+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=contact_form.php', 'pro_version' => 'contact-form-pro/contact_form_pro.php'), 'facebook-button-plugin/facebook-button-plugin.php' => array('name' => 'Facebook Like Button', 'description' => 'Allows you to add the Follow and Like buttons the easiest way.', 'link' => 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/facebook-like-button-plugin/?k=05ec4f12327f55848335802581467d55&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Facebook+Like+Button+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=facebook-button-plugin.php', 'pro_version' => 'facebook-button-pro/facebook-button-pro.php'), 'twitter-plugin/twitter.php' => array('name' => 'Twitter', 'description' => 'Allows you to add the Twitter "Follow" and "Like" buttons the easiest way.', 'link' => 'http://bestwebsoft.com/plugin/twitter-plugin/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/twitter-plugin/?k=f8cb514e25bd7ec4974d64435c5eb333&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Twitter+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=twitter.php', 'pro_version' => 'twitter-pro/twitter-pro.php'), 'portfolio/portfolio.php' => array('name' => 'Portfolio', 'description' => 'Allows you to create a page with the information about your past projects.', 'link' => 'http://bestwebsoft.com/plugin/portfolio-plugin/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/portfolio-plugin/?k=1249a890c5b7bba6bda3f528a94f768b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Portfolio+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=portfolio.php'), 'gallery-plugin/gallery-plugin.php' => array('name' => 'Gallery', 'description' => 'Allows you to implement a Gallery page into your website.', 'link' => 'http://bestwebsoft.com/plugin/gallery-plugin/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/gallery-plugin/?k=2da21c0a64eec7ebf16337fa134c5f78&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Gallery+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=gallery-plugin.php', 'pro_version' => 'gallery-plugin-pro/gallery-plugin-pro.php'), 'adsense-plugin/adsense-plugin.php' => array('name' => 'Google AdSense', 'description' => 'Allows Google AdSense implementation to your website.', 'link' => 'http://bestwebsoft.com/plugin/google-adsense-plugin/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/google-adsense-plugin/?k=60e3979921e354feb0347e88e7d7b73d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Adsense+Plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=adsense-plugin.php'), 'custom-search-plugin/custom-search-plugin.php' => array('name' => 'Custom Search', 'description' => 'Allows to extend your website search functionality by adding a custom post type.', 'link' => 'http://bestwebsoft.com/plugin/custom-search-plugin/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/custom-search-plugin/?k=933be8f3a8b8719d95d1079d15443e29&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Custom+Search+plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=custom_search.php'), 'quotes-and-tips/quotes-and-tips.php' => array('name' => 'Quotes and Tips', 'description' => 'Allows you to implement quotes & tips block into your web site.', 'link' => 'http://bestwebsoft.com/plugin/quotes-and-tips/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/quotes-and-tips/?k=5738a4e85a798c4a5162240c6515098d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Quotes+and+Tips+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=quotes-and-tips.php'), 'google-sitemap-plugin/google-sitemap-plugin.php' => array('name' => 'Google Sitemap', 'description' => 'Allows you to add sitemap file to Google Webmaster Tools.', 'link' => 'http://bestwebsoft.com/plugin/google-sitemap-plugin/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/google-sitemap-plugin/?k=5202b2f5ce2cf85daee5e5f79a51d806&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Google+sitemap+plugin+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=google-sitemap-plugin.php', 'pro_version' => 'google-sitemap-pro/google-sitemap-pro.php'), 'updater/updater.php' => array('name' => 'Updater', 'description' => 'Allows you to update plugins and WP core.', 'link' => 'http://bestwebsoft.com/plugin/updater-plugin/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/updater-plugin/?k=66f3ecd4c1912009d395c4bb30f779d1&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=updater+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=updater-options', 'pro_version' => 'updater-pro/updater_pro.php'), 'custom-fields-search/custom-fields-search.php' => array('name' => 'Custom Fields Search', 'description' => 'Allows you to add website search any existing custom fields.', 'link' => 'http://bestwebsoft.com/plugin/custom-fields-search/?k=f3f8285bb069250c42c6ffac95ed3284&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/custom-fields-search/?k=f3f8285bb069250c42c6ffac95ed3284&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Custom+Fields+Search+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=custom_fields_search.php'), 'google-one/google-plus-one.php' => array('name' => 'Google +1', 'description' => 'Allows you to celebrate liked the article.', 'link' => 'http://bestwebsoft.com/plugin/google-plus-one/?k=ce7a88837f0a857b3a2bb142f470853c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/google-plus-one/?k=ce7a88837f0a857b3a2bb142f470853c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&type=term&s=Google+%2B1+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=google-plus-one.php', 'pro_version' => 'google-one-pro/google-plus-one-pro.php'), 'relevant/related-posts-plugin.php' => array('name' => 'Relevant - Related Posts', 'description' => 'Allows you to display related posts with similar words in category, tags, title or by adding special meta key for posts.', 'link' => 'http://bestwebsoft.com/plugin/related-posts-plugin/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/related-posts-plugin/?k=73fb737037f7141e66415ec259f7e426&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Related+Posts+Plugin+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=related-posts-plugin.php'), 'contact-form-to-db/contact_form_to_db.php' => array('name' => 'Contact Form To DB', 'description' => 'Allows you to manage the messages that have been sent from your site.', 'link' => 'http://bestwebsoft.com/plugin/contact-form-to-db/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/contact-form-to-db/?k=ba3747d317c2692e4136ca096a8989d6&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Contact+Form+to+DB+bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=cntctfrmtdb_settings', 'pro_version' => 'contact-form-to-db-pro/contact_form_to_db_pro.php'), 'pdf-print/pdf-print.php' => array('name' => 'PDF & Print', 'description' => 'Allows you to create PDF and Print page with adding appropriate buttons to the content.', 'link' => 'http://bestwebsoft.com/plugin/pdf-print/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/pdf-print/?k=bfefdfb522a4c0ff0141daa3f271840c&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=PDF+Print+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=pdf-print.php', 'pro_version' => 'pdf-print-pro/pdf-print-pro.php'), 'donate-button/donate.php' => array('name' => 'Donate', 'description' => 'Makes it possible to place donation buttons of various payment systems on your web page.', 'link' => 'http://bestwebsoft.com/plugin/donate/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/donate/?k=a8b2e2a56914fb1765dd20297c26401b&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Donate+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=donate.php'), 'post-to-csv/post-to-csv.php' => array('name' => 'Post To CSV', 'description' => 'The plugin allows to export posts of any types to a csv file.', 'link' => 'http://bestwebsoft.com/plugin/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/post-to-csv/?k=653aa55518ae17409293a7a894268b8f&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Post+To+CSV+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=post-to-csv.php'), 'google-shortlink/google-shortlink.php' => array('name' => 'Google Shortlink', 'description' => 'Allows you to get short links from goo.gl servise without leaving your site.', 'link' => 'http://bestwebsoft.com/plugin/google-shortlink/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/google-shortlink/?k=afcf3eaed021bbbbeea1090e16bc22db&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Google+Shortlink+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=gglshrtlnk_options'), 'htaccess/htaccess.php' => array('name' => 'Htaccess', 'description' => 'Allows controlling access to your website using the directives Allow and Deny.', 'link' => 'http://bestwebsoft.com/plugin/htaccess/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/htaccess/?k=2b865fcd56a935d22c5c4f1bba52ed46&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Htaccess+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=htaccess.php'), 'google-captcha/google-captcha.php' => array('name' => 'Google Captcha (reCAPTCHA)', 'description' => 'Plugin intended to prove that the visitor is a human being and not a spam robot.', 'link' => 'http://bestwebsoft.com/plugin/google-captcha/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/google-captcha/?k=7b59fbe542acf950b29f3e020d5ad735&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Google+Captcha+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=google-captcha.php'), 'sender/sender.php' => array('name' => 'Sender', 'description' => 'You can send mails to all users or to certain categories of users.', 'link' => 'http://bestwebsoft.com/plugin/sender/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/sender/?k=89c297d14ba85a8417a0f2fc05e089c7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Sender+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=sndr_settings'), 'subscriber/subscriber.php' => array('name' => 'Subscriber', 'description' => 'This plugin allows you to subscribe users for newsletters from your website.', 'link' => 'http://bestwebsoft.com/plugin/subscriber/?k=a4ecc1b7800bae7329fbe8b4b04e9c88&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/subscriber/?k=a4ecc1b7800bae7329fbe8b4b04e9c88&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Subscriber+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=sbscrbr_settings_page'), 'contact-form-multi/contact-form-multi.php' => array('name' => 'Contact Form Multi', 'description' => 'This plugin allows you to subscribe users for newsletters from your website.', 'link' => 'http://bestwebsoft.com/plugin/contact-form-multi/?k=83cdd9e72a9f4061122ad28a67293c72&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/contact-form-multi/?k=83cdd9e72a9f4061122ad28a67293c72&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=Contact+Form+Multi+Bestwebsoft&plugin-search-input=Search+Plugins', 'settings' => ''), 'bws-google-maps/bws-google-maps.php' => array('name' => 'BestWebSoft Google Maps', 'description' => 'Easy to set up and insert Google Maps to your website.', 'link' => 'http://bestwebsoft.com/plugin/bws-google-maps/?k=d8fac412d7359ebaa4ff53b46572f9f7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/bws-google-maps/?k=d8fac412d7359ebaa4ff53b46572f9f7&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=BestWebSoft+Google+Maps&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=bws-google-maps.php', 'pro_version' => 'bws-google-maps-pro/bws-google-maps-pro.php'), 'bws-google-analytics/bws-google-analytics.php' => array('name' => 'BestWebSoft Google Analytics', 'description' => 'Allows you to retrieve basic stats from Google Analytics account and add the tracking code to your blog.', 'link' => 'http://bestwebsoft.com/plugin/bws-google-analytics/?k=261c74cad753fb279cdf5a5db63fbd43&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'download' => 'http://bestwebsoft.com/plugin/bws-google-analytics/?k=261c74cad753fb279cdf5a5db63fbd43&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#download', 'wp_install' => '/wp-admin/plugin-install.php?tab=search&s=BestWebSoft+Google+Analytics&plugin-search-input=Search+Plugins', 'settings' => 'admin.php?page=bws-google-analytics.php'));
        $bws_plugins_pro = array('gallery-plugin-pro/gallery-plugin-pro.php' => array('name' => 'Gallery Pro', 'description' => 'Allows you to implement as many galleries as you want into your website.', 'link' => 'http://bestwebsoft.com/plugin/gallery-pro/?k=382e5ce7c96a6391f5ffa5e116b37fe0&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/gallery-pro/?k=382e5ce7c96a6391f5ffa5e116b37fe0&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=gallery-plugin-pro.php'), 'contact-form-pro/contact_form_pro.php' => array('name' => 'Contact form Pro', 'description' => 'Allows you to implement a feedback form to a web-page or a post in no time.', 'link' => 'http://bestwebsoft.com/plugin/contact-form-pro/?k=773dc97bb3551975db0e32edca1a6d71&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/contact-form-pro/?k=773dc97bb3551975db0e32edca1a6d71&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=contact_form_pro.php'), 'captcha-pro/captcha_pro.php' => array('name' => 'Captcha Pro', 'description' => 'Allows you to implement a super security captcha form into web forms.', 'link' => 'http://bestwebsoft.com/plugin/captcha-pro/?k=ff7d65e55e5e7f98f219be9ed711094e&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/captcha-pro/?k=ff7d65e55e5e7f98f219be9ed711094e&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=captcha_pro.php'), 'updater-pro/updater_pro.php' => array('name' => 'Updater Pro', 'description' => 'Allows you to update plugins and WordPress core on your website.', 'link' => 'http://bestwebsoft.com/plugin/updater-pro/?k=cf633acbefbdff78545347fe08a3aecb&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/updater-pro?k=cf633acbefbdff78545347fe08a3aecb&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=updater-pro-options'), 'contact-form-to-db-pro/contact_form_to_db_pro.php' => array('name' => 'Contact form to DB Pro', 'description' => 'The plugin provides a unique opportunity to manage messages sent from your site via the contact form.', 'link' => 'http://bestwebsoft.com/plugin/contact-form-to-db-pro/?k=6ce5f4a9006ec906e4db643669246c6a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/contact-form-to-db-pro/?k=6ce5f4a9006ec906e4db643669246c6a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=cntctfrmtdbpr_settings'), 'google-sitemap-pro/google-sitemap-pro.php' => array('name' => 'Google Sitemap Pro', 'description' => 'Allows you to add sitemap file to Google Webmaster Tools.', 'link' => 'http://bestwebsoft.com/plugin/google-sitemap-pro/?k=7ea384a5cc36cb4c22741caa20dcd56d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/google-sitemap-pro/?k=7ea384a5cc36cb4c22741caa20dcd56d&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=google-sitemap-pro.php'), 'twitter-pro/twitter-pro.php' => array('name' => 'Twitter Pro', 'description' => 'Allows you to add the Twitter "Follow" and "Like" buttons the easiest way.', 'link' => 'http://bestwebsoft.com/plugin/twitter-pro/?k=63ecbf0cc9cebf060b5a3c9362299700&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/twitter-pro?k=63ecbf0cc9cebf060b5a3c9362299700&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=twitter-pro.php'), 'google-one-pro/google-plus-one-pro.php' => array('name' => 'Google +1 Pro', 'description' => 'Allows you to celebrate liked the article.', 'link' => 'http://bestwebsoft.com/plugin/google-plus-one-pro/?k=f4b0a62d155c9df9601a0531ad5bd832&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/google-plus-one-pro?k=f4b0a62d155c9df9601a0531ad5bd832&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=google-plus-one-pro.php'), 'facebook-button-pro/facebook-button-pro.php' => array('name' => 'Facebook Like Button Pro', 'description' => 'Allows you to add the Follow and Like buttons the easiest way.', 'link' => 'http://bestwebsoft.com/plugin/facebook-like-button-pro/?k=8da168e60a831cfb3525417c333ad275&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/facebook-like-button-pro?k=8da168e60a831cfb3525417c333ad275&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=facebook-button-pro.php'), 'pdf-print-pro/pdf-print-pro.php' => array('name' => 'PDF & Print Pro', 'description' => 'Allows you to create PDF and Print page with adding appropriate buttons to the content.', 'link' => 'http://bestwebsoft.com/plugin/pdf-print-pro/?k=fd43a0e659ddc170a9060027cbfdcc3a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/pdf-print-pro?k=fd43a0e659ddc170a9060027cbfdcc3a&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=pdf-print-pro.php'), 'bws-google-maps-pro/bws-google-maps-pro.php' => array('name' => 'BestWebSoft Google Maps Pro', 'description' => 'Easy to set up and insert Google Maps to your website.', 'link' => 'http://bestwebsoft.com/plugin/bws-google-maps-pro/?k=117c3f9fc17f2c83ef430a8a9dc06f56&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version, 'purchase' => 'http://bestwebsoft.com/plugin/bws-google-maps-pro/?k=117c3f9fc17f2c83ef430a8a9dc06f56&pn=' . $bws_plugin_info["id"] . '&v=' . $bws_plugin_info["version"] . '&wp_v=' . $wp_version . '#purchase', 'settings' => 'admin.php?page=bws-google-maps-pro.php'));
        $all_plugins = get_plugins();
        $active_plugins = get_option('active_plugins');
        $recommend_plugins = array_diff_key($bws_plugins, $all_plugins);
        foreach ($bws_plugins as $key_plugin => $value_plugin) {
            if (!isset($all_plugins[$key_plugin]) && isset($bws_plugins[$key_plugin]['pro_version']) && isset($all_plugins[$bws_plugins[$key_plugin]['pro_version']])) {
                unset($recommend_plugins[$key_plugin]);
            }
        }
        foreach ($all_plugins as $key_plugin => $value_plugin) {
            if (!isset($bws_plugins[$key_plugin]) && !isset($bws_plugins_pro[$key_plugin])) {
                unset($all_plugins[$key_plugin]);
            }
            if (isset($bws_plugins[$key_plugin]) && isset($bws_plugins[$key_plugin]['pro_version']) && isset($all_plugins[$bws_plugins[$key_plugin]['pro_version']])) {
                unset($all_plugins[$key_plugin]);
            }
        }
        if (isset($_GET['action']) && 'system_status' == $_GET['action']) {
            $all_plugins = get_plugins();
            $active_plugins = get_option('active_plugins');
            $sql_version = $wpdb->get_var("SELECT VERSION() AS version");
            $mysql_info = $wpdb->get_results("SHOW VARIABLES LIKE 'sql_mode'");
            if (is_array($mysql_info)) {
                $sql_mode = $mysql_info[0]->Value;
            }
            if (empty($sql_mode)) {
                $sql_mode = __('Not set', 'bestwebsoft');
            }
            if (ini_get('safe_mode')) {
                $safe_mode = __('On', 'bestwebsoft');
            } else {
                $safe_mode = __('Off', 'bestwebsoft');
            }
            if (ini_get('allow_url_fopen')) {
                $allow_url_fopen = __('On', 'bestwebsoft');
            } else {
                $allow_url_fopen = __('Off', 'bestwebsoft');
            }
            if (ini_get('upload_max_filesize')) {
                $upload_max_filesize = ini_get('upload_max_filesize');
            } else {
                $upload_max_filesize = __('N/A', 'bestwebsoft');
            }
            if (ini_get('post_max_size')) {
                $post_max_size = ini_get('post_max_size');
            } else {
                $post_max_size = __('N/A', 'bestwebsoft');
            }
            if (ini_get('max_execution_time')) {
                $max_execution_time = ini_get('max_execution_time');
            } else {
                $max_execution_time = __('N/A', 'bestwebsoft');
            }
            if (ini_get('memory_limit')) {
                $memory_limit = ini_get('memory_limit');
            } else {
                $memory_limit = __('N/A', 'bestwebsoft');
            }
            if (function_exists('memory_get_usage')) {
                $memory_usage = round(memory_get_usage() / 1024 / 1024, 2) . __(' Mb', 'bestwebsoft');
            } else {
                $memory_usage = __('N/A', 'bestwebsoft');
            }
            if (is_callable('exif_read_data')) {
                $exif_read_data = __('Yes', 'bestwebsoft') . " ( V" . substr(phpversion('exif'), 0, 4) . ")";
            } else {
                $exif_read_data = __('No', 'bestwebsoft');
            }
            if (is_callable('iptcparse')) {
                $iptcparse = __('Yes', 'bestwebsoft');
            } else {
                $iptcparse = __('No', 'bestwebsoft');
            }
            if (is_callable('xml_parser_create')) {
                $xml_parser_create = __('Yes', 'bestwebsoft');
            } else {
                $xml_parser_create = __('No', 'bestwebsoft');
            }
            if (function_exists('wp_get_theme')) {
                $theme = wp_get_theme();
            } else {
                $theme = get_theme(get_current_theme());
            }
            if (function_exists('is_multisite')) {
                if (is_multisite()) {
                    $multisite = __('Yes', 'bestwebsoft');
                } else {
                    $multisite = __('No', 'bestwebsoft');
                }
            } else {
                $multisite = __('N/A', 'bestwebsoft');
            }
            $site_url = get_option('siteurl');
            $home_url = get_option('home');
            $db_version = get_option('db_version');
            $system_info = array('system_info' => '', 'active_plugins' => '', 'inactive_plugins' => '');
            $system_info['system_info'] = array(__('Operating System', 'bestwebsoft') => PHP_OS, __('Server', 'bestwebsoft') => $_SERVER["SERVER_SOFTWARE"], __('Memory usage', 'bestwebsoft') => $memory_usage, __('MYSQL Version', 'bestwebsoft') => $sql_version, __('SQL Mode', 'bestwebsoft') => $sql_mode, __('PHP Version', 'bestwebsoft') => PHP_VERSION, __('PHP Safe Mode', 'bestwebsoft') => $safe_mode, __('PHP Allow URL fopen', 'bestwebsoft') => $allow_url_fopen, __('PHP Memory Limit', 'bestwebsoft') => $memory_limit, __('PHP Max Upload Size', 'bestwebsoft') => $upload_max_filesize, __('PHP Max Post Size', 'bestwebsoft') => $post_max_size, __('PHP Max Script Execute Time', 'bestwebsoft') => $max_execution_time, __('PHP Exif support', 'bestwebsoft') => $exif_read_data, __('PHP IPTC support', 'bestwebsoft') => $iptcparse, __('PHP XML support', 'bestwebsoft') => $xml_parser_create, __('Site URL', 'bestwebsoft') => $site_url, __('Home URL', 'bestwebsoft') => $home_url, '$_SERVER[HTTP_HOST]' => $_SERVER['HTTP_HOST'], '$_SERVER[SERVER_NAME]' => $_SERVER['SERVER_NAME'], __('WordPress Version', 'bestwebsoft') => $wp_version, __('WordPress DB Version', 'bestwebsoft') => $db_version, __('Multisite', 'bestwebsoft') => $multisite, __('Active Theme', 'bestwebsoft') => $theme['Name'] . ' ' . $theme['Version']);
            foreach ($all_plugins as $path => $plugin) {
                if (is_plugin_active($path)) {
                    $system_info['active_plugins'][$plugin['Name']] = $plugin['Version'];
                } else {
                    $system_info['inactive_plugins'][$plugin['Name']] = $plugin['Version'];
                }
            }
        }
        if (isset($_REQUEST['bwsmn_form_submit']) && check_admin_referer(plugin_basename(__FILE__), 'bwsmn_nonce_submit') || isset($_REQUEST['bwsmn_form_submit_custom_email']) && check_admin_referer(plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email')) {
            if (isset($_REQUEST['bwsmn_form_email'])) {
                $bwsmn_form_email = trim($_REQUEST['bwsmn_form_email']);
                if ($bwsmn_form_email == "" || !preg_match("/^((?:[a-z0-9']+(?:[a-z0-9\\-_\\.']+)?@[a-z0-9]+(?:[a-z0-9\\-\\.]+)?\\.[a-z]{2,5})[, ]*)+\$/i", $bwsmn_form_email)) {
                    $error = __("Please enter a valid email address.", 'bestwebsoft');
                } else {
                    $email = $bwsmn_form_email;
                    $bwsmn_form_email = '';
                    $message = __('Email with system info is sent to ', 'bestwebsoft') . $email;
                }
            } else {
                $email = '*****@*****.**';
                $message = __('Thank you for contacting us.', 'bestwebsoft');
            }
            if ($error == '') {
                $headers = 'MIME-Version: 1.0' . "\n";
                $headers .= 'Content-type: text/html; charset=utf-8' . "\n";
                $headers .= 'From: ' . get_option('admin_email');
                $message_text = '<html><head><title>System Info From ' . $home_url . '</title></head><body>
				<h4>Environment</h4>
				<table>';
                foreach ($system_info['system_info'] as $key => $value) {
                    $message_text .= '<tr><td>' . $key . '</td><td>' . $value . '</td></tr>';
                }
                $message_text .= '</table>
				<h4>Active Plugins</h4>
				<table>';
                foreach ($system_info['active_plugins'] as $key => $value) {
                    $message_text .= '<tr><td scope="row">' . $key . '</td><td scope="row">' . $value . '</td></tr>';
                }
                $message_text .= '</table>
				<h4>Inactive Plugins</h4>
				<table>';
                foreach ($system_info['inactive_plugins'] as $key => $value) {
                    $message_text .= '<tr><td scope="row">' . $key . '</td><td scope="row">' . $value . '</td></tr>';
                }
                $message_text .= '</table></body></html>';
                $result = wp_mail($email, 'System Info From ' . $home_url, $message_text, $headers);
                if ($result != true) {
                    $error = __("Sorry, email message could not be delivered.", 'bestwebsoft');
                }
            }
        }
        ?>
		<div class="wrap">
			<div class="icon32 icon32-bws" id="icon-options-general"></div>
			<h2>BestWebSoft</h2>			
			<h2 class="nav-tab-wrapper">
				<a class="nav-tab<?php 
        if (!isset($_GET['action'])) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=bws_plugins"><?php 
        _e('Plugins', 'bestwebsoft');
        ?>
</a>
				<?php 
        if ($wp_version >= '3.4') {
            ?>
					<a class="nav-tab<?php 
            if (isset($_GET['action']) && 'themes' == $_GET['action']) {
                echo ' nav-tab-active';
            }
            ?>
" href="admin.php?page=bws_plugins&amp;action=themes"><?php 
            _e('Themes', 'bestwebsoft');
            ?>
</a>
				<?php 
        }
        ?>
				<a class="nav-tab<?php 
        if (isset($_GET['action']) && 'system_status' == $_GET['action']) {
            echo ' nav-tab-active';
        }
        ?>
" href="admin.php?page=bws_plugins&amp;action=system_status"><?php 
        _e('System status', 'bestwebsoft');
        ?>
</a>
			</h2>			
			<?php 
        if (!isset($_GET['action'])) {
            ?>
	
				<ul class="subsubsub">
					<li><a <?php 
            if (!isset($_GET['sub'])) {
                echo 'class="current" ';
            }
            ?>
href="admin.php?page=bws_plugins"><?php 
            _e('All', 'bestwebsoft');
            ?>
</a></li> |
					<li><a <?php 
            if (isset($_GET['sub']) && 'installed' == $_GET['sub']) {
                echo 'class="current" ';
            }
            ?>
href="admin.php?page=bws_plugins&amp;sub=installed"><?php 
            _e('Installed', 'bestwebsoft');
            ?>
</a></li> |
					<li><a <?php 
            if (isset($_GET['sub']) && 'recommended' == $_GET['sub']) {
                echo 'class="current" ';
            }
            ?>
href="admin.php?page=bws_plugins&amp;sub=recommended"><?php 
            _e('Recommended', 'bestwebsoft');
            ?>
</a></li>
				</ul>
				<div class="clear"></div>
				<?php 
            if (isset($_GET['sub']) && 'installed' == $_GET['sub'] || !isset($_GET['sub'])) {
                ?>
	
					<h4 class="bws_installed"><?php 
                _e('Installed plugins', 'bestwebsoft');
                ?>
</h4>
					<?php 
                foreach ($all_plugins as $key_plugin => $value_plugin) {
                    if (isset($bws_plugins_pro[$key_plugin])) {
                        $key_plugin_explode = explode('-plugin-pro/', $key_plugin);
                        if (isset($key_plugin_explode[1])) {
                            $icon = $key_plugin_explode[0];
                        } else {
                            $key_plugin_explode = explode('-pro/', $key_plugin);
                            $icon = $key_plugin_explode[0];
                        }
                    } elseif (isset($bws_plugins[$key_plugin])) {
                        $key_plugin_explode = explode('-plugin/', $key_plugin);
                        if (isset($key_plugin_explode[1])) {
                            $icon = $key_plugin_explode[0];
                        } else {
                            $key_plugin_explode = explode('/', $key_plugin);
                            $icon = $key_plugin_explode[0];
                        }
                    }
                    if (in_array($key_plugin, $active_plugins) || is_plugin_active_for_network($key_plugin)) {
                        ?>
							<?php 
                        if (isset($bws_plugins_pro[$key_plugin])) {
                            ?>
									
								<div class="bws_product_box bws_exist_overlay">
									<div class="bws_product">				
										<div class="bws_product_title"><?php 
                            echo $value_plugin["Name"];
                            ?>
</div>
										<div class="bws_product_content">
											<div class="bws_product_icon">
												<div class="bws_product_icon_pro"></div>
												<img src="<?php 
                            echo plugins_url("icons/", __FILE__) . $icon . '.png';
                            ?>
"/>												
											</div>			
											<div class="bws_product_description"><?php 
                            echo $value_plugin["Description"];
                            ?>
</div>
										</div>
										<div class="clear"></div>
									</div>
									<div class="bws_product_links">								
										<a href="<?php 
                            echo $bws_plugins_pro[$key_plugin]["link"];
                            ?>
" target="_blank"><?php 
                            _e("Learn more", 'bestwebsoft');
                            ?>
</a>
										<span> | </span>
										<a href="<?php 
                            echo $bws_plugins_pro[$key_plugin]["settings"];
                            ?>
" target="_blank"><?php 
                            _e("Settings", 'bestwebsoft');
                            ?>
</a>
									</div>
								</div>
							<?php 
                        } elseif (isset($bws_plugins[$key_plugin])) {
                            ?>
								<div class="bws_product_box bws_product_free">
									<div class="bws_product">				
										<div class="bws_product_title"><?php 
                            echo $value_plugin["Name"];
                            ?>
</div>
										<div class="bws_product_content">
											<div class="bws_product_icon">
												<img src="<?php 
                            echo plugins_url("icons/", __FILE__) . $icon . '.png';
                            ?>
"/>
											</div>
											<div class="bws_product_description"><?php 
                            echo $bws_plugins[$key_plugin]["description"];
                            ?>
</div>
										</div>
										<?php 
                            if (isset($bws_plugins[$key_plugin]['pro_version']) && isset($bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']])) {
                                ?>
											<a class="bws_product_button" href="<?php 
                                echo $bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']]["purchase"];
                                ?>
" target="_blank">
												<?php 
                                _e('Go', 'bestwebsoft');
                                ?>
 <strong>PRO</strong>
											</a>
										<?php 
                            } else {
                                ?>
											<a class="bws_product_button bws_donate_button" href="<?php 
                                echo $bws_donate_link;
                                ?>
" target="_blank">
												<strong><?php 
                                _e('DONATE', 'bestwebsoft');
                                ?>
</strong>
											</a>
										<?php 
                            }
                            ?>
										<div class="clear"></div>
									</div>									
									<div class="bws_product_links">
										<a href="<?php 
                            echo $bws_plugins[$key_plugin]["link"];
                            ?>
" target="_blank"><?php 
                            _e("Learn more", 'bestwebsoft');
                            ?>
</a>
										<span> | </span>
										<a href="<?php 
                            echo $bws_plugins[$key_plugin]["settings"];
                            ?>
" target="_blank"><?php 
                            _e("Settings", 'bestwebsoft');
                            ?>
</a>
									</div>
								</div>
							<?php 
                        }
                    } else {
                        if (isset($bws_plugins_pro[$key_plugin])) {
                            ?>
								<div class="bws_product_box bws_product_deactivated">
									<div class="bws_product">					
										<div class="bws_product_title"><?php 
                            echo $value_plugin["Name"];
                            ?>
</div>
										<div class="bws_product_content">
											<div class="bws_product_icon">
												<div class="bws_product_icon_pro"></div>
												<img src="<?php 
                            echo plugins_url("icons/", __FILE__) . $icon . '.png';
                            ?>
"/>
											</div>
											<div class="bws_product_description"><?php 
                            echo $bws_plugins_pro[$key_plugin]["description"];
                            ?>
</div>
										</div>
										<div class="clear"></div>
									</div>
									<div class="bws_product_links">
										<a href="<?php 
                            echo $bws_plugins_pro[$key_plugin]["link"];
                            ?>
" target="_blank"><?php 
                            _e("Learn more", 'bestwebsoft');
                            ?>
</a>
										<span> | </span>
										<a class="bws_activate" href="plugins.php" title="<?php 
                            _e("Activate this plugin", 'bestwebsoft');
                            ?>
" target="_blank"><?php 
                            _e("Activate", 'bestwebsoft');
                            ?>
</a>
									</div>
								</div>
							<?php 
                        } elseif (isset($bws_plugins[$key_plugin])) {
                            ?>
								<div class="bws_product_box bws_product_deactivated bws_product_free">
									<div class="bws_product">					
										<div class="bws_product_title"><?php 
                            echo $value_plugin["Name"];
                            ?>
</div>
										<div class="bws_product_content">	
											<div class="bws_product_icon">
												<img src="<?php 
                            echo plugins_url("icons/", __FILE__) . $icon . '.png';
                            ?>
"/>
											</div>
											<div class="bws_product_description"><?php 
                            echo $bws_plugins[$key_plugin]["description"];
                            ?>
</div>
										</div>
										<?php 
                            if (isset($bws_plugins[$key_plugin]['pro_version']) && isset($bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']])) {
                                ?>
											<a class="bws_product_button" href="<?php 
                                echo $bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']]["purchase"];
                                ?>
" target="_blank">
												<?php 
                                _e('Go', 'bestwebsoft');
                                ?>
 <strong>PRO</strong>
											</a>
										<?php 
                            } else {
                                ?>
											<a class="bws_product_button bws_donate_button" href="<?php 
                                echo $bws_donate_link;
                                ?>
" target="_blank">
												<strong><?php 
                                _e('DONATE', 'bestwebsoft');
                                ?>
</strong>
											</a>
										<?php 
                            }
                            ?>
										<div class="clear"></div>
									</div>
									<div class="bws_product_links">
										<a href="<?php 
                            echo $bws_plugins[$key_plugin]["link"];
                            ?>
" target="_blank"><?php 
                            _e("Learn more", 'bestwebsoft');
                            ?>
</a>
										<span> | </span>
										<a class="bws_activate" href="plugins.php" title="<?php 
                            _e("Activate this plugin", 'bestwebsoft');
                            ?>
" target="_blank"><?php 
                            _e("Activate", 'bestwebsoft');
                            ?>
</a>
									</div>
								</div>
							<?php 
                        }
                    }
                }
            }
            ?>
				<div class="clear"></div>
				<?php 
            if (isset($_GET['sub']) && 'recommended' == $_GET['sub'] || !isset($_GET['sub'])) {
                ?>
					<h4 class="bws_recommended"><?php 
                _e('Recommended plugins', 'bestwebsoft');
                ?>
</h4>
					<?php 
                foreach ($recommend_plugins as $key_plugin => $value_plugin) {
                    if (isset($bws_plugins_pro[$key_plugin])) {
                        $key_plugin_explode = explode('-plugin-pro/', $key_plugin);
                        if (isset($key_plugin_explode[1])) {
                            $icon = $key_plugin_explode[0];
                        } else {
                            $key_plugin_explode = explode('-pro/', $key_plugin);
                            $icon = $key_plugin_explode[0];
                        }
                    } elseif (isset($bws_plugins[$key_plugin])) {
                        $key_plugin_explode = explode('-plugin/', $key_plugin);
                        if (isset($key_plugin_explode[1])) {
                            $icon = $key_plugin_explode[0];
                        } else {
                            $key_plugin_explode = explode('/', $key_plugin);
                            $icon = $key_plugin_explode[0];
                        }
                    }
                    ?>
						<div class="bws_product_box">
							<div class="bws_product">				
								<div class="bws_product_title"><?php 
                    echo $value_plugin["name"];
                    ?>
</div>
								<div class="bws_product_content">
									<div class="bws_product_icon">
										<?php 
                    if (isset($bws_plugins[$key_plugin]['pro_version']) && isset($bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']])) {
                        ?>
								
											<div class="bws_product_icon_pro"></div>
										<?php 
                    }
                    ?>
										<img src="<?php 
                    echo plugins_url("icons/", __FILE__) . $icon . '.png';
                    ?>
"/>
									</div>
									<div class="bws_product_description"><?php 
                    echo $bws_plugins[$key_plugin]["description"];
                    ?>
</div>
								</div>
								<?php 
                    if (isset($bws_plugins[$key_plugin]['pro_version']) && isset($bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']])) {
                        ?>
								
									<a class="bws_product_button" href="<?php 
                        echo $bws_plugins_pro[$bws_plugins[$key_plugin]['pro_version']]["link"];
                        ?>
" target="_blank">
										<?php 
                        echo _e('Go', 'bestwebsoft');
                        ?>
 <strong>PRO</strong>
									</a> 
								<?php 
                    } else {
                        ?>
									<a class="bws_product_button bws_donate_button" href="<?php 
                        echo $bws_donate_link;
                        ?>
" target="_blank">
										<strong><?php 
                        echo _e('DONATE', 'bestwebsoft');
                        ?>
</strong>
									</a>
								<?php 
                    }
                    ?>
							</div>
							<div class="clear"></div>
							<div class="bws_product_links">								
								<a href="<?php 
                    echo $bws_plugins[$key_plugin]["link"];
                    ?>
" target="_blank"><?php 
                    echo __("Learn more", 'bestwebsoft');
                    ?>
</a>
								<span> | </span>
								<a href="<?php 
                    echo $bws_plugins[$key_plugin]["wp_install"];
                    ?>
" target="_blank"><?php 
                    echo __("Install now", 'bestwebsoft');
                    ?>
</a>
							</div>
						</div>
					<?php 
                }
            }
            ?>
	
			<?php 
        } elseif ('themes' == $_GET['action']) {
            ?>
	
				<div id="availablethemes">
					<?php 
            global $tabs, $tab, $paged, $type, $theme_field_defaults;
            include ABSPATH . 'wp-admin/includes/theme-install.php';
            include ABSPATH . 'wp-admin/includes/class-wp-themes-list-table.php';
            include ABSPATH . 'wp-admin/includes/class-wp-theme-install-list-table.php';
            $theme_class = new WP_Theme_Install_List_Table();
            $paged = $theme_class->get_pagenum();
            $per_page = 36;
            $args = array('page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults);
            $args['author'] = 'bestwebsoft';
            $args = apply_filters('install_themes_table_api_args_search', $args);
            $api = themes_api('query_themes', $args);
            if (is_wp_error($api)) {
                wp_die($api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
            }
            $theme_class->items = $api->themes;
            $theme_class->set_pagination_args(array('total_items' => $api->info['results'], 'per_page' => $per_page, 'infinite_scroll' => true));
            $themes = $theme_class->items;
            foreach ($themes as $theme) {
                ?>
<div class="available-theme installable-theme"><?php 
                global $themes_allowedtags;
                if (empty($theme)) {
                    return;
                }
                $name = wp_kses($theme->name, $themes_allowedtags);
                $author = wp_kses($theme->author, $themes_allowedtags);
                $preview_title = sprintf(__('Preview &#8220;%s&#8221;'), $name);
                $preview_url = add_query_arg(array('tab' => 'theme-information', 'theme' => $theme->slug), self_admin_url('theme-install.php'));
                $actions = array();
                $install_url = add_query_arg(array('action' => 'install-theme', 'theme' => $theme->slug), self_admin_url('update.php'));
                $update_url = add_query_arg(array('action' => 'upgrade-theme', 'theme' => $theme->slug), self_admin_url('update.php'));
                $status = 'install';
                $installed_theme = wp_get_theme($theme->slug);
                if ($installed_theme->exists()) {
                    if (version_compare($installed_theme->get('Version'), $theme->version, '=')) {
                        $status = 'latest_installed';
                    } elseif (version_compare($installed_theme->get('Version'), $theme->version, '>')) {
                        $status = 'newer_installed';
                    } else {
                        $status = 'update_available';
                    }
                }
                switch ($status) {
                    default:
                    case 'install':
                        $actions[] = '<a class="install-now" href="' . esc_url(wp_nonce_url($install_url, 'install-theme_' . $theme->slug)) . '" title="' . esc_attr(sprintf(__('Install %s'), $name)) . '">' . __('Install Now') . '</a>';
                        break;
                    case 'update_available':
                        $actions[] = '<a class="install-now" href="' . esc_url(wp_nonce_url($update_url, 'upgrade-theme_' . $theme->slug)) . '" title="' . esc_attr(sprintf(__('Update to version %s'), $theme->version)) . '">' . __('Update') . '</a>';
                        break;
                    case 'newer_installed':
                    case 'latest_installed':
                        $actions[] = '<span class="install-now" title="' . esc_attr__('This theme is already installed and is up to date') . '">' . _x('Installed', 'theme') . '</span>';
                        break;
                }
                $actions[] = '<a class="install-theme-preview" href="' . esc_url($preview_url) . '" title="' . esc_attr(sprintf(__('Preview %s'), $name)) . '">' . __('Preview') . '</a>';
                $actions = apply_filters('theme_install_actions', $actions, $theme);
                ?>
							<a class="screenshot install-theme-preview" href="<?php 
                echo esc_url($preview_url);
                ?>
" title="<?php 
                echo esc_attr($preview_title);
                ?>
">
								<img src='<?php 
                echo esc_url($theme->screenshot_url);
                ?>
' width='150' />
							</a>
							<h3><?php 
                echo $name;
                ?>
</h3>
							<div class="theme-author"><?php 
                printf(__('By %s'), $author);
                ?>
</div>
							<div class="action-links">
								<ul>
									<?php 
                foreach ($actions as $action) {
                    ?>
										<li><?php 
                    echo $action;
                    ?>
</li>
									<?php 
                }
                ?>
									<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php 
                _e('Details');
                ?>
</a></li>
								</ul>
							</div>
							<?php 
                $theme_class->install_theme_info($theme);
                ?>
</div>
					<?php 
            }
            // end foreach $theme_names
            $theme_class->theme_installer();
            ?>
				</div>
			<?php 
        } elseif ('system_status' == $_GET['action']) {
            ?>
				<div class="updated fade" <?php 
            if (!(isset($_REQUEST['bwsmn_form_submit']) || isset($_REQUEST['bwsmn_form_submit_custom_email'])) || $error != "") {
                echo "style=\"display:none\"";
            }
            ?>
><p><strong><?php 
            echo $message;
            ?>
</strong></p></div>
				<div class="error" <?php 
            if ("" == $error) {
                echo "style=\"display:none\"";
            }
            ?>
><p><strong><?php 
            echo $error;
            ?>
</strong></p></div>
				<h3><?php 
            _e('System status', 'bestwebsoft');
            ?>
</h3>
				<div class="inside">
					<table class="bws_system_info">
						<thead><tr><th><?php 
            _e('Environment', 'bestwebsoft');
            ?>
</th><td></td></tr></thead>
						<tbody>
						<?php 
            foreach ($system_info['system_info'] as $key => $value) {
                ?>
	
							<tr>
								<td scope="row"><?php 
                echo $key;
                ?>
</td>
								<td scope="row"><?php 
                echo $value;
                ?>
</td>
							</tr>	
						<?php 
            }
            ?>
						</tbody>
					</table>
					<table class="bws_system_info">
						<thead><tr><th><?php 
            _e('Active Plugins', 'bestwebsoft');
            ?>
</th><th></th></tr></thead>
						<tbody>
						<?php 
            foreach ($system_info['active_plugins'] as $key => $value) {
                ?>
	
							<tr>
								<td scope="row"><?php 
                echo $key;
                ?>
</td>
								<td scope="row"><?php 
                echo $value;
                ?>
</td>
							</tr>	
						<?php 
            }
            ?>
						</tbody>
					</table>
					<table class="bws_system_info">
						<thead><tr><th><?php 
            _e('Inactive Plugins', 'bestwebsoft');
            ?>
</th><th></th></tr></thead>
						<tbody>
						<?php 
            if (!empty($system_info['inactive_plugins'])) {
                foreach ($system_info['inactive_plugins'] as $key => $value) {
                    ?>
	
								<tr>
									<td scope="row"><?php 
                    echo $key;
                    ?>
</td>
									<td scope="row"><?php 
                    echo $value;
                    ?>
</td>
								</tr>	
							<?php 
                }
            }
            ?>
						</tbody>
					</table>
					<div class="clear"></div>						
					<form method="post" action="admin.php?page=bws_plugins&amp;action=system_status">
						<p>			
							<input type="hidden" name="bwsmn_form_submit" value="submit" />
							<input type="submit" class="button-primary" value="<?php 
            _e('Send to support', 'bestwebsoft');
            ?>
" />
							<?php 
            wp_nonce_field(plugin_basename(__FILE__), 'bwsmn_nonce_submit');
            ?>
		
						</p>		
					</form>				
					<form method="post" action="admin.php?page=bws_plugins&amp;action=system_status">	
						<p>			
							<input type="hidden" name="bwsmn_form_submit_custom_email" value="submit" />						
							<input type="submit" class="button" value="<?php 
            _e('Send to custom email &#187;', 'bestwebsoft');
            ?>
" />
							<input type="text" value="<?php 
            echo $bwsmn_form_email;
            ?>
" name="bwsmn_form_email" />
							<?php 
            wp_nonce_field(plugin_basename(__FILE__), 'bwsmn_nonce_submit_custom_email');
            ?>
						</p>				
					</form>						
				</div>
			<?php 
        }
        ?>
		</div>
	<?php 
    }
Beispiel #28
0
/**
 * Retrieve list of WordPress theme features (aka theme tags)
 *
 * @since 3.1.0
 *
 * @param bool $api Optional. Whether try to fetch tags from the WordPress.org API. Defaults to true.
 * @return array Array of features keyed by category with translations keyed by slug.
 */
function get_theme_feature_list($api = true)
{
    // Hard-coded list is used if api not accessible.
    $features = array(__('Layout') => array('grid-layout' => __('Grid Layout'), 'one-column' => __('One Column'), 'two-columns' => __('Two Columns'), 'three-columns' => __('Three Columns'), 'four-columns' => __('Four Columns'), 'left-sidebar' => __('Left Sidebar'), 'right-sidebar' => __('Right Sidebar')), __('Features') => array('accessibility-ready' => __('Accessibility Ready'), 'buddypress' => __('BuddyPress'), 'custom-background' => __('Custom Background'), 'custom-colors' => __('Custom Colors'), 'custom-header' => __('Custom Header'), 'custom-logo' => __('Custom Logo'), 'custom-menu' => __('Custom Menu'), 'editor-style' => __('Editor Style'), 'featured-image-header' => __('Featured Image Header'), 'featured-images' => __('Featured Images'), 'flexible-header' => __('Flexible Header'), 'footer-widgets' => __('Footer Widgets'), 'front-page-post-form' => __('Front Page Posting'), 'full-width-template' => __('Full Width Template'), 'microformats' => __('Microformats'), 'post-formats' => __('Post Formats'), 'rtl-language-support' => __('RTL Language Support'), 'sticky-post' => __('Sticky Post'), 'theme-options' => __('Theme Options'), 'threaded-comments' => __('Threaded Comments'), 'translation-ready' => __('Translation Ready')), __('Subject') => array('blog' => __('Blog'), 'e-commerce' => __('E-Commerce'), 'education' => __('Education'), 'entertainment' => __('Entertainment'), 'food-and-drink' => __('Food & Drink'), 'holiday' => __('Holiday'), 'news' => __('News'), 'photography' => __('Photography'), 'portfolio' => __('Portfolio')));
    if (!$api || !current_user_can('install_themes')) {
        return $features;
    }
    if (!($feature_list = get_site_transient('wporg_theme_feature_list'))) {
        set_site_transient('wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS);
    }
    if (!$feature_list) {
        $feature_list = themes_api('feature_list', array());
        if (is_wp_error($feature_list)) {
            return $features;
        }
    }
    if (!$feature_list) {
        return $features;
    }
    set_site_transient('wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS);
    $category_translations = array('Layout' => __('Layout'), 'Features' => __('Features'), 'Subject' => __('Subject'));
    // Loop over the wporg canonical list and apply translations
    $wporg_features = array();
    foreach ((array) $feature_list as $feature_category => $feature_items) {
        if (isset($category_translations[$feature_category])) {
            $feature_category = $category_translations[$feature_category];
        }
        $wporg_features[$feature_category] = array();
        foreach ($feature_items as $feature) {
            if (isset($features[$feature_category][$feature])) {
                $wporg_features[$feature_category][$feature] = $features[$feature_category][$feature];
            } else {
                $wporg_features[$feature_category][$feature] = $feature;
            }
        }
    }
    return $wporg_features;
}
Beispiel #29
0
/**
 * Ajax handler for getting themes from themes_api().
 *
 * @since 3.9.0
 *
 * @global array $themes_allowedtags
 * @global array $theme_field_defaults
 */
function wp_ajax_query_themes()
{
    global $themes_allowedtags, $theme_field_defaults;
    if (!current_user_can('install_themes')) {
        wp_send_json_error();
    }
    $args = wp_parse_args(wp_unslash($_REQUEST['request']), array('per_page' => 20, 'fields' => $theme_field_defaults));
    if (isset($args['browse']) && 'favorites' === $args['browse'] && !isset($args['user'])) {
        $user = get_user_option('wporg_favorites');
        if ($user) {
            $args['user'] = $user;
        }
    }
    $old_filter = isset($args['browse']) ? $args['browse'] : 'search';
    /** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */
    $args = apply_filters('install_themes_table_api_args_' . $old_filter, $args);
    $api = themes_api('query_themes', $args);
    if (is_wp_error($api)) {
        wp_send_json_error();
    }
    $update_php = network_admin_url('update.php?action=install-theme');
    foreach ($api->themes as &$theme) {
        $theme->install_url = add_query_arg(array('theme' => $theme->slug, '_wpnonce' => wp_create_nonce('install-theme_' . $theme->slug)), $update_php);
        $theme->name = wp_kses($theme->name, $themes_allowedtags);
        $theme->author = wp_kses($theme->author, $themes_allowedtags);
        $theme->version = wp_kses($theme->version, $themes_allowedtags);
        $theme->description = wp_kses($theme->description, $themes_allowedtags);
        $theme->stars = wp_star_rating(array('rating' => $theme->rating, 'type' => 'percent', 'number' => $theme->num_ratings, 'echo' => false));
        $theme->num_ratings = number_format_i18n($theme->num_ratings);
        $theme->preview_url = set_url_scheme($theme->preview_url);
    }
    wp_send_json_success($api);
}
 static function install_theme()
 {
     check_ajax_referer(self::AJAX_NONCE, 'nonce');
     $theme_id = $_REQUEST['themeId'];
     $theme = wp_get_theme($theme_id);
     if (!$theme->exists()) {
         include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
         include_once ABSPATH . 'wp-admin/includes/theme-install.php';
         $theme_info = themes_api('theme_information', array('slug' => $theme_id, 'fields' => array('sections' => false, 'tags' => false)));
         error_log(print_r($theme_info, true));
         if (is_wp_error($theme_info)) {
             wp_send_json_error('Could not look up theme ' . $theme_id . ': ' . $theme_info->get_error_message());
             die;
         } else {
             $upgrader = new Theme_Upgrader(new Automatic_Upgrader_Skin());
             $install_response = $upgrader->install($theme_info->download_link);
             if (is_wp_error($install_response)) {
                 wp_send_json_error('Could not install theme: ' . $install_response->get_error_message());
                 die;
             } elseif (!$install_response) {
                 wp_send_json_error('Could not install theme (unspecified server error)');
                 die;
             }
         }
     }
     wp_send_json_success($theme_id);
 }