57% imagerecycle-pdf-image-compression

Code Review | ImageRecycle pdf & image compression

WordPress plugin ImageRecycle pdf & image compression scored57%from 54 tests.

About plugin

  • Plugin page: imagerecycle-pdf-...
  • Plugin version: 3.1.13
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.4
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Dec 1, 2023
  • Number of updates: 134
  • Update frequency: every 22.9 days
  • Top authors: ImageRecycle (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

2,000+ active /71,349 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.65MB] [CPU: ▲2.79ms] Passed 4 tests

An overview of server-side resources used by ImageRecycle pdf & image compression
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6639.96 ▼3.25
Dashboard /wp-admin4.00 ▲0.7053.42 ▲5.95
Posts /wp-admin/edit.php4.05 ▲0.6956.03 ▲1.90
Add New Post /wp-admin/post-new.php6.52 ▲0.6389.67 ▲6.56
Media Library /wp-admin/upload.php3.86 ▲0.6340.96 ▲10.18
Folder tree /wp-admin/admin.php?page=wpir-foldertree3.8337.43
ImageRecycle /wp-admin/options-general.php?page=option-image-recycle3.8941.04
ImageRecycle /wp-admin/upload.php?page=wp-image-recycle-page3.8442.03

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 68 new files
Database: 3 new tables, 11 new options
New tables
wp_wpio_queue
wp_wpio_images
wp_wpio_listimages
New WordPress options
wpio_ao_lastRun
widget_recent-comments
wpio_db_version
wpio_irfeedback_version
widget_recent-posts
wpio_indexation_auto
wpio_irreview_installation_time
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for ImageRecycle pdf & image compression
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12014.36 ▼0.351.65 ▼0.1338.77 ▼6.53
Dashboard /wp-admin2,287 ▲1105.67 ▲0.0391.35 ▼6.6542.12 ▼1.12
Posts /wp-admin/edit.php2,110 ▲101.96 ▼0.0538.56 ▲1.6635.06 ▼2.62
Add New Post /wp-admin/post-new.php1,537 ▲1123.26 ▲0.45591.92 ▼50.2555.23 ▲7.40
Media Library /wp-admin/upload.php1,409 ▲64.24 ▲0.0696.29 ▼6.4141.56 ▼5.92
Folder tree /wp-admin/admin.php?page=wpir-foldertree7832.0124.3022.73
ImageRecycle /wp-admin/options-general.php?page=option-image-recycle1,2222.1736.6958.11
ImageRecycle /wp-admin/upload.php?page=wp-image-recycle-page8692.1027.3732.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpImageRecycle::uninstall() should not be called statically
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_wpio_images
    • wp_wpio_listimages
    • wp_wpio_queue
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • wpio_indexation_auto
    • wpio_irfeedback_version
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • wpio_db_version
    • wpio_ao_lastRun

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 8× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/wpio-queue.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/ioa.class.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/wpio-table.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/pages/wpio-dashboard.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/class-image-otimizer.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/wpio-setting.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/wp-image-recycle.php
    • > /wp-content/plugins/imagerecycle-pdf-image-compression/class/wpio-helper.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > queue count
      0
    • > auto_optimize is complete

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots lack descriptions #2, #3, #4, #5, #6 in imagerecycle-pdf-image-compression/assets to your readme.txt
  • Tags: Too many tags (21 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

imagerecycle-pdf-image-compression/wp-image-recycle.php 77% from 13 tests

The entry point to "ImageRecycle pdf & image compression" version 3.1.13 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("imagerecycle-pdf-image-compression.php" instead of "wp-image-recycle.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 162 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin6,554 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP126205704,007
JavaScript101601141,080
CSS51661071,079
PO File2174158388

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 137)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity61.10
▷ Minimum class complexity2.00
▷ Maximum class complexity231.00
Average method complexity5.28
▷ Minimum method complexity1.00
▷ Maximum method complexity137.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods141
▷ Static methods2819.86%
▷ Public methods13293.62%
▷ Protected methods85.67%
▷ Private methods10.71%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
27 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/jao/file.png0.29KB0.34KB0.00%
images/jao/linux.png0.65KB0.65KB0.00%
images/jao/xls.png0.65KB0.63KB▼ 2.41%
images/jao/html.png0.72KB0.75KB0.00%
images/jao/drive.png0.34KB0.57KB0.00%