72% wp-facebook-messenger-chat

Code Review | WP Chat

WordPress plugin WP Chat scored72%from 54 tests.

About plugin

  • Plugin page: wp-facebook-messe...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Dec 15, 2017
  • Latest release: May 2, 2019
  • Number of updates: 14
  • Update frequency: every 35.9 days
  • Top authors: niumalta (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,180 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by WP Chat
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1042.70 ▲3.68
Dashboard /wp-admin3.41 ▲0.0643.26 ▼17.26
Posts /wp-admin/edit.php3.52 ▲0.1647.65 ▼0.68
Add New Post /wp-admin/post-new.php6.01 ▲0.1281.83 ▼12.48
Media Library /wp-admin/upload.php3.33 ▲0.1036.14 ▼0.09
WP Chat /wp-admin/options-general.php?page=wpfm_settings3.3430.22

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
wpfm_settings
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP Chat
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲17713.62 ▼0.665.62 ▲3.8840.76 ▼0.31
Dashboard /wp-admin2,209 ▲185.85 ▲0.9498.95 ▼13.1938.45 ▼5.85
Posts /wp-admin/edit.php2,095 ▲32.04 ▲0.0236.60 ▼8.1635.07 ▼5.27
Add New Post /wp-admin/post-new.php1,534 ▲1523.38 ▲0.18656.82 ▼24.9064.99 ▲10.61
Media Library /wp-admin/upload.php1,397 ▲124.27 ▲0.0995.04 ▼4.3340.66 ▼3.18
WP Chat /wp-admin/options-general.php?page=wpfm_settings8272.0625.8424.67

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • wpfm_settings
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wpfm_settings
    • > Notice in wp-content/plugins/wp-facebook-messenger-chat/views/wpfm-settings/page-settings-fields.php+22
    Uninitialized string offset: 0

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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-facebook-messenger-chat/views/wpfm-settings/page-settings-fields.php
    • > /wp-content/plugins/wp-facebook-messenger-chat/bootstrap.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WPFM_Module' not found in wp-content/plugins/wp-facebook-messenger-chat/classes/wpfm-handler.php:7
    • > PHP Warning
      Use of undefined constant WPFM_REQUIRED_PHP_VERSION - assumed 'WPFM_REQUIRED_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-facebook-messenger-chat/views/requirements-error.php on line 6
    • > PHP Warning
      Use of undefined constant WPFM_REQUIRED_WP_VERSION - assumed 'WPFM_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-facebook-messenger-chat/views/requirements-error.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'WPFM_Module' not found in wp-content/plugins/wp-facebook-messenger-chat/classes/wp-facebook-messenger-chat.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-facebook-messenger-chat/views/wpfm-settings/page-settings-fields.php on line 10
    • > PHP Warning
      Use of undefined constant WPFM_NAME - assumed 'WPFM_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-facebook-messenger-chat/views/requirements-error.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-facebook-messenger-chat/views/requirements-error.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WPFM_Module' not found in wp-content/plugins/wp-facebook-messenger-chat/classes/wpfm-settings.php:8
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/wp-facebook-messenger-chat/views/wpfm-settings/page-settings-fields.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-facebook-messenger-chat/views/wpfm-settings/page-settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Contributors: Contributors not specified
  • Screenshots: Screenshot #2 (The plugin working.) image not found
You can look at the official readme.txt

wp-facebook-messenger-chat/bootstrap.php 85% from 13 tests

The main file in "WP Chat" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 170 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-facebook-messenger-chat.php" instead of "bootstrap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin582 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9147417579
JavaScript1133
CSS1100

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.20
▷ Minimum class complexity4.00
▷ Maximum class complexity13.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods54
▷ Static methods1324.07%
▷ Public methods4074.07%
▷ Protected methods1425.93%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants333.33%
▷ Class constants666.67%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/blank.png0.27KB0.10KB▼ 61.68%