Documentation Gonzales Performance Wordpress Plugin
Documentation Gonzales Performance Wordpress Plugin
Thank you for purchasing Gonzales. If you have any questions that are beyond the scope of this help file,
please feel free to contact me using
following form.
If you need my help with installation or plugin
customization, use this form too. Thank you!
About Gonzales
This plugin allows you to get rid of CSS and JavaScript files that are useless for certain pages of your
site. Additionally you can also conditionally disable plugins.
In other words:
● Disable CSS/JS and your customers will download less KB
● Disable plugins and your website will generate document faster, and server will consume less
RAM
Installing
Please note that this plugin can be purchased only via my website. Let me know if you have this package
from other sources.
Installing by WP plugin installer
1. Extract the zip file that you've downloaded from
https://gonzalesplugin.com/ .
2. Go to “Plugins” > “Add New” page in your back-end.
3. Click on the “Upload Plugin” button on the top.
4. Click on “Choose File” and select gonzales.zip file. then press the “Install Now” button.
5. Now you should see "Gonzales" in plugins list. Click on the Activate Plugin to start
journey with site optimization.
Installing by FTP
To install using FTP you’ll need FTP client. There is plenty of them but I prefer to use FileZilla.
1. Extract the zip file which you've downloaded from https://gonzalesplugin.com/ .
2. Open extracted folder and extract gonzales.zip file
3. Once you extract you should see "gonzales" folder.
4. Connect to your server and change directory to to /wp-content/plugins/.
5. Upload “gonzales” folder which extracted.
6. Login to your WordPress back-end and go to the “Plugins” page.
7. Click the “Activate” below Gonzales.
Please note that Gonzales contain MU (Must Use) plugin which will automatically install when you
activate main plugin. In your server doesn’t allow to place new plugin into /wp-content/mu-plugins (or
other place defined as MU directory) please copy MU plugin manually from
/wp-content/gonzales/mu-plugins.
“Gonzales MU” is required to collect and modify list of plugins on initial stage of WordPress loading.
Upgrade
If you already use older version of Gonzales all you have to do is to:
1. Click “Deactivate”
2. Click “Delete”
3. Upload new version
4. Activate
If you used Gonzales 2.x old configuration will be automatically imported to new version.
Using
It doesn’t take a genius to use Gonzales. Login to your WordPress as administrator and go to your home
page. If plugin is correctly activated you should see new item called “Gonzales” in the top admin bar.
That’s it, no hidden settings pages or other complicated way to reach it. Gonzales menu item is clickable.
Once you do it you should see something like that:
Positions on the list present all registered JavaScript and CSS files grouped by plugins. Each group
consist of two parts: plugin informations and plugin assets.
● “Loaded” - shows current state of plugin. Green background and “Yes” label indicates that plugin
is loaded correctly. Otherwise red label with “No” will be visible. It’s important indicator especially
when you use “Disable” option mixed with “Regex” filter. Even though state is set to “Disable” you
can briefly get know whether regex rule has been applied or not on current page,
● “Plugin info” - contains plugin name, version and author. It’s first column you should look at when
you want to disable assets,
● “State” - Destination state of plugin. If you select “Disable” additional conditions will appear on
screen:
● “Loaded” - shows current state of asset. Green background and “Yes” label indicates that CSS or
JS is loaded by browser. Otherwise red label with “No” will be visible.
● “Asset info” - contains asset name, WordPress handle, and list of required and dependent assets.
Last two informations will definitely allow you to make right decision whether you should disabled
certain asset or not (asset does not rely on the other ones)
● “Size” - file weight in KB before gzip compression (file size on storage)
● “State” - Destination state of asset. If you select “Disable” additional conditions will appear on
screen:
Having knowledge where certain plugins should work, we can remove their CSS/JS from places where
they are not really acting or simply disable plugin using regex rule. Let’s assume we want to leave contact
form only for /contact-us page. To do it, open /contact-us page and click on the Gonzales menu item. Find
contact plugin. You can use Cmd+F/Ctrl+F to search “contact” phrase:
In this case there are 2 interesting assets in plugin called “CONTACT FORM 7”. One of them is JS,
second one is CSS file. We want to enable contact form only on /contact-us page so everywhere else it
should be inactive. It means you can do it in two ways:
● Assets variant: set state of “styles.css” and “scripts.js” to “Disable” -> “Everywhere” with “Current
URL” exception
● Plugin variant: set state of “CONTACT FORM 7” to “Disable” -> “Everywhere” with “Current URL”
exception
For documentation purposes I used plugin deactivation method. Scroll down page and click “Save
changes button”. Website will reload. Once open Gonzales you’ll notice that “CONTACT FORM 7” plugin
is marked green and that’s great.
Now visit other page, e.g. home page and open Gonzales. You’ll see that plugin is marked red and assets
are not loaded on the list (plugin automatically didn’t allow to load them):
Pro and con:
● If you use assets variant, plugin still use CPU cycles and use extra memory to generate Contact
functionalities on each page
● CSS/JS deactivation is more safer because in case of plugins variant you must have 100% sure
that Contact functionalities are not used on other pages.
You understand how to make assets visible on one page. Of course you can play with assets method too.
You can make it even more complex and enable assets on pages of certain content type. Please note
that content types list contains only public positions - that’s just in case you don’t see all of them.
There is also functionality which allows to disable certain asset on current page only. In this case you can
use “Current URL” checkbox from “Where” statement. It’s good approach if you need to optimize one
page only e.g. front page.
Higher percentage of unused bytes = higher possibility that you’ll have to disable asset in Gonzales.
FAQ
Gonzales reduces amount of scripts on site but itself load another JS? What the heck?
You may notice that Gonzales include css and javascript file to your WordPress. It’s visible for users with
administrative permissions so typical website visitor won’t see them in page source. There’s a way to
disable them. Take a look at next section and look for DISABLE_GONZALES_PANEL constant.
Developer notes
Uninstall
To uninstall plugin go to Plugins page and search for Gonzales. Click on the Deactivate link. To
completely remove plugin from your WordPress select checkbox next to the plugin name and from Bulk
actions choose Delete position.
Please note that you should remove Gonzales MU plugin too located in
/wp-content/mu-plugins/gonzales.php. MU plugins do not provide activation control so file removal is the
only way to uninstall it.