72% simple-responsive-images

Code Review | Simple Responsive Images

WordPress plugin Simple Responsive Images scored72%from 54 tests.

About plugin

  • Plugin page: simple-responsive...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 8, 2012
  • Latest release: Mar 6, 2013
  • Number of updates: 10
  • Update frequency: every 39.2 days
  • Top authors: Rahe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /13,742 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.21MB] [CPU: ▼11.25ms] Passed 4 tests

This is a short check of server-side resources used by Simple Responsive Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0645.13 ▲2.19
Dashboard /wp-admin3.37 ▲0.0648.57 ▼2.56
Posts /wp-admin/edit.php3.49 ▲0.1249.51 ▼5.09
Add New Post /wp-admin/post-new.php4.89 ▼1.0164.42 ▼35.67
Media Library /wp-admin/upload.php3.29 ▲0.0636.01 ▼1.67
Reponsive Images /wp-admin/options-general.php?page=sri_optionPage3.2435.58

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
sri_responsive_images
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Responsive Images
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲11613.61 ▼0.7711.13 ▲9.2141.68 ▼5.24
Dashboard /wp-admin2,196 ▲225.60 ▼0.0486.45 ▼15.3137.96 ▼10.91
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0535.66 ▼7.2933.31 ▼7.58
Add New Post /wp-admin/post-new.php1,535 ▲923.32 ▲5.80655.69 ▼64.3548.57 ▼3.32
Media Library /wp-admin/upload.php1,404 ▲74.20 ▼0.0496.77 ▼6.5044.83 ▼0.77
Reponsive Images /wp-admin/options-general.php?page=sri_optionPage1,2312.0424.1329.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

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
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=sri_optionPage
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=sri_optionPage
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-responsive-images/simple-responsive-images.php:30

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=sri_optionPage
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/simple-responsive-images/ressources/js/admin-page.js?ver=1.0.3:10:37)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=sri_optionPage
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (Settings page)
You can take inspiration from this readme.txt

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

The main PHP script in "Simple Responsive Images" version 1.0.3 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin381 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP46750291
JavaScript3162590

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity18.00
▷ Minimum class complexity9.00
▷ Maximum class complexity27.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png48.50KB17.90KB▼ 63.09%