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 index aa3b2ea..0001849 100755 --- 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/composer.json b/composer.json index 5c302b8..5330f35 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Better Font Awesome", "license": "GPL-2.0", "require": { - "mickey-kay/better-font-awesome-library": "2.0.1" + "mickey-kay/better-font-awesome-library": "2.0.2" }, "require-dev": { "phpunit/phpunit": "^5|^7", diff --git a/composer.lock b/composer.lock index 24a58ab..6670bbd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6548f3b9d3ecb96f1caf6013b86b2606", + "content-hash": "e579301f529afbbfc10aa19914476753", "packages": [ { "name": "mickey-kay/better-font-awesome-library", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/MickeyKay/better-font-awesome-library.git", - "reference": "f9e4bb32c4d7c02d0e44a473873fddd40feefebf" + "reference": "644e87e4ce89d637b17c067853226b6fa13a9584" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MickeyKay/better-font-awesome-library/zipball/f9e4bb32c4d7c02d0e44a473873fddd40feefebf", - "reference": "f9e4bb32c4d7c02d0e44a473873fddd40feefebf", + "url": "https://api.github.com/repos/MickeyKay/better-font-awesome-library/zipball/644e87e4ce89d637b17c067853226b6fa13a9584", + "reference": "644e87e4ce89d637b17c067853226b6fa13a9584", "shasum": "" }, "type": "library", @@ -26,7 +26,11 @@ "GPL-2.0-or-later" ], "description": "Better Font Awesome Library for WordPress", - "time": "2021-03-11T05:16:28+00:00" + "support": { + "issues": "https://github.com/MickeyKay/better-font-awesome-library/issues", + "source": "https://github.com/MickeyKay/better-font-awesome-library/tree/2.0.2" + }, + "time": "2022-09-14T06:00:45+00:00" } ], "packages-dev": [ @@ -1871,5 +1875,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.3.0" } 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..60bdf4c 100644 --- a/languages/better-font-awesome.pot +++ b/languages/better-font-awesome.pot @@ -2,10 +2,10 @@ # 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: 2022-09-14 06:25:05+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -84,17 +84,17 @@ 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 " 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 index 598110a..04cc4ea 100755 --- 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