56% profilegrid-user-profiles-groups-and-communities

Code Review | ProfileGrid – User Profiles, Memberships, Groups and Communities

WordPress plugin ProfileGrid – User Profiles, Memberships, Groups and Communities scored56%from 54 tests.

About plugin

  • Plugin page: profilegrid-user-...
  • Plugin version: 5.6.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Nov 30, 2016
  • Latest release: Nov 25, 2023
  • Number of updates: 564
  • Update frequency: every 4.5 days
  • Top authors: metagauss (41.31%)profilegrid (39.01%)cmshelplive (13.48%)profilegrid0 (6.74%)

Code review

54 tests

User reviews

192 reviews

Install metrics

7,000+ active /769,038 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲5.63MB] [CPU: ▲26.98ms] 75% from 4 tests

This is a short check of server-side resources used by ProfileGrid – User Profiles, Memberships, Groups and Communities
The following require your attention
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.63MB on /wp-admin/admin.php?page=pm_theme_settings)
PageMemory (MB)CPU Time (ms)
Home /9.16 ▲5.6971.85 ▲32.17
Dashboard /wp-admin8.98 ▲5.6376.93 ▲17.68
Posts /wp-admin/edit.php8.99 ▲5.6375.74 ▲29.14
Add New Post /wp-admin/post-new.php11.81 ▲5.92122.48 ▲28.91
Media Library /wp-admin/upload.php8.78 ▲5.5573.53 ▲43.36
Analytics /wp-admin/admin.php?page=pm_analytics8.6768.52
Payments Settings /wp-admin/admin.php?page=pm_payment_settings8.7764.12
Edit User /wp-admin/admin.php?page=pm_user_edit8.6763.84
Upload Settings /wp-admin/admin.php?page=pm_upload_settings8.7665.06
Members /wp-admin/admin.php?page=pm_user_manager8.9967.21
Groups /wp-admin/admin.php?page=pm_manage_groups8.8569.13
Email Preview /wp-admin/admin.php?page=pm_email_preview8.6762.62
Email Templates /wp-admin/admin.php?page=pm_email_templates8.7868.78
New Group /wp-admin/admin.php?page=pm_add_group9.2768.69
Profile Templates /wp-admin/admin.php?page=pm_theme_settings8.7662.50

