78% sustainable-ecommerce-cart

Code Review | Sustainable eCommerce cart

WordPress plugin Sustainable eCommerce cart scored78%from 54 tests.

About plugin

  • Plugin page: sustainable-ecomm...
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 14, 2023
  • Latest release: Mar 19, 2023
  • Number of updates: 11
  • Update frequency: every 3.1 days
  • Top authors: netzerosm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /239 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.79ms] Passed 4 tests

A check of server-side resources used by Sustainable eCommerce cart
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0849.06 ▲5.93
Dashboard /wp-admin3.38 ▲0.0854.02 ▼5.30
Posts /wp-admin/edit.php3.49 ▲0.1449.21 ▼0.96
Add New Post /wp-admin/post-new.php5.96 ▲0.0885.88 ▼10.00
Media Library /wp-admin/upload.php3.30 ▲0.0741.79 ▲5.10

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 284 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Sustainable eCommerce cart
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.34 ▼0.011.73 ▼0.1044.38 ▼0.97
Dashboard /wp-admin2,195 ▲215.55 ▲0.0290.81 ▼11.6441.73 ▼4.13
Posts /wp-admin/edit.php2,103 ▲32.02 ▼0.0135.89 ▼3.0934.04 ▼4.84
Add New Post /wp-admin/post-new.php1,529 ▲123.12 ▼0.11636.01 ▼37.3953.32 ▼4.12
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.13106.24 ▼0.3745.47 ▼1.81

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sustainable-ecommerce-cart/src/templates/messages.php
    • > /wp-content/plugins/sustainable-ecommerce-cart/src/templates/field-errors.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Singleton' not found in wp-content/plugins/sustainable-ecommerce-cart/src/classes/class-failed-orders.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Helper' not found in wp-content/plugins/sustainable-ecommerce-cart/src/templates/start.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Singleton' not found in wp-content/plugins/sustainable-ecommerce-cart/src/classes/class-rest-routes.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Helper' not found in wp-content/plugins/sustainable-ecommerce-cart/src/templates/header.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Helper' not found in wp-content/plugins/sustainable-ecommerce-cart/src/templates/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Singleton' not found in wp-content/plugins/sustainable-ecommerce-cart/src/classes/class-currency-rates.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Helper' not found in wp-content/plugins/sustainable-ecommerce-cart/src/templates/journey.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Helper' not found in wp-content/plugins/sustainable-ecommerce-cart/src/templates/front/save-trees-popup.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Singleton' not found in wp-content/plugins/sustainable-ecommerce-cart/src/classes/class-wp-admin.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Rgbcode\\Plugins\etzero_SM\\Classes\\Singleton' not found in wp-content/plugins/sustainable-ecommerce-cart/src/classes/class-flash.php:4

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: sustainable shopping, carbon offset, carbon footprint, sustainability, climate friendly

sustainable-ecommerce-cart/rgbc-netzero-sm.php 85% from 13 tests

The main PHP file in "Sustainable eCommerce cart" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sustainable-ecommerce-cart.php" instead of "rgbc-netzero-sm.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
Everything looks great! No dangerous files found in this plugin21,542 lines of code in 186 files:
LanguageFilesBlank linesComment linesLines of code
PO File285,6565,76813,741
PHP417296123,617
Sass44173143,105
SVG4900632
JavaScript20916443
CSS4004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.09
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods135
▷ Static methods10.74%
▷ Public methods10779.26%
▷ Protected methods42.96%
▷ Private methods2417.78%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants77
▷ Global constants33.90%
▷ Class constants7496.10%
▷ Public constants74100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 1.60MB with 0.79MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/assets/images/cart-preview/widget_place_a_gray.png79.04KB30.20KB▼ 61.79%
src/assets/images/cart-preview/widget_place_b_dark.png79.22KB30.10KB▼ 62.00%
src/assets/images/title-bg.png383.07KB423.95KB0.00%
src/assets/images/cart-preview/widget_place_a_green.png79.13KB30.05KB▼ 62.03%
src/assets/images/cart-preview/widget_place_b_green.png78.26KB29.87KB▼ 61.84%