61% felix-user-memberships-content-restriction

Code Review | Felix User Membership Site

WordPress plugin Felix User Membership Site scored 61% from 54 tests.

About plugin

  • Plugin page: felix-user-member...
  • Plugin version: 1.07
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 5.9.2
  • First release: Dec 8, 2015
  • Latest release: Dec 14, 2015
  • Number of updates: 30
  • Update frequency: every 0.4 days
  • Top authors: smartcat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,059 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
Install script ran successfully

Server metrics [RAM: ▲0.34MB] [CPU: ▼292.69ms] Passed 4 tests

A check of server-side resources used by Felix User Membership Site
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.91 ▲0.4064.59 ▲14.42
Dashboard /wp-admin3.74 ▲0.3334.19 ▼3.93
Posts /wp-admin/edit.php3.96 ▲0.3238.14 ▲2.57
Add New Post /wp-admin/post-new.php7.27 ▲0.30102.15 ▼1,171.11
Media Library /wp-admin/upload.php3.68 ▲0.3927.41 ▲1.73
Settings /wp-admin/admin.php?page=memberships_settings4.0029.21
Membership Levels /wp-admin/admin.php?page=memberships_tiers3.7730.68
Members /wp-admin/admin.php?page=memberships_users3.7824.61
Edit User /wp-admin/admin.php?page=memberships_edit_user3.7527.86
Pending Members /wp-admin/admin.php?page=memberships_pending3.7528.63
Overview /wp-admin/admin.php?page=memberships3.7029.24
Documentation /wp-admin/admin.php?page=memberships_documentation3.7726.22

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 72 new files
Database: 2 new tables, 9 new options
New tables
wp_smartcat_memberships_pending_users
wp_smartcat_memberships_custom_tiers
New WordPress options
felix_pending
felix_approved
felix_welcome
felix_suspended
felix_pwchange
widget_felix_login_widget
smartcat_memberships_options
felix_reset
widget_felix_profile_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Felix User Membership Site
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,209 ▲45518.44 ▲2.6935.03 ▲29.252.65 ▲0.02
Dashboard /wp-admin2,948 ▲936.01 ▼0.13113.27 ▼20.81189.90 ▲27.30
Posts /wp-admin/edit.php2,745 ▲513.14 ▼0.1069.50 ▲4.77174.12 ▲34.76
Add New Post /wp-admin/post-new.php1,926 ▲17317.49 ▼4.49425.51 ▼37.35235.33 ▲78.35
Media Library /wp-admin/upload.php1,755 ▲605.55 ▲0.03115.14 ▼29.61222.92 ▲38.51
Settings /wp-admin/admin.php?page=memberships_settings4,6315.69141.18161.53
Membership Levels /wp-admin/admin.php?page=memberships_tiers2,4456.01109.42153.63
Members /wp-admin/admin.php?page=memberships_users3,5625.6598.73129.19
Edit User /wp-admin/admin.php?page=memberships_edit_user1,3214.6975.04102.40
Pending Members /wp-admin/admin.php?page=memberships_pending2,2276.00107.36136.24
Overview /wp-admin/admin.php?page=memberships1,5554.8578.06170.82
Documentation /wp-admin/admin.php?page=memberships_documentation2,2084.8777.75178.12

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_smartcat_memberships_pending_users
    • wp_smartcat_memberships_custom_tiers
  • Zombie WordPress options were found after uninstall: 9 options
    • felix_pwchange
    • felix_reset
    • felix_welcome
    • widget_felix_profile_widget
    • felix_pending
    • felix_suspended
    • felix_approved
    • widget_felix_login_widget
    • smartcat_memberships_options

Smoke tests 25% 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
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+199
    Undefined index: linkedin_signups
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+200
    Undefined index: linkedin_apikey
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+219
    Undefined index: comparisons
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Warning in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+221
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+233
    Undefined index: pricing_table_tier_highlights
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+244
    Trying to access array offset on value of type null
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Warning in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+289
    ucwords() expects parameter 1 to be string, object given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+243
    Undefined index: pricing_table_fore_colors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_settings
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php+244
    Undefined index: pricing_table_back_colors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_users
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/manage_users.php+48
    Undefined variable: level
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_users
    • > Notice in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/manage_users.php+48
    Trying to get property 'title' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 26× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening '../wp-includes/option.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/felix-user-memberships-content-restriction/admin/controllers/controller.admin_handlers.php on line 238
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/felix-user-memberships-content-restriction/inc/data/tables.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/felix-user-memberships-content-restriction/inc/class/class.felix_login.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/felix-user-memberships-content-restriction/inc/views/user_profile.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SmartcatForm' not found in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/documentation.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_page() in wp-content/plugins/felix-user-memberships-content-restriction/inc/controllers/controller.redirect_handler.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/felix-user-memberships-content-restriction/inc/views/login_form.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SmartcatForm' not found in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/tiers.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function smartcat_memberships_ocelot_main_header() in wp-content/plugins/felix-user-memberships-content-restriction/admin/views/main.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_pending
    • > Network (severe)
    wp-content/plugins/felix-user-memberships-content-restriction/inc/assets/styles/DataTables-1.10.10/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=memberships_pending
    • > Network (severe)
    wp-content/plugins/felix-user-memberships-content-restriction/inc/assets/styles/DataTables-1.10.10/images/sort_asc.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Plugin overview - user stats), #2 (Setting Page permissions), #3 (Single Member profile), #4 (Login form), #5 (Single Page/Post restriction & redirect settings), #6 (Easy to use settings page)
  • Tags: You are using too many tags: 35 tag instead of maximum 10
You can look at the official readme.txt

felix-user-memberships-content-restriction/memberships.php 77% from 13 tests

"Felix User Membership Site" version 1.07'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: Please rename the main PHP file in this plugin to the plugin slug ("felix-user-memberships-content-restriction.php" instead of "memberships.php")
  • Description: The description should be shorter than 140 characters (currently 147 characters long)
  • 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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected8,301 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,6034583,686
CSS145294922,775
PO File1256284715
SVG100655
JavaScript6115121470

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity21.33
▷ Minimum class complexity3.00
▷ Maximum class complexity86.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods56
▷ Static methods35.36%
▷ Public methods5496.43%
▷ Protected methods00.00%
▷ Private methods23.57%
Functions27
▷ Named functions2592.59%
▷ Anonymous functions27.41%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/assets/images/li_default.png3.86KB1.50KB▼ 61.06%
admin/assets/images/wp.png5.69KB1.91KB▼ 66.36%
admin/assets/images/felix_icon_small.png5.90KB2.92KB▼ 50.54%
admin/assets/images/felix_icon.png0.84KB0.72KB▼ 13.85%
inc/assets/images/li_hover.png3.88KB1.49KB▼ 61.57%