Gift Wrapper 3.0-beta Release

Happy Autumn!

Whereas I started about a month ago with just a few small changes to Gift Wrapper Plus, it snowballed into a pretty big plugin overhaul. The “small change” I had in mind was dispensing with the Bootstrap JavaScript dependency for the pop-ups (modals); however, that turned into major overall JavaScript improvements, which turned into significant template changes, which included quite a few security enhancements. So, while it could be an inconvenient update for anyone overriding Gift Wrapper templates, for anyone else it will just result in painlessly quicker product, cart, and checkout pages.

View the changelog.

Are you overriding templates?

Not sure? Most times you would know if you are overriding templates, because it takes some coding and file-manipulation. If someone might have done this for you, you would find files in your (child) theme woocommerce/wcgwp/ folder. If that folder is empty, you can stop reading; no action necessary!

In most cases, your old templates will continue to work*. If you have outdated templates in your (child) theme woocommerce/wcgwp/ folder, those will be read, and their dependency templates loaded as well. But since this is not optimal, it’s highly recommended you move your template changes over to the updated (or in some cases, replacement) template. Clues to what happened to your template will be in the header of the updated (in the woocommerce-gift-wrapper-plus/templates/wcgwp/ folder) template file. If the header says the template is DEPRECATED, that means it is not used anymore and it will do no good to override it. If the header says a new template is being used, copy that new template to your (child) theme woocommerce/wcgwp/ and re-create your template changes in that new file.

Except for one template (“replace-wrap-js.php,” for now), JavaScript is no longer included for template overrides. It is enqueued in the traditional WordPress manner, in the footer, for faster loading. You can find the enqueue handles in the main plugin file (“woocommerce-gift-wrapper-plus.php”) in case you wish to dequeue and override any JavaScript. Modals now use Modal Vanilla, a lightweight script which not only does not depend on jQuery like Bootstrap does, but which will minimize future chances of theme conflicts. For people trying to run WordPress sites without using jQuery, this is a nice option to have. Slide-in gift wrap options panels still rely on jQuery (SlideToggle) to function, and that was made more clear on the settings pages.

*They will work for an indeterminate length of time. At some point in the future they may be removed, so it’s best to look at updating your template overrides sooner than later.

To top