[WP Optimization] About Freesoul Deactivate Plugins,

CPANathan

Elite Member
Joined
Jul 9, 2019
Messages
2,858
Reaction score
10,303
I'll be referencing this video here for these questions.


This tool allows you to go to any page, post etc. and disable any plugins that aren't on that page.

zhq4iW6

Using the info gained from this tool here, where should I be looking to find these individual pages source codes to disallow if even remove these plugins' calls to load on each page?

I've spent a good while flicking through my templates file structure to spot these, for instance when you're crafting a front-end via React or Laravel you just need to select your HTML, CSS & jS files and it's all there in front of you...

To put this into perspective, videos from Ahrefs & the same content creator that had created this video mention removing any plugins that aren't being used...

What do I do with this plugin after I'm done with it? Allow it to remain there after the job's done? If I remove this plugin, will it remove any progress it has made? -this being why I'd like to use it as a guide and remove plugins from where they're based.

It's the same idea as asking WPRocket to load your jS after your pages structure has loaded, why can't I just edit the code to load after the pages structure itself?
Or WPRocket minimizing your CSS & jS to reduce file size...

I know someone's going to post "it's for the people that are less technical", just it raises so many questions that I've got to dig through... Oh boy I can feel a new addiction coming along.

I mean too right you could tell me that I'm over-concerned about plugin capacity, that'd be my rookie error... I haven't actually seen to how my current website functions and I'm worried about optimizing it.

RoiBox & Scorpion Ghost are going to get chills down their spines when they figure out how many questions are building up for them...

Informational bullying

Thanks for reading through my rant, doubt anyone's gonna get past line four :cool:
 
I´ve watched a few tutorials of that plugin (including the one you posted) and tested it on different websites but never really experience good results with it and I found the UI complicated.

My 2cc
 
I´ve watched a few tutorials of that plugin (including the one you posted) and tested it on different websites but never really experience good results with it and I found the UI complicated.

My 2cc
I was also informed that it's the type of tool that looks good but will potentially force issues down the line...

I've been told I'm best off looking into how plugins are hooked onto pages.

My thought process was that it was structured in the way jS scripts and CSS stylesheets were in the head section of your static front-ends and that they could just be removed.

I've come to figure out that I should face these issues when I get to them, I don't even know if my page load speed will be an issue yet.

To put this into context, WP plugins load on every page (according to WPTuts) and why would you need Woocommerce plugins loading on a page with no transactional intent -> find pages source code in site folder and remove instances of calling plugins that aren't necessary.

My homepage has 161 lines of scripts, styles and stylesheets before it even starts to load body content

Ty for 2c
 
I was also informed that it's the type of tool that looks good but will potentially force issues down the line...

I've been told I'm best off looking into how plugins are hooked onto pages.

My thought process was that it was structured in the way jS scripts and CSS stylesheets were in the head section of your static front-ends and that they could just be removed.

I've come to figure out that I should face these issues when I get to them, I don't even know if my page load speed will be an issue yet.

To put this into context, WP plugins load on every page (according to WPTuts) and why would you need Woocommerce plugins loading on a page with no transactional intent -> find pages source code in site folder and remove instances of calling plugins that aren't necessary.

My homepage has 161 lines of scripts, styles and stylesheets before it even starts to load body content

Ty for 2c
I have the same philosophy when it comes to optimizing a website´s page loading speed.

I mean, I am not a web developer nor have experience with coding but I´ve researched so much on this topic over the past couple of years I can confident now using the functions.php file to include some rules.

Personally, when it comes to asset management plugins there´s only one plugin on my mind and that is Perfmatters. I am also intrigued with WP Shifty but more in particular with their live preview window which allows you to see the impact of the changes you´re making BEFORE rolling them into the live site, for a non-web developer like me, this is a huge I can prevent breaking things in the process.

Thankfully I contact Brian about this feature and he instantly added it to their development roadmap...

b4859dc5af982514edbb553e4978a391.png


I also use the Perfmatters Remove Unused CSS feature as I am getting better results in comparison to WP Rocket. Also, Perfmatters offers far more options and alternatives as to how to handle the unused portion of the CSS...

