Skip to content

Commit abbba11

Browse files
authored
Merge pull request #6 from jamiebergen/bugfix/1.2.1
Bugfix/1.2.1
2 parents a192cdf + b1c43be commit abbba11

File tree

6 files changed

+113
-5
lines changed

6 files changed

+113
-5
lines changed

README.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Donate link: https://jamiebergen.com/donate/
55
Requires at least: 4.0
66
Tested up to: 5.2.2
77
Requires PHP: 5.5.24
8-
Stable tag: 1.2.0
8+
Stable tag: 1.2.1
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -80,6 +80,10 @@ Each site within a multisite install maintains its own plugin notes. Additionall
8080

8181
== Changelog ==
8282

83+
= 1.2.1 =
84+
* Fixed: JavaScript error that sometimes happened on update-core.php if a plugin had no notes. Thanks to @brianhenryie for bringing this to my attention.
85+
* Added: Hungarian translation. Thanks to @tomek00.
86+
8387
= 1.2.0 =
8488
* Added: Plugin notes now display in a read-only format on the WordPress Updates page (update-core.php). Thanks to @douglsmith for the suggestion.
8589
* Fixed: Removed unnecessary multisite hook. Thanks to @foomagoo for pointing this out.
@@ -102,6 +106,9 @@ Each site within a multisite install maintains its own plugin notes. Additionall
102106

103107
== Upgrade Notice ==
104108

109+
= 1.2.1 =
110+
This version fixes a rare JavaScript error on the WordPress Updates page and adds a Hungarian translation.
111+
105112
= 1.2.0 =
106113
This version adds a feature to display plugin notes on the WordPress Updates page.
107114

admin/class-plugin-notes-plus-admin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ public function enqueue_scripts() {
109109

110110
if ( $hook_suffix == 'update-core.php' ) {
111111
$updates = $this->get_notes_for_plugin_updates_page();
112+
$updates_json_str = json_encode( $updates );
112113
$labels = array (
113114
'col_title' => esc_html__( 'Plugin Notes', $this->plugin->get_plugin_name() ),
114115
'no_note' => esc_html__( 'No Plugin Notes', $this->plugin->get_plugin_name() ),
115116
);
116117
wp_enqueue_script( 'pnp_updates_script', plugin_dir_url( __FILE__ ) . 'js/plugin-notes-plus-updates.js', array( 'jquery' ), $this->plugin->get_version(), false );
117-
wp_localize_script( 'pnp_updates_script', 'updates', $updates );
118+
wp_localize_script( 'pnp_updates_script', 'updates', $updates_json_str );
118119
wp_localize_script( 'pnp_updates_script', 'labels', $labels );
119120
}
120121
}

admin/js/plugin-notes-plus-updates.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88

99
$('#update-plugins-table thead tr, #update-plugins-table tfoot tr').append( '<td id="pnp_plugin_notes_col">'+ labels.col_title +'</td>' );
1010

11+
var notes_for_plugin_updates = $.parseJSON(updates);
12+
1113
var i = 0;
1214

1315
$('#update-plugins-table .plugins tr').each(function() {
1416

15-
const values = Object.values(updates[i]);
17+
var plugin_notes = notes_for_plugin_updates[i];
1618

17-
if (values === undefined || values.length === 0) {
19+
if (plugin_notes === undefined || plugin_notes.length === 0) {
1820

1921
$(this).append( '<td>'+ labels.no_note +'</td>' );
2022

2123
} else {
2224

25+
var values = Object.values(plugin_notes);
26+
2327
var noteMarkup = '<div class="pnp-wrapper">';
2428

2529
for (const value of values) {
1.73 KB
Binary file not shown.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# WordPress Blank Pot
2+
# Copyright (C) 2014 ...
3+
# This file is distributed under the GNU General Public License v2 or later.
4+
msgid ""
5+
msgstr ""
6+
"Project-Id-Version: Plugin Notes Plus 1.0.0\n"
7+
"Report-Msgid-Bugs-To: Translator Name <translations@example.com>\n"
8+
"POT-Creation-Date: 2019-08-12 19:22+0200\n"
9+
"PO-Revision-Date: \n"
10+
"Last-Translator: \n"
11+
"Language-Team: Tomek <tomek.maestro@gmail.com>\n"
12+
"Language: hu_HU\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: 8bit\n"
16+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
17+
"X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"
18+
"X-Poedit-SourceCharset: UTF-8\n"
19+
"X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
20+
"esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;"
21+
"_nx_noop:4c,1,2;_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;"
22+
"__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
23+
"X-Poedit-Basepath: ..\n"
24+
"X-Generator: Poedit 1.8.7\n"
25+
"X-Poedit-SearchPath-0: .\n"
26+
27+
#: admin/class-plugin-notes-plus-admin.php:93
28+
#: admin/partials/plugin-note-markup.php:27
29+
msgid "edit"
30+
msgstr "Szerkeszt"
31+
32+
#: admin/class-plugin-notes-plus-admin.php:94
33+
#: admin/partials/plugin-note-markup.php:28
34+
msgid "delete"
35+
msgstr "Töröl"
36+
37+
#: admin/class-plugin-notes-plus-admin.php:95
38+
msgid "Are you sure you want to delete this note?"
39+
msgstr "¿Biztosan törlöd a megjegyzést?"
40+
41+
#: admin/class-plugin-notes-plus-admin.php:96
42+
msgid "The note must contain content."
43+
msgstr "A megjegyzés nem lehet üres."
44+
45+
#: admin/class-plugin-notes-plus-admin.php:113
46+
#: admin/class-plugin-notes-plus-admin.php:128
47+
msgid "Plugin Notes"
48+
msgstr "Bővítmények megjegyzései"
49+
50+
#: admin/class-plugin-notes-plus-admin.php:114
51+
msgid "No Plugin Notes"
52+
msgstr "Nincsenek megjegyzéásek"
53+
54+
#: admin/class-plugin-notes-plus-admin.php:277
55+
msgid "Note"
56+
msgstr "Megjegyzés"
57+
58+
#: admin/class-plugin-notes-plus-admin.php:278
59+
msgid "Info"
60+
msgstr "Információ"
61+
62+
#: admin/class-plugin-notes-plus-admin.php:279
63+
msgid "Link"
64+
msgstr "Hivatkozás"
65+
66+
#: admin/class-plugin-notes-plus-admin.php:280
67+
msgid "Warning"
68+
msgstr "Figyelmeztetés"
69+
70+
#: admin/class-plugin-notes-plus-admin.php:281
71+
msgid "Key"
72+
msgstr "Kulcs"
73+
74+
#: admin/class-plugin-notes-plus-admin.php:282
75+
msgid "Checkmark"
76+
msgstr "Pipa"
77+
78+
#: admin/partials/plugin-note-markup.php:45
79+
msgid "+ Add plugin note"
80+
msgstr "+Megjegyzés hozzáadása"
81+
82+
#: admin/partials/plugin-note-markup.php:49
83+
msgid "Note type:"
84+
msgstr "Megjegyzés típusa:"
85+
86+
#: admin/partials/plugin-note-markup.php:58
87+
msgid "Save note"
88+
msgstr "Megjegyzés mentése"
89+
90+
#: admin/partials/plugin-note-markup.php:61
91+
msgid "Cancel"
92+
msgstr "Megszakít"
93+
94+
#: admin/partials/plugin-note-markup.php:72
95+
msgid "You are not authorized to perform this operation."
96+
msgstr "Nem vagy jogosult a művelet végrehajtására."

plugin-notes-plus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* Current plugin version.
3535
* Start at version 1.0.0 and use SemVer - https://semver.org
3636
*/
37-
define( 'PLUGIN_NOTES_PLUS_VERSION', '1.2.0' );
37+
define( 'PLUGIN_NOTES_PLUS_VERSION', '1.2.1' );
3838

3939
/**
4040
* The code that runs during plugin activation.

0 commit comments

Comments
 (0)