84% woo-cloudswipe-payments

Code Review | WooCommerce CloudSwipe Payments

WordPress plugin WooCommerce CloudSwipe Payments scored84%from 54 tests.

About plugin

  • Plugin page: woo-cloudswipe-pa...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 6.3.1
  • First release: Apr 11, 2017
  • Latest release: Jan 12, 2018
  • Number of updates: 25
  • Update frequency: every 11.2 days
  • Top authors: reality66 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,009 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.01MB] [CPU: ▼5.32ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce CloudSwipe Payments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.04 ▲0.28
Dashboard /wp-admin3.31 ▲0.0142.72 ▼6.30
Posts /wp-admin/edit.php3.36 ▲0.0144.65 ▼3.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.06 ▼11.09
Media Library /wp-admin/upload.php3.23 ▲0.0132.09 ▼0.38

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce CloudSwipe Payments
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.24 ▼1.445.16 ▲3.4242.93 ▼0.83
Dashboard /wp-admin2,209 ▲185.83 ▲0.9397.04 ▼8.6238.52 ▼7.54
Posts /wp-admin/edit.php2,092 ▲32.03 ▼0.0335.06 ▼0.2832.93 ▼3.73
Add New Post /wp-admin/post-new.php1,539 ▲623.28 ▲0.09594.25 ▼47.2054.55 ▼7.32
Media Library /wp-admin/upload.php1,394 ▲34.22 ▲0.0196.85 ▼5.1643.21 ▲1.67

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following items
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      include(/Users/joey/Sites/wp/wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/woo-cloudswipe-payments/vendor/joeybeninghove/json-api-wp-client/tests/create-test.php on line 3
    • > PHP Warning
      include(): Failed opening '/Users/joey/Sites/wp/wp-load.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/tests/wordpress-test.php on line 3
    • > PHP Warning
      require(wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/tests/wordpress-test.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'CloudSwipe_Wp_Resource' not found in wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/src/class-cloudswipe-wp-invoice.php:3
    • > PHP Warning
      include(/Users/joey/Sites/wp/wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/tests/wordpress-test.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-cloudswipe-payments/includes/class-cloudswipe-wc-slurp-tweaker.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Json_Api_Wp_Resource' not found in wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/src/class-cloudswipe-wp-resource.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CloudSwipe_Wp_Invoice' not found in wp-content/plugins/woo-cloudswipe-payments/includes/class-cloudswipe-wc-invoice.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-cloudswipe-payments/includes/class-wc-gateway-cloudswipe.php:3
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-cloudswipe-payments/vendor/cloudswipe/cloudswipe-wp/tests/wordpress-test.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can take inspiration from this readme.txt

woo-cloudswipe-payments/woocommerce-gateway-cloudswipe.php 92% from 13 tests

This is the main PHP file of "WooCommerce CloudSwipe Payments" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-cloudswipe-payments.php" instead of "woocommerce-gateway-cloudswipe.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,394 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP282332311,038
Markdown2340160
JSON400152
PO File1141644

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.43
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes14.35%
Methods97
▷ Static methods3435.05%
▷ Public methods9597.94%
▷ Protected methods00.00%
▷ Private methods22.06%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin