78% imageflux

Code Review | ImageFlux - Optimize images & Convert WebP with CDN

WordPress plugin ImageFlux - Optimize images & Convert WebP with CDN scored78%from 54 tests.

About plugin

  • Plugin page: imageflux
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0
  • WordPress version: 6.3.1
  • First release: Dec 13, 2021
  • Latest release: May 19, 2022
  • Number of updates: 9
  • Update frequency: every 19.6 days
  • Top authors: imageflux (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,414 total downloads

Benchmarks

Plugin footprint 82% from 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.15MB] [CPU: ▼7.37ms] 75% from 4 tests

A check of server-side resources used by ImageFlux - Optimize images & Convert WebP with CDN
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,249.55ms on /wp-admin/admin.php?page=image-flux-list)
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1539.69 ▲2.63
Dashboard /wp-admin3.47 ▲0.1243.45 ▼14.54
Posts /wp-admin/edit.php3.58 ▲0.2343.78 ▼4.07
Add New Post /wp-admin/post-new.php6.05 ▲0.1683.38 ▼13.49
Media Library /wp-admin/upload.php3.39 ▲0.1635.82 ▲3.78
画像変換・配信設定 /wp-admin/admin.php?page=image-flux-diff3.3832.87
ダッシュボード /wp-admin/admin.php?page=image-flux-token3.381,316.65
ImageFlux /wp-admin/admin.php?page=image-flux-top3.3632.57
オリジン設定 /wp-admin/admin.php?page=image-flux-list3.381,249.55

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by ImageFlux - Optimize images & Convert WebP with CDN
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.35 ▼0.241.76 ▲0.1839.83 ▲0.55
Dashboard /wp-admin2,235 ▲675.54 ▲0.0181.10 ▼4.9895.23 ▲52.14
Posts /wp-admin/edit.php2,134 ▲342.00 ▲0.0636.29 ▲1.2637.66 ▼1.13
Add New Post /wp-admin/post-new.php1,709 ▲18321.06 ▼2.09741.61 ▲82.3346.87 ▼15.83
Media Library /wp-admin/upload.php1,437 ▲374.20 ▲0.0395.78 ▲3.0569.93 ▲29.78
画像変換・配信設定 /wp-admin/admin.php?page=image-flux-diff1,0061.9923.5076.90
ダッシュボード /wp-admin/admin.php?page=image-flux-token8583.2372.4153.99
ImageFlux /wp-admin/admin.php?page=image-flux-top8732.0124.5543.23
オリジン設定 /wp-admin/admin.php?page=image-flux-list8692.1823.6749.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=image-flux-token
    • > Notice in wp-content/plugins/imageflux/templates/dashboard.php+76
    Undefined variable: graph_month
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=image-flux-token
    • > Notice in wp-content/plugins/imageflux/templates/dashboard.php+76
    Undefined index:
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=image-flux-token
    • > Notice in wp-content/plugins/imageflux/templates/dashboard.php+76
    Trying to access array offset on value of type null

SRP 50% 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
Please fix the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imageflux/templates/token-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imageflux/templates/diff-settings.php:9
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/imageflux/templates/dashboard.php on line 26
    • > PHP Warning
      array_reverse() expects parameter 1 to be array, null given in wp-content/plugins/imageflux/templates/dashboard.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imageflux/templates/basic-settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/imageflux/templates/origin-list.php:10
    • > PHP Notice
      Undefined variable: transfer_view_datas in wp-content/plugins/imageflux/templates/dashboard.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/imageflux/templates/basic-update-settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/imageflux/templates/dashboard.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/imageflux/imageflux.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: optimize images, cdn, images, image optimization, convert webp...

imageflux/imageflux.php Passed 13 tests

The main PHP script in "ImageFlux - Optimize images & Convert WebP with CDN" version 1.0.2 is automatically included on every request by WordPress
99 characters long description:
WordPressサイトの画像を一括で最適化・軽量化し、CDNを通して配信します。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,439 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP143212601,427
CSS12010
JavaScript10112

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.44
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods46
▷ Static methods1532.61%
▷ Public methods4393.48%
▷ Protected methods00.00%
▷ Private methods36.52%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants00.00%
▷ Class constants18100.00%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin