84% easy-basic-authentication

Code Review | Easy Basic Authentication

WordPress plugin Easy Basic Authentication scored84%from 54 tests.

About plugin

  • Plugin page: easy-basic-authen...
  • Plugin version: 1.5.1
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2023
  • Latest release: Nov 16, 2023
  • Number of updates: 15
  • Update frequency: every 3.2 days
  • Top authors: matteoenna (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /336 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.02MB] [CPU: ▼3.47ms] Passed 4 tests

A check of server-side resources used by Easy Basic Authentication
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.74 ▲0.89
Dashboard /wp-admin3.32 ▲0.0245.82 ▼0.85
Posts /wp-admin/edit.php3.38 ▲0.0248.11 ▼3.08
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.33 ▼10.84
Media Library /wp-admin/upload.php3.25 ▲0.0235.07 ▲2.11

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Basic Authentication
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲4414.70 ▲0.341.83 ▼0.3347.74 ▲5.42
Dashboard /wp-admin2,214 ▲365.58 ▼0.1483.36 ▼27.6238.19 ▼7.07
Posts /wp-admin/edit.php2,116 ▲161.95 ▲0.0139.56 ▼3.7835.44 ▼4.55
Add New Post /wp-admin/post-new.php1,538 ▲1322.82 ▼0.58596.81 ▼34.8948.31 ▼4.28
Media Library /wp-admin/upload.php1,416 ▲134.04 ▼0.1997.37 ▼0.0143.22 ▼1.57

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_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/easy-basic-authentication/template/settings_page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/easy-basic-authentication/template/log_page.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention: You can look at the official readme.txt

easy-basic-authentication/easy-basic-authentication.php Passed 13 tests

The principal PHP file in "Easy Basic Authentication" v. 1.5.1 is loaded by WordPress automatically on each request
65 characters long description:
Enhance WordPress security with Easy Basic Authentication plugin.

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
Everything looks great! No dangerous files found in this plugin376 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP87212376

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity8.25
▷ Minimum class complexity2.00
▷ Maximum class complexity17.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin