10% ajax-floating-cart

Code Review | Ajax Floating Cart

WordPress plugin Ajax Floating Cart scored10%from 54 tests.

About plugin

  • Plugin page: ajax-floating-cart
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Aug 14, 2021
  • Latest release: May 23, 2022
  • Number of updates: 3
  • Update frequency: every 94.3 days
  • Top authors: ashad531410 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /419 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin did not install without errors
    • > User error in wp-content/plugins/ajax-floating-cart/ajax-floating-cart.php+46
    Please active Woocommerce before using Ajax Floating Cart Plugin.

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.68ms] Passed 4 tests

Server-side resources used by Ajax Floating Cart
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.61 ▼1.65
Dashboard /wp-admin3.36 ▲0.0246.26 ▼14.57
Posts /wp-admin/edit.php3.48 ▲0.1251.24 ▲6.82
Add New Post /wp-admin/post-new.php5.94 ▲0.0680.35 ▼13.71
Media Library /wp-admin/upload.php3.28 ▲0.0635.43 ▲3.22

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Ajax Floating Cart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲13213.59 ▼0.704.68 ▲2.8843.07 ▼0.42
Dashboard /wp-admin2,206 ▲275.84 ▼0.03101.77 ▼13.9937.88 ▼11.92
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0139.16 ▲1.6136.15 ▲3.04
Add New Post /wp-admin/post-new.php1,534 ▲522.94 ▼0.06664.48 ▲24.2855.06 ▼1.65
Media Library /wp-admin/upload.php1,391 ▲64.21 ▼0.0294.74 ▼2.0943.43 ▲2.20

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

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

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% 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: floating cart, woocommerce cart, woocommerce, ajax cart, ajax floating cart

ajax-floating-cart/ajax-floating-cart.php 92% from 13 tests

The primary PHP file in "Ajax Floating Cart" version 1.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin605 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9101356327
CSS106223
JavaScript14355

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity1.52
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1982.61%
▷ Protected methods00.00%
▷ Private methods417.39%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/shopping-cart.png13.50KB9.37KB▼ 30.60%