/** * Load the introduction tour */ function intro_tour() { global $pagenow, $current_user; $page = ''; if (isset($_GET['page'])) { $page = SPNL()->validate->page($_GET['page']); } $function = ''; $button2 = ''; $opt_arr = array(); $id = '.nav-sp'; //echo $page; if ('admin.php' != $pagenow || !array_key_exists($page, $adminpages)) { $id = '#toplevel_page_sp-overview'; $content = '<h3>' . __('Welcome to SendPress', 'sendpress') . '</h3>'; $content .= '<p>' . __('You\'ve just installed SendPress! Click “Start Tour” to view a quick introduction of this plugins core functionality.', 'sendpress') . '</p>'; $opt_arr = array('content' => $content, 'position' => array('edge' => 'left', 'align' => 'left')); $button2 = __("Start Tour", 'sendpress'); $function = 'document.location="' . admin_url('admin.php?page=sp-overview') . '";'; } else { if ('' != $page && in_array($page, array_keys($adminpages))) { $opt_arr = array('content' => $adminpages[$page]['content'], 'position' => array('edge' => 'top', 'align' => 'left'), 'pointerWidth' => 400); $button2 = $adminpages[$page]['button2']; $function = $adminpages[$page]['function']; } } $this->print_scripts($id, $opt_arr, __("Close", 'sendpress'), $button2, $function); }
function html($sp) { $list = SPNL()->validate->int($_GET['listID']); if ($list > 0) { $role_to_sync = get_post_meta($list, 'sync_role', true); SendPress_Data::drop_active_subscribers_for_sync($list); if ($role_to_sync == 'meta') { $meta_key = get_post_meta($list, 'meta-key', true); $meta_value = get_post_meta($list, 'meta-value', true); $meta_compare = get_post_meta($list, 'meta-compare', true); // WP_User_Query arguments $args = array('meta_query' => array(array('key' => $meta_key, 'value' => $meta_value, 'compare' => $meta_compare))); $user_query = new WP_User_Query($args); $blogusers = $user_query->get_total(); } else { $result = count_users(); foreach ($result['avail_roles'] as $role => $count) { if ($role == $role_to_sync) { $blogusers = $count; } } } } //$blogusers = get_users( 'role=' . $role ); //echo count($blogusers); ?> <div id="taskbar" class="lists-dashboard rounded group"> </div> <input type="hidden" id="post_ID" name="post_ID" value="<?php echo $list; ?> " /> <div class='well' id="sync-wordpress-roles"> <h2><strong><?php _e('Syncing ', 'sendpress'); ?> <?php echo ucwords($role); ?> <?php _e(' Role to List', 'sendpress'); ?> <?php echo get_the_title($list); ?> </strong></h2> <br> <div class="progress progress-striped active"> <div class="progress-bar sp-queueit" style="width: 0%;"></div> </div> <span id="queue-total">0</span> of <span id="list-total"><?php echo $blogusers; ?> </span> </div> <?php }
function html() { $email_id = get_query_var('spemail'); global $post; if (is_object($this->data()) && $this->data()->id) { $email_id = $this->data()->id; } if (isset($_GET['eid'])) { $email_id = SPNL()->validate->int(base64_decode($_GET['eid'])); } // If there's a subscriber ID in the URL, we need to get the subscriber object from it to use for the str_replace below. if (isset($_GET['sid'])) { $subscriber_id = SPNL()->validate->int(base64_decode($_GET['sid'])); } else { $subscriber_id = 0; } //$post = get_post($email_id); $inline = false; if (isset($_GET['inline'])) { $inline = true; } SendPress_Email_Cache::build_cache_for_email($email_id); $message = new SendPress_Email(); $message->id($email_id); $message->subscriber_id($subscriber_id); $message->list_id(0); $body = $message->html(); //print_r( $body ); unset($message); echo $body; //echo SendPress_Template::get_instance()->render_html(false, true, $inline ); }
function send_email($to, $subject, $html, $text, $istest = false, $sid, $list_id, $report_id) { //$user = SendPress_Option::get( 'mandrilluser' ); //$pass = SendPress_Option::get( 'mandrillpass' ); $from_email = SendPress_Option::get('fromemail'); //$hdr = new SendPress_SendGrid_SMTP_API(); $m = SendPress_Option::get_sender('sendpress'); //$hdr->addFilterSetting('dkim', 'domain', SendPress_Manager::get_domain_from_email($from_email) ); //$phpmailer->AddCustomHeader(sprintf( 'X-SMTPAPI: %s', $hdr->asJSON() ) ); $info = array("X-SP-METHOD" => "WPED.co", "X-SP-LIST" => $list_id, "X-SP-REPORT" => $report_id, "X-SP-SUBSCRIBER" => $sid, "X-SP-DOMAIN" => home_url()); $url = 'https://gateway.wped.co/send/'; //$url = 'http://spnl.dev/'; $verify_ssl = true; if (isset($m['verifyssl']) && $m['verifyssl'] == 'donotverify') { $verify_ssl = false; $url = 'http://api.wped.co/send'; } $message = array('to' => array(array('email' => $to)), 'subject' => $subject, 'html' => $html, 'text' => $text, 'from_email' => $from_email, 'from_name' => SendPress_Option::get('fromname'), 'headers' => $info, 'inline_css' => true, 'subaccount' => $m['sendpress-key'], 'metadata' => array('sender' => 'SPNL', 'return' => home_url())); $response = wp_remote_post($url, array('method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array('Content-Type' => 'application/json'), 'body' => json_encode($message), 'sslverify' => $verify_ssl, 'cookies' => array())); if (is_wp_error($response)) { $error_message = $response->get_error_message(); SPNL()->log->add('WPED Sending', $error_message, 0, 'sending'); return false; } else { return true; } return false; }
function prerender() { $ip = $_SERVER['REMOTE_ADDR']; //print_r($info); $info = $this->data(); if (isset($info->id)) { $lists = SendPress_Data::get_list_ids_for_subscriber($info->id); //$lists = explode(',',$info->listids); foreach ($lists as $list) { $status = SendPress_Data::get_subscriber_list_status($list->listID, $info->id); if ($status->statusid == 1) { SendPress_Data::update_subscriber_status($list->listID, $info->id, '2'); } } SPNL()->db("Subscribers_Tracker")->open($info->report, $info->id, 4); } if (SendPress_Option::get('confirm-page') == 'custom') { $page = SendPress_Option::get('confirm-page-id'); if ($page != false) { $plink = get_permalink($page); if ($plink != "") { wp_safe_redirect(esc_url_raw($plink)); exit; } } } }
function html() { $ip = $_SERVER['REMOTE_ADDR']; $info = $this->data(); SPNL()->db->subscribers_tracker->open($info->report, $info->id); //$link = SendPress_Data::track_open($info->id , $info->report , $ip , $this->_device_type, $this->_device ); header('Content-type: image/gif'); //include(SENDPRESS_PATH. 'img/clear.gif'); }
function html($sp) { global $post_ID, $post; $list = ''; if (isset($_GET['emailID'])) { $emailID = SPNL()->validate->int($_GET['emailID']); $post = get_post($emailID); $post_ID = $post->ID; } update_post_meta($post->ID, '_send_last', 0); $info = get_post_meta($post->ID, '_send_data', true); $lists = get_post_meta($post->ID, '_send_lists', true); $subject = $post->post_title; $list = explode(",", $lists); $view = isset($_GET['view']) ? $_GET['view'] : ''; if (isset($_GET['finished'])) { $time = get_post_meta($post->ID, '_send_time', true); if ($time == '0000-00-00 00:00:00') { SendPress_Admin::redirect('Queue'); } else { SendPress_Admin::redirect('Reports'); } } $subs = SendPress_Data::get_active_subscribers_count($list); update_post_meta($post->ID, '_send_last_count', $subs); update_post_meta($post->ID, '_sendpress_report', 'new'); ?> <div id="taskbar" class="lists-dashboard rounded group"> </div><input type="hidden" id="post_ID" name="post_ID" value="<?php echo $post->ID; ?> " /><input type="hidden" id="reporttoqueue" name="reporttoqueue" value="<?php echo $lists; ?> " /> <div class='well' id="confirm-queue-add"> <h2><strong><?php _e('Adding Subscribers to Queue', 'sendpress'); ?> </strong></h2><br> <!-- <p>email: <?php echo stripslashes(esc_attr(htmlspecialchars($subject))); ?> </p>--> <div class="progress progress-striped active"> <div class="progress-bar sp-queueit" style="width: 0%;"></div> </div> <span id="queue-total">0</span> of <span id="list-total"><?php echo $subs; ?> </span> </div> <?php }
function html($sp) { global $sendpress_html_templates; //print_r($sendpress_html_templates[$_GET['templateID']]); $list = SPNL()->validate->int($_GET['templateID']); $postdata = get_post($list); //print_r( $postdata ); ?> <form method="post" name="post" > <input type="hidden" value="<?php echo $list; ?> " name="templateID" /> <div class="pull-right"> <a href="<?php echo SendPress_Admin::link('Emails_Tempstyle', array('templateID' => $list)); ?> ">Back to Template</a> <button class="btn btn-primary " type="submit" value="save" name="submit"><i class="icon-white icon-ok"></i> <?php echo __('Save', 'sendpress'); ?> </button> </div> <h2><?php echo $postdata->post_title; ?> <?php _e('Template Page Footer', 'sendpress'); ?> </h2><br> <div class="tab-pane fade in active" id="home"><?php wp_editor(get_post_meta($postdata->ID, '_footer_page', true), 'footer-content'); ?> </div> <br><br> <?php _e('Default Content', 'sendpress'); ?> <textarea class="form-control" rows="3"> <?php $sys = false; get_post_meta($postdata->ID, '_system_template', true); if (true == get_post_meta($postdata->ID, '_system_template', true)) { $sys = true; } echo SendPress_Tag_Footer_Page::content(true); ?> </textarea> <?php SendPress_Data::nonce_field(); ?> </form> <?php $this->popup(); }
function html($sp) { echo "<h2>" . __('Attempting to install or repair missing data', 'sendpress') . "</h2><br>"; SendPress_Data::install(); @SPNL()->db->subscribers_tracker->create_table(); @SPNL()->db->url->create_table(); @SPNL()->db->subscribers_url->create_table(); echo "<pre>"; echo SendPress_DB_Tables::check_setup_support(); echo "</pre>"; }
function html() { $info = $this->data(); if (isset($_GET['id'])) { $id = SPNL()->validate->int($_GET['id']); } else { $id = $info->id; } $email = SendPress_Data::process_with_iron($id); $data = array("send" => $email); echo json_encode($data); }
function html($sp) { global $post_ID, $post; $view = isset($_GET['view']) ? $_GET['view'] : ''; if (isset($_GET['emailID'])) { $emailID = SPNL()->validate->int($_GET['emailID']); $post = get_post($emailID); $post_ID = $post->ID; } ?> <form method="post"> <input type="hidden" id="post_ID" name="post_ID" value="<?php echo $post->ID; ?> " /> <h2><?php _e('Cancel Scheduled Email', 'sendpress'); ?> </h2> <div class='well'> <?php $info = get_post_meta($post->ID, '_send_time', true); ?> <p><?php _e('Subject', 'sendpress'); ?> : <?php echo $post->post_title; ?> </p> <p><?php _e('Date', 'sendpress'); ?> : <?php echo date_i18n('Y/m/d @ h:i A', strtotime($info)); ?> </p> <?php SendPress_Data::nonce_field(); ?> <button class="btn" value="cancel" name="submit"><?php _e('Cancel', 'sendpress'); ?> </button> <button class="btn btn-danger" value="delete" name="submit"><?php _e('Delete Scheduled Email', 'sendpress'); ?> </button> </div> </form> <?php }
function html() { //$ip = $_SERVER['REMOTE_ADDR']; $info = $this->data(); //$hash = wp_hash( $info->url , 'sendpress' ); $db_url = SPNL()->db->url; $url_in_db = $db_url->get($info->url); //= SendPress_Data::get_url_by_hash( $hash ); if ($url_in_db == false) { $id = $db_url->add($info->url); } else { $id = $url_in_db; } $dk = SendPress_Data::devicetypes($this->_device_type); $url = $info->url; switch ($info->url) { case '{sp-browser-url}': $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Browser_Url::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false); break; case '{sp-unsubscribe-url}': $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Unsubscribe::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false); break; case '{sp-manage-subscription-url}': $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Manage_Subscriptions::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false); break; } SPNL()->db->subscribers_url->add_update(array('subscriber_id' => $info->id, 'email_id' => $info->report, 'url_id' => $id)); SPNL()->db->subscribers_tracker->open($info->report, $info->id, 2); if (strrpos($url, "mailto") !== false) { header("Location: " . esc_url_raw($url)); } else { if (defined("SENDPRESS_PRO_VERSION")) { $url = add_query_arg('utm_medium', 'email', $url); $url = add_query_arg('utm_source', 'sendpress', $url); $sub = get_post_meta($info->report, '_sendpress_subject', true); $alt = get_post_meta($info->report, 'google-campaign-name', true); if ($alt !== false) { $sub = $alt; } $url = add_query_arg('utm_campaign', $sub, $url); } wp_redirect(esc_url_raw($url)); } exit; // //$link = SendPress_Data::get_url_by_id( $info->urlID ); //SendPress_Data::track_click( $info->id , $info->report, $info->urlID , $ip , $this->_device_type, $this->_device ); //header("Location: " . $link->url); //wp_redirect( $link->url ); //exit; }
function html() { SendPress_Tracking::event('Emails Tab'); //SendPress_Template_Manager::update_template_content(); //Create an instance of our package class... $testListTable = new Jaiminho_Email_Local_Table(); //Fetch, prepare, sort, and filter our data... $testListTable->prepare_items(); ?> <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> <form id="email-filter" method="get"> <div id="taskbar" class="lists-dashboard rounded group"> <h2><?php _e('Templates', 'sendpress'); ?> </h2> <small><?php _e('Help', 'sendpress'); ?> : <a target="_blank" href="http://docs.sendpress.com/article/58-setting-up-a-newsletter-template/"><?php _e('Getting Started with Templates', 'sendpress'); ?> </a></small> </div> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo SPNL()->validate->page(); ?> " /> <!-- Now we can render the completed list table --> <?php $testListTable->display(); ?> <?php wp_nonce_field($this->_nonce_value); ?> </form><br> <!--a href="<?php echo SendPress_Admin::link('Emails_Temp', array('action' => 'install')); ?> " class="btn btn-primary">Install Starter Templates</a--> <a href="<?php echo SendPress_Admin::link('Emails_Temp', array('action' => 'install')); ?> " class="btn btn-primary">Install Starter Templates</a> <?php }
function save() { $post_options = array('list', 'email', 'firstname', 'lastname', 'status'); $user_info = array(); foreach ($post_options as $opt) { $user_info[$opt] = isset($_POST['sp_' . $opt]) ? $_POST['sp_' . $opt] : false; } $valid_user = array(); //foreach() if (isset($user_info['list'])) { if (!is_array($user_info['list'])) { $user_info['list'] = array($user_info['list']); } if (isset($user_info['status'])) { $valid_user['status'] = SPNL()->validate->int($user_info['status']); } else { $valid_user['status'] = 2; } $data_error = false; if (isset($user_info['email']) && is_email($user_info['email'])) { $valid_user['email'] = $user_info['email']; } else { $data_error = __('Invalid Email', 'sendpress'); } if (isset($user_info['firstname'])) { $valid_user['firstname'] = sanitize_text_field($user_info['firstname']); } else { $valid_user['firstname'] = ''; } if (isset($user_info['lastname'])) { $valid_user['lastname'] = sanitize_text_field($user_info['lastname']); } else { $valid_user['lastname'] = ''; } $status = false; if ($data_error == false) { $list = implode(",", $user_info['list']); $custom = apply_filters('sendpress_subscribe_to_list_custom_fields', array(), $_POST); $status = SendPress_Data::subscribe_user($list, $valid_user['email'], $valid_user['firstname'], $valid_user['lastname'], $valid_user['status'], $custom); if ($status == false) { $data_error = __('Problem with subscribing user.', 'sendpress'); } else { $data_error = __('Thanks for subscribing.', 'sendpress'); } } } $this->message = $data_error; }
function html() { $ip = $_SERVER['REMOTE_ADDR']; $info = $this->data(); SPNL()->load("Subscribers_Tracker")->open($info->report, $info->id); //Get the filesize of the image for headers $filesize = filesize(SENDPRESS_PATH . 'img/icon.png'); //Now actually output the image requested (intentionally disregarding if the database was affected) header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: public ', false); header('Content-type: image/png'); header('Content-Length: ' . $filesize); echo file_get_contents(SENDPRESS_PATH . 'img/icon.png'); }
function html() { $email_id = SPNL()->validate->int(get_query_var('spemail')); global $post; $post = get_post($email_id); $inline = false; if (isset($post) && $post->post_type == 'sp_template') { //Render New Template Preview echo SendPress_Email_Render_Engine::render_template_example($post); } else { if (isset($_GET['inline'])) { $inline = true; } echo $post->post_content; } }
function html() { //$ip = $_SERVER['REMOTE_ADDR']; $info = $this->data(); //$hash = wp_hash( $info->url , 'sendpress' ); $dk = SendPress_Data::devicetypes($this->_device_type); $url = $info->url; switch ($info->url) { case '{sp-browser-url}': $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Browser_Url::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false); break; case '{sp-unsubscribe-url}': $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Unsubscribe::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false); break; case '{sp-manage-subscription-url}': $url = SPNL()->template_tags->do_subscriber_tags(SendPress_Tag_Manage_Subscriptions::external($info->url, $info->report, $info->id, false), $info->report, $info->report, $info->id, false); break; } $args = array('timeout' => 0.1, 'blocking' => false, 'headers' => array(), 'sslverify' => false); $request = home_url('/spnl-api/tracker'); // Parameters as separate arguments $request = add_query_arg(array('email' => $info->report, 'url' => urlencode($info->url), 'id' => $info->id), $request); wp_remote_get($request, $args); if (strrpos($url, "mailto") !== false) { header("Location: " . esc_url_raw($url)); } else { if (defined("SENDPRESS_PRO_VERSION")) { $url = add_query_arg('utm_medium', 'email', $url); $url = add_query_arg('utm_source', 'sendpress', $url); $sub = get_post_meta($info->report, '_sendpress_subject', true); $alt = get_post_meta($info->report, 'google-campaign-name', true); if ($alt !== false) { $sub = $alt; } $url = add_query_arg('utm_campaign', $sub, $url); } wp_redirect(esc_url_raw($url)); } exit; // //$link = SendPress_Data::get_url_by_id( $info->urlID ); //SendPress_Data::track_click( $info->id , $info->report, $info->urlID , $ip , $this->_device_type, $this->_device ); //header("Location: " . $link->url); //wp_redirect( $link->url ); //exit; }
function html($sp) { global $sendpress_html_templates; //print_r($sendpress_html_templates[$_GET['templateID']]); $templateID = SPNL()->validate->int($_GET['templateID']); $postdata = get_post($templateID); //print_r( $postdata ); ?> <form method="post" name="post" > <input type="hidden" value="<?php echo $templateID; ?> " name="templateID" /> <div class="pull-right"> <a href="<?php echo SendPress_Admin::link('Emails_Tempstyle', array('templateID' => $templateID)); ?> "><?php _e('Back to Template', 'sendpress'); ?> </a> <button class="btn btn-primary " type="submit" value="save" name="submit"><i class="icon-white icon-ok"></i> <?php echo __('Save', 'sendpress'); ?> </button> </div> <h2><?php echo $postdata->post_title; ?> <?php _e('Template Page Header', 'sendpress'); ?> </h2><br> <div class="tab-pane fade in active" id="home"><?php wp_editor(get_post_meta($postdata->ID, '_header_page', true), 'header-content'); ?> </div> <?php SendPress_Data::nonce_field(); ?> </form> <?php $this->popup(); }
static function send_mail_cron() { //@ini_set('max_execution_time',0); global $wpdb; $count = SendPress_Option::get('emails-per-hour'); $count = SendPress_Option::get('wpcron-per-call', 25); $email_count = 0; $attempts = 0; if (SendPress_Manager::limit_reached($count)) { return; } SendPress_Email_Cache::build_cache(); for ($i = 0; $i < $count; $i++) { $email = SendPress_Data::get_single_email_from_queue(); if ($email != null) { $attempts++; SendPress_Data::queue_email_process($email->id); $result = SendPress_Manager::send_email_from_queue($email); $email_count++; if ($result) { if ($result === true) { $wpdb->update(SendPress_Data::queue_table(), array('success' => 1, 'inprocess' => 3), array('id' => $email->id)); //( $sid, $rid, $lid=null, $uid=null, $ip=null, $device_type=null, $device=null, $type='confirm' ) //$wpdb->update( SendPress_Data::queue_table() , array('success'=>1,'inprocess'=>3 ) , array('id'=> $email->id )); //$wpdb->insert(SendPress_Data::subscriber_tracker_table() , array('subscriberID'=>$email->subscriberID,'emailID'=>$email->emailID,'sent_at' => get_gmt_from_date( date('Y-m-d H:i:s') )) ); SPNL()->db->subscribers_tracker->add(array('subscriber_id' => intval($email->subscriberID), 'email_id' => intval($email->emailID))); SendPress_Data::add_subscriber_event($email->subscriberID, $email->emailID, $email->listID, null, null, null, null, 'send'); } else { $wpdb->update(SendPress_Data::queue_table(), array('success' => 2, 'inprocess' => 3), array('id' => $email->id)); SendPress_Data::add_subscriber_event($email->subscriberID, $email->emailID, $email->listID, null, null, null, null, 'bounce'); SendPress_Data::bounce_subscriber_by_id($email->subscriberID); } //$wpdb->insert( $this->subscriber_open_table(), $senddata); $count++; //SendPress_Data::update_report_sent_count( $email->emailID ); } else { $wpdb->update(SendPress_Data::queue_table(), array('attempts' => $email->attempts + 1, 'inprocess' => 0, 'last_attempt' => date('Y-m-d H:i:s')), array('id' => $email->id)); } } else { //We ran out of emails to process. break; } set_time_limit(30); } return; }
function html() { SendPress_Tracking::event('Emails Tab'); //Create an instance of our package class... $testListTable = new SendPress_System_Email_Table(); //Fetch, prepare, sort, and filter our data... $testListTable->prepare_items(); ?> <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> <form id="email-filter" method="get"> <div id="taskbar" class="lists-dashboard rounded group"> <?php $form_types = SendPress_Data::get_system_email_types(); if ($form_types) { ?> <div id="button-area"> <a class="btn btn-primary btn-large" href="?page=<?php echo SPNL()->validate->page(); ?> &view=systememailcreate"><?php _e('Create System E-mail', 'sendpress'); ?> </a> </div> <?php } ?> </div> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo SPNL()->validate->page(); ?> " /> <!-- Now we can render the completed list table --> <?php $testListTable->display(); ?> <?php wp_nonce_field($this->_nonce_value); ?> </form> <?php }
function html($sp) { global $post_ID, $post; $view = isset($_GET['view']) ? $_GET['view'] : ''; $list = ''; if (isset($_GET['emailID'])) { $emailID = SPNL()->validate->int($_GET['emailID']); $post = get_post($emailID); $post_ID = $post->ID; } ?> <form method="post" id="post"> <br class="clear"> <!-- <div style="float:right;" > <a href="<?php echo SendPress_Admin::link('Settings_Styles'); ?> " class="btn btn-default btn-large" ><i class="icon-remove"></i> <?php _e('Cancel', 'sendpress'); ?> </a> <a href="#" id="save-update" class="btn btn-primary btn-large"><i class="icon-white icon-ok"></i> <?php _e('Save', 'sendpress'); ?> </a> </div> --> <br class="clear"> <?php define('SENDPRESS_STYLER_PAGE', true); require_once SENDPRESS_PATH . 'inc/forms/email-style.2.0.php'; ?> <br class="clear"> <?php wp_nonce_field($sp->_nonce_value); ?> </form> <?php }
function html($sp) { //Create an instance of our package class... $sp_reports_table = new SendPress_Reports_Tests_Table(); //Fetch, prepare, sort, and filter our data... $sp_reports_table->prepare_items(); ?> <br> <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> <form id="email-filter" method="get"> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo SPNL()->validate->page($_REQUEST['page']); ?> " /> <!-- Now we can render the completed list table --> <?php $sp_reports_table->display(); ?> <?php wp_nonce_field($this->_nonce_value); ?> </form> <h3>Information</h3> <div class='well'> <span class="label label-success"><?php _e('Unique', 'sendpress'); ?> </span> <?php _e('The total number of different recipients that have clicked on a link or opened an email.', 'sendpress'); ?> <br><br> <span class="label label-info"><?php _e('Total', 'sendpress'); ?> </span> <?php _e('The total number of clicks or opens that have happened. Regardless of who clicked or opened the email.', 'sendpress'); ?> </div> <?php }
function save() { $_POST['post_type'] = SendPress_Data::email_post_type(); // Update post 37 (37!) $my_post = _wp_translate_postdata(true); /* $my_post['ID'] = $_POST['post_ID']; $my_post['post_content'] = $_POST['content']; $my_post['post_title'] = $_POST['post_title']; */ $my_post['post_status'] = 'sp-autoresponder'; // Update the post into the database wp_update_post($my_post); update_post_meta($my_post['ID'], '_sendpress_subject', sanitize_text_field($_POST['post_subject'])); update_post_meta($my_post['ID'], '_sendpress_template', SPNL()->validate->int($_POST['template'])); update_post_meta($my_post['ID'], '_sendpress_status', 'private'); update_post_meta($my_post['ID'], '_sendpress_system', 'new'); SendPress_Email::set_default_style($my_post['ID']); //clear the cached file. delete_transient('sendpress_email_html_' . $my_post['ID']); SendPress_Admin::redirect('Emails_Edit', array('emailID' => $my_post['ID'])); //$this->save_redirect( $_POST ); }
function html() { $ip = $_SERVER['REMOTE_ADDR']; $info = $this->data(); SPNL()->db->subscribers_tracker->open($info->report, $info->id); //$link = SendPress_Data::track_open($info->id , $info->report , $ip , $this->_device_type, $this->_device ); //header('Content-type: image/gif'); //include(SENDPRESS_PATH . 'img/clear.gif'); //$graphic_http = 'http://yourwebsite.com/img/blank.gif'; //$filesize = filesize( SENDPRESS_PATH . 'img/clear.gif' ); //Full URI to the image $graphic_http = 'http://yourwebsite.com/blank.gif'; //Get the filesize of the image for headers $filesize = filesize(SENDPRESS_PATH . 'img/icon.png'); //Now actually output the image requested (intentionally disregarding if the database was affected) header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: public ', false); header('Content-type: image/png'); header('Content-Length: ' . $filesize); echo file_get_contents(SENDPRESS_PATH . 'img/icon.png'); }
function auto_cron() { // make sure we're in wp-cron.php if (false !== strpos($_SERVER['REQUEST_URI'], '/wp-cron.php')) { // make sure a secret string is provided in the ur if (isset($_GET['action']) && $_GET['action'] == 'sendpress') { $time_start = microtime(true); $count = SendPress_Data::emails_in_queue(); $bg = 0; if ($count > 0) { SendPress_Queue::send_mail(); $count = SendPress_Data::emails_in_queue(); } else { SPNL()->log->prune_logs(); SendPress_Data::clean_queue_table(); //SendPress_Logging::prune_logs(); $bg = 1; } $attempted_count = SendPress_Option::get('autocron-per-call', 25); $pro = 0; if (defined('SENDPRESS_PRO_VERSION')) { $pro = SENDPRESS_PRO_VERSION; } $stuck = SendPress_Data::emails_stuck_in_queue(); $limit = SendPress_Manager::limit_reached(); $emails_per_day = SendPress_Option::get('emails-per-day'); $emails_per_hour = SendPress_Option::get('emails-per-hour'); $hourly_emails = SendPress_Data::emails_sent_in_queue("hour"); $emails_so_far = SendPress_Data::emails_sent_in_queue("day"); $limits = array('autocron' => $attempted_count, 'dl' => $emails_per_day, 'hl' => $emails_per_hour, 'ds' => $emails_so_far, 'hs' => $hourly_emails); $time_end = microtime(true); $time = $time_end - $time_start; echo json_encode(array("background" => $bg, "queue" => $count, "stuck" => $stuck, "version" => SENDPRESS_VERSION, "pro" => $pro, "limit" => $limit, 'info' => $limits, 'time' => number_format($time, 3))); die; } } }
function html($sp) { SendPress_Tracking::event('Queue Tab'); $testListTable = new SendPress_Queue_Errors_Table(); $testListTable->prepare_items(); SendPress_Option::set('no_cron_send', 'false'); $sp->cron_start(); $open_info = array("id" => 13, "report" => 10, "view" => "open"); ?> <h2><?php _e('Error history for the last 2 Weeks', 'sendpress'); ?> .</h2> <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> <form id="email-filter" action="<?php echo SendPress_Admin::link('Queue_Errors'); ?> " method="get"> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo SPNL()->validate->page($_REQUEST['page']); ?> " /> <!-- Now we can render the completed list table --> <?php $testListTable->display(); ?> <?php wp_nonce_field($sp->_nonce_value); ?> </form> <br> <?php }
function html($sp) { SendPress_Tracking::event('Overview Tab'); global $wp_version; $classes = 'sp-welcome-panel'; $option = get_user_meta(get_current_user_id(), 'show_sp_welcome_panel', true); // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner $hide = 0 == $option || 2 == $option && wp_get_current_user()->user_email != get_option('admin_email'); list($display_version) = explode('-', $wp_version); ?> <br> <div class="sp-row "> <div class="sp-block sp-25 sp-first"> <h2 class="nomargin nopadding"><?php echo SendPress_Data::bd_nice_number(SendPress_Data::get_total_subscribers()); ?> </h2> <p class="fwb"><?php _e('Subscribers', 'sendpress'); ?> </p> </div> <div class="sp-block sp-25"> <h2 class="nomargin nopadding"><?php $report = SendPress_Data::get_last_report(); echo SendPress_Data::emails_active_in_queue(); ?> </h2> <p class="fwb"><?php _e('Emails Actively Sending', 'sendpress'); ?> </small></p> </div> <div class="sp-block sp-25"> <h2 class="nomargin nopadding"><?php echo SendPress_Data::emails_maxed_in_queue(); ?> </h2> <p class="fwb"><?php _e('Emails Stuck in Queue', 'sendpress'); ?> </p> </div> <div class="sp-block sp-25"> <h2 class="nomargin nopadding"><?php _e('Autocron last check', 'sendpress'); ?> </h2> <p class="fwb"> <?php $autocron = SendPress_Option::get('autocron', 'no'); //print_r(SendPress_Data::emails_stuck_in_queue()); if ($autocron == 'yes') { $api_info = json_decode(SendPress_Cron::get_info()); if (isset($api_info->lastcheck)) { echo $api_info->lastcheck . " UTC"; } else { echo "No Data"; } } else { echo "Not Enabled"; } ?> </p> </div> </div> <?php if ($report) { $rec = get_post_meta($report->ID, '_send_last_count', true); $this->panel_start($report->post_title . " <small style='color:#333;'>" . __('This email had', 'sendpress') . " " . $rec . " " . __('Recipients', 'sendpress') . "</small>"); $stat_type = get_post_meta($report->ID, '_stat_type', true); $clicks = SPNL()->db("Subscribers_Url")->clicks_email_id($report->ID); $clicks_total = SPNL()->db("Subscribers_Url")->clicks_total_email_id($report->ID); ?> <div class="sp-row"> <div class="sp-50 sp-first"> <h4 style="text-align:center;"><?php _e('Opens', 'sendpress'); ?> </h4> <?php $this->panel_start(); $open = 0; $rec = get_post_meta($report->ID, '_send_last_count', true); if ($report) { if ($stat_type == 'new') { $open = SPNL()->db("Subscribers_Tracker")->get_opens_total($report->ID); } else { $open = SendPress_Data::get_opens($report->ID); } $p = $open / $rec * 100; } ?> <div class="sp-row"> <div class="sp-50 sp-first"> <div style="float:left;"> <div id="myStat" class="chartid" data-dimension="150" data-text="<?php echo floor($p); ?> %" data-info="Total Opens" data-width="15" data-fontsize="30" data-percent="<?php echo floor($p); ?> " data-fgcolor="#61a9dc" data-bgcolor="#eee" data-fill="#ddd" data-total="<?php echo $rec; ?> " data-part="<?php echo $open; ?> " data-icon="long-arrow-up" data-icon-size="28" data-icon-color="#fff"></div> </div> <div style="text-align:center;"> <h5>Total</h5> <?php echo $open; ?> </div> </div> <div class="sp-50"> <?php $ou = 0; if ($stat_type == 'new') { $ou = SPNL()->db("Subscribers_Tracker")->get_opens($report->ID); } else { $ou = SendPress_Data::get_opens_unique_total($report->ID); } $px = $ou / $rec * 100; ?> <div style="float:left;"> <div id="myStat" class="chartid" data-dimension="150" data-text="<?php echo floor($px); ?> %" data-info="Unique Opens" data-width="15" data-fontsize="30" data-percent="35" data-fgcolor="#85d002" data-bgcolor="#eee" data-fill="#ddd" data-total="<?php echo $rec; ?> " data-part="<?php echo $ou; ?> " data-icon="long-arrow-up" data-icon-size="28" data-icon-color="#fff"></div> </div> <div style="text-align:center;"> <h5>Unique</h5> <?php echo $ou; ?> </div> </div> </div> <?php $this->panel_end(); ?> </div> <div class="sp-50"> <h4 style="text-align:center;"><?php _e('Clicks', 'sendpress'); ?> </h4> <?php $this->panel_start(); $click = 0; $rec = get_post_meta($report->ID, '_send_last_count', true); if ($report) { if ($stat_type == 'new') { $click = SPNL()->db("Subscribers_Url")->clicks_email_id($report->ID); } else { $click = SendPress_Data::get_clicks($report->ID); } $p = $click / $rec * 100; } ?> <div class="sp-row"> <div class="sp-50 sp-first"> <div style="float:left;"> <div id="myStat" class="chartid" data-dimension="150" data-text="<?php echo floor($p); ?> %" data-info="Total Opens" data-width="15" data-fontsize="30" data-percent="<?php echo floor($p); ?> " data-fgcolor="#61a9dc" data-bgcolor="#eee" data-fill="#ddd" data-total="<?php echo $rec; ?> " data-part="<?php echo $click; ?> " data-icon="long-arrow-up" data-icon-size="28" data-icon-color="#fff"></div> </div> <div style="text-align:center;"> <h5><?php _e('Total', 'sendpress'); ?> </h5> <?php echo $click; ?> </div> </div> <div class="sp-50"> <?php $ou = 0; if ($stat_type == 'new') { $ou = SPNL()->db("Subscribers_Url")->clicks_total_email_id($report->ID); } else { $ou = SendPress_Data::get_clicks_unique_total($report->ID); } $px = $ou / $rec * 100; ?> <div style="float:left;"> <div id="myStat" class="chartid" data-dimension="150" data-text="<?php echo floor($px); ?> %" data-info="Unique Opens" data-width="15" data-fontsize="30" data-percent="35" data-fgcolor="#85d002" data-bgcolor="#eee" data-fill="#ddd" data-total="<?php echo $rec; ?> " data-part="<?php echo $ou; ?> " data-icon="long-arrow-up" data-icon-size="28" data-icon-color="#fff"></div> </div> <div style="text-align:center;"> <h5><?php _e('Unique', 'sendpress'); ?> </h5> <?php echo $ou; ?> </div> </div> </div> <?php $this->panel_end(); ?> </div> </div> <?php $this->panel_end(); } ?> <div class="sp-row"> <div class="sp-33 sp-first"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Recent Subscribers', 'sendpress'); ?> </h3> </div> <div class="panel-body"> <table class="table table-striped table-condensed"> <tr> <th>Date</th> <th>List</th> <th><div style="text-align:right;">Email</div></th> </tr> <?php $recent = SendPress_Data::get_recent_subscribers(); foreach ($recent as $item) { echo "<tr>"; echo "<td>"; if (property_exists($item, 'subscriberID')) { $d = SendPress_Data::get_subscriber($item->subscriberID); if (property_exists($item, 'updated')) { echo date_i18n("m.d.y", strtotime($item->updated)); } echo "</td>"; echo "<td >"; if (property_exists($item, 'listID')) { echo get_the_title($item->listID); } echo "</td>"; echo "<td align='right'>"; if (is_object($d)) { echo $d->email . "<br>"; } echo "</td>"; echo "</tr>"; } } ?> </table> </div> </div> </div> <div class="sp-33"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Most Active Subscribers', 'sendpress'); ?> </h3> </div> <div class="panel-body"> <ul> <?php $recent = SPNL()->db("Subscribers_Tracker")->get_most_active(); // SendPress_Data::get_most_active_subscriber(); foreach ($recent as $item) { if (property_exists($item, 'subscriber_id')) { echo "<li>"; $d = SendPress_Data::get_subscriber($item->subscriber_id); if (is_object($d)) { echo $d->email; } echo "</li>"; } } ?> </ul> </div> </div> </div> <div class="sp-33"> <?php if (!defined('SENDPRESS_PRO_VERSION')) { ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Go Pro!', 'sendpress'); ?> </h3> </div> <div class="panel-body"> <ul> <li><a href="http://sendpress.com/purchase-pricing/"><?php _e('Advanced Reports', 'sendpress'); ?> </a></li> <li><a href="http://sendpress.com/purchase-pricing/"><?php _e('Check Spam Scores', 'sendpress'); ?> </a></li> <li><a href="http://sendpress.com/purchase-pricing/"><?php _e('Post Notifications', 'sendpress'); ?> </a></li> </ul> </div> </div> <?php } ?> </div> </div> <script> jQuery( document ).ready(function($) { $('.chartid').circliful(); }); </script> <!-- <div class="panel panel-default"> <div class="panel-body"> <h2>Welcome to SendPress</h2> </div> </div> --> <?php if (SendPress_Option::get('feedback') == 'yes' || SendPress_Option::get('allow_tracking') == 'yes') { SendPress_Tracking::data(); } }
static function send($to, $subject, $body, $text, $test = false, $sid = 0, $list_id = 0, $report_id = 0) { //SendPress_Error::log('Send me an email!'); global $sendpress_sender_factory; // $senders = $sendpress_sender_factory->get_all_senders(); $method = SendPress_Option::get('sendmethod'); //SendPress_Error::log(array($to, $subject,$method)); $sender = $sendpress_sender_factory->get_sender($method); if ($sender != false) { if (empty($text) || $text == '' || empty($body) || $body == '' || $body == " ") { SPNL()->log->add('Email Skiped', 'Email to ' . $to . ' did not have any Text.', 0, 'sending'); return false; } return $sender->send_email($to, $subject, $body, $text, $test, $sid, $list_id, $report_id); } return false; /* $website = new SendPress_Sender_Website(); return $website->send_email( $to, $subject, $body, $text, $test, $sid , $list_id, $report_id ); */ }
function html() { global $sendpress_sender_factory; $senders = $sendpress_sender_factory->get_all_senders(); ksort($senders); $method = SendPress_Option::get('sendmethod'); $fe = __('From Email', 'sendpress'); $fn = __('From Name', 'sendpress'); ?> <!-- <div style="float:right;" > <a href="" class="btn btn-large btn-default" ><i class="icon-remove"></i> <?php _e('Cancel', 'sendpress'); ?> </a> <a href="#" id="save-update" class="btn btn-primary btn-large"><i class="icon-white icon-ok"></i> <?php _e('Save', 'sendpress'); ?> </a> </div> --> <form method="post" id="post"> <br class="clear"> <br class="clear"> <div class="sp-row"> <div class="sp-50 sp-first"> <?php $this->panel_start('<span class="glyphicon glyphicon-user"></span> ' . __('Sending Email', 'sendpress')); ?> <div class="form-group"> <label for="fromname"><?php _e('From Name', 'sendpress'); ?> </label> <input name="fromname" tabindex=1 type="text" id="fromname" value="<?php echo SendPress_Option::get('fromname'); ?> " class="form-control"> </div> <div class="form-group"> <label for="fromemail"><?php _e('From Email', 'sendpress'); ?> </label> <input name="fromemail" tabindex=2 type="text" id="fromemail" value="<?php echo SendPress_Option::get('fromemail'); ?> " class="form-control"> </div> <div class="form-group"> <label for="bounceemail"><?php _e('Email de Retorno', 'jaiminho'); ?> </label> <input name="bounceemail" tabindex=3 type="text" id="bounceemail" value="<?php echo SendPress_Option::get('bounce_email'); ?> " class="form-control"> </div> <?php $this->panel_end(); ?> </div > <div class="sp-50"> <?php $this->panel_start('<span class="glyphicon glyphicon-inbox"></span> ' . __('Test Email', 'sendpress')); ?> <div class="form-group"> <label for="testemail"><?php _e('Where to send Test Email', 'sendpress'); ?> </label> <input name="testemail" type="text" id="test-email-main" value="<?php echo SendPress_Option::get('testemail'); ?> " class="form-control"/> </div> <div class="sp-row"> <div class="sp-50 sp-first"> <button class="btn btn-primary btn-block" value="test" name="test" type="submit"><?php _e('Send Test!', 'sendpress'); ?> </button> </div> <div class="sp-50"> <button class="btn btn-danger btn-block" data-toggle="modal" data-target="#debugModal" type="button"><?php _e('Debug Info', 'sendpress'); ?> </button> </div> </div> <div class="sp-row"> <br> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"> <?php _e('Click to View Last Error', 'sendpress'); ?> </a> </h4> </div> <div id="collapseOne" class="panel-collapse collapse"> <div class="panel-body"> <?php $logs = SPNL()->log->get_connected_logs(array('posts_per_page' => 1, 'log_type' => 'sending')); if (!empty($logs)) { foreach ($logs as $log) { echo "<strong>" . $log->post_date . "</strong> " . $log->post_title; echo "<br>" . $log->post_content; } } ?> </div> </div> </div> </div> </div> <?php $this->panel_end(); ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Sending Account Setup', 'sendpress'); ?> </h3> </div> <div class="panel-body"> <input type="hidden" name="action" value="account-setup" /> <?php $new = array(); foreach ($senders as $key => $sender) { array_push($new, array($key, $sender->label())); } echo '<strong>Delivery Method: </strong>'; $this->select('sendpress-sender', $method, $new); ?> <br><br> <?php if (count($senders) < 3) { $c = 0; foreach ($senders as $key => $sender) { $class = ''; if ($c >= 1) { $class = "margin-left: 4%"; } echo "<div style=' float:left; width: 48%; {$class}' id='{$key}'>"; ?> <!-- XXXX --> <p> <!--<input name="sendpress-sender" type="radio" <?php if ($method == $key || strpos(strtolower($key), $method) > 0) { ?> checked="checked"<?php } ?> id="website" value="<?php echo $key; ?> " /> <?php _e('Send Emails via', 'sendpress'); ?> --> <?php echo $sender->label(); echo "</p><div class='well'>"; echo $sender->settings(); echo "</div></div>"; $c++; } } else { ?> <div class="tabbable tabs-left"> <ul class="nav nav-tabs"> <?php foreach ($senders as $key => $sender) { $class = ''; if ($method == $key || strpos(strtolower($key), $method) > 0) { $class = "class='active'"; } echo "<li {$class}><a href='#{$key}' data-toggle='tab'>"; if ($method == $key || strpos(strtolower($key), $method) > 0) { echo '<span class="glyphicon glyphicon-ok-sign"></span> '; } echo $sender->label(); echo "</a></li>"; } ?> </ul> <div class="tab-content" style="display:block;"> <?php foreach ($senders as $key => $sender) { $class = ''; if ($method == $key || strpos(strtolower($key), $method) > 0) { $class = "active"; } echo "<div class='tab-pane {$class}' id='{$key}'>"; ?> <!-- XXXX --> <!--<p> <input name="sendpress-sender" type="radio" <?php if ($key === 'SendPress_Sender_Website' && is_multisite()) { echo 'style="display:none"'; } ?> <?php if ($method == $key || strpos(strtolower($key), $method) > 0) { ?> checked="checked"<?php } ?> id="website" value="<?php echo $key; ?> " /> <?php _e('Activate', 'sendpress'); ?> --> <?php //echo $sender->label(); echo "</p><div class='well'>"; echo $sender->settings(); echo "</div></div>"; } ?> </div> </div> <p > <span class="glyphicon glyphicon-ok-sign"></span> = <?php _e('Currently Active', 'sendpress'); ?> </p> <?php } ?> </div> </div> <br class="clear"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Advanced Sending Options', 'sendpress'); ?> </h3> </div> <div class="panel-body"> <div class="boxer form-box"> <div style="float: right; width: 45%;"> <h2><?php _e('Email Sending Limits', 'sendpress'); ?> </h2> <?php $emails_per_day = SendPress_Option::get('emails-per-day'); $emails_per_hour = SendPress_Option::get('emails-per-hour'); $credits = SendPress_Option::get('emails-credits'); //$hourly_emails = SendPress_Data::emails_sent_in_queue("hour"); $emails_so_far = SendPress_Data::emails_sent_in_queue("day"); $offset = get_option('gmt_offset') * 60 * 60; // Time offset in seconds $local_timestamp = wp_next_scheduled('sendpress_cron_action') + $offset; //print_r(wp_get_schedules()); sprintf(__('You have sent <strong>%s</strong> emails so far today and you have <strong>%s</strong> credits remaining.', 'sendpress'), $emails_so_far, $credits); ?> <br><br> <input type="text" size="6" name="emails-per-day" value="<?php echo $emails_per_day; ?> " /> <?php _e('Emails Per Day', 'sendpress'); ?> <br><br> <input type="text" size="6" name="emails-per-hour" value="<?php echo $emails_per_hour; ?> " /> <?php _e('Emails Per Hour', 'sendpress'); ?> <br><br> <h2><?php _e('Email Encoding', 'sendpress'); ?> </h2> <?php $charset = SendPress_Option::get('email-charset', 'UTF-8'); ?> Charset: <select name="email-charset" id=""> <?php $charsete = SendPress_Data::get_charset_types(); foreach ($charsete as $type) { $select = ""; if ($type == $charset) { $select = " selected "; } echo "<option {$select} value={$type}>{$type}</option>"; } ?> </select><br> <?php _e('Squares or weird characters displaying in your emails select the charset for your language', 'sendpress'); ?> . <br><br> <?php _e('Encoding', 'sendpress'); ?> : <select name="email-encoding" id=""> <?php $charset = SendPress_Option::get('email-encoding', '8bit'); $charsete = SendPress_Data::get_encoding_types(); foreach ($charsete as $type) { $select = ""; if ($type == $charset) { $select = " selected "; } echo "<option {$select} value={$type}>{$type}</option>"; } ?> </select> <br class="clear"> </div> </div> </div> </div> <?php //Page Nonce //wp_nonce_field( basename(__FILE__) ,'_spnonce' ); wp_nonce_field($this->_nonce_value); ?> <input type="submit" class="btn btn-primary" value="Save"/> <a href="" class="btn btn-default"><i class="icon-remove"></i> <?php _e('Cancel', 'sendpress'); ?> </a> </form> <form method="post" id="post-test" class="form-inline"> <input type="hidden" name="action" value="send-test-email" /> <input name="testemail" type="hidden" id="test-email-form" value="<?php echo SendPress_Option::get('testemail'); ?> " class="form-control"/> <br class="clear"> <?php //Page Nonce //wp_nonce_field( basename(__FILE__) ,'_spnonce' ); //SendPress General Nonce wp_nonce_field($this->_nonce_value); ?> </form> <?php $error = SendPress_Option::get('phpmailer_error'); $hide = 'hide'; if (!empty($error) && isset($_POST['testemail'])) { $hide = ''; $phpmailer_error = '<pre>' . $error . '</pre>'; ?> <script type="text/javascript"> jQuery(document).ready(function($) { $('#debugModal').modal('show'); }); </script> <?php } ?> <div class="modal fade" id="debugModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h3><?php _e('SMTP Debug Info', 'sendpress'); ?> </h3> </div> <div class="modal-body"> <?php if (!empty($phpmailer_error)) { $server = "smtp.sendgrid.net"; $port = "25"; $port2 = "465"; $port3 = "587"; $timeout = "1"; if ($server and $port and $timeout) { $port25 = @fsockopen("{$server}", $port, $errno, $errstr, $timeout); $port465 = @fsockopen("{$server}", $port2, $errno, $errstr, $timeout); $port587 = @fsockopen("{$server}", $port3, $errno, $errstr, $timeout); } if (!$port25) { echo '<div class="alert alert-error">'; _e('Port 25 seems to be blocked.', 'sendpress'); echo '</div>'; } if (!$port465) { echo '<div class="alert alert-error">'; _e('Port 465 seems to be blocked. Gmail may have trouble', 'sendpress'); echo '</div>'; } if (!$port587) { echo '<div class="alert alert-error">'; _e('Port 587 seems to be blocked.', 'sendpress'); echo '</div>'; } echo $phpmailer_error; } ?> <pre> <?php $whoops = SendPress_Option::get('last_test_debug'); if (empty($whoops)) { _e('No Debug info saved.', 'sendpress'); } else { echo $whoops; } ?> </pre> </div> <div class="modal-footer"> <a href="#" class="btn" data-dismiss="modal"><?php _e('Close', 'sendpress'); ?> </a> </div> </div> </div></div> <?php }
function html($sp) { $list = ''; if (isset($_GET['listID'])) { $list_id_clean = SPNL()->validate->int($_GET['listID']); $listinfo = get_post($list_id_clean); $list = '&listID=' . $list_id_clean; $listname = 'for ' . $listinfo->post_title; } //Create an instance of our package class... $testListTable = new SendPress_Subscribers_Table(); //Fetch, prepare, sort, and filter our data... $testListTable->prepare_items(); ?> <div id="taskbar" class="lists-dashboard rounded group"> <div id="button-area"> <a class="btn btn-primary btn-large" href="?page=<?php echo SPNL()->validate->page($_REQUEST['page']); ?> &view=add<?php echo $list; ?> "><?php _e('Add Subscriber', 'sendpress'); ?> </a> </div> <h2><?php _e('Subscribers', 'sendpress'); ?> <?php if (isset($listname)) { echo $listname; } ?> </h2> </div> <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> <form id="movies-filter" method="get"> <!-- For plugins, we also need to ensure that the form posts back to our current page --> <input type="hidden" name="page" value="<?php echo SPNL()->validate->page($_REQUEST['page']); ?> " /> <?php if (isset($_GET['listID']) && $_GET['listID'] > 0) { ?> <input type="hidden" name="listID" value="<?php echo $list_id_clean; ?> " /> <?php } ?> <input type="hidden" name="view" value="<?php echo esc_html($_GET['view']); ?> " /> <!-- Now we can render the completed list table --> <?php $testListTable->display(); ?> <?php wp_nonce_field($sp->_nonce_value); ?> </form> <form method='get'> <input type='hidden' value="<?php echo SPNL()->validate->page($_GET['page']); ?> " name="page" /> <input type='hidden' value="unlink-lisk" name="action" /> <?php if (isset($list_id_clean)) { ?> <input type='hidden' name="listid" value="<?php echo $list_id_clean; ?> " /> <?php } ?> <br> <a class="btn btn-danger " data-toggle="modal" href="#sendpress-empty-list" ><i class="icon-warning-sign "></i> <?php _e('Remove All Subscribers from List', 'sendpress'); ?> </a> <?php wp_nonce_field($sp->_nonce_value); ?> </form> <div class="modal fade" id="sendpress-empty-list" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h3><?php _e('Really? Remove All Subscribers from this list.', 'sendpress'); ?> </h3> </div> <div class="modal-body"> <p><?php _e('This will remove all subscribers from the list', 'sendpress'); ?> .</p> </div> <div class="modal-footer"> <a href="#" class="btn btn-primary" data-dismiss="modal"><?php _e('No! I was Joking', 'sendpress'); ?> </a><a href="<?php echo SendPress_Admin::link('Subscribers_Subscribers') . $list; ?> &action=remove-subscribers" id="confirm-delete" class="btn btn-danger" ><?php _e('Yes! Remove All Subscribers', 'sendpress'); ?> </a> </div> </div> </div> </div> <?php }