r/WordpressPlugins • u/lordspace • 12d ago
Premium [DISCUSSION] New Security Plugin for WordPress
Hey everyone! I came up with yet another simple way to protect my and client WordPress sites. One of the simplest and super effective ways is to put /wp-admin/ and wp-login.php behind basic authentication. admin-ajax.php should be excluded though because it's used in the public site for ajax stuff even though it's in /wp-admin/
So my idea is that even if someone manages to create an administrator account, they still won't be able to log in or do any administrative actions until they are approved/trusted.
I manually approve/flag high privileged users such as Store Manager (WooCommerce), Editor or Administrator roles via WP-CLI (I could easily add a UI for this though).
Should I release this as a free/paid plugin? Anyone interested in testing it?
This is so effective and there's a high chance of accidentally locking yourself out and it will require adding some lines to wp-config via FTP or file manager via the control panel 😃
The plugin checks for important changes in the WordPress site like admin email and that automatically deactivates the trust of the users e.g. a site is hacked and the admin email is changed that blocks access to all high privileged accounts for security reasons.
Slavi,
Orbisius
1
u/Outside_Elderberry19 5h ago
I like the idea of approving new admins. My first thought was what happens if a client changes the admin email and locks out their own store manager. Having to edit wp-config.php to get them back in sounds like a support call waiting to happen.
Could it just log who would’ve been locked out for the first few days? I’d want to see that on a client site before switching the blocking on.
1
u/Domewey 11d ago
Bulletproof
1
u/PeepSoWP 11d ago
I'd test the 'no administrative actions' part separately from blocking the login screen. admin-ajax.php also handles authenticated actions, and REST requests can authenticate with application passwords without visiting wp-login.php.
On an isolated test site, give a test administrator a session and application password, then mark that account untrusted. Can it still make a harmless administrative change through an otherwise permitted AJAX or REST operation? Keeping public AJAX working is necessary, but doesn't establish that administrative operations are blocked. The trust restriction needs to cover those server-side authorization decisions too. I haven't tested your implementation; this is a boundary I'd verify before describing it as containing a rogue administrator.