78% promotion-products-in-cart-for-woocommerce

Code Review | Promotion Products in Cart for WooCommerce

WordPress plugin Promotion Products in Cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: promotion-product...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.5
  • WordPress version: 6.3.1
  • First release: Aug 18, 2020
  • Latest release: Aug 18, 2020
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: wpboss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /358 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.74ms] Passed 4 tests

A check of server-side resources used by Promotion Products in Cart for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0641.90 ▲6.02
Dashboard /wp-admin3.37 ▲0.0644.95 ▲1.44
Posts /wp-admin/edit.php3.48 ▲0.1244.12 ▼0.65
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.26 ▼2.25
Media Library /wp-admin/upload.php3.29 ▲0.0631.96 ▼1.49
Promotion Products in Cart /wp-admin/admin.php?page=promotion-product-cart3.3131.33

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Promotion Products in Cart for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.30 ▼0.771.78 ▼0.0243.32 ▲1.64
Dashboard /wp-admin2,200 ▲115.83 ▲0.94101.85 ▼9.9540.61 ▲0.59
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0334.86 ▲0.3534.53 ▼0.23
Add New Post /wp-admin/post-new.php1,533 ▼023.12 ▼0.10583.24 ▼70.7152.31 ▼17.45
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.0594.86 ▼6.4641.35 ▼3.40
Promotion Products in Cart /wp-admin/admin.php?page=promotion-product-cart1,0092.0722.4623.94

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=promotion-product-cart
    • > Notice in wp-includes/class-walker-category-dropdown.php+76
    Trying to get property 'term_id' of non-object
    • > GET request to /wp-admin/admin.php?page=promotion-product-cart
    • > Notice in wp-includes/class-walker-category-dropdown.php+65
    Trying to get property 'name' of non-object

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/promotion-products-in-cart-for-woocommerce/admin/partials/promotion-product-cart-setting-page.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: The official readme.txt is a good inspiration

promotion-products-in-cart-for-woocommerce/promotion-product-cart.php 85% from 13 tests

The entry point to "Promotion Products in Cart for WooCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("promotion-products-in-cart-for-woocommerce.php" instead of "promotion-product-cart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected363 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP11117476344
JavaScript132719

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity2.29
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.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
There are no PNG files in this plugin