84% imagex

Code Review | ImageX

WordPress plugin ImageX scored84%from 54 tests.

About plugin

  • Plugin page: imagex
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Oct 9, 2020
  • Latest release: Sep 8, 2023
  • Number of updates: 23
  • Update frequency: every 47.0 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /851 total downloads

Benchmarks

Plugin footprint 83% 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.00MB] [CPU: ▼6.52ms] Passed 4 tests

An overview of server-side resources used by ImageX
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.26 ▼3.80
Dashboard /wp-admin3.32 ▼0.0342.39 ▼16.38
Posts /wp-admin/edit.php3.37 ▲0.0147.43 ▲0.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0178.90 ▼6.71
Media Library /wp-admin/upload.php3.24 ▲0.0134.78 ▲0.83
火山引擎ImageX设置 /wp-admin/options-general.php?page=imagex/imagex.php3.2130.24

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 208 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
imagex_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for ImageX
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.17 ▼0.421.53 ▲0.0440.52 ▲1.12
Dashboard /wp-admin2,193 ▲165.48 ▼0.1989.92 ▲0.5046.74 ▲4.15
Posts /wp-admin/edit.php2,104 ▲71.97 ▲0.0241.13 ▲6.8442.13 ▲6.73
Add New Post /wp-admin/post-new.php1,544 ▲923.26 ▲5.31665.18 ▲26.9152.36 ▼18.50
Media Library /wp-admin/upload.php1,404 ▲74.20 ▼0.07106.16 ▲10.0249.12 ▲3.50
火山引擎ImageX设置 /wp-admin/options-general.php?page=imagex/imagex.php1,2012.1621.93117.32

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

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
  • 60× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/imagex/sdk/vendor/guzzlehttp/guzzle/src/Pool.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/imagex/sdk/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/imagex/imagex.php:17
    • > PHP Fatal error
      Trait 'Volc\\Base\\SignatureTrait' not found in wp-content/plugins/imagex/sdk/vendor/volcengine/volc-sdk-php/src/Base/SignatureV4.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Volc\\Base\\V4Curl' not found in wp-content/plugins/imagex/sdk/vendor/volcengine/volc-sdk-php/src/Service/ImageX/ImageX.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/imagex/sdk/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/imagex/sdk/vendor/guzzlehttp/psr7/src/InflateStream.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/imagex/sdk/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:13
    • > PHP Fatal error
      Cannot declare class DivisionByZeroError, because the name is already in use in wp-content/plugins/imagex/sdk/vendor/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php on line 0
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/imagex/sdk/vendor/guzzlehttp/psr7/src/Stream.php:12

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: byteoc, imagex, volcengine

imagex/imagex.php 92% from 13 tests

The primary PHP file in "ImageX" version 1.1.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 150 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected35,773 lines of code in 187 files:
LanguageFilesBlank linesComment linesLines of code
PHP1552,6426,82730,842
Markdown161,19303,545
JSON13001,354
XML10019
Dockerfile18010
Bourne Shell1203

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 179)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity16.61
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces18
Interfaces16
Traits3
Classes99
▷ Abstract classes11.01%
▷ Concrete classes9898.99%
▷ Final classes2525.51%
Methods907
▷ Static methods16818.52%
▷ Public methods73881.37%
▷ Protected methods151.65%
▷ Private methods15416.98%
Functions190
▷ Named functions9248.42%
▷ Anonymous functions9851.58%
Constants167
▷ Global constants4426.35%
▷ Class constants12373.65%
▷ Public constants123100.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
1 PNG file occupies 0.33MB with 0.23MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png339.01KB100.27KB▼ 70.42%