93% sixa-add-to-cart-block

Code Review | Sixa Add to Cart Block

WordPress plugin Sixa Add to Cart Block scored 93% from 54 tests.

About plugin

  • Plugin page: sixa-add-to-cart-...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.9
  • WordPress version: 5.9.2
  • First release: Dec 16, 2021
  • Latest release: Mar 25, 2022
  • Number of updates: 7
  • Update frequency: every 14.1 days
  • Top authors: sixa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 80 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼296.49ms] Passed 4 tests

This is a short check of server-side resources used by Sixa Add to Cart Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.2556.68 ▲3.29
Dashboard /wp-admin3.60 ▲0.1934.42 ▲0.53
Posts /wp-admin/edit.php3.83 ▲0.1838.82 ▼9.27
Add New Post /wp-admin/post-new.php7.13 ▲0.1692.68 ▼1,178.03
Media Library /wp-admin/upload.php3.54 ▲0.2424.83 ▲0.80

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 104 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Sixa Add to Cart Block: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲6316.21 ▲0.567.33 ▼0.372.12 ▼0.55
Dashboard /wp-admin2,895 ▲346.17 ▼0.06120.73 ▼15.50158.64 ▲0.06
Posts /wp-admin/edit.php2,694 ▲33.23 ▲0.0161.39 ▼3.30140.49 ▼4.29
Add New Post /wp-admin/post-new.php1,661 ▼015.57 ▲0.02403.64 ▼1.83154.28 ▲2.79
Media Library /wp-admin/upload.php1,695 ▼35.53 ▲0.01140.46 ▼24.76179.84 ▼4.54

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require(wp-content/plugins/sixa-add-to-cart-block/trunk/vendor/sixach/wp-snippets/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/sixa-add-to-cart-block/trunk/vendor/sixach/wp-snippets/sixa-snippets.php on line 34
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/sixa-add-to-cart-block/trunk/vendor/sixach/wp-snippets/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/sixa-add-to-cart-block/trunk/vendor/sixach/wp-snippets/sixa-snippets.php on line 34
    • > PHP Warning
      require(wp-content/plugins/sixa-add-to-cart-block/vendor/sixach/wp-snippets/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/sixa-add-to-cart-block/vendor/sixach/wp-snippets/sixa-snippets.php on line 34
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/sixa-add-to-cart-block/vendor/sixach/wp-snippets/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/sixa-add-to-cart-block/vendor/sixach/wp-snippets/sixa-snippets.php on line 34

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: gutenberg, shop, button, block, ecommerce...

sixa-add-to-cart-block/index.php 77% from 13 tests

The primary PHP file in "Sixa Add to Cart Block" version 1.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 229 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sixa-add-to-cart-block.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected3,914 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP408312,5763,730
JSON200183
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity17.47
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes60
▷ Abstract classes813.33%
▷ Concrete classes5286.67%
▷ Final classes815.38%
Methods424
▷ Static methods22452.83%
▷ Public methods34882.08%
▷ Protected methods5011.79%
▷ Private methods266.13%
Functions20
▷ Named functions210.00%
▷ Anonymous functions1890.00%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants2284.62%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin