52% connect-badgeos-to-discord

Code Review | Connect BadgeOS to Discord

WordPress plugin Connect BadgeOS to Discord scored52%from 54 tests.

About plugin

  • Plugin page: connect-badgeos-t...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 13, 2022
  • Latest release: Sep 5, 2023
  • Number of updates: 10
  • Update frequency: every 26.6 days
  • Top authors: expresstechsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /550 total downloads


Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼2.02ms] Passed 4 tests

Server-side resources used by Connect BadgeOS to Discord
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3048.75 ▲7.89
Dashboard /wp-admin3.59 ▲0.2951.39 ▲6.52
Posts /wp-admin/edit.php3.70 ▲0.3448.08 ▼3.33
Add New Post /wp-admin/post-new.php6.21 ▲0.3288.55 ▼17.39
Media Library /wp-admin/upload.php3.51 ▲0.2839.73 ▲6.11
Discord Settings /wp-admin/admin.php?page=connect-badgeos-to-discord3.5845.50
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.6848.20

Server storage [IO: ▲0.88MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please fix the following
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/connect-badgeos-to-discord/" and "wp-content/uploads/"
    • (new file) wp-content/d457ac59-4def-48ba-950b-8774b9a53c8fbadgeos_discord_api_logs.txt
Filesystem: 134 new files
Database: 4 new tables, 28 new options
New tables
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Connect BadgeOS to Discord
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.15 ▼1.072.02 ▲0.2441.77 ▼6.20
Dashboard /wp-admin2,210 ▲614.85 ▼0.82100.26 ▲2.9339.54 ▼1.46
Posts /wp-admin/edit.php2,090 ▼22.02 ▼0.0236.69 ▼6.7433.48 ▼7.65
Add New Post /wp-admin/post-new.php1,537 ▲1723.38 ▲0.12686.40 ▲71.4959.94 ▲10.70
Media Library /wp-admin/upload.php1,392 ▲14.22 ▲0.04111.81 ▲13.2450.69 ▲7.17
Discord Settings /wp-admin/admin.php?page=connect-badgeos-to-discord1,8633.0078.0448.26
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2411.8324.0527.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/connect-badgeos-to-discord/uninstall.php+34
    Undefined index: plugin
  • Zombie tables detected upon uninstall: 4 tables
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
  • The uninstall procedure has failed, leaving 28 options in the database
    • ets_badgeos_discord_send_earned_achievement_dm
    • ets_badgeos_discord_uuid_file_name
    • action_scheduler_lock_async-request-runner
    • ets_badgeos_discord_loggedin_button_text
    • widget_recent-comments
    • can_compress_scripts
    • ets_badgeos_discord_send_welcome_dm
    • ets_badgeos_discord_retry_failed_api
    • widget_theysaidso_widget
    • ets_badgeos_discord_non_login_button_text
    • ...

Smoke tests 25% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/connect-badgeos-to-discord/public/partials/connect-badgeos-to-discord-public-display.php
  • 51× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/lib/cron-expression/CronExpression_YearField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/WP_CLI/Migration_Command.php:22
    • > 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/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Migration\\ActionMigrator' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/migration/DryRun_ActionMigrator.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/connect-badgeos-to-discord/includes/class-connect-badgeos-to-discord-logs.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schedule' not found in wp-content/plugins/connect-badgeos-to-discord/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=connect-badgeos-to-discord
    • > Console-api (severe) in unknown
    /wp-content/plugins/connect-badgeos-to-discord/admin/js/connect-badgeos-to-discord-admin.js?ver=1.0.3 114:12 Object


Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
You can take inspiration from this readme.txt

connect-badgeos-to-discord/connect-badgeos-to-discord.php Passed 13 tests

Analyzing the main PHP file in "Connect BadgeOS to Discord" version 1.0.3
91 characters long description:
Create a community of your users by connecting your BadgeOS Website to your Discord server.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin9,292 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code

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.33
Average class complexity12.40
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
▷ Abstract classes1517.86%
▷ Concrete classes6982.14%
▷ Final classes00.00%
▷ Static methods7010.90%
▷ Public methods48475.39%
▷ Protected methods13420.87%
▷ Private methods243.74%
▷ Named functions4384.31%
▷ Anonymous functions815.69%
▷ Global constants921.43%
▷ Class constants3378.57%
▷ Public constants33100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.11MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ets-logo.png11.34KB7.55KB▼ 33.46%
admin/images/icon.png99.19KB44.08KB▼ 55.56%