/**
  * Add a settings link to the  pluginlist
  *
  * @since   0.1
  * @access  public
  * @static
  * @param   string array links under the pluginlist
  * @return  array
  */
 public static function plugin_settings_link($links)
 {
     $settings_page = is_multisite() ? 'settings.php' : 'options-general.php';
     $settings_link = '<a href="' . network_admin_url($settings_page) . '?page=' . RW_Site_Config::$plugin_base_name . '">' . __('Settings') . '</a>';
     array_unshift($links, $settings_link);
     return $links;
 }
 public function w3tc_admin_bar_menu($menu_items)
 {
     if ($this->_config->is_extension_active_frontend('fragmentcache')) {
         $menu_items['20510.fragmentcache'] = array('id' => 'w3tc_flush_fragmentcache', 'parent' => 'w3tc_flush', 'title' => __('Fragment Cache: All Fragments', 'w3-total-cache'), 'href' => wp_nonce_url(network_admin_url('admin.php?page=w3tc_dashboard&amp;w3tc_flush_fragmentcache'), 'w3tc'));
     }
     return $menu_items;
 }
function ds_delete_stale()
{
    global $wpdb;
    $query = "SELECT * FROM {$wpdb->signups} ORDER BY registered DESC";
    $results = $wpdb->get_results($query, ARRAY_A);
    if (isset($_GET['delete'])) {
        $delete = $_GET['delete'];
    }
    if (isset($_GET['del_stale_active'])) {
        $del_stale_active = $_GET['del_stale_active'];
    }
    if (isset($_GET['del_stale_inactive'])) {
        $del_stale_inactive = $_GET['del_stale_inactive'];
    }
    $location = network_admin_url('users.php?page=act_keys');
    if (!empty($delete)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE activation_key = '{$delete}'");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    if (!empty($del_stale_active)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE active = 1 AND DATE(registered) < DATE_SUB(curdate(), INTERVAL 30 DAY)");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    if (!empty($del_stale_inactive)) {
        check_admin_referer('activation_key');
        $wpdb->query("DELETE FROM {$wpdb->signups} WHERE active = 0 AND DATE(registered) < DATE_SUB(curdate(), INTERVAL 30 DAY)");
        echo "<meta http-equiv='refresh' content='0;url={$location}' />";
        exit;
    }
    echo '<div class="wrap">';
    echo "<h2>User Activation Keys</h2>";
    if ($results) {
        echo '<p>The following is a list of user activation keys from $wpdb->signups. Delete a key to allow the username to (re)signup and bypass the "couple days" it takes WP to free up its hold on a user name. You can also manually approve users that for whatever reason have not completed their activation.</p>';
        echo '<div class="tablenav"> <span class="alignleft">';
        echo '<a class="button-secondary" href="' . wp_nonce_url($location . '&del_stale_active', 'activation_key') . '" class="delete">' . __('Delete stale active signup keys older than 30 days') . '</a>';
        echo '<a class="button-secondary" href="' . wp_nonce_url($location . '&del_stale_inactive', 'activation_key') . '" class="delete">' . __('Delete stale inactive signup keys older than 30 days') . '</a>';
        echo '</span>';
        echo '</div><br class="clear" />';
        echo '<table class="widefat"><tbody>';
        echo '<thead><th>#</th><th>Registered</th><th>User</th><th>Email</th><th>Approve</th></thead>';
        foreach ($results as $rows) {
            global $ct;
            echo '<tr><td>' . ++$ct . '</td><td>' . $rows['registered'] . '</td><td>' . $rows['user_login'] . '</td><td>' . $rows['user_email'] . '</td>';
            if ($rows['active'] != '1') {
                echo '<td><a href="' . site_url('wp-activate.php?key=' . $rows['activation_key']) . '" target="_blank">approve</a> | <a href="' . wp_nonce_url($location . '&delete=' . $rows['activation_key'], 'activation_key') . '">delete unused key</a></td>';
            } else {
                echo '<td>User Activated ' . $rows['activated'] . ' | <a href="' . wp_nonce_url($location . '&delete=' . $rows['activation_key'], 'activation_key') . '">delete uncecessary key</a></td>';
            }
            echo '</tr>';
        }
        echo '</tbody></table>';
    } else {
        echo '<p>No user activation keys in $wpdb->signups. If you delete a user, you should be able to reuse the username immediatley. If the user still had a registration key, it would need to be deleted before you could signup again right away with the same username. You can also manually approve users that for whatever reason have not completed their activation.</p>';
    }
    echo '</div>';
}
 function updater_install()
 {
     //normal
     $active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
     if (in_array('pagelines-updater/pagelines-updater.php', $active_plugins)) {
         return;
     }
     // ms
     if (!function_exists('is_plugin_active_for_network')) {
         require_once ABSPATH . '/wp-admin/includes/plugin.php';
     }
     if (is_plugin_active_for_network('pagelines-updater/pagelines-updater.php')) {
         return $slug = 'pagelines-updater';
     }
     $install_url = wp_nonce_url(network_admin_url('update.php?action=install-plugin&plugin=pagelines-updater'), 'install-plugin_pagelines-updater');
     $activate_url = 'plugins.php?action=activate&plugin=' . urlencode('pagelines-updater/pagelines-updater.php') . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode(wp_create_nonce('activate-plugin_pagelines-updater/pagelines-updater.php'));
     $message = sprintf('<a class="btn btn-mini" href="%s"> %s', esc_url($install_url), __('Install the PageLines Updater plugin</a> to activate a key and get updates for your PageLines themes and plugins.', 'pagelines'));
     $is_downloaded = false;
     $plugins = array_keys(get_plugins());
     foreach ($plugins as $plugin) {
         if (strpos($plugin, 'pagelines-updater.php') !== false) {
             $is_downloaded = true;
             $message = sprintf('<a class="btn btn-mini" href="%s">%s', esc_url(network_admin_url($activate_url)), __('Activate the PageLines Updater plugin</a> to activate your key and get updates for your PageLines themes and plugins.', 'pagelines'));
         }
     }
     echo '<div class="updated fade"><p>' . $message . '</p></div>' . "\n";
 }
 /**
  * Save module options.
  *
  * @return    void
  */
 public function update_modules()
 {
     check_admin_referer($this->nonce_action);
     if (!current_user_can('manage_network_options')) {
         wp_die('FU');
     }
     $this->set_module_activation_status();
     /**
      * Runs before the redirect.
      *
      * Process your fields in the $_POST superglobal here and then call update_site_option().
      *
      * @param array $_POST
      */
     do_action('mlp_modules_save_fields', $_POST);
     // backwards compatibility
     if (has_action('mlp_settings_save_fields')) {
         _doing_it_wrong('mlp_settings_save_fields', 'mlp_settings_save_fields is deprecated, use mlp_modules_save_fields instead.', '1.2');
         /**
          * @see mlp_modules_save_fields
          * @deprecated
          */
         do_action('mlp_settings_save_fields');
     }
     wp_safe_redirect(network_admin_url('settings.php?page=mlp&message=updated'));
     exit;
 }
 /**
  * Display a notice if the "WPWeb Updater" plugin hasn't been installed.
  * @return void
  */
 function wpweb_updater_notice()
 {
     $active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
     if (in_array('wpweb-updater/wpweb-updater.php', $active_plugins)) {
         return;
     }
     $slug = 'wpweb-updater';
     $install_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $slug), 'install-plugin_' . $slug);
     $activate_url = 'plugins.php?action=activate&plugin=' . urlencode('wpweb-updater/wpweb-updater.php') . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode(wp_create_nonce('activate-plugin_wpweb-updater/wpweb-updater.php'));
     //initilize variables
     $message = $dismiss_url = $dismiss_link = '';
     $dismiss_notice = get_site_option('dismiss_install_wpweb_notice');
     //if( !$dismiss_notice ) { //if notice dismissed
     $message = '';
     $dismiss_url = add_query_arg('action', 'install-wpweb-dismiss', add_query_arg('nonce', wp_create_nonce('install-wpweb-dismiss')));
     $dismiss_link = '<p class="alignright"><a href="' . esc_url($dismiss_url) . '">' . 'Dismiss' . '</a></p>';
     //}
     $is_downloaded = false;
     $plugins = array_keys(get_plugins());
     foreach ($plugins as $plugin) {
         if (strpos($plugin, 'wpweb-updater.php') !== false) {
             $is_downloaded = true;
             $message = '<a href="' . esc_url(network_admin_url($activate_url)) . '">Activate the WPWeb Updater plugin</a> to get updates for your WPWeb plugins.';
             $dismiss_link = '';
         }
     }
     if (!empty($message)) {
         //If message is not empty
         echo '<div class="updated fade"><p  class="alignleft">' . $message . '</p>' . $dismiss_link . '<div class="clear"></div></div>' . "\n";
     }
 }
 public function get_login_url($redirect_to, $extra_info)
 {
     if (is_array($extra_info) && !empty($extra_info['user_id']) && is_numeric($extra_info['user_id'])) {
         $user_id = $extra_info['user_id'];
         if (false == ($login_key = $this->_get_autologin_key($user_id))) {
             return $this->_generic_error_response('user_key_failure');
         }
         // Default value
         $redirect_url = network_admin_url();
         if (is_array($redirect_to) && !empty($redirect_to['module'])) {
             switch ($redirect_to['module']) {
                 case 'updraftplus':
                     if ('initiate_restore' == $redirect_to['action'] && class_exists('UpdraftPlus_Options')) {
                         $redirect_url = UpdraftPlus_Options::admin_page_url() . '?page=updraftplus&udaction=initiate_restore&entities=' . urlencode($redirect_to['data']['entities']) . '&showdata=' . urlencode($redirect_to['data']['showdata']) . '&backup_timestamp=' . (int) $redirect_to['data']['backup_timestamp'];
                     } elseif ('download_file' == $redirect_to['action']) {
                         $findex = empty($redirect_to['data']['findex']) ? 0 : (int) $redirect_to['data']['findex'];
                         // e.g. ?udcentral_action=dl&action=updraftplus_spool_file&backup_timestamp=1455101696&findex=0&what=plugins
                         $redirect_url = site_url() . '?udcentral_action=spool_file&action=updraftplus_spool_file&findex=' . $findex . '&what=' . urlencode($redirect_to['data']['what']) . '&backup_timestamp=' . (int) $redirect_to['data']['backup_timestamp'];
                     }
                     break;
                 case 'direct_url':
                     $redirect_url = $redirect_to['url'];
                     break;
             }
         }
         $login_key = apply_filters('updraftplus_remotecontrol_login_key', array('key' => $login_key, 'created' => time(), 'redirect_url' => $redirect_url), $redirect_to, $extra_info);
         // Over-write any previous value - only one can be valid at a time)
         update_user_meta($user_id, 'updraftcentral_login_key', $login_key);
         return $this->_response(array('login_url' => network_site_url('?udcentral_action=login&login_id=' . $user_id . '&login_key=' . $login_key['key'])));
     } else {
         return $this->_generic_error_response('user_unknown');
     }
 }
