78% my-htpasswd-generator-widget

Code Review | My.htpasswd Generator Widget

WordPress plugin My.htpasswd Generator Widget scored 78% from 54 tests.

About plugin

  • Plugin page: my-htpasswd-gener...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.6
  • WordPress version: 6.3.1
  • First release: May 23, 2017
  • Latest release: May 23, 2017
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: vishnu.jn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 649 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.50ms] Passed 4 tests

Analyzing server-side resources used by My.htpasswd Generator Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.20 ▼0.60
Dashboard /wp-admin3.32 ▲0.0245.41 ▼3.36
Posts /wp-admin/edit.php3.37 ▲0.0249.36 ▲2.56
Add New Post /wp-admin/post-new.php5.90 ▲0.0282.87 ▼5.32
Media Library /wp-admin/upload.php3.25 ▲0.0233.56 ▼0.72

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_htaccess-widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by My.htpasswd Generator Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6613.29 ▼1.002.38 ▲0.2844.37 ▼1.90
Dashboard /wp-admin2,225 ▲374.85 ▼1.05108.18 ▼6.6638.28 ▼5.36
Posts /wp-admin/edit.php2,105 ▲162.01 ▼0.0339.17 ▲3.1035.49 ▲0.25
Add New Post /wp-admin/post-new.php1,547 ▲3323.35 ▲5.71643.11 ▼11.6770.15 ▲11.78
Media Library /wp-admin/upload.php1,404 ▲224.20 ▲0.0293.58 ▼2.8541.71 ▼3.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_htaccess-widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/my-htpasswd-generator-widget/htpasswd-file-creator.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/my-htpasswd-generator-widget/inc/classes/htpasswd-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Please fix the following attributes: The official readme.txt is a good inspiration

my-htpasswd-generator-widget/htpasswd-file-creator.php 85% from 13 tests

"My.htpasswd Generator Widget" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("my-htpasswd-generator-widget.php" instead of "htpasswd-file-creator.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin8,066 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS197077,904
PHP33332145
JavaScript10017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin