83% wp-members

Code Review | WP-Members Membership Plugin

WordPress plugin WP-Members Membership Plugin scored 83% from 54 tests.

About plugin

  • Plugin page: wp-members
  • Plugin version: 3.4.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Sep 23, 2009
  • Latest release: Aug 2, 2023
  • Number of updates: 497
  • Update frequency: every 11.5 days
  • Top authors: cbutlerjr (100%)

Code review

54 tests

User reviews

253 reviews

Install metrics

70,000+ active / 3,332,096 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.20MB] [CPU: ▲21.20ms] 75% from 4 tests

An overview of server-side resources used by WP-Members Membership Plugin
Please fix the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 933.58ms on /wp-admin/options-general.php?page=wpmem-settings)
PageMemory (MB)CPU Time (ms)
Home /5.13 ▲1.6766.83 ▲23.24
Dashboard /wp-admin5.89 ▲2.5974.15 ▲24.02
Posts /wp-admin/edit.php5.76 ▲2.4074.68 ▲24.73
Add New Post /wp-admin/post-new.php8.27 ▲2.39114.46 ▲15.41
Media Library /wp-admin/upload.php5.56 ▲2.3356.21 ▲22.13
WP-Members /wp-admin/options-general.php?page=wpmem-settings6.88933.58
WP-Members Onboarding /wp-admin/admin.php?page=wp-members-onboarding5.5047.68

Server storage [IO: ▲2.91MB] [DB: ▲0.05MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 236 new files
Database: no new tables, 12 new options
New WordPress options
db_upgraded
widget_recent-comments
wpmembers_settings
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
wpmembers_dialogs
wpmembers_tos
wpmembers_fields
widget_widget_wpmemwidget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-Members Membership Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,001 ▲26613.62 ▼0.755.68 ▲3.8132.31 ▼18.58
Dashboard /wp-admin2,321 ▲1334.87 ▼0.05111.19 ▼3.9049.07 ▲0.38
Posts /wp-admin/edit.php2,183 ▲972.37 ▲0.3240.41 ▲5.9437.01 ▲1.18
Add New Post /wp-admin/post-new.php6,537 ▲5,02320.32 ▲2.79884.06 ▲216.9236.53 ▼13.60
Media Library /wp-admin/upload.php1,436 ▲514.21 ▲0.0297.14 ▼0.7048.44 ▲3.87
WP-Members /wp-admin/options-general.php?page=wpmem-settings1,7452.7446.1863.53
WP-Members Onboarding /wp-admin/admin.php?page=wp-members-onboarding6591.536.2416.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_widget_wpmemwidget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-members/templates/tos.php:20
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-members/includes/admin/partials/onboarding_notice.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/wp-members/includes/admin/partials/onboarding_finalize.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Walker_Nav_Menu' not found in wp-content/plugins/wp-members/includes/walkers/class-wp-members-walker-nav-menu.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/wp-members/includes/cli/class-wp-members-cli-user.php:253
    • > PHP Notice
      Undefined variable: install_state in wp-content/plugins/wp-members/includes/admin/partials/onboarding_notice.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI' not found in wp-content/plugins/wp-members/includes/cli/class-wp-members-cli-settings.php:310

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-members/wp-members.php 92% from 13 tests

"WP-Members Membership Plugin" version 3.4.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 344 characters long)

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
Success! There were no dangerous files found in this plugin41,790 lines of code in 191 files:
LanguageFilesBlank linesComment linesLines of code
PO File116,6419,84814,095
PHP722,84110,73612,890
JavaScript722,58080410,064
CSS354524774,739
Markdown1002

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 125)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity64.20
▷ Minimum class complexity5.00
▷ Maximum class complexity420.00
Average method complexity7.52
▷ Minimum method complexity1.00
▷ Maximum method complexity125.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods388
▷ Static methods7318.81%
▷ Public methods35691.75%
▷ Protected methods00.00%
▷ Private methods328.25%
Functions255
▷ Named functions255100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/jquery-ui/ui-icons_777620_256x240.png4.57KB4.18KB▼ 8.43%
assets/images/jquery-ui/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
assets/images/jquery-ui/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
assets/images/jquery-ui/ui-icons_ffffff_256x240.png6.17KB4.18KB▼ 32.17%
assets/images/jquery-ui/ui-icons_555555_256x240.png6.91KB4.18KB▼ 39.47%