AsynCRONous bbPress Subscriptions
Per default, bbPress is sending subscription notification emails as one email with a bunch of BCCs. There are various reasons why it would make more sense to send individual emails. This plugin does that, quietly in the background via WP cron, without slowing down page load times. Also increases notification performance and reduces database load on large sites. Translations by @mauriciogarofalo and @mechter Defaults If you don’t customize this plugin, this is what you’ll get: Sends mails from "MyBlog " (with your Blog’s name and admin email) Sends mail to "Markus " (with the name being the user’s display name on the forums, not their username) Subject and Message have more user friendly defaults, use the available filters (see below) to make them your own. Customization You can install and activate this plugin and it just works, but you have full control over the details if you want to. Below are some filters and code snippets that help you do what you want. If you’re new to working directly with code, please see the example at the bottom of this page. Available filters bbp_subscription_email_from( $from ) // $from can be a string or array('name'=>string, 'address'=>string) bbp_subscription_email_recipients( $recipients ) // $recipients is array of array('name'=>string, 'address'=>string) bbp_subscription_email_headers( $headers ) bbp_forum_subscription_email_subject( $subject, $forum_id, $topic_id ) bbp_forum_subscription_email_message( $message, $forum_id, $topic_id ) bbp_topic_subscription_email_subject( $subject, $forum_id, $topic_id, $reply_id ) bbp_topic_subscription_email_message( $message, $forum_id, $topic_id, $reply_id ) bbp_bounce_address( $bounce_address ) bbp_subscription_disable_async( false ) bbp_forum_subscription_disable_async( false ) bbp_topic_subscription_disable_async( false ) bbp_forum_subscription_notify_author( false ) bbp_topic_subscription_notify_author( false ) Helpful Snippets Here are some pointers to get the data you might want in your notifications: $blog_name = get_bloginfo( 'name' ); $forum_title = bbp_get_forum_title( $forum_id ); $topic_author_user_id = bbp_get_topic_author_id( $topic_id ); $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id ); $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES ); $topic_content = wp_specialchars_decode( strip_tags( bbp_get_topic_content( $topic_id ) ), ENT_QUOTES ); $topic_url = get_permalink( $topic_id ); $reply_author_user_id = bbp_get_reply_author_id( $reply_id ); $reply_author_display_name = bbp_get_topic_author_display_name( $reply_id ); $reply_content = strip_tags( bbp_get_reply_content( $reply_id ) ); $reply_url = bbp_get_reply_url( $reply_id ); // note that it's not get_permalink() Example To have a nice subject line for new topic notifications, add this to your theme’s functions.php. If your theme does not have this file, you can simply create it and it will be loaded automatically. Note how the example is basically just one of the filters above, mixed with some of the snippets and a return statement. It’s that simple. add_filter( 'bbp_forum_subscription_email_subject', function( $subject, $forum_id, $topic_id ) { $blog_name = get_bloginfo( 'name' ); $topic_author_display_name = bbp_get_topic_author_display_name( $topic_id ); $topic_title = wp_specialchars_decode( strip_tags( bbp_get_topic_title( $topic_id ) ), ENT_QUOTES ); return "[$blog_name] $topic_author_display_name created a new topic: $topic_title"; }, 10, 3); // first is priority (10 is default and just fine), second is number of arguments your filter expects
Top keywords
- topic34×5.91%
- id28×4.87%
- bbp24×4.17%
- subscription14×2.43%
- author13×2.26%
- forum13×2.26%
- name13×2.26%
- reply13×2.26%
- topic id12×2.09%
- email10×1.74%
- id topic10×1.74%
- display8×1.39%
Avatar Privacy
Avatars from Gravatar.com are great, but they come with certain privacy implications. You as site admin may already know this, but your visitors and users probably don’t. Avatar Privacy can help to improve the privacy situation by making some subtle changes to the way avatars are displayed on your site. The plugin works without changing your theme files (for reasonably modern themes), and it does support multisite installations. Please note that the plugin does not provide an options page of its own, it rather adds to the existing discussion settings page. Features The plugin’s features summed up: Self-uploaded avatars for users (and custom default images), hosted on your server. Users and commenters explicitly opt-in before using gravatars. Gravatar caching to ensure the privacy of your website visitors. Don’t publish weakly encrypted e-mail addresses of comment authors. A more detailed examination of the reasons for using Avatar Privacy can be found on the plugin homepage. WP-CLI Commands Avatar Privacy includes the following WP-CLI commands: wp avatar-privacy db show: Show information about the custom database table(s). wp avatar-privacy db list: List entries in the custom database table(s). wp avatar-privacy db create: Create the custom database table. wp avatar-privacy db upgrade: Upgrade the structure of the custom database table. wp avatar-privacy default get-custom-default-avatar: Show information about the custom default avatar for the site. wp avatar-privacy default set-custom-default-avatar: Set a custom default avatar for the site. wp avatar-privacy default delete-custom-default-avatar: Delete the custom default avatar for the site. wp avatar-privacy cron list: List active cron jobs created by the plugin. wp avatar-privacy cron delete: Delete cron jobs created by the plugin. wp avatar-privacy user set-local-avatar: Set a local avatar image for a user. wp avatar-privacy user delete-local-avatar: Delete the local avatar image for a user. wp avatar-privacy uninstall: Remove data added by Avatar Privacy. Feedback Please report any problems with the plugin, I’ll do my best to sort things out. You can use the contact form on my code site or create a topic in the support forum. You can contact me in German or English. Credits Avatar Privacy is based on the original plugin by Johannes Freudendahl. The new release also includes work by several other people: Daniel Mester Pirttijärvi (Jdenticon), Shamus Young (Wavatars), Andreas Gohr (the original MonsterID and RingIcon), Scott Sherrill-Mix & Katherine Garner (the hand-drawn monster update) Benjamin Laugueux, Grummfy, Lucas Michot & Arjen van der Meijden (Identicon), David Revoy (Bird and Cat Avatars), Zikri Kader, Colin Davis & Nimiq (RoboHash), and Johanna Amann (the Avatar Privacy icon).
Top keywords