Uplink_Controller::save_empty_license_keys()

Save empty license keys.

Contents


Source

File: src/Common/Libraries/Uplink_Controller.php

	public function save_empty_license_keys() {
		$plugins = get_plugins();

		foreach ( $plugins as $plugin ) {
			$legacy_slug = str_replace( '-', '_', $plugin->get_slug() );

			if ( ! isset( $_POST[ 'pue_install_key_' . $legacy_slug ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
				continue;
			}

			$license_key = sanitize_text_field( $_POST[ 'pue_install_key_' . $legacy_slug ] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing

			// If the license key has a value, it will be validated and stored by uplink.
			// We only want to give our users the option to remove a license key if they want to.
			if ( $license_key ) {
				continue;
			}

			$plugin->set_license_key( '' );
		}
	}

Top ↑

Changelog

Changelog
Version Description
6.3.0 Introduced.