eabef107fd6563d00a79f0c04285f7ac.png


Thankfully, since a few versions ago, Perfmatters now handles used CSS portion of the stylesheet as an external stylesheet instead of an inline file so, now, those external files can be actually cached.

Kuddos!
 
I have the same philosophy when it comes to optimizing a website´s page loading speed.

I mean, I am not a web developer nor have experience with coding but I´ve researched so much on this topic over the past couple of years I can confident now using the functions.php file to include some rules.

Personally, when it comes to asset management plugins there´s only one plugin on my mind and that is Perfmatters. I am also intrigued with WP Shifty but more in particular with their live preview window which allows you to see the impact of the changes you´re making BEFORE rolling them into the live site, for a non-web developer like me, this is a huge I can prevent breaking things in the process.

Thankfully I contact Brian about this feature and he instantly added it to their development roadmap...

b4859dc5af982514edbb553e4978a391.png


I also use the Perfmatters Remove Unused CSS feature as I am getting better results in comparison to WP Rocket. Also, Perfmatters offers far more options and alternatives as to how to handle the unused portion of the CSS...

eabef107fd6563d00a79f0c04285f7ac.png


Thankfully, since a few versions ago, Perfmatters now handles used CSS portion of the stylesheet as an external stylesheet instead of an inline file so, now, those external files can be actually cached.

Kuddos!
We have our heading, here we gooo!

Thank you for the direction... I think I'm addicted to WP now...

Hopefully it's not long before I can make more sense of back-end development by sifting through WP structures
 
You're discounting the dynamic nature of WordPress. And this stands true for every dynamically built website.

WordPress has roughly 5000 files in its core. These work together to provide a huge bunch of functionality across your install. This does not limit you to a set of number of posts.

You can have virtually unlimited posts/pages - without having your base file count increase.

The dynamic nature of the script allows you to render certain JS/CSS or run PHP functions. However, the problem occurs, when you build a specific page and the JS/CSS loads across the site.

For instance, a contact form - you have one Contact Us page. But WordPress doesn't know it. And so the CSS for the contact form, the JS for the same will load across the site - even on simple blog pages. Same for a LeadGen form on the homepage.

Or maybe you have a carousel or a design element such as a carousel or a slider for a particular landing page or your homepage, this will load across your site. Since it is called in your header.

Internal Optimization allows you to build lighter pages - without the excess artefacts.

One trade-off for this is your optimization plugin(s) have to stay active.

WordPress does allow you to disable plugins using the unset filter.

Something as simple as below in your functions.php

PHP:
add_filter( ‘option_active_plugins’, ‘disabl_some_plugin’ );
 function disable_some_plugin($plugins){
      if( is_single() ) {
         $key = array_search( ‘plugin-folder/plugin_core_file.php’ , $plugins );
         if ( false !== $key ) unset( $plugins[$key] );
      }
     return $plugins;
 }

The above code will disable your plugin on all individual post pages. You can replace this with is_page() to disable it on all pages - is_front_page() to disable it on the homepage - is_page_template( 'about.php' ) - when you're using a specific Page template, in this case about.php

You can extend this function by using elseif commands for it to disable other plugins.

//

There's a method to the madness. A particular order in which queries are run. The above is a quick fix.

Kinsta has a more elaborate guide on achieving this - https://kinsta.com/blog/disable-wordpress-plugins-loading/
 
You're discounting the dynamic nature of WordPress. And this stands true for every dynamically built website.

WordPress has roughly 5000 files in its core. These work together to provide a huge bunch of functionality across your install. This does not limit you to a set of number of posts.

You can have virtually unlimited posts/pages - without having your base file count increase.

The dynamic nature of the script allows you to render certain JS/CSS or run PHP functions. However, the problem occurs, when you build a specific page and the JS/CSS loads across the site.

For instance, a contact form - you have one Contact Us page. But WordPress doesn't know it. And so the CSS for the contact form, the JS for the same will load across the site - even on simple blog pages. Same for a LeadGen form on the homepage.

Or maybe you have a carousel or a design element such as a carousel or a slider for a particular landing page or your homepage, this will load across your site. Since it is called in your header.
This is exactly what I have been understanding man

