67% tochat-be

Code Review | TOCHAT.BE

WordPress plugin TOCHAT.BE scored67%from 54 tests.

About plugin

  • Plugin page: tochat-be
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 22, 2020
  • Latest release: Nov 4, 2023
  • Number of updates: 30
  • Update frequency: every 46.1 days
  • Top authors: cesarmartin2019 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /14,543 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.20ms] Passed 4 tests

A check of server-side resources used by TOCHAT.BE
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1248.61 ▲2.24
Dashboard /wp-admin3.40 ▲0.1049.56 ▲1.90
Posts /wp-admin/edit.php3.45 ▲0.0941.77 ▼8.40
Add New Post /wp-admin/post-new.php5.98 ▲0.1092.86 ▲3.71
Media Library /wp-admin/upload.php3.32 ▲0.0936.33 ▼0.54
GDPR /wp-admin/admin.php?page=to-chat-be-whatsapp_gdpr3.3332.83
Click Log /wp-admin/admin.php?page=to-chat-be-whatsapp_click-log3.3234.78
Shortcode /wp-admin/admin.php?page=to-chat-be-whatsapp_shortcode3.3232.07
Google Analytics /wp-admin/admin.php?page=to-chat-be-google_analytics3.3231.53
Appearence /wp-admin/admin.php?page=to-chat-be-whatsapp_appearence3.3536.39
Agents /wp-admin/edit.php?post_type=tochatbe_agent3.1131.96
Settings /wp-admin/admin.php?page=to-chat-be-whatsapp_settings3.4235.14
Facebook Analytics /wp-admin/admin.php?page=to-chat-be-facebook_analytics3.3231.89

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 51 new files
Database: 1 new table, 15 new options
New tables
wp_tochatbe_log
New WordPress options
tochatbe_plugin_version
tochatbe_just_whatsapp_icon_settings
db_upgraded
tochatbe_basic_settings
widget_recent-posts
tochatbe_facebook_analytics_settings
can_compress_scripts
tochatbe_appearance_settings
tochatbe_woo_order_button_settings
tochatbe_google_analytics_settings
...

Browser metrics Passed 4 tests

TOCHAT.BE: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,103 ▲34114.17 ▲0.106.76 ▲5.0435.32 ▼4.30
Dashboard /wp-admin2,392 ▲2155.14 ▼0.5198.51 ▲4.8194.52 ▲52.95
Posts /wp-admin/edit.php2,168 ▲681.98 ▼0.0440.37 ▲0.5337.14 ▲1.54
Add New Post /wp-admin/post-new.php6,286 ▲4,76026.07 ▲2.80912.18 ▲246.0262.81 ▲7.29
Media Library /wp-admin/upload.php1,470 ▲704.18 ▲0.0298.05 ▲0.5345.76 ▲1.06
GDPR /wp-admin/admin.php?page=to-chat-be-whatsapp_gdpr1,0213.3940.9032.03
Click Log /wp-admin/admin.php?page=to-chat-be-whatsapp_click-log1,0963.4444.3627.49
Shortcode /wp-admin/admin.php?page=to-chat-be-whatsapp_shortcode1,2523.6153.5628.86
Google Analytics /wp-admin/admin.php?page=to-chat-be-google_analytics9862.8529.8928.27
Appearence /wp-admin/admin.php?page=to-chat-be-whatsapp_appearence1,9648.31163.1556.99
Agents /wp-admin/edit.php?post_type=tochatbe_agent1,8874.9678.0035.73
Settings /wp-admin/admin.php?page=to-chat-be-whatsapp_settings1,5123.4349.0031.73
Facebook Analytics /wp-admin/admin.php?page=to-chat-be-facebook_analytics9692.8730.0428.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_tochatbe_log
  • The uninstall procedure has failed, leaving 15 options in the database
    • tochatbe_facebook_analytics_settings
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • tochatbe_google_analytics_settings
    • tochatbe_gdpr_settings
    • tochatbe_plugin_version
    • tochatbe_just_whatsapp_icon_settings
    • tochatbe_woo_order_button_settings
    • tochatbe_appearance_settings
    • ...

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 0% 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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tochat-be/includes/admin/views/notifications/html-purchase-premium.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/tochat-be/includes/admin/class-tochatbe-admin-log-table.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/tochat-be/includes/admin/class-tochatbe-admin-log-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tochatbe_just_whatsapp_icon_option() in wp-content/plugins/tochat-be/views/html-just-whatsapp-icon.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/tochat-be/includes/admin/class-tochatbe-admin-log-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_textarea() in wp-content/plugins/tochat-be/includes/admin/views/meta-boxes/html-widget-mod.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/tochat-be/includes/admin/views/meta-boxes/html-agent-add.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
The official readme.txt might help

tochat-be/to-chat-be.php 69% from 13 tests

"TOCHAT.BE" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 395 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("tochat-be.php" instead of "to-chat-be.php")
  • Domain Path: The domain path folder was not found ("/languages/")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin3,371 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP354381302,847
CSS4418262
JavaScript43927213
SVG40149

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.06
▷ Minimum class complexity2.00
▷ Maximum class complexity39.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods101
▷ Static methods1615.84%
▷ Public methods9594.06%
▷ Protected methods65.94%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-full.png12.84KB4.06KB▼ 68.39%
assets/images/ToChatBe.png3.36KB2.07KB▼ 38.37%