79% s2w-payments

Code Review | S2W Payments

WordPress plugin S2W Payments scored79%from 54 tests.

About plugin

  • Plugin page: s2w-payments
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2
  • WordPress version: 6.3.1
  • First release: May 29, 2019
  • Latest release: Sep 5, 2019
  • Number of updates: 12
  • Update frequency: every 8.3 days
  • Top authors: mikemamaril (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,985 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
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼8.05ms] Passed 4 tests

This is a short check of server-side resources used by S2W Payments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.63 ▼0.59
Dashboard /wp-admin3.36 ▲0.0256.65 ▼9.37
Posts /wp-admin/edit.php3.41 ▲0.0655.66 ▲5.28
Add New Post /wp-admin/post-new.php5.96 ▲0.0884.87 ▼20.80
Media Library /wp-admin/upload.php3.29 ▲0.0637.44 ▼1.44
Search Payments /wp-admin/admin.php?page=s2w-payments3.2332.65
Settings /wp-admin/admin.php?page=s2w-payments-settings3.2837.65
Import to WooCommerce /wp-admin/admin.php?page=s2w-payments-import-to-wc3.2932.68

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

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

Browser metrics Passed 4 tests

Checking browser requirements for S2W Payments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10114.79 ▲0.201.65 ▲0.0542.14 ▼3.08
Dashboard /wp-admin2,228 ▲515.66 ▲0.0883.27 ▼11.4437.35 ▼5.00
Posts /wp-admin/edit.php2,133 ▲332.23 ▲0.2138.40 ▲1.7734.91 ▼2.30
Add New Post /wp-admin/post-new.php1,564 ▲1523.17 ▲4.98643.91 ▼19.2361.38 ▼9.43
Media Library /wp-admin/upload.php1,430 ▲304.31 ▲0.16104.37 ▼6.3146.06 ▼0.52
Search Payments /wp-admin/admin.php?page=s2w-payments8641.8126.6541.42
Settings /wp-admin/admin.php?page=s2w-payments-settings1,0651.7424.4338.84
Import to WooCommerce /wp-admin/admin.php?page=s2w-payments-import-to-wc8491.8126.4925.17

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=s2w-payments
    • > Warning in wp-content/plugins/s2w-payments/admin/class-s2w-payments-admin.php+470
    array_reverse() expects parameter 1 to be array, bool given

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
Please fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/s2w-payments/admin/partials/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/s2w-payments/admin/partials/payments.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/s2w-payments/admin/partials/import-to-wc.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
3 plugin tags: woocommerce, square, import orders

s2w-payments/s2w-payments.php Passed 13 tests

This is the main PHP file of "S2W Payments" version 1.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
137 characters long description:
Search fullfilled payments from Square and import them to WooCommerce as orders by matching product SKU's on both Square and WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin53,116 lines of code in 457 files:
LanguageFilesBlank linesComment linesLines of code
PHP4448,49644,30250,160
JavaScript43711371,851
Markdown31870978
JSON20091
CSS33818
YAML10018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.41
▷ Minimum class complexity1.00
▷ Maximum class complexity473.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes435
▷ Abstract classes00.00%
▷ Concrete classes435100.00%
▷ Final classes00.00%
Methods5,186
▷ Static methods130.25%
▷ Public methods5,17899.85%
▷ Protected methods10.02%
▷ Private methods70.13%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants1
▷ Global constants1100.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
No PNG files were detected