Skip to content

Commit 10023f8

Browse files
committed
Merge branch 'dashboard-v3/onboard-fixing' of https://github.com/shakee93/autoptimize-unusedcss into dashboard-v3/onboard-fixing
2 parents 8753436 + 5343afb commit 10023f8

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

includes/admin/page-optimizer/src/app/page-optimizer/spaces/Optimizations.tsx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,12 @@ const Optimizations = ({ }) => {
174174
setLoadingText('Collecting active plugins...')
175175
const api = new ApiService(options);
176176
const plugins = await api.getActivePlugins();
177-
const server_data = await api.post('titan_checklist_cron');
177+
const server_data = await api.post('rapidload_server_info');
178+
178179

179180
const _diagnostics = Object.entries(diagnostics).map(([key, value]) => value)
180181
// console.log(_diagnostics)
181182

182-
console.log(serverDetails)
183-
184183
const input = {
185184
settings: settings.map(({ status, ...rest }) => ({
186185
...rest,
@@ -215,7 +214,15 @@ const Optimizations = ({ }) => {
215214
real_user_diagnostics: _diagnostics.find((d: any) => d.name === s.name),
216215
value: s.name === "Cache Policy" ? "one_time_action" : (s.inputs[0]?.value || false)
217216
})).filter((s: any) => s.settings_diagnostics || s.real_user_diagnostics),
218-
server_details: server_data
217+
server_details: server_data.data ? {
218+
...server_data.data,
219+
headers: {
220+
...server_data.data.headers,
221+
'x-cache-handler': undefined,
222+
'x-cache-status': undefined,
223+
server: undefined,
224+
}
225+
} : null,
219226
}
220227

221228
setLoadingText('Hermes AI is analyzing your page...')
@@ -443,7 +450,7 @@ const Optimizations = ({ }) => {
443450
setPageSpeedProgress(prev => Math.min(prev + 5, 90));
444451
}, 2000);
445452

446-
await dispatch(fetchReport(options, headerUrl ? headerUrl : options.optimizer_url, true));
453+
// await dispatch(fetchReport(options, headerUrl ? headerUrl : options.optimizer_url, true));
447454

448455
clearInterval(progressInterval);
449456
setPageSpeedProgress(100);
@@ -491,7 +498,7 @@ const Optimizations = ({ }) => {
491498
transition={{ duration: 0.2, delay: 0.05 }}
492499
className='bg-[#F0F0F1] dark:bg-brand-800'
493500
>
494-
501+
495502

496503
<div className='px-6 py-6 bg-white rounded-3xl'>
497504
<div className="flex gap-4 w-full items-start">
@@ -605,8 +612,8 @@ const Optimizations = ({ }) => {
605612
</button>
606613
</div>
607614
<iframe
608-
// src={showIframe ? `${optimizerUrl}/?rapidload_preview` : ''}
609-
src={showIframe ? 'http://rapidload.local/?rapidload_preview' : ''}
615+
// src={showIframe ? `${optimizerUrl}/?rapidload_preview` : ''}
616+
src={showIframe ? 'http://rapidload.local/?rapidload_preview' : ''}
610617
className="w-full h-[600px] border-0"
611618
title="Optimization Test"
612619
/>

includes/modules/optimizer/RapidLoad_Optimizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function rapidload_server_info(){
141141
$response['constants']['WP_CRON_LOCK_TIMEOUT'] = defined('WP_CRON_LOCK_TIMEOUT') ? WP_CRON_LOCK_TIMEOUT : false;
142142

143143
$response['server'] = array(
144-
'software' => $_SERVER['SERVER_SOFTWARE'],
144+
'server_software' => $_SERVER['SERVER_SOFTWARE'],
145145
'php_version' => PHP_VERSION,
146146
);
147147

0 commit comments

Comments
 (0)