73% om-stripe

Code Review | Om Stripe

WordPress plugin Om Stripescored73%from 54 tests.

About plugin

  • Plugin page: om-stripe
  • Plugin version: 02.00.00
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.9.3
  • WordPress version: 6.3.1
  • First release: Sep 25, 2015
  • Latest release: May 22, 2022
  • Number of updates: 17
  • Update frequency: every 143.0 days
  • Top authors: siddharthsingh91 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,026 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
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲0.90ms] Passed 4 tests

This is a short check of server-side resources used by Om Stripe
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.0542.29 ▼3.21
Dashboard /wp-admin3.61 ▲0.0554.37 ▼1.91
Posts /wp-admin/edit.php3.72 ▲0.0554.52 ▲5.06
Add New Post /wp-admin/post-new.php6.19 ▲0.05107.55 ▲3.67
Media Library /wp-admin/upload.php3.53 ▲0.0444.09 ▲7.36

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 36 new files
Database: 1 new table, 7 new options
New tables
wp_om_stripe
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
om_stripe_db_version
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Om Stripe
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,012 ▲22615.59 ▲1.22122.34 ▲120.4445.15 ▲1.34
Dashboard /wp-admin2,194 ▲145.61 ▼0.0395.74 ▲2.9075.37 ▲29.75
Posts /wp-admin/edit.php2,114 ▲142.00 ▼0.0338.62 ▲2.0534.88 ▲1.14
Add New Post /wp-admin/post-new.php1,545 ▼418.25 ▼5.28736.54 ▲50.0462.98 ▲0.42
Media Library /wp-admin/upload.php1,408 ▲84.25 ▲0.07102.10 ▲1.8179.87 ▲33.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 23× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/om-stripe/lib/Stripe/Plan.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/om-stripe/lib/Stripe/Token.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/om-stripe/lib/Stripe/Invoice.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_Object' not found in wp-content/plugins/om-stripe/lib/Stripe/List.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/om-stripe/lib/Stripe/Transfer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/om-stripe/lib/Stripe/InvoiceItem.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/om-stripe/including_js_css.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_Error' not found in wp-content/plugins/om-stripe/lib/Stripe/AuthenticationError.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/om-stripe/lib/Stripe/Charge.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_Error' not found in wp-content/plugins/om-stripe/lib/Stripe/CardError.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Om Stripe=== )
  • Screenshots: A description for screenshot #3 is required in om-stripe/assets to your readme.txt
The official readme.txt might help

om-stripe/index.php 92% from 13 tests

This is the main PHP file of "Om Stripe" version 02.00.00, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("om-stripe.php" instead of "index.php")

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
It is important to fix the following items
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/om-stripe/lib/data/ca-certificates.crt
1,439 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP29170301,269
JavaScript21926105
CSS12165

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.88
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes416.67%
▷ Concrete classes2083.33%
▷ Final classes00.00%
Methods118
▷ Static methods6151.69%
▷ Public methods10790.68%
▷ Protected methods65.08%
▷ Private methods54.24%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/om_stripe.png3.37KB0.67KB▼ 80.02%