title = $title; $this->slug = $slug; $this->activation_date = "pi_review_activation_date_{$this->slug}"; $this->saved_value = "pi_review_saved_value_{$this->slug}"; $this->review_url = "https://wordpress.org/support/plugin/{$this->slug}/reviews/#wp-bbp_topic_content-wrap"; $this->review_after = 6; $this->buy_url = $buy_url; $this->price = $price; $allowed_atts = array( 'align' => array(), 'class' => array(), 'selected' => array(), 'multiple' => array(), 'checked' => array(), 'type' => array(), 'id' => array(), 'dir' => array(), 'lang' => array(), 'style' => array(), 'xml:lang' => array(), 'src' => array(), 'alt' => array(), 'href' => array(), 'rel' => array(), 'rev' => array(), 'target' => array(), 'novalidate' => array(), 'type' => array(), 'value' => array(), 'name' => array(), 'tabindex' => array(), 'action' => array(), 'method' => array(), 'for' => array(), 'width' => array(), 'height' => array(), 'data' => array(), 'title' => array(), 'min' => array(), 'max' => array(), 'step' => array(), 'required' => array(), 'readonly' => array(), ); $this->allowed_tags['form'] = $allowed_atts; $this->allowed_tags['br'] = $allowed_atts; $this->allowed_tags['label'] = $allowed_atts; $this->allowed_tags['input'] = $allowed_atts; $this->allowed_tags['select'] = $allowed_atts; $this->allowed_tags['option'] = $allowed_atts; $this->allowed_tags['textarea'] = $allowed_atts; $this->allowed_tags['iframe'] = $allowed_atts; $this->allowed_tags['script'] = $allowed_atts; $this->allowed_tags['style'] = $allowed_atts; $this->allowed_tags['strong'] = $allowed_atts; $this->allowed_tags['small'] = $allowed_atts; $this->allowed_tags['table'] = $allowed_atts; $this->allowed_tags['span'] = $allowed_atts; $this->allowed_tags['abbr'] = $allowed_atts; $this->allowed_tags['code'] = $allowed_atts; $this->allowed_tags['pre'] = $allowed_atts; $this->allowed_tags['div'] = $allowed_atts; $this->allowed_tags['img'] = $allowed_atts; $this->allowed_tags['h1'] = $allowed_atts; $this->allowed_tags['h2'] = $allowed_atts; $this->allowed_tags['h3'] = $allowed_atts; $this->allowed_tags['h4'] = $allowed_atts; $this->allowed_tags['h5'] = $allowed_atts; $this->allowed_tags['h6'] = $allowed_atts; $this->allowed_tags['ol'] = $allowed_atts; $this->allowed_tags['ul'] = $allowed_atts; $this->allowed_tags['li'] = $allowed_atts; $this->allowed_tags['em'] = $allowed_atts; $this->allowed_tags['hr'] = $allowed_atts; $this->allowed_tags['br'] = $allowed_atts; $this->allowed_tags['tr'] = $allowed_atts; $this->allowed_tags['td'] = $allowed_atts; $this->allowed_tags['p'] = $allowed_atts; $this->allowed_tags['a'] = $allowed_atts; $this->allowed_tags['b'] = $allowed_atts; $this->allowed_tags['i'] = $allowed_atts; //update_option($this->saved_value, array('preference'=> 'later', 'update_at'=>'2021/06/10')); //delete_option($this->saved_value); add_filter('allowed_redirect_hosts', function($hosts){ $hosts[] = 'wordpress.org'; return $hosts; }); add_action( 'admin_notices', array($this, 'display_admin_notice'),20 ); add_action( "admin_post_pi_save_review_preference_{$this->slug}", array($this, 'savePreference'),20 ); } } function display_admin_notice() { $options = get_option($this->saved_value); $activation_time = $this->getInstallationDate(); $notice = '
' . sprintf( __( 'Is this plugin helping you control your shipping costs?', 'advanced-free-flat-shipping-woocommerce' ), esc_html( $this->title ) ) . '
'; $notice .= '