File tree Expand file tree Collapse file tree 2 files changed +10
-28
lines changed
Expand file tree Collapse file tree 2 files changed +10
-28
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ public function __construct() {
5454 add_filter ( 'plugin_action_links_ ' . plugin_basename ( TLMT_FILE ), array ( $ this , 'plugin_action_links ' ) );
5555
5656 if ( $ this ->check_installed () ) {
57- $ this ->includes ();
5857 $ this ->used_classes ();
5958 $ this ->classes_initialize ();
6059 } else {
@@ -213,21 +212,6 @@ public function install_tutor_plugin() {
213212 die ();
214213 }
215214
216- /**
217- * Includes.
218- *
219- * @return void
220- */
221- public function includes () {
222- include TLMT_PATH . 'classes/LPtoTutorMigration.php ' ;
223- include TLMT_PATH . 'classes/LDtoTutorMigration.php ' ;
224- if ( is_plugin_active ( 'lifterlms/lifterlms.php ' ) ) {
225- include TLMT_PATH . 'classes/LIFtoTutorMigration.php ' ;
226- }
227- include TLMT_PATH . 'classes/LDtoTutorExport.php ' ;
228- include TLMT_PATH . 'classes/Utils.php ' ;
229- }
230-
231215 /**
232216 * Used classed.
233217 *
@@ -239,7 +223,6 @@ public function used_classes() {
239223 if ( is_plugin_active ( 'lifterlms/lifterlms.php ' ) ) {
240224 $ this ->classes [] = 'LIFtoTutorMigration ' ;
241225 }
242-
243226 }
244227
245228 /**
Original file line number Diff line number Diff line change 2121
2222require_once __DIR__ . '/vendor/autoload.php ' ;
2323
24- require 'classes/Dependency.php ' ;
25-
2624use TutorLMSMigrationTool \TLMT \Dependency ;
2725
2826/**
@@ -82,17 +80,18 @@ function tutor_migration_tool_deleted() {
8280
8381register_uninstall_hook ( __FILE__ , 'tutor_migration_tool_deleted ' );
8482
85- if ( ! class_exists ( ' TutorLMSMigrationTool ' ) ) {
83+ TutorLMSMigrationTool:: instance ();
8684
87- $ dependency = new Dependency ();
88- if ( ! $ dependency ->is_tutor_core_has_req_verion () ) {
89- add_action ( 'admin_notices ' , array ( $ dependency , 'show_admin_notice ' ) );
90- return ;
85+ add_action (
86+ 'plugins_loaded ' ,
87+ function () {
88+ $ dependency = new Dependency ();
89+ if ( ! $ dependency ->is_tutor_core_has_req_verion () ) {
90+ add_action ( 'admin_notices ' , array ( $ dependency , 'show_admin_notice ' ) );
91+ return ;
92+ }
9193 }
92-
93- include_once 'classes/TutorLMSMigrationTool.php ' ;
94- TutorLMSMigrationTool::instance ();
95- }
94+ );
9695
9796if ( is_plugin_active ( 'tutor/tutor.php ' ) ) {
9897
You can’t perform that action at this time.
0 commit comments