10% buddypress-group-email-subscription

Code Review | BuddyPress Group Email Subscription

WordPress plugin BuddyPress Group Email Subscription scored 10% from 54 tests.

About plugin

  • Plugin page: buddypress-group-...
  • Plugin version: 4.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.8
  • WordPress version: 5.8.1
  • First release: Mar 22, 2010
  • Latest release: Oct 4, 2021
  • Number of updates: 319
  • Update frequency: every 13.2 days
  • Top authors: boonebgorges (55.17%)dwenaus (45.14%)

Code review

54 tests

User reviews

30 reviews

Install metrics

5,000+ active / 191,511 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Error in wp-content/plugins/buddypress-group-email-subscription/bp-activity-subscription-digest.php+815
    Uncaught Error: Call to undefined function restore_current_blog() in wp-content/plugins/buddypress-group-email-subscription/bp-activity-subscription-digest.php:815
    Stack trace:
    #0 wp-content/plugins/buddypress-group-email-subscription/bp-activity-subscription.php(79): ass_set_daily_digest_time()
    #1 wp-includes/class-wp-hook.php(303): activitysub_setup_defaults()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(698): do_action()

Server metrics [RAM: ▼0.00MB] [CPU: ▼142.97ms] Passed 4 tests

An overview of server-side resources used by BuddyPress Group Email Subscription
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1235.97 ▲10.26
Dashboard /wp-admin3.06 ▲0.0052.88 ▲8.23
Posts /wp-admin/edit.php3.11 ▲0.0049.72 ▲0.18
Add New Post /wp-admin/post-new.php5.42 ▼0.0297.61 ▼572.08
Media Library /wp-admin/upload.php3.01 ▲0.0033.40 ▼8.20

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 77 new files
Database: no new tables, 1 new option
New WordPress options
ass_digest_time

Browser metrics Passed 4 tests

A check of browser resources used by BuddyPress Group Email Subscription
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲8216.14 ▲0.188.23 ▲0.5051.76 ▼0.23
Dashboard /wp-admin2,967 ▲335.94 ▼0.01143.50 ▼7.88126.76 ▲5.20
Posts /wp-admin/edit.php2,739 ▼02.68 ▲0.0069.10 ▼0.2897.22 ▲11.40
Add New Post /wp-admin/post-new.php1,591 ▼9218.82 ▲0.04384.64 ▼11.88120.61 ▲8.14
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.03157.97 ▼0.10127.34 ▲1.41

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • ass_digest_time

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 23× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/buddypress-group-email-subscription/lib/wp-background-processing/wp-background-processing.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-group-email-subscription/screen-user-settings.php:99
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-group-email-subscription/screen-admin.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/buddypress-group-email-subscription/screen-bbpress.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/buddypress-group-email-subscription/classes/class-bpges-command.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Async_Request' not found in wp-content/plugins/buddypress-group-email-subscription/classes/class-bpges-async-request.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function groups_get_groupmeta() in wp-content/plugins/buddypress-group-email-subscription/templates/groups/single/admin/ges-welcome-email.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'BPGES_Async_Request' not found in wp-content/plugins/buddypress-group-email-subscription/classes/class-bpges-async-request-digest-queue-migrate.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'BPGES_Async_Request' not found in wp-content/plugins/buddypress-group-email-subscription/classes/class-bpges-async-request-send-queue.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddypress-group-email-subscription/legacy-forums.php:319

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
Please take inspiration from this readme.txt

buddypress-group-email-subscription/bp-activity-subscription.php 92% from 13 tests

The principal PHP file in "BuddyPress Group Email Subscription" v. 4.0.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("buddypress-group-email-subscription.php" instead of "bp-activity-subscription.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin12,931 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PO File162,4673,4687,997
PHP301,4682,4454,412
CSS1454209
Markdown1540104
JavaScript1241289
Bourne Shell115459
XML20031
JSON10018
YAML14012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity8.93
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes320.00%
▷ Concrete classes1280.00%
▷ Final classes00.00%
Methods91
▷ Static methods1010.99%
▷ Public methods5257.14%
▷ Protected methods3942.86%
▷ Private methods00.00%
Functions152
▷ Named functions14595.39%
▷ Anonymous functions74.61%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/emailwide.png0.47KB0.39KB▼ 17.19%
css/email.png0.31KB0.22KB▼ 27.30%