89% wc-ajax-product-add-to-cart

Code Review | Woo Ajax Add to Cart product page

WordPress plugin Woo Ajax Add to Cart product page scored89%from 54 tests.

About plugin

  • Plugin page: wc-ajax-product-a...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1
  • WordPress version: 6.3.1
  • First release: Sep 27, 2018
  • Latest release: Jun 13, 2019
  • Number of updates: 9
  • Update frequency: every 28.8 days
  • Top authors: m1tk00 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,106 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.24ms] Passed 4 tests

This is a short check of server-side resources used by Woo Ajax Add to Cart product page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.98 ▼0.78
Dashboard /wp-admin3.31 ▲0.0144.74 ▼1.59
Posts /wp-admin/edit.php3.36 ▲0.0047.59 ▼0.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.20 ▼6.22
Media Library /wp-admin/upload.php3.23 ▲0.0035.32 ▲0.70

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

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

Browser metrics Passed 4 tests

Woo Ajax Add to Cart product page: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.074.32 ▲2.4139.38 ▼5.46
Dashboard /wp-admin2,206 ▲184.86 ▼0.02111.19 ▼4.1940.47 ▼4.24
Posts /wp-admin/edit.php2,092 ▲32.00 ▲0.0240.01 ▲2.6435.02 ▲0.74
Add New Post /wp-admin/post-new.php1,535 ▲2123.23 ▲5.54675.96 ▼6.4152.86 ▼18.76
Media Library /wp-admin/upload.php1,385 ▼64.18 ▼0.0897.96 ▼6.0341.20 ▼3.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely 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
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Donate link: Invalid URI found ("webpigment.com")
  • Screenshots: Screenshot #1 (This screenshot explains where the enable checkbox is placed. You can see it at the bottom of the screenshot.) image required
Please take inspiration from this readme.txt

wc-ajax-product-add-to-cart/wc-ajax-product-add-to-cart.php 92% from 13 tests

The entry point to "Woo Ajax Add to Cart product page" version 1.2.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • 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 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin269 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP889420213
JavaScript19156

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.80
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1773.91%
▷ Protected methods14.35%
▷ Private methods521.74%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected