83% cart-products-for-woocommerce

Code Review | Cart Products for WordPress

WordPress plugin Cart Products for WordPress scored83%from 54 tests.

About plugin

  • Plugin page: cart-products-for...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1
  • WordPress version: 6.3.1
  • First release: Jan 11, 2019
  • Latest release: Feb 12, 2019
  • Number of updates: 6
  • Update frequency: every 5.3 days
  • Top authors: blueglassinteractive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,473 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Cart Products for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.63 ▼3.72
Dashboard /wp-admin3.31 ▼0.0446.69 ▼12.14
Posts /wp-admin/edit.php3.36 ▲0.0045.99 ▼0.70
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.14 ▼5.72
Media Library /wp-admin/upload.php3.23 ▲0.0034.47 ▼1.13

Server storage [IO: ▲0.50MB] [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: 30 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Cart Products for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.37 ▲0.021.62 ▼0.4841.01 ▼9.26
Dashboard /wp-admin2,195 ▲185.60 ▲0.0086.14 ▼28.1337.27 ▼7.40
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0138.26 ▼0.5735.55 ▲3.30
Add New Post /wp-admin/post-new.php1,526 ▼023.50 ▲0.41617.53 ▼34.3448.07 ▼13.97
Media Library /wp-admin/upload.php1,400 ▲34.21 ▲0.0298.80 ▼3.7741.16 ▼6.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/cart-products-for-woocommerce/templates/cart-actions.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: You can look at the official readme.txt

cart-products-for-woocommerce/card-products.php 85% from 13 tests

The main PHP script in "Cart Products for WordPress" version 1.0.4 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cart-products-for-woocommerce.php" instead of "card-products.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.3" instead of "3.0")

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
There were no executable files found in this plugin1,666 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP92151121,118
JavaScript55943293
CSS2300146
SVG20270
Sass34139

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity13.75
▷ Minimum class complexity2.00
▷ Maximum class complexity32.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods35
▷ Static methods1542.86%
▷ Public methods3291.43%
▷ Protected methods25.71%
▷ Private methods12.86%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.23MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png87.85KB24.47KB▼ 72.15%
assets/screenshot-3.png69.62KB20.99KB▼ 69.85%
assets/screenshot-1.png79.13KB22.53KB▼ 71.53%