83% add-product-to-cart-via-url

Code Review | Add Product To Cart Via URL

WordPress plugin Add Product To Cart Via URL scored83%from 54 tests.

About plugin

  • Plugin page: add-product-to-ca...
  • Plugin version: 2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2022
  • Latest release: Feb 8, 2023
  • Number of updates: 17
  • Update frequency: every 5.0 days
  • Top authors: onethruten@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Add Product To Cart Via URL
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.80 ▼5.53
Dashboard /wp-admin3.31 ▲0.0149.48 ▼22.76
Posts /wp-admin/edit.php3.36 ▲0.0142.35 ▼4.29
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.64 ▼5.72
Media Library /wp-admin/upload.php3.23 ▲0.0138.21 ▲5.64

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

An overview of browser requirements for Add Product To Cart Via URL
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲18113.81 ▼0.576.24 ▲4.5439.95 ▼5.15
Dashboard /wp-admin2,203 ▲155.84 ▼0.0597.49 ▼22.8238.18 ▼5.98
Posts /wp-admin/edit.php2,086 ▼32.02 ▲0.0136.09 ▼1.9631.26 ▼5.41
Add New Post /wp-admin/post-new.php1,533 ▲423.04 ▲4.58676.89 ▲62.6164.10 ▼0.91
Media Library /wp-admin/upload.php1,385 ▼64.13 ▼0.08109.91 ▲15.0546.49 ▲5.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/add-product-to-cart-via-url/woocommerce-add-product-to-cart-via-url.php:15
    • > PHP Notice
      Undefined variable: template in wp-content/plugins/add-product-to-cart-via-url/templates/productsForm.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get() on null in wp-content/plugins/add-product-to-cart-via-url/templates/productsForm.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 79% 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
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #2 (Multiple products can be added with this form also.)
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

add-product-to-cart-via-url/woocommerce-add-product-to-cart-via-url.php 69% from 13 tests

"Add Product To Cart Via URL" version 2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 293 characters long)
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("add-product-to-cart-via-url.php" instead of "woocommerce-add-product-to-cart-via-url.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
Success! There were no dangerous files found in this plugin541 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP27288274
JavaScript24924220
CSS10047

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 were not PNG files found in your plugin