73% imagepilot

Code Review | ImagePilot - Save Money, Disk Space, and Bandwidth with Image Optimization

WordPress plugin ImagePilot - Save Money, Disk Space, and Bandwidth with Image Optimization scored73%from 54 tests.

About plugin

  • Plugin page: imagepilot
  • Plugin version: 0.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 16, 2023
  • Latest release: Jul 6, 2023
  • Number of updates: 15
  • Update frequency: every 7.5 days
  • Top authors: prasadkirpekar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /296 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲5.04MB] [CPU: ▲23.75ms] 75% from 4 tests

This is a short check of server-side resources used by ImagePilot - Save Money, Disk Space, and Bandwidth with Image Optimization
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.04MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.93 ▲5.4767.89 ▲16.97
Dashboard /wp-admin8.95 ▲5.6479.99 ▲22.39
Posts /wp-admin/edit.php8.95 ▲5.5979.94 ▲23.47
Add New Post /wp-admin/post-new.php9.35 ▲3.47135.68 ▲32.17
Media Library /wp-admin/upload.php8.95 ▲5.7277.37 ▲39.24
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9565.44

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 196 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
fs_accounts
fs_debug_mode
can_compress_scripts
fs_active_plugins
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for ImagePilot - Save Money, Disk Space, and Bandwidth with Image Optimization
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.34 ▼0.391.80 ▲0.0532.12 ▼10.13
Dashboard /wp-admin2,224 ▲475.62 ▼0.0584.57 ▼16.0839.67 ▼3.15
Posts /wp-admin/edit.php2,130 ▲271.98 ▼0.0236.60 ▼2.3634.01 ▲1.11
Add New Post /wp-admin/post-new.php1,550 ▲2220.73 ▼2.33680.57 ▲23.9563.37 ▲13.78
Media Library /wp-admin/upload.php1,429 ▲264.23 ▲0.0197.22 ▼10.0944.34 ▼1.70
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0811.6924.1827.91

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
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/imagepilot/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • fs_accounts
    • fs_debug_mode
    • db_upgraded
    • can_compress_scripts
    • fs_active_plugins
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/imagepilot/imagepilot.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5 in imagepilot/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can take inspiration from this readme.txt

imagepilot/imagepilot.php Passed 13 tests

The main file in "ImagePilot - Save Money, Disk Space, and Bandwidth with Image Optimization" v. 0.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
62 characters long description:
Easy to use plugin to compress images from WordPress dashboard

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin33,901 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1238,03517,24633,256
JavaScript452904380
Markdown1680214
CSS166031
JSON10014
SVG6006

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity86.31
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,278
▷ Static methods19715.41%
▷ Public methods88969.56%
▷ Protected methods171.33%
▷ Private methods37229.11%
Functions101
▷ Named functions10099.01%
▷ Anonymous functions10.99%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%