58% pluco-membership

Code Review | Membership By PluginsCorner

WordPress plugin Membership By PluginsCorner scored58%from 54 tests.

About plugin

  • Plugin page: pluco-membership
  • Plugin version: 0.9.1
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.1
  • WordPress version: 6.3.1
  • First release: Feb 10, 2023
  • Latest release: Feb 27, 2023
  • Number of updates: 17
  • Update frequency: every 40.3 days
  • Top authors: pluginscorner (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /565 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 gracefully, with no errors

Server metrics [RAM: ▲1.31MB] [CPU: ▲19.63ms] Passed 4 tests

A check of server-side resources used by Membership By PluginsCorner
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.54 ▲1.0846.46 ▲6.80
Dashboard /wp-admin4.71 ▲1.4170.88 ▲20.98
Posts /wp-admin/edit.php4.78 ▲1.4375.21 ▲27.12
Add New Post /wp-admin/post-new.php7.28 ▲1.39112.07 ▲23.63
Media Library /wp-admin/upload.php4.60 ▲1.3766.33 ▲30.03
Plugins Corner /wp-admin/admin.php?page=plco_dashboard4.5954.83
Support /wp-admin/admin.php?page=plco_support4.5958.73
Membership /wp-admin/admin.php?page=plco_membership4.5958.05

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 704 new files
Database: 8 new tables, 10 new options
New tables
wp_plcom_payments
wp_plcom_cards
wp_plco_connections
wp_plcom_user_memberships
wp_plcom_recurrences
wp_plcom_plans
wp_plcom_membership_levels
wp_plcom_user_logs
New WordPress options
widget_theysaidso_widget
widget_recent-comments
PLCO_db_version
PLCOM_plugin_version
db_upgraded
PLCOM_db_version
widget_recent-posts
can_compress_scripts
PLCO_plugin_version
theysaidso_admin_options

Browser metrics Passed 4 tests

Membership By PluginsCorner: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,243 ▲1,49720.97 ▲6.7011.48 ▲9.6034.63 ▼8.73
Dashboard /wp-admin3,495 ▲1,30912.40 ▲7.47310.32 ▲200.5455.41 ▲14.34
Posts /wp-admin/edit.php3,599 ▲1,51010.45 ▲8.44236.93 ▲197.55114.59 ▲80.20
Add New Post /wp-admin/post-new.php2,679 ▲1,16022.56 ▼0.59745.97 ▲151.88142.87 ▲88.20
Media Library /wp-admin/upload.php2,777 ▲1,39211.22 ▲6.92292.25 ▲192.4948.22 ▲4.63
Plugins Corner /wp-admin/admin.php?page=plco_dashboard2,44510.45235.30106.42
Support /wp-admin/admin.php?page=plco_support2,38510.51200.0874.22
Membership /wp-admin/admin.php?page=plco_membership2,59010.27239.9352.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 8 tables
    • wp_plcom_plans
    • wp_plco_connections
    • wp_plcom_cards
    • wp_plcom_user_memberships
    • wp_plcom_user_logs
    • wp_plcom_recurrences
    • wp_plcom_membership_levels
    • wp_plcom_payments
  • Zombie WordPress options were found after uninstall: 10 options
    • PLCO_plugin_version
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • PLCOM_plugin_version
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • PLCOM_db_version
    • PLCO_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/pluco-membership/ipn.php
    • > /wp-content/plugins/pluco-membership/vendor/sendgrid/php-http-client/examples/example.php
  • 406× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PayPalHttp\\HttpRequest' not found in wp-content/plugins/pluco-membership/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AccessTokenRequest.php:7
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/pluco-membership/front/templates/account_form.php on line 104
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/lib/Service/BalanceService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid' not found in wp-content/plugins/pluco-membership/vendor/sendgrid/sendgrid/examples/scopes/scopes.php:8
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/pluco-membership/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/pluco-membership/vendor/paypal/paypal-checkout-sdk/samples/CaptureIntentExamples/RunAll.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PLCODashboard\\classes\\PLCO_Abstract_Repository' not found in wp-content/plugins/pluco-membership/front/classes/repositories/class-plcom-card-repository.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid\\Mail\\EmailAddress' not found in wp-content/plugins/pluco-membership/vendor/sendgrid/sendgrid/lib/mail/To.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/lib/Exception/ApiErrorException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/lib/Issuing/Transaction.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/lib/Order.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: plugins corner, membership, user registration, user profiles, pluginscorner...

pluco-membership/plco-membership.php 85% from 13 tests

"Membership By PluginsCorner" version 0.9.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pluco-membership.php" instead of "plco-membership.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
These items require your attention
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/pluco-membership/vendor/stripe/stripe-php/data/ca-certificates.crt
32,195 lines of code in 638 files:
LanguageFilesBlank linesComment linesLines of code
PHP5736,82220,00627,440
Markdown201,13002,386
JavaScript14170841,374
JSON800583
YAML8232209
XML54980130
make215040
Dockerfile29020
Bourne Shell1207
CSS4074
Ruby1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.66
▷ Minimum class complexity1.00
▷ Maximum class complexity118.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces67
Interfaces13
Traits8
Classes426
▷ Abstract classes204.69%
▷ Concrete classes40695.31%
▷ Final classes20.49%
Methods1,918
▷ Static methods33217.31%
▷ Public methods1,74090.72%
▷ Protected methods653.39%
▷ Private methods1135.89%
Functions63
▷ Named functions1219.05%
▷ Anonymous functions5180.95%
Constants877
▷ Global constants50.57%
▷ Class constants87299.43%
▷ Public constants872100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.34MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sendgrid-connection.png0.56KB0.34KB▼ 39.58%
vendor/sendgrid/php-http-client/twilio_sendgrid_logo.png14.25KB5.54KB▼ 61.17%
images/membership-logo.png11.34KB4.88KB▼ 56.91%
images/stripe-connection.png7.57KB6.84KB▼ 9.60%
vendor/sendgrid/php-http-client/static/img/github-sign-up.png84.82KB29.94KB▼ 64.70%