This is the content for the tab.
' // TODO // Use 'callback' instead of 'content' for a function callback that renders the tab content. ); */ break; case 'alo-easymail/alo-easymail_options': /* TODO! $tab = array( 'id' => 'alo-easymail_options', 'title' => __("Settings", "alo-easymail"), 'content' => 'This is the content for the tab.
' // TODO ); */ break; case 'edit-newsletter': case 'newsletter': $tab = array( 'id' => 'alo-easymail_newsletter', 'title' => __("Newsletter", "alo-easymail"), 'content' => '' ); break; } if ( is_array($tab) ) $screen->add_help_tab( $tab ); // Common tab $screen->add_help_tab( array( 'id' => 'alo-easymail_links', // This should be unique for the screen. 'title' => __("Links"), 'content' => ''.__("Resources about EasyMail Newsletter", "alo-easymail") . ': '. 'homepage | guide | faq | for developers | forum | news'. '
' ) ); // Common sidebar $screen->set_help_sidebar( "". __("If you use this plugin consider the idea of donating and supporting its development", "alo-easymail") ."
". "
" ."" ); /* if ( $screen->id == 'alo-easymail/alo-easymail_subscribers' ) { $screen->add_option( 'per_page', array( 'label' => __("Subscribers per page", "alo-easymail"), 'default' => 20, 'option' => 'alo_em_subscribers_per_page' ) ); } */ } /** * Contextual help */ if ( version_compare ( $wp_version , '3.3', '<' ) ) { function alo_em_contextual_help() { global $hook_suffix; if (function_exists('add_contextual_help')) { $html = __("Resources about EasyMail Newsletter", "alo-easymail") . ': homepage | guide | faq | for developers | forum | news'; $html .= " | "; if ( $hook_suffix == 'alo-easymail/alo-easymail_options.php' ) { // extra help } if ( $hook_suffix == 'alo-easymail/alo-easymail_subscribers.php' ) { // extra help } add_contextual_help( $hook_suffix, $html ); } } add_action( 'admin_head-alo-easymail/alo-easymail_options.php', 'alo_em_contextual_help' ); add_action( 'admin_head-alo-easymail/alo-easymail_subscribers.php', 'alo_em_contextual_help' ); } /* * Add some links on the plugin page */ function alo_em_add_plugin_links($links, $file) { if ( $file == plugin_basename(__FILE__) ) { $links[] = 'Guide'; $links[] = 'Faq'; $links[] = 'Forum'; $links[] = 'News'; } return $links; } add_filter( 'plugin_row_meta', 'alo_em_add_plugin_links', 10, 2 ); /** * On plugin init */ function alo_em_init_method() { // if required, exclude the easymail page from pages' list if ( get_option('alo_em_show_subscripage') == "no" ) add_filter('get_pages','alo_em_exclude_page'); // load localization files load_plugin_textdomain ("alo-easymail", false, "alo-easymail/languages"); // Let's install custom fields, if any global $wpdb; $alo_em_cf = alo_easymail_get_custom_fields(); if ( $alo_em_cf ) { $fields = $wpdb->get_results( "SHOW COLUMNS FROM {$wpdb->prefix}easymail_subscribers" ); $existing = array(); foreach ( $fields as $field ) $existing[] = $field->Field; foreach( $alo_em_cf as $key => $value ) { // Create db column if missing if ( !in_array( $key, $existing ) ) { $wpdb->query("ALTER TABLE {$wpdb->prefix}easymail_subscribers ADD `".$key."` ". $value['sql_attr']); } // Create index if required if ( $value['sql_key'] && !$wpdb->get_row("SHOW INDEX FROM {$wpdb->prefix}easymail_subscribers WHERE Column_name = '".$key."';" ) ) { $wpdb->query("ALTER TABLE {$wpdb->prefix}easymail_subscribers ADD INDEX ( `".$key."` )"); } } // Get fields again, after previpus installation $fields = $wpdb->get_results( "SHOW COLUMNS FROM {$wpdb->prefix}easymail_subscribers" ); $existing = array(); foreach ( $fields as $field ) $existing[] = $field->Field; foreach( $alo_em_cf as $key => $value ) { // Create index if required if ( in_array( $key, $existing ) && $value['sql_key'] && !$wpdb->get_row("SHOW INDEX FROM {$wpdb->prefix}easymail_subscribers WHERE Column_name = '".$key."';" ) ) { $wpdb->query("ALTER TABLE {$wpdb->prefix}easymail_subscribers ADD INDEX ( `".$key."` )"); } } } } add_action( 'init', 'alo_em_init_method' ); /** * New custom post type: Newsletter */ function alo_em_register_newsletter_type () { $labels = array( 'name' => __( 'Newsletters', "alo-easymail" ), 'singular_name' => __( 'Newsletter', "alo-easymail" ), 'add_new' => __( 'Add New', "alo-easymail" ), 'add_new_item' => __( 'Add New Newsletter', "alo-easymail" ), 'edit_item' => __( 'Edit Newsletter', "alo-easymail" ), 'new_item' => __( 'New Newsletter', "alo-easymail" ) , 'view_item' => __( 'View Newsletter', "alo-easymail" ), 'search_items' => __( 'Search Newsletters', "alo-easymail" ), 'not_found' => __( 'No Newsletters found', "alo-easymail" ), 'not_found_in_trash' => __( 'No Newsletters found in Trash', "alo-easymail" ), 'parent_item_colon' => __( 'Parent Newsletter', "alo-easymail" ), 'menu_name' => __( 'Newsletters', "alo-easymail" ), 'parent' => __( 'Parent Newsletter', "alo-easymail" ), ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'exclude_from_search' => false, 'rewrite' => array('slug' => 'newsletters'), 'capability_type' => 'post', /*'map_meta_cap' => true,*/ 'has_archive' => true, 'hierarchical' => false, 'menu_position' => false, 'menu_icon' => ALO_EM_PLUGIN_URL.'/images/16-email-letter.png', 'can_export' => true, 'supports' => array( 'title' , 'editor', 'custom-fields' ) //edit : orig : 'supports' => array( 'title' , 'editor', 'thumbnail', 'excerpt', 'custom-fields' ) ); // If it doesn't allow newsletter publication online if ( get_option('alo_em_publish_newsletters') == "no" ) { $args['public'] = false; $args['publicly_queryable'] = false; $args['show_ui'] = true; $args['show_in_menu'] = true; $args['query_var'] = false; $args['exclude_from_search'] = true; // TODO read here: http://jandcgroup.com/2011/09/14/exclude-custom-post-types-from-wordpress-search-do-not-use-exclude_from_search/ } $args = apply_filters ( 'alo_easymail_register_newsletter_args', $args ); register_post_type( 'newsletter', $args ); } add_action('init', 'alo_em_register_newsletter_type'); /** * Texts when a Newsletter is updated */ function alo_em_newsletter_updated_messages( $messages ) { global $post, $post_ID; $messages['newsletter'] = array( 0 => '', // Unused. Messages start at index 1. 1 => sprintf( __('Newsletter updated. View Newsletter', "alo-easymail" ), esc_url( get_permalink($post_ID) ) ), 2 => __('Custom field updated.', "alo-easymail"), 3 => __('Custom field deleted.', "alo-easymail"), 4 => __('Newsletter updated.', "alo-easymail"), /* translators: %s: date and time of the revision */ 5 => isset($_GET['revision']) ? sprintf( __('Newsletter restored to revision from %s', "alo-easymail"), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false, 6 => sprintf( __('Newsletter published. View Newsletter', "alo-easymail"), esc_url( get_permalink($post_ID) ) ), 7 => __('Newsletter saved.', "alo-easymail"), 8 => sprintf( __('Newsletter submitted. Preview Newsletter', "alo-easymail"), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 9 => sprintf( __('Newsletter scheduled for: %1$s. Preview Newsletter', "alo-easymail"), // translators: Publish box date format, see http://php.net/date date_i18n( __( 'j M Y @ G:i', "alo-easymail" ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ), 10 => sprintf( __('Newsletter draft updated. Preview Newsletter', "alo-easymail"), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), ); return $messages; } add_filter('post_updated_messages', 'alo_em_newsletter_updated_messages'); /** * Adds media upload in thickbox in Newsletter */ function alo_em_newsletter_add_media_upload_scripts() { if ($GLOBALS['post_type'] == 'newsletter') { add_thickbox(); wp_enqueue_script('media-upload'); } } add_action('admin_print_styles-post-new.php', 'alo_em_newsletter_add_media_upload_scripts'); add_action('admin_print_styles-post.php', 'alo_em_newsletter_add_media_upload_scripts'); /** * Dirty hack to hide "Quick edit" button // TODO: add easymail option in Quick edit view: http://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu */ /* function alo_em_inti_method () { add_action('admin_print_styles-edit.php','alo_em_hide_quick_edit_css'); } add_action('admin_init','alo_em_inti_method'); function alo_em_hide_quick_edit_css() { if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == "newsletter" ) : ?> "; $columns["title"] = __( 'Title' ) ." / " . __( 'Subject', "alo-easymail"); $columns["easymail_recipients"] = __( 'Recipients', "alo-easymail" ); $columns["easymail_status"] = __( 'Newsletter status', "alo-easymail" ); $columns["date"] = __( 'Start', "alo-easymail" ); $columns["author"] = __( 'Author' ); return $columns; } add_filter ('manage_edit-newsletter_columns', 'alo_em_edit_table_columns'); /** * Fills the columns of Newsletter display table */ function alo_em_table_column_value ( $columns ) { global $post; $count_recipients = alo_em_count_recipients_from_meta( $post->ID ); $recipients = alo_em_get_recipients_from_meta( $post->ID ); if ( $columns == "easymail_recipients" ) { if ( $count_recipients == 0 ) { if ( alo_em_user_can_edit_newsletter( $post->ID ) ) echo ''; echo '
' . __( 'No recipients selected yet', "alo-easymail").'';
if ( alo_em_user_can_edit_newsletter( $post->ID ) ) echo '';
} else {
//echo "". print_r ( $recipients, true ) . ""; echo "". __( 'Total recipients', "alo-easymail") .": "; if ( alo_em_get_newsletter_status( $post->ID ) ) { // if already created list of recipients, count form db, otherwise from meta if( $archive = alo_em_is_newsletter_recipients_archived( $post->ID ) ) { // if archived recipients echo $archive[0]['tot']; } else { echo alo_em_count_newsletter_recipients( $post->ID ); } } else { echo alo_em_count_recipients_from_meta ( $post->ID ); } echo "
';
echo "";
echo '
';
echo "";
}
if ( alo_em_user_can_edit_newsletter( $newsletter ) ) echo " ". $goto_report;
break;
case "pending":
echo "".__("Pending Review"). "
';
}
break;
case "draft":
echo "".__("Draft"). "
';
echo "";
}
if ( alo_em_user_can_edit_newsletter( $newsletter ) ) echo " ". $goto_report;
break;
case false:
default:
if ( get_option('alo_em_js_rec_list') != "no_ajax_onsavepost" ) { // if required, no link to ajax
$rec_url = wp_nonce_url( ALO_EM_PLUGIN_URL . '/alo-easymail_recipients-list.php?', 'alo-easymail_recipients-list');
if ( alo_em_user_can_edit_newsletter( $newsletter ) ) echo "";
echo "| \n"; $html .= " | \n"; $html .= " \n"; $html .= " | \n"; $html .= "
|---|
| \n"; // edit-by-alo: $html .= " | \n"; // edit-by-alo: added next $input block //$html .= sprintf( $value['edit_html'], $subscriber->ID, $subscriber->ID, format_to_edit( $subscriber->$key ) )."\n"; /*switch( $value['input_type'] ) { case "text": $tpl = ""; } $input = str_replace( '[id]', 'id="'.$field_id.'"', $input); $input = str_replace( '[name]', 'name="'.$field_id.'"', $input); $input = str_replace( '[value]', $subscriber ? format_to_edit( $subscriber->$key ):'', $input); $html .= $input ."\n"; */ $prev = isset($subscriber->$key) ? format_to_edit( $subscriber->$key ) : ''; $html .= alo_easymail_custom_field_html ( $key, $value, $field_id, $prev, true ); $html .= " | \n"; $html .= "
|---|
ID ) == 0 ) ? "class=\"easymail-txtwarning\"" : "" ) ." >"; echo "" .__("Selected recipients", "alo-easymail") .": ". alo_em_count_recipients_from_meta( $post->ID ) ."
"; if ( alo_em_get_newsletter_status ( $post->ID ) == "sent" || alo_em_is_newsletter_recipients_archived ( $post->ID ) ) { echo "". __("This newsletter was already sent", "alo-easymail") .".
"; echo "". __("The creation of the recipients list has already started", "alo-easymail") .".
"; echo ""; echo "
"; echo "";
echo '
';
echo " " . stripslashes ( alo_em___( $newsletter[0]->post_title ) ) ."
";
echo __("Progress", "alo-easymail") .": " . alo_em_newsletter_recipients_percentuage_already_sent( $newsletter[0]->ID ) . " %
" ;
echo "".__("Added on", "alo-easymail") . " ". date_i18n( __( 'j M Y @ G:i', "alo-easymail" ), strtotime( $newsletter[0]->post_date ) ) . " - ";
echo __("Scheduled by", "alo-easymail") . " ". get_user_meta($newsletter[0]->post_author, 'nickname',true). "";
echo "
". __("There are no newsletters in queue", "alo-easymail") . ".
"; } echo "". sprintf( __("There are %d subscribers: %d activated, %d not activated", "alo-easymail"), $total, $active, $noactive ) . ".
"; } else { echo "". __("No subscribers", "alo-easymail") . ".
"; } if ( current_user_can('administrator') ) { echo "'; printf(__('RSS Error: %s'), $rss->get_error_message()); echo '
'; } } } function alo_em_add_dashboard_widgets() { if ( current_user_can ( 'manage_easymail_subscribers' ) && current_user_can ( 'edit_posts' ) ) { wp_add_dashboard_widget('alo-easymail-widget', 'EasyMail Newsletter', 'alo_em_dashboard_widget_function'); } } add_action('wp_dashboard_setup', 'alo_em_add_dashboard_widgets' ); /** * Show the optin/optout on Registration Form */ function alo_em_show_registration_optin () { $optin_txt = ( alo_em_translate_option ( alo_em_get_language (), 'alo_em_custom_optin_msg', false) !="") ? alo_em_translate_option ( alo_em_get_language (), 'alo_em_custom_optin_msg', false) : __("Yes, I would like to receive the Newsletter", "alo-easymail"); echo ''; echo '
'; $mailinglists = alo_em_get_mailinglists( 'public' ); if ( $mailinglists ) { $lists_msg = ( alo_em_translate_option ( alo_em_get_language (), 'alo_em_custom_lists_msg',false) !="") ? alo_em_translate_option ( alo_em_get_language (), 'alo_em_custom_lists_msg',false) : __("You can also sign up for specific lists", "alo-easymail"); echo "". $lists_msg .":
\n"; foreach ( $mailinglists as $list => $val ) { echo "\n"; } } echo ' '; } add_action('register_form','alo_em_show_registration_optin'); /** * Save the optin/optout on Registration Form */ function alo_em_save_registration_optin ( $user_id, $password="", $meta=array() ) { $user = get_userdata($user_id); if (!empty($user->first_name) && !empty($user->last_name)) { $name = $user->first_name.' '.$user->last_name; } else { $name = $user->display_name; } if ( isset ($_POST['alo_em_opt']) && $_POST['alo_em_opt'] == "yes" ) { $lang = ( isset($_POST['alo_em_lang']) && in_array ( $_POST['alo_em_lang'], alo_em_get_all_languages( false )) ) ? $_POST['alo_em_lang'] : "" ; $fields['email'] = $user->user_email; //edit : added all this line $fields['name'] = $name; //edit : added all this line alo_em_add_subscriber( $fields, 1, $lang ); //edit : orig : alo_em_add_subscriber( $user->user_email, $name , 1, $lang ); // if subscribing, save also lists $mailinglists = alo_em_get_mailinglists( 'public' ); if ($mailinglists) { $subscriber_id = alo_em_is_subscriber( $user->user_email ); foreach ( $mailinglists as $mailinglist => $val) { if ( isset ($_POST['alo_em_register_lists']) && is_array ($_POST['alo_em_register_lists']) && in_array ( $mailinglist, $_POST['alo_em_register_lists'] ) ) { alo_em_add_subscriber_to_list ( $subscriber_id, $mailinglist ); // add to list } } } } } add_action( 'user_register', 'alo_em_save_registration_optin' ); /** * Edit the e-mail message */ function alo_em_handle_email ( $args ) { // $args['to'], $args['subject'], $args['message'], $args['headers'], $args['attachments'] // Check based on $args['subject']; more attrs in $args['message'] global $_config; /* * 1) Activation e-mail */ if ( strpos ( "#_EASYMAIL_ACTIVATION_#", $args['subject'] ) !== false) { // Get the parameters stored as a query in $args['message'] $defaults = array( 'lang' => '', 'email' => '', 'name' => '', 'unikey' => '' ); //$defaults = array( 'email' => '' ); $customs = wp_parse_args( $args['message'], $defaults ); extract( $customs, EXTR_SKIP ); //$subscriber = alo_em_get_subscriber( $email ); // Subject if ( $subject_text = alo_em_translate_option ( $lang, 'alo_em_txtpre_activationmail_subj', true ) ) { $subject = $subject_text; } else { $subject = alo_em___( __("Confirm your subscription to %BLOGNAME% Newsletter", "alo-easymail" ) ); } $blogname = html_entity_decode ( wp_kses_decode_entities ( get_option('blogname') ) ); $subject = str_replace ( "%BLOGNAME%", $blogname, $subject ); $args['subject'] = $subject; // Content if ( $content_txt = alo_em_translate_option ( $lang, 'alo_em_txtpre_activationmail_mail', true ) ) { $content = $content_txt; } else { $content = __("Hi %NAME%\nto complete your subscription to %BLOGNAME% newsletter you need to click on the following link (or paste it in the address bar of your browser):\n", "alo-easymail"); $content .= "%ACTIVATIONLINK%\n\n"; $content .= __("If you did not ask for this subscription ignore this message.", "alo-easymail"). "\n"; $content .= __("Thank you", "alo-easymail")."\n". $blogname ."\n"; } /* $div_email = explode("@", $email); $arr_params = array ('ac' => 'activate', 'em1' => $div_email[0], 'em2' => $div_email[1], 'uk' => $unikey ); $sub_link = add_query_arg( $arr_params, get_page_link (get_option('alo_em_subsc_page')) ); $sub_link = alo_em_translate_url ( $sub_link, $lang ); */ //$div_email = explode("@", $email); $sub_vars = $email ."|" /*$div_email[0] . "|" . $div_email[1] . "|" */ . $unikey . "|" . $lang; //$sub_vars = $subscriber->ID . "|" . $subscriber->unikey; $sub_vars = urlencode( base64_encode( $sub_vars ) ); $sub_link = add_query_arg( 'emact', $sub_vars, alo_em_translate_home_url ( $lang ) /*trailingslashit( get_home_url() )*/ ); //$sub_link = alo_em_translate_url ( $sub_link, $lang /*$subscriber->lang */ ); $content = str_replace ( "%BLOGNAME%", $blogname, $content ); $content = str_replace ( "%NAME%", /* $subscriber->name */ $name, $content ); $content = str_replace ( "%ACTIVATIONLINK%", $sub_link, $content ); $args['message'] = $content; } return $args; } add_filter('wp_mail', 'alo_em_handle_email'); /** * Add Newsletter menu in Toolbar Admin bar (WP 3.1-3.2) */ if ( version_compare ( $wp_version , '3.1', '>=' ) && version_compare ( $wp_version , '3.3', '<' ) ) { function alo_em_add_menu_admin_bar() { global $wp_admin_bar; if ( !$wp_admin_bar ) return; if ( !is_admin_bar_showing() ) return; if ( current_user_can('edit_posts') ) { $wp_admin_bar->add_menu( array( 'id' => 'alo_easymail', 'title' =>__( 'Newsletters', "alo-easymail" ), 'href' => admin_url('edit.php')."?post_type=newsletter" ) ); $wp_admin_bar->add_menu( array( 'id' => 'alo_easymail_main', 'parent' => 'alo_easymail', 'title' => __( 'Newsletters', "alo-easymail" ), 'href' => admin_url('edit.php')."?post_type=newsletter" ) ); $wp_admin_bar->add_menu( array( 'parent' => 'alo_easymail_main', 'title' => __( 'Add New Newsletter', "alo-easymail" ), 'href' => admin_url('post-new.php')."?post_type=newsletter" ) ); $wp_admin_bar->add_menu( array( 'parent' => 'alo_easymail_main', 'title' => __( 'Show all', "alo-easymail" ), 'href' => admin_url('edit.php')."?post_type=newsletter" ) ); } if ( current_user_can('manage_easymail_subscribers') ) { $wp_admin_bar->add_menu( array( 'parent' => 'alo_easymail', 'title' => __( 'Subscribers', "alo-easymail" ), 'href' => admin_url('edit.php')."?post_type=newsletter&page=alo-easymail/alo-easymail_subscribers.php" ) ); } if ( current_user_can('manage_easymail_options') ) { $wp_admin_bar->add_menu( array( 'parent' => 'alo_easymail', 'title' => __( 'Options', "alo-easymail" ), 'href' => admin_url('edit.php')."?post_type=newsletter&page=alo-easymail/alo-easymail_options.php" ) ); } } add_action( 'admin_bar_menu', 'alo_em_add_menu_admin_bar' , 70); } else if ( version_compare ( $wp_version , '3.3', '>=' ) ) { function alo_em_add_menu_toolbar( $wp_admin_bar ) { if ( current_user_can('edit_posts') ) { $ico = ''; $args = array('id' => 'alo_easymail', 'title' => $ico. __( 'Newsletters', "alo-easymail" ), 'parent' => false, 'href' => admin_url('edit.php')."?post_type=newsletter" ); $wp_admin_bar->add_node($args); $args = array('id' => 'alo_easymail-all', 'title' => __( 'Newsletters', "alo-easymail" ), 'parent' => 'alo_easymail', 'href' => admin_url('edit.php')."?post_type=newsletter" ); $wp_admin_bar->add_node($args); $args = array('id' => 'alo_easymail-new', 'title' => __( 'Add New', "alo-easymail" ), 'parent' => 'alo_easymail', 'href' => admin_url('post-new.php')."?post_type=newsletter" ); $wp_admin_bar->add_node($args); if ( current_user_can('manage_easymail_subscribers') ) { $args = array('id' => 'alo_easymail-subscribers', 'title' => __( 'Subscribers', "alo-easymail" ), 'parent' => 'alo_easymail', 'href' => admin_url('edit.php')."?post_type=newsletter&page=alo-easymail/alo-easymail_subscribers.php" ); $wp_admin_bar->add_node($args); } if ( current_user_can('manage_easymail_options') ) { $args = array('id' => 'alo_easymail-settings', 'title' => __( 'Options', "alo-easymail" ), 'parent' => 'alo_easymail', 'href' => admin_url('edit.php')."?post_type=newsletter&page=alo-easymail/alo-easymail_options.php" ); $wp_admin_bar->add_node($args); } } } add_action( 'admin_bar_menu', 'alo_em_add_menu_toolbar', 45 ); } /** * Send a newsletter to a test email */ function alo_em_send_mailtest () { $result = "no"; check_ajax_referer( "alo-easymail_recipients-list" ); $newsletter = ( isset( $_POST['newsletter'] ) && is_numeric( $_POST['newsletter'] ) ) ? (int) $_POST['newsletter'] : false; $email = ( isset( $_POST['email'] ) && is_email( $_POST['email'] ) ) ? $_POST['email'] : false; if ( $email && $newsletter ) { $maybe_subscriber = (array)alo_em_get_subscriber( $email ); if ( isset( $maybe_subscriber['ID'] ) ) { $maybe_subscriber['subscriber'] = $maybe_subscriber['ID']; unset( $maybe_subscriber['ID'] ); } else { $maybe_subscriber['subscriber'] = false; } $user_id = ( email_exists( $email ) ) ? email_exists( $email ) : false; $recipient = (object) array_merge( $maybe_subscriber, array ( 'newsletter' => $newsletter, 'email' => $email, 'user_id' => $user_id ) ); //$recipient = (object) array ( 'newsletter' => $newsletter, 'email' => $email ); if ( alo_em_send_newsletter_to ( $recipient, false /*true*/ ) ) $result = "yes"; } usleep( 500000 ); die ( $result ); } add_action('wp_ajax_easymail_send_mailtest', 'alo_em_send_mailtest'); /** * Alert in admin panel */ function alo_em_admin_notice() { global $pagenow; $page = ( isset( $_GET['page'] ) ) ? $_GET['page'] : false; if ( $pagenow == "edit.php" && isset( $_GET['post_type'] ) && $_GET['post_type'] == 'newsletter' && $page != 'alo-easymail/alo-easymail_subscribers.php' ) { /* if ( get_option('alo_em_timeout_alert') != "hide" ) { echo '
'. __("To enable the plugin work better you should increase the wp_cron and php timeouts", "alo-easymail") .". ";
echo __("For more info you can use the Help button or visit the FAQ of the site", "alo-easymail");
echo ' »
'. __("Debug mode is activated", "alo-easymail") .": ";
if ( get_option('ALO_em_debug_newsletters') == "to_author" ) _e("all messages will be sent to the newsletter author", "alo-easymail");
if ( get_option('ALO_em_debug_newsletters') == "to_file" ) _e("all messages will be recorded into a log file", "alo-easymail");
echo ".
'. __("ALO Easymail Newsletter needs attention", "alo-easymail") ."!
";
echo __("The plugin database tables have not properly installed", "alo-easymail") .": " . __("you can try to deactivate and activate the plugin", "alo-easymail").".";
echo "
". __("For more info, visit the FAQ of the site.", "alo-easymail")."";
echo ".