How to tell if your WordPress Plugin or Widget is Activated in WordPress

June 2, 2009

in Web Development, WordPress

Check your plugin or widget activation & settings

Ever wonder if your widget or plugin is activated on an external site?

Here’s how to find out.

When you register a sidebar widget, you use code like this:

register_sidebar_widget(array('Name of Widget', 'class-of-widget'), 'widget_function');

If you want to check whether the widget is activated (you may want to for a variety of reasons), you can do it like this (the “class-of-widget” value from above will be used in the code below): if(isset($_REQUEST['check_status'])) {
if(is_active_widget('class-of-widget')) {
echo 'Active';
} else {
echo 'Inactive';
} // End if 'is_active_widget'
} // End if 'check_status'

Now, simply browse to your widget or plugin’s location and add the variable “check_status” at the end: (wp-content/plugins/class-of-widget/widget.php?check_status). You will then see the plugin/widget is “Active” or “Inactive.”

I hope someone finds this useful; if you’re in plugin or widget development for WordPress, try the code out!

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

  1. Constant Contact WordPress Widget – Add a Newsletter Signup Form to your Sidebar
  2. VerticalResponse Widget for WordPress
  3. SEO WordSpinner Plugin – A Killer SEO Plugin for WordPress
  4. Mad Mimi Plugin for WordPress
  5. Auto-Optimize WordPress Database without a Plugin

{ 3 comments… read them below or add one }

Vancouver Web Design June 29, 2009 at 4:54 pm

Ah ha ! What an elegant solution. Thank you.

Reply

sebastien October 15, 2009 at 6:42 pm

Thanks. And in the new API ?

Reply

syed January 3, 2010 at 6:50 pm

hi this is naqvi,
I am new to wordpress and not very much familiar with SEO,
I just added wordspinner in my blog. but how i could add tags meta data key word and title in my pages.  I mean syntax and where i have to add these entries.
thanks
Naqvi.

Reply

Leave a Comment

Previous post:

Next post: