72% monitor-chat

Code Review | Monitor.chat - Monitor WordPress with Instant Messages

WordPress plugin Monitor.chat - Monitor WordPress with Instant Messages scored72%from 54 tests.

About plugin

  • Plugin page: monitor-chat
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 6.3.1
  • First release: Feb 15, 2021
  • Latest release: Mar 11, 2021
  • Number of updates: 14
  • Update frequency: every 1.9 days
  • Top authors: ec1warc1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.76MB] [CPU: ▼2.46ms] Passed 4 tests

Analyzing server-side resources used by Monitor.chat - Monitor WordPress with Instant Messages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.26 ▲0.8043.90 ▲3.16
Dashboard /wp-admin4.10 ▲0.7956.82 ▲2.51
Posts /wp-admin/edit.php4.15 ▲0.7955.32 ▼5.39
Add New Post /wp-admin/post-new.php6.62 ▲0.7393.57 ▼10.13
Media Library /wp-admin/upload.php3.96 ▲0.7344.34 ▲5.64
Monitor.chat /wp-admin/options-general.php?page=monitorchat_settings3.9037.07

Server storage [IO: ▲0.28MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 141 new options
New WordPress options
monitorchat_global_send_using
monitorchat_woocommerce_order_status_change_refunded
monitorchat_create_term_exclude
monitorchat_wp_statistics_referrals_enabled
monitorchat_upgrader_process_complete_recipient
monitorchat_global_distribute_scheduled
monitorchat_comment_post_message
monitorchat_global_enabled
monitorchat_attachment_upload_recipient
monitorchat_logins_exclude
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Monitor.chat - Monitor WordPress with Instant Messages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.73 ▲0.351.50 ▼0.6441.67 ▼3.69
Dashboard /wp-admin2,199 ▲195.69 ▼0.0290.14 ▼2.7138.43 ▼6.71
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0741.19 ▲0.4735.42 ▼5.10
Add New Post /wp-admin/post-new.php1,547 ▲1623.10 ▼0.13661.28 ▲17.9951.46 ▼17.55
Media Library /wp-admin/upload.php1,404 ▲44.25 ▼0.0197.55 ▼4.2941.70 ▼4.38
Monitor.chat /wp-admin/options-general.php?page=monitorchat_settings1,1152.0122.6257.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=monitorchat_settings
    • > Notice in wp-content/plugins/monitor-chat/includes/class-monitorchat-settings.php+1923
    Undefined index: tab
    • > GET request to /wp-admin/options-general.php?page=monitorchat_settings
    • > Notice in wp-content/plugins/monitor-chat/includes/class-monitorchat-settings.php+1928
    Undefined index: send_test_message

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
Almost there! Just fix the following items
  • 10× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/monitor-chat/about.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_woocommerce.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_general.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_linux.php
    • > /wp-content/plugins/monitor-chat/index.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_akismet.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_wp_statistics.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_gwolle_guestbook.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_wordpress.php
    • > /wp-content/plugins/monitor-chat/functions/monitorchat_updraft.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/monitor-chat/includes/class-monitorchat-settings.php on line 2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/monitor-chat/includes/class-monitorchat-settings.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/monitor-chat/includes/class-monitorchat-settings.php on line 2
    • > PHP Warning
      Use of undefined constant MONITORCHAT_VERSION - assumed 'MONITORCHAT_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/monitor-chat/about.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

monitor-chat/monitor-chat.php Passed 13 tests

The main PHP file in "Monitor.chat - Monitor WordPress with Instant Messages" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
58 characters long description:
Monitor Your Wordpress Website with XMPP Instant Messages!

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected4,741 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP186565424,741

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 136)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity66.20
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity10.31
▷ Minimum method complexity1.00
▷ Maximum method complexity136.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods35
▷ Static methods411.43%
▷ Public methods3188.57%
▷ Protected methods12.86%
▷ Private methods38.57%
Functions79
▷ Named functions79100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin