83% responsive-image

Code Review | Responsive Image

WordPress plugin Responsive Image scored83%from 54 tests.

About plugin

  • Plugin page: responsive-image
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3+
  • WordPress version: 6.3.1
  • First release: Oct 25, 2017
  • Latest release: Nov 9, 2017
  • Number of updates: 5
  • Update frequency: every 3.0 days
  • Top authors: hashsalacop (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.73ms] Passed 4 tests

An overview of server-side resources used by Responsive Image
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.26 ▲2.51
Dashboard /wp-admin3.31 ▲0.0145.09 ▲0.19
Posts /wp-admin/edit.php3.36 ▲0.0044.99 ▼2.10
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.92 ▼1.32
Media Library /wp-admin/upload.php3.24 ▲0.0034.81 ▲0.33

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Responsive Image
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.19 ▼1.182.22 ▲0.3141.97 ▼2.45
Dashboard /wp-admin2,209 ▲215.83 ▼0.06111.78 ▼0.9642.76 ▼0.84
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0334.54 ▼5.7331.67 ▼4.25
Add New Post /wp-admin/post-new.php1,533 ▲1423.42 ▲0.31682.15 ▲42.1061.29 ▲13.66
Media Library /wp-admin/upload.php1,385 ▲34.14 ▼0.09101.63 ▲1.3940.18 ▼3.29

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

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

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/responsive-image/responisve-image.php:18

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 on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Please describe screenshot #2 in responsive-image/assets to your readme.txt
  • Tested up to: Version format is invalid
You can take inspiration from this readme.txt

responsive-image/responisve-image.php 77% from 13 tests

Analyzing the main PHP file in "Responsive Image" version 1.0.0
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("responsive-image.php" instead of "responisve-image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected18 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP131114
CSS1004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.65MB with 0.35MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png555.63KB221.83KB▼ 60.08%
screenshot-1.png109.87KB57.20KB▼ 47.94%