84% talkjs

Code Review | TalkJS

WordPress plugin TalkJS scored84%from 54 tests.

About plugin

  • Plugin page: talkjs
  • Plugin version: 0.1.15
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6
  • WordPress version: 6.3.1
  • First release: Oct 19, 2017
  • Latest release: Feb 4, 2021
  • Number of updates: 57
  • Update frequency: every 21.1 days
  • Top authors: talkjs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /8,385 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.48MB] [CPU: ▼0.82ms] Passed 4 tests

An overview of server-side resources used by TalkJS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.4746.82 ▲3.66
Dashboard /wp-admin3.82 ▲0.4558.41 ▼3.20
Posts /wp-admin/edit.php3.94 ▲0.5552.76 ▲1.76
Add New Post /wp-admin/post-new.php6.42 ▲0.5094.86 ▼5.49
Media Library /wp-admin/upload.php3.75 ▲0.4942.45 ▲8.12
TalkJS Settings /wp-admin/options-general.php?page=talkjs-settings3.7237.82
Welcome to TalkJS! /wp-admin/options-general.php?page=talkjs-onboarding3.7144.44

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

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

Browser metrics Passed 4 tests

TalkJS: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8714.15 ▼0.502.01 ▲0.1646.50 ▲1.73
Dashboard /wp-admin2,237 ▲465.79 ▲0.92114.63 ▲12.2741.02 ▲1.13
Posts /wp-admin/edit.php2,124 ▲382.47 ▲0.4241.98 ▲6.1532.04 ▲1.09
Add New Post /wp-admin/post-new.php1,542 ▲2818.41 ▲0.79686.51 ▲64.3056.80 ▲2.47
Media Library /wp-admin/upload.php1,419 ▲284.96 ▲0.75104.03 ▲5.9041.90 ▲0.14
TalkJS Settings /wp-admin/options-general.php?page=talkjs-settings9782.5837.6629.90
Welcome to TalkJS! /wp-admin/options-general.php?page=talkjs-onboarding9042.4531.8032.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • talkjs_onboarding
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_talkjs
    • theysaidso_admin_options
    • talkjs_inbox_page

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 43× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJS\\Traits\\HasProperties' not found in wp-content/plugins/talkjs/classes/traits/ImplementsTalkSession.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJS\\Contracts\\StaticInstance' not found in wp-content/plugins/talkjs/classes/contracts/05-ShortcodeInstance.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJS\\Contracts\\ShortcodeInstance' not found in wp-content/plugins/talkjs/classes/chat/Shortcode.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/talkjs/tests/test-urls.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJs\\Contracts\\AssetLoaderInstance' not found in wp-content/plugins/talkjs/classes/admin/Assets.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'BaseTest' not found in wp-content/plugins/talkjs/tests/test-inbox.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'BaseTest' not found in wp-content/plugins/talkjs/tests/test-inbox-page-generator.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJS\\Traits\\HasProperties' not found in wp-content/plugins/talkjs/classes/admin/ui/FieldBuilder.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJS\\Facades\\Facade' not found in wp-content/plugins/talkjs/classes/facades/Chat.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'TalkJS\\Facades\\Facade' not found in wp-content/plugins/talkjs/classes/facades/Notification.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can take inspiration from this readme.txt

talkjs/talkjs.php Passed 13 tests

Analyzing the main PHP file in "TalkJS" version 0.1.15
77 characters long description:
This plugin lets you add TalkJS' messaging platform to your WordPress website

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected7,739 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
JSON3003,472
PHP621,3291,5372,581
Markdown32000697
JavaScript4192152384
Bourne Shell24421175
CSS261150
Sass3290129
PO File13131126
XML24225

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes60
▷ Abstract classes58.33%
▷ Concrete classes5591.67%
▷ Final classes00.00%
Methods256
▷ Static methods6726.17%
▷ Public methods21885.16%
▷ Protected methods2911.33%
▷ Private methods93.52%
Functions19
▷ Named functions736.84%
▷ Anonymous functions1263.16%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png5.73KB2.77KB▼ 51.73%
assets/icon-128x128.png2.59KB1.66KB▼ 35.90%
assets/screenshot-1.png82.09KB33.20KB▼ 59.56%