73% wzbaibaoxiang

Code Review | 网站百宝箱

WordPress plugin 网站百宝箱 scored73%from 54 tests.

About plugin

  • Plugin page: wzbaibaoxiang
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: Dec 26, 2020
  • Latest release: Aug 15, 2023
  • Number of updates: 30
  • Update frequency: every 32.1 days
  • Top authors: kelerkgibo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /6,777 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.18MB] [CPU: ▼0.49ms] Passed 4 tests

A check of server-side resources used by 网站百宝箱
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4741.25 ▲2.16
Dashboard /wp-admin3.47 ▲0.1644.66 ▲0.05
Posts /wp-admin/edit.php3.58 ▲0.2346.09 ▲1.58
Add New Post /wp-admin/post-new.php6.05 ▲0.1681.68 ▼5.76
Media Library /wp-admin/upload.php3.39 ▲0.1636.40 ▲2.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 226 new files
Database: 1 new table, 7 new options
New tables
wp_websitebox_liuyan
New WordPress options
widget_recent-posts
websitebox_tongji
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for 网站百宝箱
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,890 ▲12913.36 ▼1.008.14 ▲6.4241.40 ▼1.29
Dashboard /wp-admin2,208 ▲285.53 ▼0.1484.39 ▼3.6740.52 ▼0.10
Posts /wp-admin/edit.php2,116 ▲161.96 ▼0.0533.48 ▼3.2539.01 ▲2.29
Add New Post /wp-admin/post-new.php1,539 ▲1123.63 ▲0.39588.70 ▼10.6665.56 ▲11.29
Media Library /wp-admin/upload.php1,416 ▲164.19 ▲0.0394.71 ▼5.0345.56 ▲3.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_websitebox_liuyan
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • websitebox_tongji
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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
Good news, no errors were detected

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
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wzbaibaoxiang/websitebox.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/back.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/sanhheyi.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function websitebox_paymoney() in wp-content/plugins/wzbaibaoxiang/head.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/shuiyin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/tankuang.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/shubiaotexiao.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wzbaibaoxiang/inc/websitebox_art_cron.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/shoujikefu.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wzbaibaoxiang/liuyan.php:6

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: wp

wzbaibaoxiang/websitebox.php 85% from 13 tests

The primary PHP file in "网站百宝箱" version 0.1.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 210 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wzbaibaoxiang.php" instead of "websitebox.php")

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
Success! There were no dangerous files found in this plugin63,333 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript38543040,376
CSS112,7073211,002
PHP21487788,777
SVG335632,954
JSON100224

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 351)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity112.80
▷ Minimum class complexity18.00
▷ Maximum class complexity351.00
Average method complexity18.47
▷ Minimum method complexity1.00
▷ Maximum method complexity351.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
54 PNG files occupy 1.58MB with 0.52MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/side_icon02.png0.82KB0.82KB0.00%
images/huaban.png4.01KB4.01KB0.10%
images/bei3.png111.10KB61.24KB▼ 44.88%
images/bei2.png16.25KB6.25KB▼ 61.56%
images/leixing3.png5.95KB2.48KB▼ 58.27%