diff --git a/inc/spbc-tools.php b/inc/spbc-tools.php index 681c5909a..3092b4aa3 100644 --- a/inc/spbc-tools.php +++ b/inc/spbc-tools.php @@ -824,7 +824,13 @@ function spbc_parse_action_from_admin_page_uri($url, $post_id = null) $skip_request = isset($parsed_query['tab']) && $parsed_query['tab'] === 'plugin-information'; if ( isset($parsed_query['plugin']) && !$skip_request ) { if (is_callable('get_plugin_data')) { - $plugin_name = get_plugin_data(WP_PLUGIN_DIR . '/' . $parsed_query['plugin'])['Name']; + $plugin_path = WP_PLUGIN_DIR . '/' . $parsed_query['plugin']; + if (@is_dir($plugin_path) && @is_readable($plugin_path)) { + $plugin_data = get_plugin_data($plugin_path); + if (isset($plugin_data['Name'])) { + $plugin_name = $plugin_data['Name']; + } + } } if (empty($plugin_name)) { $plugin_name = explode('/', $parsed_query['plugin'])[0]; @@ -913,15 +919,8 @@ function spbc_parse_action_from_admin_page_uri($url, $post_id = null) $out['add_time'] = false; break; default: - preg_match_all('/\/wp-admin\/(.+\.php)\?(action=.+?)&/', $url, $matches); - $file = !empty($matches[1]) && !empty($matches[1][0]) ? $matches[1][0] : ''; - $the_action = !empty($matches[2]) && !empty($matches[2][0]) ? $matches[2][0] : ''; - $event = !empty($file) && !empty($the_action) ? $file . '...' . $the_action : 'view'; - // shortening to 16 symbols - $event = strlen($event) > 16 - ? '..' . substr($event, -14, -14) - : $event; - $out['action_event'] = $event; + // removed parsing the actions to unify parsing on the cloud + $out['action_event'] = 'view'; $out['add_time'] = false; } return $out;