77% custom-checkout-layouts-for-woocommerce

Code Review | One page checkout and layouts for woocommerce

WordPress plugin One page checkout and layouts for woocommerce scored77%from 54 tests.

About plugin

  • Plugin page: custom-checkout-l...
  • Plugin version: 4.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.3.2
  • WordPress version: 6.3.1
  • First release: May 2, 2019
  • Latest release: Nov 23, 2023
  • Number of updates: 102
  • Update frequency: every 16.4 days
  • Top authors: coolcoders (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

6,000+ active /122,006 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.68ms] Passed 4 tests

A check of server-side resources used by One page checkout and layouts for woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.95 ▼0.5219.92 ▼22.02
Dashboard /wp-admin3.57 ▲0.2746.90 ▲0.19
Posts /wp-admin/edit.php3.62 ▲0.2651.34 ▲5.39
Add New Post /wp-admin/post-new.php6.16 ▲0.2794.18 ▲1.26
Media Library /wp-admin/upload.php3.49 ▲0.2637.44 ▲1.84
Customize Checkout Fields /wp-admin/admin.php?page=custom_checkout_settings&page=cclw_checkout_fields4.5748.62
Replace Text /wp-admin/admin.php?page=custom_checkout_settings&page=cclw_pro_version3.4832.62
Global Style /wp-admin/admin.php?page=custom_checkout_settings&page=cclw_global_css3.5732.39

Server storage [IO: ▲3.76MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

One page checkout and layouts for woocommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,481 ▼30614.73 ▲0.630.59 ▼1.2918.69 ▼26.54
Dashboard /wp-admin2,234 ▲545.73 ▲0.1296.95 ▲9.0341.17 ▲3.06
Posts /wp-admin/edit.php2,136 ▲332.07 ▲0.1142.14 ▲0.9329.66 ▼4.95
Add New Post /wp-admin/post-new.php1,556 ▲2623.73 ▲0.70660.83 ▼6.2867.95 ▲5.75
Media Library /wp-admin/upload.php1,439 ▲424.27 ▲0.0596.30 ▲0.2240.34 ▼1.80
Customize Checkout Fields /wp-admin/admin.php?page=custom_checkout_settings&page=cclw_checkout_fields3,1402.0433.4128.16
Replace Text /wp-admin/admin.php?page=custom_checkout_settings&page=cclw_pro_version8792.2933.9423.43
Global Style /wp-admin/admin.php?page=custom_checkout_settings&page=cclw_global_css1,8582.5980.8623.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/two-column-layout.php
    • > /wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/three-column-layout.php
    • > /wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/one-column-layout.php
    • > /wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/cart-checkout-layout.php
  • 92× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-checkout-layouts-for-woocommerce/includes/front/shipping_fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/cclw_includes/cclw_additional_fields.php:3
    • > PHP Warning
      Use of undefined constant CCLW_PLUGIN_DIR - assumed 'CCLW_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/two-column-layout.php on line 11
    • > PHP Warning
      include_once(CCLW_PLUGIN_DIRWooCommerce/checkout/cclw_includes/cclw_billing_details_section.php): failed to open stream: No such file or directory in wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/three-column-layout.php on line 2
    • > PHP Warning
      Use of undefined constant CCLW_PLUGIN_DIR - assumed 'CCLW_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/cart-checkout-layout.php on line 12
    • > PHP Warning
      Use of undefined constant CCLW_PLUGIN_DIR - assumed 'CCLW_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/one-column-layout.php on line 4
    • > PHP Warning
      Use of undefined constant CCLW_PLUGIN_DIR - assumed 'CCLW_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-checkout-layouts-for-woocommerce/WooCommerce/checkout/layouts/two-column-layout.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/custom-checkout-layouts-for-woocommerce/cmb2/includes/types/CMB2_Type_Title.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-checkout-layouts-for-woocommerce/includes/template_style.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function new_cmb2_box() in wp-content/plugins/custom-checkout-layouts-for-woocommerce/includes/admin/setting_panel.php:4

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 Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: checkout, woocommerce one page checkout, woocommerce checkout, single page checkout, multi step checkout...

custom-checkout-layouts-for-woocommerce/woocommerce-one-page-checkout-and-layouts.php 77% from 13 tests

The main file in "One page checkout and layouts for woocommerce" v. 4.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "3.4")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-checkout-layouts-for-woocommerce.php" instead of "woocommerce-one-page-checkout-and-layouts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin55,671 lines of code in 232 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP842,6216,5539,470
JavaScript101,7581,3907,197
CSS153531,2585,926
Markdown32440755

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity19.13
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes912.68%
▷ Concrete classes6287.32%
▷ Final classes00.00%
Methods570
▷ Static methods9316.32%
▷ Public methods47783.68%
▷ Protected methods9015.79%
▷ Private methods30.53%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants646.15%
▷ Class constants753.85%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.52MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
asserts/images/icon.png1.06KB1.35KB0.00%
asserts/images/cclw_pro_features.png503.25KB176.13KB▼ 65.00%
cmb2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%