68% online-contact-widget

Code Review | Online Contact Widget-多合一在线客服插件

WordPress plugin Online Contact Widget-多合一在线客服插件 scored68%from 54 tests.

About plugin

  • Plugin page: online-contact-wi...
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 21, 2021
  • Latest release: Sep 14, 2023
  • Number of updates: 11
  • Update frequency: every 70.7 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /5,170 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼5.18ms] Passed 4 tests

Analyzing server-side resources used by Online Contact Widget-多合一在线客服插件
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5542.10 ▼0.11
Dashboard /wp-admin3.80 ▲0.5047.73 ▲1.83
Posts /wp-admin/edit.php3.86 ▲0.5045.35 ▼1.96
Add New Post /wp-admin/post-new.php6.32 ▲0.4487.75 ▼20.35
Media Library /wp-admin/upload.php3.66 ▲0.4436.64 ▲1.70

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 54 new files
Database: 2 new tables, 6 new options
New tables
wp_ocw_contact_content
wp_ocw_contact
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Online Contact Widget-多合一在线客服插件
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,057 ▲32213.46 ▼1.297.62 ▲5.7775.37 ▲27.84
Dashboard /wp-admin2,239 ▲484.90 ▼0.0296.66 ▼7.8498.95 ▲56.80
Posts /wp-admin/edit.php2,125 ▲362.02 ▲0.0333.67 ▼8.7943.82 ▲8.65
Add New Post /wp-admin/post-new.php1,705 ▲17124.73 ▲1.60637.35 ▼17.4167.32 ▲17.11
Media Library /wp-admin/upload.php1,421 ▲364.23 ▲0.0794.36 ▼12.7882.32 ▲37.02
工单管理 /wp-admin/admin.php?page=wb_ocw#/wo-list1,4507.12109.15146.33
插件设置 /wp-admin/admin.php?page=wb_ocw#/setting-base1,8537.6094.78168.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie tables were found after uninstall: 2 tables
    • wp_ocw_contact
    • wp_ocw_contact_content
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/online-contact-widget/inc/fold.tpl.php
    • > /wp-content/plugins/online-contact-widget/wbm/tpl/svg.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: class_name in wp-content/plugins/online-contact-widget/inc/fold.tpl.php on line 1
    • > PHP Notice
      Undefined variable: position in wp-content/plugins/online-contact-widget/inc/unfold.tpl.php on line 6
    • > PHP Notice
      Undefined variable: position in wp-content/plugins/online-contact-widget/inc/fold.tpl.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_is_mobile() in wp-content/plugins/online-contact-widget/inc/panel.tpl.php:6
    • > PHP Notice
      Undefined variable: tool_items in wp-content/plugins/online-contact-widget/inc/fold.tpl.php on line 2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/online-contact-widget/inc/fold.tpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/online-contact-widget/wbm/tpl/header.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/online-contact-widget/wbm/tpl/header.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/online-contact-widget/wbm/tpl/footer.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_is_mobile() in wp-content/plugins/online-contact-widget/inc/unfold.tpl.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: email, wechat, contact, tel, qq

online-contact-widget/index.php 85% from 13 tests

"Online Contact Widget-多合一在线客服插件" version 1.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("online-contact-widget.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 221 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected3,261 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP226603183,229
JavaScript1804723
CSS5066
HTML2002
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity40.91
▷ Minimum class complexity2.00
▷ Maximum class complexity106.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods110
▷ Static methods8375.45%
▷ Public methods10595.45%
▷ Protected methods00.00%
▷ Private methods54.55%
Functions13
▷ Named functions00.00%
▷ Anonymous functions13100.00%
Constants5
▷ Global constants5100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/def_avatar.png1.55KB1.70KB0.00%
assets/images/pic_head.png2.24KB2.24KB0.04%