84% restrict-anonymous-access

Code Review | Restrict Anonymous Access

WordPress plugin Restrict Anonymous Access scored84%from 54 tests.

About plugin

  • Plugin page: restrict-anonymou...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 9, 2017
  • Latest release: Sep 11, 2023
  • Number of updates: 18
  • Update frequency: every 127.1 days
  • Top authors: cleuenberg (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /2,058 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.47ms] Passed 4 tests

Analyzing server-side resources used by Restrict Anonymous Access
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.94 ▼6.88
Dashboard /wp-admin3.32 ▼0.0245.38 ▼16.45
Posts /wp-admin/edit.php3.37 ▲0.0247.17 ▲1.66
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.16 ▼17.89
Media Library /wp-admin/upload.php3.24 ▲0.0235.83 ▼0.64

Server storage [IO: ▲0.05MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Restrict Anonymous Access
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.23 ▼1.071.54 ▼0.2539.80 ▼3.36
Dashboard /wp-admin2,209 ▲185.80 ▼0.1097.37 ▼5.0938.32 ▼5.64
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0139.93 ▲3.1736.09 ▼1.22
Add New Post /wp-admin/post-new.php1,533 ▲1923.14 ▲5.54723.07 ▲38.4356.38 ▼0.77
Media Library /wp-admin/upload.php1,385 ▼64.18 ▼0.0794.78 ▼2.6742.68 ▲0.27

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restrict-anonymous-access/restrict-anonymous-access.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Requires at least: Invalid version format
You can look at the official readme.txt

restrict-anonymous-access/restrict-anonymous-access.php 92% from 13 tests

The main PHP script in "Restrict Anonymous Access" version 1.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin135 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1184272
JavaScript18333
PO File15529
CSS1011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code1.07
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/lock.png0.77KB0.88KB0.00%