</p> </div> <?php } // Check to see if wp_mail() has been overloaded if (class_exists('ReflectionFunction')) { $wp_mail = new ReflectionFunction('wp_mail'); $actual = realpath($wp_mail->getFileName()); $expected = realpath(sprintf('%s%swp-includes%spluggable.php', ABSPATH, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)); if ($actual != $expected) { printf('<div class="updated fade"><h3>%s</h3></div>', __('Warning: wp_mail() appears to be overloaded.', MAILUSERS_I18N_DOMAIN)); } } // Check the number of users who accept notifications and mass emails $massemails = mailusers_get_users('', MAILUSERS_ACCEPT_MASS_EMAIL_USER_META); $notifications = mailusers_get_users('', MAILUSERS_ACCEPT_NOTIFICATION_USER_META); if (count($massemails) == 0 || count($notifications) == 0) { ?> <div class="updated fade"> <div class="table table_content"> <p class="sub"><?php _e('Current settings show post or page notification and/or mass email may not be received by any users.', MAILUSERS_I18N_DOMAIN); ?> </p> <table style="text-align: left; width: auto;"> <tr> <th><?php _e('Number of Users who accept post or page notification emails:', MAILUSERS_I18N_DOMAIN); ?> </th> <td<?php
/** * Create the function to output the contents of our Dashboard Widget. */ function mailusers_dashboard_widget_function() { ?> <div class="table table_content"> <p class="sub"><?php _e('Default User Settings', MAILUSERS_I18N_DOMAIN); ?> </p> <table style="text-align: left; width: 90%;"> <tr> <th><?php _e('Receive post or page notification emails:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_default_notifications() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <tr> <th><?php _e('Receive emails sent to multiple recipients:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_default_mass_email() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <tr> <th><?php _e('Allow Users to control their own Email Users settings:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_default_user_control() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <tr> <th><?php _e('Filter Users with no role from Recipient List:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_no_role_filter() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> </table> </div> <?php // Report the number of users who accept notifications and mass emails $massemails = mailusers_get_users('', MAILUSERS_ACCEPT_MASS_EMAIL_USER_META); $notifications = mailusers_get_users('', MAILUSERS_ACCEPT_NOTIFICATION_USER_META); ?> <div class="table table_content"> <p class="sub"><?php _e('User Statistics', MAILUSERS_I18N_DOMAIN); ?> </p> <table style="text-align: left; width: 90%;"> <tr> <th><?php _e('Number of Users who accept post or page notification emails:', MAILUSERS_I18N_DOMAIN); ?> </th> <td<?php if (count($notifications) == 0) { echo ' style="color: red;"'; } ?> ><?php echo count($notifications); ?> </td> </tr> <tr> <th><?php _e('Number of Users who accept emails sent to multiple recipients:', MAILUSERS_I18N_DOMAIN); ?> </th> <td<?php if (count($massemails) == 0) { echo ' style="color: red;"'; } ?> ><?php echo count($massemails); ?> </td> </tr> </table> </div> <?php return; /** The remainder of the filter information isn't finished yet. **/ ?> <div class="table table_content"> <p class="sub"><?php _e('Content Filters', MAILUSERS_I18N_DOMAIN); ?> </p> <table style="text-align: left; width: 90%;"> <?php global $wp_filter; $filters = array('the_content' => 'http://codex.wordpress.org/Function_Reference/the_content', 'the_excerpt' => 'http://codex.wordpress.org/Function_Reference/the_excerpt', 'tiny_mce_before_init' => 'http://codex.wordpress.org/Plugin_API/Filter_Reference/tiny_mce_before_init'); $hooks = array('wpautop' => 'http://codex.wordpress.org/Function_Reference/wpautop', 'wptexturize' => 'http://codex.wordpress.org/Function_Reference/wptexturize', 'shortcode_unautop' => 'https://developer.wordpress.org/reference/functions/shortcode_unautop/'); // Loop through filters and hooks checking for anything missing foreach ($filters as $fkey => $fvalue) { if (has_filter($fkey)) { $f = array(); foreach (array_keys($wp_filter[$fkey]) as $key => $value) { $f = array_merge($f, array_keys($wp_filter[$fkey][$value])); } foreach ($hooks as $key => $value) { ?> <tr> <th><a href="<?php echo $fvalue; ?> "><?php echo $fkey; ?> </a> / <a href="<?php echo $value; ?> "><?php echo $key; ?> </a></th> <td<?php if (!in_array($key, $f)) { echo ' style="color: red;"'; } ?> ><?php echo in_array($key, $f) ? __('Present', MAILUSERS_I18N_DOMAIN) : __('Missing', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <?php } } } ?> </table> </div> <?php }
_e('You can select multiple users by pressing the CTRL key. When selecting multiple users, any user who should not receive Mass Email will be filtered from the recipient list.', MAILUSERS_I18N_DOMAIN); } ?> </small></label></th> <td> <select id="send_users" name="send_users[]" size="8" style="width: 654px; height: 250px;" <?php if (current_user_can(MAILUSERS_EMAIL_MULTIPLE_USERS_CAP)) { echo 'multiple="multiple"'; } ?> > <?php // Display of users is based on plugin setting $na = __('N/A', MAILUSERS_I18N_DOMAIN); $sortby = mailusers_get_default_sort_users_by(); $users = mailusers_get_users($user_ID); foreach ($users as $user) { switch ($sortby) { case 'fl': // First Last $name = sprintf('%s %s', is_null($user->first_name) ? $na : $user->first_name, is_null($user->last_name) ? $na : $user->last_name); break; case 'flul': // First Last User Login $name = sprintf('%s %s (%s)', is_null($user->first_name) ? $na : $user->first_name, is_null($user->last_name) ? $na : $user->last_name, $user->user_login); break; case 'lf': $name = sprintf('%s, %s', is_null($user->last_name) ? $na : $user->last_name, is_null($user->first_name) ? $na : $user->first_name); break; case 'lful': $name = sprintf('%s, %s (%s)', is_null($user->last_name) ? $na : $user->last_name, is_null($user->first_name) ? $na : $user->first_name, $user->user_login);
/** * Create the function to output the contents of our Dashboard Widget. */ function mailusers_dashboard_widget_function() { ?> <div class="table table_content"> <p class="sub"><?php _e('Default User Settings', MAILUSERS_I18N_DOMAIN); ?> </p> <table style="text-align: left; width: 90%;"> <tr> <th><?php _e('Receive post or page notification emails:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_default_notifications() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <tr> <th><?php _e('Receive emails sent to multiple recipients:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_default_mass_email() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <tr> <th><?php _e('Allow Users to control their own Email Users settings:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_default_user_control() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> <tr> <th><?php _e('Filter Users with no role from Recipient List:', MAILUSERS_I18N_DOMAIN); ?> </th> <td><?php echo mailusers_get_no_role_filter() == 'true' ? __('On', MAILUSERS_I18N_DOMAIN) : __('Off', MAILUSERS_I18N_DOMAIN); ?> </td> </tr> </table> </div> <?php // Report the number of users who accept notifications and mass emails $massemails = mailusers_get_users('', MAILUSERS_ACCEPT_MASS_EMAIL_USER_META); $notifications = mailusers_get_users('', MAILUSERS_ACCEPT_NOTIFICATION_USER_META); ?> <div class="table table_content"> <p class="sub"><?php _e('User Statistics', MAILUSERS_I18N_DOMAIN); ?> </p> <table style="text-align: left; width: 90%;"> <tr> <th><?php _e('Number of Users who accept post or page notification emails:', MAILUSERS_I18N_DOMAIN); ?> </th> <td<?php if (count($notifications) == 0) { echo ' style="color: red;"'; } ?> ><?php echo count($notifications); ?> </td> </tr> <tr> <th><?php _e('Number of Users who accept emails sent to multiple recipients:', MAILUSERS_I18N_DOMAIN); ?> </th> <td<?php if (count($massemails) == 0) { echo ' style="color: red;"'; } ?> ><?php echo count($massemails); ?> </td> </tr> </table> </div> <?php }
<?php printf('%s - %s', $prefix, __($value)); ?> </option> <?php } } ?> </select> <select name="send_users[]" multiple="yes" size="8" style="width: 400px; height: 250px;"> <?php // Display of users is based on plugin setting $na = __('N/A', MAILUSERS_I18N_DOMAIN); $sortby = mailusers_get_default_sort_users_by(); $users = mailusers_get_users($user_ID, MAILUSERS_ACCEPT_NOTIFICATION_USER_META); foreach ($users as $user) { switch ($sortby) { case 'fl': // First Last $name = sprintf('%s %s', is_null($user->first_name) ? $na : $user->first_name, is_null($user->last_name) ? $na : $user->last_name); break; case 'flul': // First Last User Login $name = sprintf('%s %s (%s)', is_null($user->first_name) ? $na : $user->first_name, is_null($user->last_name) ? $na : $user->last_name, $user->user_login); break; case 'lf': $name = sprintf('%s, %s', is_null($user->last_name) ? $na : $user->last_name, is_null($user->first_name) ? $na : $user->first_name); break; case 'lful': $name = sprintf('%s, %s (%s)', is_null($user->last_name) ? $na : $user->last_name, is_null($user->first_name) ? $na : $user->first_name, $user->user_login);