/**
  * get_syndication_posts
  * 
  * @Called By $this->detect_webhook_push_request()
  *
  * Performs the actions required to get sydication posts via an xmlrpc api request
  * Then format the data, add the posts along with categories, tags, and media
  * 
  * @access 	public
  * @author	Ben Moody
  */
 private function get_syndication_posts()
 {
     //Init vars
     $params = array();
     $results = NULL;
     //Expand allowed tags for post content santization iframes, ect
     add_filter('wp_kses_allowed_html', array($this, 'expand_kses_allowed_tags'), 10, 2);
     //Add any metyhod specific params in $params[3] as array
     $params = array('last_date' => get_option(PRSOSYNDTOOLKITREADER__LAST_IMPORT_OPTION));
     //Make api request
     $results = $this->api_request($this->api_method_get_posts, $params);
     //Check for error
     if ($this->is_api_request_error($results)) {
         //Shh, silence :)
         return;
     }
     //Init import
     $this->init_post_import($results);
     PrsoSyndToolkitReader::plugin_error_log($results);
 }
 /**
  * send_admin_email
  * 
  * Sends an error warning email to the wordpress admin
  * 
  * @access 	private
  * @author	Ben Moody
  */
 public static function send_admin_email($error_msg, $error_type = 'pull_error', $admin_email = NULL)
 {
     //Init vars
     $inc_templates = PRSOSYNDTOOLKITREADER__PLUGIN_DIR . "inc/templates/email/{$error_type}.php";
     $subject = NULL;
     $headers = array();
     $message = NULL;
     if (file_exists($inc_templates)) {
         //send admin an email to let them know
         if (empty($admin_email)) {
             $admin_email = get_option('admin_email');
         }
         //Set email content
         $subject = _x('WP Content Syndication Toolkit', 'text', PRSOSYNDTOOLKITREADER__DOMAIN);
         ob_start();
         include_once $inc_templates;
         $message = ob_get_contents();
         ob_end_clean();
         //Send Email to admin
         wp_mail($admin_email, $subject, $message);
         //Error log
         PrsoSyndToolkitReader::plugin_error_log($message);
         return;
     }
 }