Making WordPress.org

Changeset 11533


Ignore:
Timestamp:
02/09/2022 01:20:09 AM (5 years ago)
Author:
dd32
Message:

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.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-plugin.php

    r9802 r11533  
    4444                $this->report_topic = new Report_Topic;
    4545                $this->nsfw_handler = new NSFW_Handler;
     46                $this->stats        = new Stats;
    4647
    4748                // These modifications are specific to https://wordpress.org/support/
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/support-forums.php

    r9802 r11533  
    2727include( dirname( __FILE__ ) . '/inc/class-report-topic.php' );
    2828include( dirname( __FILE__ ) . '/inc/class-nsfw-handler.php' );
     29include( dirname( __FILE__ ) . '/inc/class-stats.php' );
    2930
    3031// Compat-only includes.
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php

    r11530 r11533  
    248248
    249249                // Replace forum subscriber list with term subscribers, avoiding duplicates.
    250                 add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers_to_forum' ) );
     250                add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers' ) );
    251251
    252252                // Actually notify our term subscribers.
     
    254254
    255255                // Remove filters.
    256                 remove_filter( 'bbp_forum_subscription_user_ids',     array( $this, 'add_term_subscribers_to_forum' ) );
     256                remove_filter( 'bbp_forum_subscription_user_ids',     array( $this, 'add_term_subscribers' ) );
    257257                remove_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10 );
    258258
     
    262262         * Temporarily replace the forum subscriber list with any unincluded term subscribers.
    263263         */
    264         public function add_term_subscribers_to_forum( $users ) {
     264        public function add_term_subscribers( $users ) {
    265265                return array_diff( $this->subscribers, $users );
    266266        }
     
    369369
    370370                // Replace forum subscriber list with term subscribers, avoiding duplicates.
    371                 add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) );
     371                add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers' ) );
    372372
    373373                // Actually notify our term subscribers.
     
    375375
    376376                // Remove filters.
    377                 remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) );
     377                remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers' ) );
    378378                remove_filter( 'bbp_subscription_mail_message',   array( $this, 'replace_topic_subscription_mail_message' ) );
    379         }
    380 
    381         /**
    382          * Temporarily replace the forum subscriber list with any unincluded term subscribers.
    383          */
    384         public function add_term_subscribers_to_topic( $users ) {
    385                 return array_diff( $this->subscribers, $users );
    386379        }
    387380
     
    566559         * @return bool False if invalid, otherwise true
    567560         */
    568         public static function add_user_subscription( $user_id = 0, $term_id = 0 ) {
     561        public static function add_user_subscription( $user_id, $term_id ) {
    569562                if ( empty( $user_id ) || empty( $term_id ) ) {
    570563                        return false;
     
    575568                        wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
    576569                }
     570
    577571                do_action( 'wporg_bbp_add_user_term_subscription', $user_id, $term_id );
    578572
     
    587581         * @return bool False if invalid, otherwise true
    588582         */
    589         public static function remove_user_subscription( $user_id = 0, $term_id = 0 ) {
     583        public static function remove_user_subscription( $user_id, $term_id ) {
    590584                if ( empty( $user_id ) || empty( $term_id ) ) {
    591585                        return false;
     
    596590                        wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
    597591                }
     592
    598593                do_action( 'wporg_bbp_remove_user_term_subscription', $user_id, $term_id );
    599594
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php

    r4005 r11533  
    2020
    2121// Instantiate the Plugin
    22 new Plugin();
     22$GLOBALS['wporg_bbp_topic_term_subscriptions'] = new Plugin();
    2323
    2424// Easy access for templates
Note: See TracChangeset for help on using the changeset viewer.