73% mycred-learndash

Code Review | myCred - Learndash

WordPress plugin myCred - Learndash scored73%from 54 tests.

About plugin

  • Plugin page: mycred-learndash
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 6, 2020
  • Latest release: Nov 7, 2023
  • Number of updates: 50
  • Update frequency: every 28.1 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

400+ active /17,113 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.16MB] [CPU: ▲5.65ms] Passed 4 tests

A check of server-side resources used by myCred - Learndash
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.62 ▲1.1642.43 ▲1.61
Dashboard /wp-admin4.47 ▲1.1654.21 ▼0.92
Posts /wp-admin/edit.php4.52 ▲1.1660.73 ▲12.83
Add New Post /wp-admin/post-new.php7.08 ▲1.19109.49 ▲12.45
Media Library /wp-admin/upload.php4.39 ▲1.1644.90 ▲9.46
MyCred Settings /wp-admin/admin.php?page=learndash-mycred-settings4.2739.72

Server storage [IO: ▲0.46MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
recovery_mode_email_last_sent
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for myCred - Learndash
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲12913.49 ▼0.877.54 ▲5.5937.65 ▼5.53
Dashboard /wp-admin2,210 ▲335.79 ▲0.1597.38 ▼5.7540.44 ▼2.89
Posts /wp-admin/edit.php2,118 ▲152.09 ▲0.1241.87 ▲3.9634.35 ▲0.22
Add New Post /wp-admin/post-new.php1,545 ▲1923.38 ▲0.27673.00 ▼10.8656.47 ▲6.07
Media Library /wp-admin/upload.php1,415 ▲124.29 ▲0.0798.80 ▼1.0245.16 ▲1.97
MyCred Settings /wp-admin/admin.php?page=learndash-mycred-settings7461.6410.9229.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=learndash-mycred-settings
    • > Error in wp-content/plugins/mycred-learndash/inc/admin/settings/class-mycred-learndash-settings.php+191
    Uncaught Error: Call to undefined function mycred_get_types() in wp-content/plugins/mycred-learndash/inc/admin/settings/class-mycred-learndash-settings.php:191
    Stack trace:
    #0 wp-content/plugins/mycred-learndash/inc/admin/settings/class-mycred-learndash-settings.php(159): MyCred_LearnDash_Settings->exchange_rate_settings()
    #1 wp-includes/class-wp-hook.php(310): MyCred_LearnDash_Settings->mycred_settings_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/mycred-learndash/inc/mycred-learndash-lb-shortcode.php:129
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mycred-learndash/inc/class-mycred-learndash-leaderboard.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mycred-learndash/inc/class-mycred-buy-pts-handler.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mycred-learndash/inc/admin/settings/class-mycred-learndash-course-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mycred-learndash/inc/views/my_cred_overide.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mycred-learndash/inc/views/max_percentage.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mycred-learndash/inc/views/mycred_badges_override.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/mycred-learndash/mycred-learndash.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mycred-learndash/inc/views/min_percentage.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=learndash-mycred-settings
    • > Network (severe)
    wp-content/plugins/mycred-learndash/inc/admin/settings//assets/images/question.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in mycred-learndash/assets to your readme.txt
You can take inspiration from this readme.txt

mycred-learndash/mycred-learndash.php Passed 13 tests

The principal PHP file in "myCred - Learndash" v. 2.1.1 is loaded by WordPress automatically on each request
102 characters long description:
myCred Learndash is a plugin for WordPress that enabled you to build points based on Learndash plugin.

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 plugin7,498 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP222,1473535,900
JavaScript313315936
CSS386172662

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity71.25
▷ Minimum class complexity8.00
▷ Maximum class complexity228.00
Average method complexity7.77
▷ Minimum method complexity1.00
▷ Maximum method complexity60.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods166
▷ Static methods00.00%
▷ Public methods166100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
inc/assets/images/question.png0.68KB0.71KB0.00%