/** * Display our custom plugin details when the user clicks "view details" * on the plugin listing page. */ function plugin_update_popup() { $slug = sanitize_key($_GET['plugin']); if (!$this->is_plugin($slug)) { return; } $error_msg = '<p>' . __('Could not retrieve version details. Please try again.', 'as3cf-pro') . '</p>'; $filename = $slug; $latest_version = $this->get_latest_version($slug); if (false === $latest_version) { echo $error_msg; exit; } if ($this->is_beta_version($latest_version)) { $filename .= '-beta'; } $url = $this->licences->api_base . '/content/themes/delicious-brains/update-popup/' . $filename . '.html'; $data = $this->licences->get($url); if (is_wp_error($data) || 200 != $data['response']['code']) { echo $error_msg; } else { echo $data['body']; } exit; }