78% wp-chat-button-for-telegram-accounts

Code Review | WP Chat button for Telegram Accounts

WordPress plugin WP Chat button for Telegram Accounts scored78%from 54 tests.

About plugin

  • Plugin page: wp-chat-button-fo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 6.3.1
  • First release: Apr 6, 2021
  • Latest release: Apr 6, 2021
  • Number of updates: 2
  • Update frequency: every 3.0 days
  • Top authors: jeviwebstudio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /385 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.43MB] [CPU: ▼4.82ms] Passed 4 tests

A check of server-side resources used by WP Chat button for Telegram Accounts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5239.17 ▼3.29
Dashboard /wp-admin3.75 ▲0.4449.33 ▼2.65
Posts /wp-admin/edit.php3.80 ▲0.4444.96 ▲5.39
Add New Post /wp-admin/post-new.php6.34 ▲0.4483.81 ▼15.96
Media Library /wp-admin/upload.php3.61 ▲0.3835.20 ▲2.61
Add New account /wp-admin/post-new.php?post_type=telegram-accounts3.8049.81
All Accounts /wp-admin/edit.php?post_type=telegram-accounts3.7239.31
Settings /wp-admin/admin.php?page=rj_telegram_setting3.6634.38
Floating Widget /wp-admin/admin.php?page=rj_telegram_floating_widget3.7352.56

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 72 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
rj_te_version
rj_te_first_time_active
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
nta_wa_restored
theysaidso_admin_options
rj_te_review
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Chat button for Telegram Accounts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲13513.48 ▼0.908.20 ▲6.1740.05 ▼4.31
Dashboard /wp-admin2,224 ▲445.52 ▼0.1290.78 ▼11.6779.61 ▲36.74
Posts /wp-admin/edit.php2,141 ▲411.97 ▼0.0234.47 ▼7.7533.66 ▼3.53
Add New Post /wp-admin/post-new.php6,230 ▲4,70418.96 ▼4.26998.21 ▲366.4861.74 ▲5.02
Media Library /wp-admin/upload.php1,441 ▲414.16 ▼0.1194.55 ▼15.0263.58 ▲18.74
Add New account /wp-admin/post-new.php?post_type=telegram-accounts5,1674.9891.4096.28
All Accounts /wp-admin/edit.php?post_type=telegram-accounts1,1231.9631.3927.52
Settings /wp-admin/admin.php?page=rj_telegram_setting1,1542.7550.6030.42
Floating Widget /wp-admin/admin.php?page=rj_telegram_floating_widget2,2349.12173.3665.38

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • rj_te_review
    • theysaidso_admin_options
    • rj_te_version
    • nta_wa_restored
    • rj_te_first_time_active

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/floating-widget-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RJ_Telegram\\Helper' not found in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/selected-accounts.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/meta-accounts.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/meta-button-style.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/display-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RJ_Telegram\\Helper' not found in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/design-preview.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/analytics.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/design-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-chat-button-for-telegram-accounts/views/woocommerce-button.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=rj_telegram_floating_widget
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'addStyle')" "TypeError: Cannot read properties of undefined (reading 'addStyle')\n at n.initialize (/wp-content/plugins/wp-chat-button-for-telegram-accounts/assets/dist/js/app.js?ver=1.0.0:2283:60)\n at h.View (/wp-includes/js/backbone.min.js?ver=1.4.1:2:14648)\n at new n (/wp-includes/js/backbone.min.js?ver=1.4.1:2:23485)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-chat-button-for-telegram-accounts/assets/dist/js/app.js?ver=1.0.0:2259:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=rj_telegram_floating_widget
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'addStyle')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
2 plugin tags: telegram, socialmedia

wp-chat-button-for-telegram-accounts/telegram.php 85% from 13 tests

This is the main PHP file of "WP Chat button for Telegram Accounts" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-chat-button-for-telegram-accounts.php" instead of "telegram.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin7,790 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP26347612,733
JavaScript8131132,476
CSS6239482,275
PO File17991189
SVG80660
HTML116032
XML10021
JSON1004

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity14.07
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods125
▷ Static methods3528.00%
▷ Public methods11793.60%
▷ Protected methods00.00%
▷ Private methods86.40%
Functions9
▷ Named functions444.44%
▷ Anonymous functions555.56%
Constants5
▷ Global constants5100.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
7 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/woo_settings/after_add_to_cart.png2.58KB1.15KB▼ 55.60%
assets/img/woo_settings/before_add_to_cart.png2.70KB1.26KB▼ 53.35%
assets/img/filebird-recommended.png20.96KB10.34KB▼ 50.67%
assets/img/woo_settings/after_short_desc.png2.72KB1.34KB▼ 50.57%
assets/img/FB_Wireframe.png10.56KB4.88KB▼ 53.83%