84% perfect-checkout

Code Review | Perfect Checkout for WooCommerce

WordPress plugin Perfect Checkout for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: perfect-checkout
  • Plugin version: 1.6.12
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Jul 30, 2021
  • Latest release: Jun 19, 2023
  • Number of updates: 32
  • Update frequency: every 21.7 days
  • Top authors: sebd86 (59.38%)perfectcheckout (43.75%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,702 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.70MB] [CPU: ▲2.76ms] Passed 4 tests

Analyzing server-side resources used by Perfect Checkout for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5748.84 ▲8.87
Dashboard /wp-admin4.05 ▲0.7162.22 ▼2.54
Posts /wp-admin/edit.php4.10 ▲0.7554.17 ▲5.79
Add New Post /wp-admin/post-new.php6.67 ▲0.7995.86 ▼1.07
Media Library /wp-admin/upload.php3.98 ▲0.7549.67 ▲12.57

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 194 new files
Database: no new tables, 11 new options
New WordPress options
perfectcheckout_admin_notices
db_upgraded
widget_recent-comments
theysaidso_admin_options
woocommerce_shipping_cost_requires_address
widget_recent-posts
perfectcheckout_version
can_compress_scripts
perfectcheckout_install_date
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Perfect Checkout for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲8414.37 ▲0.021.87 ▲0.2141.36 ▲0.46
Dashboard /wp-admin2,227 ▲505.61 ▼0.1099.99 ▲8.4494.03 ▲54.03
Posts /wp-admin/edit.php2,140 ▲402.02 ▲0.0336.25 ▼2.6631.97 ▼1.31
Add New Post /wp-admin/post-new.php1,554 ▲2823.62 ▲0.47770.39 ▲69.4549.35 ▲1.73
Media Library /wp-admin/upload.php1,431 ▲314.22 ▲0.0597.27 ▼3.7579.01 ▲31.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • woocommerce_shipping_cost_requires_address
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/perfect-checkout/packages/extras/includes/filters/filter-v1.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/perfect-checkout/packages/extras/includes/filters/filter-v2.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/perfect-checkout/packages/framework/load-package.php:105
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/perfect-checkout/packages/extras/includes/filters/filter-v2-preview.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
5 plugin tags: paypal, stripe, payments, checkout, square

perfect-checkout/perfect-checkout.php Passed 13 tests

The entry point to "Perfect Checkout for WooCommerce" version 1.6.12 is a PHP file that has certain tags in its header comment area
54 characters long description:
The absolute best checkout experience for WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin19,494 lines of code in 184 files:
LanguageFilesBlank linesComment linesLines of code
PHP1664,69112,45718,360
CSS99539888
JavaScript75467225
SVG20021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity18.01
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes123
▷ Abstract classes32.44%
▷ Concrete classes12097.56%
▷ Final classes21.67%
Methods911
▷ Static methods27630.30%
▷ Public methods78986.61%
▷ Protected methods839.11%
▷ Private methods394.28%
Functions67
▷ Named functions3044.78%
▷ Anonymous functions3755.22%
Constants52
▷ Global constants4382.69%
▷ Class constants917.31%
▷ Public constants9100.00%

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
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/fav/android-chrome-512x512.png14.90KB4.73KB▼ 68.28%
assets/images/fav/android-chrome-192x192.png4.14KB2.37KB▼ 42.84%
assets/images/fav/favicon-16x16.png0.29KB0.32KB0.00%
assets/images/fav/apple-touch-icon.png5.14KB2.95KB▼ 42.58%
assets/images/fav/favicon-32x32.png0.48KB0.44KB▼ 6.57%