public static function get_instance() { if (!isset(self::$instance)) { $c = __CLASS__; self::$instance = new $c(); } return self::$instance; }
<?php /* Plugin Name: ChatPirate Plugin URI: http://chatpirate.com Description: Pirate Chat is a live chat software on course to help you chat with your website visitors, offer live support, and increase sales. Try it on your Wordpress-based website now, don’t let your visitors sail aways.s Author: ChatPirate Author URI: http://chatpirate.com Version: 1.0.0 */ global $wp_version; if (version_compare($wp_version, "3", "<")) { exit("Requires WordPress 3 or newer"); } if (is_admin()) { require_once plugin_dir_path(__FILE__) . '/assets/ChatPirateAdmin.class.php'; $ChatPirateAdmin = new ChatPirateAdmin(); } else { require_once plugin_dir_path(__FILE__) . '/assets/ChatPirateFront.class.php'; ChatPirateFront::get_instance(); }