10% qiniu-speed

Code Review | QiniuSpeed for WordPress

WordPress plugin QiniuSpeed for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: qiniu-speed
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.2
  • WordPress version: 6.3.1
  • First release: Aug 21, 2013
  • Latest release: Aug 24, 2013
  • Number of updates: 8
  • Update frequency: every 0.4 days
  • Top authors: EvilPointer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,019 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+11
    date_default_timezone_set(): Timezone ID '' is invalid

Server metrics [RAM: ▼1.89MB] [CPU: ▼56.70ms] Passed 4 tests

This is a short check of server-side resources used by QiniuSpeed for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.364.71 ▼33.95
Dashboard /wp-admin2.13 ▼1.186.93 ▼46.94
Posts /wp-admin/edit.php2.13 ▼1.236.62 ▼48.79
Add New Post /wp-admin/post-new.php2.13 ▼3.775.91 ▼97.12
Media Library /wp-admin/upload.php2.13 ▼1.114.84 ▼33.36
七牛云存储 /wp-admin/options-general.php?page=QiniuSpeed2.135.56

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

QiniuSpeed for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8814.78 ▲0.422.03 ▲0.3243.44 ▲2.32
Dashboard /wp-admin2,215 ▲385.68 ▲0.0090.28 ▼2.5845.69 ▲6.92
Posts /wp-admin/edit.php2,117 ▲202.19 ▲0.1735.18 ▼0.2340.35 ▲3.19
Add New Post /wp-admin/post-new.php1,534 ▼423.11 ▲0.06641.01 ▼52.9051.50 ▼9.93
Media Library /wp-admin/upload.php1,420 ▲174.39 ▲0.21101.91 ▲0.7146.65 ▼0.59
七牛云存储 /wp-admin/options-general.php?page=QiniuSpeed8982.0724.1770.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+11
    date_default_timezone_set(): Timezone ID '' is invalid
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+11
    date_default_timezone_set(): Timezone ID '' is invalid
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+15
    Undefined index: bucket
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+18
    Undefined index: accesskey
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+19
    Undefined index: secretkey
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+20
    Undefined index: storagepath
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the QiniuSpeed_scripts handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the QiniuSpeed_scripts handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-form handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=QiniuSpeed
    • > Notice in wp-content/plugins/qiniu-speed/QiniuSpeed.php+238
    Undefined variable: value

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/qiniu-speed/InfoFromQiniu.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/qiniu-speed/QiniuSpeed.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 ([1.png Screenshots](http://qiniuspeed.qiniudn.com/1.png)), #2 ([2.png Screenshots](http://qiniuspeed.qiniudn.com/2.png))
You can look at the official readme.txt

qiniu-speed/QiniuSpeed.php 85% from 13 tests

This is the main PHP file of "QiniuSpeed for WordPress" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("qiniu-speed.php" instead of "QiniuSpeed.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 925 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,080 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP122161281,021
JavaScript1102459

PHP code Passed 2 tests

Analyzing 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.20
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions61
▷ Named functions61100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
4 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png46.46KB16.02KB▼ 65.53%
screenshot-1.png6.61KB3.52KB▼ 46.78%
qiniulogo.png4.69KB1.31KB▼ 72.09%
alipaylogo.png2.52KB1.04KB▼ 58.59%