68% quizzes-for-buddypress

Code Review | Quizzes for BuddyPress

WordPress plugin Quizzes for BuddyPress scored 68% from 54 tests.

About plugin

  • Plugin page: quizzes-for-buddy...
  • Plugin version: 0.7.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.6
  • WordPress version: 6.3.1
  • First release: Nov 2, 2017
  • Latest release: Mar 2, 2021
  • Number of updates: 9
  • Update frequency: every 135.1 days
  • Top authors: prasunsen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,135 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.69ms] Passed 4 tests

A check of server-side resources used by Quizzes for BuddyPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0836.82 ▼7.00
Dashboard /wp-admin3.39 ▲0.0946.88 ▼1.56
Posts /wp-admin/edit.php3.50 ▲0.1544.14 ▼1.60
Add New Post /wp-admin/post-new.php5.97 ▲0.0984.15 ▼12.58
Media Library /wp-admin/upload.php3.31 ▲0.0935.45 ▲4.84
Settings /wp-admin/admin.php?page=qbuddy3.2832.80
Rules /wp-admin/admin.php?page=qbuddy_rules3.2530.28

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 17 new files
Database: 1 new table, 8 new options
New tables
wp_qbuddy_rules
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
recovery_mode_email_last_sent
theysaidso_admin_options
can_compress_scripts
qbuddy_version

Browser metrics Passed 4 tests

An overview of browser requirements for Quizzes for BuddyPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲17113.67 ▼0.974.81 ▲2.5941.26 ▼5.80
Dashboard /wp-admin2,236 ▲484.85 ▼1.0597.37 ▼17.6539.52 ▼9.22
Posts /wp-admin/edit.php2,116 ▲272.01 ▼0.1633.25 ▼12.4831.31 ▼28.92
Add New Post /wp-admin/post-new.php1,556 ▲4223.36 ▲5.82715.58 ▲124.3255.97 ▲1.25
Media Library /wp-admin/upload.php1,409 ▲214.21 ▲0.0096.17 ▲1.1543.45 ▲0.55
Settings /wp-admin/admin.php?page=qbuddy8472.0526.3329.13
Rules /wp-admin/admin.php?page=qbuddy_rules7091.536.8521.14

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 failed, leaving 1 table in the database
    • wp_qbuddy_rules
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • qbuddy_version
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=qbuddy_rules
    • > Notice in wp-content/plugins/quizzes-for-buddypress/controllers/rules.php+68
    Undefined variable: name_field
    • > GET request to /wp-admin/admin.php?page=qbuddy_rules
    • > Notice in wp-content/plugins/quizzes-for-buddypress/controllers/rules.php+68
    Undefined variable: id_field
    • > GET request to /wp-admin/admin.php?page=qbuddy_rules
    • > Notice in wp-content/plugins/quizzes-for-buddypress/controllers/rules.php+68
    Undefined variable: table
    • > GET request to /wp-admin/admin.php?page=qbuddy_rules
    • > Error in wp-content/plugins/quizzes-for-buddypress/controllers/rules.php+71
    Uncaught Error: Call to undefined function bp_is_active() in wp-content/plugins/quizzes-for-buddypress/controllers/rules.php:71
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): QBuddyRules::manage()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/quizzes-for-buddypress/views/manage-rules.html.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/quizzes-for-buddypress/quizzes-for-buddypress.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/quizzes-for-buddypress/views/main.html.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: buddypress, watu, chained quiz, quiz, test...

quizzes-for-buddypress/quizzes-for-buddypress.php 92% from 13 tests

"Quizzes for BuddyPress" version 0.7.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 279 characters long)

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
Success! There were no dangerous files found in this plugin457 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP910049457

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity17.00
▷ Minimum class complexity9.00
▷ Maximum class complexity26.00
Average method complexity6.33
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods12
▷ Static methods12100.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin