84% wp-basic-authentication

Code Review | WP Basic Authentication

WordPress plugin WP Basic Authentication scored84%from 54 tests.

About plugin

  • Plugin page: wp-basic-authenti...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 18, 2020
  • Latest release: Jan 6, 2023
  • Number of updates: 8
  • Update frequency: every 105.0 days
  • Top authors: nutttaro (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /14,985 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.97ms] Passed 4 tests

Analyzing server-side resources used by WP Basic Authentication
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0145.09 ▼3.17
Dashboard /wp-admin3.35 ▲0.0451.63 ▼3.25
Posts /wp-admin/edit.php3.40 ▲0.0455.69 ▲6.23
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.42 ▼11.02
Media Library /wp-admin/upload.php3.27 ▲0.0437.23 ▼6.45

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Basic Authentication
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲1914.25 ▲0.001.81 ▼0.3542.40 ▲0.19
Dashboard /wp-admin2,211 ▲315.63 ▲0.0687.40 ▼7.6041.46 ▲0.43
Posts /wp-admin/edit.php2,116 ▲162.07 ▲0.0936.84 ▼0.9337.26 ▼2.58
Add New Post /wp-admin/post-new.php1,539 ▲1323.08 ▲0.02691.39 ▼20.8856.21 ▲4.68
Media Library /wp-admin/upload.php1,416 ▲164.29 ▲0.10104.65 ▼1.9148.22 ▲6.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • wpba_auth_settings
    • theysaidso_admin_options

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-basic-authentication/wp-basic-authentication.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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: The official readme.txt is a good inspiration

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

The main file in "WP Basic Authentication" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
81 characters long description:
Basic Authentication for protected your development WordPress site like .htpasswd

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected184 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34367184

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.50
▷ Minimum class complexity3.00
▷ Maximum class complexity12.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin