/** * Sets up Developer Plugin * @subcommand install-plugins * @synopsis --type=<type> [--activate] */ function install_plugins($args, $assoc_args) { global $automattic_developer; // wp-cli doesn't fire admin_init since 0.11.2 if (!did_action('admin_init')) { $automattic_developer->admin_init(); } $type = $assoc_args['type']; $activate = isset($assoc_args['activate']) && $assoc_args['activate'] == "true"; $reco_plugins = $automattic_developer->recommended_plugins; $installed_plugins = array_keys(get_plugins()); $types = array_keys($automattic_developer->get_project_types()); if (in_array($type, $types)) { $automattic_developer->save_project_type($type); foreach ($reco_plugins as $slug => $plugin) { $path = $automattic_developer->get_path_for_recommended_plugin($slug); $activate_plugin = $activate && ('all' == $plugin['project_type'] || $type == $plugin['project_type']); // Download the plugin if we don't already have it if (!in_array($path, $installed_plugins)) { WP_CLI::run_command(explode(" ", "plugin install {$slug}")); } // Install the plugin if --activate and it's the right type if (is_plugin_inactive($path) && $activate_plugin) { if (NULL == activate_plugin($path)) { WP_CLI::success("Activated " . $plugin['name']); } } } } else { WP_CLI::error("Specify a valid type to install: <" . implode("|", $types) . ">"); } }
function ninja_forms_tab_addons() { $uri = 'http://ninjaforms.com/downloads/category/ninja-forms/feed/'; //include_once(ABSPATH . WPINC . '/feed.php'); $feed = fetch_feed($uri); if (!is_wp_error($feed)) { $items = $feed->get_items(0, 0); } $items = array(array('title' => __('Layout and Styles', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/01/layout-styles-300x121.png', 'content' => __('This extension gives you power over the look and feel of your Ninja Forms from within your WordPress admin. It gives you the ability to style almost every part of your form, down to the the smallest detail, with little to no …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/layout-styles/', 'plugin' => 'ninja-forms-style/ninja-forms-style.php', 'docs' => 'http://ninjaforms.com/documentation/extensions/layout-styles/'), array('title' => __('PayPal Express', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/09/paypal-express-300x121.png', 'content' => __('Accept payments using PayPal Express and Ninja Forms', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/paypal-express/', 'plugin' => 'ninja-forms-paypal-express/paypal-express.php', 'docs' => 'http://ninjaforms.com/documentation/extensions/paypal-express/'), array('title' => __('Save User Progress', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/save-user-progress-300x121.png', 'content' => __('Sometimes forms can grow quite large, and it would be very helpful for users to be able to save their progress and come back at a later time. This extension does just that for you. Using the built-in WordPress user …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/save-user-progress/', 'plugin' => 'ninja-forms-save-progress/save-progress.php', 'docs' => ''), array('title' => __('File Uploads', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/file-uploads1-300x121.png', 'content' => __('File Uploads for Ninjas Forms gives you the ability to insert file upload fields to your forms. This will allow users the ability to upload images, docs, audio or video files, or anything else you may need. You can easily …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/file-uploads/', 'plugin' => 'ninja-forms-uploads/file-uploads.php', 'docs' => 'http://ninjaforms.com/documentation/extensions/file-uploads/'), array('title' => __('Front-End Posting', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/front-end-posting-300x121.png', 'content' => __('The Ninja Forms Front-end Posting extension gives you the power of the WordPress post editor on any publicly viewable page you choose. You can allow users the ability to create content and have it assigned to any publicly available built-in or custom …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/front-end-posting/', 'plugin' => 'ninja-forms-post-creation/post-creation.php', 'docs' => ''), array('title' => __('Front-End Editor', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/03/front-end-editor.png', 'content' => __('The Front-End Editor Extension brings the power of your WordPress admin to your front-facing site. It is a one-stop solution for almost all your front-end editing needs. Users can now be allowed to create, edit, or delete posts, pages, or any custom post type without the need to see the WordPress admin.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/front-end-editor/', 'plugin' => 'ninja-forms-front-end-editor/front-end-editor.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/front-end-editor/'), array('title' => __('Multi-Part Forms', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/multi-part-forms-300x121.png', 'content' => __('The Multi-Part Forms extension allows you to break long forms into sections, creating a natural flow for your visitors. You can add a breadcrumb trail through the various sections of the form and a progress bar so that your users …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/multi-part-forms/', 'plugin' => 'ninja-forms-multi-part/multi-part.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/multi-part-forms/'), array('title' => __('Conditional Logic', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/conditional-logic-300x121.png', 'content' => __('This extension for Ninja Forms allows you to create “smart” forms. Fields within these forms can dynamically change based upon user input; show or hide fields based on a selected item, set field values based upon a list selection, or …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/conditional-logic/', 'plugin' => 'ninja-forms-conditionals/conditionals.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/conditional-logic/'), array('title' => __('MailChimp', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/04/mailchimp-for-ninja-forms-300x121.png', 'content' => __('The MailChimp extension allows you to quickly create newsletter signup forms for your MailChimp account using the power and flexibility that Ninja Forms provides. …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/mail-chimp/', 'plugin' => 'ninja-forms-mailchimp/ninja-forms-mailchimp.php', 'docs' => ''), array('title' => __('Campaign Monitor', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/05/campaign-monitor-header-300x121.png', 'content' => __('The Campaign Monitor extension allows you to quickly create newsletter signup forms for your Campaign Monitor account using the power and flexibility that Ninja Forms provides. …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/mail-chimp/', 'plugin' => 'ninja-forms-campaign-monitor/ninja-forms-campaign-monitor.php', 'docs' => ''), array('title' => __('User Analytics', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/05/user-analytics-header-300x121.png', 'content' => __('The User Analytics extension will help website owners understand how hot a lead is based on extra data automatically collected about the user. …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/user-analytics/', 'plugin' => 'ninja-forms-user-analytics/nf-user-analytics.php', 'docs' => ''), array('title' => __('Constant Contact', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/07/constant-contact-300x121.png', 'content' => __('The Constant Contact extension allows you to quickly create newsletter signup forms for your Constant Contact account using the power and…', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/constant-contact/', 'plugin' => 'ninja-forms-constant-contact/ninja-forms-constant-contact.php', 'docs' => ''), array('title' => __('AWeber', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/08/aweber-300x121.png', 'content' => __('Use Ninja Forms to quickly create flexible newsletter signup forms for your AWeber email marketing account.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/aweber/', 'plugin' => 'ninja-forms-aweber/ninja-forms-aweber.php', 'docs' => ''), array('title' => __('Picatcha', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/08/picatcha-header-300x121.png', 'content' => __('The Picatcha extension allows you to add image-based CAPTHA to your forms.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/picatcha/', 'plugin' => 'ninja-forms-picatcha/ninja-forms-picatcha.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/picatcha/'), array('title' => __('MailPoet (formerly Wysija)', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/09/mailpoet-300x121.png', 'content' => __('The MailPoet (formerly Wysija) extension allows you to quickly create newsletter signup forms for your MailPoet mailing lists using the power and flexibility that Ninja Forms provides.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/mailpoet/', 'plugin' => 'ninja-forms-mailpoet/nf-mailpoet.php', 'docs' => ''), array('title' => __('HubSpot', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/10/hubspot-300x121.png', 'content' => __('The Ninja Forms HubSpot Extension extends a forms capabilities by forwarding submit data directly into your HubSpot account.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/hubspot/', 'plugin' => 'ninja-forms-hubspot/ninja-forms-hubspot.php', 'docs' => ''), array('title' => __('Text Message Notifications', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/10/text-message-notifications-300x121.png', 'content' => __('Send text message notifications to a site administrator when a form has been submitted.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/text-message-notifications/', 'plugin' => 'ninja-forms-text-message-notifications/nf-text-message-notifications.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/text-message-notifications/'), array('title' => __('Modal Forms', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/11/modal-forms-300x121.png', 'content' => __('Open your Ninja Forms with a simple and clean modal pop-up.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/modal-forms/', 'plugin' => 'ninja-forms-modal/ninja-forms-modal.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/modal-forms/')); foreach ($items as $item) { echo '<div class="nf-extend nf-box">'; echo '<img src="' . $item['image'] . '" />'; echo '<h2>' . $item['title'] . '</h2>'; echo '<div>'; echo '<p>' . $item['content'] . '</p>'; if (!empty($item['docs'])) { echo '<a href="' . $item['docs'] . '" class="button-secondary nf-doc-button">' . __('Documentation', 'ninja-forms') . '</a>'; } else { echo '<p>' . __('Documentation coming soon.', 'ninja-forms') . '</a>.</p>'; } echo '</div>'; if (file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) { if (is_plugin_active($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Active', 'ninja-forms') . '</span>'; } elseif (is_plugin_inactive($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Installed', 'ninja-forms') . '</span>'; } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } echo '</div>'; } }
function plugin_activate_example_activate() { // Activation code here... // let's create some categories upon activation //http://codex.wordpress.org/Function_Reference/wp_insert_category for ($i = 0; $i < 5; $i++) { $catarr = array('cat_name' => 'My Category' . $i, 'category_description' => 'A Cool Category' . $i, 'category_nicename' => 'category-slug' . $i, 'category_parent' => ''); wp_insert_category($catarr); } // should be root path of the wp install $wordpress_path = get_home_path(); require_once $wordpress_path . '/wp-load.php'; //not sure if this line is needed //activate_plugin() is here: require_once $wordpress_path . '/wp-admin/includes/plugin.php'; // we're going to activate our plugins that are dependencies $plugins = array("filters-example", "js-example", "shortcode-example"); // see //http://wordpress.stackexchange.com/questions/62967/why-activate-plugin-is-not-working-in-register-activation-hook foreach ($plugins as $plugin) { $plugin_path = $wordpress_path . 'wp-content/plugins/' . $plugin . '/' . $plugin . '.php'; if (file_exists($plugin_path) && is_plugin_inactive($plugin . '/' . $plugin . '.php')) { // just double check that the plugin exists and unactivated add_action('update_option_active_plugins', 'plugin_activation_dependencies'); } } }
/** * Install * * Runs on plugin install to populates the settings fields for those plugin * pages. After successful install, the user is redirected to the MASHSB Welcome * screen. * * @since 2.0 * @global $wpdb * @global $mashsb_options * @global $wp_version * @return void */ function mashsb_install() { global $wpdb, $mashsb_options, $wp_version; // Add Upgraded From Option $current_version = get_option('mashsb_version'); if ($current_version) { update_option('mashsb_version_upgraded_from', $current_version); } // Update the current version update_option('mashsb_version', MASHSB_VERSION); // Add plugin installation date and variable for rating div add_option('mashsb_installDate', date('Y-m-d h:i:s')); add_option('mashsb_RatingDiv', 'no'); if (!get_option('mashsb_update_notice')) { add_option('mashsb_update_notice', 'no'); } /* Setup some default options * Store our initial social networks in separate option row. * For easier modification and to prevent some trouble */ $networks = array('Facebook', 'Twitter', 'Subscribe'); if (is_plugin_inactive('mashshare-networks/mashshare-networks.php')) { update_option('mashsb_networks', $networks); } // Bail if activating from network, or bulk if (is_network_admin() || isset($_GET['activate-multi'])) { return; } // Add the transient to redirect / not for multisites set_transient('_mashsb_activation_redirect', true, 30); }
function axiom_widget_is_active($slug) { if (!function_exists('is_plugin_inactive')) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } return !is_plugin_inactive("{$slug}.php"); }
/** * Check if target plugin is inactive wrapper * * @param string $plugin_file * * @return bool */ public static function is_plugin_inactive($plugin_file) { if (!function_exists('is_plugin_inactive')) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; } return is_plugin_inactive($plugin_file); }
/** * Activate add-on. * * @access public * @return void */ public function activate_addon() { //make sure we activated an add-on if (empty($_POST['gmw_action']) || $_POST['gmw_action'] != 'activate_addon') { return; } $active_addon = $_POST['gmw_addon_activated']; $plugin_basename = $_POST['gmw_addon_basename']; //look for nonce if (empty($_POST[$active_addon . '_activate_addon_nonce'])) { return; } //varify nonce if (!wp_verify_nonce($_POST[$active_addon . '_activate_addon_nonce'], $active_addon . '_activate_addon_nonce')) { return; } unset($this->addons[$active_addon]); $this->addons[$active_addon] = 'active'; update_option('gmw_addons', $this->addons); $plugins = get_plugins(); //activate the addon if (array_key_exists($plugin_basename, $plugins) && is_plugin_inactive($plugin_basename)) { activate_plugins($plugin_basename); } //reload the page to prevent resubmission wp_safe_redirect(admin_url('admin.php?page=gmw-add-ons&gmw_notice=addon_activated&gmw_notice_status=updated')); exit; }
function plugins_messages(){ $plugin_messages = array(); include_once(ABSPATH . 'wp-admin/includes/plugin.php' ); if(is_plugin_inactive('polylang/polylang.php')) { // if (is_plugin_page('polylang/polylang.php')) { // $plugin_messages[] = '當前主題要求必須啟用 Polylang 插件'; // } else { $plugin_messages[] = '當前主題要求必須安裝 Polylang 插件,<a href="' . admin_url() . '/plugin-install.php?tab=plugin-information&plugin=polylang&TB_iframe=true" class="thickbox">下載插件2</a>'; // } } if(is_plugin_inactive( 'cool-tag-cloud/cool-tag-cloud.php' )) { // if (is_plugin_page('cool-tag-cloud/cool-tag-cloud.php')) { // // activate_plugins( 'cool-tag-cloud/cool-tag-cloud.php' ); // $plugin_messages[] = '當前主題要求必須啟用 Cool Tag Cloud 插件'; // } else { $plugin_messages[] = '當前主題要求必須安裝 Cool Tag Cloud 插件,<a href="' . admin_url() . '/plugin-install.php?tab=plugin-information&plugin=cool-tag-cloud&TB_iframe=true" class="thickbox">下載插件</a>'; // } } if( count( $plugin_messages ) > 0 ){ echo '<div id="message" class="error">'; foreach( $plugin_messages as $message ) echo '<p><strong>' . $message . '</strong></p>'; echo '</div>'; } }
function test_is_plugin_inactive_false() { activate_plugin('hello.php'); $test = is_plugin_inactive('hello.php'); $this->assertFalse($test); deactivate_plugins('hello.php'); }
/** * Initialize the plugin by registering any hooks the plugin needs to run * * @static */ public static function init() { // If Wordfence is not activated, display a warning if (is_plugin_inactive('wordfence/wordfence.php')) { add_thickbox(); add_action('admin_notices', array('SM_Wordfence_Scanner', 'display_warning')); } }
public function activate() { // Check if WP-Piwik is installed if (!isset($GLOBALS['wp-piwik'])) { if (is_plugin_inactive('wp-piwik/wp-piwik.php')) { add_action('update_option_active_plugins', array($this, 'activate_piwik')); } else { deactivate_plugins(plugin_basename(__FILE__)); wp_die('This plugin requires WP-Piwik. Install that one first.', 'Install WP-Piwik', array('back_link' => true)); } } }
function ninja_forms_tab_addons() { // $uri = 'https://ninjaforms.com/downloads/category/ninja-forms/feed/'; //include_once(ABSPATH . WPINC . '/feed.php'); // $feed = fetch_feed( $uri ); // if (!is_wp_error( $feed ) ) : // $items = $feed->get_items(0, 0); // endif; $items = wp_remote_get('https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h'); $items = wp_remote_retrieve_body($items); $items = json_decode($items, true); //shuffle( $items ); foreach ($items as $item) { $plugin_data = array(); if (!empty($item['plugin']) && file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) { $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true); } $version = isset($plugin_data['Version']) ? $plugin_data['Version'] : ''; if (!empty($version) && $version < $item['version']) { echo '<div class="error"><p>'; echo '<strong>' . $item['title'] . '</strong> requires an update. You have version <strong>' . $version . '</strong> installed. The current version is <strong>' . $item['version'] . '</strong>.'; echo '</p></div>'; } } foreach ($items as $item) { echo '<div class="nf-extend nf-box">'; echo '<img src="' . $item['image'] . '" />'; echo '<h2>' . $item['title'] . '</h2>'; echo '<div class="nf-extend-content">'; echo '<p>' . $item['content'] . '</p>'; echo '<div class="nf-extend-buttons">'; if (!empty($item['docs'])) { echo '<a href="' . $item['docs'] . '" class="button-secondary nf-doc-button">' . __('Documentation', 'ninja-forms') . '</a>'; } else { echo '<p>' . __('Documentation coming soon.', 'ninja-forms') . '</a>.</p>'; } if (!empty($item['plugin']) && file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) { if (is_plugin_active($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Active', 'ninja-forms') . '</span>'; } elseif (is_plugin_inactive($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Installed', 'ninja-forms') . '</span>'; } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } echo '</div>'; echo '</div>'; echo '</div>'; } }
/** * Check plugin status * * @return array * @since 1.3 */ public function check_plugin_status($slug, $extension) { if (is_plugin_active($slug)) { echo '<button class="button-primary">' . __('Already Installed', 'wp-analytify') . '</button>'; } else { if (array_key_exists($slug, $this->plugins_list)) { echo '<a href="' . admin_url('plugins.php') . '" class="button-primary">' . __('Activate Plugin', 'wp-analytify') . '</a>'; } else { if (is_plugin_inactive($slug)) { if ($extension->status != '') { echo '<a target="_blank" href="' . $extension->url . '" class="button-primary">' . __('Coming Soon', 'wp-analytify') . '</a>'; } else { echo '<a target="_blank" href="' . $extension->url . '" class="button-primary">' . __('Get this add-on', 'wp-analytify') . '</a>'; } } } } }
function ninja_forms_tab_addons() { $uri = 'http://ninjaforms.com/downloads/category/ninja-forms/feed/'; //include_once(ABSPATH . WPINC . '/feed.php'); $feed = fetch_feed($uri); if (!is_wp_error($feed)) { $items = $feed->get_items(0, 0); } $items = wp_remote_get('https://ninjaforms.com/?extend_feed=jlhrbgf89734go7387o4g3h'); $items = wp_remote_retrieve_body($items); $items = json_decode($items, true); //shuffle( $items ); foreach ($items as $item) { echo '<div class="nf-extend nf-box">'; echo '<img src="' . $item['image'] . '" />'; echo '<h2>' . $item['title'] . '</h2>'; echo '<div>'; echo '<p>' . $item['content'] . '</p>'; if (!empty($item['docs'])) { echo '<a href="' . $item['docs'] . '" class="button-secondary nf-doc-button">' . __('Documentation', 'ninja-forms') . '</a>'; } else { echo '<p>' . __('Documentation coming soon.', 'ninja-forms') . '</a>.</p>'; } echo '</div>'; if (!empty($item['plugin']) && file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) { if (is_plugin_active($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Active', 'ninja-forms') . '</span>'; } elseif (is_plugin_inactive($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Installed', 'ninja-forms') . '</span>'; } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } echo '</div>'; } }
/** * Display a notice with a list of recommended plugins. */ function restful_notice_recommended_plugins() { $plugins = array('brightslider/brightslider.php' => array('name' => 'BrightSlider', 'slug' => 'brightslider'), 'church-theme-content/church-theme-content.php' => array('name' => 'Church Theme Content', 'slug' => 'church-theme-content'), 'post-type-archive-links/post-type-archive-links.php' => array('name' => 'Post Type Archive Link', 'slug' => 'post-type-archive-links')); $inactive = array(); foreach ($plugins as $plugin => $data) { if (is_plugin_inactive($plugin)) { $inactive[] = $data; } } if (count($inactive) > 0) { wp_enqueue_script('plugin-install'); add_thickbox(); $plugins_str = ''; $i = 0; foreach ($inactive as $plugin) { if ($i > 0) { $plugins_str .= ', '; } $install_url = esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] . '&TB_iframe=true&width=772&height=644')); $plugins_str .= '<a href="' . $install_url . '" class="thickbox"><strong>' . $plugin['name'] . '</strong></a>'; $i++; } ?> <div class="notice error"> <p><?php _e('Restful recommends the following plugin(s):', 'restful'); ?> <?php echo $plugins_str; ?> </p> </div> <?php } }
function ninja_forms_tab_addons() { $uri = 'http://ninjaforms.com/downloads/category/ninja-forms/feed/'; //include_once(ABSPATH . WPINC . '/feed.php'); $feed = fetch_feed($uri); if (!is_wp_error($feed)) { $items = $feed->get_items(0, 0); } $items = array(array('title' => __('Layout and Styles', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/01/layout-styles-300x121.png', 'content' => __('This extension gives you power over the look and feel of your Ninja Forms from within your WordPress admin. It gives you the ability to style almost every part of your form, down to the the smallest detail, with little to no …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/layout-styles/', 'plugin' => 'ninja-forms-style/ninja-forms-style.php', 'docs' => 'http://ninjaforms.com/documentation/extensions/layout-styles/'), array('title' => __('PayPal Express', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/09/paypal-express-300x121.png', 'content' => __('Accept payments using PayPal Express and Ninja Forms', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/paypal-express/', 'plugin' => 'ninja-forms-paypal-express/paypal-express.php', 'docs' => 'http://ninjaforms.com/documentation/extensions/paypal-express/'), array('title' => __('Save User Progress', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/save-user-progress-300x121.png', 'content' => __('Sometimes forms can grow quite large, and it would be very helpful for users to be able to save their progress and come back at a later time. This extension does just that for you. Using the built-in WordPress user …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/save-user-progress/', 'plugin' => 'ninja-forms-save-progress/save-progress.php', 'docs' => ''), array('title' => __('File Uploads', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/file-uploads1-300x121.png', 'content' => __('File Uploads for Ninjas Forms gives you the ability to insert file upload fields to your forms. This will allow users the ability to upload images, docs, audio or video files, or anything else you may need. You can easily …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/file-uploads/', 'plugin' => 'ninja-forms-uploads/file-uploads.php', 'docs' => 'http://ninjaforms.com/documentation/extensions/file-uploads/'), array('title' => __('Front-End Posting', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/front-end-posting-300x121.png', 'content' => __('The Ninja Forms Front-end Posting extension gives you the power of the WordPress post editor on any publicly viewable page you choose. You can allow users the ability to create content and have it assigned to any publicly available built-in or custom …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/front-end-posting/', 'plugin' => 'ninja-forms-post-creation/post-creation.php', 'docs' => ''), array('title' => __('Front-End Editor', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/03/front-end-editor.png', 'content' => __('The Front-End Editor Extension brings the power of your WordPress admin to your front-facing site. It is a one-stop solution for almost all your front-end editing needs. Users can now be allowed to create, edit, or delete posts, pages, or any custom post type without the need to see the WordPress admin.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/front-end-editor/', 'plugin' => 'ninja-forms-front-end-editor/front-end-editor.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/front-end-editor/'), array('title' => __('Multi-Part Forms', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/multi-part-forms-300x121.png', 'content' => __('The Multi-Part Forms extension allows you to break long forms into sections, creating a natural flow for your visitors. You can add a breadcrumb trail through the various sections of the form and a progress bar so that your users …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/multi-part-forms/', 'plugin' => 'ninja-forms-multi-part/multi-part.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/multi-part-forms/'), array('title' => __('Conditional Logic', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2012/10/conditional-logic-300x121.png', 'content' => __('This extension for Ninja Forms allows you to create “smart” forms. Fields within these forms can dynamically change based upon user input; show or hide fields based on a selected item, set field values based upon a list selection, or …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/conditional-logic/', 'plugin' => 'ninja-forms-conditionals/conditionals.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/conditional-logic/'), array('title' => __('MailChimp', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/04/mailchimp-for-ninja-forms-300x121.png', 'content' => __('The MailChimp extension allows you to quickly create newsletter signup forms for your MailChimp account using the power and flexibility that Ninja Forms provides. …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/mail-chimp/', 'plugin' => 'ninja-forms-mailchimp/ninja-forms-mailchimp.php', 'docs' => ''), array('title' => __('Campaign Monitor', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/05/campaign-monitor-header-300x121.png', 'content' => __('The Campaign Monitor extension allows you to quickly create newsletter signup forms for your Campaign Monitor account using the power and flexibility that Ninja Forms provides. …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/extensions/campaign-monitor/', 'plugin' => 'ninja-forms-campaign-monitor/ninja-forms-campaign-monitor.php', 'docs' => ''), array('title' => __('User Analytics', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/05/user-analytics-header-300x121.png', 'content' => __('The User Analytics extension will help website owners understand how hot a lead is based on extra data automatically collected about the user. …', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/user-analytics/', 'plugin' => 'ninja-forms-user-analytics/ninja-forms-user-analytics.php', 'docs' => ''), array('title' => __('Constant Contact', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/07/constant-contact-300x121.png', 'content' => __('The Constant Contact extension allows you to quickly create newsletter signup forms for your Constant Contact account using the power and…', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/constant-contact/', 'plugin' => 'ninja-forms-constant-contact/ninja-forms-constant-contact.php', 'docs' => ''), array('title' => __('Pushover', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/07/pushover-300x121.png', 'content' => __('When email and SMS notifications just do not cut it, send yourself push notifications of form submissions with Pushover. Pushover makes…', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/pushover/', 'plugin' => 'ninja-forms-pushover/ninja-forms-pushover.php', 'docs' => ''), array('title' => __('Freshbooks', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/07/freshbooks-300x121.png', 'content' => __('Automatically insert Ninja Forms data right into Freshbooks when your potential clients submit forms. Go from lead to invoice that much quicker…', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/freshbooks/', 'plugin' => 'ninja-forms-freshbooks/ninja-forms-freshbooks.php', 'docs' => ''), array('title' => __('AWeber', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/08/aweber-300x121.png', 'content' => __('Use Ninja Forms to quickly create flexible newsletter signup forms for your AWeber email marketing account.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/aweber/', 'plugin' => 'ninja-forms-aweber/ninja-forms-aweber.php', 'docs' => ''), array('title' => __('Picatcha', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/08/picatcha-header-300x121.png', 'content' => __('The Picatcha extension allows you to add image-based CAPTHA to your forms.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/picatcha/', 'plugin' => 'ninja-forms-picatcha/ninja-forms-picatcha.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/picatcha/'), array('title' => __('MailPoet (formerly Wysija)', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/09/mailpoet-300x121.png', 'content' => __('The MailPoet (formerly Wysija) extension allows you to quickly create newsletter signup forms for your MailPoet mailing lists using the power and flexibility that Ninja Forms provides.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/mailpoet/', 'plugin' => 'ninja-forms-mailpoet/nf-mailpoet.php', 'docs' => ''), array('title' => __('HubSpot', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/10/hubspot-300x121.png', 'content' => __('The Ninja Forms HubSpot Extension extends a forms capabilities by forwarding submit data directly into your HubSpot account.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/hubspot/', 'plugin' => 'ninja-forms-hubspot/ninja-forms-hubspot.php', 'docs' => ''), array('title' => __('Text Message Notifications', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/10/text-message-notifications-300x121.png', 'content' => __('Send text message notifications to a site administrator when a form has been submitted.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/text-message-notifications/', 'plugin' => 'ninja-forms-text-message-notifications/nf-text-message-notifications.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/text-message-notifications/'), array('title' => __('Modal Forms', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/11/modal-forms-300x121.png', 'content' => __('Open your Ninja Forms with a simple and clean modal pop-up.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/modal-forms/', 'plugin' => 'ninja-forms-modal/ninja-forms-modal.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/modal-forms/'), array('title' => __('Mad Mimi', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/12/mad-mini-300x121.png', 'content' => __('Use Ninja Forms to quickly create flexible newsletter signup forms for your Mad Mimi email marketing account.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/mad-mimi/', 'plugin' => 'ninja-forms-mad-mimi/ninja-forms-mad-mimi.php', 'docs' => ''), array('title' => __('Zoho CRM', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/12/zoho-crm-300x121.png', 'content' => __('Easily integrate your Zoho CRM and convert more inquiries into sales.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/zoho-crm/', 'plugin' => 'ninja-forms-zoho-crm/zoho-integration.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/zoho-crm/'), array('title' => __('Table Editor', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/01/table-editor-300x121.png', 'content' => __('Collect tabular data in your form from users with a spreadsheet-like table editor.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/table-editor/', 'plugin' => 'ninja-forms-table-editor/ninja-forms-table-editor.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/table-editor/'), array('title' => __('Stripe', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2013/09/stripe-300x121.png', 'content' => __('Use Stripe to accept payments using your Ninja Forms.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/stripe/', 'plugin' => 'ninja-forms-stripe/stripe.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/stripe/'), array('title' => __('PopControl', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/08/popcontrol-300x121.png', 'content' => __('Many options to pop your Ninja Forms in a lightbox', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/popcontrol/', 'plugin' => 'ninja-forms-pop-control/PopControl.php', 'docs' => ''), array('title' => __('Sendy', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/08/sendy-300x121.png', 'content' => __('Sendy extension for Ninja Forms lets you subscribe user’s using Ninja Forms.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/sendy/', 'plugin' => 'ninja-forms-sendy/ninja-forms-sendy.php', 'docs' => ''), array('title' => __('Batchbook CRM', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/07/batchbook-300x121.png', 'content' => __('Connect WordPress to your Batchbook CRM to automatically create contacts and companies.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/batchbook-crm/', 'plugin' => 'ninja-forms-batchbook-crm/ninja-forms-batchbook-crm.php', 'docs' => ''), array('title' => __('White Label Forms', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/07/white-label-forms-300x121.png', 'content' => __('Brand the amazing Ninja Forms plugin however you like. Change “Ninja Forms” to your name name and remove any reference to Ninja Forms.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/white-label-forms/', 'plugin' => 'ninja-forms-white-label/ninja-forms-white-label.php', 'docs' => ''), array('title' => __('PDF Form Submission', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/05/pdf-form-submission-300x121.png', 'content' => __('Easily create PDF copies of your form submissions', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/pdf-form-submissions/', 'plugin' => 'ninja-forms-pdf-submissions/nf-pdf-submissions.php', 'docs' => ''), array('title' => __('Insightly CRM', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/04/insightly-300x121.png', 'content' => __('Create contacts, opportunities, projects, tasks, and notes from your form!', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/insightly-crm/', 'plugin' => 'ninja-forms-insightly-crm/ninja-forms-insightly-crm.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/insightly-crm/'), array('title' => __('Secure Form', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/03/secure-form-300x121.png', 'content' => __('Control who can see your form based on a password or popular WordPress eCommerce systems.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/secure-form/', 'plugin' => 'ninja-forms-secure-form/ninja-forms-secure-form.php', 'docs' => ''), array('title' => __('Capsule CRM', 'ninja-forms'), 'image' => 'http://ninjaforms.com/wp-content/uploads/edd/2014/01/capsule-300x121.png', 'content' => __('Create a new contact, opportunity, and task automatically from your contact us form.', 'ninja-forms'), 'link' => 'http://ninjaforms.com/downloads/capsule-crm/', 'plugin' => 'ninja-forms-capsule-crm/ninja-forms-capsule-crm.php', 'docs' => 'http://ninjaforms.com/documentation/extension-docs/capsule-crm/')); shuffle($items); foreach ($items as $item) { echo '<div class="nf-extend nf-box">'; echo '<img src="' . $item['image'] . '" />'; echo '<h2>' . $item['title'] . '</h2>'; echo '<div>'; echo '<p>' . $item['content'] . '</p>'; if (!empty($item['docs'])) { echo '<a href="' . $item['docs'] . '" class="button-secondary nf-doc-button">' . __('Documentation', 'ninja-forms') . '</a>'; } else { echo '<p>' . __('Documentation coming soon.', 'ninja-forms') . '</a>.</p>'; } echo '</div>'; if (file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) { if (is_plugin_active($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Active', 'ninja-forms') . '</span>'; } elseif (is_plugin_inactive($item['plugin'])) { echo '<span class="button-secondary nf-button">' . __('Installed', 'ninja-forms') . '</span>'; } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } } else { echo '<a href="' . $item['link'] . '" title="' . $item['title'] . '" class="button-primary nf-button">' . __('Learn More', 'ninja-forms') . '</a>'; } echo '</div>'; } }
/** * Echoes required plugin notice. * * Outputs a message telling users that a specific plugin is required for * their theme. If appropriate, it includes a link to the form page where * users can install and activate the plugin. * * @since 1.0.0 * * @global object $current_screen * @return null Returns early if we're on the Install page */ public function notices() { global $current_screen; // Remove nag on the install page if ($this->is_tgmpa_page()) { return; } $installed_plugins = get_plugins(); // Retrieve a list of all the plugins $this->populate_file_path(); $message = array(); // Store the messages in an array to be outputted after plugins have looped through foreach ($this->plugins as $plugin) { if (is_plugin_active($plugin['file_path'])) { // If the plugin is active, no need to display nag continue; } if (!isset($installed_plugins[$plugin['file_path']])) { // Not installed if (current_user_can('install_plugins')) { if ($plugin['required']) { $message['notice_can_install_required'][] = $plugin['name']; } else { // This plugin is only recommended $message['notice_can_install_recommended'][] = $plugin['name']; } } else { // Need higher privileges to install the plugin $message['notice_cannot_install'][] = $plugin['name']; } } elseif (is_plugin_inactive($plugin['file_path'])) { // Installed but not active if (current_user_can('activate_plugins')) { if ($plugin['required']) { $message['notice_can_activate_required'][] = $plugin['name']; } else { // This plugin is only recommended $message['notice_can_activate_recommended'][] = $plugin['name']; } } else { // Need higher privileges to activate the plugin $message['notice_cannot_activate'][] = $plugin['name']; } } } if (!get_user_meta(get_current_user_id(), 'tgmpa_dismissed_notice', true)) { krsort($message); if (!empty($message)) { $rendered = ''; // Display all nag messages as strings foreach ($message as $type => $plugin_groups) { // Grab all plugin names $linked_plugin_groups = array(); /** Loop through the plugin names to make the ones pulled from the .org repo linked */ foreach ($plugin_groups as $plugin_group_single_name) { $source = $this->_get_plugin_data_from_name($plugin_group_single_name, 'source'); if (!$source || preg_match('|^http://wordpress.org/extend/plugins/|', $source)) { $url = add_query_arg(array('page' => $this->menu, 'tab' => 'plugin_information', 'plugin' => $this->_get_plugin_data_from_name($plugin_group_single_name), 'TB_iframe' => 'true', 'width' => '640', 'height' => '500'), admin_url('themes.php')); $linked_plugin_groups[] .= '<a href="' . $url . '" class="thickbox" title="' . $plugin_group_single_name . '">' . $plugin_group_single_name . '</a>'; } else { $linked_plugin_groups[] .= $plugin_group_single_name; // No hyperlink } if (isset($linked_plugin_groups) && (array) $linked_plugin_groups) { $plugin_groups = $linked_plugin_groups; } } $last_plugin = array_pop($plugin_groups); // Pop off last name to prep for readability $imploded = empty($plugin_groups) ? '<em>' . $last_plugin . '</em>' : '<em>' . (implode(', ', $plugin_groups) . '</em> and <em>' . $last_plugin . '</em>'); $rendered .= '<p>' . sprintf($this->strings[$type], $imploded) . '</p>'; // All messages now stored } /** Define all of the action links */ $action_links = apply_filters('tgmpa_notice_action_links', array('install' => '<a href="' . add_query_arg('page', $this->menu, admin_url('themes.php')) . '">' . __('Begin installing plugins', $this->domain) . '</a>', 'activate' => '<a href="' . admin_url('plugins.php') . '">' . __('Activate installed plugins', $this->domain) . '</a>', 'dismiss' => '<a class="dismiss-notice" href="' . add_query_arg('tgmpa-dismiss', 'dismiss_admin_notices') . '" target="_parent">' . __('Dismiss this notice', $this->domain) . '</a>')); if ($action_links) { $rendered .= '<p>' . implode(' | ', $action_links) . '</p>'; } add_settings_error('tgmpa', 'tgmpa', $rendered, 'updated'); } } /** Admin options pages already output settings_errors, so this is to avoid duplication */ if ('options-general' !== $current_screen->parent_base) { settings_errors('tgmpa'); } }
/** * Register action to the admin_notice when Nginx Cache Controller is not activated. * * @access public * @since 1.1.0 */ public function admin_init() { if (function_exists('is_plugin_inactive') && is_plugin_inactive($this->nginxcc)) { add_action('admin_notices', array($this, 'admin_notice')); } }
/** * Callback for displaying the UI for addons settings tab. * * @since 1.0.0 */ public function settings_addons_tab() { // Go ahead and grab the type of license. It will be necessary for displaying Addons. $type = $this->base->get_license_key_type(); // Only display the Addons information if no license key errors are present. if (!$this->base->get_license_key_errors()) { ?> <div id="soliloquy-settings-addons"> <?php if (empty($type)) { ?> <div class="error below-h2"><p><?php _e('In order to get access to Addons, you need to verify your license key for Soliloquy.', 'soliloquy'); ?> </p></div> <?php } else { ?> <?php $addons = $this->get_addons(); if ($addons) { ?> <form id="soliloquy-settings-refresh-addons-form" method="post"> <p><?php _e('Missing addons that you think you should be able to see? Try clicking the button below to refresh the addon data.', 'soliloquy'); ?> </p> <?php wp_nonce_field('soliloquy-refresh-addons', 'soliloquy-refresh-addons'); ?> <?php submit_button(__('Refresh Addons', 'soliloquy'), 'primary', 'soliloquy-refresh-addons-submit', false); ?> </form> <div id="soliloquy-addons-area" class="soliloquy-clear"> <?php // Let's begin outputting the addons. $i = 0; foreach ((array) $addons as $i => $addon) { // Attempt to get the plugin basename if it is installed or active. $plugin_basename = $this->get_plugin_basename_from_slug($addon->slug); $installed_plugins = get_plugins(); $last = 2 == $i % 3 ? 'last' : ''; // If site is HTTPS, serve $addon->image as HTTPS too, this prevents warnings if (is_ssl()) { $addon->image = str_replace('http://', 'https://', $addon->image); } echo '<div class="soliloquy-addon ' . $last . '">'; echo '<img class="soliloquy-addon-thumb" src="' . esc_url($addon->image) . '" width="300px" height="250px" alt="' . esc_attr($addon->title) . '" />'; echo '<h3 class="soliloquy-addon-title">' . esc_html($addon->title) . '</h3>'; // If the plugin is active, display an active message and deactivate button. if (is_plugin_active($plugin_basename)) { echo '<div class="soliloquy-addon-active soliloquy-addon-message">'; echo '<span class="addon-status">' . __('Status: Active', 'soliloquy') . '</span>'; echo '<div class="soliloquy-addon-action">'; echo '<a class="button button-primary soliloquy-addon-action-button soliloquy-deactivate-addon" href="#" rel="' . esc_attr($plugin_basename) . '">' . __('Deactivate', 'soliloquy') . '</a><span class="spinner soliloquy-spinner"></span>'; echo '</div>'; echo '</div>'; } // If the plugin is not installed, display an install message and install button. if (!isset($installed_plugins[$plugin_basename])) { echo '<div class="soliloquy-addon-not-installed soliloquy-addon-message">'; echo '<span class="addon-status">' . __('Status: Not Installed', 'soliloquy') . '</span>'; echo '<div class="soliloquy-addon-action">'; echo '<a class="button button-primary soliloquy-addon-action-button soliloquy-install-addon" href="#" rel="' . esc_url($addon->url) . '">' . __('Install Addon', 'soliloquy') . '</a><span class="spinner soliloquy-spinner"></span>'; echo '</div>'; echo '</div>'; } elseif (is_plugin_inactive($plugin_basename)) { echo '<div class="soliloquy-addon-inactive soliloquy-addon-message">'; echo '<span class="addon-status">' . __('Status: Inactive', 'soliloquy') . '</span>'; echo '<div class="soliloquy-addon-action">'; echo '<a class="button button-primary soliloquy-addon-action-button soliloquy-activate-addon" href="#" rel="' . esc_attr($plugin_basename) . '">' . __('Activate', 'soliloquy') . '</a><span class="spinner soliloquy-spinner"></span>'; echo '</div>'; echo '</div>'; } echo '<p class="soliloquy-addon-excerpt">' . esc_html($addon->excerpt) . '</p>'; echo '</div>'; $i++; } ?> </div> <?php } else { ?> <form id="soliloquy-settings-refresh-addons-form" method="post"> <p><?php _e('There was an issue retrieving the addons for this site. Please click on the button below the refresh the addons data.', 'soliloquy'); ?> </p> <?php wp_nonce_field('soliloquy-refresh-addons', 'soliloquy-refresh-addons'); ?> <?php submit_button(__('Refresh Addons', 'soliloquy'), 'primary', 'soliloquy-refresh-addons-submit', false); ?> </form> <?php } ?> <?php } ?> </div> <?php } else { ?> <div class="error below-h2"><p><?php _e('In order to get access to Addons, you need to resolve your license key errors.', 'soliloquy'); ?> </p></div> <?php } }
/** * Ensure Max Mega Menu (free) is installed * * @since 1.3 */ public function check_megamenu_is_installed() { if (is_plugin_active('megamenu/megamenu.php')) { return; } if (is_plugin_inactive('megamenu/megamenu.php')) { $plugin = plugin_basename('megamenu/megamenu.php'); $string = __('Max Mega Menu Pro requires Max Mega Menu (free). Please {activate} the Max Mega Menu plugin.', 'megamenu'); $link = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s=' . $s, 'activate-plugin_' . $plugin) . '" class="edit">' . __('activate', 'megamenu') . '</a>'; ?> <div class="updated"> <p> <?php echo str_replace("{activate}", $link, $string); ?> </p> </div> <?php } else { ?> <div class="updated"> <p> <?php _e('Max Mega Menu Pro requires Max Mega Menu (free). Please install the Max Mega Menu plugin.', 'megamenu'); ?> </p> <p class='submit'> <a href="<?php echo admin_url("plugin-install.php?tab=search&type=term&s=max+mega+menu"); ?> " class='button button-secondary'><?php _e("Install Max Mega Menu", "megamenupro"); ?> </a> </p> </div> <?php } }
\______________________/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ // load is_plugin_active function if required if (!function_exists('is_plugin_inactive')) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } // registers widget when bundled with the null framework if (is_plugin_inactive('wp-instagram-widget/wordpress-instagram-widget.php') && function_exists('null_get_extensions')) { // register register_widget('null_instagram_widget'); // text domain $wpiwdomain = 'null'; } // register widget for standalone if (is_plugin_active('wp-instagram-widget/wp-instagram-widget.php')) { // define some constants define('WP_INSTAGRAM_WIDGET_JS_URL', plugins_url('/assets/js', __FILE__)); define('WP_INSTAGRAM_WIDGET_CSS_URL', plugins_url('/assets/css', __FILE__)); define('WP_INSTAGRAM_WIDGET_IMAGES_URL', plugins_url('/assets/images', __FILE__)); define('WP_INSTAGRAM_WIDGET_PATH', dirname(__FILE__)); define('WP_INSTAGRAM_WIDGET_BASE', plugin_basename(__FILE__)); define('WP_INSTAGRAM_WIDGET_FILE', __FILE__); // text domain
/** * Check if Quick AdSense is installed and if version is 1.9.2 * * @return boolean true when it is installed and version matches */ function quads_check_quick_adsense_version() { $plugin_file = 'quick-adsense/quick-adsense.php'; $plugin_abs_path = get_home_path() . '/wp-content/plugins/quick-adsense/quick-adsense.php'; $checkVersion = '1.9.2'; if (is_plugin_active($plugin_file)) { $plugin_data = get_plugin_data($plugin_abs_path, $markup = true, $translate = true); if ($plugin_data['Version'] === $checkVersion) { return true; } } if (is_plugin_inactive($plugin_file) || file_exists($plugin_abs_path)) { $plugin_data = get_plugin_data($plugin_abs_path, $markup = true, $translate = true); if ($plugin_data['Version'] === $checkVersion) { return true; } } }
/** * Create default title column along with action links of 'Install' * and 'Activate'. * * @since 2.2.0 * * @param array $item * @return string The action hover links */ public function column_plugin($item) { $installed_plugins = get_plugins(); /** No need to display any hover links */ if (is_plugin_active($item['file_path'])) { $actions = array(); } /** We need to display the 'Install' hover link */ if (!isset($installed_plugins[$item['file_path']])) { if ('Pre-Packaged' == $item['source'] && !file_exists($item['url'])) { $msg = 'Get the ZIP package of the plugin from ' . $this->_marketplace . ' package, put it inside theme/plugins folder of the theme and reload this page'; $actions = array('install' => '<span style="font-size: 12px; color: #aaa;">' . __($msg, 'yit') . '</span>'); } else { $actions = array('install' => sprintf('<a href="%1$s" title="Install %2$s">Install</a>', wp_nonce_url(add_query_arg(array('page' => TGM_Plugin_Activation::$instance->menu, 'plugin' => $item['slug'], 'plugin_name' => $item['sanitized_plugin'], 'plugin_source' => $item['url'], 'tgmpa-install' => 'install-plugin'), admin_url(TGM_Plugin_Activation::$instance->parent_url_slug)), 'tgmpa-install'), $item['sanitized_plugin'])); } } elseif (is_plugin_inactive($item['file_path'])) { $actions = array('activate' => sprintf('<a href="%1$s" title="Activate %2$s">Activate</a>', add_query_arg(array('page' => TGM_Plugin_Activation::$instance->menu, 'plugin' => $item['slug'], 'plugin_name' => $item['sanitized_plugin'], 'plugin_source' => $item['url'], 'tgmpa-activate' => 'activate-plugin', 'tgmpa-activate-nonce' => wp_create_nonce('tgmpa-activate')), admin_url(TGM_Plugin_Activation::$instance->parent_url_slug)), $item['sanitized_plugin'])); } return sprintf('%1$s %2$s', $item['plugin'], $this->row_actions($actions)); }
/** * Ajax handler for installing a plugin. * * @since 4.6.0 * * @see Plugin_Upgrader */ function wp_ajax_install_plugin() { check_ajax_referer('updates'); if (empty($_POST['slug'])) { wp_send_json_error(array('slug' => '', 'errorCode' => 'no_plugin_specified', 'errorMessage' => __('No plugin specified.'))); } $status = array('install' => 'plugin', 'slug' => sanitize_key(wp_unslash($_POST['slug']))); if (!current_user_can('install_plugins')) { $status['errorMessage'] = __('Sorry, you are not allowed to install plugins on this site.'); wp_send_json_error($status); } include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $api = plugins_api('plugin_information', array('slug' => sanitize_key(wp_unslash($_POST['slug'])), 'fields' => array('sections' => false))); if (is_wp_error($api)) { $status['errorMessage'] = $api->get_error_message(); wp_send_json_error($status); } $status['pluginName'] = $api->name; $skin = new WP_Ajax_Upgrader_Skin(); $upgrader = new Plugin_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); } $install_status = install_plugin_install_status($api); $pagenow = isset($_POST['pagenow']) ? sanitize_key($_POST['pagenow']) : ''; // If install request is coming from import page, do not return network activation link. $plugins_url = 'import' === $pagenow ? admin_url('plugins.php') : network_admin_url('plugins.php'); if (current_user_can('activate_plugins') && is_plugin_inactive($install_status['file'])) { $status['activateUrl'] = add_query_arg(array('_wpnonce' => wp_create_nonce('activate-plugin_' . $install_status['file']), 'action' => 'activate', 'plugin' => $install_status['file']), $plugins_url); } if (is_multisite() && current_user_can('manage_network_plugins') && 'import' !== $pagenow) { $status['activateUrl'] = add_query_arg(array('networkwide' => 1), $status['activateUrl']); } wp_send_json_success($status); }
/** * Create default title column along with action links of 'Install' * and 'Activate'. * * @since 2.2.0 * * @param array $item Array of item data. * @return string The action hover links. */ public function column_plugin($item) { $installed_plugins = get_plugins(); // No need to display any hover links. if (is_plugin_active($item['file_path'])) { $actions = array(); } // We need to display the 'Install' hover link. if (!isset($installed_plugins[$item['file_path']])) { $actions = array('install' => sprintf('<a href="%1$s" title="' . esc_attr__('Install', 'tgmpa') . ' %2$s">' . __('Install', 'tgmpa') . '</a>', esc_url(wp_nonce_url(add_query_arg(array('page' => urlencode(TGM_Plugin_Activation::$instance->menu), 'plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['url']), 'tgmpa-install' => 'install-plugin'), network_admin_url('themes.php')), 'tgmpa-install')), $item['sanitized_plugin'])); } elseif (is_plugin_inactive($item['file_path'])) { $actions = array('activate' => sprintf('<a href="%1$s" title="' . esc_attr__('Activate', 'tgmpa') . ' %2$s">' . __('Activate', 'tgmpa') . '</a>', esc_url(add_query_arg(array('page' => urlencode(TGM_Plugin_Activation::$instance->menu), 'plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['url']), 'tgmpa-activate' => 'activate-plugin', 'tgmpa-activate-nonce' => urlencode(wp_create_nonce('tgmpa-activate'))), network_admin_url('themes.php'))), $item['sanitized_plugin'])); } return sprintf('%1$s %2$s', $item['plugin'], $this->row_actions($actions)); }
/** * Check if plugin file exists but plugin is inactive * @param $path Path to plugin file * @since 4.7.3 * @return bool TRUE if plugin file found but plugin inactive. False otherwise */ function wprss_is_plugin_inactive($path) { if (!isset($path)) { return FALSE; } if (file_exists(WP_PLUGIN_DIR . '/' . $path) && is_plugin_inactive($path)) { return TRUE; // plugin found but inactive } return FALSE; }
/** * Create default title column along with action links of 'Install' * and 'Activate'. * * @since 2.2.0 * * @param array $item * @return string The action hover links */ public function column_plugin($item) { $installed_plugins = get_plugins(); /** No need to display any hover links */ if (is_plugin_active($item['file_path'])) { $actions = array(); } /** We need to display the 'Install' hover link */ if (!isset($installed_plugins[$item['file_path']])) { $actions = array('install' => sprintf('<a href="%1$s" title="Install %2$s">Install</a>', wp_nonce_url(add_query_arg(array('page' => TGM_Plugin_Activation::$instance->menu, 'plugin' => $item['slug'], 'plugin_name' => $item['sanitized_plugin'], 'plugin_source' => $item['url'], 'tgmpa-install' => 'install-plugin'), admin_url(TGM_Plugin_Activation::$instance->parent_url_slug)), 'tgmpa-install'), $item['sanitized_plugin'])); } elseif (is_plugin_inactive($item['file_path'])) { $actions = array('activate' => sprintf('<a href="%1$s" title="Activate %2$s">Activate</a>', add_query_arg(array('page' => TGM_Plugin_Activation::$instance->menu, 'plugin' => $item['slug'], 'plugin_name' => $item['sanitized_plugin'], 'plugin_source' => $item['url'], 'tgmpa-activate' => 'activate-plugin', 'tgmpa-activate-nonce' => wp_create_nonce('tgmpa-activate')), admin_url(TGM_Plugin_Activation::$instance->parent_url_slug)), $item['sanitized_plugin'])); } return sprintf('%1$s %2$s', $item['plugin'], $this->row_actions($actions)); }
bloginfo('name'); $site_description = get_bloginfo('description', 'display'); if ($site_description && (is_home() || is_front_page())) { echo " | {$site_description}"; } if ($paged >= 2 || $page >= 2) { echo ' | ' . sprintf(__('Page', WEBNUS_TEXT_DOMAIN) . ' %s', max($paged, $page)); } } /***************************************/ /* End Title Generation Process /***************************************/ ?> </title> <?php if (is_plugin_inactive('all-in-one-seo-pack/all_in_one_seo_pack.php') && is_plugin_inactive('wordpress-seo/wp-seo.php')) { ?> <meta name="description" content="<?php /***************************************/ /* Description Meta Tag Generator /***************************************/ $page_seo_meta = false; global $page_seo_meta; $seo_meta = !empty($page_seo_meta) ? $page_seo_meta->the_meta() : null; if (!empty($seo_meta) && !empty($seo_meta['webnus_seo_options'][0]['seo_desc'])) { echo $seo_meta['webnus_seo_options'][0]['seo_desc']; } else { if (is_single()) { single_post_title('', true); } else { bloginfo('name');
/** * Create default title column along with action links of 'Install' * and 'Activate'. * * @since 2.2.0 * * @param array $item Array of item data. * @return string The action hover links. */ public function column_plugin($item) { $installed_plugins = get_plugins(); // No need to display any hover links. if (is_plugin_active($item['file_path'])) { $actions = array(); } // We need to display the 'Install' hover link. if (!isset($installed_plugins[$item['file_path']])) { $install_nonce_url = wp_nonce_url(add_query_arg(array('page' => urlencode($this->tgmpa->menu), 'plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['url']), 'tgmpa-install' => 'install-plugin'), self_admin_url($this->admin_page_base)), 'tgmpa-install'); $actions = array('install' => sprintf('<a href="%1$s">' . esc_attr_x('Install %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa') . '</a>', esc_url($install_nonce_url), '<span class="screen-reader-text">' . $item['sanitized_plugin'] . '</span>')); } elseif (is_plugin_inactive($item['file_path'])) { $activate_url = add_query_arg(array('page' => urlencode($this->tgmpa->menu), 'plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['url']), 'tgmpa-activate' => 'activate-plugin', 'tgmpa-activate-nonce' => urlencode(wp_create_nonce('tgmpa-activate'))), self_admin_url($this->admin_page_base)); $actions = array('activate' => sprintf('<a href="%1$s">' . esc_attr_x('Activate %2$s', '%2$s = plugin name in screen reader markup', 'tgmpa') . '</a>', esc_url($activate_url), '<span class="screen-reader-text">' . $item['sanitized_plugin'] . '</span>')); } $prefix = defined('WP_NETWORK_ADMIN') && WP_NETWORK_ADMIN ? 'network_admin_' : ''; $actions = apply_filters("tgmpa_{$prefix}plugin_action_links", array_filter($actions), $item['slug']); return sprintf('%1$s %2$s', $item['plugin'], $this->row_actions($actions)); }
function plugin_link($item) { $installed_plugins = get_plugins(); $item['sanitized_plugin'] = $item['name']; // We have a repo plugin if (!$item['version']) { $item['version'] = TGM_Plugin_Activation::$instance->does_plugin_have_update($item['slug']); } /** We need to display the 'Install' hover link */ if (!isset($installed_plugins[$item['file_path']])) { $actions = array('install' => sprintf('<a href="%1$s" class="button button-primary" title="Install %2$s">Install</a>', esc_url(wp_nonce_url(add_query_arg(array('page' => urlencode(TGM_Plugin_Activation::$instance->menu), 'plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['source']), 'tgmpa-install' => 'install-plugin', 'return_url' => 'fusion_plugins'), TGM_Plugin_Activation::$instance->get_tgmpa_url()), 'tgmpa-install', 'tgmpa-nonce')), $item['sanitized_plugin'])); } elseif (is_plugin_inactive($item['file_path'])) { $actions = array('activate' => sprintf('<a href="%1$s" class="button button-primary" title="Activate %2$s">Activate</a>', esc_url(add_query_arg(array('plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['source']), 'avada-activate' => 'activate-plugin', 'avada-activate-nonce' => wp_create_nonce('avada-activate')), admin_url('admin.php?page=avada-plugins'))), $item['sanitized_plugin'])); } elseif (version_compare($installed_plugins[$item['file_path']]['Version'], $item['version'], '<')) { $actions = array('update' => sprintf('<a href="%1$s" class="button button-primary" title="Install %2$s">Update</a>', wp_nonce_url(add_query_arg(array('page' => urlencode(TGM_Plugin_Activation::$instance->menu), 'plugin' => urlencode($item['slug']), 'tgmpa-update' => 'update-plugin', 'plugin_source' => urlencode($item['source']), 'version' => urlencode($item['version']), 'return_url' => 'fusion_plugins'), TGM_Plugin_Activation::$instance->get_tgmpa_url()), 'tgmpa-update', 'tgmpa-nonce'), $item['sanitized_plugin'])); } elseif (is_plugin_active($item['file_path'])) { $actions = array('deactivate' => sprintf('<a href="%1$s" class="button button-primary" title="Deactivate %2$s">Deactivate</a>', esc_url(add_query_arg(array('plugin' => urlencode($item['slug']), 'plugin_name' => urlencode($item['sanitized_plugin']), 'plugin_source' => urlencode($item['source']), 'avada-deactivate' => 'deactivate-plugin', 'avada-deactivate-nonce' => wp_create_nonce('avada-deactivate')), admin_url('admin.php?page=avada-plugins'))), $item['sanitized_plugin'])); } return $actions; }