• Resolved cjyabraham

    (@cjyabraham)


    Hi,
    This plugin is great and light on the front-end but it seems to slow down my wp-admin by about 50%. I’ve gone from about a 1s load time to 1.5s, 420KB to 905KB. It’s going to be hard justifying that extended load time just for this plugin. Any thoughts on how to speed this up?

    Thanks,
    Chris

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    When you say “wp-admin”, which screen do you mean?

    I am not seeing anything in Photonic that adds 485 KB to page load size, be it in the front-end or the back-end. Size-wise this is what Photonic adds in the worst performance scenario:

    1. A linked CSS file, admin-form.css – 1KB
    2. A linked JS file if you are using the Classic Editor in “Visual” mode (i.e. the TinyMCE Editor), gallery-settings.js – 3KB
    3. A linked CSS file if you are using Gutenberg, admin-block.css – 1KB
    4. A linked JS file if you are using Gutenberg, block.js – 5KB
    5. A JavaScript template (printed as script type="text/html") that is used by the Classic Editor – adds 49KB to the markup. This is standard practice for anything interacting with the editor.

    Even if you insert a gallery nothing additional gets added to the back-end, plus there literally is nothing that adds any additional data (no scripts or markup are added). All of this is added exclusively on the editing screen, and no other screen. There are no heavy graphics either anywhere.

    What is it specifically that you are seeing that adds 485KB and where?

    Thread Starter cjyabraham

    (@cjyabraham)

    Thanks for the reply. I was doing a speed test using this url:
    https://lfeventsci.lndo.site/wp/wp-admin/edit.php?post_type=page

    Here are the extra assets that get downloaded when I have Protonic activated as opposed to when I don’t:
    https://docs.google.com/spreadsheets/d/1ahSvV1v1NPl1Z53V07c2BJZBLCigkZOwhRCtMfEiUQ8/edit?usp=sharing

    Admittedly, a lot of these extra assets are not from Protonic, but having Protonic active somehow causes them to be downloaded. This doesn’t appear to happen for other Flickr plugins I’ve tried.

    It’d be nice to figure this out or if I’m doing something wrong as I do really like your plugin.

    FYI, I’m running WP 5.1.1 with Gutenberg enabled.

    Plugin Author Sayontan Sinha

    (@sayontan)

    I guess you first need to analyze what it is that Photonic is doing differently.

    To the best of my knowledge other galleries for Flickr follow a two-step process:

    1. Define a set of shortcodes on a different admin screen
    2. Embed one of the shortcodes in your post / page (typically by copy-paste, or by

    Photonic lets you combine both of the above so that you don’t have to switch back and forth between screens. In this process Photonic piggybacks on the standard gallery functionality from WP and has to add less stuff on its own.

    Now, I took a look at the list you provided and I am not sure how you are drawing the inference that Photonic is exclusively causing these to be downloaded. I have analyzed each one individually using TwentyTen and no other plugins. I deliberately used TwentyTen because it has pretty much no frills and would hence not add anything extra to the admin screens:

    • Photonic-20-gr.png – This is the icon that shows up in the menu item on the left; it will be loaded on all admin screens if you have Photonic active. I seriously doubt this is slowing down anything (it is < 1KB)
    • underscore.min.js?ver=1.8.3 – Loads with a vanilla install of WP with no other plugins activated
    • backbone.min.js?ver=1.2.3 – Loads with a vanilla install of WP with no other plugins activated
    • wp-util.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • wp-backbone.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • media-models.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • moxie.min.js?ver=1.3.5 – Loads with a vanilla install of WP with no other plugins activated
    • plupload.min.js?ver=2.1.9 – Loads with a vanilla install of WP with no other plugins activated
    • wp-plupload.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • mouse.min.js?ver=1.11.4 – Loads with a vanilla install of WP with no other plugins activated
    • sortable.min.js?ver=1.11.4 – Loads with a vanilla install of WP with no other plugins activated
    • mediaelement-and-player.min.js?ver=4.2.6-78496d1 – Loads with a vanilla install of WP with no other plugins activated
    • mediaelement-migrate.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • wp-mediaelement.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • api-request.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • media-views.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • thickbox.js?ver=3.1-20121105 – Loads with a vanilla install of WP with no other plugins activated
    • shortcode.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • media-upload.min.js?ver=5.1.1 – Loads with a vanilla install of WP with no other plugins activated
    • gallery-settings.js?ver=20190116-235652 – This is pretty much the only Photonic-specific file (I have written about this in my previous post). Mind you, this only shows up if you are using the Classic Editor, not Gutenberg – can you confirm if you are seeing this on a Gutenberg screen?
    • data:image/gif;base… – Loads with a vanilla install of WP with no other plugins activated
    • loadingAnimation.gif – Loads with a vanilla install of WP with no other plugins activated

    With the exception of the menu icon and gallery-settings.js almost all the items above get loaded due to WP’s native media manager, so there seems to be a problem with your analysis. Are you using a plugin to block out WP’s native galleries? Because there is no other way that Photonic would “add” these scripts to your site; every WP installation will have the scripts active by default.

    Thread Starter cjyabraham

    (@cjyabraham)

    I see. Thanks for your explanation. I did a test to try and replicate what you are describing.

    First I deactivated all plugins and installed and activated the twentyten theme. When I load https://lfeventsci.lndo.site/wp/wp-admin/edit.php?post_type=page I get the following: 15 requests, 420KB downloaded. No media files are downloaded and no, I’m not doing anything to repress them.

    Then when I activate Photonic, indeed all the media files start to get downloaded and I get: 39 requests, 905KB downloaded.

    It’s a shame since none of those Media files are required for that particular url So, for whatever reason, the performance cost of running this plugin seems quite high. Is it possible to not download any Photonic scripts until you actually need them? Perhaps these scripts have the media files as a dependency?

    Plugin Author Sayontan Sinha

    (@sayontan)

    I misread your previous link and the information I provided is for the Edit screen (for any type of post), not for the screen that lists the posts / pages. I will take a look at this.

    Thread Starter cjyabraham

    (@cjyabraham)

    Great thanks. Incidentally, I just tried installing this plugin as a comparison: https://ww.wp.xz.cn/plugins/wp-flickr-gallery/ and it doesn’t add any files to the download when I go here: https://lfeventsci.lndo.site/wp/wp-admin/edit.php?post_type=page.

    Plugin Author Sayontan Sinha

    (@sayontan)

    Do a couple of things:

    1. First ensure that you have the latest version of Photonic
    2. Next, go to Photonic → Settings → Generic Options → Generic Settings → Disable shortcode editing in Visual Editor and select this option. Since you are using Gutenberg you will be fine with this selection.
    Thread Starter cjyabraham

    (@cjyabraham)

    Looks like that solved the issue. Thanks!

    Thread Starter cjyabraham

    (@cjyabraham)

    resolved

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Slows admin experience’ is closed to new replies.