66% learn-manager

Code Review | WP Learn Manager

WordPress plugin WP Learn Manager scored66%from 54 tests.

About plugin

  • Plugin page: learn-manager
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2019
  • Latest release: Nov 22, 2021
  • Number of updates: 56
  • Update frequency: every 18.8 days
  • Top authors: rabilal (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /6,364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.82MB] [CPU: ▲15.67ms] Passed 4 tests

Server-side resources used by WP Learn Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.62 ▲2.1662.60 ▲21.00
Dashboard /wp-admin5.32 ▲1.9875.21 ▲12.14
Posts /wp-admin/edit.php5.16 ▲1.8069.47 ▲17.03
Add New Post /wp-admin/post-new.php7.64 ▲1.76114.64 ▲12.49
Media Library /wp-admin/upload.php4.96 ▲1.7463.48 ▲26.46
Premium Addon /wp-admin/admin.php?page=jslm_paymentmethodconfiguration5.2250.62
Premium Addon /wp-admin/admin.php?page=jslm_awardsaction5.2248.48
Currencies /wp-admin/admin.php?page=jslm_currency5.4559.95
Premium Addon /wp-admin/admin.php?page=jslm_message4.7032.87
Premium Addon /wp-admin/admin.php?page=jslm_earning4.9139.22
User /wp-admin/admin.php?page=jslm_user5.6357.32
Help /wp-admin/admin.php?page=jslearnmanager&jslmslay=help5.2852.72
Learn Manager /wp-admin/admin.php?page=jslearnmanager5.5253.42
Configurations /wp-admin/admin.php?page=jslm_configuration6.3764.30
Courses /wp-admin/admin.php?page=jslm_course6.0568.59

