84% wp-similar-basic-auth

Code Review | WP Similar Basic Auth

WordPress plugin WP Similar Basic Auth scored84%from 54 tests.

About plugin

  • Plugin page: wp-similar-basic-...
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Jan 7, 2020
  • Latest release: May 29, 2021
  • Number of updates: 9
  • Update frequency: every 56.6 days
  • Top authors: 256hax (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,670 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.29MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by WP Similar Basic Auth
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2938.06 ▼2.23
Dashboard /wp-admin3.64 ▲0.3346.06 ▼15.12
Posts /wp-admin/edit.php3.69 ▲0.3351.31 ▼1.84
Add New Post /wp-admin/post-new.php6.16 ▲0.2794.83 ▼1.77
Media Library /wp-admin/upload.php3.50 ▲0.2747.02 ▲13.13
WP Similar Basic Auth /wp-admin/options-general.php?page=hax-wsba-submenu3.4832.73

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 54 new files
Database: no new tables, 10 new options
New WordPress options
hax_wsba_user_name
widget_theysaidso_widget
db_upgraded
hax_wsba_password
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
hax_wsba_message
widget_recent-comments
hax_wsba_title

Browser metrics Passed 4 tests

An overview of browser requirements for WP Similar Basic Auth
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.19 ▼1.191.52 ▼0.5442.65 ▼4.48
Dashboard /wp-admin2,210 ▲224.82 ▼1.21107.36 ▼9.4740.31 ▼5.97
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0240.20 ▲2.6736.49 ▲4.32
Add New Post /wp-admin/post-new.php1,517 ▼317.77 ▼5.34670.71 ▲1.9558.65 ▼0.28
Media Library /wp-admin/upload.php1,389 ▲44.21 ▼0.0395.66 ▼8.0942.17 ▲0.34
WP Similar Basic Auth /wp-admin/options-general.php?page=hax-wsba-submenu8672.0624.7325.05

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'naming_text_domain' of non-object in wp-content/plugins/wp-similar-basic-auth/includes/admin/admin-plugins-page.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-similar-basic-auth/includes/admin/views/html-admin-options-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-similar-basic-auth/wsba-config.php:21
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_error_message() on null in wp-content/plugins/wp-similar-basic-auth/includes/public/views/html-login-page.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-similar-basic-auth/wp-similar-basic-auth.php:78
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Error' not found in wp-content/plugins/wp-similar-basic-auth/includes/public/login-page.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-similar-basic-auth/includes/admin/admin-options-page.php:17
    • > PHP Notice
      Trying to get property 'naming_text_domain' of non-object in wp-content/plugins/wp-similar-basic-auth/includes/admin/admin-plugins-page.php on line 13
    • > PHP Notice
      Trying to get property 'errors' of non-object in wp-content/plugins/wp-similar-basic-auth/includes/public/views/html-login-page.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-similar-basic-auth/includes/admin/admin-plugins-page.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("none")
The official readme.txt is a good inspiration

wp-similar-basic-auth/wp-similar-basic-auth.php Passed 13 tests

The principal PHP file in "WP Similar Basic Auth" v. 0.1.1 is loaded by WordPress automatically on each request
69 characters long description:
Protect WordPress admin page on similar Basic Auth without .htaccess.

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 plugin4,415 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP443869103,166
Markdown118201,150
PO File1182951
CSS15025
JavaScript242823

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity28.78
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods109
▷ Static methods43.67%
▷ Public methods5954.13%
▷ Protected methods5045.87%
▷ Private methods00.00%
Functions13
▷ Named functions1076.92%
▷ Anonymous functions323.08%
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
No PNG images were found in this plugin