Tribe__PUE__Notices::select_empty_keys()

Select all products with empty license keys and format their names

This information will be used to remove products with no license keys from $this->notices[‘invalid_key’]


Return

(array)


Top ↑

Source

File: src/Tribe/PUE/Notices.php

	public function select_empty_keys() {
		/** @var $wpdb */
		global $wpdb;

		$sql = "
			SELECT option_name
				FROM {$wpdb->options}
				WHERE option_name LIKE 'pue_install_key_%'
					AND option_value=''
			";

		$empty_keys = $wpdb->get_results( $sql, ARRAY_N );

		$plugin_names = array(
			'pue_install_key_event_tickets_plus'       => 'Event Tickets Plus',
			'pue_install_key_events_community'         => 'The Events Calendar: Community Events',
			'pue_install_key_events_community_tickets' => 'The Events Calendar: Community Events Tickets',
			'pue_install_key_image_widget_plus'        => 'Image Widget Plus',
			'pue_install_key_tribe_eventbrite'         => 'The Events Calendar: Eventbrite Tickets',
			'pue_install_key_tribe_filterbar'          => 'The Events Calendar: Filter Bar',
			'pue_install_key_event_aggregator'         => 'Event Aggregator',
			'pue_install_key_events_calendar_pro'      => 'The Events Calendar PRO',
		);

		$formatted_empty_keys = array();
		foreach ( $empty_keys as $empty_key ) {
			$empty_key              = Tribe__Utils__Array::get( $empty_key, array( 0 ) );
			$formatted_empty_keys[] = Tribe__Utils__Array::get( $plugin_names, $empty_key );
		}

		return $formatted_empty_keys;
	}

Top ↑

Changelog

Changelog
Version Description
4.8 Introduced.