84% cf-image-resizing

Code Review | Cloudflare Image Resizing - Optimize & Accelerate Your Images

WordPress plugin Cloudflare Image Resizing - Optimize & Accelerate Your Images scored84%from 54 tests.

About plugin

  • Plugin page: cf-image-resizing
  • Plugin version: 1.5.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2022
  • Latest release: Nov 23, 2023
  • Number of updates: 22
  • Update frequency: every 28.4 days
  • Top authors: mecanik (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /2,156 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
Install script ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼2.67ms] Passed 4 tests

Analyzing server-side resources used by Cloudflare Image Resizing - Optimize & Accelerate Your Images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2139.39 ▼0.79
Dashboard /wp-admin3.52 ▲0.2247.16 ▼2.22
Posts /wp-admin/edit.php3.63 ▲0.2848.48 ▼3.68
Add New Post /wp-admin/post-new.php6.10 ▲0.2189.90 ▲3.35
Media Library /wp-admin/upload.php3.44 ▲0.2134.81 ▼3.99
CF Image Resizing /wp-admin/options-general.php?page=cf-image-resizing-settings3.4234.19

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 19 new options
New WordPress options
cf_image_resizing_quality
cf_image_resizing_strip_img_sizes
cf_image_resizing_hook_6
widget_recent-comments
cf_image_resizing_metadata
cf_image_resizing_homedir
cf_image_resizing_format
can_compress_scripts
widget_theysaidso_widget
cf_image_resizing_fit
...

Browser metrics Passed 4 tests

An overview of browser requirements for Cloudflare Image Resizing - Optimize & Accelerate Your Images
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6114.17 ▼0.181.67 ▲0.0640.98 ▼5.62
Dashboard /wp-admin2,222 ▲425.53 ▼0.10102.54 ▲9.9748.96 ▲10.29
Posts /wp-admin/edit.php2,136 ▲362.11 ▲0.1040.67 ▲2.0434.92 ▼4.80
Add New Post /wp-admin/post-new.php1,549 ▲2321.05 ▼2.03604.45 ▼74.2445.23 ▼8.58
Media Library /wp-admin/upload.php1,433 ▲334.31 ▲0.1396.06 ▼12.8444.68 ▼2.95
CF Image Resizing /wp-admin/options-general.php?page=cf-image-resizing-settings9627.61189.9474.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 19 options
    • cf_image_resizing_quality
    • cf_image_resizing_hook_6
    • cf_image_resizing_sitefolder
    • cf_image_resizing_siteurl
    • cf_image_resizing_hook_1
    • cf_image_resizing_metadata
    • cf_image_resizing_format
    • widget_recent-comments
    • can_compress_scripts
    • cf_image_resizing_strip_img_sizes
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=cf-image-resizing-settings
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    Button isDefault prop is deprecated since version 5.4 and will be removed in version 6.2. Please use variant=\"secondary\" instead.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: No descriptions were found for these screenshots #3, #4, #5 in cf-image-resizing/assets to your readme.txt
  • Tags: Too many tags (24 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

cf-image-resizing/cf-image-resizing.php Passed 13 tests

"Cloudflare Image Resizing - Optimize & Accelerate Your Images" version 1.5.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
112 characters long description:
Optimize images on-the-fly using Cloudflare's Image Resizing service, improving performance and core web vitals.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin907 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP2278200902
CSS2043
JavaScript2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity31.50
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods2580.65%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants20
▷ Global constants20100.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
There were not PNG files found in your plugin