84% wp-basic-auth

Code Review | WP BASIC Auth

WordPress plugin WP BASIC Auth scored84%from 54 tests.

About plugin

  • Plugin page: wp-basic-auth
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2013
  • Latest release: Nov 22, 2022
  • Number of updates: 10
  • Update frequency: every 354.6 days
  • Top authors: wokamoto (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

8,000+ active /101,044 total downloads

Benchmarks

Plugin footprint 82% 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.01MB] [CPU: ▼3.84ms] Passed 4 tests

A check of server-side resources used by WP BASIC Auth
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.41 ▼5.08
Dashboard /wp-admin3.31 ▲0.0150.76 ▼2.94
Posts /wp-admin/edit.php3.36 ▲0.0151.28 ▼0.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.66 ▼3.54
Media Library /wp-admin/upload.php3.23 ▲0.0136.19 ▼3.79

Server storage [IO: ▲0.00MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • Illegal file modification found: 1 file (0.69KB) outside of "wp-content/plugins/wp-basic-auth/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

WP BASIC Auth: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.39 ▼0.262.28 ▲0.3242.41 ▼1.16
Dashboard /wp-admin2,192 ▲245.53 ▼0.0883.70 ▼17.2839.51 ▼4.58
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0540.89 ▲0.1835.04 ▼1.27
Add New Post /wp-admin/post-new.php1,545 ▲1923.20 ▲5.75615.25 ▼93.8148.84 ▼1.45
Media Library /wp-admin/upload.php1,403 ▼04.17 ▲0.0198.25 ▼20.2742.97 ▼8.20

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-basic-auth/plugin.php:46

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: auth, basic auth

wp-basic-auth/plugin.php 92% from 13 tests

The main PHP script in "WP BASIC Auth" version 1.1.4 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-basic-auth.php" instead of "plugin.php")

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 plugin75 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1152575

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 code0.52
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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