84% bu-learning-blocks

Code Review | BU Learning Blocks

WordPress plugin BU Learning Blocks scored 84% from 54 tests.

About plugin

  • Plugin page: bu-learning-blocks
  • Plugin version: 1.1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-6.0
  • WordPress version: 6.3.1
  • First release: Apr 20, 2021
  • Latest release: Jul 19, 2022
  • Number of updates: 3
  • Update frequency: every 153.0 days
  • Top authors: bostonu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,217 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▲0.56ms] Passed 4 tests

This is a short check of server-side resources used by BU Learning Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4044.15 ▲4.91
Dashboard /wp-admin3.67 ▲0.3644.83 ▼0.56
Posts /wp-admin/edit.php3.78 ▲0.4347.53 ▲1.39
Add New Post /wp-admin/post-new.php6.28 ▲0.3994.29 ▼3.52
Media Library /wp-admin/upload.php3.59 ▲0.3639.26 ▲6.48

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 79 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_bu_pages
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
bulb_active

Browser metrics Passed 4 tests

A check of browser resources used by BU Learning Blocks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲13714.61 ▲0.1627.49 ▲25.8644.00 ▼1.86
Dashboard /wp-admin2,203 ▲125.79 ▲0.90105.60 ▲3.5138.05 ▼5.43
Posts /wp-admin/edit.php2,089 ▼31.98 ▼0.0238.71 ▼2.7334.56 ▼3.62
Add New Post /wp-admin/post-new.php1,516 ▼1723.41 ▼0.13673.36 ▲24.2538.93 ▼19.72
Media Library /wp-admin/upload.php1,388 ▼04.10 ▼0.3094.02 ▼18.6042.21 ▼5.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_bu_pages
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following
  • 19× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\avigation\\add_filter() in wp-content/plugins/bu-learning-blocks/inc/bu-navigation-core-widget/src/data-active-section.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\\LearningBlocks\\add_action() in wp-content/plugins/bu-learning-blocks/src/blocks/bulb-fitb/index.php:111
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/bu-learning-blocks/phpunit/bootstrap.php on line 25
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/bu-learning-blocks/phpunit/bootstrap.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\\LearningBlocks\\add_action() in wp-content/plugins/bu-learning-blocks/src/enqueue-assets.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\\LearningBlocks\\add_action() in wp-content/plugins/bu-learning-blocks/src/blocks/bulb-tf/index.php:126
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\\LearningBlocks\\add_action() in wp-content/plugins/bu-learning-blocks/src/blocks/bulb-cn/index.php:116
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\avigation\\add_filter() in wp-content/plugins/bu-learning-blocks/inc/bu-navigation-core-widget/src/filters.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\\LearningBlocks\\add_action() in wp-content/plugins/bu-learning-blocks/src/learning-module-cpt.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BU\\Plugins\\LearningBlocks\\add_action() in wp-content/plugins/bu-learning-blocks/src/blocks/bulb-mat/index.php:126

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

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: online courses, bu, education, learning, teaching...

bu-learning-blocks/bu-learning-blocks.php Passed 13 tests

The primary PHP file in "BU Learning Blocks" version 1.1.4 is used by WordPress to initiate all plugin functionality
136 characters long description:
BU Learning Blocks — is a collection of tools to enable the easy creation of academic lessons with embedded self-assessment questions.

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
Success! There were no dangerous files found in this plugin48,517 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
JSON40044,701
PHP284531,0552,042
JavaScript26108661,151
Markdown3780408
Sass3206101
YAML210060
XML25348
CSS2606

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods654.55%
▷ Protected methods545.45%
▷ Private methods00.00%
Functions65
▷ Named functions5889.23%
▷ Anonymous functions710.77%
Constants9
▷ Global constants9100.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
PNG images were not found in this plugin