66% s2member

Code Review | s2Member – Best Membership Plugin for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions

WordPress plugin s2Member – Best Membership Plugin for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions scored 66% from 54 tests.

About plugin

  • Plugin page: s2member
  • Plugin version: 230815...
  • PHP compatiblity: 5.6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2+
  • WordPress version: 6.3.1
  • First release: Mar 22, 2010
  • Latest release: Aug 15, 2023
  • Number of updates: 550
  • Update frequency: every 8.9 days
  • Top authors: PriMoThemes (69.82%)clavaque (11.27%)WebSharks (10.36%)JasWSInc (6.55%)raamdev (2.73%)

Code review

54 tests

User reviews

218 reviews

Install metrics

10,000+ active / 1,483,112 total downloads

Benchmarks

Plugin footprint 82% 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.68MB] [CPU: ▲1.65ms] Passed 4 tests

An overview of server-side resources used by s2Member – Best Membership Plugin for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.37 ▲1.9153.52 ▲8.77
Dashboard /wp-admin4.96 ▲1.6647.30 ▲0.24
Posts /wp-admin/edit.php5.23 ▲1.8856.51 ▲5.59
Add New Post /wp-admin/post-new.php7.35 ▲1.4697.95 ▼7.99
Media Library /wp-admin/upload.php4.96 ▲1.7452.33 ▲20.60
Restriction Options /wp-admin/admin.php?page=ws-plugin--s2member-res-ops5.3553.88
API / Tracking /wp-admin/admin.php?page=ws-plugin--s2member-trk-ops5.3352.78
PayPal Buttons /wp-admin/admin.php?page=ws-plugin--s2member-paypal-buttons5.3652.69
Log Files (Debug) /wp-admin/admin.php?page=ws-plugin--s2member-logs5.1755.73
Other Integrations /wp-admin/admin.php?page=ws-plugin--s2member-integrations5.0747.80
PayPal Options /wp-admin/admin.php?page=ws-plugin--s2member-paypal-ops5.5351.49
Getting Help /wp-admin/admin.php?page=ws-plugin--s2member-help5.0845.80
Download Options /wp-admin/admin.php?page=ws-plugin--s2member-down-ops5.5954.31
Getting Started /wp-admin/admin.php?page=ws-plugin--s2member-start5.0659.31

