10% training

Code Review | Training - Courses

WordPress plugin Training - Courses scored10%from 54 tests.

About plugin

  • Plugin page: training
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.2
  • WordPress version: 6.3.1
  • First release: Oct 24, 2017
  • Latest release: Nov 26, 2021
  • Number of updates: 28
  • Update frequency: every 53.4 days
  • Top authors: rudrainnovatives (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /4,705 total downloads

Benchmarks

Plugin footprint 40% 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
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/training/inc/tr-db-install-scripts.php+89
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.25ms] Passed 4 tests

This is a short check of server-side resources used by Training - Courses
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0727.17 ▼13.99
Dashboard /wp-admin3.35 ▲0.0545.82 ▼4.29
Posts /wp-admin/edit.php3.40 ▲0.0546.87 ▼4.02
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.37 ▼2.70
Media Library /wp-admin/upload.php3.27 ▲0.0535.23 ▲1.24
/wp-admin/admin.php?page=edit_course3.4235.63
/wp-admin/admin.php?page=add_exercise3.2933.99
Manage Authors /wp-admin/admin.php?page=manage-authors3.3231.48
/wp-admin/admin.php?page=add_lesson3.2832.77
/wp-admin/admin.php?page=progress_detail3.3832.62
/wp-admin/admin.php?page=module_detail3.3132.59
/wp-admin/admin.php?page=course_detail3.3032.64
/wp-admin/admin.php?page=add_module3.2832.76
Image By Course /wp-admin/admin.php?page=course_images3.2928.42
/wp-admin/admin.php?page=edit_lesson3.3031.12

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 136 new files
Database: 14 new tables, 7 new options
New tables
wp_rtr_courses
wp_rtr_enrollment
wp_rtr_categories
wp_rtr_modules
wp_rtr_project_exercise
wp_rtr_lessons
wp_rtr_setting
wp_rtr_resource_status
wp_rtr_media
wp_rtr_projects
...
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
trainingtoolpage
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Training - Courses
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲15114.25 ▼0.341.61 ▼0.1541.50 ▼2.13
Dashboard /wp-admin2,299 ▲1195.52 ▼0.1684.55 ▼4.3439.38 ▲0.41
Posts /wp-admin/edit.php2,204 ▲1042.04 ▲0.0138.24 ▲3.5137.22 ▲0.43
Add New Post /wp-admin/post-new.php1,602 ▲6623.57 ▲0.37690.91 ▲45.5255.37 ▼1.16
Media Library /wp-admin/upload.php1,504 ▲1104.20 ▲0.00106.36 ▲11.8846.46 ▲5.65
/wp-admin/admin.php?page=edit_course8761.337.3724.49
/wp-admin/admin.php?page=add_exercise8531.516.6519.74
Manage Authors /wp-admin/admin.php?page=manage-authors1,4753.8661.7058.01
/wp-admin/admin.php?page=add_lesson8531.516.1420.28
/wp-admin/admin.php?page=progress_detail1,1862.7350.1333.18
/wp-admin/admin.php?page=module_detail8531.516.6022.06
/wp-admin/admin.php?page=course_detail8531.126.6619.20
/wp-admin/admin.php?page=add_module8531.516.2821.34
Image By Course /wp-admin/admin.php?page=course_images1,4093.9358.7968.13
/wp-admin/admin.php?page=edit_lesson8531.516.3019.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 14 tables in the database
    • wp_rtr_modules
    • wp_rtr_resource_list
    • wp_rtr_categories
    • wp_rtr_project_exercise
    • wp_rtr_email_templates
    • wp_rtr_resource_status
    • wp_rtr_lessons
    • wp_rtr_authors
    • wp_rtr_lesson_notes
    • wp_rtr_setting
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • trainingtoolpage
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=edit_course
    • > Deprecated in wp-content/plugins/training/views/menus.php+28
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=course_images
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=course_images
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/training/email-templates/templates.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/training/views/tmpl/rtr-tmpl-load-categories.php:2
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/training/views/tmpl/rtr-tmpl-load-authors.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/training/views/tmpl/rtr-tmpl-load-front-courses.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/training/views/front-trining-template.php:12
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/training/views/tmpl/rtr-tmpl-load-categories.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/training/views/tmpl/rtr-tmpl-load-authors.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: sell courses, e-learning, udemy clone, online courses, lms...

training/wp-training.php 85% from 13 tests

The primary PHP file in "Training - Courses" version 1.3 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("training.php" instead of "wp-training.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 238 characters long)

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 plugin21,491 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,5874289,582
JavaScript62,0576,1409,291
CSS6290821,869
SVG300749

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.36
Average class complexity16.67
▷ Minimum class complexity16.00
▷ Maximum class complexity17.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes266.67%
Methods21
▷ Static methods523.81%
▷ Public methods1885.71%
▷ Protected methods00.00%
▷ Private methods314.29%
Functions76
▷ Named functions76100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
42 PNG files occupy 0.37MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/off.png9.65KB5.34KB▼ 44.65%
assets/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
assets/css/images/help.png18.09KB0.48KB▼ 97.33%
assets/img/linkedin.png0.66KB0.69KB0.00%
assets/css/chosen-sprite.png0.53KB0.88KB0.00%