84% image-automatic-height-width

Code Review | Image Automatic Height Width

WordPress plugin Image Automatic Height Width scored84%from 54 tests.

About plugin

  • Plugin page: image-automatic-h...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Jun 9, 2021
  • Latest release: Nov 28, 2021
  • Number of updates: 3
  • Update frequency: every 57.7 days
  • Top authors: nayeem07007 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /2,344 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.30ms] Passed 4 tests

Analyzing server-side resources used by Image Automatic Height Width
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0044.18 ▲4.09
Dashboard /wp-admin3.32 ▲0.0142.24 ▼6.18
Posts /wp-admin/edit.php3.37 ▲0.0146.44 ▼3.10
Add New Post /wp-admin/post-new.php5.90 ▲0.0177.98 ▼12.02
Media Library /wp-admin/upload.php3.24 ▲0.0139.94 ▲7.82

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Image Automatic Height Width
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,003 ▲25714.06 ▼0.577.20 ▲5.5638.02 ▼0.71
Dashboard /wp-admin2,222 ▲314.87 ▼0.02114.24 ▲11.2246.41 ▲3.85
Posts /wp-admin/edit.php2,108 ▲162.01 ▲0.0143.89 ▲1.4836.61 ▲1.67
Add New Post /wp-admin/post-new.php1,549 ▲1323.47 ▲0.24645.95 ▼55.5856.80 ▼3.94
Media Library /wp-admin/upload.php1,407 ▲254.23 ▲0.0493.97 ▼5.2040.69 ▼4.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/image-automatic-height-width/admin/admin.php:139
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/image-automatic-height-width/admin/admin.php:139

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is stored in the /assets directory.), #2 (This is the second screen shot)
The official readme.txt might help

image-automatic-height-width/image-automatic-height-width.php Passed 13 tests

The entry point to "Image Automatic Height Width" version 1.0.1 is a PHP file that has certain tags in its header comment area
56 characters long description:
Fix image elements do not have explicit width and height

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
No dangerous file extensions were detected132 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32552115
JavaScript19117

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin