83% learnpress-import-export

Code Review | LearnPress Export Import - WordPress extension for LearnPress

WordPress plugin LearnPress Export Import - WordPress extension for LearnPress scored83%from 54 tests.

About plugin

  • Plugin page: learnpress-import...
  • Plugin version: 4.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Jun 16, 2015
  • Latest release: Apr 17, 2023
  • Number of updates: 34
  • Update frequency: every 84.2 days
  • Top authors: ThimPress (41.18%)tunnhn (29.41%)thongta (23.53%)leehld (11.76%)halink0803 (5.88%)

Code review

54 tests

User reviews

13 reviews

Install metrics

8,000+ active /134,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.39ms] Passed 4 tests

A check of server-side resources used by LearnPress Export Import - WordPress extension for LearnPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.46 ▼2.95
Dashboard /wp-admin3.31 ▼0.0453.38 ▼6.29
Posts /wp-admin/edit.php3.36 ▲0.0043.85 ▼5.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.06 ▼23.08
Media Library /wp-admin/upload.php3.23 ▲0.0038.15 ▲2.15

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for LearnPress Export Import - WordPress extension for LearnPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.35 ▲0.061.50 ▼0.1438.63 ▼2.25
Dashboard /wp-admin2,192 ▲155.53 ▼0.1281.91 ▼2.2238.62 ▼4.55
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0136.26 ▲0.8731.21 ▼3.39
Add New Post /wp-admin/post-new.php1,526 ▼023.12 ▲0.03649.72 ▼18.9763.73 ▲11.32
Media Library /wp-admin/upload.php1,403 ▲94.18 ▼0.0199.46 ▲7.6144.48 ▲2.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'LP_Request' not found in wp-content/plugins/learnpress-import-export/inc/admin/views/learnpress/export/step-2.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/learnpress-import-export/inc/admin/providers/learnpress/xml/items/export-quiz.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'LP_Request' not found in wp-content/plugins/learnpress-import-export/inc/admin/views/learnpress/import-user/form-import.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/learnpress-import-export/inc/admin/views/learnpress/import-user/step-3.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/learnpress-import-export/inc/admin/views/settings-page.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'LP_Export_LearnPress_Provider' not found in wp-content/plugins/learnpress-import-export/inc/admin/views/learnpress/export/step-1.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function learn_press_get_request() in wp-content/plugins/learnpress-import-export/inc/admin/views/export.php:9
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/learnpress-import-export/inc/admin/providers/learnpress/xml/items/export-question.php:6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/learnpress-import-export/inc/admin/providers/learnpress/xml/items/export-course.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/learnpress-import-export/inc/admin/providers/learnpress/xml/lp-export.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add an image for screenshot #1 (LearnPress Export Import screenshot.)
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

learnpress-import-export/learnpress-import-export.php Passed 13 tests

The main PHP file in "LearnPress Export Import - WordPress extension for LearnPress" ver. 4.0.3 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
Export and Import your courses with all lesson and quiz in easiest way.

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
Success! There were no dangerous files found in this plugin3,958 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP325739703,406
JavaScript3294416
CSS1231136

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity26.80
▷ Minimum class complexity2.00
▷ Maximum class complexity124.00
Average method complexity4.99
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods97
▷ Static methods99.28%
▷ Public methods8587.63%
▷ Protected methods66.19%
▷ Private methods66.19%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected