78% anychat-widget

Code Review | All-in-one Chat Button by anychat.one

WordPress plugin All-in-one Chat Button by anychat.one scored78%from 54 tests.

About plugin

  • Plugin page: anychat-widget
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 25, 2022
  • Latest release: Nov 22, 2023
  • Number of updates: 8
  • Update frequency: every 79.5 days
  • Top authors: anychat (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /2,597 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.04MB] [CPU: ▼0.21ms] Passed 4 tests

Server-side resources used by All-in-one Chat Button by anychat.one
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.18 ▼3.75
Dashboard /wp-admin3.34 ▲0.0450.15 ▲1.00
Posts /wp-admin/edit.php3.46 ▲0.1051.35 ▼1.45
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.55 ▲11.38
Media Library /wp-admin/upload.php3.27 ▲0.0435.15 ▲3.36
AnyChat /wp-admin/options-general.php?page=anychat-key-config3.4534.23

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for All-in-one Chat Button by anychat.one
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6513.93 ▼0.452.31 ▲0.3444.46 ▼1.97
Dashboard /wp-admin2,202 ▲255.60 ▲0.0492.62 ▼8.0143.37 ▼3.47
Posts /wp-admin/edit.php2,107 ▲102.01 ▲0.0739.05 ▲0.7733.77 ▼1.13
Add New Post /wp-admin/post-new.php1,529 ▲323.10 ▼0.01577.09 ▼53.0362.47 ▲18.33
Media Library /wp-admin/upload.php1,407 ▲74.18 ▲0.0299.06 ▲3.1141.06 ▼0.69
AnyChat /wp-admin/options-general.php?page=anychat-key-config1,1741.9734.7744.08

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 detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/anychat-widget/functions.php
    • > /wp-content/plugins/anychat-widget/anychat.php
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AnyChatLoader' not found in wp-content/plugins/anychat-widget/models/AnyChatConfigModel.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'AnyChatLoader' not found in wp-content/plugins/anychat-widget/classes/AnyChat.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'AnyChatLoader' not found in wp-content/plugins/anychat-widget/classes/AnyChatAdmin.php:2
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/anychat-widget/classes/AnyChatTools.php on line 2
    • > PHP Notice
      Undefined variable: generalConfig in wp-content/plugins/anychat-widget/views/admin/_general.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'AnyChatTools' not found in wp-content/plugins/anychat-widget/views/admin/_button.php:5
    • > PHP Notice
      Undefined variable: activeSubmit in wp-content/plugins/anychat-widget/views/admin/_general.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/anychat-widget/views/helper/form.php:1
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/anychat-widget/classes/AnyChatTools.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'AnyChatLoader' not found in wp-content/plugins/anychat-widget/classes/AnyChatAbstract.php:2

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
Please take inspiration from this readme.txt

anychat-widget/anychat.php 85% from 13 tests

The entry point to "All-in-one Chat Button by anychat.one" version 1.0.3 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("anychat-widget.php" instead of "anychat.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin2,755 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP19197351,866
SVG100565
CSS31371303
JavaScript211021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity30.22
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes333.33%
▷ Concrete classes666.67%
▷ Final classes00.00%
Methods142
▷ Static methods2014.08%
▷ Public methods13997.89%
▷ Protected methods32.11%
▷ Private methods00.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.20MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
res/img/06.png23.70KB12.20KB▼ 48.50%
res/img/05.png42.45KB22.75KB▼ 46.41%
res/img/02.png28.04KB15.00KB▼ 46.52%
res/img/03.png16.18KB7.94KB▼ 50.92%
res/img/01.png14.10KB7.53KB▼ 46.58%