当前位置: 首页>>代码示例>>PHP>>正文


PHP install_plugin_install_status函数代码示例

本文整理汇总了PHP中install_plugin_install_status函数的典型用法代码示例。如果您正苦于以下问题:PHP install_plugin_install_status函数的具体用法?PHP install_plugin_install_status怎么用?PHP install_plugin_install_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了install_plugin_install_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_status

 public function get_status()
 {
     if (!function_exists('install_plugin_install_status')) {
         require ABSPATH . 'wp-admin/includes/plugin-install.php';
     }
     return install_plugin_install_status($this->get());
 }
开发者ID:nightsunny2,项目名称:sb-core,代码行数:7,代码来源:class-sb-plugin.php

示例2: manage

 public function manage()
 {
     if (!function_exists('plugins_api')) {
         require_once ABSPATH . '/wp-admin/includes/plugin-install.php';
     }
     preg_match_all('/####([\\d\\w\\-]{1,})####/', $this->template, $plugin_list);
     if (isset($plugin_list[1]) && is_array($plugin_list[1])) {
         $search = array();
         foreach ($plugin_list[1] as $plugin) {
             $api = plugins_api('plugin_information', array('slug' => stripslashes($plugin)));
             $status = install_plugin_install_status($api);
             switch ($status['status']) {
                 case 'install':
                     $search["####{$plugin}####"] = isset($status['url']) ? $status['url'] : 'javascript:void();';
                     $search["###{$plugin}-install-text###"] = __('Install Now');
                     break;
                 case 'update_available':
                     $search["####{$plugin}####"] = isset($status['url']) ? $status['url'] : 'javascript:void();';
                     $search["###{$plugin}-install-text###"] = __('Install Update Now');
                     break;
                 case 'newer_installed':
                     $search["####{$plugin}####"] = 'javascript:void();';
                     $search["###{$plugin}-install-text###"] = sprintf(__('Newer Version (%s) Installed'), $status['version']);
                     break;
                 case 'latest_installed':
                     $search["####{$plugin}####"] = 'javascript:void();';
                     $search["###{$plugin}-install-text###"] = __('Latest Version Installed');
                     break;
             }
         }
         $this->template = str_replace(array_keys($search), $search, $this->template);
     }
     echo $this->template;
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:34,代码来源:about.php

示例3: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $env = Validators::validateEnv($input->getOption('env'));
     $root = $this->skeleton->getWebRoot();
     $plugins = $this->skeleton->get(sprintf('wordpress.%s.plugins', $env));
     require $root . '/wp-load.php';
     require ABSPATH . 'wp-admin/includes/admin.php';
     require ABSPATH . 'wp-admin/includes/plugin-install.php';
     foreach ($plugins as $slug => $version) {
         $plugin = plugins_api('plugin_information', array('slug' => $slug));
         if (is_wp_error($plugin)) {
             throw new \Exception('Could not get plugin information for ' . $slug);
         }
         if ($version) {
             list($prefix) = explode($slug, $plugin->download_link);
             $link = sprintf('%s%s.%s.zip', $prefix, $slug, $version);
             $response = wp_remote_head($link);
             if (!isset($response['response']['code']) || $response['response']['code'] != 200) {
                 throw new \Exception('Unable to verify ' . $link);
             }
             $plugin->download_link = $link;
             $plugin->version = $version;
         }
         require ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
         $status = install_plugin_install_status($plugin);
         $upgrader = new \Plugin_Upgrader(new UpgraderSkin($output));
         $current = current(get_plugins("/{$slug}"));
         switch ($status['status']) {
             case 'install':
                 $output->write(sprintf('Installing <info>%s</info> v<comment>%s</comment>', $plugin->name, $plugin->version));
                 $upgrader->install($plugin->download_link);
                 break;
             case 'update_available':
                 if ($plugin->version == $current['Version']) {
                     $output->writeln(sprintf('<info>%s</info> v<comment>%s</comment> is already installed!', $plugin->name, $plugin->version));
                 } else {
                     $output->write(sprintf('Upgrading <info>%s</info> from <comment>%s</comment> to <comment>%s</comment>', $plugin->name, $current['Version'], $plugin->version));
                     $file = sprintf('%s/%s', $slug, key(get_plugins("/{$slug}")));
                     $upgrader->upgrade($file);
                 }
                 break;
             case 'latest_installed':
                 $output->writeln(sprintf('<info>%s</info> v<comment>%s</comment> is already installed!', $plugin->name, $current['Version']));
                 break;
             case 'newer_installed':
                 $output->writeln(sprintf('<info>%s</info> v<comment>%s</comment> is installed & newer than <comment>%s</comment>', $plugin->name, $current['Version'], $plugin->version));
                 break;
         }
     }
     if ($plugins) {
         $output->writeln(sprintf('<info>Activate plugins in the WordPress Admin</info>', $plugin->name));
     }
 }
开发者ID:ericclemmons,项目名称:wordpress-generator,代码行数:53,代码来源:InstallPluginsWordPressCommand.php

示例4: change_action_links

 public function change_action_links($action_links, $plugin)
 {
     $action_links = array();
     if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
         $status = install_plugin_install_status($plugin);
         $tracking = '?utm_source=Add-New-Plugin&utm_medium=Action-Link&utm_content=' . $_SERVER['HTTP_HOST'] . '&utm_campaign=Add-new-plugins-action-links';
         switch ($status['status']) {
             case 'install':
                 if ($status['url']) {
                     $action_links[] = '<a class="install-now button" href="http://realbigplugins.com/plugins/' . $plugin['slug'] . '/' . $tracking . '" aria-label="' . esc_attr(sprintf(__('Download %s now'), $name)) . '">' . __('Download Now') . '</a>';
                 } else {
                     $action_links[] = '<span class="button button-disabled" title="' . esc_attr__('This plugin is already installed and is up to date') . ' ">' . _x('Installed', 'plugin') . '</span>';
                 }
                 break;
             case 'update_available':
                 if ($status['url']) {
                     $action_links[] = '<a class="button" href="' . $status['url'] . '" aria-label="' . esc_attr(sprintf(__('Update %s now'), $name)) . '">' . __('Update Now') . '</a>';
                 }
                 break;
             case 'latest_installed':
             case 'newer_installed':
                 $action_links[] = '<span class="button button-disabled" title="' . esc_attr__('This plugin is already installed and is up to date') . ' ">' . _x('Installed', 'plugin') . '</span>';
                 break;
         }
     }
     $details_link = 'http://realbigplugins.com/plugins/' . $plugin['slug'] . '/' . $tracking . '&amp;TB_iframe=true&amp;width=600&amp;height=550';
     $action_links[] = '<a href="' . esc_url($details_link) . '" class="thickbox" aria-label="' . esc_attr(sprintf(__('More information about %s'), $name)) . '" data-title="' . esc_attr($name) . '">' . __('More Details') . '</a>';
     return $action_links;
 }
开发者ID:joffcrabtree,项目名称:render-extensions-listing,代码行数:29,代码来源:render-extensions-listing.php

