10% talentlms

Code Review | TalentLMS WordPress plugin

WordPress plugin TalentLMS WordPress plugin scored10%from 54 tests.

About plugin

  • Plugin page: talentlms
  • Plugin version: 7.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2012
  • Latest release: Apr 28, 2023
  • Number of updates: 154
  • Update frequency: every 24.6 days
  • Top authors: V. (79.22%)panagop (11.04%)simosnomikos (10.39%)m13raptis (1.3%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /14,670 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▼0.88MB] [CPU: ▼47.18ms] Passed 4 tests

A check of server-side resources used by TalentLMS WordPress plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.12 ▼0.3411.11 ▼27.49
Dashboard /wp-admin3.14 ▼0.2113.36 ▼47.78
Posts /wp-admin/edit.php3.14 ▼0.2216.74 ▼33.66
Add New Post /wp-admin/post-new.php3.14 ▼2.7513.40 ▼79.80
Media Library /wp-admin/upload.php3.14 ▼0.0914.86 ▼26.51
CSS /wp-admin/admin.php?page=talentlms-css3.1415.05
Integrations /wp-admin/admin.php?page=talentlms-integrations3.1413.21
Setup /wp-admin/admin.php?page=talentlms-setup3.1413.73
Dashboard /wp-admin/admin.php?page=talentlms3.1413.54

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

Filesystem and database footprint
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 39.63MB)
Filesystem: 3,154 new files
Database: 4 new tables, 14 new options
New tables
wp_talentlms_categories
wp_talentlms_products
wp_talentlms_products_categories
wp_talentlms_courses
New WordPress options
widget_recent-posts
tlms-enroll-user-to-courses
widget_theysaidso_widget
tlms-woocommerce-active
widget_tlms_widget
tlms-apikey
tlms_courses_page_title
tlms-domain
theysaidso_admin_options
db_upgraded
...

Browser metrics Passed 4 tests

TalentLMS WordPress plugin: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,986 ▲24017.06 ▲2.7432.92 ▲31.1140.70 ▼2.91
Dashboard /wp-admin2,256 ▲688.79 ▲3.00127.01 ▲12.9639.76 ▼4.30
Posts /wp-admin/edit.php2,108 ▲195.16 ▲3.1075.94 ▲39.1233.75 ▼0.63
Add New Post /wp-admin/post-new.php1,564 ▲5025.17 ▲7.80681.74 ▲4.2633.77 ▼19.32
Media Library /wp-admin/upload.php1,447 ▲567.11 ▲2.92127.32 ▲31.6244.73 ▼0.03
CSS /wp-admin/admin.php?page=talentlms-css8464.9959.0837.54
Integrations /wp-admin/admin.php?page=talentlms-integrations9054.7560.3925.71
Setup /wp-admin/admin.php?page=talentlms-setup9624.7360.6625.80
Dashboard /wp-admin/admin.php?page=talentlms1,1615.6563.0534.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/talentlms/src/Pages/Errors.php+73
    Trying to get property 'id' of non-object
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_talentlms_products
    • wp_talentlms_courses
    • wp_talentlms_categories
    • wp_talentlms_products_categories
  • Zombie WordPress options were found after uninstall: 14 options
    • tlms_courses_page_id
    • tlms-apikey
    • tlms_courses_page_title
    • tlms_courses_page_name
    • widget_tlms_widget
    • theysaidso_admin_options
    • tlms-woocommerce-active
    • tlms-enroll-user-to-courses
    • widget_theysaidso_widget
    • tlms-domain
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=talentlms
    • > Notice in wp-content/plugins/talentlms/src/Pages/Errors.php+73
    Trying to get property 'id' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=talentlms
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tlms-widget handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=talentlms
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tlms-widget handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=talentlms-css
    • > Notice in wp-content/plugins/talentlms/src/Pages/Admin.php+174
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=talentlms-css
    • > Notice in wp-content/plugins/talentlms/templates/css.php+4
    Undefined variable: action_status
    • > GET request to /wp-admin/admin.php?page=talentlms-css
    • > Notice in wp-content/plugins/talentlms/templates/css.php+5
    Undefined variable: action_message
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=talentlms-setup
    • > Notice in wp-content/plugins/talentlms/templates/setup.php+32
    Undefined variable: enroll_user_validation

SRP 0% 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
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/talentlms/vendor/nikic/php-parser/grammar/rebuildParsers.php
    • > /wp-content/plugins/talentlms/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php
    • > /wp-content/plugins/talentlms/templates/widget/tlmswidget.php
  • 1588× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Exception' not found in wp-content/plugins/talentlms/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Core\\AbstractMethodUnitTest' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/FinallyTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractScopeSniff' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/talentlms/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Reports\\Report' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/src/Reports/Notifysend.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/talentlms/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/Classes/NewLateStaticBindingSniff.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/CSS/ClassDefinitionOpeningBraceSpaceUnitTest.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: learning management system, lms, elearning, hcm, talentlms...

talentlms/talentlms.php Passed 13 tests

The primary PHP file in "TalentLMS WordPress plugin" version 7.0 is used by WordPress to initiate all plugin functionality
108 characters long description:
This plugin integrates TalentLMS with WordPress. Promote your TalentLMS content through your WordPress site.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
These items require your attention
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/talentlms/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
262,873 lines of code in 2,656 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,09038,176244,151231,920
Pascal1303,2177,0906,548
Markdown712,78406,365
XML1864167726,107
JSON44705,091
JavaScript677718942,203
yacc3336122,048
XSD4601,094
CSS402391041,068
YAML8613239
Bourne Shell74165147
reStructuredText2231831
DOS Batch241010
SVG2002

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 478)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity6.72
▷ Minimum class complexity1.00
▷ Maximum class complexity721.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces371
Interfaces115
Traits15
Classes3,197
▷ Abstract classes1484.63%
▷ Concrete classes3,04995.37%
▷ Final classes50416.53%
Methods20,464
▷ Static methods2,78913.63%
▷ Public methods15,92477.81%
▷ Protected methods3,30916.17%
▷ Private methods1,2316.02%
Functions6,011
▷ Named functions4,70778.31%
▷ Anonymous functions1,30421.69%
Constants1,216
▷ Global constants16913.90%
▷ Class constants1,04786.10%
▷ Public constants99394.84%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sort_asc_disabled.png0.14KB0.25KB0.00%
assets/images/sort_both.png0.20KB0.29KB0.00%
assets/images/sort_asc.png0.16KB0.25KB0.00%
assets/images/sort_desc_disabled.png0.14KB0.25KB0.00%
assets/images/sort_desc.png0.15KB0.25KB0.00%