84% htaccess-site-access-control

Code Review | .htaccess Site Access Control

WordPress plugin .htaccess Site Access Control scored84%from 54 tests.

About plugin

  • Plugin page: htaccess-site-acc...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Jan 29, 2016
  • Latest release: May 11, 2016
  • Number of updates: 6
  • Update frequency: every 17.3 days
  • Top authors: stubgo (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /8,402 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼8.96ms] Passed 4 tests

Server-side resources used by .htaccess Site Access Control
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0845.97 ▼2.38
Dashboard /wp-admin3.39 ▲0.0942.39 ▼11.12
Posts /wp-admin/edit.php3.51 ▲0.1546.71 ▼6.10
Add New Post /wp-admin/post-new.php5.99 ▲0.1186.93 ▼16.22
Media Library /wp-admin/upload.php3.32 ▲0.0939.08 ▲2.86
.htaccess Site Access Control /wp-admin/options-general.php?page=wpsos-site-access-control3.2832.88

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
wpsos_hp_options

Browser metrics Passed 4 tests

A check of browser resources used by .htaccess Site Access Control
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.28 ▼0.291.81 ▼0.0238.79 ▼9.89
Dashboard /wp-admin2,206 ▲295.56 ▼0.1187.24 ▼8.1238.50 ▼3.77
Posts /wp-admin/edit.php2,111 ▲112.03 ▲0.0334.14 ▼5.3734.13 ▼6.87
Add New Post /wp-admin/post-new.php1,533 ▲723.69 ▲0.15682.18 ▼4.1456.94 ▲2.40
Media Library /wp-admin/upload.php1,405 ▲54.21 ▲0.0697.87 ▼22.4947.60 ▼1.09
.htaccess Site Access Control /wp-admin/options-general.php?page=wpsos-site-access-control8752.0123.4728.53

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/htaccess-site-access-control/settings-page.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/htaccess-site-access-control/settings-page.php:39

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 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can take inspiration from this readme.txt

htaccess-site-access-control/htaccess-site-access-control.php Passed 13 tests

This is the main PHP file of ".htaccess Site Access Control" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
89 characters long description:
This plugin lets you password protect your login page, admin page, and/or the whole site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin634 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP463185533
CSS113079
JavaScript12022

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity84.00
▷ Minimum class complexity84.00
▷ Maximum class complexity84.00
Average method complexity5.88
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected