10% buddypress-courseware

Code Review | BuddyPress Courseware

WordPress plugin BuddyPress Courseware scored10%from 54 tests.

About plugin

  • Plugin page: buddypress-course...
  • Plugin version: 0.9.7
  • PHP version: 7.4.16
  • WordPress compatibility: WordPress 3.2, BuddyPress 1.5+
  • WordPress version: 6.3.1
  • First release: Aug 25, 2010
  • Latest release: Oct 9, 2012
  • Number of updates: 108
  • Update frequency: every 8.0 days
  • Top authors: sushkov (99.07%)johnjamesjacoby (1.85%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /42,459 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/buddypress-courseware/notifications/notifications.class.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; BPSP_Notifications has a deprecated constructor

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.61ms] Passed 4 tests

Analyzing server-side resources used by BuddyPress Courseware
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.21 ▲1.17
Dashboard /wp-admin3.31 ▲0.0048.04 ▲0.91
Posts /wp-admin/edit.php3.36 ▲0.0048.93 ▲4.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.04 ▼0.35
Media Library /wp-admin/upload.php3.23 ▲0.0033.39 ▲0.72

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 121 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by BuddyPress Courseware
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.134.72 ▲3.0445.01 ▲0.64
Dashboard /wp-admin2,203 ▲144.87 ▼0.0797.73 ▼8.4240.17 ▼6.72
Posts /wp-admin/edit.php2,086 ▼32.04 ▲0.0236.80 ▼0.1937.54 ▲5.05
Add New Post /wp-admin/post-new.php1,542 ▲2817.98 ▲0.46644.92 ▼45.0650.36 ▼0.52
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0299.06 ▲3.8040.69 ▼4.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/buddypress-courseware/groups/templates/list_schedules.php
    • > /wp-content/plugins/buddypress-courseware/groups/templates/_bibs.php
    • > /wp-content/plugins/buddypress-courseware/groups/templates/_nav.php
  • 38× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: lecture_edit_uri in wp-content/plugins/buddypress-courseware/groups/templates/edit_lecture.php on line 1
    • > PHP Notice
      Undefined variable: bibs in wp-content/plugins/buddypress-courseware/groups/templates/_bibs.php on line 60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function setup_postdata() in wp-content/plugins/buddypress-courseware/groups/templates/single_assignment.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function setup_postdata() in wp-content/plugins/buddypress-courseware/groups/templates/single_lecture.php:1
    • > PHP Notice
      Undefined variable: bibs_form_uri in wp-content/plugins/buddypress-courseware/groups/templates/edit_bibliography.php on line 2
    • > PHP Notice
      Undefined variable: course in wp-content/plugins/buddypress-courseware/groups/templates/edit_course.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/buddypress-courseware/groups/templates/new_schedule.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/buddypress-courseware/wordpress/templates/admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/buddypress-courseware/groups/templates/new_lecture.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/buddypress-courseware/groups/templates/_no_course_group_header.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 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
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Requires at least: Invalid plugin version format
  • Tested up to: Invalid plugin version format
You can look at the official readme.txt

buddypress-courseware/courseware.php 85% from 13 tests

The main file in "BuddyPress Courseware" v. 0.9.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Requires at least: Required version number formatted incorrectly (ex. "7.0" instead of "WordPress 3.2, BuddyPress 1.5")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("buddypress-courseware.php" instead of "courseware.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected21,584 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
PHP529134,06512,286
JavaScript243134714,073
PO File41,7363,1403,718
CSS83001471,507

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,580)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 145)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity119.12
▷ Minimum class complexity1.00
▷ Maximum class complexity1,580.00
Average method complexity8.45
▷ Minimum method complexity1.00
▷ Maximum method complexity145.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods412
▷ Static methods00.00%
▷ Public methods412100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/css/jquery-ui-custom/theme/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
static/images/blank_book.png2.54KB1.83KB▼ 27.90%
static/css/jquery-ui-custom/theme/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
static/images/calendar_link.png0.78KB0.83KB0.00%
static/css/jquery-ui-custom/theme/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%