Skip to content

Commit bbcb92d

Browse files
committed
Unify the SQLite setup screen
Combine installation requirements, database location guidance, and the install action in one panel. Clarify that switching does not copy the existing content, while preserving installation guards and Query Monitor support.
1 parent c15cf75 commit bbcb92d

7 files changed

Lines changed: 339 additions & 168 deletions

File tree

‎packages/plugin-sqlite-database-integration/activate.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ function sqlite_activation() {
4646

4747
check_admin_referer( 'sqlite-install' );
4848

49+
/*
50+
* The drop-in would fail every request with an invalid database location.
51+
* A stale install link can skip the check on the settings screen, so return
52+
* there to show the error.
53+
*/
54+
if ( 'unknown' === sqlite_plugin_get_database_location_status() ) {
55+
wp_safe_redirect( sqlite_plugin_get_admin_page_url() );
56+
exit;
57+
}
58+
4959
sqlite_plugin_copy_db_file();
5060

5161
// WordPress will automatically redirect to the install screen here.

‎packages/plugin-sqlite-database-integration/admin-page.css‎

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
color: #008a20;
8181
}
8282

83+
.sqlite-integration .sqlite-error {
84+
color: #d63638;
85+
}
86+
8387
.sqlite-integration .sqlite-box,
8488
.sqlite-integration .sqlite-help {
8589
background: #fff;
@@ -123,6 +127,10 @@
123127
margin: 0;
124128
}
125129

130+
.sqlite-integration .sqlite-setup-header p {
131+
margin: 8px 0 0;
132+
}
133+
126134
.sqlite-integration .sqlite-data p {
127135
margin: 0 0 10px;
128136
}
@@ -248,8 +256,48 @@
248256
cursor: pointer;
249257
}
250258

251-
.sqlite-integration .sqlite-installation .notice {
252-
margin-inline: 0;
259+
.sqlite-integration .sqlite-setup-header {
260+
padding: 20px;
261+
border-bottom: 1px solid #c3c4c7;
262+
}
263+
264+
.sqlite-integration .sqlite-setup-heading {
265+
display: flex;
266+
flex-wrap: wrap;
267+
align-items: center;
268+
justify-content: space-between;
269+
gap: 12px;
270+
}
271+
272+
.sqlite-integration .sqlite-setup-heading h2 {
273+
margin: 0;
274+
font-size: 16px;
275+
line-height: 1.5;
276+
}
277+
278+
.sqlite-integration .sqlite-inactive {
279+
color: #50575e;
280+
}
281+
282+
.sqlite-integration .sqlite-inactive .sqlite-status-dot {
283+
background: #787c82;
284+
}
285+
286+
.sqlite-integration .sqlite-setup-next {
287+
padding: 20px;
288+
border-top: 1px solid #c3c4c7;
289+
}
290+
291+
.sqlite-integration .sqlite-setup-next h3 {
292+
margin-top: 0;
293+
}
294+
295+
.sqlite-integration .sqlite-setup-actions {
296+
display: flex;
297+
flex-wrap: wrap;
298+
align-items: center;
299+
gap: 12px;
300+
margin-top: 20px;
253301
}
254302

255303
@media (pointer: coarse) {

0 commit comments

Comments
 (0)