[wp-trac] [WordPress Trac] #33898: Reduce Customizer peak memory usage by JSON-encoding settings and controls separately

WordPress Trac noreply at wordpress.org
Wed Sep 16 21:38:03 UTC 2015


#33898: Reduce Customizer peak memory usage by JSON-encoding settings and controls
separately
----------------------------------------+--------------------------
 Reporter:  westonruter                 |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  4.4
Component:  Customize                   |     Version:  3.4
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  performance
----------------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch => has-patch needs-unit-tests


Comment:

 In [attachment:33898.2.diff]:

 Serialize settings individually in Preview to avoid memory peak spike.

 Move logic from `customize.php` to `WP_Customize_Manager` class.

  * Move logic for exporting JS to Customizer pane to
 `customize_pane_settings()` method, to correspond to
 `customize_preview_settings()`.
  * Move logic for setting preview url, return url, and autofocus
  * Move iOS detection to helper method.
  * Create `get_document_title_template` method instead of global variable.
  * Use `wp_json_encode()` for outputting `ajaxurl`.
  * Move rendering of templates and outputting of settings to
 `customize_controls_print_footer_scripts` action.

 What's remaining are unit tests for these new methods, the logic for which
 was previously not testable since it was inline to the `customize.php`
 template code.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33898#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list