84% nocks-checkout-for-woocommerce

Code Review | Nocks Checkout for WooCommerce

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

About plugin

  • Plugin page: nocks-checkout-fo...
  • Plugin version: 0.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8.2
  • WordPress version: 6.3.1
  • First release: Dec 21, 2017
  • Latest release: Nov 28, 2019
  • Number of updates: 32
  • Update frequency: every 22.1 days
  • Top authors: nocksapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,182 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.25ms] Passed 4 tests

This is a short check of server-side resources used by Nocks Checkout for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.61 ▼0.90
Dashboard /wp-admin3.31 ▲0.0045.89 ▼5.96
Posts /wp-admin/edit.php3.36 ▲0.0047.54 ▲0.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.43 ▼9.77
Media Library /wp-admin/upload.php3.23 ▲0.0033.89 ▼0.35

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Nocks Checkout for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.36 ▼1.011.99 ▲0.1045.96 ▼0.09
Dashboard /wp-admin2,221 ▲155.80 ▲0.8798.68 ▼5.2644.50 ▲3.97
Posts /wp-admin/edit.php2,100 ▲32.04 ▲0.0241.25 ▲4.0537.33 ▲2.63
Add New Post /wp-admin/post-new.php1,545 ▲523.22 ▲0.07652.83 ▼27.1955.79 ▲5.04
Media Library /wp-admin/upload.php1,397 ▼34.29 ▲0.0795.67 ▼8.2443.09 ▼3.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_WC_Gateway_Abstract' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/gateway/bitcoin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/nocks-checkout-for-woocommerce/includes/woocommerce_functions.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_WC_Gateway_Abstract' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/gateway/litecoin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/gateway/abstract.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/nocks-checkout-for-woocommerce/nocks-payments-for-woocommerce.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_WC_Gateway_Abstract' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/gateway/ethereum.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_WC_Exception' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/exception/incompatibleplatform.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_WC_Exception' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/exception/couldnotconnecttonocks.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_WC_Gateway_Abstract' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks/wc/gateway/balance.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Nocks_Exception' not found in wp-content/plugins/nocks-checkout-for-woocommerce/includes/nocks-checkout/Exception/IncompatiblePlatform.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: psp, ideal, payment gateway, ethereum, nocks...

nocks-checkout-for-woocommerce/nocks-payments-for-woocommerce.php 85% from 13 tests

This is the main PHP file of "Nocks Checkout for WooCommerce" version 0.19, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.8")
  • Main file name: The principal plugin file should be the same as the plugin slug ("nocks-checkout-for-woocommerce.php" instead of "nocks-payments-for-woocommerce.php")

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
There were no executable files found in this plugin2,495 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP286289562,252
PO File2520108
JavaScript114282
CSS12024
Markdown18015
SVG10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.73
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes13.85%
▷ Concrete classes2596.15%
▷ Final classes00.00%
Methods186
▷ Static methods2513.44%
▷ Public methods13974.73%
▷ Protected methods4624.73%
▷ Private methods10.54%
Functions12
▷ Named functions866.67%
▷ Anonymous functions433.33%
Constants21
▷ Global constants29.52%
▷ Class constants1990.48%
▷ Public constants19100.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
8 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/balance.png3.61KB1.99KB▼ 44.83%
assets/images/ideal.png7.58KB3.53KB▼ 53.38%
assets/images/bitcoin.png7.01KB2.99KB▼ 57.27%
assets/images/litecoin.png4.41KB1.88KB▼ 57.28%
assets/images/ethereum.png5.36KB2.33KB▼ 56.43%