46% connect-learndash-and-discord

Code Review | Connect LearnDash to Discord

WordPress plugin Connect LearnDash to Discord scored46%from 54 tests.

About plugin

  • Plugin page: connect-learndash...
  • Plugin version: 1.0.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Jun 30, 2022
  • Latest release: Sep 8, 2023
  • Number of updates: 27
  • Update frequency: every 16.2 days
  • Top authors: expresstechsoftware (77.78%)webbdeveloper (25.93%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /1,364 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.74MB] [CPU: ▼18.92ms] Passed 4 tests

Server-side resources used by Connect LearnDash to Discord
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.13 ▲1.6656.14 ▲16.57
Dashboard /wp-admin4.69 ▲1.3845.79 ▼6.76
Posts /wp-admin/edit.php4.69 ▲1.3343.03 ▼12.30
Add New Post /wp-admin/post-new.php4.69 ▼1.2041.21 ▼67.96
Media Library /wp-admin/upload.php4.69 ▲1.4649.30 ▲11.36
Scheduled Actions /wp-admin/tools.php?page=action-scheduler4.6941.56
Discord Settings /wp-admin/admin.php?page=connect-learndash-discord-addon4.6937.12

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

A short overview of filesystem and database impact
These are issues you should consider
  • Illegal file modification detected: 1 file (0.00KB) outside of "wp-content/plugins/connect-learndash-and-discord/" and "wp-content/uploads/"
    • (new file) wp-content/d8719905-f5bc-4723-ab96-04d39e72a8a4learndash_discord_api_logs.txt
Filesystem: 136 new files
Database: 4 new tables, 31 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_groups
wp_actionscheduler_actions
wp_actionscheduler_claims
New WordPress options
ets_learndash_discord_retry_failed_api
ets_learndash_discord_assignment_approved_message
ets_learndash_discord_non_login_button_text
ets_learndash_discord_loggedin_button_text
ets_learndash_discord_course_complete_message
ets_learndash_discord_connect_button_bg_color
ets_learndash_discord_job_queue_concurrency
action_scheduler_lock_async-request-runner
ets_learndash_discord_retry_api_count
action_scheduler_hybrid_store_demarkation
...

Browser metrics Passed 4 tests

An overview of browser requirements for Connect LearnDash to Discord
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.34 ▼0.281.86 ▲0.1944.56 ▲5.70
Dashboard /wp-admin2,207 ▲335.63 ▲0.0790.78 ▼1.7646.02 ▲5.49
Posts /wp-admin/edit.php2,115 ▲122.02 ▲0.0740.36 ▼4.8141.04 ▲2.97
Add New Post /wp-admin/post-new.php1,545 ▲1923.24 ▲0.11639.92 ▲27.6647.89 ▼15.58
Media Library /wp-admin/upload.php1,415 ▲154.25 ▲0.06113.42 ▲9.1748.47 ▲1.65
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2451.8226.8129.49
Discord Settings /wp-admin/admin.php?page=connect-learndash-discord-addon1,8222.6749.7548.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-includes/functions.php+6691
    file_get_contents(wp-content/plugins/sfwd-lms/sfwd_lms.php): failed to open stream: No such file or directory
  • Zombie tables detected upon uninstall: 4 tables
    • wp_actionscheduler_claims
    • wp_actionscheduler_actions
    • wp_actionscheduler_groups
    • wp_actionscheduler_logs
  • This plugin does not fully uninstall, leaving 31 options in the database
    • ets_learndash_discord_send_welcome_dm
    • schema-ActionScheduler_StoreSchema
    • ets_learndash_discord_assignment_approved_message
    • ets_learndash_discord_welcome_message
    • ets_learndash_discord_quiz_complete_message
    • widget_recent-posts
    • ets_learndash_discord_retry_failed_api
    • ets_learndash_discord_course_complete_message
    • ets_learndash_discord_job_queue_concurrency
    • ets_learndash_discord_disconnect_button_bg_color
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=connect-learndash-discord-addon
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-includes/functions.php+6691
    file_get_contents(wp-content/plugins/sfwd-lms/sfwd_lms.php): failed to open stream: No such file or directory

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/connect-learndash-and-discord/public/partials/learndash-discord-public-display.php
  • 51× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schedule' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Exception' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/ActionScheduler_InvalidActionException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/schema/ActionScheduler_LoggerSchema.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/connect-learndash-and-discord/admin/partials/pages/learndash_discord_advanced.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_DBStore' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php:10
    • > 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-learndash-and-discord/includes/libraries/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_FinishedAction' not found in wp-content/plugins/connect-learndash-and-discord/includes/libraries/action-scheduler/classes/actions/ActionScheduler_CanceledAction.php:9

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/admin.php?page=connect-learndash-discord-addon
    • > Javascript (severe) in unknown
    /wp-content/plugins/connect-learndash-and-discord/admin/js/learndash-discord-admin.js?ver=1.0.11 360:54 Uncaught TypeError: $(...).wpColorPicker is not a function
    • > GET request to /wp-admin/admin.php?page=connect-learndash-discord-addon
    • > Console-api (severe) in unknown
    /wp-content/plugins/connect-learndash-and-discord/admin/js/learndash-discord-admin.js?ver=1.0.11 114:12 Object

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: friends, hang out, memberships, lms, discord...

connect-learndash-and-discord/learndash-discord.php 92% from 13 tests

The main file in "Connect LearnDash to Discord" v. 1.0.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("connect-learndash-and-discord.php" instead of "learndash-discord.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin10,219 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
PHP1052,0555,7909,015
CSS61120624
JavaScript63717407
Markdown3560163
SVG10010

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.33
Average class complexity13.30
▷ Minimum class complexity1.00
▷ Maximum class complexity180.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes85
▷ Abstract classes1517.65%
▷ Concrete classes7082.35%
▷ Final classes00.00%
Methods663
▷ Static methods7110.71%
▷ Public methods50476.02%
▷ Protected methods13520.36%
▷ Private methods243.62%
Functions57
▷ Named functions4985.96%
▷ Anonymous functions814.04%
Constants43
▷ Global constants920.93%
▷ Class constants3479.07%
▷ Public constants34100.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
3 PNG files occupy 0.30MB with 0.14MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ets-logo.png11.34KB7.55KB▼ 33.46%
admin/images/icon.png16.17KB7.91KB▼ 51.10%
admin/images/ravisoni.png278.09KB110.22KB▼ 60.36%