Server storage [IO: ▲24.37MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 453 new files
Database: 11 new tables, 46 new options
New tables
wp_promag_groups
wp_promag_notification
wp_promag_fields
wp_promag_msg_conversation
wp_promag_sections
wp_promag_group_update_request
wp_promag_group_requests
wp_promag_paypal_log
wp_promag_email_templates
wp_promag_msg_threads
...
New WordPress options
pm_blog_notification_user
pm_redirect_after_login
pg_email_templates_created
pm_admin_account_review_notification
db_upgraded
progrid_db_version
pm_admin_notification
pm_encrypt_secret_key
pm_show_delete_profile
widget_pg_groups_menu
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for ProfileGrid – User Profiles, Memberships, Groups and Communities
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,508 ▲73618.02 ▲3.7931.17 ▲29.3439.72 ▼5.07
Dashboard /wp-admin2,491 ▲3136.85 ▲1.27118.16 ▲11.94116.62 ▲73.05
Posts /wp-admin/edit.php2,423 ▲3264.43 ▲2.4556.45 ▲15.3285.07 ▲50.35
Add New Post /wp-admin/post-new.php1,948 ▲42222.02 ▼1.36764.47 ▲135.0743.07 ▼9.17
Media Library /wp-admin/upload.php1,577 ▲1775.69 ▲1.5090.85 ▼10.59113.79 ▲68.08
Analytics /wp-admin/admin.php?page=pm_analytics1,1204.2853.5288.95
Payments Settings /wp-admin/admin.php?page=pm_payment_settings1,4144.1653.6682.45
Edit User /wp-admin/admin.php?page=pm_user_edit1,1174.2156.6178.43
Upload Settings /wp-admin/admin.php?page=pm_upload_settings1,2384.2857.9976.61
Members /wp-admin/admin.php?page=pm_user_manager1,7754.6360.53104.39
Groups /wp-admin/admin.php?page=pm_manage_groups1,5304.2554.26118.98
Email Preview /wp-admin/admin.php?page=pm_email_preview1,1204.1452.9969.78
Email Templates /wp-admin/admin.php?page=pm_email_templates1,5034.1953.3190.15
New Group /wp-admin/admin.php?page=pm_add_group7751.8920.4214.84
Profile Templates /wp-admin/admin.php?page=pm_theme_settings1,2464.1252.6194.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 11 tables in the database
    • wp_promag_group_requests
    • wp_promag_msg_conversation
    • wp_promag_group_update_request
    • wp_promag_sections
    • wp_promag_msg_threads
    • wp_promag_email_templates
    • wp_promag_paypal_log
    • wp_promag_fields
    • wp_promag_friends
    • wp_promag_groups
    • ...
  • This plugin did not uninstall successfully, leaving 46 options in the database
    • db_upgraded
    • pm_encrypt_secret_iv
    • pm_blog_feature_image
    • pm_admin_account_review_notification
    • pm_blog_notification_admin
    • pg_email_templates_created_upgrade
    • pm_redirect_after_login
    • pm_enable_blog
    • pm_show_delete_profile
    • progrid_multi_group_version
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=pm_analytics
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Profile_Magic_Admin' does not have a method 'pm_analytics'
    • > GET request to /wp-admin/admin.php?page=pm_user_edit
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Profile_Magic_Admin' does not have a method 'pm_user_edit'
    • > GET request to /wp-admin/admin.php?page=pm_email_preview
    • > Warning in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/class-profile-magic-admin.php+507
    include(partials/email-preview.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=pm_email_preview
    • > Warning in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/class-profile-magic-admin.php+507
    include(): Failed opening 'partials/email-preview.php' for inclusion (include_path='.:/usr/share/php')

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/profilegrid-user-profiles-groups-and-communities/public/partials/profile-magic-public-display.php
    • > /wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/partials/profile-magic-admin-display.php
  • 125× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PM_DBhandler' not found in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/partials/manage-groups.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PM_DBhandler' not found in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/partials/export-fields.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PM_DBhandler' not found in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/public/partials/profile-magic-add-blog.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function profile_magic_my_friends_requests() on null in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/public/partials/profile-magic-friend-sent-request.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/partials/friends-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/public/partials/themes/default/edit-profile-shortcode-tpl.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PM_DBhandler' not found in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/public/partials/themes/default/group-tpl.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PM_DBhandler' not found in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/partials/thirdparty-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/public/partials/themes/default/add-blog-tpl.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/partials/premium-features-profile-labels.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).datepicker is not a function" "TypeError: $(...).datepicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/js/profile-magic-admin.js?ver=5.6.9:17:29)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).sortable is not a function" "TypeError: jQuery(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/js/profile-magic-admin.js?ver=5.6.9:1075:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).sortable is not a function" "TypeError: jQuery(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/js/profile-magic-admin.js?ver=5.6.9:1096:35)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).sortable is not a function" "TypeError: jQuery(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/js/profile-magic-admin.js?ver=5.6.9:1118:41)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tabs is not a function" "TypeError: $(...).tabs is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/js/profile-magic-admin.js?ver=5.6.9:1183:16)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tabs is not a function" "TypeError: $(...).tabs is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/profilegrid-user-profiles-groups-and-communities/admin/js/profile-magic-admin.js?ver=5.6.9:1189:20)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).datepicker is not a function
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).sortable is not a function
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pm_add_group
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).tabs is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Tags: There are too many tags (78 tag instead of maximum 10)
  • Screenshots: These screenshots require images: #9 (A Group registration form using single page format - Notice the Profile sections are bundled into boxes.), #10 (The same Group registration form (As above), now split into multiple pages. Notice the "Next" button instead of Submit on bottom right.), #11 (All Members page with search capabilities.), #12 (Single Group page showing Group details and its members.), #13 (Dashboard Area - Groups Manager), #14 (Dashboard Area - Individual Group settings), #15 (Dashboard Area - User Profiles with filtering.), #16 (Dashboard Area - Individual Profile. Notice how Profile Sections are split into tabs.), #17 (Dashboard Area - Global Settings.), #18 (Dashboard Area - All the shortcodes associated with ProfileGrid.)
The official readme.txt is a good inspiration

profilegrid-user-profiles-groups-and-communities/profile-magic.php 92% from 13 tests

The primary PHP file in "ProfileGrid – User Profiles, Memberships, Groups and Communities" version 5.6.9 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("profilegrid-user-profiles-groups-and-communities.php" instead of "profile-magic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected218,614 lines of code in 244 files:
LanguageFilesBlank linesComment linesLines of code
PO File2354,09675,892131,695
PHP1576,9881,16749,562
JavaScript272,2271,04717,805
CSS232,24325215,335
SVG13004,206
JSON10011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity125.57
▷ Minimum class complexity1.00
▷ Maximum class complexity945.00
Average method complexity5.27
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods875
▷ Static methods00.00%
▷ Public methods86298.51%
▷ Protected methods00.00%
▷ Private methods131.49%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
133 PNG files occupy 6.93MB with 4.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/partials/images/performance.png36.41KB12.82KB▼ 64.80%
admin/partials/images/general.png40.38KB13.12KB▼ 67.51%
admin/partials/images/pg-woocommerce-wishlist-extension.png399.10KB142.51KB▼ 64.29%
admin/partials/images/mailpoet.png15.79KB8.30KB▼ 47.40%
admin/partials/images/userblogs.png19.55KB6.64KB▼ 66.03%