10% wp-drupal-imagecache

Code Review | Thumbnails like in Drupal

WordPress plugin Thumbnails like in Drupal scored10%from 54 tests.

About plugin

  • Plugin page: wp-drupal-imagecache
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Jan 31, 2020
  • Latest release: Jul 3, 2023
  • Number of updates: 12
  • Update frequency: every 104.1 days
  • Top authors: stasionok (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /903 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/wp-drupal-imagecache/controller/class-wpdi-common.php+341
    unlink(/var/lib/php/sessions/sample.png): No such file or directory

Server metrics [RAM: ▲0.40MB] [CPU: ▼6.80ms] Passed 4 tests

Analyzing server-side resources used by Thumbnails like in Drupal
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3938.93 ▲1.64
Dashboard /wp-admin3.73 ▲0.4343.66 ▼2.25
Posts /wp-admin/edit.php3.76 ▲0.4142.04 ▼4.29
Add New Post /wp-admin/post-new.php6.34 ▲0.4571.96 ▼22.29
Media Library /wp-admin/upload.php3.60 ▲0.3735.75 ▲3.38
Thumbnails like in Drupal /wp-admin/options-general.php?page=wp-drupal-imagecache3.6134.59

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 8 new options
New WordPress options
wpdi_sample_image_id
widget_recent-comments
can_compress_scripts
widget_recent-posts
wpdi_presets
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Thumbnails like in Drupal
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.36 ▼0.181.69 ▲0.0842.17 ▼0.26
Dashboard /wp-admin2,201 ▲215.62 ▼0.0190.95 ▲3.2438.30 ▲1.35
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0633.30 ▼3.6333.38 ▼0.75
Add New Post /wp-admin/post-new.php1,531 ▲523.11 ▲0.04663.39 ▼14.0550.06 ▼12.61
Media Library /wp-admin/upload.php1,446 ▲434.34 ▲0.1998.79 ▼3.9741.34 ▼1.30
Thumbnails like in Drupal /wp-admin/options-general.php?page=wp-drupal-imagecache1,2032.0524.4429.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp-drupal-imagecache
    • > Notice in wp-content/plugins/wp-drupal-imagecache/views/settings-page.php+12
    Undefined variable: error
    • > GET request to /wp-admin/options-general.php?page=wp-drupal-imagecache
    • > Notice in wp-content/plugins/wp-drupal-imagecache/views/settings-page.php+13
    Undefined variable: success

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: imagecache, drupal, thumbnail, regenerate, image...

wp-drupal-imagecache/bootstrap.php 92% from 13 tests

This is the main PHP file of "Thumbnails like in Drupal" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-drupal-imagecache.php" instead of "bootstrap.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 detected3,000 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP174036542,488
PO File1143182376
CSS1300136

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity44.00
▷ Minimum class complexity7.00
▷ Maximum class complexity91.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods89
▷ Static methods4449.44%
▷ Public methods8393.26%
▷ Protected methods00.00%
▷ Private methods66.74%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
static/images/sample.png164.17KB79.46KB▼ 51.60%