( get_option( 'bill_installed' ) + 60*60*24*3 ); if ( in_array( $vote, array( 'yes', 'no', 'tweet' ) ) || !$timeout ) return; add_action( 'in_admin_footer', array( __CLASS__, 'message' ) ); add_action( 'admin_head', array( __CLASS__, 'register' ) ); add_action( 'admin_footer', array( __CLASS__, 'enqueue' ) ); } public static function register() { $xpos = stripos(PRODUCTNAME , 'theme'); if($xpos === false) { wp_register_script( PRODCLASS.'_js', URL.'includes/feedback/feedback.js' , array(), VERSION , true ); wp_register_style( PRODCLASS , URL.'includes/feedback/feedback-plugin.css'); } else { wp_register_script( PRODCLASS.'_js', URL.'/js/feedback.js' , array(), VERSION , true ); wp_register_style( PRODCLASS , URL.'/css/feedback-plugin.css'); } } public static function enqueue() { wp_enqueue_script( PRODCLASS.'_js' ); wp_enqueue_style( PRODCLASS); } public static function vote() { $vote = sanitize_key( $_GET['vote'] ); // http://boatplugin.com/wp-admin/admin-ajax.php?action=vote&vote=no if ( !is_user_logged_in() || !in_array( $vote, array( 'yes', 'no', 'later' ) ) ) die( 'error' ); $r = update_option( OPTIN, $vote ); if(!$r) add_option( OPTIN, $vote ); if ( $vote === 'later' ) update_option( DINSTALL, time() ); wp_die( 'OK: ' . $vote ); } public static function message() { ?>