83% password-generator

Code Review | Password Generator

WordPress plugin Password Generator scored83%from 54 tests.

About plugin

  • Plugin page: password-generator
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Aug 27, 2011
  • Latest release: Sep 1, 2022
  • Number of updates: 34
  • Update frequency: every 118.4 days
  • Top authors: outerbridge (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,662 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Password Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.30 ▼0.89
Dashboard /wp-admin3.34 ▲0.0453.76 ▼3.22
Posts /wp-admin/edit.php3.39 ▲0.0450.47 ▼4.12
Add New Post /wp-admin/post-new.php5.92 ▲0.0493.20 ▼11.54
Media Library /wp-admin/upload.php3.26 ▲0.0443.04 ▲5.43

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 8 new options
New WordPress options
obr_password_generator
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_obr_pass_gen
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Password Generator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8114.76 ▲0.281.97 ▲0.0840.76 ▲2.50
Dashboard /wp-admin2,206 ▲184.88 ▼0.93108.56 ▲7.6242.38 ▼0.39
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0034.93 ▼4.4132.58 ▼1.25
Add New Post /wp-admin/post-new.php1,533 ▲523.02 ▼0.19660.21 ▼15.2352.49 ▼0.84
Media Library /wp-admin/upload.php1,388 ▼34.21 ▲0.1197.40 ▼15.6941.94 ▼9.22

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_obr_pass_gen
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/password-generator/outerbridge-password-generator.php:29

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 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (screenshot1.png shows the Widget on a WordPress site before a password is generated.), #2 (screenshot2.png shows the Widget after a password has been generated.)
You can take inspiration from this readme.txt

password-generator/outerbridge-password-generator.php 85% from 13 tests

Analyzing the main PHP file in "Password Generator" version 1.7
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 ("password-generator.php" instead of "outerbridge-password-generator.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin156 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11430156

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.72MB with 0.45MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png365.74KB139.45KB▼ 61.87%
screenshot-2.png372.31KB140.71KB▼ 62.21%