10% badgearoo

Code Review | Badgearoo

WordPress plugin Badgearoo scored 10% from 54 tests.

About plugin

  • Plugin page: badgearoo
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 5.8.1
  • First release: Sep 18, 2015
  • Latest release: Feb 28, 2017
  • Number of updates: 42
  • Update frequency: every 12.8 days
  • Top authors: dpowney (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

60+ active / 5,011 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/badgearoo/includes/actions.php+88
    Undefined index: broo_show_user_assignment_modal

Server metrics [RAM: ▲1.21MB] [CPU: ▼132.40ms] Passed 4 tests

An overview of server-side resources used by Badgearoo
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.9343.08 ▲5.62
Dashboard /wp-admin4.39 ▲1.3359.86 ▲18.49
Posts /wp-admin/edit.php4.50 ▲1.4058.91 ▲11.88
Add New Post /wp-admin/post-new.php6.71 ▲1.2895.60 ▼552.81
Media Library /wp-admin/upload.php4.31 ▲1.3138.18 ▲5.70
Settings /wp-admin/edit.php?post_type=badge&page=broo_settings4.3142.56
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=badge4.3349.95
About /wp-admin/edit.php?post_type=badge&page=broo_about4.3147.30
Assignments /wp-admin/edit.php?post_type=badge&page=broo_assignments4.3346.53
Badges /wp-admin/edit.php?post_type=badge4.3945.88
Add New /wp-admin/post-new.php?post_type=badge4.4360.87
Conditions /wp-admin/edit.php?post_type=badge&page=broo_conditions4.3651.93
Tools /wp-admin/edit.php?post_type=badge&page=broo_tools4.3244.49
/wp-admin/index.php?page=broo_about4.3142.00

Server storage [IO: ▲1.15MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 73 new files
Database: 7 new tables, 7 new options
New tables
wp_broo_user_assignment
wp_broo_condition
wp_broo_condition_step
wp_broo_user_action_meta
wp_broo_condition_step_meta
wp_broo_action
wp_broo_user_action
New WordPress options
category_children
broo_actions_enabled
broo_bp_settings
widget_broo_recent_assignments
broo_email_settings
broo_general_settings
widget_broo_user_badges

Browser metrics Passed 4 tests

Badgearoo: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,119 ▲52318.54 ▲3.0411.52 ▲3.1449.70 ▼0.85
Dashboard /wp-admin3,262 ▲3287.54 ▲1.57175.92 ▲32.80111.79 ▲0.81
Posts /wp-admin/edit.php3,084 ▲3454.05 ▲1.3591.52 ▲27.0391.31 ▼0.45
Add New Post /wp-admin/post-new.php1,746 ▲24619.01 ▲0.59373.98 ▲19.73105.65 ▼5.51
Media Library /wp-admin/upload.php1,930 ▲1235.05 ▲0.01117.70 ▼38.89117.70 ▼1.49
Settings /wp-admin/edit.php?post_type=badge&page=broo_settings1,5334.0583.5970.70
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=badge2,2704.4488.5488.82
About /wp-admin/edit.php?post_type=badge&page=broo_about1,8274.0588.14135.35
Assignments /wp-admin/edit.php?post_type=badge&page=broo_assignments1,7374.4379.2383.13
Badges /wp-admin/edit.php?post_type=badge1,7954.4489.1379.77
Add New /wp-admin/post-new.php?post_type=badge3,7159.21239.03157.61
Conditions /wp-admin/edit.php?post_type=badge&page=broo_conditions1,9524.2992.1076.93
Tools /wp-admin/edit.php?post_type=badge&page=broo_tools1,5724.1984.3276.39
/wp-admin/index.php?page=broo_about1,8244.0584.95115.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall successfully, leaving 7 tables in the database
    • wp_broo_condition_step
    • wp_broo_user_action
    • wp_broo_condition_step_meta
    • wp_broo_user_assignment
    • wp_broo_action
    • wp_broo_condition
    • wp_broo_user_action_meta
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • broo_general_settings
    • widget_broo_recent_assignments
    • broo_actions_enabled
    • category_children
    • broo_bp_settings
    • broo_email_settings
    • widget_broo_user_badges

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
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/badgearoo/includes/admin/class-assignments-table.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/badgearoo/includes/admin/class-assignments-table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/badgearoo/includes/admin/class-assignments-table.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
You can look at the official readme.txt

badgearoo/badgearoo.php 77% from 13 tests

"Badgearoo" version 1.0.14's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 147 characters long)
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin6,818 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP481,8131,5816,039
JavaScript3177104505
CSS2415264
XML10010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity27.50
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity4.97
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods102
▷ Static methods65.88%
▷ Public methods102100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions142
▷ Named functions142100.00%
▷ Anonymous functions00.00%
Constants39
▷ Global constants3897.44%
▷ Class constants12.56%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.77MB with 0.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-9.PNG115.89KB35.93KB▼ 68.99%
assets/screenshot-5.png71.89KB25.82KB▼ 64.08%
assets/img/about-theme-icon.PNG5.70KB3.17KB▼ 44.30%
assets/screenshot-7.png63.76KB30.96KB▼ 51.44%
assets/img/about-theme-light.PNG2.46KB1.59KB▼ 35.38%