84% cardflow-for-woocommerce

Code Review | Cardflow for WooCommerce

WordPress plugin Cardflow for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: cardflow-for-wooc...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4.1
  • WordPress version: 6.3.1
  • First release: May 17, 2023
  • Latest release: Nov 10, 2023
  • Number of updates: 11
  • Update frequency: every 16.8 days
  • Top authors: dexbos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /424 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Cardflow for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.18 ▼3.71
Dashboard /wp-admin3.37 ▲0.0649.69 ▼1.15
Posts /wp-admin/edit.php3.48 ▲0.1249.38 ▲0.06
Add New Post /wp-admin/post-new.php5.95 ▲0.0679.38 ▼21.95
Media Library /wp-admin/upload.php3.29 ▲0.0635.32 ▲1.31

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 58 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cardflow for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3513.15 ▼1.191.60 ▼0.2542.45 ▼3.19
Dashboard /wp-admin2,202 ▲225.61 ▼0.0591.22 ▼8.5839.35 ▼9.05
Posts /wp-admin/edit.php2,104 ▲41.95 ▼0.0740.05 ▲2.1236.54 ▼2.52
Add New Post /wp-admin/post-new.php1,532 ▲123.44 ▲0.27613.39 ▼83.3366.92 ▲9.86
Media Library /wp-admin/upload.php1,410 ▲104.19 ▼0.0297.55 ▼10.9341.27 ▼4.53

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/psr/http-message/src/RequestInterface.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/HttpClient/Stream.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/HttpClient/HttpResponse.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Cardflow\\Client\\Services\\AbstractService' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/Services/GiftCardService.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Cardflow\\Client\\HttpClient\\CardflowHttpClientInterface' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/HttpClient/CardflowHttpClient.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/psr/http-message/src/ResponseInterface.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Cardflow\\Client\\Services\\AbstractService' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/Services/TransactionService.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Cardflow\\Client\\Resources\\AbstractResource' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/Resources/Transaction.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Cardflow\\Client\\Exceptions\\ApiException' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/cardflow/cardflow-php/src/Exceptions/MissingParameterException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/cardflow-for-woocommerce/vendor/psr/http-message/src/ServerRequestInterface.php:45

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)
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
6 plugin tags: cardflow, cadeaubon, coupon, cadeaukaart, gift card...

cardflow-for-woocommerce/cardflow-woocommerce.php 92% from 13 tests

"Cardflow for WooCommerce" version 1.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cardflow-for-woocommerce.php" instead of "cardflow-woocommerce.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
Everything looks great! No dangerous files found in this plugin3,060 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP365751,6291,811
JSON400413
SVG100406
Markdown5990301
PO File12532105
XML12024

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.10
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces11
Interfaces8
Traits2
Classes20
▷ Abstract classes210.00%
▷ Concrete classes1890.00%
▷ Final classes1372.22%
Methods213
▷ Static methods167.51%
▷ Public methods19390.61%
▷ Protected methods62.82%
▷ Private methods146.57%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants114.29%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/icon-128x128.png8.97KB3.80KB▼ 57.59%
.wordpress-org/icon-256x256.png21.94KB7.40KB▼ 66.28%