62% course-migration-for-learndash

Code Review | Course Migration for LearnDash

WordPress plugin Course Migration for LearnDash scored62%from 54 tests.

About plugin

  • Plugin page: course-migration-...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-5.3.2
  • WordPress version: 6.3.1
  • First release: Jun 26, 2019
  • Latest release: Jan 6, 2020
  • Number of updates: 12
  • Update frequency: every 16.2 days
  • Top authors: fzngagan (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,432 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.77MB] [CPU: ▼32.93ms] Passed 4 tests

Analyzing server-side resources used by Course Migration for LearnDash
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0943.16 ▼1.44
Dashboard /wp-admin3.17 ▼0.1325.49 ▼28.97
Posts /wp-admin/edit.php3.17 ▼0.1830.97 ▼15.51
Add New Post /wp-admin/post-new.php3.17 ▼2.7124.94 ▼79.24
Media Library /wp-admin/upload.php3.17 ▼0.0528.24 ▼7.99
Security Key /wp-admin/admin.php?page=sfwd-lms-course-migration-admin-whitelist3.1727.54
Course Migration /wp-admin/admin.php?page=sfwd-lms-course-migration-admin3.1727.89

Server storage [IO: ▲0.42MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Course Migration for LearnDash: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲18514.02 ▼0.368.37 ▲6.2044.85 ▼1.67
Dashboard /wp-admin2,257 ▲695.03 ▲0.14103.63 ▼14.6539.25 ▼4.24
Posts /wp-admin/edit.php2,140 ▲512.04 ▼0.1142.47 ▲6.4137.12 ▼0.02
Add New Post /wp-admin/post-new.php1,552 ▲1917.68 ▼5.51692.73 ▲24.0251.77 ▼4.67
Media Library /wp-admin/upload.php1,439 ▲484.25 ▼0.0099.58 ▼7.0743.64 ▼2.83
Security Key /wp-admin/admin.php?page=sfwd-lms-course-migration-admin-whitelist8501.9531.9754.37
Course Migration /wp-admin/admin.php?page=sfwd-lms-course-migration-admin8842.0331.2930.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/course-migration-for-learndash/admin/class-sfwd-lms-course-migration-admin.php+122
    Undefined index: ldcm_nonce
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

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 server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sfwd-lms-course-migration-admin
    • > Notice in wp-content/plugins/course-migration-for-learndash/admin/class-sfwd-lms-course-migration-admin.php+122
    Undefined index: ldcm_nonce

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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/course-migration-for-learndash/public/partials/sfwd-lms-course-migration-public-display.php
    • > /wp-content/plugins/course-migration-for-learndash/admin/partials/sfwd-lms-course-migration-admin-display.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: courses in wp-content/plugins/course-migration-for-learndash/admin/partials/sfwd-lms-course-migration-admin-display.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/course-migration-for-learndash/admin/partials/sfwd-lms-course-migration-admin-whitelist.php:11
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/course-migration-for-learndash/admin/partials/sfwd-lms-course-migration-admin-display.php on line 38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 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
7 plugin tags: online courses, learndash, education, e-learning, lms...

course-migration-for-learndash/sfwd-lms-course-migration.php 85% from 13 tests

This is the main PHP file of "Course Migration for LearnDash" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to 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
  • Main file name: Name the main plugin file the same as the plugin slug ("course-migration-for-learndash.php" instead of "sfwd-lms-course-migration.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected1,201 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6506198679
PHP13218594424
SVG30192
CSS31146

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.57
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.47
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png2.28KB1.46KB▼ 35.94%
assets/icon-256x256.png5.18KB2.92KB▼ 43.57%
assets/screenshot-1.png40.40KB9.55KB▼ 76.36%
assets/screenshot-2.png64.85KB17.97KB▼ 72.29%