Skip to content

Commit 46122c6

Browse files
committed
🐛 Fix loading admin assets on production
1 parent c7cd417 commit 46122c6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

impressum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Plugin Name: Impressum
66
Plugin URI: https://wordpress.org/plugins/impressum/
77
Description: Simple Imprint Generator
8-
Version: 2.2.0
8+
Version: 2.2.1
99
Requires at least: 5.0
1010
Requires PHP: 5.6
1111
Author: Epiphyt

inc/class-admin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function block_assets() {
8888
public function enqueue_assets( $hook ) {
8989
$is_debug = ( \defined( 'SCRIPT_DEBUG' ) && \SCRIPT_DEBUG ) || ( \defined( 'WP_DEBUG' ) && \WP_DEBUG );
9090
$suffix = $is_debug ? '' : '.min';
91-
$file_path = \EPI_IMPRESSUM_BASE . 'assets/js/ajax-dismissible-notice' . $suffix . '.js';
91+
$file_path = \EPI_IMPRESSUM_BASE . 'assets/js/' . ( $is_debug ? '' : 'build/' ) . 'ajax-dismissible-notice' . $suffix . '.js';
9292

9393
if ( \file_exists( $file_path ) ) {
9494
$file_version = $is_debug ? (string) \filemtime( $file_path ) : \EPI_IMPRESSUM_VERSION;
@@ -101,23 +101,23 @@ public function enqueue_assets( $hook ) {
101101
return;
102102
}
103103

104-
$file_path = \EPI_IMPRESSUM_BASE . '/assets/js/admin-options' . $suffix . '.js';
104+
$file_path = \EPI_IMPRESSUM_BASE . 'assets/js/' . ( $is_debug ? '' : 'build/' ) . 'admin-options' . $suffix . '.js';
105105

106106
if ( \file_exists( $file_path ) ) {
107107
$file_version = $is_debug ? (string) \filemtime( $file_path ) : \EPI_IMPRESSUM_VERSION;
108108

109109
\wp_enqueue_script( 'impressum-admin-options', \EPI_IMPRESSUM_URL . '/assets/js/' . ( $is_debug ? '' : 'build/' ) . 'admin-options' . $suffix . '.js', [], $file_version );
110110
}
111111

112-
$file_path = \EPI_IMPRESSUM_BASE . '/assets/js/admin-tabs' . $suffix . '.js';
112+
$file_path = \EPI_IMPRESSUM_BASE . 'assets/js/' . ( $is_debug ? '' : 'build/' ) . 'admin-tabs' . $suffix . '.js';
113113

114114
if ( \file_exists( $file_path ) ) {
115115
$file_version = $is_debug ? (string) \filemtime( $file_path ) : \EPI_IMPRESSUM_VERSION;
116116

117117
\wp_enqueue_script( 'impressum-admin-tabs', \EPI_IMPRESSUM_URL . '/assets/js/' . ( $is_debug ? '' : 'build/' ) . 'admin-tabs' . $suffix . '.js', [], $file_version );
118118
}
119119

120-
$file_path = \EPI_IMPRESSUM_BASE . '/assets/style/build/style' . $suffix . '.css';
120+
$file_path = \EPI_IMPRESSUM_BASE . 'assets/style/build/style' . $suffix . '.css';
121121

122122
if ( \file_exists( $file_path ) ) {
123123
$file_version = $is_debug ? (string) \filemtime( $file_path ) : \EPI_IMPRESSUM_VERSION;

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: epiphyt, kittmedia, krafit
33
Tags: impressum, legal notice, imprint, privacy policy
44
Requires at least: 5.0
5-
Stable tag: 2.2.0
5+
Stable tag: 2.2.1
66
Tested up to: 6.8
77
Requires PHP: 5.6
88
License: GPL2
@@ -87,6 +87,9 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
8787

8888
== Changelog ==
8989

90+
= 2.2.1 =
91+
* Fixed: Some assets in the backend could not be loaded and thus prevented JavaScript functionality
92+
9093
= 2.2.0 =
9194
* Added: All missing European countries
9295
* Changed: The multiselect field to (de-)activate fields in the block is now a list of checkboxes

0 commit comments

Comments
 (0)