10% telegram-chat

Code Review | Telegram-chat

WordPress plugin Telegram-chat scored10%from 54 tests.

About plugin

  • Plugin page: telegram-chat
  • Plugin version: 3.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7.2
  • WordPress version: 6.3.1
  • First release: Jul 8, 2016
  • Latest release: Feb 22, 2017
  • Number of updates: 310
  • Update frequency: every 0.7 days
  • Top authors: Totalpat (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /8,946 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/telegram-chat/lib/browser.lib.php+134
    Methods with the same name as their class will not be constructors in a future version of PHP; Browser_telegram_chat has a deprecated constructor

Server metrics [RAM: ▼1.53MB] [CPU: ▼60.53ms] Passed 4 tests

A check of server-side resources used by Telegram-chat
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.47 ▼1.007.45 ▼39.47
Dashboard /wp-admin2.49 ▼0.867.14 ▼57.26
Posts /wp-admin/edit.php2.50 ▼0.866.79 ▼47.22
Add New Post /wp-admin/post-new.php2.49 ▼3.408.00 ▼98.17
Media Library /wp-admin/upload.php2.50 ▼0.737.59 ▼29.68
Telegram Chat /wp-admin/themes.php?page=telegram-chat-plugin2.507.64

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 112 new files
Database: 2 new tables, 7 new options
New tables
wp_telegram_chat_history
wp_telegram_chat_info
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
telegramChat_db_version
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Telegram-chat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲13213.81 ▼0.119.25 ▲7.4239.64 ▲0.35
Dashboard /wp-admin2,200 ▲205.60 ▼0.0884.33 ▼9.5168.21 ▲25.10
Posts /wp-admin/edit.php2,120 ▲201.99 ▼0.0036.28 ▼3.4031.92 ▼5.18
Add New Post /wp-admin/post-new.php1,541 ▲1523.17 ▼0.24696.95 ▼15.2053.45 ▲1.98
Media Library /wp-admin/upload.php1,414 ▲144.28 ▲0.09102.53 ▼9.4070.77 ▲24.45
Telegram Chat /wp-admin/themes.php?page=telegram-chat-plugin8632.0026.6629.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/telegram-chat/lib/browser.lib.php+134
    Methods with the same name as their class will not be constructors in a future version of PHP; Browser_telegram_chat has a deprecated constructor
  • Zombie tables were found after uninstall: 2 tables
    • wp_telegram_chat_info
    • wp_telegram_chat_history
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • telegramChat_db_version
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Deprecated in wp-content/plugins/telegram-chat/lib/browser.lib.php+134
    Methods with the same name as their class will not be constructors in a future version of PHP; Browser_telegram_chat has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/lib/hash.php+40
    Undefined index: accion
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+262
    Undefined offset: 0
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+262
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+159
    Undefined index: valor2
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+162
    Undefined index: valor3
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+253
    Undefined index: nombre
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+254
    Undefined index: email
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+255
    Undefined index: telefono
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/telegram-chat.php+795
    Undefined variable: active_tab
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/menu/display.php+51
    Undefined index: HTTP_CLIENT_IP
    • > GET request to /wp-admin/themes.php?page=telegram-chat-plugin
    • > Notice in wp-content/plugins/telegram-chat/menu/display.php+52
    Undefined index: HTTP_X_FORWARDED_FOR

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
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: accion in wp-content/plugins/telegram-chat/lib/hash.php on line 40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/telegram-chat/menu/config.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/telegram-chat/menu/display.php:46
    • > PHP Notice
      Undefined index: accion in wp-content/plugins/telegram-chat/lib/hash.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/telegram-chat/menu/active.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% 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:
  • Tags: Please reduce the number of tags, currently 33 tag instead of maximum 10
The official readme.txt is a good inspiration

telegram-chat/telegram-chat.php Passed 13 tests

"Telegram-chat" version 3.0.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
98 characters long description:
Take all your conversations to your phone by Telegram. Just configure your phone number and ready!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin12,717 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
CSS3108283,255
JavaScript133781542,008
PHP63175241,833
Sass1434341,656
LESS1434441,646
PO File42883001,098
SVG201721
Markdown31560318
HTML52090
JSON20062
XML150015
YAML1039
Bourne Shell1006

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity118.00
▷ Minimum class complexity118.00
▷ Maximum class complexity118.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods1934.55%
▷ Protected methods3665.45%
▷ Private methods00.00%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants55
▷ Global constants00.00%
▷ Class constants55100.00%
▷ Public constants55100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/diagrama.png50.02KB16.76KB▼ 66.50%
images/ayudaInfo.png46.64KB14.90KB▼ 68.06%
images/mensaje_telegram.png18.32KB7.50KB▼ 59.08%
images/chat_icon.png4.13KB1.65KB▼ 60.14%
images/telegram.png31.04KB14.60KB▼ 52.98%