57% connect-lifterlms-to-discord

Code Review | Connect LifterLMS to Discord

WordPress plugin Connect LifterLMS to Discord scored57%from 54 tests.

About plugin

  • Plugin page: connect-lifterlms...
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Nov 15, 2022
  • Latest release: Nov 23, 2023
  • Number of updates: 17
  • Update frequency: every 21.9 days
  • Top authors: expresstechsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /815 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▲2.55ms] Passed 4 tests

A check of server-side resources used by Connect LifterLMS to Discord
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3242.38 ▼0.61
Dashboard /wp-admin3.63 ▲0.3253.11 ▲3.57
Posts /wp-admin/edit.php3.74 ▲0.3854.90 ▲9.36
Add New Post /wp-admin/post-new.php6.23 ▲0.3499.33 ▲3.15
Media Library /wp-admin/upload.php3.55 ▲0.3238.23 ▲4.08
Discord Settings /wp-admin/admin.php?page=connect-lifterlms-discord3.65287.12
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.7148.72

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

A short overview of filesystem and database impact
Please try to fix the following items
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/connect-lifterlms-to-discord/" and "wp-content/uploads/"
    • (new file) wp-content/02f91e2c-6f1d-41c1-9ced-1194e20bb927lifterlms_discord_api_logs.txt
Filesystem: 133 new files
Database: 4 new tables, 31 new options
New tables
wp_actionscheduler_actions
wp_actionscheduler_groups
wp_actionscheduler_claims
wp_actionscheduler_logs
New WordPress options
ets_lifterlms_discord_loggedin_button_text
ets_lifterlms_discord_job_queue_batch_size
can_compress_scripts
ets_lifterlms_discord_uuid_file_name
ets_lifterlms_discord_number_of_courses
ets_lifterlms_discord_connect_button_bg_color
action_scheduler_hybrid_store_demarkation
ets_lifterlms_discord_send_certificate_earned_dm
ets_lifterlms_discord_retry_api_count
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Connect LifterLMS to Discord
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲714.67 ▲0.341.60 ▼0.5735.75 ▼8.51
Dashboard /wp-admin2,202 ▲285.58 ▲0.0091.86 ▼8.0542.58 ▼4.85
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0339.45 ▼2.0737.88 ▲0.78
Add New Post /wp-admin/post-new.php1,529 ▼423.23 ▲0.18611.43 ▼21.0255.83 ▼1.70
Media Library /wp-admin/upload.php1,407 ▲44.31 ▲0.05103.95 ▲6.1242.92 ▲1.54
Discord Settings /wp-admin/admin.php?page=connect-lifterlms-discord2,1332.9670.2358.39
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2101.7927.6827.65

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
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/connect-lifterlms-to-discord/uninstall.php+33
    Undefined index: plugin
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_actionscheduler_claims
    • wp_actionscheduler_groups
    • wp_actionscheduler_actions
    • wp_actionscheduler_logs
  • This plugin does not fully uninstall, leaving 31 options in the database
    • ets_lifterlms_discord_certificate_earned_message
    • ets_lifterlms_discord_retry_api_count
    • ets_lifterlms_discord_loggedin_button_text
    • ets_lifterlms_discord_connect_button_bg_color
    • ets_lifterlms_discord_quiz_complete_message
    • db_upgraded
    • ets_lifterlms_discord_job_queue_batch_size
    • ets_lifterlms_discord_send_lesson_complete_dm
    • action_scheduler_lock_async-request-runner
    • ets_lifterlms_discord_send_achievement_earned_dm
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/connect-lifterlms-to-discord/public/partials/lifterlms-discord-addon-public-display.php
  • 52× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/connect-lifterlms-to-discord/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/connect-lifterlms-to-discord/admin/partials/pages/lifterlms-discord-get-support.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/connect-lifterlms-to-discord/admin/partials/pages/lifterlms-discord-documentation.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/connect-lifterlms-to-discord/includes/libraries/action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Exception' not found in wp-content/plugins/connect-lifterlms-to-discord/includes/libraries/action-scheduler/classes/ActionScheduler_InvalidActionException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/connect-lifterlms-to-discord/includes/libraries/action-scheduler/lib/cron-expression/CronExpression_MonthField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/connect-lifterlms-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-lifterlms-to-discord/includes/libraries/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Schedule' not found in wp-content/plugins/connect-lifterlms-to-discord/includes/libraries/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/connect-lifterlms-to-discord/includes/libraries/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
10 plugin tags: discord, lifterlms, discord role management, memberships, talk...

connect-lifterlms-to-discord/lifterlms-discord-addon.php 77% from 13 tests

The entry point to "Connect LifterLMS to Discord" version 1.0.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("connect-lifterlms-to-discord.php" instead of "lifterlms-discord-addon.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 162 characters long)

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
Success! There were no dangerous files found in this plugin9,836 lines of code in 119 files:
LanguageFilesBlank linesComment linesLines of code
PHP1042,0305,4648,667
CSS61013631
JavaScript66219438
Markdown237090
SVG10010

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.40
▷ Minimum class complexity1.00
▷ Maximum class complexity227.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes84
▷ Abstract classes1517.86%
▷ Concrete classes6982.14%
▷ Final classes00.00%
Methods648
▷ Static methods7010.80%
▷ Public methods49175.77%
▷ Protected methods13220.37%
▷ Private methods253.86%
Functions56
▷ Named functions4987.50%
▷ Anonymous functions712.50%
Constants41
▷ Global constants921.95%
▷ Class constants3278.05%
▷ Public constants32100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.31MB with 0.16MB 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.png30.09KB11.09KB▼ 63.15%
admin/images/ravisoni.png278.09KB110.22KB▼ 60.36%