Skip to content

Add method/action/filter to initialize fields #22

@tripflex

Description

@tripflex

While I know this may not be a huge issue, currently the way addons work, I have to add my fields on every page load through the addon. As we all know with how over-saturated the plugin ecosystem is, users end up having a very large number of plugins activated on their site, eating up memory and adding load time, when a lot of the time it may not be necessary.

Would be nice if there way some way to either call a specific method, action, or filter, to trigger only when $this->fields in the RapidAddon are actually required (as to not have to constantly initialize the fields).

Reason being is in my addon i'm working on, I am dynamically creating the fields that are shown based on existing posts, configurations, etc ... which results in multiple WP_Query calls, option calls, etc

While I know this doesn't add any major load time to a site, most users will end up leaving WP All Import and my addon enabled on their site ... even after they are done importing.

Just wondering what your thoughts are on this? I know I could cache them in a transient or what not, but figure that shouldn't be necessary if we can figure out a way to initialize fields only when they are required

Was thinking maybe in the meantime could just check if user is admin, or on admin area page ... but haven't tried it out yet. Maybe i'm over analyzing it, but being a net/sys admin for so many years i've seen how many user's sites become so slow ... really just due to plugins running code that is not necessary, so I always try to minimize anytime that my codebase is ran

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions