83% bp-activity-filter

Code Review | Wbcom Designs - BuddyPress Activity Filter

WordPress plugin Wbcom Designs - BuddyPress Activity Filter scored83%from 54 tests.

About plugin

  • Plugin page: bp-activity-filter
  • Plugin version: 2.8.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Dec 1, 2016
  • Latest release: Aug 17, 2023
  • Number of updates: 30
  • Update frequency: every 81.4 days
  • Top authors: wbcomdesigns (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

800+ active /30,821 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.00MB] [CPU: ▼4.16ms] Passed 4 tests

This is a short check of server-side resources used by Wbcom Designs - BuddyPress Activity Filter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.26 ▼1.55
Dashboard /wp-admin3.31 ▲0.0056.03 ▲6.49
Posts /wp-admin/edit.php3.36 ▲0.0053.15 ▼4.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.93 ▼7.74
Media Library /wp-admin/upload.php3.23 ▲0.0036.71 ▼2.99

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 72 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Wbcom Designs - BuddyPress Activity Filter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.121.70 ▼0.1439.95 ▼7.84
Dashboard /wp-admin2,195 ▲215.63 ▼0.0387.80 ▲2.3440.73 ▼2.59
Posts /wp-admin/edit.php2,100 ▼32.02 ▼0.0240.25 ▼1.3434.51 ▼4.46
Add New Post /wp-admin/post-new.php1,535 ▲718.30 ▼4.71612.31 ▼47.9179.42 ▲9.06
Media Library /wp-admin/upload.php1,403 ▲64.22 ▼0.0396.41 ▼5.7944.57 ▼1.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/bp-activity-filter/admin/wbcom/templates/wbcom-support-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/bp-activity-filter/admin/wbcom/templates/wbcom-license-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-activity-filter/admin/class-bp-activity-filter-admin-setting.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bp-activity-filter/templates/class-bp-activity-filter-dropdown.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/bp-activity-filter/admin/class-bp-activity-filter-feedback.php:311
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-activity-filter/admin/class-bp-activity-filter-add-post-support.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-activity-filter/admin/class-bp-activity-filter-admin-setting-save.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bp-activity-filter/templates/class-bp-activity-filter-query.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/bp-activity-filter/buddypress-activity-filter.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-activity-filter/admin/class-bp-activity-filter-admin-script-includer.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (The screenshot shows settings to select the activity type to display on the activity page by default, corresponding to screenshot-1.(png|jpg|jpeg|gif).), #2 (The screenshot shows settings to select activity/activities you want to hide from the dropdown list on activity options, which corresponds to), #3 (The screenshot shows settings to add custom post-type activities, corresponding to screenshot-3.(png|jpg|jpeg|gif).), #4 (The screenshot shows FAQ(s) , corresponds to screenshot-4.(png|jpg|jpeg|gif).)
The official readme.txt is a good inspiration

bp-activity-filter/buddypress-activity-filter.php 92% from 13 tests

The main PHP script in "Wbcom Designs - BuddyPress Activity Filter" version 2.8.6 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bp-activity-filter.php" instead of "buddypress-activity-filter.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
No dangerous file extensions were detected6,524 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
CSS35671092,796
PHP143215712,097
PO File34726921,343
JavaScript41313266
JSON10022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity25.56
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods53
▷ Static methods00.00%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.58MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/wbcom/assets/imgs/logowbcom.png10.12KB3.87KB▼ 61.72%
admin/images/ui-icons_555555_256x240.png3.20KB3.50KB0.00%
admin/images/wbcom.png11.75KB4.75KB▼ 59.58%
admin/images/ui-icons_ffffff_256x240.png3.19KB3.49KB0.00%
admin/wbcom/assets/imgs/wbcom-offer-notice.png67.64KB32.40KB▼ 52.11%