Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Conversation

@stevegrunwell
Copy link
Contributor

This PR rewrites the WC_Custom_Order_Table_Install to use just two static methods: activate() (which performs the jobs formerly handled by maybe_install_tables(), get_latest_table_version(), and get_installed_table_version()), and install_tables(), the latter of which is marked as protected.

This enables register_activation_hook() to call WC_Custom_Order_Table_Install::activate() directly, while avoiding treating the installer as an object (since it's really just using the class construct as a pseudo-namespace).

The PR also ensures that the "wc_orders_table_version" option is not auto-loaded, as it's only needed during plugin activation.

…re simple getters that were used exactly once.
…hods.

This keeps us from creating an instance of a WC_Custom_Order_Table_Install (as it's really only a pseudo-namespace, not an actual object). This change also enables us to drop the wc_custom_order_table_install() function, since we can call the `activate()` method directly.
Based on https://developer.wordpress.org/reference/classes/wpdb/has_cap/#source, MySQL has supported collation since version 4.1, which is *far* below the minimum MySQL requirements for WordPress (5.0+, per https://wordpress.org/about/requirements/).
@bswatson bswatson merged commit 3c92135 into master Dec 23, 2017
@bswatson bswatson deleted the feature/cleanup-table-installation branch December 23, 2017 02:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants