78% quadlayers-telegram-chat

Code Review | QuadLayers Telegram Button

WordPress plugin QuadLayers Telegram Button scored78%from 54 tests.

About plugin

  • Plugin page: quadlayers-telegr...
  • Plugin version: 3.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Feb 13, 2021
  • Latest release: Nov 13, 2023
  • Number of updates: 70
  • Update frequency: every 14.3 days
  • Top authors: quadlayers (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /23,375 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.71MB] [CPU: ▲5.92ms] 75% from 4 tests

An overview of server-side resources used by QuadLayers Telegram Button
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 675.65ms on /wp-admin/admin.php?page=qltgm_suggestions)
PageMemory (MB)CPU Time (ms)
Home /4.20 ▲0.7343.97 ▲0.35
Dashboard /wp-admin4.06 ▲0.7554.60 ▲3.92
Posts /wp-admin/edit.php4.07 ▲0.7055.98 ▲11.66
Add New Post /wp-admin/post-new.php6.60 ▲0.71106.71 ▲7.73
Media Library /wp-admin/upload.php3.94 ▲0.7144.46 ▲12.53
Box /wp-admin/admin.php?page=qltgm_box3.9845.12
Colors /wp-admin/admin.php?page=qltgm_scheme3.9243.40
Contacts /wp-admin/admin.php?page=qltgm_contacts4.0143.01
Display /wp-admin/admin.php?page=qltgm_display3.9741.29
Button /wp-admin/admin.php?page=qltgm_button4.2342.68
Suggestions /wp-admin/admin.php?page=qltgm_suggestions4.33675.65
Welcome /wp-admin/admin.php?page=qltgm3.9240.43

Server storage [IO: ▲0.89MB] [DB: ▲0.06MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 128 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

QuadLayers Telegram Button: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,043 ▲28113.42 ▼0.869.94 ▲7.9239.28 ▼4.60
Dashboard /wp-admin2,348 ▲1775.59 ▼0.0793.31 ▼10.4182.10 ▲37.62
Posts /wp-admin/edit.php2,158 ▲551.98 ▲0.0438.03 ▼1.2133.35 ▼0.71
Add New Post /wp-admin/post-new.php1,569 ▲3823.71 ▲0.81713.01 ▲72.8351.52 ▼9.31
Media Library /wp-admin/upload.php1,455 ▲614.12 ▼0.12103.74 ▲2.7974.90 ▲31.76
Box /wp-admin/admin.php?page=qltgm_box1,9838.75183.58152.73
Colors /wp-admin/admin.php?page=qltgm_scheme1,1912.6853.0736.67
Contacts /wp-admin/admin.php?page=qltgm_contacts1,2223.7248.9484.65
Display /wp-admin/admin.php?page=qltgm_display1,3052.6750.0237.50
Button /wp-admin/admin.php?page=qltgm_button1,2962.4447.8739.62
Suggestions /wp-admin/admin.php?page=qltgm_suggestions2,0152.6037.9672.80
Welcome /wp-admin/admin.php?page=qltgm9832.4030.9043.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/quadlayers-telegram-chat/quadlayers-telegram-chat.php
    • > /wp-content/plugins/quadlayers-telegram-chat/lib/view/backend/pages/modals/contact/panel-contact-chat.php
    • > /wp-content/plugins/quadlayers-telegram-chat/uninstall.php
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-plugin-install-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/quadlayers-telegram-chat/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/quadlayers-telegram-chat/lib/view/backend/pages/premium.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/quadlayers-telegram-chat/lib/view/backend/pages/modals/contact/panel-visibility.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/quadlayers-telegram-chat/lib/view/backend/pages/modals/contact/panel-info.php:3
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActions' not found in wp-content/plugins/quadlayers-telegram-chat/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginBySlug.php on line 20
    • > PHP Notice
      Undefined variable: wp_list_table in wp-content/plugins/quadlayers-telegram-chat/lib/view/backend/pages/suggestions.php on line 19
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-plugin-install-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/quadlayers-telegram-chat/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/quadlayers-telegram-chat/vendor/automattic/jetpack-composer-plugin/src/class-manager.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'QuadLayers\\QLTGM\\Models\\Base' not found in wp-content/plugins/quadlayers-telegram-chat/lib/models/class-button.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/quadlayers-telegram-chat/lib/view/backend/pages/scheme.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: telegram chat, telegram message, help desk, telegram support, click to chat...

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

"QuadLayers Telegram Button" version 3.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
107 characters long description:
Telegram Button allows your visitors to contact you or your team through Telegram chat with a single click.

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 plugin6,379 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
PHP868121,7404,753
Markdown122700730
JSON100458
CSS3660354
JavaScript591457
XML10027

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity11.84
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces14
Interfaces0
Traits3
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes12.44%
Methods243
▷ Static methods6024.69%
▷ Public methods20986.01%
▷ Protected methods00.00%
▷ Private methods3413.99%
Functions19
▷ Named functions315.79%
▷ Anonymous functions1684.21%
Constants27
▷ Global constants27100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.20MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/backend/img/box.png44.47KB14.35KB▼ 67.73%
assets/backend/img/icon.png19.44KB3.27KB▼ 83.20%
assets/backend/img/box2.png53.77KB14.44KB▼ 73.14%
assets/backend/img/old.png89.13KB23.93KB▼ 73.15%