83% woo-mynix-braintree

Code Review | Woo Braintree Payment

WordPress plugin Woo Braintree Payment scored 83% from 54 tests.

About plugin

  • Plugin page: woo-mynix-braintree
  • Plugin version: 0.2-1 $...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.8
  • WordPress version: 5.9.2
  • First release: Oct 7, 2015
  • Latest release: Jan 17, 2017
  • Number of updates: 29
  • Update frequency: every 21.5 days
  • Top authors: eugenmihailescu (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

20+ active / 3,902 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

An overview of server-side resources used by Woo Braintree Payment
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0175.44 ▲10.69
Dashboard /wp-admin3.41 ▲0.0034.78 ▼13.31
Posts /wp-admin/edit.php3.64 ▲0.0040.59 ▼11.35
Add New Post /wp-admin/post-new.php6.88 ▼0.09110.15 ▼1,214.05
Media Library /wp-admin/upload.php3.30 ▲0.0032.26 ▼0.17

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 306 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Woo Braintree Payment
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,829 ▲8415.81 ▲0.3015.16 ▲6.472.93 ▼0.47
Dashboard /wp-admin2,958 ▲386.44 ▼0.02191.73 ▼15.94204.45 ▲2.96
Posts /wp-admin/edit.php2,719 ▼53.43 ▼0.0190.61 ▼2.17168.49 ▼30.77
Add New Post /wp-admin/post-new.php1,662 ▼3316.71 ▼1.53638.99 ▼103.13204.77 ▼41.62
Media Library /wp-admin/upload.php1,730 ▼25.68 ▼0.05194.25 ▲14.57257.16 ▼4.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 163× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/braintree/lib/Braintree/Transaction/StatusDetails.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/Braintree/Transaction/VenmoAccountDetails.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/Braintree/Subscription/StatusDetails.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/Braintree/CreditCard.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Exception' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/braintree/lib/Braintree/Exception/TestOperationPerformedInProduction.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/braintree/lib/Braintree/PayPalAccount.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Exception' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/Braintree/Exception/InvalidChallenge.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Exception' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/braintree/lib/Braintree/Exception/NotFound.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/Braintree/Subscription.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/woo-mynix-braintree/assets/vendor/braintree/lib/Braintree/Transaction/CreditCardDetails.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found


Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-mynix-braintree === )
You can look at the official readme.txt

woo-mynix-braintree/woo-mynix-braintree-gateway.php 69% from 13 tests

The primary PHP file in "Woo Braintree Payment" version 0.2-1 $... is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-mynix-braintree.php" instead of "woo-mynix-braintree-gateway.php")
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "0.2-1 $...")
  • Description: Please improve your description making it at least 10 characters long (currently 0 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/woo-mynix-braintree/assets/vendor/ssl/api_braintreegateway_com.ca.crt
      • wp-content/plugins/woo-mynix-braintree/assets/vendor/braintree/lib/ssl/api_braintreegateway_com.ca.crt
16,125 lines of code in 204 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity5.91
▷ Minimum class complexity1.00
▷ Maximum class complexity155.00
Average method complexity1.78
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
▷ Abstract classes41.44%
▷ Concrete classes27498.56%
▷ Final classes186.57%
▷ Static methods72341.84%
▷ Public methods1,41681.94%
▷ Protected methods1126.48%
▷ Private methods20011.57%
▷ Named functions1680.00%
▷ Anonymous functions420.00%
▷ Global constants201.58%
▷ Class constants1,24898.42%
▷ Public constants1,248100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/pci-badge.png4.19KB2.21KB▼ 47.40%
assets/img/icon-128x128.png18.26KB6.13KB▼ 66.46%
assets/img/pro-icon.png5.80KB2.77KB▼ 52.18%
assets/img/cc-badge.png6.40KB2.88KB▼ 54.92%