83% cart-ninja-wordpress-shopping-cart

Code Review | CartNinja - Wordpress Shopping Cart

WordPress plugin CartNinja - Wordpress Shopping Cart scored83%from 54 tests.

About plugin

  • Plugin page: cart-ninja-wordpr...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3.2
  • WordPress version: 6.3.1
  • First release: Jun 14, 2012
  • Latest release: Aug 30, 2012
  • Number of updates: 10
  • Update frequency: every 7.8 days
  • Top authors: CartNinja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,361 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by CartNinja - Wordpress Shopping Cart
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.69 ▼1.28
Dashboard /wp-admin3.31 ▲0.0147.14 ▼7.48
Posts /wp-admin/edit.php3.36 ▲0.0148.84 ▲0.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.52 ▼20.57
Media Library /wp-admin/upload.php3.24 ▲0.0143.59 ▲4.91

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
CNCSS
db_upgraded
widget_theysaidso_widget
widget_recent-comments
CNJS
theysaidso_admin_options
can_compress_scripts
CNOutputForm

Browser metrics Passed 4 tests

A check of browser resources used by CartNinja - Wordpress Shopping Cart
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲14913.89 ▼0.457.69 ▲5.8541.45 ▼3.08
Dashboard /wp-admin2,213 ▲335.59 ▼0.0788.07 ▼2.2065.40 ▲20.91
Posts /wp-admin/edit.php2,115 ▲151.99 ▼0.0033.28 ▼7.0232.75 ▼4.89
Add New Post /wp-admin/post-new.php6,515 ▲4,98927.37 ▲3.79994.05 ▲332.1472.80 ▲19.19
Media Library /wp-admin/upload.php1,412 ▲154.20 ▲0.09102.99 ▼0.2479.75 ▲38.18

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • CNCSS
    • db_upgraded
    • widget_recent-posts
    • CNJS
    • CNOutputForm
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-ninja-wordpress-shopping-cart/CartNinja.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Logo), #2 (Sales Reports), #3 (Adding in Products), #4 (Add to Cart Form), #5 (Cart Ninja Dashboard)
The official readme.txt might help

cart-ninja-wordpress-shopping-cart/CartNinja.php 85% from 13 tests

The primary PHP file in "CartNinja - Wordpress Shopping Cart" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 341 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cart-ninja-wordpress-shopping-cart.php" instead of "CartNinja.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
Good job! No executable or dangerous file extensions detected573 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP110234376
CSS100137
JavaScript120660

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.31MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png38.30KB15.30KB▼ 60.05%
screenshot-2.png32.22KB13.55KB▼ 57.96%
banner-772x250.png45.79KB20.66KB▼ 54.88%
CNLogo.png26.82KB10.81KB▼ 59.70%
defaultBox.png3.65KB2.87KB▼ 21.28%