78% chat-telegram

Code Review | Chat Support for Telegram - Bubble & Button with Gutenberg, Elementor and Shortcode

WordPress plugin Chat Support for Telegram - Bubble & Button with Gutenberg, Elementor and Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: chat-telegram
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2023
  • Latest release: Nov 16, 2023
  • Number of updates: 14
  • Update frequency: every 21.6 days
  • Top authors: themeatelier (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /909 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.21MB] [CPU: ▲3.50ms] Passed 4 tests

Server-side resources used by Chat Support for Telegram - Bubble & Button with Gutenberg, Elementor and Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.00 ▲1.5354.44 ▲12.77
Dashboard /wp-admin4.80 ▲1.4964.20 ▲16.01
Posts /wp-admin/edit.php4.85 ▲1.4954.01 ▲12.45
Add New Post /wp-admin/post-new.php6.31 ▲0.4263.95 ▼26.95
Media Library /wp-admin/upload.php4.66 ▲1.4348.33 ▲15.71

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 161 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
cts-opt

Browser metrics Passed 4 tests

Checking browser requirements for Chat Support for Telegram - Bubble & Button with Gutenberg, Elementor and Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,054 ▲29215.80 ▲1.1724.07 ▲22.3278.77 ▲35.90
Dashboard /wp-admin2,250 ▲765.54 ▼0.0995.72 ▼5.0444.32 ▲1.06
Posts /wp-admin/edit.php2,156 ▲532.15 ▲0.1436.05 ▼5.0536.32 ▼1.69
Add New Post /wp-admin/post-new.php1,706 ▲16622.87 ▼0.14611.53 ▼85.5659.02 ▲6.31
Media Library /wp-admin/upload.php1,455 ▲554.17 ▼0.01103.76 ▼6.2046.83 ▲2.18
Buttons shortcodes /wp-admin/admin.php?page=cts#tab=buttons-shortcodes4,0793.6580.4386.29
Backup /wp-admin/admin.php?page=cts#tab=backup4,0903.3956.7272.66
CTS settings /wp-admin/admin.php?page=cts#tab=cts-settings4,2124.0375.0492.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • cts-opt
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/chat-telegram/telegram-chat.php
    • > /wp-content/plugins/chat-telegram/inc/class-enqueue.php
    • > /wp-content/plugins/chat-telegram/inc/functions.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/chat-telegram/view/shortcodes/custom-shortcode.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/chat-telegram/view/chat-bubbles/chat-bubbles.php:3
    • > PHP Warning
      Use of undefined constant CTS_ALERT_MSG - assumed 'CTS_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/chat-telegram/inc/class-enqueue.php on line 11
    • > PHP Warning
      Use of undefined constant CTS_ALERT_MSG - assumed 'CTS_ALERT_MSG' (this will throw an Error in a future version of PHP) in wp-content/plugins/chat-telegram/inc/functions.php on line 11

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
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Settings option for bubble), #2 (Shortcode in settings panel), #3 (Chat bubble frontend), #4 (Elementor widget), #5 (Gutenberg button block)
You can take inspiration from this readme.txt

chat-telegram/telegram-chat.php 85% from 13 tests

Analyzing the main PHP file in "Chat Support for Telegram - Bubble & Button with Gutenberg, Elementor and Shortcode" version 1.0.6
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("chat-telegram.php" instead of "telegram-chat.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin21,444 lines of code in 106 files:
LanguageFilesBlank linesComment linesLines of code
PHP712,1071,4309,189
PO File203,1983,5916,500
JavaScript5861392,873
Sass11941,397
CSS680191,335
JSON120148
SVG2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity20.58
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes59
▷ Abstract classes23.39%
▷ Concrete classes5796.61%
▷ Final classes11.75%
Methods246
▷ Static methods3012.20%
▷ Public methods22491.06%
▷ Protected methods72.85%
▷ Private methods156.10%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/bubble-9.png6.58KB2.97KB▼ 54.88%
assets/image/button-with-info.png13.58KB5.36KB▼ 60.53%
assets/image/bubble-8.png4.32KB2.18KB▼ 49.64%
assets/image/bubble-4.png7.59KB3.43KB▼ 54.86%
assets/image/button2.png5.55KB2.39KB▼ 56.93%