83% buddybadges

Code Review | buddybadges

WordPress plugin buddybadges scored 83% from 54 tests.

About plugin

  • Plugin page: buddybadges
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.0-4.4.2
  • WordPress version: 5.9.2
  • First release: Mar 28, 2016
  • Latest release: Mar 28, 2016
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: techspawn1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 703 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼307.82ms] Passed 4 tests

An overview of server-side resources used by buddybadges
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0156.92 ▼6.05
Dashboard /wp-admin3.42 ▲0.0238.29 ▲1.29
Posts /wp-admin/edit.php3.65 ▲0.0136.97 ▼6.03
Add New Post /wp-admin/post-new.php6.89 ▼0.0898.20 ▼1,220.47
Media Library /wp-admin/upload.php3.30 ▲0.0130.57 ▲6.18
buddybadge /wp-admin/options-general.php?page=buddybadge3.4824.40

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 3 new files
Database: 1 new table, 1 new option
New tables
wp_buddybadge
New WordPress options
bbadges_db_version

Browser metrics Passed 4 tests

buddybadges: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,812 ▲7015.71 ▼0.306.19 ▲0.392.62 ▲0.49
Dashboard /wp-admin2,903 ▲466.10 ▼0.07125.49 ▼5.68121.44 ▼40.63
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0066.92 ▲3.64132.67 ▼11.15
Add New Post /wp-admin/post-new.php1,670 ▲918.16 ▼4.50412.11 ▼28.27158.18 ▼9.38
Media Library /wp-admin/upload.php1,704 ▲35.57 ▲0.06159.77 ▲21.36223.07 ▼10.84
buddybadge /wp-admin/options-general.php?page=buddybadge1,4532.6962.16110.05

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+20
    Undefined index: edit
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+34
    Undefined index: successmeg
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+37
    Undefined index: _wpsuccessedit
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+40
    Undefined index: _wpdelete
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+464
    Undefined index: j_add_form
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+524
    Undefined index: j_edit_form
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Notice in wp-content/plugins/buddybadges/buddybadge.php+572
    Undefined index: _wpnonce

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 take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_verify_nonce() in wp-content/plugins/buddybadges/buddybadge.php:34
    • > PHP Notice
      Undefined index: edit in wp-content/plugins/buddybadges/buddybadge.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/buddybadges/buddybadgefunction.php:36

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=buddybadge
    • > Javascript (severe) in unknown
    https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js?ver=5.9.2 5:215 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

Optimizations

Plugin configuration 96% from 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: badge, achievement, reward, award, badges...

buddybadges/buddybadgefunction.php 92% from 13 tests

"buddybadges" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("buddybadges.php" instead of "buddybadgefunction.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin698 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP237165698

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin