83% restricted-site-access

Code Review | Restricted Site Access

WordPress plugin Restricted Site Access scored83%from 54 tests.

About plugin

  • Plugin page: restricted-site-a...
  • Plugin version: 7.4.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Aug 17, 2009
  • Latest release: Nov 14, 2023
  • Number of updates: 72
  • Update frequency: every 72.3 days
  • Top authors: jakemgold (48.61%)helen (19.44%)10up (13.89%)10upbot (13.89%)tlovett1 (6.94%)

Code review

54 tests

User reviews

59 reviews

Install metrics

20,000+ active /711,617 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.41MB] [CPU: ▼5.34ms] Passed 4 tests

Analyzing server-side resources used by Restricted Site Access
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4642.28 ▲1.10
Dashboard /wp-admin3.76 ▲0.4148.85 ▼13.43
Posts /wp-admin/edit.php3.81 ▲0.4549.62 ▲5.01
Add New Post /wp-admin/post-new.php6.27 ▲0.3983.65 ▼11.12
Media Library /wp-admin/upload.php3.62 ▲0.3936.56 ▲2.09

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 141 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Restricted Site Access
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.31 ▲0.151.83 ▲0.1146.81 ▲2.65
Dashboard /wp-admin2,195 ▲205.66 ▲0.0291.65 ▼31.3937.79 ▼8.96
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0340.41 ▲0.8036.78 ▲4.63
Add New Post /wp-admin/post-new.php1,535 ▲925.10 ▲1.84607.11 ▼83.8669.51 ▲12.70
Media Library /wp-admin/upload.php1,397 ▲34.16 ▼0.0199.42 ▼3.1244.86 ▼1.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 103× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/restricted-site-access/restricted_site_access.php:2098
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/restricted-site-access/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: You can take inspiration from this readme.txt

restricted-site-access/restricted_site_access.php 85% from 13 tests

The entry point to "Restricted Site Access" version 7.4.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 416 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("restricted-site-access.php" instead of "restricted_site_access.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin6,672 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1281,2573,4646,101
JavaScript44120280
JSON100268
Bourne Shell15413
CSS12010

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity7.64
▷ Minimum class complexity1.00
▷ Maximum class complexity256.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces8
Interfaces2
Traits0
Classes117
▷ Abstract classes21.71%
▷ Concrete classes11598.29%
▷ Final classes00.00%
Methods385
▷ Static methods11529.87%
▷ Public methods31381.30%
▷ Protected methods4511.69%
▷ Private methods277.01%
Functions19
▷ Named functions210.53%
▷ Anonymous functions1789.47%
Constants26
▷ Global constants27.69%
▷ Class constants2492.31%
▷ Public constants24100.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
PNG images were not found in this plugin