Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend oik-loader to work like oik-unloader but in reverse #13

Open
bobbingwide opened this issue Feb 15, 2022 · 2 comments
Open

Extend oik-loader to work like oik-unloader but in reverse #13

bobbingwide opened this issue Feb 15, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Feb 15, 2022

On cwiccer.com, I'm preparing a presentation for the WordPress Portsmouth Meetup on Performance.
Trouble is, with so many poor performing plugins activated, the system's really slow to edit.
How easy would it be to change the code to operate like oik-unloader, but in reverse?

It needs to be able to activate plugins for a particular URL.

Can we use the oik-loader-extras.csv file to achieve this?
Or do we need to use the post meta data the same as in wp-a2z?

@bobbingwide bobbingwide added the enhancement New feature or request label Feb 15, 2022
@bobbingwide bobbingwide self-assigned this Feb 15, 2022
@bobbingwide
Copy link
Owner Author

bobbingwide commented Feb 15, 2022

Can we use the oik-loader-extras.csv file to achieve this?

Yes. I tested it in s.b/cwiccer with two URLs: /cwiccer/process/elementor/ and /cwiccer/process/

I copied the extras ( oik-loader-extras.csv ) file from s.b/wp-a2z

/wp-json/wp/v2/download_category,0,edd-blocks/edd-blocks.php,easy-digital-downloads/easy-digital-downloads.php
/wp-json/wp/v2/download_tag,0,edd-blocks/edd-blocks.php,easy-digital-downloads/easy-digital-downloads.php
edd-api=products,0,edd-blocks/edd-blocks.php

and added two new lines

/cwiccer/process/elementor/,2332,nextgen-gallery/nggallery.php,oik-magnetic-poetry/oik-magnetic-poetry.php
/cwiccer/process/,2330,oik-magnetic-poetry/oik-magnetic-poetry.php,hello-dolly/hello.php,cwiccer/cwiccer.php

elementor's dependent upon NextGEN Gallery and Magnetic Poetry
process is dependent upon Magnetic Poetry and Hello Dolly

In order to activate the changed extras file visit oik options > oik loader and choose Click to rebuild index.
This will append the extras file to the loader file ( oik-loader.1.csv )

Completing the post ID's enables the plugins in the block editor as well.

A quick fix for cwiccer.com is needed to enable editing of the extras file in the oik-loader page.

@bobbingwide
Copy link
Owner Author

A similar problem happened with oik-loader as with oik-unloader. NextGEN Gallery updated the active_plugins entry at shutdown. So, when I visited a page where NextGEN Gallery was dynamically loaded then all the other plugins were activated as well.

Need to remove the filters some time on / after plugins_loaded and before shutdown.

See bobbingwide/oik-unloader#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant