Tag Archives: Plugins
Activate WordPress Plugins Automatically via a Function

Activate WordPress Plugins Automatically via a Function

You have probably seen it before, you install a theme or plugin and a message displayed if you want to activate some related plugins as well.

In many cases, this could be a plugin that is necessary for the theme / plugin process or, in other cases, you just want to market another plugin that you developed or that you have a joint venture agreement with.

This simple tutorial will guide you on how to activate a plugin that is already installed, it will not show you how to install a plugin that is not already installed (we will cover it in a future tutorial).

The idea behind this process is simple, WordPress stores all the active plugins’ list in the options table.

A special field is assigned to that list under the name activate_plugins .

So in order to activate any plugin that is already installed we just need to change this field value.

Before we start writing the simple code, we need to find the plugin file name as we are going to use the activation process.

A simple way to find the plugin’s file name is by using the code below. These few lines will add the plugin’s file name into the plugins page list, so you can use the activation code later (a plugin version of this code is attached to this tutorial, you can download it and activate it on your website):

/* Getting plugin file names */

add_filter( 'plugin_row_meta', 'wpinsiders_get_plugin_string', 10, 4 );

function wpinsiders_get_plugin_string( $plugin_meta, $plugin_file, $plugin_data, $status ) {
	/* echo plugin file string */
	echo '<code>' . $plugin_file . '</code><br>';
	return $plugin_meta;
}


Now that we know the plugin's name, we can use the following code inside our plugin or theme in order to activate the plugin/s:

/* example on admin init, control about register_activation_hook()  */

add_action( 'admin_init', 'wpinsiders_activate_plugins' );
// the exmple function
function wpinsiders_activate_plugins() {
	
	if ( ! current_user_can('activate_plugins') )
		wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
	$plugins = FALSE;
	$plugins = get_option('active_plugins'); // get active plugins
	
	if ( $plugins ) {
		// plugins to active
		$plugins_to_activate = array(
			'hello.php', // Hello Dolly
			'adminimize/adminimize.php', // Adminimize
			'akismet/akismet.php' // Akismet
		);
		
		foreach ( $plugins_to_activate as $plugin ) {
			if ( ! in_array( $plugin, $plugins ) ) {
				array_push( $plugins, $plugin );
				update_option( 'active_plugins', $plugins );
			}
		}
		
	} // end if $plugins

}

As you can see in the above code, you can activate more than one plugin at once just by filling-in the right information inside the $plugin_to_activates  array.

Important Notice:

Important aspect that you should know about this process is: When WordPress activates a plugin on the back-end using the activate command in the plugins’ page, it is activating it inside a “sandbox”. If the plugin is broken, your website will not be broken and you will get a message regarding the plugin’s error on WordPress admin back-end.  However, when activating a plugin using a code, no sandbox is created and the plugin is activated in the live environment, so if the plugin that is activated has an error, it will break the website as well.

Examples for usage:

  • The plugin needs some other plugins activated in order to work properly.
  • You are creating a testing environment and you need to activate / deactivate several plugins at one.
  • You want to make sure a plugin is active (for any reason that you can think of).

If you like this tutorial share using the social sharing buttons, if you want to add new information feel free to write in the comments section below.

 

Wishlist Member Tips Series

Tip #32: Top 10 Powerful Wishlist Member Dedicated Plugins to Empower Your Membership Site

Using Wishlist Member you can build many membership sites models.

No matter which one of the models you decide to build, the list of Wishlist Member dedicated plugins that you will probably need to have on your membership site.

What You Get in the Tip?

In this tip we have collected the top 10 Wishlist Member dedicated plugins that will make you more money by:

A. Increasing your registration rates

B. Increasing your retention rates

C. Engaging your members

Get Free Access Now:

Login to get all the tips or Register to our FREE membership using the registration form to your right and get immediate access to this tip and to all the upcoming tips about Wishlist Member!

Tip #32: Top 10 Powerful Wishlist Member Dedicated Plugins to Empower Your Membership Site

Read more…

plugin-spotlight

Wishlist 1 Click Registration Plugin – Register Members Automatically in Just 1 Click!

If you offer a free membership then the 1-Click Registration plugin will be very useful to you.

Wishlist 1-Click Registration will increase the registrations to your free membership by simplifying the registration process by allowing you to register members in just one click!

The plugin allows you to register members easily in 3 unique ways:

Read more…

Wishlist Member Plugins Wizard

The New Wishlist Member Plugins Wizard – Find Plugins You Need in 3 Steps Only!

If you are looking for ways to empower your Wishlist membership site then the new Wishlist Member Plugins Wizard is exactly what you need.

*** The Wizard Contains 40 Different Plugins! ***

This is How the Wizard Works:

STEP #1: Choose the type of plugins you need

Wishlist Member Plugins Wizard Step 1

STEP #2: Choose what you want to achieve

Wishlist Member Plugins Wizard Step 2

STEP #3: Click on each title to explore the plugin

Wishlist Member Plugins Wizard Step 3

Click here to access Wishlist Member Plugins Wizard

The Wizard Gives You Focused Results

Every result contains 3-6 plugins’ suggestions tops to help you find what you need in seconds!

The Wizard Contains Large Variety of Plugins

There are 40 different plugins, but instead of getting confused with so many plugins, you see only to the ones you really need according to what you choose

We hope you will love the wizard as much as we do.

Any suggestion for improving the wizard will benefit all of Wishlist’s users!

For any suggestion please write your comment below.

Click here to access Wishlist Member Plugins Wizard

plugin-spotlight

Plugin Spotlight: Wishlist Protection Display for Better Content Protection!

How sure are you that your membership site’s protection settings are correct?

If you have only few protected posts/ paged it won’t take too much time to go over them and make sure they are indeed protected.

However, if you already have a decent amount of posts/ pages, or if you just want to make your life easier and save time…

With Wishlist Protection Display you will be able to view all of your protection settings in a very simple and visual way.

Read more…

Does Wishlist Auto Registration Work with WooCommerce ?

Is It Possible to Create Coupons with Wishlist Member Plugin?

“I was wondering if your tool has anyway of allowing members to use coupon codes for our course.

It’s a high priority that our members have the ability to buy the course for a discounted rate through a coupon code if they come from certain references.

Is there any way WishList can do that?”

~ Destinee Cushing

Our Answer:

Read more…

Wishlist Smart Shortcodes for Wishlist Member Plugin

Wishlist Smart Shortcodes Plugin Complete Overview

Wishlist Smart Shortcodes is a new plugin that contains an impressive number of 32 smart shortcodes to help improve and enhance your membership site.

Using the shortcodes you will be able to display different statistics and information about your membership site to both existing and potential clients.

These shortcodes are unique to Wishlist Member membership sites and are not available in the Wishlist Member plugin itself.

Wishlist Smart Shortcodes is divided to 1 Core plugin + 3 Add-Ons which are available for purchase additionally.

These are the available shortcodes:

Read more…

Wishlist Member Plugins Wizard

Wishlist Member Plugins Wizard

Welcome to the complete Wishlist Member Plugins Wizard!

The Wizard contains 65 Wishlist dedicated plugins to empower your membership site.

The relevant information will open according to the answers you click on.

It may take a couple of seconds for the wizard to be displayed. If not, please refresh the page or open the page in Internet Explorer, for some reason it works best there…

If this link doesn’t work, please go to the Wishlist Member Plugins Complete Repository to view all plugins

Follow the Wizard Below:

Wishlist Member Plugins Wizard is Powered by Wishlist Selector

Check Our Wishlist Member Tips Series

These are only some of the tips you will find (must be logged-in):

Get all the tips in this link

Not a Member Yet?

Register for free using the form to your right.

 

 

 

 

 

Wishlist Member Tips Series

Tip #8: 6 Free Excellent Plugins for Managing Your Membership Site Better

I have gathered 6 of the most popular plugins we are using on a regular basis in our clients’ websites as well as on our websites.

All the plugins are free for download and using them will save you time and money.

Get Free Access Now

Login to get all the tips in this link or Register to our FREE membership on the form to your right and get immediate access to this tip and to all the upcoming tips about Wishlist Member.Premium Content

 

Read more…

Wishlist Member Tips Series

Tip #3 – Must Have Plugins for Managing Your Membership Site

In this tip we gathered the most popular plugins we are using to make our lives much easier when building and managing our membership sites and our clients’ membership sites.

This a list we share only with our clients and we built it since we noticed that many are not familiar with these plugins, and we wanted to save them time in the process of building their sites.

This is a complete suit of plugins that is extremely useful and saves valuable time.

The list is divided to both free and paid plugins.

We hope you will benefit from it as much as we do!

Register for Free to Get Access

Register to our FREE membership on the form to your right and get immediate access to this tip and to all the upcoming tips about Wishlist Member.Premium Content

 

Read more…

Wishlist Smart Shortcodest - Improve your Membership Site
This Website is Using Wishlist Memers Count to Increase Members Registration
Wishlist Registration Widget - Increase Members Registration
We are the Biggest 3rd Party Company that Sells Plugins for the WishList Member Platform. Read More About Us
/* */