wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
664 stars 142 forks source link

Deferred loading of shortcode list, syntax and selection lists #124

Open bobbingwide opened 9 years ago

bobbingwide commented 9 years ago

In the current implementation, whenever you edit a post, shortcake builds a large JSON structure containing information about all the active shortcodes.

In my development environment I can have over 170 of my own shortcodes. Some themes deliver shed loads, so does Jetpack, WooCommerce and Easy-Digital-Downloads.

Many of my shortcodes have lots of parameters. Any many of the parameters have multiple values, ideal for select lists.

The shortcodeUIData structure I'm currently working with contains the syntax definition for just over 100 shortcodes and is nearly 64K.

If I never use a shortcode, or perhaps only use 5 or 6 in each post, then the system's done an awful lot of unnecessary work.

I propose that the code is changed to perform lazy loading of

  1. The shortcode list.
  2. The parameters for the selected shortcode
  3. Select lists with dynamic items.

The underlying architecture should allow for efficient collection of the data to be displayed.

danielbachhuber commented 9 years ago

Interesting idea. We'll keep this in mind as we go forward.

pbowyer commented 9 years ago

This would be great - playing around with the plugin I was surprised that changing my ui registration code didn't affect the modal window unless I refreshed the entire page. It'd be really good to load them on-demand.