1414
1515defined ( 'ABSPATH ' ) or die ( 'Nothing here to see! ' );
1616
17- final class OpenPlugin
17+ final class OpenPlugin6
1818{
1919 protected $ path = null ;
2020 protected $ message = '' ;
@@ -23,47 +23,50 @@ final class OpenPlugin
2323
2424 public function __construct ()
2525 {
26- add_action ('plugins_loaded ' , function () {
27- if (defined ('TYPEROCKET_PLUGIN_INSTALL ' ) || defined ('TYPEROCKET_PATH ' )) {
28- add_filter ('plugin_action_links ' ,function ($ actions , $ plugin_file ) {
29- if ( $ found = strpos (__FILE__ , $ plugin_file ) ) {
30- $ actions ['settings ' ] = '<span style="color: red">Inactive Install</span> ' ;
31- }
26+ add_action ('plugins_loaded ' , [$ this , 'plugins_loaded ' ], 13 );
27+ register_activation_hook ( __FILE__ , [$ this , 'activation ' ]);
28+ }
3229
33- return $ actions ;
34- }, 10 , 2 );
30+ public function plugins_loaded ()
31+ {
32+ if (defined ('TYPEROCKET_PLUGIN_INSTALL ' ) || defined ('TYPEROCKET_PATH ' )) {
33+ add_filter ('plugin_action_links ' , function ($ actions , $ plugin_file ) {
34+ if ( strpos (__FILE__ , $ plugin_file ) ) {
35+ $ actions ['settings ' ] = '<span style="color: red">Inactive Install</span> ' ;
36+ }
3537
36- return ;
37- }
38+ return $ actions ;
39+ }, 10 , 2 );
3840
39- define ( ' TYPEROCKET_PLUGIN_VERSION ' , ' 6.0.0 ' ) ;
40- define ( ' TYPEROCKET_PLUGIN_INSTALL ' , __DIR__ );
41+ return ;
42+ }
4143
42- if (!defined ('TYPEROCKET_ROOT_WP ' ))
43- define ('TYPEROCKET_ROOT_WP ' , ABSPATH );
44+ define ('TYPEROCKET_PLUGIN_VERSION ' , '6.0.0 ' );
45+ define ('TYPEROCKET_PLUGIN_INSTALL ' , __DIR__ );
46+ define ('TYPEROCKET_PLUGIN_PRO ' , false );
4447
45- $ this -> loadConfig ();
46- require ' typerocket/init.php ' ;
48+ if (! defined ( ' TYPEROCKET_ROOT_WP ' ))
49+ define ( ' TYPEROCKET_ROOT_WP ' , ABSPATH ) ;
4750
48- if (typerocket_env ('TYPEROCKET_UPDATES ' , true )) {
49- add_filter ('http_request_host_is_external ' , function ($ value , $ host ) {
50- return $ value || $ host == 'typerocket.com ' ;
51- }, 10 , 2 );
51+ $ this ->loadConfig ();
52+ require 'typerocket/init.php ' ;
5253
53- new \TypeRocket \OpenPlugin \Updater ([
54- 'slug ' => 'typerocket-v6 ' ,
55- 'api_url ' => 'https://typerocket.com/plugins/typerocket-v6/ '
56- ]);
57- }
54+ if (typerocket_env ('TYPEROCKET_UPDATES ' , true )) {
55+ add_filter ('http_request_host_is_external ' , function ($ value , $ host ) {
56+ return $ value || $ host == 'typerocket.com ' ;
57+ }, 10 , 2 );
5858
59- $ this ->path = plugin_dir_path (__FILE__ );
60- define ('TYPEROCKET_AUTO_LOADER ' , '__return_false ' );
61- add_action ('admin_notices ' , [$ this , 'activation_notice ' ]);
62- add_action ('typerocket_loaded ' , [$ this , 'typerocket_loaded ' ]);
63- add_filter ('plugin_action_links ' , [$ this , 'links ' ], 10 , 2 );
64- }, 15 );
59+ new \TypeRocket \OpenPlugin6 \Updater ([
60+ 'slug ' => 'typerocket-v6 ' ,
61+ 'api_url ' => 'https://typerocket.com/plugins/typerocket-v6/ '
62+ ]);
63+ }
6564
66- register_activation_hook ( __FILE__ , [$ this , 'activation ' ]);
65+ $ this ->path = plugin_dir_path (__FILE__ );
66+ define ('TYPEROCKET_AUTO_LOADER ' , '__return_false ' );
67+ add_action ('admin_notices ' , [$ this , 'activation_notice ' ]);
68+ add_action ('typerocket_loaded ' , [$ this , 'typerocket_loaded ' ]);
69+ add_filter ('plugin_action_links ' , [$ this , 'links ' ], 10 , 2 );
6770 }
6871
6972 public function links ($ actions , $ plugin_file )
@@ -132,7 +135,7 @@ public function activation_notice()
132135
133136 public function typerocket_loaded ()
134137 {
135- tr_page ('settings@TypeRocket \\OpenPlugin \\SettingsController ' , 'typerocket ' , __ ('TypeRocket Settings ' ), [
138+ tr_page ('settings@TypeRocket \\OpenPlugin6 \\SettingsController ' , 'typerocket ' , __ ('TypeRocket Settings ' ), [
136139 'menu ' => __ ('TypeRocket ' ),
137140 'capability ' => 'activate_plugins '
138141 ]);
@@ -143,4 +146,4 @@ public function typerocket_loaded()
143146 }
144147}
145148
146- new OpenPlugin ();
149+ new OpenPlugin6 ();
0 commit comments