62% jiutu-qingdong

Code Review | WP商城系统 - 情动

WordPress plugin WP商城系统 - 情动 scored62%from 54 tests.

About plugin

  • Plugin page: jiutu-qingdong
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.1-6.0
  • WordPress version: 6.3.1
  • First release: Sep 10, 2019
  • Latest release: Jul 6, 2022
  • Number of updates: 39
  • Update frequency: every 26.4 days
  • Top authors: jiutu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,451 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.25MB] [CPU: ▼15.30ms] Passed 4 tests

An overview of server-side resources used by WP商城系统 - 情动
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4541.86 ▲3.32
Dashboard /wp-admin3.76 ▲0.4250.90 ▼13.84
Posts /wp-admin/edit.php3.81 ▲0.4655.14 ▲3.94
Add New Post /wp-admin/post-new.php3.57 ▼2.3149.50 ▼53.27
Media Library /wp-admin/upload.php3.69 ▲0.4637.68 ▲2.61
Dashboard /wp-admin/plugins.php?page=meta-box3.6237.05
商品管理 /wp-admin/edit.php?post_type=products3.7358.14
订单管理 /wp-admin/edit.php?post_type=orders3.7342.10

Server storage [IO: ▲6.56MB] [DB: ▲0.12MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 537 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
qd_admin
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP商城系统 - 情动
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14014.28 ▲0.011.71 ▲0.0041.24 ▲0.63
Dashboard /wp-admin2,298 ▲1215.62 ▼0.1392.14 ▼2.9754.09 ▲11.97
Posts /wp-admin/edit.php2,177 ▲771.99 ▼0.0040.23 ▲0.4348.79 ▲8.92
Add New Post /wp-admin/post-new.php6,400 ▲4,86326.26 ▲8.00885.32 ▲217.18105.16 ▲35.16
Media Library /wp-admin/upload.php1,486 ▲894.17 ▼0.11104.28 ▲2.2152.92 ▲7.09
Dashboard /wp-admin/plugins.php?page=meta-box1,7969.30289.4170.12
商品管理 /wp-admin/edit.php?post_type=products1,1751.9730.8754.76
常见问题/介绍 /wp-admin/admin.php?page=qd_admin#tab=%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98-%e4%bb%8b%e7%bb%8d1,4163.6154.6993.71
常规设置 /wp-admin/admin.php?page=qd_admin#tab=%e5%b8%b8%e8%a7%84%e8%ae%be%e7%bd%ae1,4323.3950.8669.98
支付设置 /wp-admin/admin.php?page=qd_admin#tab=%e6%94%af%e4%bb%98%e8%ae%be%e7%bd%ae1,4443.5757.3072.42
订单管理 /wp-admin/edit.php?post_type=orders1,1211.9029.0345.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.12MB] 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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • qd_admin
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/plugins.php?page=meta-box
    • > Warning in wp-includes/functions.php+6691
    file_get_contents(wp-content/plugins/jiutu-qingdong/meta-box.php): failed to open stream: No such file or directory

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
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/jiutu-qingdong/inc/templates/upload.php
    • > /wp-content/plugins/jiutu-qingdong/inc/templates/media.php
    • > /wp-content/plugins/jiutu-qingdong/inc/templates/audio.php
    • > /wp-content/plugins/jiutu-qingdong/inc/templates/video.php
    • > /wp-content/plugins/jiutu-qingdong/inc/templates/image-advanced.php
  • 66× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Multiple_Values_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/text-list.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_List_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/radio.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/jiutu-qingdong/inc/about/sections/upgrade.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/fieldset-text.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/file.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/custom-html.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Object_Choice_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/taxonomy.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/image-select.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Taxonomy_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/taxonomy-advanced.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/jiutu-qingdong/inc/fields/heading.php:11

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (商城页面), #2 (产品详情页), #3 (详情), #4 (详情)
You can take inspiration from this readme.txt

jiutu-qingdong/qingdong.php 92% from 13 tests

"WP商城系统 - 情动" version 1.0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("jiutu-qingdong.php" instead of "qingdong.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .as - Adobe Flash ActionScript File in Adobe Flash
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/htmlelements/AudioElement.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/htmlelements/DailyMotionElement.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/FlashMediaElement.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/htmlelements/HLSMediaElement.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/HtmlMediaEvent.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/htmlelements/IMediaElement.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/htmlelements/VideoElement.as
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/info/src/flash/htmlelements/YouTubeElement.as
    • .xap - Silverlight Application Package in Microsoft Silverlight
      • wp-content/plugins/jiutu-qingdong/static/external/player/johndyer-mediaelement-89793bc/build/silverlightmediaelement.xap
65,000 lines of code in 450 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1787,2966,08931,786
CSS532,08751514,608
PHP1592,7774,95912,313
ActionScript85312492,176
HTML25438321,365
Markdown735301,309
C#314293504
PO File1161177334
XAML2201263
MSBuild script1010119
Sass112087
JSON20047
XML20038
SVG61035
Bourne Shell12118
Ruby1208

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity13.12
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes135
▷ Abstract classes85.93%
▷ Concrete classes12794.07%
▷ Final classes00.00%
Methods629
▷ Static methods31149.44%
▷ Public methods57591.41%
▷ Protected methods335.25%
▷ Private methods213.34%
Functions56
▷ Named functions3766.07%
▷ Anonymous functions1933.93%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
39 PNG files occupy 1.42MB with 0.60MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
static/external/player/johndyer-mediaelement-89793bc/info/src/css/controls-wmp.png5.38KB3.02KB▼ 43.93%
static/external/player/johndyer-mediaelement-89793bc/info/src/css/controls.fw.png78.86KB1.98KB▼ 97.48%
screenshot-2.png532.31KB162.40KB▼ 69.49%
inc/about/images/online-generator.png12.95KB13.04KB0.00%