10% wp-htpasswd-generator

Code Review | WordPress .htpasswd Generator

WordPress plugin WordPress .htpasswd Generator scored10%from 54 tests.

About plugin

  • Plugin page: wp-htpasswd-gener...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 30, 2016
  • Latest release: Jun 25, 2016
  • Number of updates: 17
  • Update frequency: every 3.5 days
  • Top authors: andreacomo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,296 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-htpasswd-generator/crypt_apr1_md5.php+11
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.87MB] [CPU: ▼53.99ms] Passed 4 tests

This is a short check of server-side resources used by WordPress .htpasswd Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.335.16 ▼35.13
Dashboard /wp-admin2.13 ▼1.187.03 ▼46.94
Posts /wp-admin/edit.php2.13 ▼1.237.84 ▼41.35
Add New Post /wp-admin/post-new.php2.13 ▼3.768.36 ▼92.54
Media Library /wp-admin/upload.php2.13 ▼1.108.04 ▼29.40
Htpasswd Generator /wp-admin/options-general.php?page=htpasswd-generator-options2.137.39

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress .htpasswd Generator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.68 ▲0.331.82 ▼0.1044.90 ▲1.96
Dashboard /wp-admin2,202 ▲255.63 ▲0.0584.84 ▼16.4040.88 ▼2.13
Posts /wp-admin/edit.php2,104 ▲12.03 ▼0.0238.91 ▼3.2237.37 ▼2.11
Add New Post /wp-admin/post-new.php1,531 ▲323.33 ▲0.28655.75 ▼33.2381.48 ▲24.26
Media Library /wp-admin/upload.php1,404 ▲44.15 ▼0.05100.98 ▼8.8848.80 ▲4.81
Htpasswd Generator /wp-admin/options-general.php?page=htpasswd-generator-options8742.0222.2630.65

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-htpasswd-generator/crypt_apr1_md5.php+11
    Array and string offset access syntax with curly braces is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% 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 server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=htpasswd-generator-options
    • > Deprecated in wp-content/plugins/wp-htpasswd-generator/crypt_apr1_md5.php+11
    Array and string offset access syntax with curly braces is deprecated
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=htpasswd-generator-options
    • > Notice in wp-content/plugins/wp-htpasswd-generator/htpasswd-options-ftp.php+49
    Trying to access array offset on value of type bool

SRP 0% 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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-htpasswd-generator/htpasswd-generator.php
    • > /wp-content/plugins/wp-htpasswd-generator/ftp-client.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-htpasswd-generator/htpasswd-options-page.php:64

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (Htpasswd Generator settings page) image not found
Please take inspiration from this readme.txt

wp-htpasswd-generator/htpasswd-generator.php 85% from 13 tests

Analyzing the main PHP file in "WordPress .htpasswd Generator" version 1.1.2
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-htpasswd-generator.php" instead of "htpasswd-generator.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
Good job! No executable or dangerous file extensions detected488 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP99695488

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods45
▷ Static methods920.00%
▷ Public methods3884.44%
▷ Protected methods00.00%
▷ Private methods715.56%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
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
1 compressed PNG file occupies 0.09MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png89.02KB86.57KB▼ 2.75%