10% password-policy

Code Review | Password-policy

WordPress plugin Password-policy scored10%from 54 tests.

About plugin

  • Plugin page: password-policy
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 28, 2020
  • Latest release: Aug 31, 2023
  • Number of updates: 19
  • Update frequency: every 53.1 days
  • Top authors: kirua93 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,601 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/password-policy/src/class.db.php+24
    Undefined offset: 0

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

This is a short check of server-side resources used by Password-policy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0336.39 ▼1.87
Dashboard /wp-admin3.38 ▲0.0744.11 ▼4.01
Posts /wp-admin/edit.php3.49 ▲0.1343.99 ▼0.81
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.64 ▼8.67
Media Library /wp-admin/upload.php3.30 ▲0.0734.13 ▲1.19
User Lists /wp-admin/admin.php?page=pssp_display_page_user3.2831.20
Password Policy /wp-admin/admin.php?page=password-policy3.2831.06

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Password-policy
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.14 ▼0.481.79 ▲0.3542.01 ▲1.94
Dashboard /wp-admin2,224 ▲475.51 ▼0.1683.03 ▼7.4537.93 ▼4.79
Posts /wp-admin/edit.php2,129 ▲322.03 ▲0.0637.56 ▲0.3635.39 ▲2.93
Add New Post /wp-admin/post-new.php1,561 ▲3318.58 ▼4.56628.97 ▼54.8965.87 ▲14.29
Media Library /wp-admin/upload.php1,429 ▲294.20 ▼0.0899.64 ▼1.2242.22 ▼3.33
User Lists /wp-admin/admin.php?page=pssp_display_page_user9162.0423.6929.08
Password Policy /wp-admin/admin.php?page=password-policy8672.0125.8626.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pssp_display_page_user
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User->id was called with an argument that is deprecated since version 2.1.0! Use WP_User->ID instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/password-policy/password-policy.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/password-policy/src/check_password_policy.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/password-policy/src/views/view_config.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/password-policy/src/admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/password-policy/src/views/view_admin.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: enhance, security, password, policy

password-policy/password-policy.php Passed 13 tests

"Password-policy" version 1.0.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
56 characters long description:
A plugin for enfance the password policy for each users.

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 plugin594 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP710673387
Sass1170105
CSS117194
JavaScript1218

PHP code Passed 2 tests

Analyzing 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.33
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin