- Timestamp:
- 10/27/2026 04:27:21 AM (10 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
softminal-cache/trunk/app/Http/Controllers/CacheController.php
r3763679 r3767725 3 3 namespace SoftminalCache\App\Http\Controllers; 4 4 5 use SoftminalCache\App\Admin\ReviewAsk; 5 6 use SoftminalCache\App\Cache\Config; 6 7 use SoftminalCache\App\Cache\ConfigFile; … … 17 18 use SoftminalCache\App\Check\SelfCheck; 18 19 use SoftminalCache\App\Core\Compat; 20 use SoftminalCache\App\Edge\Edge; 19 21 use SoftminalCache\App\Preload\HostLimits; 20 22 use SoftminalCache\App\Preload\Preloader; … … 27 29 use SoftminalCache\App\Images\Stats as ImageStats; 28 30 use SoftminalCache\App\Modules\Bloat; 31 use SoftminalCache\App\Modules\Cdn; 32 use SoftminalCache\App\Modules\CdnCheck; 29 33 use SoftminalCache\App\Modules\Images; 30 34 use SoftminalCache\App\Modules\Js; … … 230 234 231 235 return $this->success($this->payload(), __('Cache cleared.', 'softminal-cache')); 236 } 237 238 /** The review card: "later" asks again in two weeks, "done" never again. */ 239 public function review(\WP_REST_Request $request): \WP_REST_Response 240 { 241 $data = $this->validated($request, ['answer' => 'required|in:later,done']); 242 ReviewAsk::answer(get_current_user_id(), $data['answer'] === 'done' ? 'done' : 'later'); 243 244 return $this->success(ReviewAsk::status(get_current_user_id())); 245 } 246 247 /** Fetch one core file through a CDN address, to check its origin before it is used. */ 248 public function cdnTest(\WP_REST_Request $request): \WP_REST_Response 249 { 250 $data = $this->validated($request, ['url' => 'required|string|max:200']); 251 252 return $this->success(CdnCheck::run((string) $data['url'])); 232 253 } 233 254 … … 284 305 'bloat' => ['overlap' => Compat::overlaps('bloat'), 'heartbeat' => Bloat::HEARTBEAT, 'revisions' => Bloat::REVISIONS], 285 306 'css' => ['overlap' => Compat::overlaps('css')], 307 'html' => ['overlap' => Compat::overlaps('html')], 308 'cdn' => ['overlap' => Compat::overlaps('cdn'), 'hosts' => Config::hosts(), 'types' => array_keys(Cdn::TYPES), 'max' => Cdn::MAX_URLS], 286 309 'script-manager' => ['overlap' => Compat::overlaps('script-manager'), 'seen' => Seen::all(), 'protected' => ScriptRules::PROTECTED, 'homeUrl' => home_url('/'), 'maxPages' => ScriptRules::MAX_PAGES], 287 310 'fonts' => ['overlap' => Compat::overlaps('fonts')] + GoogleFonts::status(), … … 296 319 'lastPurge' => isset($state['last_purge']) ? (int) $state['last_purge'] : null, 297 320 'safeMode' => ['on' => SafeMode::active(), 'source' => SafeMode::source()], 321 'review' => ReviewAsk::status(get_current_user_id()), 322 'edge' => Edge::status() + ['overlaps' => ['cloudflare' => Compat::overlaps('cloudflare'), 'varnish' => Compat::overlaps('varnish')]], 298 323 'compat' => Compat::summary() + ['moduleErrors' => Modules::errors()], 299 324 'undo' => $this->undoPayload(),
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)