Bug: SP Page Builder ships with Production Mode disabled by default. Live sites silently run in developer mode, and existing installs need an in-product prompt to fix it - Forum | JoomShaper
Staff replied SP Page Builder Joomla 5 v6.9.1

Bug: SP Page Builder ships with Production Mode disabled by default. Live sites silently run in developer mode, and existing installs need an in-product prompt to fix it

Asked by HalTurner 1 day ago Last activity 18 hours ago

Environment

  • SP Page Builder Pro 6.9.1
  • Joomla 5.4.9, PHP 8.3

The problem

  1. The default is Developer Mode. In administrator/components/com_sppagebuilder/config.xml, the production_mode field is declared with default="0". Any site where nobody explicitly turns it on runs in Developer
    Mode, including production sites.

  2. Developer Mode is the wrong behaviour for live sites. In components/com_sppagebuilder/parser/addon-parser.php, when production_mode is off, the page's generated CSS is added inline to the <head> of every page
    (addStyleDeclaration) instead of being written to a stylesheet file and linked. On our homepage that is about 13 KB of extra HTML per page view. Inline CSS can't be cached by browsers or CDNs, so it is downloaded
    again on every single page view. Your own documentation describes Production Mode as the setting that combines the CSS into one file to improve load time, i.e. what a live site should use.

  3. Nothing tells the site owner. The setting lives in the component options / editor settings, there is no warning when it is off, and changing it in the editor's application settings is not recorded in Joomla's User
    Actions Log. Site owners have no way of knowing their site has been running in Developer Mode, or since when. We only found it while investigating performance.

  4. Related inefficiency in Production Mode. When production_mode is on, the same code calls file_put_contents() on media/com_sppagebuilder/css/<page>.css on every page build, even when the CSS hasn't changed.
    On multi-server or high-traffic sites that is a disk write per uncached page view. Comparing a hash of the new CSS with the existing file before writing would avoid it.

Why changing the default is not enough

Changing default="0" to default="1" only helps new installations. Every existing site that never touched the setting will keep running in Developer Mode indefinitely, because updates preserve the stored component
parameters. The fix has to reach existing customers too.

Requested changes

  1. Make Production Mode the default for new installations (default="1"), or default it to the opposite of Joomla's own debug setting.

  2. Prompt existing users interactively. When an administrator opens SP Page Builder (dashboard or page list) and Production Mode is off, show a clear notice:

    Your site is running SP Page Builder in Developer Mode. This inlines all page CSS into every page and is not recommended for live sites. Switch to Production Mode?

    with two buttons:

    • Switch to Production Mode (one click, saves the setting)
    • Keep Developer Mode (this is a development/staging site)

    Joomla's built-in Post-installation Messages (com_postinstall) would also be a natural way to surface this on the next update for every existing installation.

  3. Re-confirm every 90 days. If the administrator chooses to keep Developer Mode, store the date of that confirmation (e.g. a dev_mode_confirmed_on parameter) and ask again every 90 days. Developer Mode is meant
    to be temporary, and sites often go live, or stay live for years, with it accidentally left on. A periodic re-confirmation keeps the choice deliberate.

  4. Show the current mode at a glance, for example a small "Developer Mode" badge in the SP Page Builder admin header, so it is visible without opening the settings.

  5. Log changes to the setting in Joomla's User Actions Log, so site owners can see when and by whom the mode was changed.

  6. Only rewrite the Production Mode CSS file when its content changes (see point 4 under The problem).

Impact

Every live site running in Developer Mode serves heavier, less cacheable pages on every request, and its owner has no indication anything is wrong. A one-time, periodically re-confirmed prompt would fix this for the whole
existing customer base at almost no cost, without changing anything for sites that genuinely want Developer Mode.

1 reply

Ziaul Kabir Staff

Hi HalTurner,

Thanks for the detailed report. I've passed it to our development team for review, and they will check it.

If you need this sooner, there is a workaround. Switch on Production Mode yourself under SP Page Builder → Options (the component settings), by setting Production Mode to Yes and saving. Your pages will then load their CSS from a cached file and stop inlining it in every page.

Please do this only on live sites. On a development or staging site you may want Developer Mode left on.

Thanks again for the report.

Log in to reply.