Server storage [IO: ▲14.71MB] [DB: ▲0.09MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 947 new files
Database: 24 new tables, 10 new options
New tables
wp_js_learnmanager_country
wp_js_learnmanager_activitylog
wp_js_learnmanager_fieldsordering
wp_js_learnmanager_emailtemplates
wp_js_learnmanager_course_access_type
wp_js_learnmanager_instructor
wp_js_learnmanager_session
wp_js_learnmanager_slug
wp_js_learnmanager_wishlist
wp_js_learnmanager_user
...
New WordPress options
jslearnmanager_do_activation_redirect
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_widget_js_learn_manager_course_search_widget_options
_wpjslm_session_
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Learn Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,273 ▲52714.29 ▼0.097.64 ▲5.7440.94 ▼2.56
Dashboard /wp-admin2,579 ▲3915.73 ▼0.08120.85 ▲11.77101.08 ▲60.73
Posts /wp-admin/edit.php2,178 ▲922.52 ▲0.4937.18 ▲1.4336.60 ▲1.26
Add New Post /wp-admin/post-new.php1,741 ▲22721.98 ▲4.42773.21 ▲137.8728.98 ▼21.62
Media Library /wp-admin/upload.php1,463 ▲814.32 ▲0.15103.64 ▲6.1495.48 ▲52.92
Premium Addon /wp-admin/admin.php?page=jslm_paymentmethodconfiguration1,3572.1032.8484.16
Premium Addon /wp-admin/admin.php?page=jslm_awardsaction1,3542.0553.6931.84
Currencies /wp-admin/admin.php?page=jslm_currency1,7653.0252.7296.77
Premium Addon /wp-admin/admin.php?page=jslm_message450.440.089.71
Premium Addon /wp-admin/admin.php?page=jslm_earning7100.453.4416.51
User /wp-admin/admin.php?page=jslm_user1,5882.7644.6165.22
Help /wp-admin/admin.php?page=jslearnmanager&jslmslay=help1,9342.6345.9390.61
Learn Manager /wp-admin/admin.php?page=jslearnmanager2,4766.7774.09218.12
Configurations /wp-admin/admin.php?page=jslm_configuration3,2616.34135.31128.54
Courses /wp-admin/admin.php?page=jslm_course1,7262.6642.2679.00

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_widget_js_learn_manager_course_search_widget_options
    • recovery_mode_email_last_sent
    • jslearnmanager_do_activation_redirect
    • _wpjslm_session_
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=jslm_message
    • > Warning in wp-content/plugins/learn-manager/includes/includer.php+66
    include_once(wp-content/plugins/learn-manager/modules/message/model.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=jslm_message
    • > Warning in wp-content/plugins/learn-manager/includes/includer.php+66
    include_once(): Failed opening 'wp-content/plugins/learn-manager/modules/message/model.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=jslm_message
    • > Error in wp-content/plugins/learn-manager/includes/includer.php+68
    Uncaught Error: Class 'JSLEARNMANAGERmessageModel' not found in wp-content/plugins/learn-manager/includes/includer.php:68
    Stack trace:
    #0 wp-content/plugins/learn-manager/learn-manager.php(294): JSLEARNMANAGERincluder::getJSModel()
    #1 wp-includes/class-wp-hook.php(310): jslearnmanager->jslearnmanager_handle_search_form_data()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-settings.php(632): do_action()
    #5 wp-config.php(129): require_once('/var/www/wordpr...')
    #6 wp-load.php(50): require_once('/var/www/wordpr...')
    #7 wp-admin/admin.php(34): require_once('/var/www/wordpr...')
    #8 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=jslm_earning
    • > Error in wp-content/plugins/learn-manager/includes/includer.php+68
    Uncaught Error: Class 'JSLEARNMANAGERearningModel' not found in wp-content/plugins/learn-manager/includes/includer.php:68
    Stack trace:
    #0 wp-content/plugins/learn-manager/learn-manager.php(268): JSLEARNMANAGERincluder::getJSModel()
    #1 wp-includes/class-wp-hook.php(310): jslearnmanager->jslearnmanager_handle_search_form_data()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-settings.php(632): do_action()
    #5 wp-config.php(129): require_once('/var/www/wordpr...')
    #6 wp-load.php(50): require_once('/var/www/wordpr...')
    #7 wp-admin/admin.php(34): require_once('/var/www/wordpr...')
    #8 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=jslearnmanager
    • > Notice in wp-content/plugins/learn-manager/modules/jslearnmanager/tmpl/admin_controlpanel.php+54
    Undefined variable: data_array
    • > GET request to /wp-admin/admin.php?page=jslearnmanager
    • > Notice in wp-content/plugins/learn-manager/modules/jslearnmanager/tmpl/admin_controlpanel.php+54
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 166× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/learn-manager/modules/language/model.php
    • > /wp-content/plugins/learn-manager/includes/messages.php
    • > /wp-content/plugins/learn-manager/modules/emailtemplatestatus/controller.php
    • > /wp-content/plugins/learn-manager/modules/courselevel/controller.php
    • > /wp-content/plugins/learn-manager/includes/activation.php
    • > /wp-content/plugins/learn-manager/modules/instructor/tmpl/admin_instructordetail.php
    • > /wp-content/plugins/learn-manager/includes/tables/currency.php
    • > /wp-content/plugins/learn-manager/modules/common/controller.php
    • > /wp-content/plugins/learn-manager/includes/pagination.php
    • > /wp-content/plugins/learn-manager/includes/breadcrumbs.php
  • 48× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/learn-manager/modules/postinstallation/tmpl/admin_settingcomplete.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/learn-manager/modules/jslearnmanager/tmpl/admin_controlpanel.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JSLEARNMANAGERincluder' not found in wp-content/plugins/learn-manager/modules/premiumplugin/tmpl/admin_missingaddon.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JSLEARNMANAGERincluder' not found in wp-content/plugins/learn-manager/modules/user/tmpl/profileform.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'JSLEARNMANAGERbreadcrumbs' not found in wp-content/plugins/learn-manager/modules/user/tmpl/register.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/learn-manager/modules/user/tmpl/instructorregister.inc.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'jslearnmanager' not found in wp-content/plugins/learn-manager/modules/student/tmpl/studentcourselist.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'JSLEARNMANAGERbreadcrumbs' not found in wp-content/plugins/learn-manager/modules/user/tmpl/myprofile.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_names() on null in wp-content/plugins/learn-manager/modules/postinstallation/tmpl/admin_steptwo.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/learn-manager/modules/premiumplugin/tmpl/admin_step1.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=jslm_paymentmethodconfiguration
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=jslm_paymentmethodconfiguration:397:32)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=jslm_awardsaction
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).accordion is not a function
    • > GET request to /wp-admin/admin.php?page=jslm_awardsaction
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).accordion is not a function" "TypeError: jQuery(...).accordion is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=jslm_awardsaction:397:32)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=jslm_message
    • > Network (severe)
    wp-admin/admin.php?page=jslm_message - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=jslm_earning
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=jslm_earning 220:4 Uncaught ReferenceError: jQuery is not defined
    • > GET request to /wp-admin/admin.php?page=jslm_earning
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=jslm_earning 249:4 Uncaught ReferenceError: jQuery is not defined
    • > GET request to /wp-admin/admin.php?page=jslm_earning
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=jslm_earning 334:4 Uncaught ReferenceError: jQuery is not defined
    • > GET request to /wp-admin/admin.php?page=jslearnmanager
    • > Javascript (severe) in unknown
    http://www.google.com/jsapi?autoload=%7B%27modules%27%3A%5B%7B%27name%27%3A%27visualization%27%2C%27version%27%3A%271%27%2C%27packages%27%3A%5B%27corechart%27%5D%7D%5D%7D&ver=6.3.1 150:139 Uncaught Error: Autoload failed with: SyntaxError: Expected proper…me or '}' in JSON at position 1 (line 1 column 2)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

learn-manager/learn-manager.php Passed 13 tests

This is the main PHP file of "WP Learn Manager" version 1.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
75 characters long description:
Learn Manager is Word Press most comprehensive and easist show room plugin.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected78,904 lines of code in 258 files:
LanguageFilesBlank linesComment linesLines of code
PHP2164,1799,59348,505
CSS132,65343822,213
SVG3102,972
JavaScript54435212,715
PO File19902,1222,041
JSON100398
SQL179058
HTML2002

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 574)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity60.37
▷ Minimum class complexity1.00
▷ Maximum class complexity823.00
Average method complexity7.70
▷ Minimum method complexity1.00
▷ Maximum method complexity574.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes107
▷ Abstract classes00.00%
▷ Concrete classes107100.00%
▷ Final classes00.00%
Methods949
▷ Static methods727.59%
▷ Public methods93398.31%
▷ Protected methods10.11%
▷ Private methods151.58%
Functions78
▷ Named functions78100.00%
▷ Anonymous functions00.00%
Constants68
▷ Global constants68100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
445 PNG files occupy 3.73MB with 1.89MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/cp/new-icons/addons/earnings.png1.73KB0.98KB▼ 43.08%
includes/images/instuctor.png8.83KB4.48KB▼ 49.30%
includes/images/left-icons/arrow2.png2.92KB0.29KB▼ 90.03%
includes/images/cp/documentation.png4.53KB2.29KB▼ 49.41%
includes/images/about-us/7.png0.10KB0.08KB▼ 21.50%