10% nicechat

Code Review | NiceChat-to-WP

WordPress plugin NiceChat-to-WP scored 10% from 54 tests.

About plugin

  • Plugin page: nicechat
  • Plugin version: 0.1.2
  • PHP compatiblity: 5.2.10+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 27, 2017
  • Latest release: Oct 10, 2017
  • Number of updates: 17
  • Update frequency: every 6.2 days
  • Top authors: silverice (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 747 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/nicechat/includes/nice-chat-config.php+13
    Use of undefined constant NICE_CHAT_WIDGET_URL - assumed 'NICE_CHAT_WIDGET_URL' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.94MB] [CPU: ▼51.91ms] Passed 4 tests

A check of server-side resources used by NiceChat-to-WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.414.84 ▼36.87
Dashboard /wp-admin2.07 ▼1.245.48 ▼46.78
Posts /wp-admin/edit.php2.07 ▼1.296.01 ▼38.84
Add New Post /wp-admin/post-new.php2.07 ▼3.825.74 ▼85.14
Media Library /wp-admin/upload.php2.07 ▼1.165.84 ▼29.75
NiceChat /wp-admin/options-general.php?page=nice_chat_options_page2.076.16

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for NiceChat-to-WP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲10213.56 ▼0.884.84 ▲3.1641.17 ▼0.24
Dashboard /wp-admin2,212 ▲244.84 ▼1.08107.09 ▼12.7741.84 ▼5.94
Posts /wp-admin/edit.php2,098 ▲92.01 ▲0.0539.02 ▲2.5933.94 ▲0.91
Add New Post /wp-admin/post-new.php1,524 ▼2023.14 ▲4.60585.51 ▼70.0550.74 ▼1.18
Media Library /wp-admin/upload.php1,394 ▲64.19 ▼0.0193.02 ▼12.1440.30 ▼2.44
NiceChat /wp-admin/options-general.php?page=nice_chat_options_page9162.0526.0926.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/nicechat/includes/nice-chat-config.php+13
    Use of undefined constant NICE_CHAT_WIDGET_URL - assumed 'NICE_CHAT_WIDGET_URL' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=nice_chat_options_page
    • > Warning in wp-content/plugins/nicechat/includes/nice-chat-config.php+13
    Use of undefined constant NICE_CHAT_WIDGET_URL - assumed 'NICE_CHAT_WIDGET_URL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=nice_chat_options_page
    • > Warning in wp-content/plugins/nicechat/includes/nice-chat-config.php+14
    Use of undefined constant NICE_CHAT_API_BASE - assumed 'NICE_CHAT_API_BASE' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=nice_chat_options_page
    • > Warning in wp-content/plugins/nicechat/admin/class-nice-chat-to-wp-admin.php+64
    Use of undefined constant nice_chat_options_page - assumed 'nice_chat_options_page' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=nice_chat_options_page
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=nice_chat_options_page
    • > Notice in wp-content/plugins/nicechat/admin/class-nice-chat-to-wp-admin.php+82
    Undefined index: nice_chat_partner_id
    • > GET request to /wp-admin/options-general.php?page=nice_chat_options_page
    • > Notice in wp-content/plugins/nicechat/admin/class-nice-chat-to-wp-admin.php+92
    Undefined index: nice_chat_api_id

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant NICE_CHAT_API_BASE - assumed 'NICE_CHAT_API_BASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/nicechat/includes/nice-chat-config.php on line 14
    • > PHP Warning
      Use of undefined constant NICE_CHAT_WIDGET_URL - assumed 'NICE_CHAT_WIDGET_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/nicechat/includes/nice-chat-config.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2 in nicechat/assets to your readme.txt
You can take inspiration from this readme.txt

nicechat/nice-chat-to-wp.php 77% from 13 tests

The primary PHP file in "NiceChat-to-WP" version 0.1.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("nicechat.php" instead of "nice-chat-to-wp.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin985 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13194700798
JavaScript2185139
PO File2224048

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity15.75
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods46
▷ Static methods24.35%
▷ Public methods2554.35%
▷ Protected methods00.00%
▷ Private methods2145.65%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin