84% pal-digital-goods-express-checkout-for-woo

Code Review | PayPal Digital Goods For Woocommerce

WordPress plugin PayPal Digital Goods For Woocommerce scored 84% from 54 tests.

About plugin

  • Plugin page: pal-digital-goods...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 17, 2016
  • Latest release: Aug 17, 2016
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: wppaypalcontact (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 2,126 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Server-side resources used by PayPal Digital Goods For Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.20 ▼8.75
Dashboard /wp-admin3.32 ▲0.0243.67 ▼8.06
Posts /wp-admin/edit.php3.37 ▲0.0145.96 ▼2.04
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.02 ▲0.82
Media Library /wp-admin/upload.php3.24 ▲0.0137.79 ▲4.63

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by PayPal Digital Goods For Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼1.101.72 ▼0.3740.15 ▼6.85
Dashboard /wp-admin2,203 ▲125.88 ▲1.00107.13 ▼11.7443.18 ▼4.77
Posts /wp-admin/edit.php2,089 ▲32.01 ▼0.1139.89 ▲3.8835.09 ▲2.46
Add New Post /wp-admin/post-new.php1,543 ▲2418.40 ▼4.64586.96 ▼84.8651.42 ▼3.43
Media Library /wp-admin/upload.php1,388 ▼04.19 ▲0.0295.16 ▼7.5940.04 ▼7.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/pal-digital-goods-express-checkout-for-woo/includes/class-woo-paypal-digital-goods-express-checkout-gateway.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: paypal digital goods, express checkout, paypal digital, paypal, e-commerce...

pal-digital-goods-express-checkout-for-woo/woo-paypal-digital-goods-express-checkout.php 85% from 13 tests

The main PHP file in "PayPal Digital Goods For Woocommerce" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("pal-digital-goods-express-checkout-for-woo.php" instead of "woo-paypal-digital-goods-express-checkout.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,236 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP101213521,124
CSS11068
JavaScript11044

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity28.17
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods4692.00%
▷ Protected methods00.00%
▷ Private methods48.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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