78% wcvn-one-page-checkout

Code Review | One Page Checkout for WooCommerce

WordPress plugin One Page Checkout for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: wcvn-one-page-che...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.2
  • WordPress version: 5.8.1
  • First release: Jul 7, 2021
  • Latest release: Jul 8, 2021
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: thientran2359 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 202 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼143.69ms] Passed 4 tests

Analyzing server-side resources used by One Page Checkout for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1338.09 ▲2.40
Dashboard /wp-admin3.25 ▲0.1954.05 ▲1.77
Posts /wp-admin/edit.php3.30 ▲0.1942.02 ▼7.38
Add New Post /wp-admin/post-new.php5.54 ▲0.1196.73 ▼571.56
Media Library /wp-admin/upload.php3.13 ▲0.1339.41 ▲4.71

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 54 new files
Database: no new tables, 1 new option
New WordPress options
onepagecheckout_do_activation_redirect

Browser metrics Passed 4 tests

One Page Checkout for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,722 ▲12616.46 ▲0.7910.34 ▼1.9049.40 ▼3.08
Dashboard /wp-admin2,979 ▲485.94 ▼0.00155.09 ▼15.72118.90 ▼0.16
Posts /wp-admin/edit.php2,748 ▲92.72 ▲0.0272.34 ▲2.9290.71 ▲0.72
Add New Post /wp-admin/post-new.php1,689 ▲618.67 ▼0.02422.89 ▲35.22114.98 ▼3.88
Media Library /wp-admin/upload.php1,813 ▲685.05 ▲0.03157.49 ▼30.03129.83 ▲6.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • onepagecheckout_do_activation_redirect

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/billing_details_section.php
    • > /wp-content/plugins/wcvn-one-page-checkout/admin/partials/onepagecheckout-admin-display.php
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WCVN_OPC_WC_TEMPLATE_PATH - assumed 'WCVN_OPC_WC_TEMPLATE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/billing_details_section.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/layouts/layout-2.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/review_order_section.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function remove_action() in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/subtotal_section.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WCVN_OnePageCheckout_Integrations_Base' not found in wp-content/plugins/wcvn-one-page-checkout/integrations/themes/flatsome.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function woocommerce_checkout_payment() in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/payment_section.php:2
    • > PHP Notice
      Trying to get property 'checkout_fields' of non-object in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/billing_details_section.php on line 2
    • > PHP Warning
      Use of undefined constant WCVN_OPC_PATH - assumed 'WCVN_OPC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wcvn-one-page-checkout/integrations/integrations.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'WCVN_OPC_WC_TEMPLATE_PATHcheckout/parts/additional_fields.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/parts/billing_details_section.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wcvn-one-page-checkout/public/templates/checkout/layouts/layout-1.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: woocommerce, onepagecheckout, one page checkout, checkout

wcvn-one-page-checkout/onepagecheckout-for-woocommerce.php 85% from 13 tests

The principal PHP file in "One Page Checkout for WooCommerce" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wcvn-one-page-checkout.php" instead of "onepagecheckout-for-woocommerce.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,535 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP343097591,194
CSS3187491,025
PO File189110217
JavaScript329299

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity1.69
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes18.33%
▷ Concrete classes1191.67%
▷ Final classes00.00%
Methods61
▷ Static methods813.11%
▷ Public methods5691.80%
▷ Protected methods00.00%
▷ Private methods58.20%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.63MB with 0.46MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png161.98KB44.11KB▼ 72.77%
screenshot-4.png161.98KB44.11KB▼ 72.77%
screenshot-1.png176.35KB47.57KB▼ 73.02%
screenshot-2.png146.88KB42.59KB▼ 71.00%