79% cart-notify

Code Review | Cart Notify

WordPress plugin Cart Notify scored79%from 54 tests.

About plugin

  • Plugin page: cart-notify
  • Plugin version: 1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 24, 2022
  • Latest release: Sep 28, 2023
  • Number of updates: 3
  • Update frequency: every 93.0 days
  • Top authors: hemelhasan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /156 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.74MB] [CPU: ▼57.14ms] Passed 4 tests

An overview of server-side resources used by Cart Notify
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.216.18 ▼45.24
Dashboard /wp-admin2.27 ▼1.037.31 ▼45.47
Posts /wp-admin/edit.php2.27 ▼1.087.49 ▼42.83
Add New Post /wp-admin/post-new.php2.27 ▼3.628.34 ▼95.02
Media Library /wp-admin/upload.php2.27 ▼0.968.47 ▼29.95

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
cart_notify_installed
widget_recent-comments
db_upgraded
cart_notify_version
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Cart Notify
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,900 ▲13913.43 ▼0.979.39 ▲7.7444.59 ▲0.84
Dashboard /wp-admin2,220 ▲435.66 ▼0.04101.39 ▲6.3149.51 ▲10.21
Posts /wp-admin/edit.php2,129 ▲292.02 ▲0.0138.08 ▲1.4048.55 ▲11.64
Add New Post /wp-admin/post-new.php1,569 ▲2923.24 ▼0.07602.36 ▼42.7059.44 ▲1.37
Media Library /wp-admin/upload.php1,425 ▲284.24 ▲0.03100.86 ▼5.1947.60 ▲0.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the cartnotifyadmin-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • cart_notify_installed
    • cart_notify_version

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screenshot_1.png), #2 (Screenshot_2.png)
Please take inspiration from this readme.txt

cart-notify/cartnotify.php 85% from 13 tests

The entry point to "Cart Notify" version 1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cart-notify.php" instead of "cartnotify.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected968 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP18241529787
CSS2306116
JavaScript126360
JSON1005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity9.67
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods61
▷ Static methods1931.15%
▷ Public methods5895.08%
▷ Protected methods00.00%
▷ Private methods34.92%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/cartnotify_layout_1.png10.29KB5.11KB▼ 50.39%