示例5: display_rows

    /**
     * @global string $wp_version
     */
    public function display_rows()
    {
        $plugins_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array()), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array());
        $plugins_group_titles = array('Performance' => _x('Performance', 'Plugin installer group title'), 'Social' => _x('Social', 'Plugin installer group title'), 'Tools' => _x('Tools', 'Plugin installer group title'));
        $group = null;
        foreach ((array) $this->items as $plugin) {
            if (is_object($plugin)) {
                $plugin = (array) $plugin;
            }
            // Display the group heading if there is one
            if (isset($plugin['group']) && $plugin['group'] != $group) {
                if (isset($this->groups[$plugin['group']])) {
                    $group_name = $this->groups[$plugin['group']];
                    if (isset($plugins_group_titles[$group_name])) {
                        $group_name = $plugins_group_titles[$group_name];
                    }
                } else {
                    $group_name = $plugin['group'];
                }
                // Starting a new group, close off the divs of the last one
                if (!empty($group)) {
                    echo '</div></div>';
                }
                echo '<div class="plugin-group"><h3>' . esc_html($group_name) . '</h3>';
                // needs an extra wrapping div for nth-child selectors to work
                echo '<div class="plugin-items">';
                $group = $plugin['group'];
            }
            $title = wp_kses($plugin['name'], $plugins_allowedtags);
            // Remove any HTML from the description.
            $description = strip_tags($plugin['short_description']);
            $version = wp_kses($plugin['version'], $plugins_allowedtags);
            $name = strip_tags($title . ' ' . $version);
            $author = wp_kses($plugin['author'], $plugins_allowedtags);
            if (!empty($author)) {
                $author = ' <cite>' . sprintf(__('By %s'), $author) . '</cite>';
            }
            $action_links = array();
            if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
                $status = install_plugin_install_status($plugin);
                switch ($status['status']) {
                    case 'install':
                        if ($status['url']) {
                            /* translators: 1: Plugin name and version. */
                            $action_links[] = '<a class="install-now button" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url($status['url']) . '" aria-label="' . esc_attr(sprintf(__('Install %s now'), $name)) . '" data-name="' . esc_attr($name) . '">' . __('Install Now') . '</a>';
                        }
                        break;
                    case 'update_available':
                        if ($status['url']) {
                            /* translators: 1: Plugin name and version */
                            $action_links[] = '<a class="update-now button" data-plugin="' . esc_attr($status['file']) . '" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url($status['url']) . '" aria-label="' . esc_attr(sprintf(__('Update %s now'), $name)) . '" data-name="' . esc_attr($name) . '">' . __('Update Now') . '</a>';
                        }
                        break;
                    case 'latest_installed':
                    case 'newer_installed':
                        $action_links[] = '<span class="button button-disabled" title="' . esc_attr__('This plugin is already installed and is up to date') . ' ">' . _x('Installed', 'plugin') . '</span>';
                        break;
                }
            }
            $details_link = self_admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] . '&amp;TB_iframe=true&amp;width=600&amp;height=550');
            /* translators: 1: Plugin name and version. */
            $action_links[] = '<a href="' . esc_url($details_link) . '" class="thickbox" aria-label="' . esc_attr(sprintf(__('More information about %s'), $name)) . '" data-title="' . esc_attr($name) . '">' . __('More Details') . '</a>';
            if (!empty($plugin['icons']['svg'])) {
                $plugin_icon_url = $plugin['icons']['svg'];
            } elseif (!empty($plugin['icons']['2x'])) {
                $plugin_icon_url = $plugin['icons']['2x'];
            } elseif (!empty($plugin['icons']['1x'])) {
                $plugin_icon_url = $plugin['icons']['1x'];
            } else {
                $plugin_icon_url = $plugin['icons']['default'];
            }
            /**
             * Filter the install action links for a plugin.
             *
             * @since 2.7.0
             *
             * @param array $action_links An array of plugin action hyperlinks. Defaults are links to Details and Install Now.
             * @param array $plugin The plugin currently being listed.
             */
            $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin);
            $date_format = __('M j, Y @ H:i');
            $last_updated_timestamp = strtotime($plugin['last_updated']);
            ?>
            <div class="plugin-card plugin-card-<?php 
            echo sanitize_html_class($plugin['slug']);
            ?>
">
                <div class="plugin-card-top">
                    <a href="<?php 
            echo esc_url($details_link);
            ?>
" class="thickbox plugin-icon"><img
                            src="<?php 
            echo esc_attr($plugin_icon_url);
            ?>
"/></a>

//.........这里部分代码省略.........
开发者ID:richardbota,项目名称:WordPress-Theme-Development-with-Bootstrap,代码行数:101,代码来源:class-wp-plugin-install-list-table.php

示例6: install_plugin_information


//.........这里部分代码省略.........
px;"></span>
						</span>
					</a>
					<span class="counter-count"><?php 
            echo number_format_i18n($ratecount);
            ?>
</span>
				</div>
				<?php 
        }
    }
    if (!empty($api->contributors)) {
        ?>
			<h3><?php 
        _e('Contributors');
        ?>
</h3>
			<ul class="contributors">
				<?php 
        foreach ((array) $api->contributors as $contrib_username => $contrib_profile) {
            if (empty($contrib_username) && empty($contrib_profile)) {
                continue;
            }
            if (empty($contrib_username)) {
                $contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile);
            }
            $contrib_username = sanitize_user($contrib_username);
            if (empty($contrib_profile)) {
                echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
            } else {
                echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
            }
        }
        ?>
			</ul>
			<?php 
        if (!empty($api->donate_link)) {
            ?>
				<a target="_blank" href="<?php 
            echo esc_url($api->donate_link);
            ?>
"><?php 
            _e('Donate to this plugin &#187;');
            ?>
</a>
			<?php 
        }
        ?>
		<?php 
    }
    ?>
	</div>
	<div id="section-holder" class="wrap">
	<?php 
    if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
        echo '<div class="error"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
    } else {
        if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
            echo '<div class="error"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
        }
    }
    foreach ((array) $api->sections as $section_name => $content) {
        $content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/');
        $content = links_add_target($content, '_blank');
        $san_section = esc_attr($section_name);
        $display = $section_name === $section ? 'block' : 'none';
        echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
        echo $content;
        echo "\t</div>\n";
    }
    echo "</div>\n";
    echo "</div>\n";
    echo "</div>\n";
    // #plugin-information-scrollable
    echo "<div id='{$tab}-footer'>\n";
    if (!empty($api->download_link) && (current_user_can('install_plugins') || current_user_can('update_plugins'))) {
        $status = install_plugin_install_status($api);
        switch ($status['status']) {
            case 'install':
                if ($status['url']) {
                    echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
                }
                break;
            case 'update_available':
                if ($status['url']) {
                    echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') . '</a>';
                }
                break;
            case 'newer_installed':
                echo '<a class="button button-primary right disabled">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
                break;
            case 'latest_installed':
                echo '<a class="button button-primary right disabled">' . __('Latest Version Installed') . '</a>';
                break;
        }
    }
    echo "</div>\n";
    iframe_footer();
    exit;
}
开发者ID:justatechnology,项目名称:Security,代码行数:101,代码来源:plugin-install.php

示例7: easy_table_page


//.........这里部分代码省略.........
/* <![CDATA[ */
    var DsqLocal = {
        'trackbacks': [
        ],
        'trackback_url': "http:\/\/takien.com\/1126\/easy-table-is-the-easiest-way-to-create-table-in-wordpress.php\/trackback"    };
/* ]]> */
</script>

<script type="text/javascript">
/* <![CDATA[ */
(function() {
    var dsq = document.createElement('script'); dsq.type = 'text/javascript';
    dsq.async = true;
        dsq.src = 'http' + '://' + disqus_shortname + '.' + disqus_domain + '/embed.js?pname=wordpress&pver=2.72';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
/* ]]> */
</script>
<?php 
            } elseif ($_GET['gettab'] == 'about') {
                require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
                $api = plugins_api('plugin_information', array('slug' => 'easy-table'));
                ?>
 	<div>
	<h2 class="mainheader"><?php 
                echo $this->easy_table_base('name') . ' ' . $this->easy_table_base('version');
                ?>
</h2>
		<?php 
                if (!empty($api->download_link) && (current_user_can('install_plugins') || current_user_can('update_plugins'))) {
                    ?>
		<p class="action-button">
		<?php 
                    $status = install_plugin_install_status($api);
                    switch ($status['status']) {
                        case 'install':
                            if ($status['url']) {
                                echo '<a href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
                            }
                            break;
                        case 'update_available':
                            if ($status['url']) {
                                echo '<a  class="red" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') . '</a>';
                            }
                            break;
                        case 'newer_installed':
                            echo '<a class="green">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
                            break;
                        case 'latest_installed':
                            echo '<a class="green">' . __('Latest Version Installed') . '</a>';
                            break;
                    }
                    ?>
		</p>
		<?php 
                }
                ?>
		
		<ul>
<?php 
                if (!empty($api->version)) {
                    ?>
			<li><strong><?php 
                    _e('Latest Version:', 'easy-table');
                    ?>
</strong> <?php 
开发者ID:HeliWang,项目名称:EngSoc-Website,代码行数:67,代码来源:easy-table.php

示例8: icp_free_plugins_page

function icp_free_plugins_page()
{
    // run a quick security check
    if (!check_ajax_referer('icp_free_plugins_nonce', 'security')) {
        return;
    }
    ob_start();
    include ABSPATH . "wp-admin/includes/plugin-install.php";
    global $tabs, $tab, $paged, $type, $term;
    $tabs = array();
    $tab = "search";
    $per_page = 30;
    $args = array("author" => "GhozyLab", "page" => $paged, "per_page" => $per_page, "fields" => array("last_updated" => true, "downloaded" => true, "icons" => true), "locale" => get_locale());
    $args = apply_filters("install_plugins_table_api_args_{$tab}", $args);
    $api = plugins_api("query_plugins", $args);
    $item = $api->plugins;
    $plugins_allowedtags = array('a' => array('href' => array(), 'title' => array(), 'target' => array()), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'code' => array(), 'pre' => array(), 'em' => array(), 'strong' => array(), 'div' => array('class' => array()), 'span' => array('class' => array()), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), 'img' => array('src' => array(), 'class' => array(), 'alt' => array()));
    ?>
	<form id="plugin-filter">
    
<div class="wrap">
<div style="margin-top:30px;" class="wp-list-table widefat plugin-install">
	<div id="the-list">
    
		<?php 
    foreach ((array) $item as $plugin) {
        if (is_object($plugin)) {
            $plugin = (array) $plugin;
        }
        $title = wp_kses($plugin['name'], $plugins_allowedtags);
        // Remove any HTML from the description.
        $description = strip_tags($plugin['short_description']);
        $version = wp_kses($plugin['version'], $plugins_allowedtags);
        $name = strip_tags($title . ' ' . $version);
        $author = wp_kses($plugin['author'], $plugins_allowedtags);
        if (!empty($author)) {
            $author = ' <cite>' . sprintf(__('By %s'), $author) . '</cite>';
        }
        $action_links = array();
        if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
            $status = install_plugin_install_status($plugin);
            switch ($status['status']) {
                case 'install':
                    if ($status['url']) {
                        /* translators: 1: Plugin name and version. */
                        $action_links[] = '<a class="install-now button-secondary icp-button-install" href="' . $status['url'] . '" aria-label="' . esc_attr(sprintf(__('Install %s now'), $name)) . '">' . __('Install Now') . '</a>';
                    }
                    break;
                case 'update_available':
                    if ($status['url']) {
                        /* translators: 1: Plugin name and version */
                        $action_links[] = '<a class="button icp-button-update" href="' . $status['url'] . '" aria-label="' . esc_attr(sprintf(__('Update %s now'), $name)) . '">' . __('Update Now') . '</a>';
                    }
                    break;
                case 'latest_installed':
                case 'newer_installed':
                    $action_links[] = '<span class="button button-disabled" title="' . esc_attr__('This plugin is already installed and is up to date') . ' ">' . _x('Installed', 'plugin') . '</span>';
                    break;
            }
        }
        $details_link = self_admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] . '&amp;TB_iframe=true&amp;width=750&amp;height=550');
        /* translators: 1: Plugin name and version. */
        $action_links[] = '<a href="' . esc_url($details_link) . '" class="thickbox" aria-label="' . esc_attr(sprintf(__('More information about %s'), $name)) . '" data-title="' . esc_attr($name) . '">' . __('More Details') . '</a>';
        if (!empty($plugin['icons']['svg'])) {
            $plugin_icon_url = $plugin['icons']['svg'];
        } elseif (!empty($plugin['icons']['2x'])) {
            $plugin_icon_url = $plugin['icons']['2x'];
        } elseif (!empty($plugin['icons']['1x'])) {
            $plugin_icon_url = $plugin['icons']['1x'];
        } else {
            $plugin_icon_url = $plugin['icons']['default'];
        }
        /**
         * Filter the install action links for a plugin.
         *
         * @since 2.7.0
         *
         * @param array $action_links An array of plugin action hyperlinks. Defaults are links to Details and Install Now.
         * @param array $plugin       The plugin currently being listed.
         */
        $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin);
        ?>
		<div class="plugin-card drop-shadow lifted">
			<div class="plugin-card-top" style="min-height: 190px !important;">
            <?php 
        if (isset($plugin["slug"]) && $plugin["slug"] == 'easy-media-gallery') {
            echo '<div class="most_popular"></div>';
        }
        ?>
				<a href="<?php 
        echo esc_url($details_link);
        ?>
