73% manage-gravity-forms-stripe-subscriptions

Code Review | GravityStripe Subscription Manager

WordPress plugin GravityStripe Subscription Manager scored73%from 54 tests.

About plugin

  • Plugin page: manage-gravity-fo...
  • Plugin version: 4.1.6
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 25, 2020
  • Latest release: Aug 14, 2023
  • Number of updates: 76
  • Update frequency: every 16.7 days
  • Top authors: zerozendesign (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /3,474 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.20MB] [CPU: ▲24.28ms] 75% from 4 tests

Server-side resources used by GravityStripe Subscription Manager
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.20MB on /wp-admin/admin.php?page=manage-gravity-forms-stripe-subscriptions)
PageMemory (MB)CPU Time (ms)
Home /9.11 ▲5.6470.28 ▲29.91
Dashboard /wp-admin9.13 ▲5.7871.30 ▲13.28
Posts /wp-admin/edit.php9.13 ▲5.7772.94 ▲30.64
Add New Post /wp-admin/post-new.php9.51 ▲3.62117.23 ▲23.78
Media Library /wp-admin/upload.php9.13 ▲5.8962.86 ▲30.13
Subscriptions /wp-admin/admin.php?page=zzd_stripe_subscriptions9.1353.46
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.1355.92
Single Transactions /wp-admin/admin.php?page=zzd_stripe_transactions9.1357.53
GravityStripe Subscription Management /wp-admin/admin.php?page=manage-gravity-forms-stripe-subscriptions9.1377.61

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 227 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_recent-comments
fs_accounts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
fs_debug_mode
fs_active_plugins
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by GravityStripe Subscription Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲27015.89 ▲1.6922.20 ▲20.2933.80 ▼19.74
Dashboard /wp-admin2,292 ▲1126.02 ▲0.46102.09 ▲1.9043.69 ▲0.61
Posts /wp-admin/edit.php2,195 ▲953.12 ▲1.1253.36 ▲18.1837.53 ▲5.55
Add New Post /wp-admin/post-new.php1,602 ▲6523.41 ▲5.30701.78 ▲74.7038.09 ▼32.93
Media Library /wp-admin/upload.php1,494 ▲915.61 ▲1.42111.46 ▲10.2444.06 ▲0.12
Subscriptions /wp-admin/admin.php?page=zzd_stripe_subscriptions8102.7242.0219.80
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1342.7140.5126.03
Single Transactions /wp-admin/admin.php?page=zzd_stripe_transactions1,4439.91285.5778.71
GravityStripe Subscription Management /wp-admin/admin.php?page=manage-gravity-forms-stripe-subscriptions1,0742.7139.5460.81

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
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/manage-gravity-forms-stripe-subscriptions/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-posts
    • theysaidso_admin_options
    • fs_active_plugins
    • fs_debug_mode
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • fs_accounts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/manage-gravity-forms-stripe-subscriptions/gravitystripe-subscriptions-manager.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_users() in wp-content/plugins/manage-gravity-forms-stripe-subscriptions/entry-metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/manage-gravity-forms-stripe-subscriptions/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/manage-gravity-forms-stripe-subscriptions/admin-table.php:63

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes: Please take inspiration from this readme.txt

manage-gravity-forms-stripe-subscriptions/gravitystripe-subscriptions-manager.php 85% from 13 tests

The main PHP script in "GravityStripe Subscription Manager" version 4.1.6 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 384 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("manage-gravity-forms-stripe-subscriptions.php" instead of "gravitystripe-subscriptions-manager.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin71,320 lines of code in 169 files:
LanguageFilesBlank linesComment linesLines of code
PHP1248,23517,32935,397
PO File137,0478,55915,453
JavaScript113,5572,34015,382
CSS212881275,088

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity93.06
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,259
▷ Static methods19715.65%
▷ Public methods87069.10%
▷ Protected methods171.35%
▷ Private methods37229.55%
Functions150
▷ Named functions150100.00%
▷ Anonymous functions00.00%
Constants150
▷ Global constants10368.67%
▷ Class constants4731.33%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
images/gravity-stripe-wp-menu_logo.png2.35KB2.04KB▼ 13.16%
css/images/ui-icons_ffffff_256x240.png6.33KB4.18KB▼ 33.99%
images/icon.png21.46KB7.93KB▼ 63.07%
css/images/ui-icons_cc0000_256x240.png4.57KB4.18KB▼ 8.43%