63% restrict-with-stripe

Code Review | Restrict With Stripe - Sell Access to Posts and Pages with Stripe

WordPress plugin Restrict With Stripe - Sell Access to Posts and Pages with Stripe scored 63% from 54 tests.

About plugin

  • Plugin page: restrict-with-stripe
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.2
  • WordPress version: 6.3.1
  • First release: Nov 4, 2022
  • Latest release: Jun 9, 2023
  • Number of updates: 10
  • Update frequency: every 21.8 days
  • Top authors: dlparker1005 (70%)strangerstudios (40%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,018 total downloads

Benchmarks

Plugin footprint 83% from 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.28MB] [CPU: ▼111.84ms] Passed 4 tests

This is a short check of server-side resources used by Restrict With Stripe - Sell Access to Posts and Pages with Stripe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3046.78 ▲5.68
Dashboard /wp-admin3.61 ▲0.2254.90 ▼442.93
Posts /wp-admin/edit.php3.73 ▲0.3855.47 ▲1.70
Add New Post /wp-admin/post-new.php6.16 ▲0.2791.93 ▼11.60
Media Library /wp-admin/upload.php3.53 ▲0.3040.14 ▲5.49
Restrict With Stripe /wp-admin/options-general.php?page=rwstripe3.5137.95

Server storage [IO: ▲1.71MB] [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: 337 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Restrict With Stripe - Sell Access to Posts and Pages with Stripe
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,097 ▲35124.23 ▲9.636.86 ▲5.2142.45 ▲1.98
Dashboard /wp-admin2,378 ▲20413.78 ▲8.88300.87 ▲188.9438.94 ▼2.89
Posts /wp-admin/edit.php2,252 ▲16312.63 ▲10.52101.75 ▲59.7028.77 ▼9.96
Add New Post /wp-admin/post-new.php1,543 ▲823.65 ▲0.52524.29 ▼115.7738.01 ▼14.17
Media Library /wp-admin/upload.php1,593 ▲20513.19 ▲8.94135.01 ▲37.9541.63 ▼1.86
Restrict With Stripe /wp-admin/options-general.php?page=rwstripe1,04413.00118.8638.92

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/update_certs.php
    • > /wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/build.php
  • 255× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/Exception/SignatureVerificationException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/OAuthErrorObject.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/Treasury/ReceivedCredit.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\HttpClient\\ClientInterface' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/HttpClient/CurlClient.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/Service/TestHelpers/Treasury/ReceivedCreditService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/Service/TestHelpers/Treasury/ReceivedDebitService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/Service/Terminal/ReaderService.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/restrict-with-stripe/includes/content.php:83
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/Service/Issuing/TransactionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/lib/SearchResult.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=rwstripe
    • > Network (severe)
    index.php/wp-json/rwstripe/v1/products?_locale=user - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration Passed 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
6 plugin tags: restrict access, e-commerce, subscriptions, ecommerce, stripe...

restrict-with-stripe/restrict-with-stripe.php Passed 13 tests

The main PHP script in "Restrict With Stripe - Sell Access to Posts and Pages with Stripe" version 1.0.9 is automatically included on every request by WordPress
35 characters long description:
Monetize your content using Stripe.

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
These items require your attention
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/restrict-with-stripe/includes/lib/Stripe/data/ca-certificates.crt
12,886 lines of code in 314 files:
LanguageFilesBlank linesComment linesLines of code
PHP2922,44912,22010,159
Markdown268401,293
JavaScript94171539
PO File1143396303
Sass2440255
CSS4512212
JSON20065
XML10031
make110029

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.77
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity1.52
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces34
Interfaces9
Traits9
Classes256
▷ Abstract classes103.91%
▷ Concrete classes24696.09%
▷ Final classes00.00%
Methods874
▷ Static methods17820.37%
▷ Public methods78990.27%
▷ Protected methods404.58%
▷ Private methods455.15%
Functions56
▷ Named functions4478.57%
▷ Anonymous functions1221.43%
Constants1,007
▷ Global constants70.70%
▷ Class constants1,00099.30%
▷ Public constants1,000100.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
11 PNG files occupy 0.31MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
blocks/assets/rwstripe-customer-portal-block.png43.65KB42.49KB▼ 2.65%
blocks/build/images/restrict-with-stripe.f445c776.png14.45KB7.62KB▼ 47.29%
blocks/assets/rwstripe-edit-term-restrict-setting.png23.72KB22.87KB▼ 3.57%
blocks/assets/restrict-with-stripe.png14.45KB7.62KB▼ 47.29%
restrict-with-stripe-banner.png21.49KB9.13KB▼ 57.53%