'used-it', 'text' => __( 'Used it successfully. Don\'t need anymore.', 'accessibility-plus' ), 'type' => 'reviewhtml', 'placeholder' => __( 'Have used it successfully and don\'t need it anymore', 'accessibility-plus' ), ), array( 'id' => 'could-not-understand', 'text' => __( 'I couldn\'t understand how to make it work', 'accessibility-plus' ), 'type' => 'textarea', 'placeholder' => __( 'Would you like us to assist you?', 'accessibility-plus' ), ), array( 'id' => 'found-better-plugin', 'text' => __( 'I found a better plugin', 'accessibility-plus' ), 'type' => 'text', 'placeholder' => __( 'Which plugin?', 'accessibility-plus' ), ), array( 'id' => 'not-have-that-feature', 'text' => __( 'The plugin is great, but I need specific feature that you don\'t support', 'accessibility-plus' ), 'type' => 'textarea', 'placeholder' => __( 'Could you tell us more about that feature?', 'accessibility-plus' ), ), array( 'id' => 'is-not-working', 'text' => __( 'The plugin didn\'t work as expected', 'accessibility-plus' ), 'type' => 'textarea', 'placeholder' => __( 'Could you tell us a bit more what\'s not working?', 'accessibility-plus' ), ), array( 'id' => 'other', 'text' => __( 'Other', 'accessibility-plus' ), 'type' => 'textarea', 'placeholder' => __( 'Could you tell us a bit more?', 'accessibility-plus' ), ), ); return $reasons; } /** * Add deactivation scripts (modal + JS) */ public function deactivate_scripts() { global $pagenow; if ( 'plugins.php' !== $pagenow ) { return; } $reasons = $this->get_uninstall_reasons(); $reasons = ( isset( $reasons ) && is_array( $reasons ) ) ? $reasons : array(); ?>
$reason_id, 'plugin' => 'wyaccessibilityplus', 'auth' => 'wyaccessibilityplus_uninstall_1234#', 'date' => gmdate( 'M d, Y h:i:s A' ), 'url' => home_url(), 'user_email' => '', 'reason_info' => $reason_info, 'software' => isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '', 'php_version' => phpversion(), 'mysql_version' => $wpdb->db_version(), 'wp_version' => get_bloginfo( 'version' ), 'wc_version' => ( function_exists( 'WC' ) ) ? WC()->version : '', 'locale' => get_locale(), 'languages' => implode( ',', get_available_languages() ), 'theme' => wp_get_theme()->get( 'Name' ), 'plugin_version' => defined( 'WY_A11Y_VERSION' ) ? WY_A11Y_VERSION : '', 'multisite' => is_multisite() ? 'Yes' : 'No', ); error_log( 'fhbjhfb:-' . print_r( $data, 1 ) . '', 3, ABSPATH . '/wp-content/uploads/wc-logs/test-log.log' ); // Example endpoint; replace or hook as needed $res = wp_remote_post( 'https://feedback.webtoffee.com/wp-json/wyaccessibilityplus/v1/uninstall', array( 'method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => false, 'body' => $data, 'cookies' => array(), ) ); error_log( 'fhbjhfb:-' . print_r( $res, 1 ) . '', 3, ABSPATH . '/wp-content/uploads/wc-logs/test-log.log' ); wp_send_json_success(); } } new Uninstall_Feedback();