84% payment-pro-direct-payment-hosted-paypal

Code Review | Payment Pro (Direct Payment + Hosted) - PayPal

WordPress plugin Payment Pro (Direct Payment + Hosted) - PayPal scored84%from 54 tests.

About plugin

  • Plugin page: payment-pro-direc...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.5.3
  • WordPress version: 6.3.1
  • First release: Jan 19, 2021
  • Latest release: Jan 21, 2021
  • Number of updates: 5
  • Update frequency: every 2.0 days
  • Top authors: prestochangeo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /477 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.69ms] Passed 4 tests

This is a short check of server-side resources used by Payment Pro (Direct Payment + Hosted) - PayPal
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.80 ▼5.10
Dashboard /wp-admin3.33 ▲0.0358.43 ▲2.09
Posts /wp-admin/edit.php3.38 ▲0.0252.70 ▲0.55
Add New Post /wp-admin/post-new.php5.92 ▲0.02100.50 ▲5.00
Media Library /wp-admin/upload.php3.26 ▲0.0235.91 ▼8.29

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
ppp_visa
ppp_mc
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Pro (Direct Payment + Hosted) - PayPal
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.231.91 ▼0.0345.93 ▲1.03
Dashboard /wp-admin2,192 ▲155.54 ▼0.0984.70 ▼10.5837.53 ▼4.42
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0639.16 ▲3.7936.54 ▼0.82
Add New Post /wp-admin/post-new.php1,526 ▼1923.57 ▲0.37674.23 ▼87.8858.43 ▼1.18
Media Library /wp-admin/upload.php1,400 ▼34.17 ▼0.0999.76 ▼4.2044.06 ▼5.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
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • ppp_visa
    • widget_recent-posts
    • can_compress_scripts
    • ppp_mc
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payment-pro-direct-payment-hosted-paypal/class-paypal-pro.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/payment-pro-direct-payment-hosted-paypal/templates/hosted.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Countries' not found in wp-content/plugins/payment-pro-direct-payment-hosted-paypal/templates/direct.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: paypal-pro, payments, paypal

payment-pro-direct-payment-hosted-paypal/paypal-pro.php 92% from 13 tests

Analyzing the main PHP file in "Payment Pro (Direct Payment + Hosted) - PayPal" version 1.0.0
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("payment-pro-direct-payment-hosted-paypal.php" instead of "paypal-pro.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
Good job! No executable or dangerous file extensions detected1,710 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP93442161,693
JavaScript14017

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity57.00
▷ Minimum class complexity2.00
▷ Maximum class complexity150.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods12.38%
▷ Public methods3992.86%
▷ Protected methods00.00%
▷ Private methods37.14%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants13
▷ Global constants13100.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
PNG images were not found in this plugin