84% wc-discord-notifications

Code Review | Notifications on Discord for Woocommerce

WordPress plugin Notifications on Discord for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: wc-discord-notifi...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Jan 29, 2021
  • Latest release: Aug 14, 2023
  • Number of updates: 7
  • Update frequency: every 132.4 days
  • Top authors: Jarryd Long (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /3,162 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 gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.21ms] Passed 4 tests

An overview of server-side resources used by Notifications on Discord for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.26 ▼7.16
Dashboard /wp-admin3.34 ▲0.0444.61 ▼1.39
Posts /wp-admin/edit.php3.39 ▲0.0448.24 ▲1.85
Add New Post /wp-admin/post-new.php5.92 ▲0.0480.14 ▼16.39
Media Library /wp-admin/upload.php3.27 ▲0.0433.80 ▲0.12
Discord Notifications /wp-admin/options-general.php?page=wc-discord-notifications3.2432.22

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Notifications on Discord for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.58 ▼0.711.98 ▼0.0041.46 ▼2.29
Dashboard /wp-admin2,207 ▲255.79 ▼0.0897.35 ▼4.1939.44 ▼6.94
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0438.78 ▼3.5537.30 ▼0.42
Add New Post /wp-admin/post-new.php1,536 ▼622.99 ▲4.75659.47 ▲43.5058.22 ▲7.70
Media Library /wp-admin/upload.php1,392 ▲74.19 ▼0.0093.16 ▼9.2042.51 ▼0.02
Discord Notifications /wp-admin/options-general.php?page=wc-discord-notifications9012.0623.5025.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wc-discord-notifications/wc-discord-notifications.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-discord-notifications/includes/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-discord-notifications/includes/woocommerce.php:43

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: discord, ecommerce, woocommerce, notifications

wc-discord-notifications/wc-discord-notifications.php 85% from 13 tests

The main PHP script in "Notifications on Discord for Woocommerce" version 1.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.4" instead of "4.0")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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 plugin232 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP45929232

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin