84% wpc-smart-messages

Code Review | WPC Smart Messages for WooCommerce

WordPress plugin WPC Smart Messages for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wpc-smart-messages
  • Plugin version: 4.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 13, 2022
  • Latest release: Oct 9, 2023
  • Number of updates: 30
  • Update frequency: every 10.0 days
  • Top authors: wpclever (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /4,343 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.40ms] Passed 4 tests

This is a short check of server-side resources used by WPC Smart Messages for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1045.43 ▲2.75
Dashboard /wp-admin3.40 ▲0.0547.17 ▼17.48
Posts /wp-admin/edit.php3.52 ▲0.1644.52 ▼0.67
Add New Post /wp-admin/post-new.php6.01 ▲0.1179.73 ▼14.21
Media Library /wp-admin/upload.php3.33 ▲0.0938.73 ▲2.89
About /wp-admin/admin.php?page=wpclever3.2931.19
Essential Kit /wp-admin/admin.php?page=wpclever-kit3.2930.29

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WPC Smart Messages for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10514.46 ▲0.111.74 ▼0.0743.20 ▼0.45
Dashboard /wp-admin2,260 ▲855.59 ▼0.0396.07 ▼17.1583.73 ▲38.90
Posts /wp-admin/edit.php2,181 ▲842.06 ▲0.0736.44 ▼1.1631.94 ▼2.90
Add New Post /wp-admin/post-new.php1,799 ▲27326.10 ▲3.03699.78 ▲8.5545.08 ▼21.09
Media Library /wp-admin/upload.php1,477 ▲744.14 ▼0.0799.35 ▲0.6672.14 ▲30.68
About /wp-admin/admin.php?page=wpclever1,4052.1430.3134.56
Essential Kit /wp-admin/admin.php?page=wpclever-kit5,7352.1335.1255.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpc-smart-messages/wpc-smart-messages.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention: Please take inspiration from this readme.txt

wpc-smart-messages/wpc-smart-messages.php Passed 13 tests

The primary PHP file in "WPC Smart Messages for WooCommerce" version 4.1.5 is used by WordPress to initiate all plugin functionality
80 characters long description:
Display messages throughout your store through smart conditional logic settings.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin7,343 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript84311102,491
PHP23429952,455
CSS74191602,040
Sass1580328
SVG10029

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity46.25
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods73
▷ Static methods56.85%
▷ Public methods73100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants8
▷ Global constants8100.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 were not PNG files found in your plugin