72% cart-checkout-confirmation

Code Review | Cart Checkout Confirmation

WordPress plugin Cart Checkout Confirmation scored72%from 54 tests.

About plugin

  • Plugin page: cart-checkout-con...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 7, 2022
  • Latest release: Mar 9, 2023
  • Number of updates: 30
  • Update frequency: every 8.2 days
  • Top authors: andbroinc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,015 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼4.15ms] Passed 4 tests

Analyzing server-side resources used by Cart Checkout Confirmation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1425.64 ▼12.31
Dashboard /wp-admin3.49 ▲0.1448.77 ▼10.30
Posts /wp-admin/edit.php3.59 ▲0.2347.74 ▲3.65
Add New Post /wp-admin/post-new.php6.07 ▲0.1896.21 ▲2.37
Media Library /wp-admin/upload.php3.42 ▲0.1940.42 ▲6.93
Edit /wp-admin/admin.php?page=cart-checkout-confirmation3.3732.92
Install Paid Version /wp-admin/admin.php?page=checkout-confirm-configure-fields3.3937.67

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 9 new options
New WordPress options
recovery_mode_email_last_sent
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
license_checkout_confirm
widget_theysaidso_widget
db_upgraded
confirm_on_off_text_bill
widget_recent-comments

Browser metrics Passed 4 tests

Cart Checkout Confirmation: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,532 ▼21415.27 ▲1.150.46 ▼1.1817.53 ▼21.26
Dashboard /wp-admin2,261 ▲866.50 ▲0.93101.02 ▼5.3365.24 ▲26.65
Posts /wp-admin/edit.php2,334 ▲2343.39 ▲1.3847.13 ▲4.9673.01 ▲35.64
Add New Post /wp-admin/post-new.php1,750 ▲22424.53 ▲1.63641.18 ▲31.3643.53 ▼14.93
Media Library /wp-admin/upload.php1,627 ▲2245.14 ▲0.98112.95 ▲15.7285.55 ▲40.93
Edit /wp-admin/admin.php?page=cart-checkout-confirmation7481.516.9028.97
Install Paid Version /wp-admin/admin.php?page=checkout-confirm-configure-fields1,1253.1645.9371.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-posts
    • confirm_on_off_text_bill
    • license_checkout_confirm
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • recovery_mode_email_last_sent

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=cart-checkout-confirmation
    • > Error in wp-content/plugins/cart-checkout-confirmation/admin/class-checkout-confirm-admin.php+197
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/cart-checkout-confirmation/admin/class-checkout-confirm-admin.php:197
    Stack trace:
    #0 wp-content/plugins/cart-checkout-confirmation/admin/class-checkout-confirm-admin.php(175): Checkout_Confirm_Admin->checkout_confirm_tab_fields()
    #1 wp-includes/class-wp-hook.php(310): Checkout_Confirm_Admin->checkout_confirm_config_tab()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-content/plugins/cart-checkout-confirmation/admin/views/configure.php(44): do_action()
    #5 wp-content/plugins/cart-checkout-confirmation/admin/class-checkout-confirm-admin.php(168): require_once('/var/www/wordpr...')
    #6 wp-includes/class-wp-hook.php(310): Checkout_Confirm_Admin->show_plugin_options()
    #7 wp-includes/class-wp-hook.php(334
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=checkout-confirm-configure-fields
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cart-checkout-confirmation/admin/partials/checkout-confirm-admin-display.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/cart-checkout-confirmation/admin/views/configure.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-checkout-confirmation/admin/views/tabs/additional-display.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cart-checkout-confirmation/public/partials/checkout-confirm-public-display.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/cart-checkout-confirmation/admin/views/pro_version.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-checkout-confirmation/admin/views/tabs/option.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-checkout-confirmation/admin/views/tabs/fields.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/cart-checkout-confirmation/admin/views/alert.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: checkout, confirm popup, checkout confirm, confirm

cart-checkout-confirmation/cart-checkout-confirmation.php 92% from 13 tests

The principal PHP file in "Cart Checkout Confirmation" v. 1.0.2 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,952 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP181945421,148
CSS3718428
JavaScript3214173
PO File1106169170
SVG10133

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity11.29
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods48
▷ Static methods36.25%
▷ Public methods4389.58%
▷ Protected methods00.00%
▷ Private methods510.42%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/contact.png2.85KB1.28KB▼ 55.22%