84% canvas-image-resize

Code Review | Canvas Image Resize

WordPress plugin Canvas Image Resize scored84%from 54 tests.

About plugin

  • Plugin page: canvas-image-resize
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.2-6.9
  • WordPress version: 6.3.1
  • First release: Feb 29, 2016
  • Latest release: Mar 18, 2023
  • Number of updates: 36
  • Update frequency: every 71.6 days
  • Top authors: sippsolutions (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

3,000+ active /8,812 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.02MB] [CPU: ▼5.33ms] Passed 4 tests

A check of server-side resources used by Canvas Image Resize
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.69 ▲3.63
Dashboard /wp-admin3.32 ▲0.0246.39 ▼8.10
Posts /wp-admin/edit.php3.38 ▲0.0250.49 ▼0.83
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.50 ▼10.46
Media Library /wp-admin/upload.php3.25 ▲0.0234.92 ▼1.93
Canvas Image Resize /wp-admin/options-general.php?page=canvas-image-resize3.2130.08

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Canvas Image Resize
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.72 ▲0.371.82 ▲0.1345.48 ▲5.42
Dashboard /wp-admin2,196 ▲165.56 ▼0.1187.46 ▼3.1438.56 ▼4.90
Posts /wp-admin/edit.php2,104 ▲11.99 ▼0.1639.05 ▼4.5437.00 ▼1.98
Add New Post /wp-admin/post-new.php1,529 ▼423.54 ▲0.67667.21 ▼3.0266.31 ▲8.54
Media Library /wp-admin/upload.php1,407 ▲104.23 ▲0.1199.05 ▼16.6143.57 ▼3.35
Canvas Image Resize /wp-admin/options-general.php?page=canvas-image-resize8192.0025.5729.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/canvas-image-resize/canvas-image-resize.php:113

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (The settings page.)
Please take inspiration from this readme.txt

canvas-image-resize/canvas-image-resize.php Passed 13 tests

The principal PHP file in "Canvas Image Resize" v. 1.0.1 is loaded by WordPress automatically on each request
63 characters long description:
Re-sizes images right inside the browser BEFORE uploading them.

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
No dangerous file extensions were detected173 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP134159138
PO File181635

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.02
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.06
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1062.50%
▷ Protected methods637.50%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin