78% just-responsive-images

Code Review | Just Responsive Images

WordPress plugin Just Responsive Images scored78%from 54 tests.

About plugin

  • Plugin page: just-responsive-i...
  • Plugin version: 1.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8
  • WordPress version: 6.3.1
  • First release: Mar 6, 2017
  • Latest release: Sep 6, 2021
  • Number of updates: 43
  • Update frequency: every 38.2 days
  • Top authors: aprokopenko (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

800+ active /12,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.62ms] Passed 4 tests

Analyzing server-side resources used by Just Responsive Images
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1045.14 ▲2.10
Dashboard /wp-admin3.41 ▲0.1049.28 ▼0.45
Posts /wp-admin/edit.php3.52 ▲0.1652.63 ▲2.67
Add New Post /wp-admin/post-new.php5.99 ▲0.1087.93 ▼10.80
Media Library /wp-admin/upload.php3.33 ▲0.1042.06 ▲4.35
Uploads Cleanup /wp-admin/tools.php?page=jri_cleanup3.2941.52

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
just_responsive_images_version
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Just Responsive Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.74 ▲0.021.71 ▼0.4646.88 ▲2.67
Dashboard /wp-admin2,199 ▲225.61 ▼0.0189.89 ▲2.4337.33 ▼2.84
Posts /wp-admin/edit.php2,101 ▲11.97 ▼0.0339.54 ▼1.2736.59 ▲0.01
Add New Post /wp-admin/post-new.php1,538 ▲1023.24 ▲0.14688.99 ▲54.2660.97 ▲4.23
Media Library /wp-admin/upload.php1,407 ▲44.14 ▼0.02110.10 ▲7.9748.99 ▲2.56
Uploads Cleanup /wp-admin/tools.php?page=jri_cleanup7992.0127.9826.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • just_responsive_images_version
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/just-responsive-images/views/media/meta-box.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/just-responsive-images/just-responsive-images.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/just-responsive-images/views/cleanup/index.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'jri\\core\\Controller' not found in wp-content/plugins/just-responsive-images/components/UploadsCleanup.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'jri\\core\\Controller' not found in wp-content/plugins/just-responsive-images/components/MediaMetaInfo.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Responsive image sizes declaration/config.), #2 (Template basic usage example.), #3 (Generated HTML.)
  • Requires php: Version format is invalid
The official readme.txt might help

just-responsive-images/just-responsive-images.php 92% from 13 tests

This is the main PHP file of "Just Responsive Images" version 1.6.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 190 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,539 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP192907521,243
Markdown1920296

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity18.67
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods59
▷ Static methods58.47%
▷ Public methods4677.97%
▷ Protected methods1322.03%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.35MB with 0.27MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png143.29KB23.69KB▼ 83.47%
screenshot-2.png47.70KB14.39KB▼ 69.83%
screenshot-1.png164.50KB38.72KB▼ 76.46%