service( 'options' )->get_usage_timestamp(); // If the usage timestamp is empty, add it and bail. if ( empty( $usage_timestamp ) ) { // Add the activation timestamp. woo_additional_terms()->service( 'options' )->add_usage_timestamp(); return; } // Bail early if the plugin recently installed. if ( time() < ( $usage_timestamp + WEEK_IN_SECONDS ) ) { return; } // Enqueue the assets. wp_enqueue_style( 'woo-additional-terms-rate' ); wp_enqueue_script( 'woo-additional-terms-dismiss' ); // Display the notice. woo_additional_terms()->service( 'template_manager' )->echo_template( 'notices/rate.php', array( 'usage_timestamp' => human_time_diff( $usage_timestamp ), ) ); } /** * Ask for a review in the footer of the settings page. * * @since 1.6.0 * * @return void */ public function wp_footer() { new WP_Footer_Rate\Rate( woo_additional_terms()->service( 'file' )->plugin_basename(), woo_additional_terms()->get_slug(), _x( 'Woo Additional Terms', 'plugin name', 'woo-additional-terms' ), Helper\Settings::is_page() ); } }