83% kodo-qiniu

Code Review | KODO Qiniu

WordPress plugin KODO Qiniu scored83%from 54 tests.

About plugin

  • Plugin page: kodo-qiniu
  • Plugin version: 1.4.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 27, 2020
  • Latest release: Oct 19, 2023
  • Number of updates: 38
  • Update frequency: every 34.3 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /6,502 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼4.01ms] Passed 4 tests

An overview of server-side resources used by KODO Qiniu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2843.10 ▼5.02
Dashboard /wp-admin3.60 ▲0.3052.85 ▲2.58
Posts /wp-admin/edit.php3.65 ▲0.3047.69 ▼5.58
Add New Post /wp-admin/post-new.php6.12 ▲0.2485.98 ▼8.02
Media Library /wp-admin/upload.php3.46 ▲0.2339.90 ▲5.14
七牛云 KODO /wp-admin/options-general.php?page=kodo-qiniu/qiniu-kodo-wordpress.php3.4336.50

Server storage [IO: ▲0.68MB] [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: 60 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
kodo_options

Browser metrics Passed 4 tests

KODO Qiniu: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.72 ▲0.361.68 ▲0.0144.42 ▼4.81
Dashboard /wp-admin2,193 ▲135.54 ▼0.0885.33 ▼12.8746.20 ▲3.01
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0338.62 ▲1.0341.30 ▲2.17
Add New Post /wp-admin/post-new.php1,531 ▲523.21 ▲0.11652.32 ▼45.6865.39 ▲1.30
Media Library /wp-admin/upload.php1,404 ▲44.24 ▼0.03118.13 ▲14.4255.23 ▲9.08
七牛云 KODO /wp-admin/options-general.php?page=kodo-qiniu/qiniu-kodo-wordpress.php1,1982.1624.7088.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Qiniu\\Enum\\QiniuEnum' not found in wp-content/plugins/kodo-qiniu/sdk/vendor/qiniu/php-sdk/src/Qiniu/Enum/SplitUploadVersion.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Qiniu\\Config' not found in wp-content/plugins/kodo-qiniu/sdk/vendor/qiniu/php-sdk/src/Qiniu/functions.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Qiniu\\Http\\Middleware\\Middleware' not found in wp-content/plugins/kodo-qiniu/sdk/vendor/qiniu/php-sdk/src/Qiniu/Http/Middleware/RetryDomainsMiddleware.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Qiniu\\Region' not found in wp-content/plugins/kodo-qiniu/sdk/vendor/qiniu/php-sdk/src/Qiniu/Zone.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MyCLabs\\Enum\\Enum' not found in wp-content/plugins/kodo-qiniu/sdk/vendor/qiniu/php-sdk/src/Qiniu/Enum/QiniuEnum.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (设置页面), #2 (数据库替换)
You can look at the official readme.txt

kodo-qiniu/qiniu-kodo-wordpress.php 85% from 13 tests

The main file in "KODO Qiniu" v. 1.4.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 144 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("kodo-qiniu.php" instead of "qiniu-kodo-wordpress.php")

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
There were no executable files found in this plugin5,833 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP438642,1365,298
Markdown51240337
JSON400194
Bourne Shell1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity17.06
▷ Minimum class complexity1.00
▷ Maximum class complexity102.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces12
Interfaces1
Traits0
Classes32
▷ Abstract classes39.38%
▷ Concrete classes2990.62%
▷ Final classes1965.52%
Methods306
▷ Static methods8327.12%
▷ Public methods25081.70%
▷ Protected methods20.65%
▷ Private methods5417.65%
Functions47
▷ Named functions4289.36%
▷ Anonymous functions510.64%
Constants18
▷ Global constants316.67%
▷ Class constants1583.33%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.39MB with 0.27MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png61.75KB19.51KB▼ 68.41%
screenshot-1.png333.51KB101.13KB▼ 69.68%