<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: WordPress Plugin Dependency Checking</title>
	<atom:link href="http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking/feed" rel="self" type="application/rss+xml" />
	<link>http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking</link>
	<description>Tech Stuff</description>
	<lastBuildDate>Mon, 11 Apr 2011 10:11:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: thomasb</title>
		<link>http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking/comment-page-1#comment-10260</link>
		<dc:creator>thomasb</dc:creator>
		<pubDate>Mon, 11 Apr 2011 10:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://novemberechoromeodelta.com/?p=203#comment-10260</guid>
		<description>Wordpress keeps track of active plugins in the `options` table.

SELECT * FROM wp_options WHERE option_name = &#039;active_plugins&#039;;

global $wpdb;
$active_plugins = get_option(&#039;active_plugins&#039;, FALSE);
$depends = &#039;nextgen-gallery/nggallery.php&#039;;
if ( ! in_array($depends, $active_plugins)) {
die(&quot;Required plugin, {$depends} could not be found, please activate it before continuing&quot;);
}</description>
		<content:encoded><![CDATA[<p>WordPress keeps track of active plugins in the `options` table.</p>
<p>SELECT * FROM wp_options WHERE option_name = &#8216;active_plugins&#8217;;</p>
<p>global $wpdb;<br />
$active_plugins = get_option(&#8216;active_plugins&#8217;, FALSE);<br />
$depends = &#8216;nextgen-gallery/nggallery.php&#8217;;<br />
if ( ! in_array($depends, $active_plugins)) {<br />
die(&#8220;Required plugin, {$depends} could not be found, please activate it before continuing&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thomasb</title>
		<link>http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking/comment-page-1#comment-10259</link>
		<dc:creator>thomasb</dc:creator>
		<pubDate>Mon, 11 Apr 2011 10:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://novemberechoromeodelta.com/?p=203#comment-10259</guid>
		<description>Wordpress keeps track of active plugins in the `options` table.

SELECT * FROM wp_options WHERE option_name = &#039;active_plugins&#039;;

</description>
		<content:encoded><![CDATA[<p>WordPress keeps track of active plugins in the `options` table.</p>
<p>SELECT * FROM wp_options WHERE option_name = &#8216;active_plugins&#8217;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Kemp</title>
		<link>http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking/comment-page-1#comment-6709</link>
		<dc:creator>Will Kemp</dc:creator>
		<pubDate>Sun, 23 Jan 2011 06:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://novemberechoromeodelta.com/?p=203#comment-6709</guid>
		<description>Interesting and useful. Thanks for that!</description>
		<content:encoded><![CDATA[<p>Interesting and useful. Thanks for that!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dell Sala</title>
		<link>http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking/comment-page-1#comment-6697</link>
		<dc:creator>Dell Sala</dc:creator>
		<pubDate>Sun, 23 Jan 2011 02:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://novemberechoromeodelta.com/?p=203#comment-6697</guid>
		<description>Just implemented something very similar. Was hoping for something built into WP for this, but found nothing. This is the best solution I&#039;ve found.

A couple minor improvements to the usability: Instead of die(), just return. This will stop execution of the file, but won&#039;t kill the entire wordpress stack.

To notify the user add an admin notice:

if (/*PLUGIN-NOT-INSTALLED*/) {
    add_action(&#039;admin_notices&#039;, &#039;dependency_error&#039;);
    return;
}

function dependency_error () {
    echo &#039;Required dependency is missing.&#039;;
}</description>
		<content:encoded><![CDATA[<p>Just implemented something very similar. Was hoping for something built into WP for this, but found nothing. This is the best solution I&#8217;ve found.</p>
<p>A couple minor improvements to the usability: Instead of die(), just return. This will stop execution of the file, but won&#8217;t kill the entire wordpress stack.</p>
<p>To notify the user add an admin notice:</p>
<p>if (/*PLUGIN-NOT-INSTALLED*/) {<br />
    add_action(&#8216;admin_notices&#8217;, &#8216;dependency_error&#8217;);<br />
    return;<br />
}</p>
<p>function dependency_error () {<br />
    echo &#8216;Required dependency is missing.&#8217;;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex chousmith</title>
		<link>http://novemberechoromeodelta.com/20090727-wordpress-plugin-dependency-checking/comment-page-1#comment-4076</link>
		<dc:creator>alex chousmith</dc:creator>
		<pubDate>Tue, 12 Oct 2010 23:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://novemberechoromeodelta.com/?p=203#comment-4076</guid>
		<description>Hey, I found this post as I was searching for &quot;how to figure out if a plugin is installed&quot;. You have a great quick solution, but unfortunately I have found that many WP plugins are not good about cleaning up after themselves...

in the case where a user has at one point installed NextGen Gallery (or in my case, WP e-Commerce Plugin), but gave up on it and uninstalled/deleted it, the db tables often might not get removed correctly, and your test would show that the plugin is there when it really isnt any more.</description>
		<content:encoded><![CDATA[<p>Hey, I found this post as I was searching for &#8220;how to figure out if a plugin is installed&#8221;. You have a great quick solution, but unfortunately I have found that many WP plugins are not good about cleaning up after themselves&#8230;</p>
<p>in the case where a user has at one point installed NextGen Gallery (or in my case, WP e-Commerce Plugin), but gave up on it and uninstalled/deleted it, the db tables often might not get removed correctly, and your test would show that the plugin is there when it really isnt any more.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

