{product} active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers!

~ {developer}, developer of {product}'; /** * @var string $msg The text of the modal */ private $msg = ''; /** * @var string $button_cancel The text of the cancel button */ private $button_cancel = 'No, thanks.'; /** * @var array Developers who work for each type of product for review purpose. */ private $developers = array( 'plugin' => array( 'Marius', 'Bogdan' ), 'theme' => array( 'Rodica', 'Andrei', 'Bogdan', 'Cristi' ), ); /** * @var string $button_already The text of the already did it button */ private $button_do = 'Ok, I will gladly help.'; /** * ThemeIsle_SDK_Feedback_Deactivate constructor. * * @param ThemeIsle_SDK_Product $product_object The product object. */ public function __construct( $product_object ) { parent::__construct( $product_object ); } /** * Registers the hooks */ public function setup_hooks_child() { add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'dismiss' ) ); } /** * Either we can notify or not. * * @return bool Notification available or not. */ public function can_notify() { if ( ! $this->product->is_wordpress_available() ) { $this->disable(); return false; } $show = get_option( $this->product->get_key() . '_review_flag', 'yes' ); if ( 'no' === $show ) { return false; } $finally_show = apply_filters( $this->product->get_key() . '_feedback_review_trigger', true ); if ( false !== $finally_show ) { if ( is_array( $finally_show ) && ! empty( $finally_show ) ) { $this->heading = $finally_show['heading']; $this->msg = $finally_show['msg']; } } else { return false; } return true; } /** * Shows the notification */ function show_notification() { add_action( 'admin_notices', array( $this, 'admin_notices' ) ); } /** * Shows the admin notice */ function admin_notices() { $id = $this->product->get_key() . '_review'; $this->add_css( $this->product->get_key() ); $this->add_js( $this->product->get_key() ); echo '
' . $this->get_html( $this->product->get_key() ) . '
'; } /** * Loads the css * * @param string $key The product key. */ function add_css( $key ) { ?> product->get_type() . '/' . $this->product->get_slug() . '/reviews/#wporg-footer'; $heading = apply_filters( $this->product->get_key() . '_feedback_review_heading', $this->heading ); $heading = str_replace( array( '{product}' ), $this->product->get_friendly_name(), $heading ); $heading = str_replace( '{developer}', $this->developers[ $this->product->get_type() ][ rand( 0, ( count( $this->developers[ $this->product->get_type() ] ) - 1 ) ) ], $heading ); $button_cancel = apply_filters( $this->product->get_key() . '_feedback_review_button_cancel', $this->button_cancel ); $button_do = apply_filters( $this->product->get_key() . '_feedback_review_button_do', $this->button_do ); $msg = apply_filters( $this->product->get_key() . '_feedback_review_message', $this->msg ); return '
' . '

' . $heading . '

' . ( $msg ? '

' . $msg . '

' : '' ) . '
' . ' ' . $button_do . '' . get_submit_button( $button_cancel, 'review-dismiss ' . $this->product->get_key() . '-ti-review', $this->product->get_key() . 'ti-review-no', false ) . '
'; } /** * Called when the either button is clicked */ function dismiss() { check_ajax_referer( (string) __CLASS__, 'nonce' ); $this->disable(); } /** * Disables the notification */ protected function disable() { update_option( $this->product->get_key() . '_review_flag', 'no' ); } /** * Enables the notification */ protected function enable() { update_option( $this->product->get_key() . '_review_flag', 'yes' ); } } endif;