1

How can i check the plugin is installed and status on ImpressPages 4.x?

I want to show rss feed link if RSS plugin is installed and active. Is there any function checking plugin status? I tried with ipGetOption(), but options stored always whether plugin is active or not. I need to get Plugin status that isActive column.

<?php if($rss_url = ipGetOption('Rss.rssUrl')): ?>

     <li class="rss"><a href="<?php echo $rss_url; ?>" title="RSS" target="_blank">RSS</a></li>

<?php endif; ?>
Bora
  • 10,529
  • 5
  • 43
  • 73

1 Answers1

2

There are no "correct" way to do this. Nevertheless, there are multiple ways to do that by using internal methods. I believe the most simple way is this:

<?php
    $activePlugins = \Ip\Internal\Plugins\Service::getActivePluginNames();
    if(in_array('Rss', $activePlugins)) {
        $rss_url = ipGetOption('Rss.rssUrl');
?>

<li class="rss"><a href="<?php echo $rss_url; ?>" title="RSS" target="_blank">RSS</a></li>

<?php } ?>

This service method executes a DB query each time. Therefore, use it carefully.