74% nocks-nifty-for-woocommerce

Code Review | Nocks Nifty for WooCommerce

WordPress plugin Nocks Nifty for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: nocks-nifty-for-w...
  • Plugin version: 0.0.20
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Aug 12, 2015
  • Latest release: Oct 3, 2017
  • Number of updates: 50
  • Update frequency: every 15.7 days
  • Top authors: nocksapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,707 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.97MB] [CPU: ▼54.57ms] Passed 4 tests

This is a short check of server-side resources used by Nocks Nifty for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.03 ▼36.27
Dashboard /wp-admin2.05 ▼1.305.31 ▼53.89
Posts /wp-admin/edit.php2.05 ▼1.315.36 ▼44.14
Add New Post /wp-admin/post-new.php2.05 ▼3.846.86 ▼83.99
Media Library /wp-admin/upload.php2.05 ▼1.185.25 ▼31.57

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 629 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Nocks Nifty for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14513.93 ▼0.458.48 ▲6.8142.56 ▲1.17
Dashboard /wp-admin2,207 ▲225.88 ▲1.01111.39 ▼5.7338.04 ▼4.15
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0138.21 ▼3.6335.03 ▼2.06
Add New Post /wp-admin/post-new.php1,518 ▼417.63 ▼5.74678.91 ▲65.5560.48 ▼3.82
Media Library /wp-admin/upload.php1,389 ▼24.28 ▲0.0597.50 ▲2.0041.36 ▼0.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 158× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Arcanedev\\QrCode\\Modes\\Base\\EncodeMode' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/arcanedev/qr-code/src/Modes/NumericMode.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/ringphp/tests/Client/StreamHandlerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\PromiseInterface' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/react/promise/src/ExtendedPromiseInterface.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Stream\\StreamInterface' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/streams/tests/StreamDecoratorTraitTest.php:8
    • > PHP Warning
      require(wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/ringphp/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/ringphp/tests/bootstrap.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/streams/tests/FnStreamTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Post\\PostBodyInterface' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/guzzle/src/Post/PostBody.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Event\\AbstractEvent' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/guzzle/src/Event/AbstractRequestEvent.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/streams/tests/NoSeekStreamTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nocks-nifty-for-woocommerce/vendor/guzzlehttp/ringphp/tests/Client/CurlMultiHandlerTest.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: psp, gulden, bitcoin, payment gateway, woocommerce

nocks-nifty-for-woocommerce/nocks-nifty-woocommerce.php 92% from 13 tests

This is the main PHP file of "Nocks Nifty for WooCommerce" version 0.0.20, 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:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nocks-nifty-for-woocommerce.php" instead of "nocks-nifty-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin29,512 lines of code in 325 files:
LanguageFilesBlank linesComment linesLines of code
PHP2373,7646,42918,558
Markdown1065802,557
reStructuredText191,2221,5702,029
CSS43121,856
Sass1326241,352
LESS1326331,343
SVG200579
JSON710488
make57810333
JavaScript22560196
XML52089
YAML521288
Python210041
HTML1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.70
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces39
Interfaces30
Traits15
Classes184
▷ Abstract classes52.72%
▷ Concrete classes17997.28%
▷ Final classes31.68%
Methods1,715
▷ Static methods915.31%
▷ Public methods1,49587.17%
▷ Protected methods583.38%
▷ Private methods1629.45%
Functions265
▷ Named functions3111.70%
▷ Anonymous functions23488.30%
Constants22
▷ Global constants14.55%
▷ Class constants2195.45%
▷ Public constants21100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
46 PNG files occupy 0.28MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/arcanedev/qr-code/assets/image/qrv5.png0.16KB0.15KB▼ 5.00%
vendor/arcanedev/qr-code/assets/image/qrv22.png0.24KB0.22KB▼ 6.64%
vendor/arcanedev/qr-code/assets/image/qrv16.png0.23KB0.21KB▼ 6.49%
vendor/arcanedev/qr-code/assets/image/d.png0.83KB0.08KB▼ 90.21%
assets/img/btc.png13.91KB8.68KB▼ 37.59%