78% wpturbo

Code Review | WPTurbo -WordPress性能优化插件

WordPress plugin WPTurbo -WordPress性能优化插件 scored78%from 54 tests.

About plugin

  • Plugin page: wpturbo
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 6, 2022
  • Latest release: Sep 19, 2023
  • Number of updates: 4
  • Update frequency: every 116.5 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,332 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
Installer ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▲2.38ms] Passed 4 tests

A check of server-side resources used by WPTurbo -WordPress性能优化插件
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5746.61 ▲2.40
Dashboard /wp-admin3.86 ▲0.5551.06 ▼0.58
Posts /wp-admin/edit.php3.91 ▲0.5556.78 ▲8.14
Add New Post /wp-admin/post-new.php6.38 ▲0.4992.63 ▲0.85
Media Library /wp-admin/upload.php3.72 ▲0.4841.85 ▲6.85

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 866 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WPTurbo -WordPress性能优化插件
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5214.58 ▲0.021.97 ▲0.2743.28 ▼1.63
Dashboard /wp-admin2,207 ▲305.59 ▼0.0289.87 ▼14.7670.47 ▲24.70
Posts /wp-admin/edit.php2,127 ▲272.00 ▲0.0339.20 ▲3.3434.15 ▼2.67
Add New Post /wp-admin/post-new.php1,551 ▲2022.90 ▼0.24711.94 ▲44.6666.16 ▲7.90
Media Library /wp-admin/upload.php1,424 ▲274.24 ▲0.08100.21 ▼8.6973.12 ▲23.72

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 23× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/BucketWorm.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/Bucket.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/BucketEncryption.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/MultipartUpload.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/BucketTransferAcceleration.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/Signature.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/RunAll.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/BucketLogging.php
    • > /wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/samples/Image.php
    • > /wp-content/plugins/wpturbo/index.php
  • 670× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require(../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wpturbo/vendor/obs/esdk-obs-php/examples/DeleteObjectsSample.php on line 25
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Command\\Guzzle\\ResponseLocation\\AbstractLocation' not found in wp-content/plugins/wpturbo/vendor/guzzlehttp/guzzle-services/src/ResponseLocation/ReasonPhraseLocation.php:11
    • > PHP Warning
      require(wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/getSnapshot.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wpturbo/vendor/guzzlehttp/guzzle-services/tests/ResponseLocation/JsonLocationTest.php:18
    • > PHP Fatal error
      require(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpturbo/vendor/obs/esdk-obs-php/examples/ConcurrentUploadPartSample.php on line 25
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/deleteBucketDomain.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/getBucketWebsite.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wpturbo/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/GetLifecycleResultTest.php:11
    • > PHP Warning
      require(wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/createMediaVideoMontageJobs.php on line 3
    • > PHP Warning
      require(wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wpturbo/vendor/qcloud/cos-sdk-v5/sample/deleteBucketGuetzli.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: optimize, speedup, mysql, oss, cache...

wpturbo/index.php 85% from 13 tests

Analyzing the main PHP file in "WPTurbo -WordPress性能优化插件" version 2.0.1
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wpturbo.php" instead of "index.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 188 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected105,137 lines of code in 829 files:
LanguageFilesBlank linesComment linesLines of code
PHP74810,95621,78197,161
Markdown291,90605,392
JSON18102,052
JavaScript127240240
YAML11373211
XML21032
make29019
Dockerfile18010
HTML1109
Bourne Shell1445
SVG2004
CSS2032

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.81
▷ Minimum class complexity1.00
▷ Maximum class complexity232.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces57
Interfaces37
Traits10
Classes491
▷ Abstract classes122.44%
▷ Concrete classes47997.56%
▷ Final classes275.64%
Methods3,354
▷ Static methods37211.09%
▷ Public methods2,72281.16%
▷ Protected methods2858.50%
▷ Private methods34710.35%
Functions448
▷ Named functions24755.13%
▷ Anonymous functions20144.87%
Constants506
▷ Global constants9017.79%
▷ Class constants41682.21%
▷ Public constants39093.75%

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 compressed PNG file occupies 0.03MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
tpl/assets/img/icons.abf3bf80.png28.97KB28.95KB0.06%