10% membership-site

Code Review | MemberSonic Lite Membership Site Plugin

WordPress plugin MemberSonic Lite Membership Site Plugin scored 10% from 54 tests.

About plugin

  • Plugin page: membership-site
  • Plugin version: 2.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.6
  • WordPress version: 5.8.1
  • First release: Dec 22, 2020
  • Latest release: Jan 9, 2021
  • Number of updates: 56
  • Update frequency: every 0.3 days
  • Top authors: Plugin Results (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 387 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/membership-site/membersonic_class.php+20
    Trying to access array offset on value of type null

Server metrics [RAM: ▼1.67MB] [CPU: ▼144.79ms] Passed 4 tests

This is a short check of server-side resources used by MemberSonic Lite Membership Site Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.96 ▼0.7650.92 ▲30.89
Dashboard /wp-admin1.98 ▼1.0748.54 ▲4.49
Posts /wp-admin/edit.php1.99 ▼1.1256.12 ▲11.62
Add New Post /wp-admin/post-new.php1.98 ▼3.4550.64 ▼609.25
Media Library /wp-admin/upload.php1.98 ▼1.0249.82 ▲13.99
Import Members /wp-admin/admin.php?page=membership-site-manage-users-import1.9848.09
Content Protection /wp-admin/admin.php?page=membership-site-content_protection1.9849.84
General Settings /wp-admin/admin.php?page=membership-site-general_settings1.9848.56
Dashboard /wp-admin/admin.php?page=membership-site-dashboard1.9848.50
Member Mgmt /wp-admin/admin.php?page=membership-site-manage-users1.9849.35
Add Edit Membership /wp-admin/admin.php?page=membership-site-add-edit-membership-level1.9849.86

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 58 new files
Database: 13 new tables, no new options
New tables
wp_77_sm_email_broadcast
wp_77_sm_content_protection
wp_77_sm_membership_paypal
wp_77_sm_transactions
wp_77_sm_membership_transaction
wp_77_jvzoo_bonusdata
wp_77_sm_membership_details
wp_77_jvzoo_detail
wp_77_sm_login_limit
wp_77_sm_member_assoc
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for MemberSonic Lite Membership Site Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,001 ▲39615.87 ▲0.319.27 ▲0.1856.43 ▲8.72
Dashboard /wp-admin3,120 ▲1865.98 ▼0.10135.97 ▼10.63116.63 ▼2.98
Posts /wp-admin/edit.php2,885 ▲1492.73 ▲0.0161.60 ▲1.07106.21 ▲13.80
Add New Post /wp-admin/post-new.php1,857 ▲17421.72 ▲2.98271.92 ▼105.42159.99 ▲46.19
Media Library /wp-admin/upload.php1,890 ▲835.00 ▼0.03153.76 ▲3.48118.19 ▼1.18
Import Members /wp-admin/admin.php?page=membership-site-manage-users-import1,3963.3789.7999.05
Content Protection /wp-admin/admin.php?page=membership-site-content_protection1,3863.6287.8478.06
General Settings /wp-admin/admin.php?page=membership-site-general_settings1,6573.4281.1184.60
Dashboard /wp-admin/admin.php?page=membership-site-dashboard1,3623.4177.4584.28
Member Mgmt /wp-admin/admin.php?page=membership-site-manage-users1,6273.6484.1381.56
Add Edit Membership /wp-admin/admin.php?page=membership-site-add-edit-membership-level1,8583.5675.7684.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/membership-site/membersonic_class.php+20
    Trying to access array offset on value of type bool
  • Zombie tables detected upon uninstall: 13 tables
    • wp_77_sm_login_limit
    • wp_77_sm_cat_drip_ar
    • wp_77_sm_drip_ar
    • wp_77_sm_membership_details
    • wp_77_jvzoo_detail
    • wp_77_sm_member_assoc
    • wp_77_jvzoo_bonusdata
    • wp_77_sm_membership_transaction
    • wp_77_sm_membership_paypal
    • wp_77_sm_email_broadcast
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/membersonic_class.php+20
    Trying to access array offset on value of type bool
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/membersonic_class.php+52
    Undefined index: mspaypalipn
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/add-edit-membership-level.php+34
    Undefined index: membersoniclite_action
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > User deprecated in wp-includes/functions.php+5211
    get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/membersonic_class.php+85
    Undefined index: msliteaction
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/membersonic_class.php+724
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=membership-site-manage-users-import
    • > Notice in wp-content/plugins/membership-site/admin/view/manage_users_import.php+6
    Undefined index: importfile
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-manage-users-import
    • > Notice in wp-content/plugins/membership-site/admin/view/manage_users_import.php+26
    Undefined variable: res
    • > GET request to /wp-admin/admin.php?page=membership-site-content_protection
    • > Notice in wp-content/plugins/membership-site/admin/model/content-protection.php+24
    Undefined variable: protected
    • > GET request to /wp-admin/admin.php?page=membership-site-content_protection
    • > Notice in wp-content/plugins/membership-site/admin/model/content-protection.php+41
    Undefined variable: all_membership_levels
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-general_settings
    • > Notice in wp-content/plugins/membership-site/admin/view/general_settings.php+83
    Undefined variable: arg
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-manage-users
    • > Notice in wp-content/plugins/membership-site/admin/view/manage_users.php+12
    Undefined variable: data
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/includes/step3.php+37
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-manage-users
    • > Notice in wp-content/plugins/membership-site/helper/paginator.class.php+91
    Undefined property: membership_site::$ipp
    • > GET request to /wp-admin/admin.php?page=membership-site-manage-users
    • > Notice in wp-content/plugins/membership-site/admin/view/manage_users.php+110
    Undefined variable: membershipid
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/add-edit-membership-level.php+28
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/add-edit-membership-level.php+30
    Undefined variable: page_head
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/includes/step3.php+37
    Undefined variable: membership_level
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/includes/step2.php+19
    Undefined variable: protected_ids
    • > GET request to /wp-admin/admin.php?page=membership-site-add-edit-membership-level
    • > Notice in wp-content/plugins/membership-site/admin/view/add-edit-membership-level.php+72
    Undefined index: tb

SRP 50% 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
The following issues need your attention
  • 36× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant MEMBERSONICLITE_PLUGIN_URL - assumed 'MEMBERSONICLITE_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/membership-site/admin/view/header.php on line 13
    • > PHP Warning
      Use of undefined constant MEMBERSONICLITE_PLUGIN_DIR - assumed 'MEMBERSONICLITE_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/membership-site/helper/mailer-helper.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/membership-site/membersonic_class.php:2
    • > PHP Warning
      require_once(MEMBERSONICLITE_PLUGIN_DIR/admin/model/general-settings.php): failed to open stream: No such file or directory in wp-content/plugins/membership-site/helper/mailer-helper.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/membership-site/front_end/view/shortcode-passwordreset.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'MEMBERSONICLITE_PLUGIN_DIR/helper/mailer-helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/membership-site/front_end/model/front_model.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/membership-site/admin/view/includes/step1.php:6
    • > PHP Warning
      include_once(MEMBERSONICLITE_PLUGIN_DIR/admin/model/add-edit-membership-level.php): failed to open stream: No such file or directory in wp-content/plugins/membership-site/admin/view/add-edit-membership-level.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/membership-site/admin/view/msshortcode.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/membership-site/admin/view/header.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

membership-site/membersonic.php 85% from 13 tests

Analyzing the main PHP file in "MemberSonic Lite Membership Site Plugin" version 2.0.2
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 ("membership-site.php" instead of "membersonic.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected4,534 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP321591773,532
PO File12,334794805
JavaScript322112
CSS42085

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity17.71
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods114
▷ Static methods00.00%
▷ Public methods114100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.20MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/one-ad.png36.95KB21.20KB▼ 42.61%
assets/images/ms-lite-logo.png12.61KB6.54KB▼ 48.13%
assets/images/popbutton.png3.15KB0.62KB▼ 80.31%
assets/images/PayPal-payment-button-1.png81.16KB23.75KB▼ 70.73%
assets/images/PayPal-payment-button-1TH.png1.70KB1.60KB▼ 5.70%