73% quick-paypal-payments

Code Review | Quick Paypal Payments

WordPress plugin Quick Paypal Payments scored73%from 54 tests.

About plugin

  • Plugin page: quick-paypal-paym...
  • Plugin version: 5.7.38
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4
  • WordPress version: 6.3.1
  • First release: Oct 13, 2012
  • Latest release: Oct 26, 2023
  • Number of updates: 196
  • Update frequency: every 20.6 days
  • Top authors: aerin (67.86%)fullworks (32.14%)alanfuller (1.02%)

Code review

54 tests

User reviews

30 reviews

Install metrics

2,000+ active /204,947 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.69MB] [CPU: ▲34.37ms] 50% from 4 tests

A check of server-side resources used by Quick Paypal Payments
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,614.61ms on /wp-admin/options-general.php?page=quick-paypal-payments)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.69MB on /wp-admin/options-general.php?page=quick-paypal-payments)
PageMemory (MB)CPU Time (ms)
Home /9.22 ▲5.7679.40 ▲41.69
Dashboard /wp-admin9.24 ▲5.9480.89 ▲34.71
Posts /wp-admin/edit.php9.24 ▲5.8977.64 ▲23.48
Add New Post /wp-admin/post-new.php11.05 ▲5.16130.45 ▲37.58
Media Library /wp-admin/upload.php9.24 ▲6.0183.51 ▲46.46
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius9.2466.26
Paypal Payments /wp-admin/options-general.php?page=quick-paypal-payments9.241,614.61

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 233 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
fs_debug_mode
widget_theysaidso_widget
qpp_legacy_free
widget_recent-posts
fs_accounts
widget_qpp_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by Quick Paypal Payments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10514.28 ▼0.341.68 ▲0.0232.38 ▼7.75
Dashboard /wp-admin2,273 ▲1025.60 ▲0.0684.56 ▼4.6577.91 ▲37.92
Posts /wp-admin/edit.php2,142 ▲392.01 ▲0.0537.32 ▼13.7434.90 ▼9.47
Add New Post /wp-admin/post-new.php1,680 ▲15221.86 ▼1.26639.66 ▲5.5837.04 ▼18.17
Media Library /wp-admin/upload.php1,441 ▲414.22 ▲0.0496.53 ▼2.4543.89 ▼1.05
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,1061.6624.1528.44
Paypal Payments /wp-admin/options-general.php?page=quick-paypal-payments1,2133.5252.6354.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/quick-paypal-payments/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 11 options in the database
    • can_compress_scripts
    • fs_debug_mode
    • widget_recent-posts
    • widget_qpp_widget
    • widget_recent-comments
    • fs_active_plugins
    • qpp_legacy_free
    • db_upgraded
    • widget_theysaidso_widget
    • fs_accounts
    • ...

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

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant QUICK_PAYPAL_PAYMENTS_PLUGIN_DIR - assumed 'QUICK_PAYPAL_PAYMENTS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/quick-paypal-payments/control/class-user-template-loader.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quick-paypal-payments/legacy/settings.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'QUICK_PAYPAL_PAYMENTS_PLUGIN_DIR/vendor/gamajo/template-loader/class-gamajo-template-loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/quick-paypal-payments/control/class-user-template-loader.php on line 28
    • > PHP Fatal error
      Uncaught Error: Class 'Quick_Paypal_Payments\\UI\\Admin\\Admin_Pages' not found in wp-content/plugins/quick-paypal-payments/ui/admin/class-admin-settings.php:26
    • > PHP Warning
      require_once(QUICK_PAYPAL_PAYMENTS_PLUGIN_DIR/vendor/gamajo/template-loader/class-gamajo-template-loader.php): failed to open stream: No such file or directory in wp-content/plugins/quick-paypal-payments/control/class-user-template-loader.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to a member function add_filter() on null in wp-content/plugins/quick-paypal-payments/legacy/messages.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quick-paypal-payments/legacy/quick-paypal-payments.php:17

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)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (This is the main admin screen.), #2 (An example form.), #3 (The payment record)
The official readme.txt might help

quick-paypal-payments/quick-paypal-payments.php Passed 13 tests

The main PHP script in "Quick Paypal Payments" version 5.7.38 is automatically included on every request by WordPress
60 characters long description:
Accept any amount or payment ID before submitting to paypal.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin42,809 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
PHP1378,80518,01141,265
JavaScript8211285917
CSS1858200568
Sass21043
XML13016

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity73.82
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes62
▷ Abstract classes23.23%
▷ Concrete classes6096.77%
▷ Final classes00.00%
Methods1,348
▷ Static methods20415.13%
▷ Public methods95170.55%
▷ Protected methods201.48%
▷ Private methods37727.97%
Functions200
▷ Named functions19497.00%
▷ Anonymous functions63.00%
Constants151
▷ Global constants10267.55%
▷ Class constants4932.45%
▷ Public constants49100.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
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/wordpress-sdk/assets/img/quick-paypal-payments.png14.54KB5.14KB▼ 64.67%
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%