I think my awe of what's actually going on, my lack of understanding of what's going on and my interest in how to bring function to it is spinning out my threads and questions

I love the dynamic side of a Laravel development because it's essentially this without the crack cocaine in the sense that in React's case you can choose to import a certain jS/CSS etc. script from a jS/CSS etc. file... It's just that 100 times more readable and editable...

Once I figure these "issues" WP out, I'll be kicking myself and I'm confident I'll have all the more understanding in learning further into PHP... And I'm sure that can only lead to a better understanding of the Laravel I love

Internal Optimization allows you to build lighter pages - without the excess artefacts.

One trade-off for this is your optimization plugin(s) have to stay active.

WordPress does allow you to disable plugins using the unset filter.

Something as simple as below in your functions.php

You can extend this function by using elseif commands for it to disable other plugins.

//

There's a method to the madness. A particular order in which queries are run. The above is a quick fix.

Kinsta has a more elaborate guide on achieving this - https://kinsta.com/blog/disable-wordpress-plugins-loading/
"You can replace this with is_page() to disable it on all pages - is_front_page() to disable it on the homepage - is_page_template( 'about.php' ) - when you're using a specific Page template, in this case about.php"

This is what I'm so intrigued by and was looking for! I was thinking about it so wrong in the sense that I've only studied into, correct me if I'm wrong but object-oriented side of coding; I can't believe I was looking for scripts starting function's locations instead of thinking about denying a scripts function...

Oh my days, this thread is a gold mine... I've got so much to think about
 
Man, this has ironed out my next three years of study by the looks of it thank you both!

I'll get to that Kinsta read when I've got more battery life and it isn't 3AM!

Buzzing

edit: BlogPro's reply was a rollercoaster of emotions for me :D
 
So, there's two ways to achieve things in WordPress or any other programming interface for that matter. The right way, the way it was always meant to be - and every other way.

With so many moving parts, it's so easy to achieve things by doing x instead of y. However, x may not always be the correct way. This doesn't make y stupid - however, it can cause problems down the line.

For instance, if I am to customize my theme - I'll always implement a child theme. If I am looking at customizing something like WooCommerce - I'll create a folder name woocommerce within my theme and copy everything over from the woocommerce/templates/ directory and run everything.

This is upgrade-safe, I can freely upgrade WooCommerce or my theme without risking to lose my customizations.

//

When WordPress came about - things were nice. Themes were meant to be themes. Plugins were meant to be plugins.

Then came along ThemeForest - developers noticed they could use all of the plugin filters within their themes, since they both plugged into the same system.

And so themes became excessively technical. Started coming with a shit ton of dependencies and "required plugins" et al, along with an "options panel".

This wasn't how things were envisioned at all. But it is the reality of today.
 
edit: BlogPro's reply was a rollercoaster of emotions for me :D
For you and me both!

Learning PHP at the moment for the sole purpose of effectively implementing these "hacks" and so relying less on performance plugins like Perfmatters.

Of course, as a user, there´s nothing easier than working with Perfmatters to manage the assets loading on the site and even create rules to make the loading of resources more efficient.
 
I think that Perfmatters and Asset Cleanup lets you finegrain better these things than just a full plugin with a full page (since each plugin may have one or multiple CSS and JS files which generally only 1 of all is the real culprit of the whole issue).

I only use Perfmatters when I have sitewide plugins that for some reason I'm using only in one page.

But finegraining for multiple page use plugin is a headache and not worth the time. I think this is a very niche application regardless the fact that we can technically ultra optimize every single thing in life.

From my experience finegraining too much over the time, leads more into errors than the ones solved, because plugins start to grow and update in unexpected ways to the point they end breaking (unless you have a no-update policy which I personally dislike).
 
Kinsta have some great videos on how to go about BP's function.php ideas for disabling plugins on set pages, WPTuts have some great videos on how to best edit function.php and then Kinsta have more videos on how to edit separate things like pages HTML structure, global CSS files and from there I'm sure I could figure out everything talked about in this thread...

Delighted, really didn't think WP would be this in-depth, thanks all.
 
Back
Top