74% 2checkout

Code Review | 2Checkout Integration for WordPress - WP Super Pay

WordPress plugin 2Checkout Integration for WordPress - WP Super Pay scored74%from 54 tests.

About plugin

  • Plugin page: 2checkout
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Jun 3, 2021
  • Latest release: Jun 3, 2021
  • Number of updates: 3
  • Update frequency: every 15.0 days
  • Top authors: mukto90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /847 total downloads

Benchmarks

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

An overview of server-side resources used by 2Checkout Integration for WordPress - WP Super Pay
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6542.49 ▼0.31
Dashboard /wp-admin3.81 ▲0.4638.90 ▼32.65
Posts /wp-admin/edit.php4.03 ▲0.6751.89 ▲3.59
Add New Post /wp-admin/post-new.php6.64 ▲0.75101.25 ▲2.28
Media Library /wp-admin/upload.php3.90 ▲0.6743.00 ▲6.38
Settings /wp-admin/admin.php?page=2checkout-settings3.9043.06
Transactions /wp-admin/admin.php?page=2checkout-transactions3.9040.85
Payment Forms /wp-admin/edit.php?post_type=twoco3.9441.68

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 60 new files
Database: 2 new tables, 11 new options
New tables
wp_2co_transactionmeta
wp_2co_transactions
New WordPress options
db_upgraded
codexpert-blog-json
2checkout_installed
2checkout_install_time
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
_2checkout_notices
...

Browser metrics Passed 4 tests

An overview of browser requirements for 2Checkout Integration for WordPress - WP Super Pay
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,178 ▲41721.50 ▲7.15308.28 ▲306.6548.41 ▲4.85
Dashboard /wp-admin2,292 ▲1125.68 ▼0.0190.29 ▼10.1636.62 ▼5.56
Posts /wp-admin/edit.php2,149 ▲492.22 ▲0.0835.25 ▼3.7932.74 ▼2.98
Add New Post /wp-admin/post-new.php1,581 ▲5318.36 ▼4.67590.21 ▼64.0166.34 ▲11.21
Media Library /wp-admin/upload.php1,443 ▲404.28 ▲0.14100.41 ▼4.0843.94 ▼2.97
Settings /wp-admin/admin.php?page=2checkout-settings1,0963.6248.1035.75
Transactions /wp-admin/admin.php?page=2checkout-transactions9632.1226.2826.64
Payment Forms /wp-admin/edit.php?post_type=twoco1,1132.1633.1427.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_2co_transactionmeta
    • wp_2co_transactions
  • Zombie WordPress options were found after uninstall: 11 options
    • 2checkout_version
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • 2checkout_installed
    • db_upgraded
    • 2checkout_install_time
    • codexpert-blog-json
    • ...

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'codexpert\\plugin\\Base' not found in wp-content/plugins/2checkout/src/Settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/2checkout/views/transactions.php:2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/2checkout/functions/helpers.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/2checkout/views/payment-section.php:3
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/2checkout/views/payment-section.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/2checkout/functions/helpers.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/2checkout/functions/helpers.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/2checkout/functions/helpers.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/2checkout/views/payment-section.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/2checkout/functions/helpers.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: 2checkout for wordpress, 2checkout, twoco

2checkout/2checkout.php 92% from 13 tests

"2Checkout Integration for WordPress - WP Super Pay" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
Good job! No executable or dangerous file extensions detected4,825 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP358889123,495
CSS856971
JavaScript7234288
JSON30070
Markdown1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity24.43
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes23
▷ Abstract classes28.70%
▷ Concrete classes2191.30%
▷ Final classes14.76%
Methods229
▷ Static methods73.06%
▷ Public methods21995.63%
▷ Protected methods20.87%
▷ Private methods83.49%
Functions17
▷ Named functions1376.47%
▷ Anonymous functions423.53%
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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/codexpert/plugin/src/assets/img/survey.png7.31KB3.08KB▼ 57.88%