/**
 * Function that outputs admin notice if theme has update
 */
function qode_envato_toolkit_notice()
{
    //is Envato WordPress Toolkit plugin installed?
    if (defined('EWPT_PLUGIN_VER')) {
        $options = get_option(EWPT_PLUGIN_SLUG);
        $current_page = get_current_screen();
        //don't show update notification on envato wordpress toolkit plugin page
        if ($current_page->parent_base !== 'envato-wordpress-toolkit') {
            if (is_array($options) && !empty($options['api_key']) && !empty($options['user_name'])) {
                $envato_api = new Envato_Protected_API($options['user_name'], $options['api_key']);
                //get current theme info
                $theme_version = qode_get_theme_info_item('Version');
                $theme_name = qode_get_theme_info_item('Name');
                $theme_author = qode_get_theme_info_item('Author');
                //get all user's themes
                $premium_themes = $envato_api->wp_list_themes();
                $qode_envato_item = new stdClass();
                if (is_array($premium_themes) && count($premium_themes)) {
                    foreach ($premium_themes as $premium_theme) {
                        //check if premium theme is current theme
                        if ($premium_theme->theme_name == $theme_name && $premium_theme->author_name == $theme_author) {
                            $qode_envato_item = $premium_theme;
                            break;
                        }
                    }
                }
                //is version if currently installed theme lower than latest version?
                $need_update = version_compare($theme_version, $qode_envato_item->version, '<') ? TRUE : FALSE;
                if ($need_update && current_user_can('update_themes')) {
                    echo '<div class="updated"><p>' . __('There is a new version of ' . $theme_name . ' available. You can view it\'s details <a href="' . network_admin_url('admin.php?page=' . EWPT_PLUGIN_SLUG . '&tab=themes') . '">here</a>', 'qode') . '</p></div>';
                }
            }
        }
    }
}
Exemple #9
0
function ra_replicator_filter_site_actions($actions, $blog_id)
{
    if (!is_main_site($blog_id)) {
        $actions['replicate'] = '<a href="' . esc_url(wp_nonce_url(network_admin_url('sites.php?page=wp-replicator&amp;replicate=' . $blog_id), 'replicate-' . $blog_id)) . '">' . __('Replicate') . '</a>';
    }
    return $actions;
}
 function init()
 {
     global $wpmudev_un;
     if (class_exists('WPMUDEV_Dashboard') || isset($wpmudev_un->version) && version_compare($wpmudev_un->version, '3.4', '<')) {
         return;
     }
     // Schedule update cron on main site only
     if (is_main_site()) {
         if (!wp_next_scheduled('wpmudev_scheduled_jobs')) {
             wp_schedule_event(time(), 'twicedaily', 'wpmudev_scheduled_jobs');
         }
         add_action('wpmudev_scheduled_jobs', array($this, 'updates_check'));
     }
     add_action('delete_site_transient_update_plugins', array(&$this, 'updates_check'));
     //refresh after upgrade/install
     add_action('delete_site_transient_update_themes', array(&$this, 'updates_check'));
     //refresh after upgrade/install
     if (is_admin() && current_user_can('install_plugins')) {
         add_action('site_transient_update_plugins', array(&$this, 'filter_plugin_count'));
         add_action('site_transient_update_themes', array(&$this, 'filter_theme_count'));
         add_filter('plugins_api', array(&$this, 'filter_plugin_info'), 101, 3);
         //run later to work with bad autoupdate plugins
         add_filter('themes_api', array(&$this, 'filter_plugin_info'), 101, 3);
         //run later to work with bad autoupdate plugins
         add_action('admin_init', array(&$this, 'filter_plugin_rows'), 15);
         //make sure it runs after WP's
         add_action('core_upgrade_preamble', array(&$this, 'disable_checkboxes'));
         add_action('activated_plugin', array(&$this, 'set_activate_flag'));
         //remove version 1.0
         remove_action('admin_notices', 'wdp_un_check', 5);
         remove_action('network_admin_notices', 'wdp_un_check', 5);
         //remove version 2.0, a bit nasty but only way
         remove_all_actions('all_admin_notices', 5);
         //if dashboard is installed but not activated
         if (file_exists(WP_PLUGIN_DIR . '/wpmudev-updates/update-notifications.php')) {
             if (!get_site_option('wdp_un_autoactivated')) {
                 //include plugin API if necessary
                 if (!function_exists('activate_plugin')) {
                     require_once ABSPATH . 'wp-admin/includes/plugin.php';
                 }
                 $result = activate_plugin('/wpmudev-updates/update-notifications.php', network_admin_url('admin.php?page=wpmudev'), is_multisite());
                 if (!is_wp_error($result)) {
                     //if autoactivate successful don't show notices
                     update_site_option('wdp_un_autoactivated', 1);
                     return;
                 }
             }
             add_action('admin_print_styles', array(&$this, 'notice_styles'));
             add_action('all_admin_notices', array(&$this, 'activate_notice'), 5);
         } else {
             //dashboard not installed at all
             if (get_site_option('wdp_un_autoactivated')) {
                 update_site_option('wdp_un_autoactivated', 0);
                 //reset flag when dashboard is deleted
             }
             add_action('admin_print_styles', array(&$this, 'notice_styles'));
             add_action('all_admin_notices', array(&$this, 'install_notice'), 5);
         }
     }
 }
 private static function add_network_entries($wp_admin_bar)
 {
     // add network dashboard
     $wp_admin_bar->add_node(['id' => self::podcast_toolbar_id('network', 'dashboard'), 'title' => __('Podlove Dashboard', 'podlove'), 'parent' => 'network-admin', 'href' => network_admin_url('admin.php?page=podlove_network_settings_handle')]);
     // add network templates
     $wp_admin_bar->add_node(['id' => self::podcast_toolbar_id('network', 'templates'), 'title' => __('Podlove Templates', 'podlove'), 'parent' => 'network-admin', 'href' => network_admin_url('admin.php?page=podlove_templates_settings_handle')]);
 }
 function gettext($translated, $original, $domain)
 {
     if ('Comment author must have a previously approved comment' != $original) {
         return $translated;
     }
     return sprintf(__('Comment author must have a previously approved comment (<a href="%s">and not be on probation</a>)', 'comment-probation'), network_admin_url('plugins.php') . '#comment-probation');
 }
function wangguard_welcome_splash()
{
    global $wuangguard_parent, $wangguard_version;
    if (!defined('WANGGUARD_VERSION')) {
        define('WANGGUARD_VERSION', $wangguard_version);
    }
    if (defined('WANGGUARD_VERSION')) {
        $wangguard_act_version = WANGGUARD_VERSION;
    }
    if (get_site_option('wangguard-option-version') == $wangguard_act_version) {
        return;
    } elseif ($wuangguard_parent == 'update.php') {
        return;
    } elseif ($wuangguard_parent == 'update-core.php') {
        return;
    } else {
        update_site_option('wangguard-option-version', $wangguard_act_version);
        if (!is_multisite()) {
            $wangguardredirect = esc_url(admin_url(add_query_arg(array('page' => 'wangguard_about'), 'admin.php')));
        } else {
            $wangguardredirect = esc_url(network_admin_url(add_query_arg(array('page' => 'wangguard_about'), 'admin.php')));
        }
        wp_redirect($wangguardredirect);
        exit;
    }
}
function stats_is_plugin_available($plugin_slug = '', $plugin_name = '', $link_class = '', $link_id = '')
{
    if (empty($plugin_slug)) {
        return;
    }
    if (empty($plugin_name)) {
        $plugin_name = __('Activate Plugin', 'stats');
    }
    $action = '';
    if (file_exists(WP_PLUGIN_DIR . '/' . $plugin_slug)) {
        $plugins = get_plugins('/' . $plugin_slug);
        if (!empty($plugins)) {
            $keys = array_keys($plugins);
            $plugin_file = $plugin_slug . '/' . $keys[0];
            $action = '<a 	id="' . esc_attr($link_id) . '"
							class="' . esc_attr($link_class) . '"
							href="' . esc_url(wp_nonce_url(admin_url('plugins.php?action=activate&plugin=' . $plugin_file . '&from=plugins'), 'activate-plugin_' . $plugin_file)) . '"title="' . esc_attr__('Activate Plugin', 'stats') . '"">' . esc_attr($plugin_name) . '</a>';
        }
    }
    if (empty($action) && function_exists('is_main_site') && is_main_site()) {
        $action = '<a 	id="' . esc_attr($link_id) . '"
							class="thickbox ' . esc_attr($link_class) . '"
							href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&from=plugins&TB_iframe=true&width=600&height=550')) . '" title="' . esc_attr__('Install Plugin', 'stats') . '">' . esc_attr($plugin_name) . '</a>';
    }
    return $action;
}
 /**
  * Add an extra update message to the update plugin notification. Thanks BP!
  */
 public static function update_notices()
 {
     if (!self::check_api_key()) {
         $admin_url = is_multisite() ? network_admin_url('admin.php?page=events-manager-options') : admin_url('edit.php?post_type=' . EM_POST_TYPE_EVENT . '&page=events-manager-options');
         echo '<p style="font-style:italic; border-top: 1px solid #ddd; padding-top: 3px">' . sprintf(__('Please enter a valid API key in your <a href="%s">settings page</a>.', 'em-pro'), $admin_url) . '</p>';
     }
 }
 function current_context_url($path)
 {
     if (is_multisite() and defined('WP_NETWORK_ADMIN') and WP_NETWORK_ADMIN == true) {
         return network_admin_url($path);
     }
     return admin_url($path);
 }
 /**
  * Activate plugin action
  *
  * @return void
  */
 function activate($network_wide)
 {
     w3_require_once(W3TC_INC_DIR . '/functions/activation.php');
     if (w3_is_network()) {
         if ($network_wide) {
             // we are in network activation
         } else {
             if ($_GET['action'] == 'error_scrape' && strpos($_SERVER['REQUEST_URI'], '/network/') !== false) {
                 // workaround for error_scrape page called after error
                 // really we are in network activation and going to throw some error
             } else {
                 echo 'Please <a href="' . network_admin_url('plugins.php') . '">network activate</a> W3 Total Cache when using WordPress Multisite.';
                 die;
             }
         }
     }
     /**
      * Create cache folder and extension files
      */
     try {
         w3_activation_create_required_files();
         if (!$this->_config->own_config_exists()) {
             $this->_config->save();
         }
         // save admin config
         $admin_config = w3_instance('W3_ConfigAdmin');
         if (!$admin_config->own_config_exists()) {
             $admin_config->save();
         }
     } catch (Exception $e) {
         w3_activation_error_on_exception($e);
     }
     delete_option('w3tc_request_data');
     add_option('w3tc_request_data', '', null, 'no');
 }
 /**
  * Add additional links to the plugin row
  * If we're not running as a plugin, this won't do anything,
  * because plugin_basename won't match any active plugin path.
  */
 public function plugin_row_meta($meta, $basename)
 {
     if ($basename == $this->plugin->plugin_basename) {
         $meta[] = '<a href="' . network_admin_url('plugins.php?page=' . $this->readme_page_slug) . '">How to use this plugin</a>';
     }
     return $meta;
 }
 /**
  * Show notice
  */
 public function notice()
 {
     // only show to users who have the required capability
     if (!current_user_can(self::CAPABILITY)) {
         return;
     }
     add_thickbox();
     echo '<div class="notice is-dismissible notice-info">';
     # List of required plugins
     echo '<p>';
     echo sprintf(__("%s requires the following plugin(s):", 'mailchimp-for-wp'), '<strong>' . $this->plugin_name . '</strong>');
     echo '<ul class="ul-square">';
     foreach ($this->required_plugins as $plugin) {
         $link_class = '';
         $in_wordpress_repo = preg_match('/wordpress\\.org\\/plugins\\/([\\w+-]+)/i', $plugin['url'], $matches);
         if ($in_wordpress_repo && isset($matches[1])) {
             $slug = $matches[1];
             $plugin['url'] = network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $slug . '&TB_iframe=true&width=600&height=550');
             $link_class = 'thickbox';
         }
         echo sprintf('<li><a href="%s" class="%s">%s</a> (' . __('version %s or higher', 'mailchimp-for-wp') . ')</li>', $plugin['url'], $link_class, $plugin['name'], $plugin['version']);
     }
     echo '</ul>';
     echo __('Either install or update the required plugins. If you already have the required version(s) installed, please do not forget to activate the plugins.', 'mailchimp-for-wp');
     echo '</p>';
     echo '</div>';
 }
