<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[11533] sites/trunk/wordpress.org/public_html/wp-content/plugins: Support Forums: Record stats on the number of subscriptions added/removed/notified per day.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/11533">11533</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/11533","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dd32</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-02-09 01:20:09 +0000 (Wed, 09 Feb 2022)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Support Forums: Record stats on the number of subscriptions added/removed/notified per day.

This will hopefully be used to determine if more people unsubscribe from emails over time in response to any improvements we make.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupportforumsincclasspluginphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupportforumssupportforumsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionincclasspluginphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionwporgbbptermsubscriptionphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginssupportforumsincclassstatsphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stats.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupportforumsincclasspluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php      2022-02-08 21:28:48 UTC (rev 11532)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php        2022-02-09 01:20:09 UTC (rev 11533)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,6 +43,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->hooks        = new Hooks;
</span><span class="cx" style="display: block; padding: 0 10px">                $this->report_topic = new Report_Topic;
</span><span class="cx" style="display: block; padding: 0 10px">                $this->nsfw_handler = new NSFW_Handler;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                $this->stats        = new Stats;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // These modifications are specific to https://wordpress.org/support/
</span><span class="cx" style="display: block; padding: 0 10px">                $blog_id = get_current_blog_id();
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupportforumsincclassstatsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stats.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stats.php                               (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stats.php 2022-02-09 01:20:09 UTC (rev 11533)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,98 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+namespace WordPressdotorg\Forums;
+/**
+ * Some basic Statistics for forum actions.
+ * 
+ * These are very ad-hoc and added on an as-needed basis.
+ */
+class Stats {
+
+       public function __construct() {
+               // Definition: bump_stats_extra( $name, $value, $views = 1 )
+               if ( ! function_exists( 'bump_stats_extra' ) ) {
+                       return;
+               }
+
+               // Term subscriptions (add/remove)
+               add_action( 'wporg_bbp_add_user_term_subscription',    array( $this, 'term_subsription_changes' ), 10, 2 );
+               add_action( 'wporg_bbp_remove_user_term_subscription', array( $this, 'term_subsription_changes' ), 10, 2 );
+
+               // Subscription emails sent
+               add_action( 'bbp_pre_notify_subscribers',       array( $this, 'topic_subscribers' ), 10, 3 );
+               add_action( 'bbp_pre_notify_forum_subscribers', array( $this, 'forum_subscribers' ), 10, 3 );
+       }
+
+       /**
+        * Record stats for how many subscriptions are added/removed.
+        */
+       public function term_subsription_changes( $user_id, $term_id ) {
+               $action = 'wporg_bbp_add_user_term_subscription' == current_filter() ? 'subscribe' : 'unsubscribe';
+               $type   = str_replace( 'topic-', '', get_term( $term_id )->taxonomy );
+
+               bump_stats_extra( 'wporg-support', $action . '-' . $type );
+       }
+
+       /**
+        * Record stats for how many subscription emails (per type) are sent daily.
+        */
+       public function topic_subscribers( $reply_id, $topic_id, $user_ids ) {
+               $type = 'topic-unknown';
+
+               // Either "notify me of replies" or "subscribed to tag/plugin/theme"
+               if ( ! has_filter( 'bbp_topic_subscription_user_ids' ) ) {
+                       $type = 'topic-subscribed';
+               } else {
+                       // Determine which taxonomy triggered it.
+                       $class_instance = $this->which_subscription_class_is_filtering( 'bbp_topic_subscription_user_ids' );
+                       if ( $class_instance ) {
+                               $type = $class_instance->taxonomy;
+                       }
+               }
+
+               bump_stats_extra( 'email', $type, count( $user_ids ) );
+       }
+
+       /**
+        * Record stats for how many subscription emails (per type) are sent daily.
+        */
+       public function forum_subscribers( $topic_id, $forum_id, $user_ids ) {
+               $type = 'forum-unknown';
+
+               // Subscribed to tag/plugin/theme
+               if ( ! has_filter( 'bbp_forum_subscription_user_ids' ) ) {
+                       $type = 'forum-subscribed'; // Should be none..
+               } else {
+                       // Determine which taxonomy triggered it.
+                       $class_instance = $this->which_subscription_class_is_filtering( 'bbp_forum_subscription_user_ids' );
+                       if ( $class_instance ) {
+                               $type = $class_instance->taxonomy;
+                       }
+               }
+
+               bump_stats_extra( 'email', $type, count( $user_ids ) );
+       }
+
+       /**
+        * Determine which instance of WordPressdotorg\Forums\Term_Subscription\Plugin is currently filtering
+        * the forum/topic subscriptions.
+        * 
+        * There's multiple instances of this class with different parameters stored in different places.
+        */
+       protected function which_subscription_class_is_filtering( $filter ) {
+               $forums = Plugin::get_instance();
+
+               $subscription_instances = [
+                       $forums->plugin_subscriptions ?? false,
+                       $forums->theme_subscriptions ?? false,
+                       $GLOBALS['wporg_bbp_topic_term_subscriptions'] ?? false
+               ];
+
+               foreach ( $subscription_instances as $instance ) {
+                       if ( $instance && has_filter( $filter, [ $instance, 'add_term_subscribers' ] ) ) {
+                               return $instance;
+                       }
+               }
+
+               return false;
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stats.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginssupportforumssupportforumsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php        2022-02-08 21:28:48 UTC (rev 11532)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php  2022-02-09 01:20:09 UTC (rev 11533)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,6 +26,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> include( dirname( __FILE__ ) . '/inc/class-hooks.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> include( dirname( __FILE__ ) . '/inc/class-report-topic.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> include( dirname( __FILE__ ) . '/inc/class-nsfw-handler.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+include( dirname( __FILE__ ) . '/inc/class-stats.php' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> // Compat-only includes.
</span><span class="cx" style="display: block; padding: 0 10px"> include( dirname( __FILE__ ) . '/inc/class-dropin.php' );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionincclasspluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php 2022-02-08 21:28:48 UTC (rev 11532)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php   2022-02-09 01:20:09 UTC (rev 11533)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -247,13 +247,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10, 4 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Replace forum subscriber list with term subscribers, avoiding duplicates.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers_to_forum' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Actually notify our term subscribers.
</span><span class="cx" style="display: block; padding: 0 10px">                bbp_notify_forum_subscribers( $topic_id, $forum_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Remove filters.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                remove_filter( 'bbp_forum_subscription_user_ids',     array( $this, 'add_term_subscribers_to_forum' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         remove_filter( 'bbp_forum_subscription_user_ids',     array( $this, 'add_term_subscribers' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 remove_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Temporarily replace the forum subscriber list with any unincluded term subscribers.
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public function add_term_subscribers_to_forum( $users ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function add_term_subscribers( $users ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 return array_diff( $this->subscribers, $users );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -368,24 +368,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">                add_filter( 'bbp_subscription_mail_message', array( $this, 'replace_topic_subscription_mail_message' ), 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Replace forum subscriber list with term subscribers, avoiding duplicates.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Actually notify our term subscribers.
</span><span class="cx" style="display: block; padding: 0 10px">                bbp_notify_topic_subscribers( $reply_id, $topic_id, $forum_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Remove filters.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">                 remove_filter( 'bbp_subscription_mail_message',   array( $this, 'replace_topic_subscription_mail_message' ) );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Temporarily replace the forum subscriber list with any unincluded term subscribers.
-        */
-       public function add_term_subscribers_to_topic( $users ) {
-               return array_diff( $this->subscribers, $users );
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Replace the topic subscription message with term-specific messaging.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param string $message The message
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -565,7 +558,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @param $term_id int The term id
</span><span class="cx" style="display: block; padding: 0 10px">         * @return bool False if invalid, otherwise true
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public static function add_user_subscription( $user_id = 0, $term_id = 0 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function add_user_subscription( $user_id, $term_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( empty( $user_id ) || empty( $term_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return false;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -574,6 +567,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        add_term_meta( $term_id, self::META_KEY, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 do_action( 'wporg_bbp_add_user_term_subscription', $user_id, $term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return true;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -586,7 +580,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @param $term_id int The term id
</span><span class="cx" style="display: block; padding: 0 10px">         * @return bool False if invalid, otherwise true
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        public static function remove_user_subscription( $user_id = 0, $term_id = 0 ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public static function remove_user_subscription( $user_id, $term_id ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( empty( $user_id ) || empty( $term_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return false;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -595,6 +589,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        delete_term_meta( $term_id, self::META_KEY, $user_id );
</span><span class="cx" style="display: block; padding: 0 10px">                        wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 do_action( 'wporg_bbp_remove_user_term_subscription', $user_id, $term_id );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                return true;
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionwporgbbptermsubscriptionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php      2022-02-08 21:28:48 UTC (rev 11532)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php        2022-02-09 01:20:09 UTC (rev 11533)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> include( dirname( __FILE__ ) . '/inc/class-plugin.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> // Instantiate the Plugin
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-new Plugin();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$GLOBALS['wporg_bbp_topic_term_subscriptions'] = new Plugin();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> // Easy access for templates
</span><span class="cx" style="display: block; padding: 0 10px"> function get_subscription_link( $term_id ) {
</span></span></pre>
</div>
</div>

</body>
</html>