77% nines-taoke

Code Review | 淘宝客(官方接口)

WordPress plugin 淘宝客(官方接口) scored77%from 54 tests.

About plugin

  • Plugin page: nines-taoke
  • Plugin version: 2.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: Nov 24, 2018
  • Latest release: Jul 2, 2022
  • Number of updates: 69
  • Update frequency: every 19.1 days
  • Top authors: jiutu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /4,060 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.26MB] [CPU: ▲3.59ms] Passed 4 tests

A check of server-side resources used by 淘宝客(官方接口)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.71 ▲1.2453.22 ▲3.90
Dashboard /wp-admin4.61 ▲1.3158.86 ▲8.59
Posts /wp-admin/edit.php4.66 ▲1.3161.76 ▲8.48
Add New Post /wp-admin/post-new.php7.13 ▲1.2493.93 ▼6.62
Media Library /wp-admin/upload.php4.47 ▲1.2451.76 ▲14.54

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for 淘宝客(官方接口)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8514.28 ▼0.071.74 ▲0.1540.20 ▼0.21
Dashboard /wp-admin2,246 ▲665.56 ▼0.0890.68 ▼1.7746.38 ▲0.84
Posts /wp-admin/edit.php2,151 ▲512.01 ▲0.0439.44 ▼2.6745.47 ▲4.00
Add New Post /wp-admin/post-new.php1,566 ▲2923.05 ▲4.59671.42 ▼9.9356.96 ▼18.19
Media Library /wp-admin/upload.php1,454 ▲544.24 ▲0.11103.24 ▼15.4448.10 ▲2.14
商品菜单配置 /wp-admin/admin.php?page=jiutu_tbk#tab=%e5%95%86%e5%93%81%e8%8f%9c%e5%8d%95%e9%85%8d%e7%bd%ae2,3144.2969.0089.43
插件设置 /wp-admin/admin.php?page=jiutu_tbk#tab=%e6%8f%92%e4%bb%b6%e8%ae%be%e7%bd%ae2,3784.0967.14106.21
使用说明 /wp-admin/admin.php?page=jiutu_tbk#tab=%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e2,2993.5556.0365.06

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

Smoke tests 50% 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 no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/test.php
  • 122× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DtkClient' not found in wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/api/GetActivityCatalogue.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/nines-taoke/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'DtkClient' not found in wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/api/GetTopicGoodsList.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'DtkClient' not found in wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/api/GetJdParseUrl.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DtkClient' not found in wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/api/GetGoodsPriceTrend.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/nines-taoke/vendor/psr/container/src/NotFoundExceptionInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'DtkClient' not found in wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/api/GetCarouseList.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'DtkClient' not found in wp-content/plugins/nines-taoke/vendor/dtk-developer/openapi-sdk-php/api/GetJdGoodsDetails.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/nines-taoke/vendor/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php:39
    • > PHP Fatal error
      Uncaught Error: Interface 'Pimple\\ServiceProviderInterface' not found in wp-content/plugins/nines-taoke/vendor/ennnnny/tbk/src/Tbk/Spread/ServiceProvider.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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: Please add images for these screenshots: #1 (前端首页展示截图), #2 (搜索功能展示截图)
The official readme.txt is a good inspiration

nines-taoke/NinesTaoKe.php 85% from 13 tests

The main PHP script in "淘宝客(官方接口)" version 2.8.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Git Repository: Please remove the Git repository from this plugin
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nines-taoke.php" instead of "NinesTaoKe.php")

Code Analysis Passed 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
There were no executable files found in this plugin21,268 lines of code in 241 files:
LanguageFilesBlank linesComment linesLines of code
PHP2173,0154,36112,049
CSS41,268337,323
JavaScript327953
PO File1161177334
JSON700309
Markdown4420146
reStructuredText19613997
YAML17139
XML12016
SVG2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity8.36
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces26
Interfaces4
Traits0
Classes188
▷ Abstract classes21.06%
▷ Concrete classes18698.94%
▷ Final classes21.08%
Methods667
▷ Static methods669.90%
▷ Public methods65798.50%
▷ Protected methods40.60%
▷ Private methods60.90%
Functions110
▷ Named functions3935.45%
▷ Anonymous functions7164.55%
Constants79
▷ Global constants00.00%
▷ Class constants79100.00%
▷ Public constants79100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 2.96MB with 1.66MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png2,466.33KB349.38KB▼ 85.83%
screenshot-2.png563.44KB101.95KB▼ 81.91%
inc/assets/images/checkerboard.png2.29KB2.54KB0.00%