Automator_Review::maybe_ask_tracking()

Admin notice for review this plugin.


Source Source

File: src/core/admin/class-automator-review.php

	public function maybe_ask_tracking() {
		$_is_reminder   = get_option( '_uncanny_automator_tracking_reminder', '' );
		$_reminder_date = get_option( '_uncanny_automator_tracking_reminder_date', current_time( 'timestamp' ) );

		if ( ! empty( $_is_reminder ) && 'hide-forever' === $_is_reminder ) {
			return;
		}

		$automator_reporting = get_option( 'automator_reporting', false );

		if( $automator_reporting ) {
			return;
		}
		add_action( 'admin_notices', function () {

			// Check only Automator related pages.
			global $typenow;

			if ( empty( $typenow ) || 'uo-recipe' !== $typenow ) {
				return;
			}

			$screen = get_current_screen();

			if ( $screen->base === 'post' ) {
				return;
			}

			// Get data about Automator's version
			$is_pro  = false;
			$version = AUTOMATOR_PLUGIN_VERSION;
			if ( defined( 'AUTOMATOR_PRO_FILE' ) || class_exists( '\Uncanny_Automator_Pro\InitializePlugin' ) ) {
				$is_pro  = true;
				$version = \Uncanny_Automator_Pro\InitializePlugin::PLUGIN_VERSION;
			}

			if( $is_pro ) {
				return;
			}

			// Send review URL
			$url_send_review = add_query_arg( [ 'action' => 'uo-allow-tracking' ] );

			// Send feedback URL
			$url_send_feedback_version = $is_pro ? 'Uncanny%20Automator%20Pro%20' . $version : 'Uncanny%20Automator%20' . $version;
			$url_send_feedback_source  = $is_pro ? 'uncanny_automator_pro' : 'uncanny_automator';
			$url_remind_later          = add_query_arg( [ 'action' => 'uo-hide-track' ] );
			include Utilities::automator_get_view( 'tracking-banner.php' );
		} );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.1.4 Introduced.