File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,19 @@ public function enqueue_script() {
7575 return ;
7676 }
7777
78+ $ is_installed = self ::is_plugin_installed ();
79+
80+ // Prevent exposing Cimo plugin status and action URLs to users lacking the necessary install or activate plugin capabilities.
81+ if ( ( ! $ is_installed && ! current_user_can ( 'install_plugins ' ) ) ||
82+ ( $ is_installed && ! current_user_can ( 'activate_plugins ' ) )
83+ ) {
84+ return ;
85+ }
86+
7887 $ cimo_status = 'activated ' ;
7988 $ cimo_action = '' ;
8089
81- if ( ! self :: is_plugin_installed () ) {
90+ if ( ! $ is_installed ) {
8291 $ cimo_status = 'not_installed ' ;
8392 $ cimo_action = wp_nonce_url (
8493 add_query_arg (
@@ -104,6 +113,11 @@ public function enqueue_script() {
104113 );
105114 }
106115
116+ // No need to expose plugin status and action URL if it's activated.
117+ if ( $ cimo_status === 'activated ' ) {
118+ return ;
119+ }
120+
107121 $ data = array (
108122 'status ' => $ cimo_status ,
109123 'action ' => html_entity_decode ( $ cimo_action ),
You can’t perform that action at this time.
0 commit comments