10% easy-courses

Code Review | Easy Courses

WordPress plugin Easy Courses scored10%from 54 tests.

About plugin

  • Plugin page: easy-courses
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Jun 30, 2022
  • Latest release: Jul 7, 2023
  • Number of updates: 13
  • Update frequency: every 28.8 days
  • Top authors: wpmighty (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /835 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/easy-courses/libraries/vendor/freemius/wordpress-sdk/require.php+24
    require_once(wp-content/plugins/easy-courses/libraries/vendor/freemius/wordpress-sdk/includes/managers/class-fs-clone-manager.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.34ms] Passed 4 tests

An overview of server-side resources used by Easy Courses
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.02 ▼5.31
Dashboard /wp-admin3.31 ▲0.0044.71 ▼4.31
Posts /wp-admin/edit.php3.36 ▲0.0046.27 ▼0.09
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.36 ▲0.34
Media Library /wp-admin/upload.php3.23 ▲0.0036.24 ▲5.83

Server storage [IO: ▲35.50MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 35.50MB)
Filesystem: 803 new files
Database: no new tables, 8 new options
New WordPress options
fs_active_plugins
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
fs_debug_mode
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Courses
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.29 ▼1.011.82 ▲0.0537.47 ▼7.71
Dashboard /wp-admin2,209 ▲185.91 ▲1.04107.46 ▼10.6141.19 ▼4.71
Posts /wp-admin/edit.php2,089 ▼02.14 ▲0.1140.06 ▲4.5234.89 ▼0.44
Add New Post /wp-admin/post-new.php1,533 ▲1923.22 ▲5.53652.13 ▼12.8252.79 ▼0.49
Media Library /wp-admin/upload.php1,391 ▲34.23 ▼0.04100.32 ▼2.5944.01 ▲0.55

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • fs_active_plugins
    • fs_debug_mode
    • widget_recent-posts
    • theysaidso_admin_options
    • 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 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
  • 83× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_003.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_001.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_009.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_035.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_042.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_030.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_046.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_061.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svg.php
    • > /wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_038.php
  • 80× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/easy-courses/libraries/admin/view/reports.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'EasyCourses_Admin_Table_Notifications' not found in wp-content/plugins/easy-courses/libraries/admin/table/class-forums.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/easy-courses/libraries/include/easycourses/view/admin/assessment/assessment-modules.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'EasyCourses_Admin_Controller_Menu' not found in wp-content/plugins/easy-courses/libraries/admin/class-instructors.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/easy-courses/libraries/include/easycourses/widget/class-calendar.php:8
    • > PHP Warning
      require_once(wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/example_066.php on line 22
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-users-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/easy-courses/libraries/admin/table/class-instructors.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'EasyCourses_View_Admin_Student_Workbook' not found in wp-content/plugins/easy-courses/libraries/include/easycourses/view/admin/student/class-profile.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/easy-courses/libraries/admin/view/instructors.php:2
    • > PHP Fatal error
      require(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-users-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/easy-courses/libraries/include/easycourses/helper/table/class-instructor.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6 in easy-courses/assets to your readme.txt
You can take inspiration from this readme.txt

easy-courses/easycourses.php 77% from 13 tests

The main PHP script in "Easy Courses" version 1.2.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("easy-courses.php" instead of "easycourses.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 215 characters long)

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
These items require your attention
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/easy-courses/libraries/vendor/tecnickcom/tcpdf/examples/data/cert/tcpdf.crt
158,056 lines of code in 592 files:
LanguageFilesBlank linesComment linesLines of code
PHP51920,00946,026131,799
JavaScript261,9041,25910,310
CSS376861925,991
SVG5114,564
PO File11,8072,8904,277
JSON3001,052
Markdown121063

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,415)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 500)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity84.34
▷ Minimum class complexity1.00
▷ Maximum class complexity4,415.00
Average method complexity6.09
▷ Minimum method complexity1.00
▷ Maximum method complexity500.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes214
▷ Abstract classes31.40%
▷ Concrete classes21198.60%
▷ Final classes00.00%
Methods3,533
▷ Static methods1,65546.84%
▷ Public methods2,69676.31%
▷ Protected methods36210.25%
▷ Private methods47513.44%
Functions159
▷ Named functions15899.37%
▷ Anonymous functions10.63%
Constants301
▷ Global constants23678.41%
▷ Class constants6521.59%
▷ Public constants65100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
18 PNG files occupy 0.67MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/collapse.png2.82KB0.15KB▼ 94.80%
libraries/vendor/tecnickcom/tcpdf/examples/images/img.png190.15KB64.69KB▼ 65.98%
assets/css/external/chosen-sprite.png0.53KB0.88KB0.00%
assets/img/chosen-sprite.png0.53KB0.88KB0.00%
libraries/vendor/tecnickcom/tcpdf/examples/images/image_with_alpha.png238.07KB61.71KB▼ 74.08%