Testing for addon plugin activated

There is the function is_plugin_active() which can be used easily for this check, but what if the user decides to change the folder name of the plugin?

Simply put, you’re doing it wrong.

If you’re making extensions for a plugin, then you should provide hooks in the “parent” plugin for those addons to hook into and change things. Take tabs, for instance, you could use a filter.

<?php
$tabs = apply_filters('myplugin_options_tabs', array(
    'some_tab'  => __('The Tab Label', 'your-textdomain'),
    'a_tab'     => __('Another Label', 'your-textdomain'),
));

foreach ($tabs as $tab => $label) {
   printf('<a href="#%s">%s</a>', esc_attr($tab), esc_html($label));
}

// some where further on where the tab content is supposed to display:
do_action('myplugin_tab_' . some_function_that_gets_the_current_tab() . '_display');

Doing it this way means you don’t have to do any checks in your parent plugin. Add ons can simply hook in and do their thing. Much more elegant, and a lot more flexible.

That said, if you really really want to check for the existence of another plugin, the best bet is to hook into plugins_loaded and check for the existence of one of that plugin’s classes, functions and/or constants.

<?php
add_action('plugins_loaded', 'wpse89926_load');
function wpse89926_load()
{
   if (class_exists('Other_Plugins_Class')) {
       // do stuff, the other plugin is in installed
   }

   if (function_exists('a_function_in_the_other_plugin')) {
       // do stuff, the other plugin is in installed
   }

   if (defined('A_CONSTANT_IN_THE_OTHER_PLUGIN')) {
       // do stuff, the other plugin is in installed
   }
}