73% simple-cart-solution

Code Review | Simple Cart

WordPress plugin Simple Cart scored73%from 54 tests.

About plugin

  • Plugin page: simple-cart-solution
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Dec 9, 2019
  • Latest release: Apr 17, 2022
  • Number of updates: 10
  • Update frequency: every 86.1 days
  • Top authors: ibenic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,099 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲4.98MB] [CPU: ▲14.73ms] Passed 4 tests

A check of server-side resources used by Simple Cart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /8.77 ▲5.3058.80 ▲18.57
Dashboard /wp-admin8.79 ▲5.4470.45 ▲11.05
Posts /wp-admin/edit.php8.79 ▲5.4376.70 ▲30.58
Add New Post /wp-admin/post-new.php9.62 ▲3.73100.14 ▼1.27
Media Library /wp-admin/upload.php8.79 ▲5.5664.74 ▲31.58
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.7952.51

Server storage [IO: ▲4.16MB] [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: 213 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
fs_debug_mode
widget_recent-posts
db_upgraded
can_compress_scripts
fs_accounts
fs_gdpr
fs_active_plugins

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Cart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲17813.69 ▼0.509.21 ▲7.6828.24 ▼9.10
Dashboard /wp-admin2,230 ▲505.48 ▼0.2084.06 ▼6.1540.16 ▼1.67
Posts /wp-admin/edit.php2,133 ▲331.98 ▲0.0040.53 ▲6.0438.58 ▲5.83
Add New Post /wp-admin/post-new.php1,553 ▲2722.98 ▼0.09699.81 ▲57.4350.11 ▼3.58
Media Library /wp-admin/upload.php1,435 ▲354.31 ▲0.1695.59 ▼3.7446.87 ▲2.77
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0691.7024.1727.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/simple-cart-solution/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • fs_active_plugins
    • widget_recent-posts
    • fs_accounts
    • can_compress_scripts
    • widget_recent-comments
    • fs_debug_mode
    • fs_gdpr
    • db_upgraded
    • theysaidso_admin_options
    • 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
Everything seems fine, however 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 items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'SimpleCart\\Abstracts\\Cart' not found in wp-content/plugins/simple-cart-solution/includes/carts/class-edd.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'SimpleCart\\Interfaces\\Cart' not found in wp-content/plugins/simple-cart-solution/includes/abstracts/class-cart.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/simple-cart-solution/templates/cart-button.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/simple-cart-solution/templates/cart-popup.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SimpleCart\\Abstracts\\Cart' not found in wp-content/plugins/simple-cart-solution/includes/carts/class-woocommerce.php:14

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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
7 plugin tags: cart, ecommerce, commerce, sales, easy-digital-downloads...

simple-cart-solution/simple-cart.php 77% from 13 tests

"Simple Cart" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-cart-solution.php" instead of "simple-cart.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin47,587 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
PHP1207,48416,45631,428
PO File126,9608,45515,240
JavaScript106068355
Sass8400306
Markdown1680214
JSON10027
CSS140017

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity75.14
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes55
▷ Abstract classes35.45%
▷ Concrete classes5294.55%
▷ Final classes00.00%
Methods1,204
▷ Static methods18415.28%
▷ Public methods86471.76%
▷ Protected methods151.25%
▷ Private methods32526.99%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants126
▷ Global constants10180.16%
▷ Class constants2519.84%
▷ Public constants25100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%