Skip to content

Commit

Permalink
Merge branch 'hotfix/1.11.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
abrain committed Apr 1, 2024
2 parents d10c86c + 89c44e3 commit 492331d
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/Admin/Initializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,21 @@ public function enqueueEditScripts($hook)
}

wp_enqueue_style(
'font-awesome',
'einsatzverwaltung-font-awesome',
Core::$pluginUrl . 'font-awesome/css/fontawesome.min.css',
false,
'6.2.1'
);
wp_enqueue_style(
'font-awesome-solid',
'einsatzverwaltung-font-awesome-solid',
Core::$pluginUrl . 'font-awesome/css/solid.min.css',
array('font-awesome'),
array('einsatzverwaltung-font-awesome'),
'6.2.1'
);
wp_enqueue_style(
'font-awesome-brands',
'einsatzverwaltung-font-awesome-brands',
Core::$pluginUrl . 'font-awesome/css/brands.min.css',
array('font-awesome'),
array('einsatzverwaltung-font-awesome'),
'6.2.1'
);
wp_enqueue_style(
Expand Down
4 changes: 2 additions & 2 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*/
class Core
{
const VERSION = '1.11.0';
const DB_VERSION = 72;
const VERSION = '1.11.1';
const DB_VERSION = 80;

/**
* Statische Variable, um die aktuelle (einzige!) Instanz dieser Klasse zu halten
Expand Down
27 changes: 15 additions & 12 deletions src/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,21 @@ public function addHooks()
*/
public function enqueueStyleAndScripts()
{
wp_enqueue_style(
'font-awesome',
Core::$pluginUrl . 'font-awesome/css/fontawesome.min.css',
false,
'6.2.1'
);
wp_enqueue_style(
'font-awesome-solid',
Core::$pluginUrl . 'font-awesome/css/solid.min.css',
array('font-awesome'),
'6.2.1'
);
if (get_option('einsatzvw_disable_fontawesome') !== '1') {
wp_enqueue_style(
'einsatzverwaltung-font-awesome',
Core::$pluginUrl . 'font-awesome/css/fontawesome.min.css',
false,
'6.2.1'
);
wp_enqueue_style(
'einsatzverwaltung-font-awesome-solid',
Core::$pluginUrl . 'font-awesome/css/solid.min.css',
array('einsatzverwaltung-font-awesome'),
'6.2.1'
);
}

wp_enqueue_style(
'einsatzverwaltung-frontend',
Core::$styleUrl . 'style-frontend.css',
Expand Down
32 changes: 32 additions & 0 deletions src/Settings/Pages/Advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ public function addSettingsFields()
$this->settingsApiPage,
'einsatzvw_settings_advreport'
);
add_settings_field(
'einsatzvw_compatibility_fontawesome',
__('Font Awesome', 'einsatzverwaltung'),
array($this, 'echoFieldFontAwesome'),
$this->settingsApiPage,
'einsatzvw_settings_advanced_compatibility'
);
}

public function addSettingsSections()
Expand Down Expand Up @@ -112,6 +119,12 @@ function () {
null,
$this->settingsApiPage
);
add_settings_section(
'einsatzvw_settings_advanced_compatibility',
__('Compatibility', 'einsatzverwaltung'),
null,
$this->settingsApiPage
);
}

/**
Expand Down Expand Up @@ -174,6 +187,20 @@ public function echoFieldCoreFeatures()
echo '</fieldset>';
}

public function echoFieldFontAwesome()
{
echo '<fieldset>';
$this->echoSettingsCheckbox(
'einsatzvw_disable_fontawesome',
__('Disable Font Awesome', 'einsatzverwaltung')
);
printf(
'<p class="description">%s</p>',
esc_html__('If the icons are not shown correctly, there may be a collision with another installed version of Font Awesome. You can try and deactivate this plugin\'s version. This will not affect the admin area.', 'einsatzverwaltung')
);
echo '</fieldset>';
}

public function echoFieldGutenberg()
{
echo '<fieldset>';
Expand Down Expand Up @@ -265,5 +292,10 @@ public function registerSettings()
'einsatz_disable_blockeditor',
array(Utilities::class, 'sanitizeCheckbox')
);
register_setting(
'einsatzvw_settings_advanced',
'einsatzvw_disable_fontawesome',
array(Utilities::class, 'sanitizeCheckbox')
);
}
}
14 changes: 14 additions & 0 deletions src/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public function doUpdate(int $currentDbVersion, int $targetDbVersion)
if ($currentDbVersion < 72 && $targetDbVersion >= 72) {
$this->upgrade1102();
}

if ($currentDbVersion < 80 && $targetDbVersion >= 80) {
$this->upgrade1111();
}
}

/**
Expand Down Expand Up @@ -669,6 +673,16 @@ public function upgrade1102()
update_option('einsatzvw_db_version', 72);
}

/**
* @since 1.11.1
*/
public function upgrade1111()
{
add_option('einsatzvw_disable_fontawesome', '0');

update_option('einsatzvw_db_version', 80);
}

/**
* Fügt einen Bezeichner für eine Admin Notice der Liste der noch anzuzeigenden Notices hinzu
*
Expand Down
2 changes: 1 addition & 1 deletion src/einsatzverwaltung.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Einsatzverwaltung
Plugin URI: https://einsatzverwaltung.org
Description: Public incident reports for fire departments and other rescue services
Version: 1.11.0
Version: 1.11.1
Author: Andreas Brain
Author URI: https://www.abrain.de
License: GPLv2
Expand Down
11 changes: 9 additions & 2 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: abrain
Donate link: https://einsatzverwaltung.org/unterstuetzen/
Tags: Feuerwehr, fire department, EMS
Requires at least: 5.6.0
Tested up to: 6.4
Tested up to: 6.5
Requires PHP: 7.1.0
Stable tag: 1.11.0
Stable tag: 1.11.1
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -52,6 +52,10 @@ Yes, you can find them on [our website](https://einsatzverwaltung.org/faq/).

== Changelog ==

= 1.11.1 =
* Reduce collisions with other occurrences of Font Awesome
* Add option to disable Font Awesome

= 1.11.0 =
* Alerting Methods: Can now be linked with a page from the same site or an arbitrary URL
* Shortcode `reportcount` can ignore weights
Expand All @@ -75,6 +79,9 @@ Yes, you can find them on [our website](https://einsatzverwaltung.org/faq/).
* Fix: Changing the category setting for incident reports caused an error on fresh installations

== Upgrade Notice ==
= 1.11.1 =
Maintenance Release

= 1.11.0 =
Minor enhancements, upgraded Font Awesome, improved compatibility with PHP 8.2

Expand Down
10 changes: 10 additions & 0 deletions tests/unit/UpdateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,14 @@ public function testUpgrade1102Foo()
expect('update_option')->once()->with('einsatzvw_db_version', 72);
(new Update())->upgrade1102();
}

/**
* @throws ExpectationArgsRequired
*/
public function testUpgrade1111AddsOptionDefault()
{
expect('add_option')->once()->with('einsatzvw_disable_fontawesome', '0');
expect('update_option')->once()->with('einsatzvw_db_version', 80);
(new Update())->upgrade1111();
}
}

0 comments on commit 492331d

Please sign in to comment.