function powerpressplayer_videojs_info()
{
    $plugin_link = '';
    if (!function_exists('add_videojs_header') && file_exists(WP_PLUGIN_DIR . '/' . 'videojs-html5-video-player-for-wordpress')) {
        $plugin_file = 'videojs-html5-video-player-for-wordpress' . '/' . 'video-js.php';
        $plugin_link = '<a href="' . esc_url(wp_nonce_url(admin_url('plugins.php?plugin_status=active&action=activate&plugin=' . $plugin_file), 'activate-plugin_' . $plugin_file)) . '"title="' . esc_attr__('Activate Plugin') . '"">' . __('VideoJS - HTML5 Video Player for WordPress plugin', 'powerpress') . '</a>';
    } else {
        $plugin_link = '<a href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . 'videojs-html5-video-player-for-wordpress' . '&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="' . esc_attr__('Install Plugin') . '">' . __('VideoJS - HTML5 Video Player for WordPress plugin', 'powerpress') . '</a>';
    }
    ?>
	<p>
		<?php 
    echo __('VideoJS is a HTML5 JavaScript and CSS video player with fallback to Flash. ', 'powerpress');
    ?>
	</p>
	
	<?php 
    if ($plugin_link) {
        ?>
	<p <?php 
        echo function_exists('add_videojs_header') ? '' : ' style="background-color: #FFFFE0; border: 1px solid #E6DB55; padding: 8px 12px; line-height: 29px; font-weight: bold; font-size: 14px; display:inline;"';
        ?>
>
		<?php 
        echo sprintf(__('The %s must be installed and activated in order to enable this feature.', 'powerpress'), $plugin_link);
        ?>
	</p>
	<?php 
    }
}
	function no_items() {
		if ( $this->search || $this->features ) {
			_e( 'No items found.' );
			return;
		}

		if ( is_multisite() ) {
			if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
				printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ), network_admin_url( 'theme-install.php' ) );

				return;
			} elseif ( current_user_can( 'manage_network_themes' ) ) {
				printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ) );

				return;
			}
			// else, fallthrough. install_themes doesn't help if you can't enable it.
		} else {
			if ( current_user_can( 'install_themes' ) ) {
				printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress.org Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );

				return;
			}
		}
		// Fallthrough.
		printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
	}
    protected function get_theme_info_html(WP_Theme $theme)
    {
        $name = $theme->display('Name');
        $version = $theme->display('Version');
        $description = $theme->display('Description');
        $desc_title = esc_attr($theme->get('Description'));
        $author = $theme->display('Author');
        $screenshot = $theme->get_screenshot();
        $thumbnail_style = $screenshot !== false ? sprintf('style="background-image:url(%s);"', $screenshot) : '';
        $theme_url = network_admin_url(add_query_arg('theme', $theme->get_stylesheet(), 'themes.php'));
        $version_label = __('Version:', 'wtaiu');
        $author_label = __('By', 'wtaiu');
        $output = <<<OUTPUT

<div class="theme-info" title="{$desc_title}">
    <a href="{$theme_url}" class="theme-screenshot" {$thumbnail_style}></a>
    <div class="theme-info-wrap">
        <h3 class="theme-info-header" title="{$name}">
            <a href="{$theme_url}" class="theme-name">{$name}</a>
        </h3>
        <p class="theme-version">{$version_label} {$version}</p>
        <p class="theme-author">{$author_label} {$author}</p>
    </div>
</div>

OUTPUT;
        return $output;
    }
 protected function getDownloadUrl()
 {
     global $wp_filesystem;
     $this->skin->feedback('download_envato');
     $package_filename = 'js_composer.zip';
     $res = $this->fs_connect(array(WP_CONTENT_DIR));
     if (!$res) {
         return new WP_Error('no_credentials', __("Error! Can't connect to filesystem", 'js_composer'));
     }
     $username = WPBakeryVisualComposerSettings::get('envato_username');
     $api_key = WPBakeryVisualComposerSettings::get('envato_api_key');
     $purchase_code = WPBakeryVisualComposerSettings::get('js_composer_purchase_code');
     if (empty($username) || empty($api_key) || empty($purchase_code)) {
         return new WP_Error('no_credentials', __('Error! Envato username, api key and your purchase code are required for downloading updates from Envato marketplace for the Visual Composer. Visit <a href="' . network_admin_url('options-general.php?page=wpb_vc_settings&tab=updater') . '' . '">Settings</a> to fix.', 'js_composer'));
     }
     $json = wp_remote_get($this->envatoDownloadPurchaseUrl($username, $api_key, $purchase_code));
     $result = json_decode($json['body'], true);
     if (!isset($result['download-purchase']['download_url'])) {
         return new WP_Error('no_credentials', __('Error! Envato API error' . (isset($result['error']) ? ': ' . $result['error'] : '.'), 'js_composer'));
     }
     $result['download-purchase']['download_url'];
     $download_file = download_url($result['download-purchase']['download_url']);
     if (is_wp_error($download_file)) {
         return $download_file;
     }
     $upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade_tmp/js_composer_envato_package';
     if (is_dir($upgrade_folder)) {
         $wp_filesystem->delete($upgrade_folder);
     }
     $result = unzip_file($download_file, $upgrade_folder);
     if ($result && is_file($upgrade_folder . '/' . $package_filename)) {
         return $upgrade_folder . '/' . $package_filename;
     }
     return new WP_Error('no_credentials', __('Error on unzipping package', 'js_composer'));
 }
 /**
  * Display admin notices to help users solve requirements for getting events.
  *
  * @access public
  */
 public function display_admin_notice()
 {
     // Don't display notices to users that can't do anything about it.
     if (!current_user_can('install_plugins')) {
         return;
     }
     // Notices are only displayed on the dashboard, plugins, tools, and settings admin pages.
     $page = get_current_screen()->base;
     $display_on_pages = array('dashboard', 'plugins', 'tools', 'options-general');
     if (!in_array($page, $display_on_pages)) {
         return;
     }
     // We're all fired up. No need for any admin notices.
     if (self::has_active_connection()) {
         return;
     }
     // Keyring is not already installed.
     if (!file_exists(plugin_dir_path(dirname(__DIR__)) . 'keyring')) {
         $notice = sprintf(__('Eventbrite needs the <a href="%1$s">Keyring plugin</a> to work. <a href="%2$s" class="thickbox">Install Keyring</a>.', 'eventbrite-api'), 'https://wordpress.org/plugins/keyring/', esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=keyring&TB_iframe=true&width=600&height=550')));
     } elseif (!is_plugin_active('keyring/keyring.php')) {
         $notice = sprintf(__('Eventbrite needs the <a href="%1$s">Keyring plugin</a> activated, with a connection to eventbrite.com. <a href="%2$s">Activate Keyring</a>.', 'eventbrite-api'), 'https://wordpress.org/plugins/keyring/', esc_url(wp_nonce_url(network_admin_url('plugins.php?action=activate&plugin=keyring/keyring.php&plugin_status=all&paged=1&s'), 'activate-plugin_keyring/keyring.php')));
     } elseif (!self::has_active_connection()) {
         $notice = sprintf(__('The Eventbrite API plugin needs a working connection to eventbrite.com. We recommend first <a href="%1$s">logging in</a> to your eventbrite.com account. <a href="%2$s">Connect to Eventbrite</a>.', 'eventbrite-api'), 'https://www.eventbrite.com/login/', esc_url(get_admin_url(null, 'tools.php?page=keyring&action=services')));
     }
     // Output notice HTML.
     printf('<div id="message" class="updated"><p>%s</p></div>', $notice);
 }
 function vw_notice_regenerate_thumbnail_on_version_2()
 {
     $plugin_name = 'force-regenerate-thumbnails';
     $plugin_install_link = '<a href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_name . '&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="More info about ' . $plugin_name . '">this plugin</a>';
     $class = "update-nag";
     $message = "<strong>PRESSO Theme:</strong> Old theme data detected. Please regenerate all thumbnails by using " . $plugin_install_link . '| <a href="?dismiss_notice_regenerate_thumbnail_on_version_2=true">Hide Notice</a>';
     echo "<div class=\"{$class}\"> <p>{$message}</p></div>";
 }
Exemple #26
0
 public function setMultiSite()
 {
     if (is_multisite()) {
         $this->tmpBaseUrl = $this->baseUrl;
         $this->baseUrl = network_admin_url("admin.php?page=" . NEXTEND_SMARTSLIDER_3_URL_PATH);
     }
     return $this;
 }
function wptouch_get_license_activation_url()
{
    if (is_plugin_active_for_network(WPTOUCH_PLUGIN_SLUG)) {
        return network_admin_url('admin.php?page=wptouch-admin-license');
    } else {
        return admin_url('admin.php?page=wptouch-admin-license');
    }
}
Exemple #28
0
 /**
  * Adds Stream to the admin bar under the "My Sites > Network Admin" menu
  * if Stream has been network-activated
  */
 function network_admin_bar_menu($admin_bar)
 {
     if (!self::is_network_activated()) {
         return;
     }
     $href = add_query_arg(array('page' => WP_Stream_Admin::RECORDS_PAGE_SLUG), network_admin_url(WP_Stream_Admin::ADMIN_PARENT_PAGE));
     $admin_bar->add_menu(array('id' => 'network-admin-stream', 'parent' => 'network-admin', 'title' => esc_html__('Stream', 'stream'), 'href' => esc_url($href)));
 }
 function url()
 {
     if ($this->settings_url) {
         return $this->settings_url;
     }
     $this->settings_url = add_query_arg(array('page' => 'wds-multisite-aggregate'), network_admin_url('settings.php'));
     return $this->settings_url;
 }
function icl_reset_wpml($blog_id = false)
{
    global $wpdb, $sitepress_settings;
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'resetwpml') {
        check_admin_referer('resetwpml');
    }
    if (empty($blog_id)) {
        $blog_id = isset($_POST['id']) ? $_POST['id'] : $wpdb->blogid;
    }
    if ($blog_id || !function_exists('is_multisite') || !is_multisite()) {
        if (function_exists('is_multisite') && is_multisite()) {
            switch_to_blog($blog_id);
        }
        wp_clear_scheduled_hook('update_wpml_config_index');
        $icl_tables = array($wpdb->prefix . 'icl_languages', $wpdb->prefix . 'icl_languages_translations', $wpdb->prefix . 'icl_translations', $wpdb->prefix . 'icl_translation_status', $wpdb->prefix . 'icl_translate_job', $wpdb->prefix . 'icl_translate', $wpdb->prefix . 'icl_locale_map', $wpdb->prefix . 'icl_flags', $wpdb->prefix . 'icl_content_status', $wpdb->prefix . 'icl_core_status', $wpdb->prefix . 'icl_node', $wpdb->prefix . 'icl_strings', $wpdb->prefix . 'icl_string_packages', $wpdb->prefix . 'icl_translation_batches', $wpdb->prefix . 'icl_string_translations', $wpdb->prefix . 'icl_string_status', $wpdb->prefix . 'icl_string_positions', $wpdb->prefix . 'icl_message_status', $wpdb->prefix . 'icl_reminders');
        foreach ($icl_tables as $icl_table) {
            $wpdb->query("DROP TABLE IF EXISTS " . $icl_table);
        }
        delete_option('icl_sitepress_settings');
        delete_option('icl_sitepress_version');
        delete_option('_icl_cache');
        delete_option('_icl_admin_option_names');
        delete_option('wp_icl_translators_cached');
        delete_option('wpml32_icl_non_translators_cached');
        delete_option('WPLANG');
        delete_option('wpml-package-translation-db-updates-run');
        delete_option('wpml-package-translation-refresh-required');
        delete_option('wpml-package-translation-string-packages-table-updated');
        delete_option('wpml-package-translation-string-table-updated');
        delete_option('icl_translation_jobs_basket');
        delete_option('widget_icl_lang_sel_widget');
        delete_option('icl_admin_messages');
        delete_option('icl_adl_settings');
        delete_option('wpml_tp_com_log');
        delete_option('wpml_config_index');
        delete_option('wpml_config_index_updated');
        delete_option('wpml_config_files_arr');
        $sitepress_settings = null;
        wp_cache_init();
        $wpmu_sitewide_plugins = (array) maybe_unserialize(get_site_option('active_sitewide_plugins'));
        if (!isset($wpmu_sitewide_plugins[ICL_PLUGIN_FOLDER . '/sitepress.php'])) {
            $file = plugin_basename(WP_PLUGIN_DIR . '/' . ICL_PLUGIN_FOLDER . '/sitepress.php');
            remove_action('deactivate_' . $file, 'icl_sitepress_deactivate');
            deactivate_plugins(basename(ICL_PLUGIN_PATH) . '/sitepress.php');
            $ra = get_option('recently_activated');
            $ra[basename(ICL_PLUGIN_PATH) . '/sitepress.php'] = time();
            update_option('recently_activated', $ra);
        } else {
            update_option('_wpml_inactive', true);
        }
        if (isset($_REQUEST['submit'])) {
            wp_redirect(network_admin_url('admin.php?page=' . ICL_PLUGIN_FOLDER . '/menu/network.php&updated=true&action=resetwpml'));
        }
        if (function_exists('is_multisite') && is_multisite()) {
            restore_current_blog();
        }
    }
}