62% just-image-optimizer

Code Review | Just Image Optimizer

WordPress plugin Just Image Optimizer scored 62% from 54 tests.

About plugin

  • Plugin page: just-image-optimizer
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.0.1
  • WordPress version: 6.3.1
  • First release: Feb 28, 2018
  • Latest release: Dec 17, 2018
  • Number of updates: 13
  • Update frequency: every 23.3 days
  • Top authors: aprokopenko (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

50+ active / 2,634 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▲2.55ms] Passed 4 tests

Analyzing server-side resources used by Just Image Optimizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1739.76 ▼1.65
Dashboard /wp-admin3.57 ▲0.2649.55 ▲2.27
Posts /wp-admin/edit.php3.62 ▲0.2651.04 ▲5.28
Add New Post /wp-admin/post-new.php6.08 ▲0.2096.59 ▲13.41
Media Library /wp-admin/upload.php3.43 ▲0.2036.93 ▲4.30
Just Image Optimizer /wp-admin/upload.php?page=just-img-opt-dashboard3.9643.13
Settings /wp-admin/admin.php?page=just-img-opt-settings3.4935.19
Just Image Optimizer /wp-admin/admin.php?page=just-img-opt-log3.4434.73
Just Image Optimizer /wp-admin/admin.php?page=just-img-opt-connection3.4033.72

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 49 new files
Database: 3 new tables, 8 new options
New tables
wp_image_optimize_log
wp_image_optimize_log_details
wp_image_optimize
New WordPress options
joi_version
theysaidso_admin_options
recovery_mode_email_last_sent
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Just Image Optimizer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.121.77 ▼0.1941.35 ▼0.96
Dashboard /wp-admin2,210 ▲185.86 ▲0.89105.65 ▲1.0240.56 ▲0.57
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0037.82 ▲4.5135.79 ▲2.46
Add New Post /wp-admin/post-new.php1,541 ▲823.52 ▲0.23602.80 ▼119.3454.15 ▼8.52
Media Library /wp-admin/upload.php1,396 ▲54.26 ▲0.0895.17 ▼7.8040.99 ▼5.00
Just Image Optimizer /wp-admin/upload.php?page=just-img-opt-dashboard1,5542.6030.6030.74
Settings /wp-admin/admin.php?page=just-img-opt-settings1,5142.3027.8526.68
Just Image Optimizer /wp-admin/admin.php?page=just-img-opt-log8452.0325.9725.67
Just Image Optimizer /wp-admin/admin.php?page=just-img-opt-connection8922.0322.5023.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables detected upon uninstall: 3 tables
    • wp_image_optimize_log_details
    • wp_image_optimize_log
    • wp_image_optimize
  • Zombie WordPress options detected upon uninstall: 8 options
    • recovery_mode_email_last_sent
    • joi_version
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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/upload.php?page=just-img-opt-dashboard
    • > Error in wp-content/plugins/just-image-optimizer/views/dashboard/_requirements.php+21
    Uncaught Error: Call to a member function name() on null in wp-content/plugins/just-image-optimizer/views/dashboard/_requirements.php:21
    Stack trace:
    #0 wp-content/plugins/just-image-optimizer/views/dashboard/index.php(11): include()
    #1 wp-content/plugins/just-image-optimizer/core/Component.php(36): include('/var/www/wordpr...')
    #2 wp-content/plugins/just-image-optimizer/controllers/DashboardController.php(71): JustCoded\WP\ImageOptimizer\core\Component->render()
    #3 wp-includes/class-wp-hook.php(310): JustCoded\WP\ImageOptimizer\controllers\DashboardController->actionIndex()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/upload.php(10): require_once('/var/www/wordpr...')
    #8 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=just-img-opt-settings
    • > Error in wp-content/plugins/just-image-optimizer/views/dashboard/_requirements.php+21
    Uncaught Error: Call to a member function name() on null in wp-content/plugins/just-image-optimizer/views/dashboard/_requirements.php:21
    Stack trace:
    #0 wp-content/plugins/just-image-optimizer/views/dashboard/settings.php(4): include()
    #1 wp-content/plugins/just-image-optimizer/core/Component.php(36): include('/var/www/wordpr...')
    #2 wp-content/plugins/just-image-optimizer/controllers/SettingsController.php(63): JustCoded\WP\ImageOptimizer\core\Component->render()
    #3 wp-includes/class-wp-hook.php(310): JustCoded\WP\ImageOptimizer\controllers\SettingsController->actionIndex()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/just-image-optimizer/views/migrate/index.php
    • > /wp-content/plugins/just-image-optimizer/views/redirect.php
  • 55× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      include(): Failed opening 'JUSTIMAGEOPTIMIZER_ROOT/views/_tabs.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/just-image-optimizer/views/log/index.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'JustCoded\\WP\\ImageOptimizer\\core\\Component' not found in wp-content/plugins/just-image-optimizer/controllers/DashboardController.php:12
    • > PHP Warning
      include(): Failed opening 'JUSTIMAGEOPTIMIZER_ROOT/views/_tabs.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/just-image-optimizer/views/dashboard/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/just-image-optimizer/views/migrate/upgraded.php:6
    • > PHP Warning
      include(JUSTIMAGEOPTIMIZER_ROOT/views/dashboard/_requirements.php): failed to open stream: No such file or directory in wp-content/plugins/just-image-optimizer/views/dashboard/settings.php on line 4
    • > PHP Warning
      include(): Failed opening 'JUSTIMAGEOPTIMIZER_ROOT/views/_tabs.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/just-image-optimizer/views/dashboard/connect.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'JustCoded\\WP\\ImageOptimizer\\core\\Migration' not found in wp-content/plugins/just-image-optimizer/migrations/m0x100.php:10
    • > PHP Notice
      Undefined variable: redirect_url in wp-content/plugins/just-image-optimizer/views/redirect.php on line 1
    • > PHP Warning
      include(JUSTIMAGEOPTIMIZER_ROOT/views/_tabs.php): failed to open stream: No such file or directory in wp-content/plugins/just-image-optimizer/views/log/index.php on line 10
    • > PHP Warning
      include(JUSTIMAGEOPTIMIZER_ROOT/views/_tabs.php): failed to open stream: No such file or directory in wp-content/plugins/just-image-optimizer/views/migrate/upgraded.php on line 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 90% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (Optimization service Connect options.), #2 (Plugin Settings page.), #3 (Plugin Dashboard with optimization statistics.), #4 (Media library optimization info.)
  • Requires php: Version format is invalid
Please take inspiration from this readme.txt

just-image-optimizer/just-image-optimizer.php Passed 13 tests

The entry point to "Just Image Optimizer" version 1.1.3 is a PHP file that has certain tags in its header comment area
128 characters long description:
Compress image files, improve performance and boost your SEO rank using Google Page Speed Insights compression and optimization.

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 plugin2,507 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP404081,0342,348
JavaScript321112
CSS18147

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.08
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes24
▷ Abstract classes14.17%
▷ Concrete classes2395.83%
▷ Final classes00.00%
Methods130
▷ Static methods118.46%
▷ Public methods11991.54%
▷ Protected methods96.92%
▷ Private methods21.54%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants48
▷ Global constants12.08%
▷ Class constants4797.92%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.35MB with 0.26MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png53.80KB14.51KB▼ 73.03%
screenshot-4.png181.63KB49.60KB▼ 72.69%
screenshot-2.png57.70KB15.41KB▼ 73.28%
screenshot-3.png67.63KB17.48KB▼ 74.16%