• Resolved thisuserid

    (@thisuserid)


    Hello,
    I really like the plugin for it’s function, thanks a bunch.

    But I do have a problem: I have all the styles and scripts the dashboard needs in the front-end, when the plugin is activated. I turn it of, everything’s normal.
    I tested it with a second browser window in private mode, where I’m certainly not logged in.
    Do you know this issue and what to do to avoid this misbehavior?

    Thanks a lot,
    Clemens

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi Clemens! I’m really glad you like the plugin.

    I’m not sure I quite understand your problem. Why have you included the dashboard scripts and styles in the front-end? ??

    Thread Starter thisuserid

    (@thisuserid)

    Thank you Fabian for your reply.
    My message was a little bit confusing, I agree :). When the Advanced Forms Plugin is activated, anytime I visit the frontend, the frontend loads all the scripts and styles which are usually only loaded when I visit the backend.
    Or in other words, as soon as I activate the AF Plugin, the frontend loads unnecessary styles and scripts, which the backend needs, but not the frontend.

    The only thing I included though is a custom admin.css stylesheet for the backend, to customize the design for the client’s dashboard. Therefore I added some lines of code in the functions.php to load this style sheet.

    Do you think it has something to do with it? I will try.

    Thread Starter thisuserid

    (@thisuserid)

    Hi Fabian,
    short update on this topic. First problem I found, I use AF for a newsletter field in the footer on every page. I saw the core-forms.php of this plug-in enques all acf scripts with acf_enqueue_scripts(); on line 115.
    When I disable this line, everything is nice and tidy again, no bloated code.

    Because I have several ACF Addons installed, I have many scripts to load there.
    Too bad, cause I enqueue the scripts with every page load, not just on one contact form page.
    Can you think of any solution for that? I’d be very happy if I could slim down the traffic.

    • This reply was modified 8 years ago by thisuserid.
    Plugin Author fabianlindfors

    (@fabianlindfors)

    Good catch!

    It’s true that my plugin always includes the ACF scripts which is quite unnecessary and wasteful. I’m going to look into this and hopefully optimize, keep an eye out!

    Thanks a lot for pointing this out. ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Admin Styles and Scripts loaded on Front-End’ is closed to new replies.