Support

Account

Home Forums Backend Issues (wp-admin) JS performance issues Reply To: JS performance issues

  • I just finished reading through this thread and am still having a similar problem today as the one this thread describes. The agency I work for has started using flexible content fields to make our designs modular. Each module typically has it’s own flexible content layout. One such layouts uses a repeater to provide the user with column layouts. Each row of the repeater represents a “column” in that layout. Among the options in each row there is a content field that uses a WYSIWYG.

    I noticed page load suffering in a big way the further i got into development. Each time I added a new column layout, each with it’s own set of WYSIWYG Editors, the longer it took to reload/load the page.

    In development I was laying out a design that featured several variations of 1, 2, 3, 4 column layouts. In all there are 39 editors on this page causing a page load time of 18+ seconds. I understand this is an extreme case but this is hardly the only layout where WYSIWYG editors are going to be. After a couple hours debugging I came across an old support forum post suggesting that setting the default tab to “text” on the editor might solve the problem. I dug into the codex and learned that there is a filter for doing exactly that.

    Solution might be a strong word. I definitely saw an improvement. Using this function i was able to reduce the load time by more than 10s. From an average of 18.41s to 8.37s

    //set default tab on WYSIWYG
    //return html for the "Text" tab
    //return tinymce for "Visual" tab
    function tiny_mce_default_tab() {
        return 'html';
    }
    
    add_filter('wp_default_editor', 'tiny_mce_default_tab');

    I hope this will help someone else as frustrated by this issue as I’ve been. If you discover an actual solution to this I would greatly appreciate a reply to this post.

    Love,
    Sean