84% payment-gateway-for-paynow-on-easy-digital-downloads

Code Review | Payment Gateway for Paynow on Easy Digital Downloads

WordPress plugin Payment Gateway for Paynow on Easy Digital Downloads scored84%from 54 tests.

About plugin

  • Plugin page: payment-gateway-f...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 6.3.1
  • First release: Sep 4, 2020
  • Latest release: Sep 5, 2021
  • Number of updates: 6
  • Update frequency: every 63.8 days
  • Top authors: Bragi26 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /681 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.46ms] Passed 4 tests

Server-side resources used by Payment Gateway for Paynow on Easy Digital Downloads
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.70 ▼3.93
Dashboard /wp-admin3.32 ▲0.0244.87 ▼5.64
Posts /wp-admin/edit.php3.37 ▲0.0245.80 ▼3.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0298.06 ▲1.79
Media Library /wp-admin/upload.php3.24 ▲0.0233.55 ▼1.27

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 297 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Payment Gateway for Paynow on Easy Digital Downloads
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.42 ▼0.341.75 ▼0.1642.48 ▼10.88
Dashboard /wp-admin2,203 ▲125.83 ▲0.94104.20 ▼1.3341.01 ▼3.66
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0239.40 ▼0.6334.20 ▲0.88
Add New Post /wp-admin/post-new.php1,519 ▼1523.23 ▼0.04642.39 ▼20.0152.76 ▼5.31
Media Library /wp-admin/upload.php1,382 ▼94.26 ▲0.0295.18 ▼4.3339.17 ▼2.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 110× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Paynow\\Tests\\TestCase' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/pay-now/paynow-php-sdk/tests/Service/PaymentTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Exception\\TransferException' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/httplug/src/Exception/RequestException.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\RequestMatcher' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\RequestFactory' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/message-factory/src/MessageFactory.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientInterface' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/httplug/src/HttpClient.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/discovery/src/StreamFactoryDiscovery.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/discovery/src/UriFactoryDiscovery.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Message\\Authentication' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/php-http/message/src/Authentication/Matching.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/payment-gateway-for-paynow-on-easy-digital-downloads/vendor/psr/http-client/src/NetworkExceptionInterface.php:14

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 93% 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
7 plugin tags: payment gateway, payments, polish payment gateway, paynow, edd...

payment-gateway-for-paynow-on-easy-digital-downloads/edd-paynow-payments.php 85% from 13 tests

The main PHP file in "Payment Gateway for Paynow on Easy Digital Downloads" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("payment-gateway-for-paynow-on-easy-digital-downloads.php" instead of "edd-paynow-payments.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected12,055 lines of code in 269 files:
LanguageFilesBlank linesComment linesLines of code
PHP1972,1145,4178,080
JSON34002,283
Markdown3192501,502
YAML417293
PO File1202365
XML20032

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.45
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces48
Interfaces37
Traits7
Classes136
▷ Abstract classes21.47%
▷ Concrete classes13498.53%
▷ Final classes4735.07%
Methods708
▷ Static methods709.89%
▷ Public methods63689.83%
▷ Protected methods233.25%
▷ Private methods496.92%
Functions36
▷ Named functions2055.56%
▷ Anonymous functions1644.44%
Constants51
▷ Global constants713.73%
▷ Class constants4486.27%
▷ Public constants3784.09%

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
assets/images/logo-paynow.png5.61KB2.61KB▼ 53.40%