10% payment-form-for-paypal-pro

Code Review | Payment Form for PayPal Pro

WordPress plugin Payment Form for PayPal Pro scored10%from 54 tests.

About plugin

  • Plugin page: payment-form-for-...
  • Plugin version: 1.1.69
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.2
  • WordPress version: 6.3.1
  • First release: Aug 3, 2015
  • Latest release: May 8, 2023
  • Number of updates: 73
  • Update frequency: every 38.9 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

70+ active /19,672 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/payment-form-for-paypal-pro/cp_ppp.php+84
    Undefined variable: wpdb

Server metrics [RAM: ▼0.09MB] [CPU: ▼4.50ms] Passed 4 tests

Server-side resources used by Payment Form for PayPal Pro
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.99 ▼0.4721.22 ▼21.50
Dashboard /wp-admin3.34 ▲0.0348.17 ▲2.64
Posts /wp-admin/edit.php3.39 ▲0.0347.24 ▲3.13
Add New Post /wp-admin/post-new.php5.94 ▲0.0687.26 ▲3.10
Media Library /wp-admin/upload.php3.26 ▲0.0334.17 ▼2.23
Manage Forms /wp-admin/admin.php?page=cp_ppp3.3831.39
Payment Form for PayPal Pro /wp-admin/options-general.php?page=cp_ppp3.2530.98
Upgrade /wp-admin/admin.php?page=cp_ppp_upgrade3.2028.66

Server storage [IO: ▲1.01MB] [DB: ▲0.64MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 250 new files
Database: 3 new tables, 9 new options
New tables
wp_cp_ppp_discount_codes
wp_cp_ppp_posts
wp_cp_ppp_settings
New WordPress options
can_compress_scripts
theysaidso_admin_options
installed_payment-form-for-paypal-pro
autoptimize_js_exclude
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_cp_ppp_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Payment Form for PayPal Pro
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9213.70 ▼0.675.93 ▲4.2146.09 ▲6.19
Dashboard /wp-admin2,237 ▲525.84 ▼0.04102.23 ▲0.3738.91 ▲0.83
Posts /wp-admin/edit.php2,117 ▲282.01 ▼0.0333.50 ▼1.4034.76 ▲2.31
Add New Post /wp-admin/post-new.php6,229 ▲4,71019.25 ▼4.06908.96 ▲258.1241.94 ▼15.44
Media Library /wp-admin/upload.php1,413 ▲224.22 ▲0.0495.12 ▼10.7740.67 ▼6.96
Manage Forms /wp-admin/admin.php?page=cp_ppp1,0482.3345.5532.35
Payment Form for PayPal Pro /wp-admin/options-general.php?page=cp_ppp1,0482.3242.4032.61
Upgrade /wp-admin/admin.php?page=cp_ppp_upgrade1,4922.4359.9856.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_cp_ppp_discount_codes
    • wp_cp_ppp_posts
    • wp_cp_ppp_settings
  • Zombie WordPress options detected upon uninstall: 9 options
    • installed_payment-form-for-paypal-pro
    • widget_cp_ppp_widget
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • autoptimize_js_exclude

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/payment-form-for-paypal-pro/js/fbuilder-loader-admin.php
    • > /wp-content/plugins/payment-form-for-paypal-pro/cp_ppp_public_int.inc.php
    • > /wp-content/plugins/payment-form-for-paypal-pro/js/fbuilder-loader-public.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/payment-form-for-paypal-pro/cp_ppp_admin_int_message_list.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payment-form-for-paypal-pro/banner.php:102
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/payment-form-for-paypal-pro/cp_admin_int_edition.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/payment-form-for-paypal-pro/cp-feedback.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/payment-form-for-paypal-pro/cp_ppp_admin_int_list.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/payment-form-for-paypal-pro/cp_ppp_paypal_pro_int.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/payment-form-for-paypal-pro/cp_ppp_admin_int.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/payment-form-for-paypal-pro/cp_ppp.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=cp_ppp_upgrade
    • > Javascript (severe) in unknown
    https://wordpress.dwbooster.com/TSScript/tab.js 37:11 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Optimizations

Plugin configuration 96% 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
10 plugin tags: accept, paypal advanced, paypal pro, processing, card...

payment-form-for-paypal-pro/cp_ppp.php 92% from 13 tests

The main PHP script in "Payment Form for PayPal Pro" version 1.1.69 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("payment-form-for-paypal-pro.php" instead of "cp_ppp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected10,660 lines of code in 128 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript413171453,725
PHP125821083,353
PO File601,0075262,843
CSS967150709
INI60030

PHP code Passed 2 tests

An overview 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.35
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions42
▷ Named functions4197.62%
▷ Anonymous functions12.38%
Constants72
▷ Global constants72100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
42 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png0.12KB0.15KB0.00%
images/custom_hsb_s.png1.14KB0.89KB▼ 21.75%
images/colorpicker_overlay.png10.11KB8.24KB▼ 18.50%
images/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
templates/03/top_bg.png9.15KB8.83KB▼ 3.51%