83% dynamic-cart-messages-woocommerce

Code Review | Dynamic Cart Messages for WooCommerce

WordPress plugin Dynamic Cart Messages for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: dynamic-cart-mess...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2022
  • Latest release: Aug 30, 2023
  • Number of updates: 14
  • Update frequency: every 32.4 days
  • Top authors: saffiretech (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,363 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼5.53ms] Passed 4 tests

A check of server-side resources used by Dynamic Cart Messages for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.66 ▼3.15
Dashboard /wp-admin3.31 ▼0.0454.50 ▼1.56
Posts /wp-admin/edit.php3.36 ▲0.0044.27 ▼4.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.19 ▼12.65
Media Library /wp-admin/upload.php3.23 ▲0.0035.00 ▲0.83

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Dynamic Cart Messages for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.111.68 ▲0.0943.69 ▲2.73
Dashboard /wp-admin2,195 ▲185.59 ▼0.0793.60 ▲4.2846.93 ▲6.78
Posts /wp-admin/edit.php2,100 ▼32.00 ▼0.0234.00 ▼1.1334.23 ▼4.54
Add New Post /wp-admin/post-new.php1,531 ▲323.12 ▼0.24675.72 ▲3.7553.96 ▼8.74
Media Library /wp-admin/upload.php1,397 ▼34.16 ▲0.0597.34 ▼8.5144.57 ▼3.63

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-cart-messages-woocommerce/includes/dcmp-settings.php:257
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dynamic-cart-messages-woocommerce/includes/dcmp-functions.php:194

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

dynamic-cart-messages-woocommerce/dynamic-cart-messages-woocommerce.php 92% from 13 tests

"Dynamic Cart Messages for WooCommerce" version 1.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 194 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,048 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3152192864
CSS31416114
JavaScript1171070

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions2996.67%
▷ Anonymous functions13.33%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.78MB with 0.51MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-3.png161.77KB56.30KB▼ 65.20%
assets/images/screenshot-1.png107.20KB35.76KB▼ 66.64%
assets/images/screenshot-6.png91.87KB31.94KB▼ 65.23%
assets/images/screenshot-4.png171.53KB62.21KB▼ 63.73%
assets/images/screenshot-2.png160.14KB57.54KB▼ 64.07%