78% better-passwords

Code Review | Better Passwords

WordPress plugin Better Passwords scored 78% from 54 tests.

About plugin

  • Plugin page: better-passwords
  • Plugin version: 1.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Feb 8, 2019
  • Latest release: May 24, 2022
  • Number of updates: 40
  • Update frequency: every 30.1 days
  • Top authors: bettersecurity (72.5%)riklewis (30%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 7,715 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.08ms] Passed 4 tests

This is a short check of server-side resources used by Better Passwords
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.23 ▼6.62
Dashboard /wp-admin3.36 ▲0.0646.52 ▼4.34
Posts /wp-admin/edit.php3.47 ▲0.1245.52 ▼0.74
Add New Post /wp-admin/post-new.php5.94 ▲0.0682.57 ▼0.61
Media Library /wp-admin/upload.php3.28 ▲0.0634.66 ▲1.53
Better Passwords /wp-admin/options-general.php?page=better-passwords-settings3.2232.01

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Better Passwords
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.22 ▼1.361.72 ▼0.0742.10 ▼8.38
Dashboard /wp-admin2,210 ▲224.86 ▼0.95107.11 ▲1.8839.18 ▼2.70
Posts /wp-admin/edit.php2,093 ▲252.13 ▲0.1139.28 ▲3.4537.02 ▲2.50
Add New Post /wp-admin/post-new.php1,517 ▲317.76 ▲0.17673.91 ▼20.4858.57 ▲6.74
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0196.60 ▼13.3540.69 ▼4.50
Better Passwords /wp-admin/options-general.php?page=better-passwords-settings9012.0625.9039.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-passwords-settings
    • > Notice in wp-content/plugins/better-passwords/better-passwords.php+200
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/better-passwords/better-passwords.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: passwords, better, haveibeenpwned, hibp, pwned...

better-passwords/better-passwords.php 85% from 13 tests

The main PHP file in "Better Passwords" ver. 1.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin228 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24659228

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
header.png10.50KB6.82KB▼ 35.03%
icon-36x36.png1.35KB0.88KB▼ 34.62%