Example #1
0
 function kill()
 {
     $killed = false;
     $proActive = is_plugin_active($this->pro);
     $liteActive = is_plugin_active($this->lite);
     if ($proActive && $liteActive) {
         add_action('init', array($this, 'init'));
         $plgPath = ABSPATH . PLUGINDIR . "/{$this->lite}";
         $liteData = get_plugin_data($plgPath);
         $plgPath = ABSPATH . PLUGINDIR . "/{$this->pro}";
         $proData = get_plugin_data($plgPath);
         $this->liteName = $liteData['Name'];
         $this->proName = $proData['Name'];
         self::$adminNotice .= sprintf('<div class="updated"><p>');
         self::$adminNotice .= sprintf(__("%s cannot be active now. Deactivating it so that you can use the Pro version %s If you really want to use the %s version, please deactivate the %s version first.", "easy-common"), "<strong><em>{$this->liteName}</em></strong>", "<strong><em>{$this->proName}</em></strong>.<br />", "<strong><em>Lite</em></strong>", "<strong><em>Pro</em></strong>");
         self::$adminNotice .= sprintf("<br /><strong>" . __("Please reload this page to remove stale links.", 'easy-common') . " <input type='button' value='Reload Page' onClick='window.location.href=window.location.href.replace(\"activate=true&\",\"\")'></strong>");
         self::$adminNotice .= sprintf('</p></div>');
         add_action('admin_notices', array('EzKillLite', 'admin_notices'));
         add_action('admin_footer-plugins.php', array($this, 'admin_footer_kill'));
         $killed = true;
     }
     self::$killed = $killed;
     return $killed;
 }
         }
         function verifyDB()
         {
             global $wpdb;
             $table = $wpdb->prefix . "ez_adsense_options";
             if ($wpdb->get_var("SHOW TABLES LIKE '{$table}'") != $table) {
                 $this->install();
             }
         }
     }
     //End Class GoogleAdSense
 } else {
     $ezFamily = array("google-adsense/google-adsense.php", "google-adsense-lite/google-adsense.php", "google-adsense-pro/google-adsense.php", "easy-adsense/easy-adsense.php", "easy-adsense-pro/easy-adsense.php", "easy-adsense-lite/easy-adsense.php", "easy-adsense-lite/easy-adsense-lite.php", "adsense-now/adsense-now.php", "adsense-now-pro/adsense-now.php", "adsense-now-lite/adsense-now.php", "adsense-now-lite/adsense-now-lite.php");
     $ezActive = array();
     foreach ($ezFamily as $lite) {
         $ezKillLite = new EzKillLite($lite);
         $liteName = $ezKillLite->deny();
         if (!empty($liteName)) {
             $ezActive[$lite] = $liteName;
         }
     }
     if (count($ezActive) > 1) {
         $ezAdminNotice = '<ul>';
         foreach ($ezActive as $k => $p) {
             $ezAdminNotice .= "<li><code>{$k}</code>: <b>{$p}</b></li>\n";
         }
         $ezAdminNotice .= "</ul>";
         EzKillLite::$adminNotice .= '<div class="error"><p><b><em>Ads EZ Family of Plugins</em></b>: Please have only one of these plugins active.</p>' . $ezAdminNotice . 'Otherwise they will interfere with each other and work as the last one.</div>';
         add_action('admin_notices', array('EzKillLite', 'admin_notices'));
     }
 }