" class="thickbox plugin-icon"><img width="128" height="128" src="<?php 
        echo esc_attr($plugin_icon_url);
        ?>
" /></a>
				<div class="name column-name" style="margin-right: 20px !important;">
					<h4 style="font-size:1.5em;"><a href="<?php 
        echo esc_url($details_link);
        ?>
//.........这里部分代码省略.........
开发者ID:paulcherrypipka,项目名称:wptest,代码行数:101,代码来源:icp-admin-ajax.php

示例9: fs_install_plugin_information


//.........这里部分代码省略.........
        }
    }
    if (!empty($api->contributors)) {
        ?>
					<h3><?php 
        _e('Contributors');
        ?>
</h3>
					<ul class="contributors">
						<?php 
        foreach ((array) $api->contributors as $contrib_username => $contrib_profile) {
            if (empty($contrib_username) && empty($contrib_profile)) {
                continue;
            }
            if (empty($contrib_username)) {
                $contrib_username = preg_replace('/^.+\\/(.+)\\/?$/', '\\1', $contrib_profile);
            }
            $contrib_username = sanitize_user($contrib_username);
            if (empty($contrib_profile)) {
                echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
            } else {
                echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
            }
        }
        ?>
					</ul>
					<?php 
        if (!empty($api->donate_link)) {
            ?>
						<a target="_blank"
						   href="<?php 
            echo esc_url($api->donate_link);
            ?>
"><?php 
            _e('Donate to this plugin &#187;');
            ?>
</a>
					<?php 
        }
        ?>
				<?php 
    }
    ?>
		</div>
		<div id="section-holder" class="wrap">
	<?php 
    if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
        echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been tested with your current version of WordPress.') . '</p></div>';
    } else {
        if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
            echo '<div class="notice notice-warning"><p>' . '<strong>' . __('Warning:') . '</strong> ' . __('This plugin has not been marked as compatible with your version of WordPress.') . '</p></div>';
        }
    }
    foreach ((array) $api->sections as $section_name => $content) {
        $content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/');
        $content = links_add_target($content, '_blank');
        $san_section = esc_attr($section_name);
        $display = $section_name === $section ? 'block' : 'none';
        echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
        echo $content;
        echo "\t</div>\n";
    }
    echo "</div>\n";
    echo "</div>\n";
    echo "</div>\n";
    // #plugin-information-scrollable
    echo "<div id='{$tab}-footer'>\n";
    if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
        if (!empty($api->checkout_link) && isset($api->plans) && 0 < is_array($api->plans)) {
            echo ' <a class="button button-primary right" href="' . esc_url(add_query_arg(array('plugin_id' => $plan->plugin_id, 'plan_id' => $plan->id, 'pricing_id' => $plan->pricing[0]->id, 'billing_cycle' => $billing_cycle), $api->checkout_link)) . '" target="_parent">' . __fs('purchase', $api->slug) . '</a>';
            // @todo Add Cart concept.
            //			echo ' <a class="button right" href="' . $status['url'] . '" target="_parent">' . __( 'Add to Cart' ) . '</a>';
        } else {
            if (!empty($api->download_link)) {
                $status = install_plugin_install_status($api);
                switch ($status['status']) {
                    case 'install':
                        if ($status['url']) {
                            echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
                        }
                        break;
                    case 'update_available':
                        if ($status['url']) {
                            echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') . '</a>';
                        }
                        break;
                    case 'newer_installed':
                        echo '<a class="button button-primary right disabled">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
                        break;
                    case 'latest_installed':
                        echo '<a class="button button-primary right disabled">' . __('Latest Version Installed') . '</a>';
                        break;
                }
            }
        }
    }
    echo "</div>\n";
    iframe_footer();
    exit;
}
开发者ID:majick777,项目名称:wordpress-sdk,代码行数:101,代码来源:fs-plugin-functions.php

示例10: pluginStatus

 /**
  * 
  * @param type $slug
  * 
  * @return type
  */
 public function pluginStatus($slug)
 {
     require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
     $plugin = plugins_api('plugin_information', array('slug' => $slug));
     return install_plugin_install_status($plugin);
 }
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:12,代码来源:Repository.php

示例11: render_menu_page_plugins

    public function render_menu_page_plugins()
    {
        $plugins = (array) $this->get_plugins();
        ?>
		<div id="welcome-panel" class="welcome-panel">

			<div class="welcome-panel-content">

				<h2><?php 
        _e('Meet the plugins that meet our high standards.', 'gd_system');
        ?>
</h2>

				<p class="about-description"><?php 
        _e("We've partnered with the world’s top WordPress plugin authors to provide a list of plugins that work well with GoDaddy WordPress hosting.", 'gd_system');
        ?>
</p>

			</div>

		</div>

		<div id="plugin-filter">

			<div class="wp-list-table widefat plugin-install">

				<h2 class="screen-reader-text"><?php 
        _e('Plugins list');
        ?>
</h2>

				<div id="the-list">

					<?php 
        if (!$plugins) {
            ?>

						<div class="error">

							<p><?php 
            _e('Whoops! There was a problem fetching the list of plugins, please try reloading this page.', 'gd_system');
            ?>
</p>

						</div>

					<?php 
        }
        ?>

					<?php 
        foreach ($plugins as $plugin) {
            if (!function_exists('install_plugin_install_status')) {
                require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
            }
            $status = install_plugin_install_status($plugin);
            $install_status = !empty($status['status']) ? $status['status'] : 'install';
            $install_url = !empty($status['url']) ? $status['url'] : null;
            $install_file = !empty($status['file']) ? $status['file'] : null;
            $more_details_link = add_query_arg(array('tab' => 'plugin-information', 'plugin' => urlencode($plugin['slug']), 'TB_iframe' => 'true', 'width' => 600, 'height' => 550), self_admin_url('plugin-install.php'));
            ?>

						<div class="plugin-card plugin-card-<?php 
            echo esc_attr($plugin['slug']);
            ?>
">

							<div class="plugin-card-top">

								<div class="name column-name">

									<h3>

										<?php 
            if ($plugin['plugins_api']) {
                ?>

											<a href="<?php 
                echo esc_url($more_details_link);
                ?>
" class="thickbox" aria-label="<?php 
                esc_attr_e(sprintf(__('More information about %s'), $plugin['name']));
                ?>
" data-title="<?php 
                echo esc_attr($plugin['name']);
                ?>
">

										<?php 
            }
            ?>

												<?php 
            echo esc_html($plugin['name']);
            ?>

												<img src="<?php 
            echo esc_url($plugin['icon']);
            ?>
" class="plugin-icon" alt="">
//.........这里部分代码省略.........
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:101,代码来源:class-gd-system-plugin-admin-page.php

示例12: learn_press_get_add_on_action_link

function learn_press_get_add_on_action_link($plugin, $file)
{
    $action_links = array();
    if (current_user_can('install_plugins') || current_user_can('update_plugins')) {
        $name = '';
        if (!empty($plugin['source']) && $plugin['source'] == 'wp') {
            $status = install_plugin_install_status($plugin);
            switch ($status['status']) {
                case 'install':
                    if ($status['url']) {
                        /* translators: 1: Plugin name and version. */
                        $action_links[] = '<a class="install-now button" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url($status['url']) . '" aria-label="' . esc_attr(sprintf(__('Install %s now'), $name)) . '" data-name="' . esc_attr($name) . '"><span>' . __('Install Now') . '</span></a>';
                    }
                    break;
                case 'update_available':
                    if ($status['url']) {
                        /* translators: 1: Plugin name and version */
                        $action_links[] = '<a class="update-now button" data-plugin="' . esc_attr($status['file']) . '" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url($status['url']) . '" aria-label="' . esc_attr(sprintf(__('Update %s now'), $name)) . '" data-name="' . esc_attr($name) . '"><span>' . __('Update Now') . '</span></a>';
                    }
                    break;
                case 'latest_installed':
                case 'newer_installed':
                    $action_links[] = '<span class="button button-disabled" title="' . esc_attr__('This plugin is already installed and is up to date') . ' ">' . _x('Installed', 'plugin') . '</span>';
                    break;
            }
            if (learn_press_is_plugin_install($file)) {
                if (is_plugin_active($file)) {
                    $action_links[] = '<a class="button disable-now" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url(wp_nonce_url('plugins.php?action=deactivate&plugin=' . $file, 'deactivate-plugin_' . $file)) . '" aria-label="' . esc_attr(sprintf(__('Disable %s now'), $name)) . '" data-name="' . esc_attr($name) . '"><span>' . __('Disable Now', 'learn_press') . '</span></a>';
                } else {
                    $action_links[] = '<a class="button enable-now" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url(wp_nonce_url('plugins.php?action=activate&plugin=' . $file, 'activate-plugin_' . $file)) . '" aria-label="' . esc_attr(sprintf(__('Enable %s now'), $name)) . '" data-name="' . esc_attr($name) . '"><span>' . __('Enable Now', 'learn_press') . '</span></a>';
                }
            }
        } else {
            if (learn_press_is_plugin_install($file)) {
                if (is_plugin_active($file)) {
                    $action_links[] = '<a class="button disable-now" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url(wp_nonce_url('plugins.php?action=deactivate&plugin=' . $file, 'deactivate-plugin_' . $file)) . '" aria-label="' . esc_attr(sprintf(__('Disable %s now'), $name)) . '" data-name="' . esc_attr($name) . '"><span>' . __('Disable Now', 'learn_press') . '</span></a>';
                } else {
                    $action_links[] = '<a class="button enable-now" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url(wp_nonce_url('plugins.php?action=activate&plugin=' . $file, 'activate-plugin_' . $file)) . '" aria-label="' . esc_attr(sprintf(__('Enable %s now'), $name)) . '" data-name="' . esc_attr($name) . '"><span>' . __('Enable Now', 'learn_press') . '</span></a>';
                }
            } else {
                if ($plugin['url']) {
                    $action_links[] = '<a class="buy-now button" data-slug="' . esc_attr($plugin['slug']) . '" href="' . esc_url($plugin['url']) . '" aria-label="' . esc_attr(sprintf(__('Buy %s now'), $name)) . '" data-name="' . esc_attr($name) . '">' . __('Buy Now') . '</a>';
                }
            }
        }
        //$action_links[] = $file;
    }
    return $action_links;
}
开发者ID:thonysmith,项目名称:LearnPress,代码行数:49,代码来源:lp-add-on-functions.php

示例13: install_from_repo

 protected function install_from_repo($slug, $assoc_args)
 {
     $api = plugins_api('plugin_information', array('slug' => $slug));
     if (is_wp_error($api)) {
         if (null === maybe_unserialize($api->get_error_data())) {
             WP_CLI::error("Can't find the plugin in the WordPress.org repository.");
         } else {
             WP_CLI::error($api);
         }
     }
     if (isset($assoc_args['version'])) {
         list($link) = explode($slug, $api->download_link);
         if ('dev' == $assoc_args['version']) {
             $api->download_link = $link . $slug . '.zip';
             $api->version = 'Development Version';
         } else {
             $api->download_link = $link . $slug . '.' . $assoc_args['version'] . '.zip';
             $api->version = $assoc_args['version'];
             // check if the requested version exists
             $response = wp_remote_head($api->download_link);
             if (!$response || $response['headers']['content-type'] != 'application/octet-stream') {
                 WP_CLI::error("Can't find the requested plugin's version " . $assoc_args['version'] . " in the WordPress.org plugins repository.");
             }
         }
     }
     $status = install_plugin_install_status($api);
     WP_CLI::line(sprintf('Installing %s (%s)', $api->name, $api->version));
     switch ($status['status']) {
         case 'update_available':
         case 'install':
             $upgrader = WP_CLI\Utils\get_upgrader($this->upgrader);
             $result = $upgrader->install($api->download_link);
             if ($result && isset($assoc_args['activate'])) {
                 WP_CLI::line("Activating '{$slug}'...");
                 $this->activate(array($slug));
             }
             break;
         case 'newer_installed':
             WP_CLI::error(sprintf('Newer version (%s) installed.', $status['version']));
             break;
         case 'latest_installed':
             WP_CLI::error('Latest version already installed.');
             break;
     }
 }
开发者ID:nunomorgadinho,项目名称:wp-cli,代码行数:45,代码来源:plugin.php

示例14: install

 /**
  * Install a new plugin
  *
  * @param array $args
  * @param array $assoc_args
  */
 function install($args, $assoc_args)
 {
     if (empty($args)) {
         WP_CLI::line("usage: wp plugin install <plugin-name>");
         exit;
     }
     $slug = stripslashes($args[0]);
     // Force WordPress to update the plugin list
     wp_update_plugins();
     $api = plugins_api('plugin_information', array('slug' => $slug));
     if (!$api) {
         WP_CLI::error('Can\'t find the plugin in the WordPress.org plugins repository.');
         exit;
     }
     if (isset($assoc_args['dev'])) {
         list($link) = explode($slug, $api->download_link);
         $api->download_link = $link . $slug . '.zip';
         $api->version = 'Development Version';
     }
     $status = install_plugin_install_status($api);
     WP_CLI::line(sprintf('Installing %s (%s)', $api->name, $api->version));
     switch ($status['status']) {
         case 'update_available':
         case 'install':
             $upgrader = WP_CLI::get_upgrader('Plugin_Upgrader');
             $result = $upgrader->install($api->download_link);
             if ($result) {
                 if (isset($assoc_args['activate'])) {
                     system("wp plugin activate " . WP_CLI::compose_args($args, $assoc_args));
                 }
             }
             break;
         case 'newer_installed':
             WP_CLI::error(sprintf('Newer version (%s) installed', $status['version']));
             break;
         case 'latest_installed':
             WP_CLI::error('Latest version already installed');
             break;
     }
 }
开发者ID:bytewang,项目名称:wp-cli,代码行数:46,代码来源:plugin.php

示例15: esc_html_e

            esc_html_e($plugin->purchasedate);
            ?>
</td>
		<?php 
            /*
            <td>
            	<?php if ($plugin->isactive) : ?>
            	<?php esc_html_e('Yes', 'plugpress')  ?>
            	<?php else: ?>
            	<span class="plugpress-red plugpress-bold"><?php esc_html_e('No', 'plugpress')  ?></span>
            	<?php endif; ?>
            </td>
            */
            ?>
		<?php 
            $status = install_plugin_install_status($plugin, true);
            $action = '';
            switch ($status['status']) {
                case 'install':
                    if ($status['url']) {
                        $action = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr(sprintf(__('Install %s', 'plugpress'), $name)) . '">' . __('Install Now', 'plugpress') . '</a>';
                    } else {
                        $action = '<span title="' . esc_attr__('This plugin is already installed and is up to date', 'plugpress') . ' ">' . __('Installed') . '</span>';
                    }
                    break;
                case 'update_available':
                    if ($status['url']) {
                        $action = '<a href="' . $status['url'] . '" title="' . esc_attr(sprintf(__('Update to version %s', 'plugpress'), $status['version'])) . '" class="plugpress-bold plugpress-orange">' . sprintf(__('Update Now', 'plugpress'), $status['version']) . '</a>';
                    }
                    break;
                case 'latest_installed':
开发者ID:BGCX067,项目名称:facebook-store-svn-to-git,代码行数:31,代码来源:account.php


注:本文中的install_plugin_install_status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。