Server storage [IO: ▲4.44MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 3 files (6.56KB) illegally modified outside of "wp-content/plugins/s2member/" and "wp-content/uploads/"
    • (new file) wp-content/plugins/s2member-logs/.htaccess
    • (new file) wp-content/plugins/s2member-files/.htaccess
    • (modified) .htaccess
Filesystem: 461 new files
Database: no new tables, 12 new options
New WordPress options
ws_plugin__s2member_activated_version
ws_plugin__s2member_configured
db_upgraded
theysaidso_admin_options
ws_plugin__s2member_cache
ws_plugin__s2member_options
ws_plugin__s2member_activated_levels
widget_recent-posts
widget_theysaidso_widget
ws_plugin__s2member_notices
...

Browser metrics Passed 4 tests

A check of browser resources used by s2Member – Best Membership Plugin for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,994 ▲24813.65 ▼0.599.91 ▲7.8939.39 ▼0.83
Dashboard /wp-admin2,308 ▲1175.87 ▲0.94111.01 ▲7.0397.06 ▲51.56
Posts /wp-admin/edit.php2,208 ▲1161.97 ▼0.1538.56 ▼1.9542.45 ▲8.20
Add New Post /wp-admin/post-new.php6,774 ▲5,26028.92 ▲11.50969.60 ▲294.0792.03 ▲34.19
Media Library /wp-admin/upload.php1,505 ▲1234.23 ▲0.0497.79 ▲0.2483.94 ▲41.29
Restriction Options /wp-admin/admin.php?page=ws-plugin--s2member-res-ops2,5978.90103.4269.56
API / Tracking /wp-admin/admin.php?page=ws-plugin--s2member-trk-ops2,6118.9491.1273.91
PayPal Buttons /wp-admin/admin.php?page=ws-plugin--s2member-paypal-buttons10,1398.8678.6071.81
Log Files (Debug) /wp-admin/admin.php?page=ws-plugin--s2member-logs1,6228.9077.6281.39
Other Integrations /wp-admin/admin.php?page=ws-plugin--s2member-integrations1,2319.0575.6382.96
PayPal Options /wp-admin/admin.php?page=ws-plugin--s2member-paypal-ops2,6048.8977.0777.50
Getting Help /wp-admin/admin.php?page=ws-plugin--s2member-help1,2428.8879.7882.16
Download Options /wp-admin/admin.php?page=ws-plugin--s2member-down-ops5,61621.22568.5674.35
Getting Started /wp-admin/admin.php?page=ws-plugin--s2member-start1,52814.66320.43106.99
/wp-admin/admin.php?page=#280.440.075.33

Uninstaller [IO: ▲0.01MB] [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
  • Zombie WordPress options were found after uninstall: 12 options
    • db_upgraded
    • widget_theysaidso_widget
    • ws_plugin__s2member_activated_levels
    • ws_plugin__s2member_notices
    • ws_plugin__s2member_cache
    • ws_plugin__s2member_activated_version
    • widget_recent-comments
    • ws_plugin__s2member_options
    • ws_plugin__s2member_configured
    • can_compress_scripts
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws-plugin--s2member-start
    • > Notice in wp-content/plugins/s2member/src/includes/classes/admin-css-js-in.inc.php+55
    ob_end_clean(): failed to delete buffer. No buffer to delete

SRP 0% 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
Almost there! Just fix the following items
  • 207× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/s2member/src/includes/menu-pages/mms-ops.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/email-configs.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/profile-mods.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/s-badge-status.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/menu-pages.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/profile.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/catgs-sp.inc.php
    • > /wp-content/plugins/s2member/src/includes/classes/option-forces.inc.php
    • > /wp-content/plugins/s2member/src/includes/functions/class-autoloader.inc.php
    • > /wp-content/plugins/s2member/src/includes/templates/players/jwplayer-v7-rtmp.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/s2member/src/vendor/defuse/php-encryption/src/Exception/WrongKeyOrModifiedCiphertextException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'AWeberOAuthAdapter' not found in wp-content/plugins/s2member/src/includes/externals/aweber/oauth_application.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/s2member/src/vendor/defuse/php-encryption/src/Exception/IOException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'AWeberResponse' not found in wp-content/plugins/s2member/src/includes/externals/aweber/aweber_collection.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/s2member/src/vendor/defuse/php-encryption/src/Exception/EnvironmentIsBrokenException.php:5
    • > PHP Fatal error
      Uncaught UnexpectedValueException: creating archive "wp-content/plugins/s2member/src/vendor/paragonie/random_compat/dist/random_compat.phar" disabled by the php.ini setting phar.readonly in /var/www/wordpress/wp-content/plugins/s2member/src/vendor/paragonie/random_compat/other/build_phar.php:12
    • > PHP Warning
      require_once(other/ide_stubs/libsodium.php): failed to open stream: No such file or directory in wp-content/plugins/s2member/src/vendor/paragonie/random_compat/psalm-autoload.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'AWeberAPIBase' not found in wp-content/plugins/s2member/src/includes/externals/aweber/aweber_response.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'other/ide_stubs/libsodium.php' (include_path='.:/usr/share/php') in wp-content/plugins/s2member/src/vendor/paragonie/random_compat/psalm-autoload.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/s2member/src/vendor/defuse/php-encryption/src/Exception/BadFormatException.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ws-plugin--s2member-start
    • > Network (severe)
    http://feeds.feedburner.com/s2member?format=sigpro&nItems=5&openLinks=new&displayTitle=false&displayFeedIcon=false&displayExcerpts=false&displayAuthor=false&displayDate=false&displayEnclosures=false&displayLinkToFeed=false - Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE.NotSameSite
    • > GET request to /wp-admin/admin.php?page=#
    • > Network (severe)
    wp-admin/admin.php?page=# - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Tested up to: Version not formatted correctly
You can look at the official readme.txt

s2member/s2member.php 92% from 13 tests

This is the main PHP file of "s2Member – Best Membership Plugin for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions" version 230815..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "230815...")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin36,546 lines of code in 275 files:
LanguageFilesBlank linesComment linesLines of code
PHP2547,23019,58432,170
JavaScript122853042,007
CSS31051351,884
INI1100305
JSON200138
make19424
XML10015
Bourne Shell1203

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 600)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity47.77
▷ Minimum class complexity1.00
▷ Maximum class complexity614.00
Average method complexity12.49
▷ Minimum method complexity1.00
▷ Maximum method complexity600.00
Code structure
Namespaces3
Interfaces3
Traits0
Classes212
▷ Abstract classes00.00%
▷ Concrete classes212100.00%
▷ Final classes73.30%
Methods889
▷ Static methods56163.10%
▷ Public methods85395.95%
▷ Protected methods212.36%
▷ Private methods151.69%
Functions78
▷ Named functions7089.74%
▷ Anonymous functions810.26%
Constants104
▷ Global constants7673.08%
▷ Class constants2826.92%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
45 PNG files occupy 0.47MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/images/lock-icon.png0.52KB0.39KB▼ 26.03%
src/images/large-icon.png11.90KB5.70KB▼ 52.07%
src/images/wordpress-dark.png2.49KB1.95KB▼ 21.66%
src/images/mailchimp-stamp.png25.43KB8.54KB▼ 66.43%
src/images/brand-upsell-pro.png10.44KB5.24KB▼ 49.81%