57% wp-courses

Code Review | WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses

WordPress plugin WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses scored57%from 54 tests.

About plugin

  • Plugin page: wp-courses
  • Plugin version: 3.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 17, 2016
  • Latest release: Nov 2, 2023
  • Number of updates: 187
  • Update frequency: every 14.1 days
  • Top authors: Bijingus (77.54%)hookandhook (22.99%)

Code review

54 tests

User reviews

21 reviews

Install metrics

700+ active /57,301 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.97MB] [CPU: ▲15.73ms] Passed 4 tests

Analyzing server-side resources used by WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.36 ▲1.9053.16 ▲12.07
Dashboard /wp-admin5.29 ▲1.9568.51 ▲6.03
Posts /wp-admin/edit.php5.41 ▲2.0573.44 ▲25.58
Add New Post /wp-admin/post-new.php8.20 ▲2.31123.71 ▲19.42
Media Library /wp-admin/upload.php5.21 ▲1.9860.81 ▲25.39
All Teachers /wp-admin/edit.php?post_type=teacher5.2962.90
Dashboard /wp-admin/admin.php?page=wpc_settings5.2356.70
Settings /wp-admin/admin.php?page=wpc_options5.2656.85
All Lessons /wp-admin/edit.php?post_type=lesson5.2971.38
All Courses /wp-admin/edit.php?post_type=course5.2952.95
All Certificates /wp-admin/admin.php?page=wpc_premium_certificates5.2152.54
Course Order /wp-admin/admin.php?page=order_courses5.2258.58
Lesson Order /wp-admin/admin.php?page=order_lessons5.2151.45
All Quizzes /wp-admin/edit.php?post_type=wpc-quiz5.2953.58
Setup and Help /wp-admin/admin.php?page=wpc_help5.2248.71

Server storage [IO: ▲5.82MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 197 new files
Database: 4 new tables, 41 new options
New tables
wp_wpc_rules
wp_wpc_tracking
wp_wpc_quiz_results
wp_wpc_connections
New WordPress options
wpc_fix_toolbar_top
widget_recent-comments
wpc_show_course_search
wpc_quiz_table_version
wpc_modules_opened
wpc_container_padding_left
wpc_standard_button_color
wpc_enable_powered_by
widget_theysaidso_widget
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,265 ▲51915.89 ▲1.5412.34 ▲10.7026.57 ▼17.41
Dashboard /wp-admin2,416 ▲2356.52 ▲0.81107.59 ▲3.1975.77 ▲39.29
Posts /wp-admin/edit.php2,343 ▲2463.08 ▲1.0756.03 ▲19.9365.33 ▲32.02
Add New Post /wp-admin/post-new.php1,751 ▲22524.03 ▲0.40686.75 ▲85.01209.60 ▲168.53
Media Library /wp-admin/upload.php1,636 ▲2396.05 ▲1.80110.67 ▲17.9396.65 ▲55.14
All Teachers /wp-admin/edit.php?post_type=teacher1,3893.1548.3376.19
Dashboard /wp-admin/admin.php?page=wpc_settings1,4094.42105.3775.93
Settings /wp-admin/admin.php?page=wpc_options4,6919.87195.71136.71
All Lessons /wp-admin/edit.php?post_type=lesson1,4293.7546.7874.37
All Courses /wp-admin/edit.php?post_type=course1,4213.1850.6172.89
All Certificates /wp-admin/admin.php?page=wpc_premium_certificates1,1583.1946.1055.19
Course Order /wp-admin/admin.php?page=order_courses1,1283.4242.1758.90
Lesson Order /wp-admin/admin.php?page=order_lessons1,1643.0961.3057.51
All Quizzes /wp-admin/edit.php?post_type=wpc-quiz1,4003.2147.8370.05
Setup and Help /wp-admin/admin.php?page=wpc_help1,2883.3048.1865.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_wpc_tracking
    • wp_wpc_quiz_results
    • wp_wpc_connections
    • wp_wpc_rules
  • Zombie WordPress options were found after uninstall: 41 options
    • wpc_tracking_table_version
    • wpc_primary_color
    • wpc_connections_table_version
    • wpc_logged_out_message
    • wpc_quiz_table_version
    • wpc_modules_opened
    • wpc_fix_toolbar_top
    • wpc_h2_font_size
    • wpc_fixed_toolbar_offset
    • wpc_container_padding_left
    • ...

Smoke tests 0% 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=order_lessons
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/wp-courses/classes/WPC_Ajax.php+200
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-courses/admin/templates/single-student.php
    • > /wp-content/plugins/wp-courses/wp-courses.php
  • 56× 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 _e() in wp-content/plugins/wp-courses/admin/templates/premium-badges.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-courses/admin/charts/chart-tracking-data.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-courses/admin/templates/premium-emails.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-courses/admin/columns.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-courses/init/enqueue.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_tax() in wp-content/plugins/wp-courses/templates/template-parts/course-filters.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-courses/classes/WPCQ_Ajax.php:4
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-courses/admin/dashboard.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpc_get_course_dropdown() in wp-content/plugins/wp-courses/admin/templates/order-lessons.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-courses/admin/front-end-editor.php:156

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=wpc_options
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=wpc_options 343 The specified value "0px" cannot be parsed, or is out of range.

Optimizations

Plugin configuration Passed 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
5 plugin tags: lms, course, elearning, courses, online courses

wp-courses/wp-courses.php Passed 13 tests

Analyzing the main PHP file in "WP Courses LMS – Online Courses Builder, eLearning Courses, Courses Solution, Education Courses" version 3.2.2
78 characters long description:
Create unlimited online courses on your WordPress website with WP Courses LMS.

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
Good job! No executable or dangerous file extensions detected58,298 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript191,01625629,282
PHP632,3605758,537
PO File113,2573,9187,864
CSS6606836,367
TypeScript254301,8961,864
Sass1434341,656
LESS1434441,646
SVG211770
Markdown3580162
JSON300150

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity17.14
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions254
▷ Named functions25399.61%
▷ Anonymous functions10.39%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 compressed PNG files occupy 1.91MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/arrow-down.png0.84KB1.06KB0.00%
css/DataTables-1.11.2/images/sort_asc.png0.16KB0.25KB0.00%
css/DataTables-1.11.2/images/sort_desc.png0.15KB0.25KB0.00%
images/wpc-logo-sm.png1.04KB0.98KB▼ 5.27%
css/DataTables-1.11.2/images/sort_both.png0.61KB0.29KB▼ 52.96%