78% buddypress-conditional-field-groups

Code Review | BuddyPress Conditional Field Groups

WordPress plugin BuddyPress Conditional Field Groups scored 78% from 54 tests.

About plugin

  • Plugin page: buddypress-condit...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.2.0
  • WordPress version: 6.3.1
  • First release: May 29, 2015
  • Latest release: May 30, 2015
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: tanner m (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 4,619 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▲1.65ms] Passed 4 tests

An overview of server-side resources used by BuddyPress Conditional Field Groups
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0255.03 ▲9.66
Dashboard /wp-admin3.33 ▲0.0260.16 ▲1.68
Posts /wp-admin/edit.php3.38 ▲0.0253.98 ▲0.88
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.89 ▲1.90
Media Library /wp-admin/upload.php3.25 ▲0.0240.44 ▲2.14
Conditional Groups /wp-admin/users.php?page=conditional-field-groups3.3043.11

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
recovery_mode_email_last_sent
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for BuddyPress Conditional Field Groups
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲4013.65 ▲0.506.22 ▲4.2643.22 ▲0.32
Dashboard /wp-admin2,210 ▲45.87 ▲1.01105.85 ▼10.3142.27 ▼2.29
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0340.63 ▲5.0635.74 ▲1.43
Add New Post /wp-admin/post-new.php1,517 ▼1717.62 ▼5.58642.05 ▼64.4956.92 ▲5.54
Media Library /wp-admin/upload.php1,395 ▲104.15 ▼0.0699.19 ▼7.1847.05 ▲4.52
Conditional Groups /wp-admin/users.php?page=conditional-field-groups6781.537.7819.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/users.php?page=conditional-field-groups
    • > Error in wp-content/plugins/buddypress-conditional-field-groups/views/settings.php+16
    Uncaught Error: Call to undefined function bp_xprofile_get_groups() in wp-content/plugins/buddypress-conditional-field-groups/views/settings.php:16
    Stack trace:
    #0 wp-content/plugins/buddypress-conditional-field-groups/includes/setup.php(89): include()
    #1 wp-includes/class-wp-hook.php(310): CFG_Setup->create_admin_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/users.php(11): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% 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
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cfg_get_conditional_map() in wp-content/plugins/buddypress-conditional-field-groups/views/settings.php:15
    • > PHP Notice
      Trying to get property 'role_names' of non-object in wp-content/plugins/buddypress-conditional-field-groups/views/settings.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/buddypress-conditional-field-groups/buddypress_conditional_field_groups.php:40
    • > PHP Warning
      array_reverse() expects parameter 1 to be array, null given in wp-content/plugins/buddypress-conditional-field-groups/views/settings.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-conditional-field-groups/includes/setup.php:34

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: buddypress, xprofile fields

buddypress-conditional-field-groups/buddypress_conditional_field_groups.php 85% from 13 tests

The principal PHP file in "BuddyPress Conditional Field Groups" v. 0.1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("buddypress-conditional-field-groups.php" instead of "buddypress_conditional_field_groups.php")

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
Everything looks great! No dangerous files found in this plugin218 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP35982189
JSON10023
Markdown3306

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods116.67%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin