72% social-messenger

Code Review | Live Chat (Messenger API) + PolyLang

WordPress plugin Live Chat (Messenger API) + PolyLang scored 72% from 54 tests.

About plugin

  • Plugin page: social-messenger
  • Plugin version: 2.4.6
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-5.5.1
  • WordPress version: 5.9.2
  • First release: Dec 10, 2017
  • Latest release: Sep 26, 2020
  • Number of updates: 71
  • Update frequency: every 14.4 days
  • Top authors: RapidDev (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 22,940 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼327.22ms] Passed 4 tests

This is a short check of server-side resources used by Live Chat (Messenger API) + PolyLang
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1262.81 ▲13.40
Dashboard /wp-admin3.50 ▲0.0934.72 ▲1.88
Posts /wp-admin/edit.php3.73 ▲0.0840.78 ▲3.73
Add New Post /wp-admin/post-new.php6.97 ▼0.0193.54 ▼1,316.12
Media Library /wp-admin/upload.php3.38 ▲0.0825.97 ▲1.62
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php4.7543.67

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 3 new options
New WordPress options
widget_recent-comments
rdev_social_messenger_verify
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Live Chat (Messenger API) + PolyLang
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,807 ▲5317.42 ▲1.7252.71 ▲46.472.43 ▼0.27
Dashboard /wp-admin2,893 ▲326.03 ▼0.15119.27 ▼12.33157.09 ▼6.11
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0162.00 ▼0.23139.85 ▲1.57
Add New Post /wp-admin/post-new.php1,664 ▲316.06 ▼0.89425.10 ▲38.09155.83 ▲2.85
Media Library /wp-admin/upload.php1,706 ▲85.48 ▼0.03141.16 ▲6.10186.61 ▲3.88
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php8,20419.12580.08186.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 3 options
    • widget_recent-posts
    • rdev_social_messenger_verify
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/social-messenger/assets/helpers.php
    • > /wp-content/plugins/social-messenger/assets/class.php
    • > /wp-content/plugins/social-messenger/social_messenger.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Javascript (severe) in unknown
    /?customize_changeset_uuid=1162f76d-9f86-4813-8408-8401e74abfc1&customize_theme=twentytwentytwo&customize_messenger_channel=preview-0 - Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df36427a5352de6%26domain%3Dwp.com%26is_canvas%3Dfalse%26origin%3Dhttp%253A%252F%252Fwp.com%252Ff2908cdc0e26e4c%26relation%3Dparent.parent&current_url=http%3A%2F%2Fwp.com%2F%3Fcustomize_changeset_uuid%3D1162f76d-9f86-4813-8408-8401e74abfc1%26customize_theme%3Dtwentytwentytwo%26customize_messenger_channel%3Dpreview-0&event_name=chat_plugin_sdk_facade_create&greeting_dialog_display=show&is_loaded_by_facade=true&loading_time=0&locale=en_GB&log_id=c9b6f90f-b221-4581-99e0-71b41c77eeb0&page_id=&request_time=1647736652111&sdk=joey&suppress_http_code=1&theme_color=%234080FF' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Network (severe)
    https://www.facebook.com/plugins/customer_chat/SDK/?app_id=&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df36427a5352de6%26domain%3Dwp.com%26is_canvas%3Dfalse%26origin%3Dhttp%253A%252F%252Fwp.com%252Ff2908cdc0e26e4c%26relation%3Dparent.parent&current_url=http%3A%2F%2Fwp.com%2F%3Fcustomize_changeset_uuid%3D1162f76d-9f86-4813-8408-8401e74abfc1%26customize_theme%3Dtwentytwentytwo%26customize_messenger_channel%3Dpreview-0&event_name=chat_plugin_sdk_facade_create&greeting_dialog_display=show&is_loaded_by_facade=true&loading_time=0&locale=en_GB&log_id=c9b6f90f-b221-4581-99e0-71b41c77eeb0&page_id=&request_time=1647736652111&sdk=joey&suppress_http_code=1&theme_color=%234080FF - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Javascript (severe) in unknown
    /?customize_changeset_uuid=1162f76d-9f86-4813-8408-8401e74abfc1&customize_theme=twentytwentytwo&customize_messenger_channel=preview-0 - Access to XMLHttpRequest at 'https://www.facebook.com/plugins/customer_chat/facade/?app_id=&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df36427a5352de6%26domain%3Dwp.com%26is_canvas%3Dfalse%26origin%3Dhttp%253A%252F%252Fwp.com%252Ff2908cdc0e26e4c%26relation%3Dparent.parent&current_url=http%3A%2F%2Fwp.com%2F%3Fcustomize_changeset_uuid%3D1162f76d-9f86-4813-8408-8401e74abfc1%26customize_theme%3Dtwentytwentytwo%26customize_messenger_channel%3Dpreview-0&greeting_dialog_display=show&is_loaded_by_facade=true&locale=en_GB&log_id=c9b6f90f-b221-4581-99e0-71b41c77eeb0&page_id=&request_time=1647736652111&sdk=joey&suppress_http_code=1&theme_color=%234080FF' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Network (severe)
    https://www.facebook.com/plugins/customer_chat/facade/?app_id=&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df36427a5352de6%26domain%3Dwp.com%26is_canvas%3Dfalse%26origin%3Dhttp%253A%252F%252Fwp.com%252Ff2908cdc0e26e4c%26relation%3Dparent.parent&current_url=http%3A%2F%2Fwp.com%2F%3Fcustomize_changeset_uuid%3D1162f76d-9f86-4813-8408-8401e74abfc1%26customize_theme%3Dtwentytwentytwo%26customize_messenger_channel%3Dpreview-0&greeting_dialog_display=show&is_loaded_by_facade=true&locale=en_GB&log_id=c9b6f90f-b221-4581-99e0-71b41c77eeb0&page_id=&request_time=1647736652111&sdk=joey&suppress_http_code=1&theme_color=%234080FF - Failed to load resource: net::ERR_FAILED

Optimizations

Plugin configuration 90% 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 to be fixed:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
You can take inspiration from this readme.txt

social-messenger/social_messenger.php 85% from 13 tests

The principal PHP file in "Live Chat (Messenger API) + PolyLang" v. 2.4.6 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("social-messenger.php" instead of "social_messenger.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected570 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP351130306
PO File190561264

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity26.50
▷ Minimum class complexity4.00
▷ Maximum class complexity49.00
Average method complexity5.78
▷ Minimum method complexity2.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods433.33%
▷ Public methods541.67%
▷ Protected methods758.33%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants6
▷ Global constants6100.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
There were not PNG files found in your plugin