78% buy-now-pay-later-addi

Code Review | Buy Now Pay Later - ADDI

WordPress plugin Buy Now Pay Later - ADDI scored78%from 54 tests.

About plugin

  • Plugin page: buy-now-pay-later...
  • Plugin version: 1.8.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 19, 2021
  • Latest release: Oct 31, 2023
  • Number of updates: 101
  • Update frequency: every 9.5 days
  • Top authors: techaddi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /15,104 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Buy Now Pay Later - ADDI
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.49 ▲0.26
Dashboard /wp-admin3.31 ▼0.0447.61 ▼15.95
Posts /wp-admin/edit.php3.36 ▲0.0046.49 ▼4.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.57 ▼8.10
Media Library /wp-admin/upload.php3.23 ▲0.0033.29 ▼4.49

Server storage [IO: ▲0.74MB] [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: 44 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Buy Now Pay Later - ADDI
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.191.81 ▼0.4247.85 ▲5.46
Dashboard /wp-admin2,195 ▲155.61 ▲0.0193.91 ▲3.0741.23 ▲3.38
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0434.22 ▼6.8335.08 ▼2.08
Add New Post /wp-admin/post-new.php1,526 ▼1023.31 ▲5.01639.30 ▲8.9462.44 ▼7.02
Media Library /wp-admin/upload.php1,394 ▼64.23 ▼0.0698.62 ▲5.3841.53 ▲1.58

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 detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl_bnpn.php
    • > /wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl.php
    • > /wp-content/plugins/buy-now-pay-later-addi/templates/br/flex.php
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: min_amount in wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl_bnpn.php on line 99
    • > PHP Notice
      Undefined variable: max_amount in wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl_bnpn.php on line 103
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/buy-now-pay-later-addi/addi-gateway.php on line 21
    • > PHP Notice
      Undefined variable: installments in wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl.php on line 64
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/buy-now-pay-later-addi/addi-gateway.php on line 21
    • > PHP Notice
      Undefined variable: installments in wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl_bnpn.php on line 49
    • > PHP Notice
      Undefined variable: total in wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl_bnpn.php on line 88
    • > PHP Notice
      Undefined variable: discount in wp-content/plugins/buy-now-pay-later-addi/templates/br/bnpl.php on line 4
    • > PHP Notice
      Undefined variable: total in wp-content/plugins/buy-now-pay-later-addi/templates/br/flex.php on line 121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/buy-now-pay-later-addi/templates/co/flex.php:5

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: spam, comments

buy-now-pay-later-addi/addi-gateway.php 85% from 13 tests

This is the main PHP file of "Buy Now Pay Later - ADDI" version 1.8.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 179 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("buy-now-pay-later-addi.php" instead of "addi-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected4,171 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP104023122,445
CSS2215541,182
PO File199102291
JavaScript22611136
SVG800117

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity119.00
▷ Minimum class complexity2.00
▷ Maximum class complexity236.00
Average method complexity15.00
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
Functions39
▷ Named functions2256.41%
▷ Anonymous functions1743.59%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.42MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icons01.png1.92KB1.32KB▼ 31.27%
assets/icons04.png1.33KB0.93KB▼ 29.62%
assets/title_br.png10.42KB4.87KB▼ 53.29%
assets/icon-white-128x128.png5.06KB3.17KB▼ 37.29%
assets/ADDI_logo_white.png3.05KB2.21KB▼ 27.31%