public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }
<?php /************************************* * Global Settings Page *************************************/ $wpcb = WPCB_Admin::get_instance(); $upgrade_message = $wpcb->upgrade_to_pro(); if(isset($_GET['step'])){ $step = $_GET['step']; } if(isset($_POST['mailer']) and isset($_POST['apikey']) and isset($_POST['connect'])){ $mailer_id = $_POST['mailer']; $api_key = $_POST['apikey']; switch($mailer_id){ //GetResponse case 1: if (!class_exists('jsonRPCClient')) { include_once(plugin_dir_path(dirname(__FILE__)).'mailers/getresponse-api.php'); } $getresponse = new jsonRPCClient('http://api2.getresponse.com'); try{ $name = array(); $allgrcampaigns = $getresponse->get_campaigns($api_key); foreach($allgrcampaigns as $grcampaign){ $campaign_name = $grcampaign['name']; $result = $getresponse->get_campaigns($api_key, array ('name' => array ( 'EQUALS' => $campaign_name ))); $res = array_keys($result);