83% pay-advantage

Code Review | Pay Advantage

WordPress plugin Pay Advantage scored83%from 54 tests.

About plugin

  • Plugin page: pay-advantage
  • Plugin version: 3.3.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 25, 2018
  • Latest release: Nov 23, 2023
  • Number of updates: 76
  • Update frequency: every 25.0 days
  • Top authors: payadvantage (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,826 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.32MB] [CPU: ▲1.09ms] Passed 4 tests

A check of server-side resources used by Pay Advantage
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3438.61 ▼1.47
Dashboard /wp-admin3.62 ▲0.3153.31 ▲5.91
Posts /wp-admin/edit.php3.73 ▲0.3747.42 ▼0.80
Add New Post /wp-admin/post-new.php6.20 ▲0.3195.64 ▲3.31
Media Library /wp-admin/upload.php3.54 ▲0.3137.94 ▲3.33
Pay Advantage /wp-admin/options-general.php?page=PayAdvantage3.5134.91

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 27 new options
New WordPress options
pay_advantage_wc_cancel_status
pay_advantage_access_token
pay_advantage_show_credit_card
pay_advantage_wc_paid_status
theysaidso_admin_options
pay_advantage_require_country
pay_advantage_credit_card_description
can_compress_scripts
pay_advantage_require_address
widget_pay_advantage_credit_card_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Pay Advantage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲16513.78 ▼0.559.91 ▲8.1737.01 ▼6.67
Dashboard /wp-admin2,196 ▲165.53 ▼0.0785.28 ▼2.4838.14 ▲0.12
Posts /wp-admin/edit.php2,104 ▲71.94 ▼0.0638.90 ▲0.4535.61 ▼2.84
Add New Post /wp-admin/post-new.php1,538 ▲723.23 ▲0.17646.09 ▲24.7260.50 ▲10.85
Media Library /wp-admin/upload.php1,404 ▲74.23 ▲0.06100.21 ▼1.4242.00 ▼0.53
Pay Advantage /wp-admin/options-general.php?page=PayAdvantage1,0641.6927.8328.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 12 options in the database
    • db_upgraded
    • widget_pay_advantage_credit_card_widget
    • pay_advantage_make_payment_button
    • pay_advantage_wc_cancel_status
    • widget_pay_advantage_bpay_widget
    • pay_advantage_wc_oncharge_credit_card_fees
    • theysaidso_admin_options
    • pay_advantage_wc_paid_status
    • widget_recent-posts
    • can_compress_scripts
    • ...

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
Good news, no errors were detected

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
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/public/ajax-payadvantage-creditcard.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/public/widget-payadvantage-register-bpay.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/admin/html/options-html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pay-advantage/public/ajax-payadvantage-woocommerce.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/payadvantage.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/public/ajax-payadvantage-customer.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/includes/payadvantage-files.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pay-advantage/admin/options-ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pay-advantage/admin/options-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pay-advantage/migration/migration.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: payment gateway, online payments, e-commerce, credit cards

pay-advantage/payadvantage.php 69% from 13 tests

The principal PHP file in "Pay Advantage" v. 3.3.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Requires at least: Required version must match the one declared in readme.txt ("5.2" instead of "3.7")
  • Main file name: Name the main plugin file the same as the plugin slug ("pay-advantage.php" instead of "payadvantage.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
Success! There were no dangerous files found in this plugin3,228 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP243172241,686
JavaScript102523951,367
SVG30193
CSS117582

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.75
▷ Minimum class complexity2.00
▷ Maximum class complexity40.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods618.18%
▷ Public methods2781.82%
▷ Protected methods00.00%
▷ Private methods618.18%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.23MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/pa_logo-30.png3.32KB2.28KB▼ 31.24%
assets/icon-256x256.png7.13KB2.77KB▼ 61.11%
assets/banner-772x250.png223.78KB81.93KB▼ 63.39%
assets/icon-26x26.png0.51KB0.48KB▼ 4.80%
assets/icon-128x128.png3.17KB1.57KB▼ 50.55%