67% badgeos

Code Review | BadgeOS

WordPress plugin BadgeOS scored 67% from 54 tests.

About plugin

  • Plugin page: badgeos
  • Plugin version: 3.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.1
  • WordPress version: 5.9.2
  • First release: Apr 3, 2013
  • Latest release: Mar 2, 2022
  • Number of updates: 137
  • Update frequency: every 23.8 days
  • Top authors: learningtimes (48.91%)credly (43.07%)tw2113 (8.03%)sc0ttkclark (2.19%)

Code review

54 tests

User reviews

71 reviews

Install metrics

6,000+ active / 281,137 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▼271.83ms] 75% from 4 tests

An overview of server-side resources used by BadgeOS
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 2,248.25ms on /wp-admin/admin.php?page=badgeos_sub_add_ons)
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7385.28 ▲38.60
Dashboard /wp-admin4.33 ▲0.9258.20 ▲25.64
Posts /wp-admin/edit.php4.54 ▲0.9065.21 ▲29.76
Add New Post /wp-admin/post-new.php7.02 ▲0.0598.16 ▼1,159.99
Media Library /wp-admin/upload.php4.29 ▲0.9946.97 ▲17.28
Point Types /wp-admin/edit.php?post_type=point_type4.3461.43
Connection Types /wp-admin/tools.php?page=connection-types4.1945.39
OB Integration /wp-admin/admin.php?page=badgeos-ob-integration4.2649.45
Badges /wp-admin/edit.php?post_type=badges4.3549.43
Add-Ons /wp-admin/admin.php?page=badgeos_sub_add_ons4.382,248.25
Help / Support /wp-admin/admin.php?page=badgeos_sub_help_support4.2550.66
Tools /wp-admin/admin.php?page=badgeos_tools4.2848.38
Settings /wp-admin/admin.php?page=badgeos_settings4.3348.87
Rank Types /wp-admin/edit.php?post_type=rank_types4.3454.83
Log Entries /wp-admin/edit.php?post_type=badgeos-log-entry4.3552.05

Server storage [IO: ▲7.68MB] [DB: ▲0.06MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 660 new files
Database: 5 new tables, 9 new options
New tables
wp_badgeos_points
wp_p2p
wp_badgeos_achievements
wp_p2pmeta
wp_badgeos_ranks
New WordPress options
widget_earned_user_points_widget
widget_p2p
badgeos_admin_tools
badgeos_db_update_v_338
widget_earned_user_ranks_widget
widget_earned_user_achievements_widget
p2p_storage
badgeos_settings
badgeos_rec_title_updated

Browser metrics Passed 4 tests

A check of browser resources used by BadgeOS
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /6,442 ▲2,68816.87 ▲1.276.80 ▲0.512.62 ▲0.18
Dashboard /wp-admin5,506 ▲2,6457.05 ▲0.87129.12 ▼6.75186.30 ▲31.18
Posts /wp-admin/edit.php5,301 ▲2,6103.63 ▲0.3972.25 ▲10.78176.90 ▲33.60
Add New Post /wp-admin/post-new.php4,214 ▲2,45423.75 ▲6.81472.60 ▲35.43209.23 ▲49.59
Media Library /wp-admin/upload.php4,341 ▲2,6436.22 ▲0.73137.51 ▼3.67186.47 ▼2.61
Point Types /wp-admin/edit.php?post_type=point_type3,9423.3870.02125.34
Connection Types /wp-admin/tools.php?page=connection-types3,6583.2361.59124.19
OB Integration /wp-admin/admin.php?page=badgeos-ob-integration3,7993.3969.33129.39
Badges /wp-admin/edit.php?post_type=badges3,9853.6170.37123.36
Add-Ons /wp-admin/admin.php?page=badgeos_sub_add_ons4,0663.2666.20146.69
Help / Support /wp-admin/admin.php?page=badgeos_sub_help_support5,0963.2863.40180.37
Tools /wp-admin/admin.php?page=badgeos_tools4,1464.00100.55179.42
Settings /wp-admin/admin.php?page=badgeos_settings4,1744.3476.82193.71
Rank Types /wp-admin/edit.php?post_type=rank_types3,9423.4169.43126.69
Log Entries /wp-admin/edit.php?post_type=badgeos-log-entry4,0103.5470.93129.12

Uninstaller [IO: ▲0.03MB] [DB: ▲0.06MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_p2p
    • wp_p2pmeta
    • wp_badgeos_ranks
    • wp_badgeos_achievements
    • wp_badgeos_points
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_earned_user_points_widget
    • p2p_storage
    • badgeos_db_update_v_338
    • widget_earned_user_achievements_widget
    • badgeos_rec_title_updated
    • badgeos_admin_tools
    • widget_earned_user_ranks_widget
    • badgeos_settings
    • widget_p2p

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=connection-types
    • > User deprecated in wp-includes/functions.php+5326
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/tools.php?page=connection-types
    • > User deprecated in wp-includes/functions.php+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
Almost there! Just fix the following items
  • 130× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/badgeos/includes/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'P2P_Field_Title' not found in wp-content/plugins/badgeos/includes/p2p/p2p-admin/field-title-user.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/badgeos/includes/rules-engine.php:193
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos/includes/admin-settings.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'badgeos_utilities' not found in wp-content/plugins/badgeos/includes/email_headers/footer.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/badgeos/includes/cmb2/includes/types/CMB2_Type_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/badgeos/includes/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos/includes/open_badge/install-default-pages.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/badgeos/includes/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos/includes/cmb2/example-functions.php:105

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
  • Screenshots: Please add descriptions for these screenshots #12, #13, #14, #15 in badgeos/assets to your readme.txt
You can look at the official readme.txt

badgeos/badgeos.php 92% from 13 tests

The entry point to "BadgeOS" version 3.7.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 309 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected100,793 lines of code in 437 files:
LanguageFilesBlank linesComment linesLines of code
PO File12315,24520,17135,437
PHP1957,68913,24830,125
JavaScript483,2602,03514,146
CSS391,7711,50410,714
JSON5008,737
Markdown52280662
Sass7486386
CoffeeScript11276306
LESS1115152
HTML1170107
SVG11013
Ruby1208

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity15.93
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes147
▷ Abstract classes2013.61%
▷ Concrete classes12786.39%
▷ Final classes00.00%
Methods1,082
▷ Static methods19818.30%
▷ Public methods85378.84%
▷ Protected methods17616.27%
▷ Private methods534.90%
Functions543
▷ Named functions543100.00%
▷ Anonymous functions00.00%
Constants23
▷ Global constants626.09%
▷ Class constants1773.91%
▷ Public constants17100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
62 PNG files occupy 0.66MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/CMB2-Date-Range-Field/assets/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
includes/CMB2-Date-Range-Field/assets/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
includes/CMB2-Date-Range-Field/assets/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
assets/screenshot-3.png57.82KB19.96KB▼ 65.48%
images/arrows.png1.71KB0.91KB▼ 46.81%