84% telegram-bot

Code Review | Telegram Bot & Channel

WordPress plugin Telegram Bot & Channel scored84%from 54 tests.

About plugin

  • Plugin page: telegram-bot
  • Plugin version: 3.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.4
  • WordPress version: 6.3.1
  • First release: Sep 7, 2015
  • Latest release: Oct 20, 2023
  • Number of updates: 177
  • Update frequency: every 16.8 days
  • Top authors: Milmor (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active /74,258 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
Installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼0.67ms] Passed 4 tests

A check of server-side resources used by Telegram Bot & Channel
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3338.29 ▼3.15
Dashboard /wp-admin3.62 ▲0.3148.90 ▲4.63
Posts /wp-admin/edit.php3.73 ▲0.3747.31 ▲2.73
Add New Post /wp-admin/post-new.php6.16 ▲0.2782.37 ▼2.33
Media Library /wp-admin/upload.php3.54 ▲0.3135.31 ▲0.07
Log /wp-admin/admin.php?page=telegram_log3.5131.10
Telegram /wp-admin/admin.php?page=telegram_main3.5133.59
Responders /wp-admin/edit.php?post_type=telegram_commands3.5834.96
Groups /wp-admin/edit.php?post_type=telegram_groups3.5835.61
Users /wp-admin/edit.php?post_type=telegram_subscribers3.5934.11
Send a message /wp-admin/admin.php?page=telegram_send3.5132.51
Settings /wp-admin/admin.php?page=telegram_settings3.5630.98

Server storage [IO: ▲0.13MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 11 new options
New WordPress options
wp_telegram_dispatches
can_compress_scripts
wp_telegram_version
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
wp_telegram_apikey
widget_telegram_widget
wp_telegram
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Telegram Bot & Channel
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8414.28 ▼0.091.69 ▲0.1545.06 ▼0.27
Dashboard /wp-admin2,249 ▲695.56 ▼0.1185.02 ▼6.2439.01 ▼1.46
Posts /wp-admin/edit.php2,157 ▲542.01 ▼0.0235.35 ▼6.0431.42 ▼3.05
Add New Post /wp-admin/post-new.php1,728 ▲20222.47 ▼1.04666.44 ▼18.7559.84 ▲6.41
Media Library /wp-admin/upload.php1,456 ▲564.27 ▲0.0498.54 ▲0.6841.34 ▼4.08
Log /wp-admin/admin.php?page=telegram_log8432.0324.6324.56
Telegram /wp-admin/admin.php?page=telegram_main8552.0324.0930.45
Responders /wp-admin/edit.php?post_type=telegram_commands1,1421.9731.1436.59
Groups /wp-admin/edit.php?post_type=telegram_groups1,1201.9732.8032.00
Users /wp-admin/edit.php?post_type=telegram_subscribers1,1291.9531.9830.63
Send a message /wp-admin/admin.php?page=telegram_send8842.0023.9025.75
Settings /wp-admin/admin.php?page=telegram_settings1,3232.1525.5136.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 11 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • wp_telegram_apikey
    • wp_telegram_version
    • wp_telegram
    • widget_theysaidso_widget
    • can_compress_scripts
    • wp_telegram_dispatches
    • widget_telegram_widget
    • ...

Smoke tests 75% 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 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 fix the following items
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/telegram-bot/custom-post-types.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function telegram_log() in wp-content/plugins/telegram-bot/parse.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/telegram-bot/panel/settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/telegram-bot/columns.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/telegram-bot/panel/main.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/telegram-bot/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/telegram-bot/columns.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/telegram-bot/defaults.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/telegram-bot/admin-messages.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 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
8 plugin tags: group, stream, channel, newsletter, telegram...

telegram-bot/telegram-bot.php 92% from 13 tests

Analyzing the main PHP file in "Telegram Bot & Channel" version 3.7
Please take the time to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

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
There were no executable files found in this plugin1,713 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11199221,523
JavaScript1131188
Markdown1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions58
▷ Named functions3356.90%
▷ Anonymous functions2543.10%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/telegramicon.png3.28KB2.18KB▼ 33.42%
img/dashicon.png0.58KB0.74KB0.00%
img/telegrambot.png25.19KB10.11KB▼ 59.86%