72% buddypress-profile-tabs

Code Review | BuddyPress Profile Tabs

WordPress plugin BuddyPress Profile Tabs scored72%from 54 tests.

About plugin

  • Plugin page: buddypress-profil...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.2-4.5
  • WordPress version: 6.3.1
  • First release: Dec 13, 2012
  • Latest release: Apr 26, 2016
  • Number of updates: 43
  • Update frequency: every 28.6 days
  • Top authors: primetimejas (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

80+ active /21,761 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.15ms] Passed 4 tests

An overview of server-side resources used by BuddyPress Profile Tabs
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.52 ▼10.47
Dashboard /wp-admin3.50 ▲0.2047.01 ▼0.86
Posts /wp-admin/edit.php3.61 ▲0.2648.66 ▼1.11
Add New Post /wp-admin/post-new.php6.08 ▲0.2094.32 ▲4.21
Media Library /wp-admin/upload.php3.42 ▲0.2035.65 ▼0.17
BP Profile Tabs /wp-admin/options-general.php?page=bp-profile-tabs3.4434.60

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 62 new files
Database: no new tables, 8 new options
New WordPress options
recovery_mode_email_last_sent
bp_profile_tabs_option
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for BuddyPress Profile Tabs
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.48 ▼0.131.68 ▼0.3939.48 ▼3.87
Dashboard /wp-admin2,207 ▲225.80 ▲0.9195.57 ▼20.6439.68 ▼6.38
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0039.10 ▲0.1335.43 ▼0.59
Add New Post /wp-admin/post-new.php1,536 ▲1623.53 ▲0.35675.28 ▼25.6657.95 ▼2.61
Media Library /wp-admin/upload.php1,395 ▲44.22 ▼0.01100.61 ▼2.0346.55 ▲1.68
BP Profile Tabs /wp-admin/options-general.php?page=bp-profile-tabs6881.6518.3125.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=bp-profile-tabs
    • > Error in wp-content/plugins/buddypress-profile-tabs/admin/views/admin.php+81
    Uncaught Error: Call to undefined function bp_get_member_types() in wp-content/plugins/buddypress-profile-tabs/admin/views/admin.php:81
    Stack trace:
    #0 wp-content/plugins/buddypress-profile-tabs/admin/class-bp-profile-tabs-admin.php(114): include_once()
    #1 wp-includes/class-wp-hook.php(310): BP_Profile_Tabs_Admin->display_plugin_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/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/buddypress-profile-tabs/admin/includes/CMBF/tests/phpunit/includes/bootstrap.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/buddypress-profile-tabs/admin/includes/CMBF/example-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/buddypress-profile-tabs/admin/includes/CMBF/tests/phpunit/tests/CMB_Core_Test.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/buddypress-profile-tabs/admin/views/admin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/buddypress-profile-tabs/admin/includes/CMBF/init.php:1041

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === buddypress-profile-tabs === )
Please take inspiration from this readme.txt

buddypress-profile-tabs/bp-profile-tabs.php 85% from 13 tests

The primary PHP file in "BuddyPress Profile Tabs" version 1.6.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("buddypress-profile-tabs.php" instead of "bp-profile-tabs.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected5,759 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP156701,3762,540
JavaScript73164032,266
CSS36122540
Markdown3880288
Bourne Shell115459
JSON10031
YAML15018
XML10117

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity50.89
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods164
▷ Static methods4125.00%
▷ Public methods15795.73%
▷ Protected methods21.22%
▷ Private methods53.05%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/includes/CMBF/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
admin/includes/CMBF/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
admin/includes/CMBF/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
admin/includes/CMBF/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
admin/includes/CMBF/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%