Make WordPress Core

Opened 7 years ago

Last modified 5 years ago

#39537 new enhancement

When switching themes, set previous theme mods as autoload = no

Reported by: igmoweb's profile igmoweb Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Themes Keywords:
Focuses: performance Cc:

Description

When a theme is switched, previous theme mods are yet autoloaded. This will start filling up the autoloaded options list if you change of Theme often. Normally this won't happen often but we had an issue like this in a big multisite where a user had many sites and he switched themes many times and PHP got out of memory when loading the user in wp-admin.

In any case, it's a good idea to:

  • Set autoload = no for previous theme mods
  • Set autoload = yes again for the new switched theme

Attachments (2)

39537.diff (1.3 KB) - added by igmoweb 7 years ago.
Patch
39537-unit-tests.diff (3.1 KB) - added by igmoweb 7 years ago.
Unit Tests

Download all attachments as: .zip

Change History (3)

@igmoweb
7 years ago

Patch

@igmoweb
7 years ago

Unit Tests

This ticket was mentioned in Slack in #themereview by williampatton. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.