function save() { $_POST['post_type'] = SendPress_Data::email_post_type(); // Update post 37 (37!) $my_post = _wp_translate_postdata(true); $system_emails = SendPress_Option::base_get('system-emails'); $my_post['post_status'] = 'sp-systememail'; $my_post['post_content'] = SendPress_Data::get_sysemail_content($_POST['email_type']); // Update the post into the database wp_update_post($my_post); update_post_meta($my_post['ID'], '_sendpress_subject', $_POST['post_subject']); update_post_meta($my_post['ID'], '_sendpress_template', $_POST['template']); update_post_meta($my_post['ID'], '_sendpress_status', 'private'); update_post_meta($my_post['ID'], '_sendpress_system', 'new'); update_post_meta($my_post['ID'], '_system_email_type', $_POST['email_type']); update_post_meta($my_post['ID'], '_system_default', $_POST['default']); if ($_POST['default']) { //set default system e-mail for this type SendPress_Data::set_system_email_default($my_post['ID'], $_POST['email_type']); } SendPress_Email::set_default_style($my_post['ID']); //clear the cached file. delete_transient('sendpress_email_html_' . $my_post['ID']); if (!in_array($_POST['email_type'], $system_emails)) { $system_emails[] = $_POST['email_type']; } SendPress_Option::base_set('system-emails', $system_emails); SendPress_Admin::redirect('Settings_Emailedit', array('emailID' => $my_post['ID'])); //$this->save_redirect( $_POST ); }
function html($sp) { SendPress_Option::base_set('update-info', 'hide'); ?> <div class="wrap about-wrap"> <h1>Welcome to SendPress <?php echo SENDPRESS_VERSION; ?> </h1> <div class="about-text">Thank you for updating! SendPress <?php echo SENDPRESS_VERSION; ?> brings you one of our biggest releases yet.</div> <!--<div class="changelog point-releases"> <h3>Maintenance & Bug Fix Release</h3> <p><strong>Version <?php echo SENDPRESS_VERSION; ?> </strong> addressed several bugs. For more information, see <a href="http://wordpress.org/plugins/sendpress/changelog/">the changelog</a>.</p> </div>--> <hr> <div class="changelog"> <div class="about-overview"> <h2 class="about-headline-callout">Introducing New Responsive Templates</h2> <img class="about-overview-img" src="<?php echo SENDPRESS_URL; ?> /img/v1update.png"> <p>Create as many responsive templates as you like with ease. Want to send 100% custom HTML emails upgrade to Pro.</p> </div> <hr> <div class="feature-section col two-col"> <div class="col-1"> <!-- focus.png --> <img src="<?php echo SENDPRESS_URL; ?> /img/simpleeditor.png"> </div> <div class="col-2 last-feature"> <h3>Focus on your content</h3> <p>Writing and editing is smoother and simpler with a new editor layout and email creation screen. Designed to support our upcoming multicolumn email templates.</p> </div> </div> <hr> <div class="feature-section col two-col"> <div class="col-1"> <!-- focus.png --> <h3>All new Forms & Widget</h3> <p>Creating that perfect signup form is now much simpler. Edit settings in one place to manage both widgets and forms shortcodes.</p> </div> <div class="col-2 last-feature"> <img src="<?php echo SENDPRESS_URL; ?> /img/forms.png"> </div> </div> <hr> <div class="feature-section col three-col about-updates"> <div class="col-1"> <img src="<?php echo SENDPRESS_URL; ?> /img/prot.png?1"> <h3>Custom HTML</h3> <p>SendPress PRO adds the ability to send any HTML template you want.</p> </div> <div class="col-2"> <img src="<?php echo SENDPRESS_URL; ?> /img/sendhistory.png?1"> <h3>Send History</h3> <p>Keep an eye on the email messages being sent and look up your recent send history.</p> </div> <div class="col-3 last-feature"> <img src="<?php echo SENDPRESS_URL; ?> /img/autocron.png?1"> <h3>Pro Discount</h3> <p>Enable AutoCron and recieve a discount from pro. Discounts are emails to the admin email of the site.</p> </div> </div> </div> <hr> <div class="changelog"> <div class="feature-section col two-col"> <div> <h3>Give us a Review</h3> <p>We love feedback so please let us know how we are doing.<br>Add your <a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/sendpress">★★★★★</a> on <a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/sendpress">wordpress.org</a></p> <h4>Help Translate</h4> <p>You can help translate on <a href="https://www.transifex.com/projects/p/sendpress/">Transifex</a>.</p> <h4>Report and Fix bugs</h4> <p>SendPress is on <a href="http://wordpress.org/support/plugin/sendpress">GitHub</a> feel free to patch bugs you find or please report them on the <a href="http://wordpress.org/support/plugin/sendpress">forum</a>.</p> </div> <div class="last-feature about-colors-img"> <a href="http://wordpress.org/support/view/plugin-reviews/sendpress" target="_blank"><img class="about-overview-img" src="<?php echo SENDPRESS_URL; ?> /img/review-us.png"></a> </div> </div> </div> <hr> <div class="changelog"> <div class="feature-section col three-col"> <h3>Whats Ahead</h3> <div> <h4>Ninja Forms</h4> <p>We are working on an exentsion so you can collect all your subscriber data with the <a href="http://ninjaforms.com/">Ninja Forms Plugin</a>.</p> </div> <div> <h4>Autoresponders</h4> <p>Automatically send emails to subscribers based on actions like link clicks, subscribe to list or email opens.</p> </div> <div class="last-feature"> <h4>Custom fields</h4> <p>Add your own information to subscribers and collect the data you need.</p> </div> </div> </div> <div class="return-to-dashboard"> SendPress: <a href="<?php echo SendPress_Admin::link('Emails'); ?> ">Emails</a> | <a href="<?php echo SendPress_Admin::link('Reports'); ?> ">Reports</a> | <a href="<?php echo SendPress_Admin::link('Subscribers'); ?> ">Subscribers</a> | <a href="<?php echo SendPress_Admin::link('Queue'); ?> ">Queue</a> | <a href="<?php echo SendPress_Admin::link('Settings'); ?> ">Settings</a> | <a href="<?php echo SendPress_Admin::link('Pro'); ?> ">Pro</a> </div> <br> </div> <?php }
function maybe_upgrade() { //SendPress::update_templates(); $current_version = SendPress_Option::get('version', '0'); //SendPress_Error::log($current_version); if (version_compare($current_version, SENDPRESS_VERSION, '==')) { return; } $current_version_base = SendPress_Option::base_get('version', '0'); if (version_compare($current_version_base, SENDPRESS_VERSION, '==')) { return; } SendPress_DB_Tables::install(); @SPNL()->db->subscribers_tracker->create_table(); @SPNL()->db->subscribers_url->create_table(); @SPNL()->db->url->create_table(); SendPress_Option::base_set('update-info', 'show'); //On version change update default template $this->set_template_default(); SendPress_Template_Manager::update_template_content(); //SendPress_Data::create_default_form(); SendPress_Option::check_for_keys(); if (version_compare($current_version, '0.8.6', '<')) { $widget_options = array(); $widget_options['widget_options']['load_css'] = 0; $widget_options['widget_options']['load_ajax'] = 0; $widget_options['widget_options']['load_scripts_in_footer'] = 0; SendPress_Option::set($widget_options); } if (version_compare($current_version, '0.8.7.5', '<')) { SendPress_Data::set_double_optin_content(); } if (version_compare($current_version, '0.8.8', '<')) { $pro_plugins = array(); $pro_plugins['pro_plugins']['setup_value'] = false; SendPress_Option::set($pro_plugins); } if (version_compare($current_version, '0.9.3', '<')) { $options = SendPress_Option::get('notification_options'); $new_options = array('email' => '', 'name' => '', 'notifications-enable' => false, 'notifications-subscribed-instant' => false, 'notifications-subscribed-daily' => false, 'notifications-subscribed-weekly' => false, 'notifications-subscribed-monthly' => false, 'notifications-unsubscribed-instant' => false, 'notifications-unsubscribed-daily' => false, 'notifications-unsubscribed-weekly' => false, 'notifications-unsubscribed-monthly' => false); if ($options === false || $options === '') { SendPress_Option::set('notification_options', $new_options); } else { if (is_array($options)) { $result = array_merge($new_options, $options); SendPress_Option::set('notification_options', $result); } } } /* if(version_compare( $current_version, '0.9.4.7', '<' )){ SendPress_Data::update_tables_0947(); } if(version_compare( $current_version, '0.9.5.2', '<' )){ SendPress_Data::update_tables_0952(); } if(version_compare( $current_version, '0.9.5.4', '<' )){ SendPress_Data::update_tables_0954(); } */ if (version_compare($current_version, '0.9.6', '<')) { $options = SendPress_Option::get('notification_options'); $new_options = array('email' => '', 'notifications-enable' => false, 'subscribed' => 1, 'unsubscribed' => 1, 'send-to-admins' => false, 'enable-hipchat' => false, 'hipchat-api' => '', 'hipchat-room' => '', 'post-notifications-enable' => false, 'post-notification-subject' => ''); if ($options === false || $options === '') { SendPress_Option::set('notification_options', $new_options); } else { if (is_array($options)) { $result = array_merge($new_options, $options); SendPress_Option::set('notification_options', $result); } } } if (version_compare($current_version, '0.9.9', '<')) { $link = SendPress_Option::get('socialicons'); if ($twit = SendPress_Option::get('twitter')) { $link['Twitter'] = $twit; } if ($fb = SendPress_Option::get('facebook')) { $link['Facebook'] = $fb; } if ($ld = SendPress_Option::get('linkedin')) { $link['LinkedIn'] = $ld; } SendPress_Option::set('socialicons', $link); } /* if( version_compare( $current_version, '0.9.9.8', '<' ) && SendPress_Option::get('autocron','no') == 'yes' ){ $email = get_option( 'admin_email' ); $url = "http://api.sendpress.com/senddiscountcode/".md5($_SERVER['SERVER_NAME']."|".$email)."/".$email; wp_remote_get( $url ); } */ $update_options_sp = array(); if (isset($_GET['sendpress_ignore_087']) && '0' == $_GET['sendpress_ignore_087']) { $update_options_sp['sendpress_ignore_087'] = 'true'; //SendPress_Option::set('sendpress_ignore_087', 'true'); } //dadd_action('admin_notices', array($this,'sendpress_ignore_087')); if (SendPress_Option::get('sendmethod') == false) { $update_options_sp['sendmethod'] = 'SendPress_Sender_Website'; //SendPress_Option::set('sendmethod','SendPress_Sender_Website'); } if (SendPress_Option::get('send_optin_email') == false) { $update_options_sp['send_optin_email'] = 'yes'; //SendPress_Option::set('send_optin_email','yes'); } if (SendPress_Option::get('try-theme') == false) { $update_options_sp['try-theme'] = 'yes'; //SendPress_Option::set('try-theme','yes'); } if (SendPress_Option::get('confirm-page') == false) { $update_options_sp['confirm-page'] = 'default'; //SendPress_Option::set('confirm-page','default'); } if (SendPress_Option::get('manage-page') == false) { $update_options_sp['manage-page'] = 'default'; //SendPress_Option::set('manage-page','default'); } if (SendPress_Option::get('cron_send_count') == false) { $update_options_sp['cron_send_count'] = '100'; //SendPress_Option::set('cron_send_count','100'); } if (SendPress_Option::get('emails-per-day') == false) { $update_options_sp['emails-per-day'] = '1000'; //SendPress_Option::set('emails-per-day','1000'); //SendPress_Option::set('emails-per-hour','100'); } if (SendPress_Option::get('emails-per-hour') == false) { $update_options_sp['emails-per-hour'] = '100'; } if (SendPress_Option::get('queue-per-call') == false) { $update_options_sp['queue-per-call'] = '1000'; //SendPress_Option::set('queue-per-call' , 1000 ); } if (!empty($update_options_sp)) { SendPress_Option::set($update_options_sp); unset($update_options_sp); } SendPress_Option::base_set('version', SENDPRESS_VERSION); SendPress_Option::set('version', SENDPRESS_VERSION); }