Support » Plugin: WordPress Access Areas » Archive, Recents Posts, Last Comments show restricted content

  • Resolved ziguri

    (@ziguri)


    Hello,

    First of all thanks for the great plugin! I really love it.

    One question. I have defined 2 specific access areas with your plugin. Furthermore, i use the the WordPress Core Widgets like Recent Posts, Recent Comments or Archive. All of them have the same problem in combination with Access Areas. Post or Comments are shown in Recent Posts or Recent Comments even if they are not accessible for the logged-in user (member of a certain access area).

    It would be great if not accessible Posts or Comments are hidden from the core widgets if they are not accessible!
    Is this possible?

    Thanks for a short reply!

    Best regards,
    Ziguri

    https://wordpress.org/plugins/wp-access-areas/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author podpirate

    (@podpirate)

    Hi Ziguri,

    concerning the recent comments widget you are absolutely right. I already found a fix, but it requires a little more testing, so it might take a few days before I publish it.

    In theory the recent posts widget should work pretty well, but I tested it again.
    Please have a look at my test scenario below. If there is something different on your system, please let me know. Other plugins doing something with WordPress’ post retrieval process may also cause that issue.

    Test #1:
    – Post X is visible for Access Area A
    – Mr. Subscriber (no further access) takes a look on front page …
    –> … can not see Post X in the Recent Posts widget. Good! 🙂

    Test #2:
    – Mr. Subscriber now has only access to B.
    – … takes a look on the front page. Can’t see post X. Good!

    Test #3:
    – Now Mr. Subscriber can access A…
    – … and will now see Post X. Good again!

    Best regards,
    jörn

    Hi Jörn,

    Thanks for your fast reply.

    I checked your scenarios on my system!

    Recent Posts:
    Test #1: -> Same behavior on my system after i deactivated the Plugin “Restrict Widgets”. Thanks for the hint with other plugins. Good!
    Test #2: -> Same behavior as you described on my system. Good!
    Test #3: -> Same behavior as you described on my system. Good!

    Recent Comments:
    Test #1: -> Comments still shown. Not good!
    Test #2: -> Comments still shown. Not good!
    Test #3: -> Everything is shown, but area A is full access on my system. So good for me.

    Archive:
    Test #1: -> Archive shows month and counter. Not good!
    Test #2: -> Archive shows month and counter. Not good!
    Test #3: -> Everything is shown, but area A is full access on my system. So good for me.

    Tags:
    Test #1: -> Tags of posts which are not accessible shown. Not good!
    Test #2: -> Tags of posts which are not accessible shown. Not good!
    Test #3: -> Everything is shown, but area A is full access on my system. So good for me.

    One further observation:
    All four widgets show posts even if the user is logged out! That is why i initially used the plugin “Restrict widgets” to deactivate widgets on specific pages. As mentioned above – this widgets causes problems in combination with your plugin. For this reason i used another widget called “Display Widgets” which works fine in combination with your plugin – BUT just for certain types of content.

    I check again the scenarios for recent posts and made an interesting observation:
    Test #1: Posts hidden on Blogs BUT shown on Pages. Half good 😉
    Test #2: Posts hidden on Blogs BUT shown on Pages. Half good 😉
    Test #3: Shown everywhere since full access! Good!

    The best would be to add an option to your plugin to disable widgets for certain access areas (eg. no access area at all)

    Tell me if i can help you in testing further scenarios!

    Thanks for your work.
    Best regards,
    ziguri

    Plugin Author podpirate

    (@podpirate)

    Hey Ziguri,

    Thanks for the testing. In total I see six issues here (thank god this happens in only one thread 😉 )

    1. Hidden Posts show up in Recent Comments Widget.

      This can be fixed. I am already working on it.

    2. Hidden posts show up in Archive Widget

      Same Thing: is Fixable. Will be up soon.

    3. Hidden posts show in Calendar Widget.

      Not fixable. I’m sorry. WordPress provides no way to hook into the database queries here.

    4. Hidden posts show in recent Posts Widget on a single post/page view.

      Sounds pretty weird, but good news: fixable!

    5. Hidden posts show in Tags/Categories Widget.

      This one is rather complicated. WordPress does not actually count the posts, when listing up taxonomy terms, this would take too long and drastically affect the overall performance. It increases / decreases this value in the database when a post is assigned to / detached from a term. Not fixable as well. Damned!

    6. Compatibility issue with Restrict Widgets Plugin (Is it this one? https://wordpress.org/plugins/restrict-widgets)

      I just did a quick check on this, but I could not reproduce your issue. Would you mind to post a screenshot of your “Restrict Widgets” Settings?

    best regards,
    jörn

    Hey Jörn,

    Wow – quite a lot of issues! But luckily at least few of them seem to be fixable!

    Regarding the 6th issue:
    Yes, that is the widget i meant.
    I did check it again using the Recent Posts Widget. I think it was my fault. Generally speaking, the Restrict Widget does not affect the functionality of your plugin. I thought it would. But the problem is more the observation i made with different types of content. Your plugin works if Restrict Widget is installed and active on a common blog post BUT it fails one a certain Page.

    Anyway – i used the default settings of Restrict Widget.
    Restrict Widget Settings

    Please inform me as soon as the updates are online!

    Have a nice day,
    Ziguri

    Plugin Author podpirate

    (@podpirate)

    Hi Ziguri,
    I just release 1.2.8 where the fixable issues (amongst other) have been fixed. I also submitted a wordpress patch, that could provide a solultion for the calendar issue, but I am not very optimistic, that it would make it into wordpress core.
    Have a good time!
    jörn

    Hey Jörn,

    Thanks a lot for your effort!
    Great job.
    I just updated the plugin and tested all the issues!
    Everything works!

    Thanks!
    Have a nice day,
    Ziguri

    Plugin Author podpirate

    (@podpirate)

    Addendum: It seems as if my patch will make it’s way into WP Core (presumably v 4.1.): https://core.trac.wordpress.org/ticket/29319#comment:4
    Yeah! 🙂

    Yeah! Good job!
    Congratulations…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Archive, Recents Posts, Last Comments show restricted content’ is closed to new replies.