57% wp-attest

Code Review | LMS Plugin - eLearning, Online Courses by Attest

WordPress plugin LMS Plugin - eLearning, Online Courses by Attest scored 57% from 54 tests.

About plugin

  • Plugin page: wp-attest
  • Plugin version: 1.7.4
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.6
  • WordPress version: 5.9.2
  • First release: May 28, 2020
  • Latest release: Feb 12, 2021
  • Number of updates: 45
  • Update frequency: every 5.8 days
  • Top authors: attest (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active / 3,100 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.06MB] [CPU: ▼278.90ms] Passed 4 tests

This is a short check of server-side resources used by LMS Plugin - eLearning, Online Courses by Attest
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.45 ▲1.3368.35 ▲43.58
Dashboard /wp-admin4.35 ▲0.9546.28 ▲13.77
Posts /wp-admin/edit.php4.60 ▲0.9650.73 ▲15.75
Add New Post /wp-admin/post-new.php8.27 ▲1.30106.56 ▼1,156.53
Media Library /wp-admin/upload.php4.31 ▲1.0235.59 ▲11.41
Freemius Debug [v.2.4.1] /wp-admin/admin.php?page=freemius4.4835.79
Courses /wp-admin/edit.php?post_type=attest_course4.3939.07
Settings /wp-admin/edit.php?post_type=attest_course&page=settings4.1434.04
Topics /wp-admin/edit-tags.php?taxonomy=topics&post_type=attest_course4.3138.30
Difficulty /wp-admin/edit-tags.php?taxonomy=difficulty&post_type=attest_course4.3240.03
Students /wp-admin/edit.php?post_type=attest_course&page=students4.3037.60
Lessons /wp-admin/edit.php?post_type=attest_lesson4.3837.67
Tutors /wp-admin/edit.php?post_type=attest_course&page=tutors4.3136.88
Get Started /wp-admin/edit.php?post_type=attest_course&page=attest4.1433.79
Announcements /wp-admin/edit.php?post_type=attest_course&page=announcement4.3037.86

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 235 new files
Database: 2 new tables, 14 new options
New tables
wp_attest_students
wp_attest_announcements
New WordPress options
difficulty_children
attest_email_completed_course_permission
attest_lms_lns
fs_debug_mode
attest_email_announcement_permission
fs_gdpr
fs_active_plugins
_attest_db_exist
_plugin_db_exist
attest_email_new_course_permission
...

Browser metrics 75% from 4 tests

An overview of browser requirements for LMS Plugin - eLearning, Online Courses by Attest
You may want to improve the following
  • Script duration: Please improve your JavaScript code, lowering total execution time to less than 1,500.00ms (currently 2,360.45ms on /wp-admin/edit.php?post_type=attest_course&page=attest)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,147 ▲39316.53 ▲0.9114.07 ▲7.812.87 ▼0.14
Dashboard /wp-admin3,113 ▲2526.20 ▲0.00121.42 ▼13.27174.12 ▲13.13
Posts /wp-admin/edit.php2,894 ▲2033.27 ▲0.0363.11 ▼0.85150.10 ▲9.12
Add New Post /wp-admin/post-new.php1,758 ▲620.47 ▼1.10399.78 ▼83.64155.86 ▼3.66
Media Library /wp-admin/upload.php1,910 ▲2155.68 ▲0.14153.46 ▲3.72205.21 ▲8.33
Freemius Debug [v.2.4.1] /wp-admin/admin.php?page=freemius1,6142.5558.70113.13
Courses /wp-admin/edit.php?post_type=attest_course1,6414.1980.00126.92
Settings /wp-admin/edit.php?post_type=attest_course&page=settings1,4233.73102.12154.96
Topics /wp-admin/edit-tags.php?taxonomy=topics&post_type=attest_course1,8422.9457.15137.88
Difficulty /wp-admin/edit-tags.php?taxonomy=difficulty&post_type=attest_course2,0982.9458.65154.36
Students /wp-admin/edit.php?post_type=attest_course&page=students1,5763.4266.50118.41
Lessons /wp-admin/edit.php?post_type=attest_lesson1,5793.2763.02122.74
Tutors /wp-admin/edit.php?post_type=attest_course&page=tutors1,5453.4365.85115.60
Get Started /wp-admin/edit.php?post_type=attest_course&page=attest3,31218.472,360.45256.89
Announcements /wp-admin/edit.php?post_type=attest_course&page=announcement1,6713.2960.18110.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+307
    Non-static method ATTEST_LMS_BUILD::deactivate() should not be called statically
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_attest_students
    • wp_attest_announcements
  • Zombie WordPress options detected upon uninstall: 14 options
    • fs_gdpr
    • _plugin_db_exist
    • fs_debug_mode
    • fs_active_plugins
    • attest_email_announcement_permission
    • attest_email_continue_course_permission
    • attest_number_courses
    • attest_ok_updated_course
    • attest_email_new_course_permission
    • difficulty_children
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-attest/vendor/freemius/templates/ajax-loader.php
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-attest/vendor/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-attest/vendor/freemius/templates/account/partials/addon.php on line 6
    • > PHP Warning
      require_once(ATTEST_LMS_PATHlib/templates/class-course-temp-functions.php): failed to open stream: No such file or directory in wp-content/plugins/wp-attest/lib/templates/single-course.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wp-attest/vendor/freemius/templates/account/partials/addon.php:9
    • > PHP Warning
      Use of undefined constant ATTEST_LMS_PATH - assumed 'ATTEST_LMS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-attest/lib/templates/archive-course.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required 'ATTEST_LMS_PATHlib/templates/class-lesson-temp-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-attest/lib/templates/single-lesson.php on line 7
    • > PHP Warning
      Use of undefined constant ATTEST_LMS_PATH - assumed 'ATTEST_LMS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-attest/lib/templates/single-lesson.php on line 7
    • > PHP Warning
      require_once(ATTEST_LMS_PATHlib/templates/class-course-archive-functions.php): failed to open stream: No such file or directory in wp-content/plugins/wp-attest/lib/templates/archive-course.php on line 7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/screen.php): failed to open stream: No such file or directory in wp-content/plugins/wp-attest/lib/user/class-attest-student-table.php on line 13
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-attest/lib/user/class-attest-student-table.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: learning, education, courses, lms, learning management system

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

The primary PHP file in "LMS Plugin - eLearning, Online Courses by Attest" version 1.7.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 211 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected46,797 lines of code in 189 files:
LanguageFilesBlank linesComment linesLines of code
PHP1599,55116,45536,909
CSS151,121998,779
JavaScript13213144868
Markdown1680214
JSON10027

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity54.13
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.32
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes93
▷ Abstract classes22.15%
▷ Concrete classes9197.85%
▷ Final classes3437.36%
Methods1,521
▷ Static methods18111.90%
▷ Public methods1,15976.20%
▷ Protected methods291.91%
▷ Private methods33321.89%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants132
▷ Global constants10781.06%
▷ Class constants2518.94%
▷ Public constants25100.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
6 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/img/woocommerce-extension.png45.21KB12.75KB▼ 71.79%
asset/img/brand.png3.38KB3.15KB▼ 6.95%
vendor/freemius/assets/img/wp-attest.png18.65KB6.83KB▼ 63.35%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%