84% bp-premiums

Code Review | BP Premiums for BuddyPress

WordPress plugin BP Premiums for BuddyPress scored84%from 54 tests.

About plugin

  • Plugin page: bp-premiums
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.7.3
  • WordPress version: 6.3.1
  • First release: Sep 8, 2015
  • Latest release: Mar 25, 2017
  • Number of updates: 7
  • Update frequency: every 80.6 days
  • Top authors: suiteplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,857 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by BP Premiums for BuddyPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1748.97 ▲9.02
Dashboard /wp-admin3.47 ▲0.1645.24 ▼5.07
Posts /wp-admin/edit.php3.58 ▲0.2250.84 ▲0.74
Add New Post /wp-admin/post-new.php6.05 ▲0.1693.19 ▼17.84
Media Library /wp-admin/upload.php3.39 ▲0.1642.10 ▲9.48

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by BP Premiums for BuddyPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.091.78 ▲0.1642.64 ▲5.33
Dashboard /wp-admin2,206 ▲215.81 ▼0.09101.68 ▲0.4239.49 ▼2.71
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0439.90 ▲6.3635.70 ▼0.40
Add New Post /wp-admin/post-new.php1,534 ▲123.27 ▲0.04677.27 ▼6.0355.24 ▲6.51
Media Library /wp-admin/upload.php1,388 ▲34.19 ▼0.00107.76 ▲11.5847.14 ▲5.34

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bp-premiums/modules/group-access.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/bp-premiums/bp-premiums.php:351

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: groups, buddypress, social network, buddypress groups, buddypress money...

bp-premiums/bp-premiums.php Passed 13 tests

"BP Premiums for BuddyPress" version 1.2.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
118 characters long description:
BP Premiums is an addon for monetizing social networks. Charge users a premium for accessing features on your network.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected857 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP797623674
JavaScript141145174
XML1249

PHP code Passed 2 tests

Analyzing 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.46
Average class complexity14.83
▷ Minimum class complexity7.00
▷ Maximum class complexity26.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods47
▷ Static methods48.51%
▷ Public methods4697.87%
▷ Protected methods12.13%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin