PluginProbe
Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity / 3.3.9
Activity Logs, User Activity Tracking, Multisite Activity Log from Logtivity v3.3.9
3.3.9 3.3.8 trunk 1.0 1.1.0 1.10.0 1.11.0 1.11.1 1.12.0 1.13.0 1.14.0 1.15.0 1.16.0 1.17.0 1.17.1 1.18.0 1.19.0 1.2.0 1.20.0 1.20.1 1.3.0 1.3.1 1.4.0 1.5.0 1.6.0 All 67 releases
← All changes | Base/Logtivity_Api.php +14 -2 3.3.8 → 3.3.9 View file →
@@ -129,9 +129,20 @@
129 129 'body' => $body,
130 130 'cookies' => [],
131 131 ];
132 132
133 - // @TODO: Switch to Logtivity_Response class to get standardized responses
133 + /**
134 + * This request must not be cached. It writes a log entry to the API rather
135 + * than reading a cacheable resource, so a cached response would silently
136 + * drop logs. The default path is also non-blocking with a 0.01s timeout,
137 + * so it does not hold up the page load.
138 + *
139 + * Settings check-ins are already rate limited by
140 + * Logtivity_Options::shouldCheckInWithApi(), which gates on the
141 + * logtivity_last_settings_check_in_at option.
142 + *
143 + * @TODO: Switch to Logtivity_Response class to get standardized responses
144 + */
134 145 $response = wp_remote_request($this->getEndpoint($url), $request);
135 146 if ($waitForResponse && $this->notUpdatingWidgetInCustomizer()) {
136 147 // We waited and received a response
137 148 if ($response instanceof WP_Error) {
@@ -203,9 +214,10 @@
203 214 * @return bool
204 215 */
205 216 protected function ready(): bool
206 217 {
207 - return ($this->getApiKey())
218 + return logtivity_url_environment_mismatch() == false
219 + && ($this->getApiKey())
208 220 && logtivity_has_site_url_changed() == false
209 221 && (
210 222 $this->ignoreStatus
211 223 || $this->getOption('logtivity_api_key_check') == 'success'