10% easy-stripe

Code Review | Easy Stripe

WordPress plugin Easy Stripe scored10%from 54 tests.

About plugin

  • Plugin page: easy-stripe
  • Plugin version: 1.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Oct 20, 2017
  • Latest release: Aug 9, 2021
  • Number of updates: 12
  • Update frequency: every 115.8 days
  • Top authors: scottpaterson (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /3,267 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/easy-stripe/includes/settings/settings_api.php+149
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.71MB] [CPU: ▼21.05ms] Passed 4 tests

Analyzing server-side resources used by Easy Stripe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.85 ▲1.3846.98 ▲5.63
Dashboard /wp-admin4.67 ▲1.3737.47 ▼11.55
Posts /wp-admin/edit.php4.67 ▲1.3148.83 ▼8.07
Add New Post /wp-admin/post-new.php4.67 ▼1.2236.16 ▼61.80
Media Library /wp-admin/upload.php4.67 ▲1.4437.73 ▼2.78
Reports /wp-admin/admin.php?page=easystripe_reports4.6735.28
Orders /wp-admin/edit.php?post_type=easystripe_order4.6736.41
Settings /wp-admin/admin.php?page=easystripe_settings_page4.6737.81
Buttons /wp-admin/edit.php?post_type=easystripe_button4.6736.12
Pro Version /wp-admin/admin.php?page=easystripe_pro4.6735.81

Server storage [IO: ▲0.97MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 185 new files
Database: no new tables, 10 new options
New WordPress options
easystripe_pages
can_compress_scripts
easystripe_settings
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
easystripe_counter
widget_theysaidso_widget
easystripe_firstrun
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Stripe
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,118 ▲35714.33 ▼0.039.39 ▲7.0837.27 ▼12.04
Dashboard /wp-admin2,407 ▲2425.48 ▼0.2192.56 ▼53.3386.68 ▲19.41
Posts /wp-admin/edit.php2,313 ▲2132.42 ▲0.4457.13 ▲14.4776.17 ▲38.32
Add New Post /wp-admin/post-new.php1,806 ▲27923.38 ▲0.49646.12 ▼45.6144.10 ▼13.34
Media Library /wp-admin/upload.php1,608 ▲2114.98 ▲0.70108.18 ▲3.7265.17 ▲21.81
Reports /wp-admin/admin.php?page=easystripe_reports1,0532.4735.1036.48
Orders /wp-admin/edit.php?post_type=easystripe_order1,2802.4743.3161.76
Settings /wp-admin/admin.php?page=easystripe_settings_page3,1968.83176.0396.96
Buttons /wp-admin/edit.php?post_type=easystripe_button1,2712.3639.9465.48
Pro Version /wp-admin/admin.php?page=easystripe_pro6464.3493.4081.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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 cannot be uninstalled
    • > Deprecated in wp-content/plugins/easy-stripe/includes/functions.php+28
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 9 options in the database
    • easystripe_pages
    • theysaidso_admin_options
    • widget_recent-comments
    • easystripe_settings
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • easystripe_counter
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=easystripe_pro
    • > Deprecated in wp-content/plugins/easy-stripe/includes/functions.php+28
    Function create_function() is deprecated

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/easy-stripe/includes/stripe_library/build.php
    • > /wp-content/plugins/easy-stripe/includes/stripe_library/examples/oauth.php
  • 116× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/easy-stripe/includes/stripe_library/tests/ExchangeRateTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/easy-stripe/includes/stripe_library/tests/AttachedObjectTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/easy-stripe/includes/stripe_library/lib/Error/Api.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/easy-stripe/includes/stripe_library/lib/OrderReturn.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/easy-stripe/includes/stripe_library/tests/StripeObjectTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/easy-stripe/includes/stripe_library/lib/Token.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/easy-stripe/includes/stripe_library/tests/ApiRequestorTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/easy-stripe/includes/stripe_library/tests/DiscountTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/easy-stripe/includes/stripe_library/lib/Collection.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\Base' not found in wp-content/plugins/easy-stripe/includes/stripe_library/lib/Error/ApiConnection.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=easystripe_button
    • > Network (severe)
    wp-content/plugins/easy-stripe/assets/css/jquery-ui-datepicker-only-custom-min.css?ver=1.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=easystripe_pro
    • > Network (severe)
    https://wpplugin.org/downloads/easy-stripe-pro?edd-flush=1 - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6 in easy-stripe/assets to your readme.txt
The official readme.txt is a good inspiration

easy-stripe/easy-stripe.php 85% from 13 tests

The principal PHP file in "Easy Stripe" v. 1.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path points to a folder that does not exist ("/i18n/languages/")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/easy-stripe/includes/stripe_library/data/ca-certificates.crt
12,255 lines of code in 178 files:
LanguageFilesBlank linesComment linesLines of code
PHP1602,5002,89910,994
JavaScript929075476
Markdown21740380
CSS2828296
YAML23043
JSON10036
XML20030

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.13
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity1.44
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces5
Interfaces4
Traits0
Classes123
▷ Abstract classes86.50%
▷ Concrete classes11593.50%
▷ Final classes00.00%
Methods574
▷ Static methods20235.19%
▷ Public methods51489.55%
▷ Protected methods345.92%
▷ Private methods264.53%
Functions107
▷ Named functions10295.33%
▷ Anonymous functions54.67%
Constants28
▷ Global constants1035.71%
▷ Class constants1864.29%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/stripe_library/data/test.png0.09KB0.09KB0.00%