Category Access 0.7.2 Released

I’ve released a new version of the Category Access Wordpress 2 plugin. This plugin allows the blog maintainer to restrict access to posts belonging to particular categories on a user-by-user basis.

New changes:

  • Updated for Wordpress 2.1. It should continue to work for Wordpress 2.0
  • Fixed a bug where pages would sometimes not be shown.

Download it on my code page.

12 Responses to “Category Access 0.7.2 Released”

  1. boldlygoing Says:

    David,

    First, from all I’ve been able to tell, your plugin does exactly what you designed it to do. In fact, I wonder if it isn’t doing one thing maybe too great!

    Allow me to explain: after installing and activating at our site, and setting up the categories to be accessible and those not, I was pleasantly surprised to learn that the set permissions cascaded to child cats of protected cats. That was cool since it meant that I don’t have a few more clicks and page views when adding new cats I want shielded under previously created and protected categories.

    Now the somewhat sticky part: has anyone expressed to you or have you possibly checked on this yourself?
    While running your plugin, I’ve found that regardless of which categories are open and which are protected, regardless of which category you post to and add a trackback link to, when that remote (Wordpress, in my testing) server receives the TB from me, it displays in its moderation cue the warning message from the plugin (”You do not have permissions to…) and it does this whether I have that radio button selected in the plugin’s options or not!

    We think we have tested about every possible combination of settings with the anonymous user having all categories “checked” (accessible), and the same for the “new user” class. There doesn’t seem to be any challenges or “interference” with a remote site initiating a trackback from one of there posts; the system handles those actions just fine.

    Thanks for any time and effort you might have for this. Ordinarily we don’t post comments for requests where we don’t see others posting as well, however, your plugin pretty much is the defacto standard for controlling access to categories in Wordpress 2.1 (and prior). Plus other than this particular issue, we really want to use it!

    Thanks again for your time.
    ~James.

  2. David Says:

    Hi there,

    I was pleasantly surprised to learn that the set permissions cascaded to child cats of protected cats.

    Hm… I didn’t explicitly design it this way, but I guess a post is in its subcategory and parent categories, so that if the parent category is protected, then the post is protected.

    While running your plugin, I’ve found that regardless of which categories are open and which are protected, regardless of which category you post to and add a trackback link to, when that remote (Wordpress, in my testing) server receives the TB from me, it displays in its moderation cue the warning message from the plugin (”You do not have permissions to…) and it does this whether I have that radio button selected in the plugin’s options or not!

    Can you please split that sentence up into a lot of short sentences? Like “On Site 1 I write an article. On Site 2 I post a trackback. On Site 1 in the moderation queue I see a protected post message. Instead, I expected the following… My settings are like the following screenshot…” I need to know exactly what the problem is, how to reproduce it, and what you expected to happen. If it would help, do a trackback for this article.

    Thanks!

  3. boldlygoing Says:

    Okay, I’ll do my best.

    1. On my site I had your plugin enabled. I had a spattering of categories that should not have allowed access to the public, only admin levels of our site.

    2. I created a post from one of the categories that was available for the public to view.

    3. In that post, I created a trackback to another site (one that I have control over, but is on a separate server/machine).

    4. The second site received the trackback (which as WP does, it listed it in the comments for approval page in admin).

    5. The only content that would show on that trackback/comment was the “you do not have permissions” message that is a part of the Cat access plugin.

    3. When I disabled the plugin, the trackback at that second site was completely normal, in that it showed a snippet of the original post on my first site.

    I’ve since not reinstated the plugin, but would like very much to do so. I tried the 0.7.3 release, however it would not work on our 2.10 install and I had to go back to 0.7.2 version (again, when I was using it.)

    Hopefully this is a bit clearer for you to try and figure out. Hopefully, I am the only one with the challenges. If you have a chance we’d love to have your take on our newly redesiged web site at BoldyGoing.com.

    Either way, thanks so much for taking the time to respond to my requests.

    Go Boldly!

  4. PhDs Says:

    Hi,

    I tried your category access plugin, but I think there is a problem. By default new user will have access to my restricted category, which is bad. Do you have time to make an improvement?

    thanks
    PhDs

  5. David Says:

    Did you see the section in the options called “Category Access for New Users”?

  6. pret Says:

    Hi

    Thanks for the great plugin, it is the perfect solution for a site I am working where I need to give access to the parts of the site per member. However, it has a problem with MySQL 4.0. I am not sure what is the exact issue, but it works perfect with MySQL 4.1 on my own site, but not on MySQL4.0, which is the clients version. I get the following error, where the SQL seems to be broken

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT ID FROM wp_posts INNER JOIN wp_post2cat ON ( wp_posts.ID]
    SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND (post_type = ‘post’ AND (post_status = ‘publish’)) AND ID NOT IN ( SELECT ID FROM wp_posts INNER JOIN wp_post2cat ON ( wp_posts.ID = wp_post2cat.post_ID ) WHERE 0 = 1 OR wp_post2cat.category_id = 1 OR wp_post2cat.category_id = 2 OR wp_post2cat.category_id = 3) ORDER BY post_date DESC LIMIT 0, 2

    Do you know why this could be? Could you make any suggestions?
    Thank you very much
    pret

  7. David Says:

    Hi pret,

    I don’t have access to MySQL 4.0, so I’m not really sure what the issue is with that query. Could you help me debug it? Here are the instructions:

    Run mysql from the command line, and keep giving it variations on the query until you figure out what’s causing the problem.

    $ mysql -D <DB NAME> -h <DB HOST> -u <DB USERNAME> -p

    Then at the prompt, enter the entire query that shows in your error message (the part that starts with “SELECT”). You should get back the error message that is appearing in your blog.

    Then start whittling away the terms until it succeeds without an error, then back up and fiddle with the last term until you figure out what the problem is.

    If for some reason you can’t run mysql on the command line, you could modify the filter_posts function in category-access.php, adding this just before the “return $sql;” line:

    $sql = “SELECT …;”;

    Then start whittling away until the error goes away. (NOTE: This latter method will cause your blog to not work right until you finish debugging and remove the line you added.)

  8. David Says:

    boldlygoing, I haven’t forgotten about you. If I understand you correctly, you expected the trackback to show you the post since it was unprotected. Right? I don’t have access to another blog that I maintain. Is there any way that you could arrange to allow me to see your trackback approval page? That would help me debug the problem.

  9. David Says:

    boldlygoing, can you please try this beta version, and let me know if it solves your problem?

    http://www.coppit.org/temp/category-access-0.7.3b.zip

  10. David Says:

    pret, your problem is solved in the 0.8.0 version, which I just released.

  11. pret Says:

    thanks for the fix David! I am still using this version, as I just avoided this problem by upgrading the DB. Everything works perfect, and the client is very happy.
    However, I need to be able to pull out the user details and their category access details. They need to understand at a glance which users have access to which product categories (like a spreadsheet with ‘username’, ‘useremail’, ‘category names’- that the user has access to-. I am not sure how to do this. I have checked the MySQL tables, but couldn’t see where the category access details are stored. Does this plugin not use any of the wp tables? Where are the details of user category access stored?
    I would be really greatful if you could help me with this? (or help me understand a little more)

  12. David Says:

    Hi Pret,

    See the function get_category_access_for_user. Basically this information is stored in the options by category id and user id. If you come up with a good spreadsheet UI I’ll add it to the code.

Leave a Reply

You must be logged in to post a comment.