79% wptelegram-widget

Code Review | WP Telegram Widget and Join Link

WordPress plugin WP Telegram Widget and Join Link scored79%from 54 tests.

About plugin

  • Plugin page: wptelegram-widget
  • Plugin version: 2.1.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 19, 2018
  • Latest release: May 20, 2023
  • Number of updates: 99
  • Update frequency: every 19.4 days
  • Top authors: manzoorwani.jk (93.94%)wpsocio (7.07%)

Code review

54 tests

User reviews

28 reviews

Install metrics

5,000+ active /83,428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.49MB] [CPU: ▼1.93ms] Passed 4 tests

Analyzing server-side resources used by WP Telegram Widget and Join Link
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5242.41 ▲5.16
Dashboard /wp-admin3.82 ▲0.4849.54 ▼10.89
Posts /wp-admin/edit.php3.88 ▲0.5248.47 ▲2.15
Add New Post /wp-admin/post-new.php6.52 ▲0.6396.75 ▲0.13
Media Library /wp-admin/upload.php3.69 ▲0.4637.51 ▲0.91

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 78 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
widget_wptelegram_widget_join_channel
widget_theysaidso_widget
can_compress_scripts
widget_wptelegram_widget_widget
theysaidso_admin_options
widget_recent-posts
widget_wptelegram_widget_ajax_widget
wptelegram_widget_ver
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WP Telegram Widget and Join Link
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲11413.82 ▼0.539.39 ▲7.7244.41 ▲3.34
Dashboard /wp-admin2,219 ▲425.58 ▼0.0188.45 ▼1.1940.37 ▼3.70
Posts /wp-admin/edit.php2,118 ▲182.02 ▲0.0534.72 ▼1.6733.27 ▲0.43
Add New Post /wp-admin/post-new.php6,231 ▲4,70521.24 ▼1.86874.05 ▲186.8482.55 ▲12.57
Media Library /wp-admin/upload.php1,424 ▲244.12 ▼0.0298.86 ▼17.5440.12 ▼9.51

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
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_wptelegram_widget_ajax_widget
    • widget_recent-comments
    • widget_recent-posts
    • widget_wptelegram_widget_widget
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_wptelegram_widget_join_channel

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 10× PHP files output text when accessed directly:
    • > /wp-content/plugins/wptelegram-widget/shared/widgets/Ajax.php
    • > /wp-content/plugins/wptelegram-widget/shared/shortcodes/AjaxWidget.php
    • > /wp-content/plugins/wptelegram-widget/shared/widgets/Legacy.php
    • > /wp-content/plugins/wptelegram-widget/shared/embed/AjaxWidget.php
    • > /wp-content/plugins/wptelegram-widget/shared/shortcodes/LegacyWidget.php
    • > /wp-content/plugins/wptelegram-widget/shared/partials/v.php
    • > /wp-content/plugins/wptelegram-widget/shared/partials/legacy-widget.php
    • > /wp-content/plugins/wptelegram-widget/shared/embed/SingleMessage.php
    • > /wp-content/plugins/wptelegram-widget/shared/shortcodes/JoinChannel.php
    • > /wp-content/plugins/wptelegram-widget/shared/widgets/JoinChannel.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPTelegram\\Widget\\includes\\BaseClass' not found in wp-content/plugins/wptelegram-widget/includes/AssetManager.php:28
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wptelegram-widget/shared/partials/legacy-widget.php on line 22
    • > PHP Fatal error
      Uncaught Error: Class 'WPTelegram\\Widget\\includes\\BaseClass' not found in wp-content/plugins/wptelegram-widget/admin/Admin.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/wptelegram-widget/shared/partials/ajax-widget-embed.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wptelegram-widget/languages/wptelegram-widget-js-translations.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WPTelegram\\Widget\\includes\\restApi\\RESTController' not found in wp-content/plugins/wptelegram-widget/includes/restApi/SettingsController.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WPTelegram\\BotAPI\\restApi\\RESTBaseController' not found in wp-content/plugins/wptelegram-widget/includes/bot-api/src/restApi/RESTAPIController.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wptelegram-widget/shared/partials/ajax-widget.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wptelegram-widget/shared/partials/join-channel.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/wptelegram-widget/uninstall.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: feed, widget, telegram, channel, group

wptelegram-widget/wptelegram-widget.php Passed 13 tests

"WP Telegram Widget and Join Link" version 2.1.10's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
111 characters long description:
Display the Telegram Public Channel or Group Feed in a WordPress widget or anywhere you want using a shortcode.

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
Everything looks great! No dangerous files found in this plugin3,682 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,0442,8342,756
PO File2241294585
Markdown11420172
SVG101108
JSON10036
CSS50322
JavaScript3053

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.60
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes30
▷ Abstract classes310.00%
▷ Concrete classes2790.00%
▷ Final classes00.00%
Methods212
▷ Static methods4621.70%
▷ Public methods18285.85%
▷ Protected methods20.94%
▷ Private methods2813.21%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants33
▷ Global constants1030.30%
▷ Class constants2369.70%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons/icon-128x128.png6.67KB3.58KB▼ 46.27%
assets/icons/icon-36x34.png2.03KB1.88KB▼ 7.13%