Skip to content

Commit 615c5bc

Browse files
author
Eugene Manuilov
committed
Added notification message at library page when allow_url_fopen option is disabled.
1 parent eef00f8 commit 615c5bc

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

classes/Visualizer/Render/Library.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,26 @@ protected function _toHTML() {
146146
echo ' <a href="javascript:;" class="add-new-h2">', esc_html__( 'Add New', Visualizer_Plugin::NAME ), '</a>';
147147
echo '</h2>';
148148

149+
$this->_renderMessages();
149150
$this->_renderLibrary();
150151
echo '</div>';
151152
}
152153

154+
/**
155+
* Renders notification messages if need be.
156+
*
157+
* @since 1.4.2
158+
*
159+
* @access private
160+
*/
161+
private function _renderMessages() {
162+
if ( !filter_var( ini_get( 'allow_url_fopen' ), FILTER_VALIDATE_BOOLEAN ) ) {
163+
echo '<div class="updated error">';
164+
echo '<p>';
165+
printf( esc_html__( '%s option is disabled in your php.ini config. Please, enable it by change its value to 1. This option increases the speed of remote CSV uploading.', Visualizer_Plugin::NAME ), '<b>allow_url_fopen</b>' );
166+
echo '</p>';
167+
echo '</div>';
168+
}
169+
}
170+
153171
}

languages/visualizer-en_US.mo

310 Bytes
Binary file not shown.

languages/visualizer-en_US.po

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: Visualizer\n"
44
"Report-Msgid-Bugs-To: \n"
5-
"POT-Creation-Date: 2014-02-06 11:31+0300\n"
6-
"PO-Revision-Date: 2014-02-06 11:31+0300\n"
5+
"POT-Creation-Date: 2014-02-06 12:33+0300\n"
6+
"PO-Revision-Date: 2014-02-06 12:33+0300\n"
77
"Last-Translator: Eugene Manuilov <[email protected]>\n"
88
"Language-Team: Eugene Manuilov <[email protected]>\n"
99
"Language: en_US\n"
@@ -351,6 +351,15 @@ msgstr "Visualizer Library"
351351
msgid "Add New"
352352
msgstr "Add New"
353353

354+
#: classes/Visualizer/Render/Library.php:165
355+
#, php-format
356+
msgid ""
357+
"%s option is disabled in your php.ini config. Please, enable it by change "
358+
"its value to 1. This option increases the speed of remote CSV uploading."
359+
msgstr ""
360+
"%s option is disabled in your php.ini config. Please, enable it by change "
361+
"its value to 1. This option increases the speed of remote CSV uploading."
362+
354363
#: classes/Visualizer/Render/Templates.php:70
355364
msgid "Insert"
356365
msgstr "Insert"

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
6161
= 1.4.2 =
6262
* Fixed remote CSV uploading issue when allow_url_fopen option is disabled in php.ini
6363
* Replaced flattr image on widget and added donate link to plugin meta data
64+
* Added notification message at library page when allow_url_fopen option is disabled
6465

6566
= 1.4.1.1 =
6667
* Removed CSV parser escape constant to prevent warnings which appears when PHP 5.2.x or less is used

0 commit comments

Comments
 (0)