77% cart-product-images-woocommmerce

Code Review | Cart Product Images Woocommmerce

WordPress plugin Cart Product Images Woocommmerce scored77%from 54 tests.

About plugin

  • Plugin page: cart-product-imag...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2.0
  • WordPress version: 6.3.1
  • First release: May 5, 2021
  • Latest release: Apr 19, 2023
  • Number of updates: 13
  • Update frequency: every 54.9 days
  • Top authors: adnanhyder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /532 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by Cart Product Images Woocommmerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.17 ▲2.50
Dashboard /wp-admin3.31 ▲0.0146.35 ▼1.38
Posts /wp-admin/edit.php3.36 ▲0.0144.13 ▼3.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.04 ▼9.70
Media Library /wp-admin/upload.php3.23 ▲0.0136.00 ▲1.06

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Cart Product Images Woocommmerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.71 ▼0.721.71 ▼0.0842.98 ▼7.13
Dashboard /wp-admin2,209 ▲215.83 ▼0.05103.81 ▲1.1739.66 ▼4.74
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0233.81 ▼2.5431.22 ▼3.75
Add New Post /wp-admin/post-new.php1,535 ▼623.14 ▲4.87684.00 ▲74.6746.37 ▼6.42
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0198.20 ▲1.9843.89 ▼0.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cart-product-images-woocommmerce/public/partials/cpiw-public-display.php
    • > /wp-content/plugins/cart-product-images-woocommmerce/admin/partials/cpiw-admin-display.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-product-images-woocommmerce/admin/views/tabs/hcpiwMethod.php:15
    • > PHP Notice
      Undefined variable: active_tab in wp-content/plugins/cart-product-images-woocommmerce/admin/views/hcpiwMethods.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-product-images-woocommmerce/admin/views/tabs/hcpiwMethod.php:15

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)
Everything seems fine on the user side

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
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (overview of the plugin)
  • Donate link: Please fix this invalid URI: "12345adnan@gmail.com"
Please take inspiration from this readme.txt

cart-product-images-woocommmerce/cpiw.php 85% from 13 tests

The principal PHP file in "Cart Product Images Woocommmerce" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cart-product-images-woocommmerce.php" instead of "cpiw.php")
  • 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

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 plugin275 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14144545269
JavaScript24546
CSS2080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity1.57
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.15
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants1
▷ Global constants1100.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
No PNG files were detected