84% twispay

Code Review | Twispay Credit Card Payments

WordPress plugin Twispay Credit Card Payments scored84%from 54 tests.

About plugin

  • Plugin page: twispay
  • Plugin version: 2.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 25, 2017
  • Latest release: Nov 17, 2023
  • Number of updates: 36
  • Update frequency: every 61.5 days
  • Top authors: twispay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,438 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.70ms] Passed 4 tests

Analyzing server-side resources used by Twispay Credit Card Payments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.37 ▲1.83
Dashboard /wp-admin3.33 ▼0.0248.13 ▼13.68
Posts /wp-admin/edit.php3.38 ▲0.0246.72 ▲0.47
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.42 ▼1.35
Media Library /wp-admin/upload.php3.31 ▲0.0833.75 ▼4.24

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Twispay Credit Card Payments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲3914.27 ▼0.491.59 ▼0.2635.18 ▼8.65
Dashboard /wp-admin2,206 ▲255.66 ▼0.0995.52 ▼8.2739.41 ▼4.12
Posts /wp-admin/edit.php2,115 ▲151.96 ▼0.0539.19 ▲0.0937.00 ▲1.95
Add New Post /wp-admin/post-new.php1,537 ▲1123.22 ▼0.24606.04 ▼136.7157.16 ▲0.34
Media Library /wp-admin/upload.php1,411 ▲84.17 ▼0.1197.86 ▼3.8343.10 ▼2.76

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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 | 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
  • 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twispay/includes/admin/admin-requests.php:38
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/twispay/includes/admin/notice/WoocommerceNotice.php on line 7
    • > PHP Warning
      Use of undefined constant TWISPAY_PLUGIN_DIR - assumed 'TWISPAY_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/twispay/includes/transaction/transaction-table.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'TWISPAY_PLUGIN_DIRincludes/class-ma-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/twispay/includes/admin/transaction/transaction-table.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twispay/includes/install.php:90
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/twispay/includes/transaction/recurring_t.php:13
    • > PHP Warning
      require_once(TWISPAY_PLUGIN_DIRincludes/class-ma-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/twispay/includes/admin/transaction/transaction-table.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/twispay/includes/transaction/refund_t.php:13
    • > PHP Fatal error
      require(): Failed opening required 'WP_PLUGIN_DIR/twispay/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/twispay/includes/admin/notice/WoocommerceNotice.php on line 7
    • > PHP Warning
      Use of undefined constant TWISPAY_PLUGIN_DIR - assumed 'TWISPAY_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/twispay/includes/scripts.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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: gateway, payment, module

twispay/twispay.php Passed 13 tests

The main file in "Twispay Credit Card Payments" v. 2.0.10 serves as a complement to information provided in readme.txt and as the entry point to the plugin
35 characters long description:
Plugin for Twispay payment gateway.

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
Good job! No executable or dangerous file extensions detected4,582 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP499902,0514,514
JavaScript25737
CSS25126
JSON1005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity17.37
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes516.67%
Methods161
▷ Static methods4024.84%
▷ Public methods12980.12%
▷ Protected methods2113.04%
▷ Private methods116.83%
Functions40
▷ Named functions3895.00%
▷ Anonymous functions25.00%
Constants13
▷ Global constants215.38%
▷ Class constants1184.62%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png23.22KB3.61KB▼ 84.46%