WordPress.org

Ready to get started?Download WordPress

Forums

BP | You are blocked
[resolved] Doesn't seem to work! (27 posts)

  1. bp-help
    Member
    Posted 1 year ago #

    Great idea for a plugin but it doesn't appear that it is working. I installed and activated the plugin and then logged out as admin, then logged in as test1 which is a subscriber in browser one. Then in another browser lets call it browser two, I logged in as test2 which is also a subscriber. Then in browser one, test1 goes to the members directory and blocks test2. Test2 then disappears off of test1's members directory. Then in browser two, on test2's members directory test1 is still visible, when test2 clicks on test1, test2 is taken to test1's personal activity, then test2 clicks test1's profile tab and test2 is taken to test1's profile. Basically the plugin is ineffective! I understand this is in beta but I would never tag a beta plugin as 1.0 it would be more appropriate to name it 0.10 or something to that effect. Also your repository is a mess. You have an assets folder inside of your trunk. That folder shouldn't even be there. The items in that assets folder belong in the assets directory of your repository. Because of this people who download your plugin are also downloading the assets which is unnecessary and only bloats the plugin. Also because of this your screenshots are not showing up on the plugins page. I hope you can eventually get this plugin working and I would also like to see it block items from the activity stream as well. Please don't take this as negative, I just wanted to make you aware. Good luck!
    Edit: I am using latest version of WP/BP and bp-default theme. No other plugins or custom code as it is a fresh install.
    http://wordpress.org/plugins/bp-you-are-blocked/

  2. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Hey.

    You are absolutely right, the assets folder should not be there, and agree I could have given it a better version number but I chose 1.0 since I have been using this plugin myself on several BP sites for the last month and felt confident enough to at least release the first beta. But I will admit I make mistakes but I am also here to fix them.

    A question. When a user that has been blocked visits the user who blocked them, the blocked template is not loaded? Do you get an error when this happens?

  3. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Also try flushing your re-write rules on the Permalink settings to make sure the templates are loaded for blocked users.

  4. bp-help
    Member
    Posted 1 year ago #

    Hi Gabriel,
    No the blocked template is not loaded at all and does not display the message. I am not getting any php errors either so it is strange. Maybe I am missing something obvious. I haven't really studied your code yet. I did notice you also have a bunch of unnecessary index.php files throughout the trunk and its sub directories. I do hope you can get this baby working because it will be pretty sweet. I was planning on doing a plugin like this myself that completely blocked a member on all buddypress component pages excluding of course bbpress pages but since you have a work in progress I will focus my attention elsewhere and wait for you to get this plugin corrected. I appreciate your work. If I can be of further assistance please let me know. Good luck!

  5. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Very odd. I just created a fresh WordPress installation with nothing but Buddypress and this plugin installed.

    I added two users. Sara (subscriber) and John (subscriber).
    Sara blocked John and when she tries to visit Johns page she gets the blocked template. If John tries to visit Sara he gets a blocked template as well.

    I have tried with all Buddypress Components enabled and all disabled without any issues. So the question is what difference is there between your setup and mine?

    What I did in steps:
    1. I installed WordPress
    2. Installed BuddyPress
    3. Enabled this plugin
    4. Created two users, john and sara
    5. Set permalinks
    6. Logged in via one browser as sara and one as john.
    7. Confirmed blocking working.

    Are you sure both of your users are not admins?

  6. bp-help
    Member
    Posted 1 year ago #

    I am certain they are both subscribers. I am testing on localhost using xampp. The version of PHP is 5.4.16. It looks like from what you did above you set the permalinks after you created the users. I had these users already created before installing the plugin because I had planned to use this setup in testing my own plugin development. I tried resetting the permalinks but the blocking still fails and the template still is not loaded. I can see that another person on your support forum is having the same issue. I suppose the best idea is to figure out why it is functioning correctly on your test environment but failing on everyone else's. You may need to go through your code with a fine toothed comb to sort it out. I would suggest getting rid of all those unnecessary index.php files so you can focus strictly on the php files that contain the functionality of the plugin, plus its just good house keeping. I really hope you can get this working cause it is a very needed addition. Plus it will save me from having to code another plugin and would allow me to work on other important things! Thanks Gabriel!

  7. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    So I found the issue. I was hooking in and overriding template files incorrectly. I also removed the index files.

  8. bp-help
    Member
    Posted 1 year ago #

    Sorry Gabriel but I just tested beta 2 and it still is not working. It is got to be something else incorrect in the code. Same results as beta 1 unfortunately. I know you will eventually get it. Thanks for the effort anyhow!

  9. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Are you using the default theme or a custom one? Also may I ask what components you have setup so I could try and replicate?

  10. bp-help
    Member
    Posted 1 year ago #

    Hi Gabriel,
    I made a mistake, it is working to a degree but the user you block still shows up in the members directory but when you click on the member the blocked template loads and displays the message. Is this the way you intended? I would think if user1 blocks user2 then if user2 goes to the members directory then user1 does not display in the list. It would be better if that was the case. I still would like to see this blocking occur on the activity stream as well. For instance if user1 blocks user2 then user2 cannot see user1 in the members directory, nor can user2 see user1's activity on the activity stream. Its getting better though! Thanks!

  11. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    I started out building the membership list filtering two ways, so if Sara blocks John, John will not see Sara the same way as Sara will no longer see John.

    But then I tested it on a large community network and quickly found that if we are to check our block list to exclude those we block AND check everyone else out there who might be blocking us, we start making some very heavy db calls.

    One could compile a list of users who block me next to the current list of users I block but I am open for suggestions.

    Hence the extra template file for those who block you. I do welcome suggestions though! After all, my way is not always the highway.

  12. bp-help
    Member
    Posted 1 year ago #

    Hmmm! Maybe not the best solution but what about a conditional that checks the members directory, and if the condition is false, then use some CSS to not display that member in the directory. Of course this is just a dirty way of getting a certain effect. I would prefer using another method to achieve this myself because the source code will still show the user, but only web designers, web developers, and hackers study source code anyway. Hopefully you will figure out a better solution because this is a very important plugin! Thanks Gabriel!

  13. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    I think right now the plugin is a "out of sight out of mind" solution.

    If you select to block someone, you will not be bothered by them since they will not be able to:

    - See you profile
    - Mention you
    - Continue writting or create new messages
    - Be friends with you.

    The only thing they will be able to do is to see you in the members list and see your latest update.

    Also, I feel the person you block deserves the chance to block you back. And for that, you will need to be visible in the members list at least.

  14. bp-help
    Member
    Posted 1 year ago #

    Hi Gabriel,
    On the contrary what good does blocking a person do if the person that has been blocked can still snoop around by viewing your activity? This plugin needs some work before it will be essential. I suppose that is why it is labeled as a beta version. @mentions only works halfway. It converts @ to # but it is still viewable in the activity stream. For instance if I write @gabriel Hi! How are you? and post it on the activity stream, it prints #gabriel Hi! How are you?. Of course it doesn't show up under mentions but it is still very annoying! Can you fix it where the the activities of the person blocked doesn't show up in in the person that blocked them's site-wide activity? The composing new messages seems okay, so really this activity issue as well as displaying a member that has been blocked are really the only major issues that need to be addressed. Thanks!

  15. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Done! :)
    Activities filtered out if blocked.

  16. bp-help
    Member
    Posted 1 year ago #

    Hi Gabriel,
    Just installed beta3 and sorry to inform you but it is still not filtering the activity of the blocked persons on either end. I hope you don't mind that I am reporting my findings back to you, I hope you feel it helps you debug the problem. What hook are you using to filter? May be the issue!

  17. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    No worries.

    I found the bp_get_member_latest_update filter which I then used to return an empty string if the user (with the activity) is blocking you as the viewer.

  18. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Found the issue.
    It seems I updated the wrong file and left out the function.

    In the bpb-queries.php file there should be in the end:

    /**
     * Block Activity View
     * If the user listed is blocking us, we will not be able to see
     * their activities.
     * @since 1.0
     * @version 1.0
     */
    function bpb_remove_activity_if_blocked( $update_content ) {
    	global $members_template;
    
    	if ( !empty( $members_template->member->id ) )
    		$user_id = $members_template->member->id;
    	elseif ( bp_displayed_user_id() )
    		$user_id = bp_displayed_user_id();
    
    	$users_list = bpb_get_blocked_users( $user_id );
    	if ( in_array( get_current_user_id(), $users_list ) && ! current_user_can( 'edit_users' ) )
    		return '';
    
    	return $update_content;
    }
  19. bp-help
    Member
    Posted 1 year ago #

    Are you going to update the repository?

  20. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    It should be updated

  21. bp-help
    Member
    Posted 1 year ago #

    Still not working on the activity stream! :-(

  22. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    I only added the filter for the members list page. I see what you mean now, I forgot the activity page. I'll get on it.

  23. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    I pushed though one solution for now. It is not perfect and could use a better approach but it is 4AM here so I will not get it done without some sleep. Any suggestions on how to best filter activities are welcomed. When it comes to members it was pretty easy to just hook into BP_User_Query but I cant find a way to do similar stuff with activities.

  24. bp-help
    Member
    Posted 1 year ago #

    Hi Gabriel,
    You are getting closer to resolving this. However there is no need for the block buttons on the activity or the message. Basically the entire activity needs to be blocked as if the person did not exist. That means no avatar of a blocked person, no message that they are blocked, and no button. I hope you get some rest and can figure this out when rested. You are so close to nailing this down. Thanks for the update, it definitely shows you are working to get this plugin on track!

  25. Gabriel
    Member
    Plugin Author

    Posted 1 year ago #

    After some good night sleep, I immediately found a way to hook in and filter our activities :)
    So in Beta5. You can no longer see activities you block and activities of those who block you.

    Also added a constant to allow you to set which capability to check for when it comes to who can not be blocked (as in admins).

  26. bp-help
    Member
    Posted 1 year ago #

    Hi Gabriel,
    I just tested beta5 and if you block a persons activity then the person that has been blocked can no longer see the person who blocked them's activity. However I noticed some strange behavior. After the person that has blocked someone starts posting on the sitewide activity stream, it makes the person who was blocked activity stream start to diminish to where the person that was blocked does even see their own activities or the other users activities that has not blocked them. Your getting closer though. Hopefully you can find a fix! Thanks!

  27. bp-help
    Member
    Posted 1 year ago #

    @Gabriel
    Hi just checking to see if you have found a solution to my last reply above? Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic