78% eychat

Code Review | Eyoung Chat - Ey聊天极简版

WordPress plugin Eyoung Chat - Ey聊天极简版 scored 78% from 54 tests.

About plugin

  • Plugin page: eychat
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 1, 2022
  • Latest release: May 24, 2022
  • Number of updates: 15
  • Update frequency: every 3.6 days
  • Top authors: yuyaoit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,990 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼0.74ms] Passed 4 tests

A check of server-side resources used by Eyoung Chat - Ey聊天极简版
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2837.74 ▼3.24
Dashboard /wp-admin3.59 ▲0.2945.41 ▼4.25
Posts /wp-admin/edit.php3.71 ▲0.3546.58 ▲1.44
Add New Post /wp-admin/post-new.php6.19 ▲0.3189.51 ▲3.11
Media Library /wp-admin/upload.php3.52 ▲0.2942.25 ▲6.59
设置 /wp-admin/admin.php?page=ey_chat-setting3.5131.22
访问 /wp-admin/admin.php?page=ey_chat-gochat3.4933.23

Server storage [IO: ▲1.59MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 178 new files
Database: 3 new tables, 7 new options
New tables
wp_ey_chat_room_apply
wp_ey_chat_room_member
wp_ey_chat_content
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
eychat_options
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Eyoung Chat - Ey聊天极简版
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,086 ▲35114.73 ▲0.508.87 ▲7.1339.60 ▼8.98
Dashboard /wp-admin2,342 ▲1575.97 ▲0.10119.76 ▲11.3047.92 ▲3.22
Posts /wp-admin/edit.php2,234 ▲1452.69 ▲0.6845.46 ▲11.9742.48 ▲6.71
Add New Post /wp-admin/post-new.php1,805 ▲28623.63 ▲0.45638.30 ▼41.4540.64 ▼11.57
Media Library /wp-admin/upload.php1,527 ▲1365.16 ▲0.91108.79 ▲5.7648.60 ▲3.33
设置 /wp-admin/admin.php?page=ey_chat-setting2,2443.3166.4779.38
访问 /wp-admin/admin.php?page=ey_chat-gochat1,5553.5447.69104.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=ey_chat-setting
    • > Notice in wp-content/plugins/eychat/assets/admin.php+39
    Undefined index: limitdate
    • > GET request to /wp-admin/admin.php?page=ey_chat-gochat
    • > Notice in wp-content/plugins/eychat/assets/chat.php+7
    Undefined variable: cfg
    • > GET request to /wp-admin/admin.php?page=ey_chat-gochat
    • > Notice in wp-content/plugins/eychat/assets/chat.php+7
    Trying to access array offset on value of type null

SRP 50% 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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/eychat/assets/tip.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/eychat/assets/admin.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/eychat/assets/chath5.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/eychat/assets/chat.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: webim, chat

eychat/index.php 92% from 13 tests

Analyzing the main PHP file in "Eyoung Chat - Ey聊天极简版" version 1.0
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("eychat.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected2,335 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP11200582,060
SVG13563195
CSS513074
JavaScript4026

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity39.40
▷ Minimum class complexity9.00
▷ Maximum class complexity98.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods75
▷ Static methods7397.33%
▷ Public methods5370.67%
▷ Protected methods00.00%
▷ Private methods2229.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
44 PNG files occupy 0.32MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/30.png8.32KB3.24KB▼ 61.00%
images/6.png7.21KB2.91KB▼ 59.63%
images/4.png8.25KB2.64KB▼ 68.00%
images/22.png7.92KB3.10KB▼ 60.88%
images/23.png7.84KB2.99KB▼ 61.94%