Today I released our first public WordPress plugin, “Simple Access Control”. The plugin is as simple as its name implies, there is only one optional configuration setting and only one widget to control access.
Use of the plugin is described on the Simple Access Control page.
The code is written in procedural PHP so it can be followed by programmers at any skill level, it’s well commented and was built with use as an example in mind. Feel free to pick it up and use it or modify it to your requirements. I will be posting an annotated version of the code as a tutorial in the near future.
The following two tabs change content below.
pkw
Peter is a partner and Web Designer and Developer on Silver Maple Web. Peter has been building websites since 1996. Currently working in WordPress, Joomla! and Ruby on Rails.
He has design experience and programming expertise in PHP, Ruby, Java, APL, HTML, CSS, and Javascript.
Latest posts by pkw (see all)
- Enabling HTTPS in WordPress - May 26, 2017
- WordPress Maintenance for Beginners - March 28, 2017
- Five Top Mistakes of DIY Websites - February 11, 2017
is it possible to add control also to whole post categories?
Thanks for taking time for srahing this article, it was excellent and very informative. It’s my first time that I visit here. I found a lot of informative stuff in your article. Keep it up. Thank you.
Thank you, that’s a good suggestion, but is not possible at present, control is on a post by post and page by page basis.
/peter
Hello, Do you have any plans – or the ability to – make this plugin more compatible with PHP 7? It is throwing errors in my PHP error log: PHP Deprecated: Non-static method WP_Widget_Text::form() should not be called statically in /home/scmeate/public_html/wp-content/plugins/simple-access-control/simple-access-control.php on line 440.
I am also getting an error when I try to edit my active widgets and while doing various other admin tasks “Error thrown Using $this when not in object context” I think that this is all related.
When I temporarily switch back to PHP 5.6, all works well.
Thanks!
Hi, thanks for the bug report. I’m now using PHP 7 as well and will address this issue when I get a chance.
I noticed that this issue is still unsolved, but I found a fix on https://core.trac.wordpress.org/ticket/41540, so hopefully that helps you to update the plugin soon.
I’ve just released an update to Simple Access Control. It works on WP 4.9, but still requires the core patch plugin described in ticket 41540 on WP 4.8.1 and possibly other 4.8 versions.
I’ve just released a new version of Simple Access Control that should fix this along with some other bugs.