[wp-trac] [WordPress Trac] #38124: Setting user to SPAM also marks site as SPAM in a network install

WordPress Trac noreply at wordpress.org
Thu Sep 22 06:08:54 UTC 2016


#38124: Setting user to SPAM also marks site as SPAM in a network install
--------------------------------+-----------------------------
 Reporter:  mensmaximus         |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  4.6.1
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 If you mark one or more users as SPAM from network admin the sites the
 users are associated with get marked as spam as well. As a result the site
 marked as spam will only display "This site has been archived or
 suspended." if accessed.

 Within the switch statement in /wp-admin/network/users.php from line 70 we
 can read

 {{{#!php
 <?php
 case 'spam':
         $user = get_userdata( $user_id );
         if ( is_super_admin( $user->ID ) )
                 wp_die( sprintf( __( 'Warning! User cannot be modified.
 The user %s is a network administrator.' ), esc_html( $user->user_login )
 ) );

         $userfunction = 'all_spam';
         $blogs = get_blogs_of_user( $user_id, true );
         foreach ( (array) $blogs as $details ) {
                 if ( $details->userblog_id != $current_site->blog_id ) //
 main blog not a spam !
                         update_blog_status( $details->userblog_id, 'spam',
 '1' );
         }
         update_user_status( $user_id, 'spam', '1' );
 break;
 }}}

 Imho this behavior needs some tweaking. Think about a site with community
 of 1000 members. If one member gets marked as spam why would you suspend
 the entire site and penalize 999 others by switching the site off?

 If this is something really intended there should be a warning that
 marking a user as spam will suspend any site the user is associated to.

 However I cant think of any good reason to suspend an entire site if one
 user is suspected to be spam. It may be worth to discuss whether this
 would be an appropriate action if a site-admin gets marked as spam. But
 even than the superadmin(s) should get a notice that a site has been
 suspended on behalf of a superadmin (the email should name the user how
 marked which user  as spam and what site(s) got suspended)

 However I think suspending a site should never be connected to marking a
 user as spam. You would not delete the site either if the user gets
 deleted - won't you? To suspend a site is a decision of the superadmin and
 there should me no automatism making a possible false decision for him.

 I opt for removing the entire part to mark a site/blog as spam in case a
 user gets marked as spam.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38124>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list