83% cart32-shopping-cart

Code Review | Cart32 Shopping Cart

WordPress plugin Cart32 Shopping Cart scored83%from 54 tests.

About plugin

  • Plugin page: cart32-shopping-cart
  • Plugin version: 2.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.4
  • WordPress version: 6.3.1
  • First release: Jul 11, 2013
  • Latest release: Dec 2, 2015
  • Number of updates: 21
  • Update frequency: every 41.6 days
  • Top authors: beaubC32 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,719 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.68ms] Passed 4 tests

A check of server-side resources used by Cart32 Shopping Cart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1355.30 ▲7.93
Dashboard /wp-admin3.41 ▲0.1154.27 ▼2.75
Posts /wp-admin/edit.php3.46 ▲0.1149.70 ▼11.61
Add New Post /wp-admin/post-new.php5.99 ▲0.1187.83 ▼5.72
Media Library /wp-admin/upload.php3.33 ▲0.1143.94 ▲5.35
Cart32 Shopping Cart /wp-admin/options-general.php?page=Cart32Wordpress3.2941.83

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 10 new options
New WordPress options
cart32wp_c32web_url
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
last_cart32_call
last_cart32_update
cart32wp_cart32_url
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Cart32 Shopping Cart
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17814.48 ▲0.131.86 ▼0.1343.99 ▼3.27
Dashboard /wp-admin2,327 ▲1364.81 ▼1.07117.11 ▲6.1142.16 ▼0.98
Posts /wp-admin/edit.php2,217 ▲1252.01 ▲0.0038.21 ▼3.4533.83 ▼1.98
Add New Post /wp-admin/post-new.php1,666 ▲13323.36 ▲0.29662.09 ▲5.7850.16 ▼9.37
Media Library /wp-admin/upload.php1,513 ▲1254.22 ▼0.00108.63 ▲11.0247.95 ▲5.94
Cart32 Shopping Cart /wp-admin/options-general.php?page=Cart32Wordpress1,0771.9534.9434.21

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 10 options in the database
    • last_cart32_update
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • last_cart32_call
    • cart32wp_cart32_url
    • widget_theysaidso_widget
    • cart32wp_c32web_url
    • can_compress_scripts

Smoke tests 75% from 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 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
Please fix the following
  • 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/cart32-shopping-cart/cart32.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/cart32-shopping-cart/cart32template.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 20 tag instead of maximum 10
  • Plugin Name: Please specify the plugin name on the first line ( === cart32-shopping-cart === )
You can take inspiration from this readme.txt

cart32-shopping-cart/cart32.php 92% from 13 tests

The principal PHP file in "Cart32 Shopping Cart" v. 2.0.11 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cart32-shopping-cart.php" instead of "cart32.php")

Code Analysis Passed 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 plugin582 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP35553582

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
Functions21
▷ Named functions21100.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
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
cart32_for_wordpress.png9.28KB3.62KB▼ 61.03%