84% codepassenger-paypalpay

Code Review | Paypal Pay Donation and Payment

WordPress plugin Paypal Pay Donation and Payment scored 84% from 54 tests.

About plugin

  • Plugin page: codepassenger-pay...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.1
  • WordPress version: 6.3.1
  • First release: Sep 12, 2017
  • Latest release: Sep 12, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: CodePassenger (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 1,264 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼0.17ms] Passed 4 tests

Analyzing server-side resources used by Paypal Pay Donation and Payment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.73 ▲2.38
Dashboard /wp-admin3.52 ▲0.2149.70 ▼2.51
Posts /wp-admin/edit.php3.58 ▲0.2251.07 ▲0.55
Add New Post /wp-admin/post-new.php6.04 ▲0.1694.19 ▼0.68
Media Library /wp-admin/upload.php3.37 ▲0.1436.25 ▲1.97

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Paypal Pay Donation and Payment: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲24115.22 ▲0.471.90 ▲0.2043.52 ▼4.80
Dashboard /wp-admin2,380 ▲1926.70 ▲1.61125.81 ▲24.6638.97 ▼9.06
Posts /wp-admin/edit.php2,289 ▲2003.64 ▲1.6751.66 ▲13.9734.53 ▼1.98
Add New Post /wp-admin/post-new.php1,543 ▲2317.76 ▼5.47594.01 ▼102.9236.52 ▼15.33
Media Library /wp-admin/upload.php1,419 ▲344.37 ▲0.1583.65 ▼19.5743.39 ▼6.14

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/codepassenger-paypalpay/include/ppdp-setting.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/codepassenger-paypalpay/settings/ppdp-settings-fields.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/codepassenger-paypalpay/ppdp.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: paypal, donation, gateway, payment, paypal button

codepassenger-paypalpay/ppdp.php 85% from 13 tests

The entry point to "Paypal Pay Donation and Payment" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("codepassenger-paypalpay.php" instead of "ppdp.php")

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
Success! There were no dangerous files found in this plugin534 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP574155509
CSS20024
JavaScript1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.00
▷ Minimum class complexity2.00
▷ Maximum class complexity48.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods33
▷ Static methods515.15%
▷ Public methods3296.97%
▷ Protected methods00.00%
▷ Private methods13.03%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected