78% bp-member-type-manager

Code Review | BP Member Type Manager

WordPress plugin BP Member Type Manager scored78%from 54 tests.

About plugin

  • Plugin page: bp-member-type-ma...
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.5
  • WordPress version: 6.3.1
  • First release: Apr 28, 2016
  • Latest release: May 12, 2016
  • Number of updates: 4
  • Update frequency: every 3.5 days
  • Top authors: Rimon_Habib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /4,038 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.02MB] [CPU: ▼8.62ms] Passed 4 tests

An overview of server-side resources used by BP Member Type Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.12 ▼0.60
Dashboard /wp-admin3.33 ▼0.0153.72 ▼17.43
Posts /wp-admin/edit.php3.44 ▲0.0950.28 ▼1.66
Add New Post /wp-admin/post-new.php5.93 ▲0.0584.76 ▼12.38
Media Library /wp-admin/upload.php3.25 ▲0.0337.07 ▼2.99
Manage /wp-admin/admin.php?page=bmtm_manage_member_types3.2032.67
Settings /wp-admin/admin.php?page=bmtm_manage_member_types_settings3.2032.04

Server storage [IO: ▲0.28MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
recovery_mode_email_last_sent
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for BP Member Type Manager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.63 ▼0.031.87 ▲0.1443.37 ▼2.34
Dashboard /wp-admin2,224 ▲505.51 ▼0.0283.59 ▼1.2341.02 ▲1.61
Posts /wp-admin/edit.php2,129 ▲292.01 ▲0.0235.69 ▼5.5233.88 ▼1.95
Add New Post /wp-admin/post-new.php1,554 ▲2623.32 ▲0.43679.54 ▼3.0450.99 ▲2.71
Media Library /wp-admin/upload.php1,426 ▲294.20 ▼0.08100.52 ▼9.0146.36 ▼0.37
Manage /wp-admin/admin.php?page=bmtm_manage_member_types7311.537.4822.87
Settings /wp-admin/admin.php?page=bmtm_manage_member_types_settings1,0002.0225.3925.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% 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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bmtm_manage_member_types_settings
    • > Notice in wp-content/plugins/bp-member-type-manager/admin/bmtm-admin.php+38
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bmtm_manage_member_types_settings
    • > Notice in wp-content/plugins/bp-member-type-manager/admin/bmtm-admin.php+39
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=bmtm_manage_member_types
    • > Error in wp-content/plugins/bp-member-type-manager/includes/bp-member-type-manager-functions.php+16
    Uncaught Error: Call to undefined function bp_get_member_types() in wp-content/plugins/bp-member-type-manager/includes/bp-member-type-manager-functions.php:16
    Stack trace:
    #0 wp-content/plugins/bp-member-type-manager/admin/class-bp-member-types-list-table.php(101): bmtm_get_all_member_type()
    #1 wp-content/plugins/bp-member-type-manager/admin/screens/member-types-list.php(19): BP_Member_Type_List_Table->prepare_items()
    #2 wp-content/plugins/bp-member-type-manager/admin/bmtm-admin.php(51): require_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): bmtm_admin_screen()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP 50% 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
Please fix the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-member-type-manager/bp-member-type-manager.php:130
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/bp-member-type-manager/admin/class-bp-member-types-list-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-member-type-manager/admin/bmtm-admin.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-member-type-manager/includes/bmtm-ajax.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bmtm_get_options() in wp-content/plugins/bp-member-type-manager/admin/screens/edit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-member-type-manager/includes/bp-member-type-manager-actions.php:28
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/bp-member-type-manager/admin/class-bp-member-types-list-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/bp-member-type-manager/admin/class-bp-member-types-list-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bp-member-type-manager/admin/screens/member-types-list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_options() on null in wp-content/plugins/bp-member-type-manager/admin/screens/_settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === bp-member-type-manager === )
  • Screenshots: Please add descriptions for these screenshots #3, #4 in bp-member-type-manager/assets to your readme.txt
You can look at the official readme.txt

bp-member-type-manager/bp-member-type-manager.php Passed 13 tests

"BP Member Type Manager" version 1.01's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
55 characters long description:
Create and Manage member types of your BuddyPress site.

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
Success! There were no dangerous files found in this plugin959 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP11394128946
JavaScript12013

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity15.33
▷ Minimum class complexity8.00
▷ Maximum class complexity30.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions30
▷ Named functions2686.67%
▷ Anonymous functions413.33%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.23MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png53.02KB24.94KB▼ 52.96%
screenshot-1.png82.30KB39.13KB▼ 52.46%
asset/images/donate-btn.png5.08KB0.57KB▼ 88.88%
screenshot-3.png32.30KB15.76KB▼ 51.20%
screenshot-4.png60.03KB28.67KB▼ 52.24%