58% coschool

Code Review | CoSchool – A WordPress LMS Plugin To Create and Sell Your Courses Online

WordPress plugin CoSchool – A WordPress LMS Plugin To Create and Sell Your Courses Online scored58%from 54 tests.

About plugin

  • Plugin page: coschool
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Aug 10, 2022
  • Latest release: May 17, 2023
  • Number of updates: 9
  • Update frequency: every 31.2 days
  • Top authors: codexpert (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,000 total downloads

Benchmarks

Plugin footprint 48% 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: ▲2.43MB] [CPU: ▲19.63ms] Passed 4 tests

A check of server-side resources used by CoSchool – A WordPress LMS Plugin To Create and Sell Your Courses Online
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.45 ▲1.9970.27 ▲30.36
Dashboard /wp-admin5.90 ▲2.6068.96 ▲19.20
Posts /wp-admin/edit.php5.96 ▲2.6172.51 ▲20.71
Add New Post /wp-admin/post-new.php8.47 ▲2.58111.75 ▲8.26
Media Library /wp-admin/upload.php5.77 ▲2.5568.76 ▲32.12
Quizzes /wp-admin/edit.php?post_type=quiz5.8959.99
Reports /wp-admin/admin.php?page=reports5.8054.59
Assignments /wp-admin/edit.php?post_type=assignment5.8959.89
Payments /wp-admin/admin.php?page=payments5.8061.05
Lessons /wp-admin/edit.php?post_type=lesson5.8958.46
Pro Features /wp-admin/admin.php?page=coschool-pro5.7550.81
Coupons /wp-admin/edit.php?post_type=coupon5.8963.13
Students /wp-admin/admin.php?page=students5.8053.40
Bundles /wp-admin/edit.php?post_type=bundle5.8959.74
Settings /wp-admin/admin.php?page=coschool5.9664.15

