88% advanced-forms-paypal-payment-buttons

Code Review | Advanced Forms PayPal Payment Buttons

WordPress plugin Advanced Forms PayPal Payment Buttons scored 88% from 54 tests.

About plugin

  • Plugin page: advanced-forms-pa...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-4.9.1
  • WordPress version: 5.9.2
  • First release: Jan 5, 2018
  • Latest release: Jan 5, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: demotic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 682 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼301.49ms] Passed 4 tests

A check of server-side resources used by Advanced Forms PayPal Payment Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3556.03 ▲5.77
Dashboard /wp-admin3.69 ▲0.2840.18 ▲6.90
Posts /wp-admin/edit.php3.92 ▲0.2839.02 ▼3.85
Add New Post /wp-admin/post-new.php7.15 ▲0.1893.96 ▼1,209.74
Media Library /wp-admin/upload.php3.57 ▲0.2725.26 ▲1.85

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Advanced Forms PayPal Payment Buttons: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,793 ▲7115.91 ▲0.256.13 ▲0.182.22 ▼0.26
Dashboard /wp-admin2,923 ▲656.13 ▼0.02121.90 ▼13.73156.02 ▼4.82
Posts /wp-admin/edit.php2,716 ▲283.36 ▼0.0063.78 ▲3.36139.95 ▲5.54
Add New Post /wp-admin/post-new.php1,683 ▲2216.04 ▼0.16441.99 ▲23.49153.65 ▼0.27
Media Library /wp-admin/upload.php1,726 ▲285.49 ▼0.02143.21 ▲4.40191.15 ▲9.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/advanced-forms-paypal-payment-buttons/public/partials/advanced-forms-paypal-payment-buttons-public-redirect.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/advanced-forms-paypal-payment-buttons/admin/partials/advanced-forms-paypal-payment-buttons-admin-display.php:16
    • > PHP Notice
      Undefined variable: form in wp-content/plugins/advanced-forms-paypal-payment-buttons/public/partials/advanced-forms-paypal-payment-buttons-public-redirect.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

advanced-forms-paypal-payment-buttons/advanced-forms-paypal-payment-buttons.php Passed 13 tests

The main file in "Advanced Forms PayPal Payment Buttons" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
90 characters long description:
Create PayPal Payment Buttons with the power of Advanced Forms and Advanced Custom Fields.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,941 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP132255891,904
CSS10635
Markdown1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.14
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2275.86%
▷ Protected methods00.00%
▷ Private methods724.14%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png4.19KB2.41KB▼ 42.52%
assets/icon-256x256.png8.68KB4.20KB▼ 51.59%