46% wpmerchant

Code Review | WPMerchant - Stripe Plugin for WordPress

WordPress plugin WPMerchant - Stripe Plugin for WordPress scored46%from 54 tests.

About plugin

  • Plugin page: wpmerchant
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.3
  • WordPress version: 6.3.1
  • First release: Jul 22, 2015
  • Latest release: Nov 19, 2020
  • Number of updates: 49
  • Update frequency: every 40.0 days
  • Top authors: benshadle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,480 total downloads

Benchmarks

Plugin footprint 65% 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: ▼0.29MB] [CPU: ▼19.07ms] Passed 4 tests

An overview of server-side resources used by WPMerchant - Stripe Plugin for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1044.13 ▲7.08
Dashboard /wp-admin3.16 ▼0.1528.86 ▼20.01
Posts /wp-admin/edit.php3.29 ▼0.0632.99 ▼10.66
Add New Post /wp-admin/post-new.php4.92 ▼0.9750.51 ▼38.03
Media Library /wp-admin/upload.php3.24 ▲0.0124.57 ▼7.59
Settings /wp-admin/admin.php?page=wpmerchant-settings3.1426.35
Products /wp-admin/edit.php?post_type=wpmerchant_products3.2732.48
Dashboard /wp-admin/admin.php?page=wpmerchant3.1426.15

Server storage [IO: ▲1.25MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/wpmerchant/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/wpmerchant/public/class-wpmerchant-public (Benjamin\342\200\231s MacBook Pro's conflicted copy 2015-06-21).php"
Filesystem: 265 new files
Database: 1 new table, 10 new options
New tables
wp_wpmerchant_customers
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
wpmerchant_currency
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
wpmerchant_email_list_processor
wpmerchant_payment_processor
wpmerchant_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for WPMerchant - Stripe Plugin for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,031 ▲28515.74 ▲1.38138.07 ▲136.3338.20 ▼2.40
Dashboard /wp-admin2,227 ▲395.88 ▲0.01110.83 ▲10.2093.71 ▲50.26
Posts /wp-admin/edit.php2,128 ▲392.01 ▼0.0435.99 ▼3.2432.34 ▼0.58
Add New Post /wp-admin/post-new.php1,554 ▲2123.08 ▼0.11686.54 ▲25.8561.48 ▼0.51
Media Library /wp-admin/upload.php1,418 ▲334.25 ▲0.05102.21 ▲1.0668.44 ▲23.74
Settings /wp-admin/admin.php?page=wpmerchant-settings1,4521.7229.2136.98
Products /wp-admin/edit.php?post_type=wpmerchant_products1,1431.9831.0530.46
Dashboard /wp-admin/admin.php?page=wpmerchant1,4039.47258.9672.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_wpmerchant_customers
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • wpmerchant_email_list_processor
    • widget_recent-posts
    • wpmerchant_db_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • wpmerchant_payment_processor
    • db_upgraded
    • wpmerchant_currency

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpmerchant
    • > Notice in wp-content/plugins/wpmerchant/admin/class-wpmerchant-admin.php+138
    Undefined variable: addPlanNonce
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpmerchant
    • > Notice in wp-content/plugins/wpmerchant/admin/class-wpmerchant-admin.php+139
    Undefined variable: getPlanNonce
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpmerchant-settings
    • > Notice in wp-content/plugins/wpmerchant/admin/class-wpmerchant-admin.php+1616
    Undefined variable: select_options

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/build.php
    • > /wp-content/plugins/wpmerchant/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/wpmerchant/public/partials/wpmerchant-public-display.php
  • 165× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/lib/Transfer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/lib/Coupon.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/wpmerchant/vendor/stripe/stripe-php/tests/BalanceTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wpmerchant/vendor/stripe/stripe-php/lib/Subscription.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ExternalAccount' not found in wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/lib/BitcoinReceiver.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/lib/BitcoinTransaction.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/wpmerchant/vendor/stripe/stripe-php/lib/Error/Api.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/lib/Error/Card.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wpmerchant/includes/stripe-php-2.2.0/lib/Recipient.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wpmerchant/vendor/stripe/stripe-php/lib/Product.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=wpmerchant-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: wpm_ajax_object is not defined" "ReferenceError: wpm_ajax_object is not defined\n at Object.getEmailData (/wp-content/plugins/wpmerchant/admin/js/wpmerchant-admin.js?ver=2.0.6:120:86)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wpmerchant/admin/js/wpmerchant-admin.js?ver=2.0.6:55:24)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=wpmerchant-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: wpm_ajax_object is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid url: "wpmerchant.com/team"
  • Tags: Too many tags (29 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

wpmerchant/wpmerchant.php Passed 13 tests

The main PHP script in "WPMerchant - Stripe Plugin for WordPress" version 2.0.6 is automatically included on every request by WordPress
81 characters long description:
Start making money by easily and professionally selling anything on your website.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
It is important to 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/wpmerchant/includes/stripe-php-2.2.0/data/ca-certificates.crt
      • wp-content/plugins/wpmerchant/vendor/stripe/stripe-php/data/ca-certificates.crt
13,397 lines of code in 200 files:
LanguageFilesBlank linesComment linesLines of code
PHP1812,0294,83111,808
Markdown53990633
JavaScript219135451
CSS21034272
JSON420172
XML20030
YAML36030
HTML1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity5.60
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces6
Interfaces4
Traits0
Classes180
▷ Abstract classes105.56%
▷ Concrete classes17094.44%
▷ Final classes00.00%
Methods880
▷ Static methods23726.93%
▷ Public methods79390.11%
▷ Protected methods424.77%
▷ Private methods455.11%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants16
▷ Global constants425.00%
▷ Class constants1275.00%
▷ Public constants12100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/logo2.png16.32KB8.29KB▼ 49.18%
vendor/stripe/stripe-php/data/test.png0.09KB0.09KB0.00%
admin/img/payment.png6.55KB2.47KB▼ 62.25%
public/img/close.png3.93KB1.36KB▼ 65.42%
admin/img/payments.png9.48KB3.62KB▼ 61.87%