Server storage [IO: ▲10.13MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 347 new files
Database: 7 new tables, 8 new options
New tables
wp_coschool_enrollments
wp_coschool_enrollment_progress
wp_coschool_quiz_attempt_answers
wp_coschool_enrollmentmeta
wp_coschool_quiz_attempts
wp_coschool_payments
wp_coschool_paymentmeta
New WordPress options
db_upgraded
coschool_install_time
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
coschool_version

Browser metrics Passed 4 tests

An overview of browser requirements for CoSchool – A WordPress LMS Plugin To Create and Sell Your Courses Online
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,391 ▲63016.29 ▲1.6632.69 ▲30.9739.97 ▼2.90
Dashboard /wp-admin2,321 ▲1475.54 ▼0.0491.65 ▲3.6469.89 ▲28.13
Posts /wp-admin/edit.php2,242 ▲1422.54 ▲0.5748.20 ▲8.9535.78 ▼2.06
Add New Post /wp-admin/post-new.php1,648 ▲12223.71 ▲0.09693.37 ▼5.3540.27 ▼11.79
Media Library /wp-admin/upload.php1,542 ▲1425.04 ▲0.8197.15 ▼15.6373.77 ▲28.02
Quizzes /wp-admin/edit.php?post_type=quiz1,2202.5038.3132.81
Reports /wp-admin/admin.php?page=reports1,2753.5082.7728.97
Assignments /wp-admin/edit.php?post_type=assignment1,2252.5136.0731.01
Payments /wp-admin/admin.php?page=payments1,1302.3938.1031.13
Lessons /wp-admin/edit.php?post_type=lesson1,2472.5237.1834.42
Pro Features /wp-admin/admin.php?page=coschool-pro1,0442.4933.6841.49
Coupons /wp-admin/edit.php?post_type=coupon1,2382.5137.3830.69
Students /wp-admin/admin.php?page=students1,0842.3835.5627.71
Bundles /wp-admin/edit.php?post_type=bundle1,2362.5237.9128.83
Settings /wp-admin/admin.php?page=coschool4,16713.55367.6051.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Codexpert\CoSchool\Admin' does not have a method 'uninstall'
  • The uninstall procedure failed, leaving 7 tables in the database
    • wp_coschool_paymentmeta
    • wp_coschool_quiz_attempts
    • wp_coschool_payments
    • wp_coschool_enrollmentmeta
    • wp_coschool_quiz_attempt_answers
    • wp_coschool_enrollments
    • wp_coschool_enrollment_progress
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 items
  • 58× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\CoSchool\\App\\Student\\Data' not found in wp-content/plugins/coschool/templates/shortcodes/student-dashboard/contents/wishlist.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\CoSchool\\App\\Quiz\\Data' not found in wp-content/plugins/coschool/views/metabox/quiz/config.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_content() in wp-content/plugins/coschool/templates/lesson/tabs/content.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\CoSchool\\App\\Certificate\\Data' not found in wp-content/plugins/coschool/views/metabox/certificate/config.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get() on null in wp-content/plugins/coschool/templates/course/tabs/faq.php:4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/coschool/inc/functions.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Codexpert\\CoSchool\\Helper' not found in wp-content/plugins/coschool/templates/shortcodes/courses.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/coschool/templates/shortcodes/student-dashboard.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/coschool/inc/functions.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function coschool_get_cart_items() in wp-content/plugins/coschool/templates/shortcodes/enroll.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bundle
    • > 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: Cannot read properties of undefined (reading 'bar')" "TypeError: Cannot read properties of undefined (reading 'bar')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/coschool/assets/admin/js/reports.js?ver=1.0:54:34)\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
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bundle
    • > 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: Cannot read properties of undefined (reading 'bar')
    • > GET request to /wp-admin/admin.php?page=reports
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=reports 193 The specified value "1" does not conform to the required format, "yyyy-MM-dd".
    • > GET request to /wp-admin/admin.php?page=reports
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=reports 194 The specified value "1" does not conform to the required format, "yyyy-MM-dd".
    • > GET request to /wp-admin/admin.php?page=reports
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=reports 219 The specified value "1" does not conform to the required format, "yyyy-MM-dd".
    • > GET request to /wp-admin/admin.php?page=reports
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=reports 220 The specified value "1" does not conform to the required format, "yyyy-MM-dd".
    • > GET request to /wp-admin/admin.php?page=reports
    • > 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: Cannot read properties of undefined (reading 'labels')" "TypeError: Cannot read properties of undefined (reading 'labels')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/coschool/assets/admin/js/reports.js?ver=1.0:121:39)\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=reports
    • > 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: Cannot read properties of undefined (reading 'labels')
    • > GET request to /wp-admin/admin.php?page=coschool
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'bar')" "TypeError: Cannot read properties of undefined (reading 'bar')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/coschool/assets/admin/js/reports.js?ver=1.0:54:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&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,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=coschool
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'bar')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: lms, online learning, learning management system, education, course...

coschool/coschool.php 92% from 13 tests

Analyzing the main PHP file in "CoSchool – A WordPress LMS Plugin To Create and Sell Your Courses Online" version 1.0
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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 plugin23,666 lines of code in 250 files:
LanguageFilesBlank linesComment linesLines of code
PHP1823,2824,32514,289
CSS341302107,591
JavaScript192231341,648
JSON30079
SVG110058
Markdown1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.64
▷ Minimum class complexity1.00
▷ Maximum class complexity228.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces22
Interfaces0
Traits0
Classes103
▷ Abstract classes43.88%
▷ Concrete classes9996.12%
▷ Final classes11.01%
Methods652
▷ Static methods456.90%
▷ Public methods63897.85%
▷ Protected methods20.31%
▷ Private methods121.84%
Functions59
▷ Named functions4881.36%
▷ Anonymous functions1118.64%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
30 compressed PNG files occupy 1.49MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/add-ons/paypal.png3.67KB3.67KB0.11%
assets/img/pay.png78.24KB78.17KB0.08%
assets/img/add-ons/fastspring.png4.01KB3.99KB▼ 0.66%
vendor/codexpert/plugin/src/assets/img/survey.png7.31KB3.08KB▼ 57.88%
assets/img/add-ons/2checkout.png3.14KB3.14KB0.00%