/**
  * @author James Lafferty
  * @since 0.1
  */
 public function NS_Widget_MailChimp()
 {
     $this->default_failure_message = __('There was a problem processing your submission.');
     $this->default_signup_text = __('Join now!');
     $this->default_success_message = __('Thank you for joining our mailing list. Please check your email for a confirmation link.');
     $this->default_title = __('Sign up for our mailing list.');
     $widget_options = array('classname' => 'widget_ns_mailchimp', 'description' => __("Displays a sign-up form for a MailChimp mailing list.", 'mailchimp-widget'));
     $this->WP_Widget('ns_widget_mailchimp', __('MailChimp List Signup', 'mailchimp-widget'), $widget_options);
     $this->ns_mc_plugin = NS_MC_Plugin::get_instance();
     $this->default_loader_graphic = get_bloginfo('wpurl') . $this->default_loader_graphic;
     add_action('init', array(&$this, 'add_scripts'));
     add_action('parse_request', array(&$this, 'process_submission'));
 }
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
/**
 * Set up the autoloader.
 */
set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/lib/'));
spl_autoload_extensions('.class.php');
if (!function_exists('buffered_autoloader')) {
    function buffered_autoloader($c)
    {
        try {
            spl_autoload($c);
        } catch (Exception $e) {
            $message = $e->getMessage();
            return $message;
        }
    }
}
spl_autoload_register('buffered_autoloader');
/**
 * Get the plugin object. All the bookkeeping and other setup stuff happens here.
 */
$ns_mc_plugin = NS_MC_Plugin::get_instance();
register_deactivation_hook(__FILE__, array(&$ns_mc_plugin, 'remove_options'));
 public function get_mcapi()
 {
     $api_key = $this->get_api_key();
     if (false == $api_key) {
         return false;
     } else {
         if (empty(self::$mcapi)) {
             self::$mcapi = new MCAPI($api_key);
         }
         return self::$mcapi;
     }
 }