88% riu-responsive-image-uploader

Code Review | RIU - Responsive Image Uploader

WordPress plugin RIU - Responsive Image Uploader scored 88% from 54 tests.

About plugin

  • Plugin page: riu-responsive-im...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.0-3.4
  • WordPress version: 5.8.1
  • First release: Aug 1, 2014
  • Latest release: Oct 2, 2014
  • Number of updates: 16
  • Update frequency: every 4.0 days
  • Top authors: brandup (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active / 1,937 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼140.73ms] Passed 4 tests

Server-side resources used by RIU - Responsive Image Uploader
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1840.09 ▲17.72
Dashboard /wp-admin3.12 ▲0.0748.15 ▼0.93
Posts /wp-admin/edit.php3.17 ▲0.0643.17 ▼6.79
Add New Post /wp-admin/post-new.php5.48 ▲0.0496.63 ▼555.29
Media Library /wp-admin/upload.php3.06 ▲0.0634.33 ▲0.11

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for RIU - Responsive Image Uploader
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,717 ▲12215.91 ▼0.068.85 ▲0.4555.66 ▲10.23
Dashboard /wp-admin2,981 ▲476.03 ▼0.12155.70 ▲0.33117.56 ▲0.53
Posts /wp-admin/edit.php2,753 ▲142.71 ▲0.0371.81 ▼0.5491.50 ▲2.00
Add New Post /wp-admin/post-new.php1,691 ▲818.52 ▼0.04389.43 ▲9.68110.85 ▼11.53
Media Library /wp-admin/upload.php1,817 ▲75.07 ▲0.07152.50 ▲2.85126.82 ▲1.46

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/riu-responsive-image-uploader/src/admin/page/adminMediaEdit.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function riu\\add_action() in wp-content/plugins/riu-responsive-image-uploader/src/Javascripts.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function riu\\add_shortcode() in wp-content/plugins/riu-responsive-image-uploader/src/Shortcode.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function riu\\add_action() in wp-content/plugins/riu-responsive-image-uploader/src/admin/MediaEdit.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function riu\\add_action() in wp-content/plugins/riu-responsive-image-uploader/src/Javascripts.php:33

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: image aspect ratio, focus point, area o focus, image optimizer, responsive image...

riu-responsive-image-uploader/riu.php 92% from 13 tests

The entry point to "RIU - Responsive Image Uploader" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("riu-responsive-image-uploader.php" instead of "riu.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,033 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS22343542
PHP8186166420
JavaScript2241371

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.50
▷ Minimum class complexity8.00
▷ Maximum class complexity9.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
14 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
css/images/ui-icons_ef8c08_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%
css/images/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%