diff --git a/README.md b/README.md index 177daff..2f6b408 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ **Donate link:** https://mickeykay.me **Requires at least:** 3.0 **Tested up to:** 6.0.2 -**Stable tag:** 2.0.2 +**Stable tag:** 2.0.3 **License:** GPLv2+ **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -113,6 +113,10 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS, ## Changelog ## +### 2.0.3 ### +* Bugfix: fix broken icon text selection +* Improve admin settings success/error message logic + ### 2.0.2 ### * Bugfix: fix CSRF vulnerability @@ -158,6 +162,10 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS, ## Upgrade Notice ## +### 2.0.3 ### +* Bugfix: fix broken icon text selection +* Improve admin settings success/error message logic + ### 2.0.2 ### * Bugfix: fix CSRF vulnerability diff --git a/better-font-awesome.php b/better-font-awesome.php old mode 100755 new mode 100644 index aa3b2ea..0001849 --- a/better-font-awesome.php +++ b/better-font-awesome.php @@ -12,7 +12,7 @@ * Plugin Name: Better Font Awesome * Plugin URI: http://wordpress.org/plugins/better-font-awesome * Description: The ultimate Font Awesome icon plugin for WordPress. - * Version: 2.0.2 + * Version: 2.0.3 * Author: Mickey Kay * Author URI: mickeyskay@gmail.com * License: GPLv2+ @@ -59,7 +59,7 @@ class Better_Font_Awesome_Plugin { * * @var string */ - const VERSION = '2.0.2'; + const VERSION = '2.0.3'; /** * The Better Font Awesome Library object. @@ -489,9 +489,7 @@ public function admin_enqueue_scripts( $hook ) { public function save_options() { if ( false == check_ajax_referer( self::SLUG . '-options', 'bfa_nonce', false ) ) { wp_die( - '

' - . __( 'Settings were not saved due to a missing nonce. Refresh the page and try again.', 'better-font-awesome' ) - . '

', + __( 'Settings were not saved due to a missing nonce. Refresh the page and try again.', 'better-font-awesome' ), 403 ); } @@ -506,7 +504,7 @@ public function save_options() { update_option( $this->option_name, $options ); // Return a message. - echo '

' . esc_html__( 'Settings saved.', 'better-font-awesome' ) . '

'; + esc_html_e( 'Settings saved.', 'better-font-awesome' ); wp_die(); } diff --git a/js/admin.js b/js/admin.js index 24d778e..7af44f5 100644 --- a/js/admin.js +++ b/js/admin.js @@ -34,17 +34,29 @@ $.post( bfa_ajax_object.ajax_url, // Array passed via wp_localize_script() data, - function( response ) { - $( '.bfa-loading-gif' ).fadeOut( function() { - $( '.bfa-ajax-response-holder' ).html( response ).slideDown().delay(2000).fadeTo(600, 0).delay(300).slideUp().fadeTo(0, 100); - }); + function() {}, // Empty success handler since success/errors handled below. + ).always( function( response, status, thing ) { + var message, messageClass; + + if ('success' == status) { + message = response; + messageClass = 'updated'; + } else { + message = response.responseText; + messageClass = 'error'; } - ).fail( function( response ) { + $( '.bfa-loading-gif' ).fadeOut( function() { - $( '.bfa-ajax-response-holder' ).html( response.responseText ).slideDown().delay(2000).fadeTo(600, 0).delay(300).slideUp().fadeTo(0, 100); + $( '.bfa-ajax-response-holder' ) + .html( `

${message}

` ) + .slideDown() + .delay(2000) + .fadeTo(600, 0) + .delay(300) + .slideUp() + .fadeTo(0, 100); }); }); - }); }); })( jQuery ); diff --git a/languages/better-font-awesome.pot b/languages/better-font-awesome.pot index 7b5bffd..de75591 100644 --- a/languages/better-font-awesome.pot +++ b/languages/better-font-awesome.pot @@ -1,15 +1,15 @@ -# Copyright (C) 2022 Mickey Kay +# Copyright (C) 2023 Mickey Kay # This file is distributed under the GPLv2+. msgid "" msgstr "" -"Project-Id-Version: Better Font Awesome 2.0.2\n" +"Project-Id-Version: Better Font Awesome 2.0.3\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/better-font-awesome\n" -"POT-Creation-Date: 2022-09-13 01:28:55+00:00\n" +"POT-Creation-Date: 2023-01-15 17:47:10+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2022-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "X-Generator: grunt-wp-i18n 1.0.3\n" @@ -84,40 +84,44 @@ msgid "" "occur." msgstr "" -#: better-font-awesome.php:493 +#: better-font-awesome.php:492 msgid "" "Settings were not saved due to a missing nonce. Refresh the page and try " "again." msgstr "" -#: better-font-awesome.php:509 +#: better-font-awesome.php:507 msgid "Settings saved." msgstr "" -#: better-font-awesome.php:533 +#: better-font-awesome.php:531 #. translators: placeholder is the numeric current version number. msgid "" "%s (The plugin automatically uses the latest version of Font Awesome, and " "checks for updates at this frequency)" msgstr "" -#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:927 +#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:928 +#: vendor/mickey-kay/better-font-awesome-library-git/better-font-awesome-library.php:928 msgid "Insert Icon" msgstr "" -#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:954 +#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:955 +#: vendor/mickey-kay/better-font-awesome-library-git/better-font-awesome-library.php:955 msgid "" "It looks like something went wrong when trying to fetch data from the Font " "Awesome API:" msgstr "" -#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:965 +#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:966 +#: vendor/mickey-kay/better-font-awesome-library-git/better-font-awesome-library.php:966 msgid "" "Don't worry! Better Font Awesome will still render using the included " "fallback version: " msgstr "" -#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:966 +#: vendor/mickey-kay/better-font-awesome-library/better-font-awesome-library.php:967 +#: vendor/mickey-kay/better-font-awesome-library-git/better-font-awesome-library.php:967 msgid "" "This may be the result of a temporary server or connectivity issue which " "will resolve shortly. However if the problem persists please file a support " diff --git a/package.json b/package.json index acb175a..21faa34 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "Better Font Awesome", "description": "The best WordPress extension ever made!", - "version": "2.0.2", + "version": "2.0.3", "homepage": "http://wordpress.org/plugins/better-font-awesome", "scripts": { "composer": "composer install", diff --git a/readme.txt b/readme.txt old mode 100755 new mode 100644 index 598110a..04cc4ea --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: better, font, awesome, icon, icons, bootstrap, fontstrap, cdn, shortcode Donate link: https://mickeykay.me Requires at least: 3.0 Tested up to: 6.0.2 -Stable tag: 2.0.2 +Stable tag: 2.0.3 License: GPLv2+ License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -111,6 +111,10 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS, == Changelog == += 2.0.3 = +* Bugfix: fix broken icon text selection +* Improve admin settings success/error message logic + = 2.0.2 = * Bugfix: fix CSRF vulnerability @@ -156,6 +160,10 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS, == Upgrade Notice == += 2.0.3 = +* Bugfix: fix broken icon text selection +* Improve admin settings success/error message logic + = 2.0.2 = * Bugfix: fix CSRF vulnerability