Codeinwp / Codeinwp/wp-maintenance-mode

Activating LightStart corrupts `show_on_front` option, breaking `front-page.php` template loading

Open
#564 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

customer report
Dominant language
PHP
Stars
163
Forks
82
Avg merge
8h 31m
Merged PRs (30d)
8

Description

When LightStart is activated (or maintenance mode is enabled and later disabled), the show_on_front option in wp_options is changed from posts to page, but page_on_front remains 0. This puts WordPress into a broken in-between state where front-page.php no longer loads, and the homepage falls through to index.php showing unstyled posts.

The issue persists after:

  • Disabling maintenance mode
  • Deactivating the plugin
  • Rolling back to a previous plugin version
  • Clearing browser cache / testing logged-out

Steps to reproduce

  1. Set up a WordPress site with a theme that uses a front-page.php template.
  2. Go to Settings → Reading and set the homepage display to "Your latest posts".
  3. Confirm the homepage loads correctly via front-page.php.
  4. Install and activate LightStart.
  5. Enable maintenance mode
  6. Do some normal work (edit a post or two).
  7. Then disable it.
  8. Visit the homepage.
    Expected: Homepage renders using front-page.php.
    Actual: Homepage shows unstyled posts via index.php.

Root cause

Querying the database confirms the corruption:

SELECT option_name, option_value FROM wp_options
WHERE option_name IN ('show_on_front', 'page_on_front');
option_name option_value
show_on_front page
page_on_front 0

show_on_front has been flipped to page, but no page is assigned (page_on_front = 0). WordPress then evaluates is_home() as true but is_front_page() as false, so the template hierarchy skips front-page.php entirely and falls through to index.php.

The likely cause is that LightStart's maintenance-mode logic sets show_on_front to page (to serve its own landing page) but does not restore the original value on deactivation or when maintenance mode is toggled off.

Workaround

Running this query restores the homepage:

UPDATE wp_options SET option_value = 'posts' WHERE option_name = 'show_on_front';

https://wordpress.org/support/topic/lightstart-activation-preventing-front-page-php-from-loading/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the maintenance-mode activation and toggle flow described in the issue, focusing on where it changes the WordPress show_on_front and page_on_front options. Reproduce the state using the listed Settings → Reading steps and inspect the homepage template behavior; done means disabling maintenance mode preserves the original option values and front-page.php loads again.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.