78% wp-user-center

Code Review | WordPress 用户中心

WordPress plugin WordPress 用户中心 scored78%from 54 tests.

About plugin

  • Plugin page: wp-user-center
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.7
  • WordPress version: 6.3.1
  • First release: Jan 1, 2016
  • Latest release: Aug 22, 2018
  • Number of updates: 8
  • Update frequency: every 121.1 days
  • Top authors: smyx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /12,270 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.85ms] Passed 4 tests

This is a short check of server-side resources used by WordPress 用户中心
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.84 ▲3.69
Dashboard /wp-admin3.36 ▲0.0548.71 ▼0.00
Posts /wp-admin/edit.php3.41 ▲0.0555.19 ▲1.48
Add New Post /wp-admin/post-new.php5.94 ▲0.0592.77 ▼7.58
Media Library /wp-admin/upload.php3.28 ▲0.0538.30 ▲2.69
基本设置 /wp-admin/admin.php?page=wp-user-center3.2828.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress 用户中心
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.67 ▲0.121.81 ▲0.1844.54 ▲0.70
Dashboard /wp-admin2,233 ▲595.61 ▼0.0591.75 ▼3.5352.17 ▲11.11
Posts /wp-admin/edit.php2,138 ▲381.97 ▼0.0145.18 ▲9.4844.43 ▲8.81
Add New Post /wp-admin/post-new.php1,554 ▲2623.11 ▲0.03596.08 ▼62.6863.48 ▲7.82
Media Library /wp-admin/upload.php1,432 ▲354.28 ▲0.1997.72 ▼9.1151.68 ▲6.71
积分统计 /wp-admin/admin.php?page=wp-user-center#2,5561.9230.83112.59
基本设置 /wp-admin/admin.php?page=wp-user-center2,5561.9033.2155.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-user-center/wp-user-center.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-user-center
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-user-center/js/jquery.ba-bbq.min.js?ver=6.3.1 17:118 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-user-center
    • > Network (severe)
    wp-content/plugins/wp-user-center/images/input_bg.png - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-user-center
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: a(...).live is not a function" "TypeError: a(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-user-center/js/admin.js?ver=1.0.1:1:2373)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-user-center
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: a(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 15 tag instead of maximum 10
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-user-center === )
The official readme.txt is a good inspiration

wp-user-center/wp-user-center.php 92% from 13 tests

The main PHP file in "WordPress 用户中心" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 230 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected723 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP259609
CSS100111
JavaScript20163

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/on_off_slide.png0.82KB0.84KB0.00%
images/check-off.png0.40KB0.41KB0.00%
images/wp_admin_map.png2.69KB2.79KB0.00%
images/wp_admin_icon_map.png0.85KB0.92KB0.00%
images/check-on.png0.32KB0.33KB0.00%