WPIntell

Source evidence

Bug – wp_localize_script

Syntax Highlight · support · 2014-06-09T06:41:00+00:00

mixedsentiment
mediumseverity
0.85relevance
7replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

8 / 34 rows with source links

23.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
vovasik resolved
Does not match the data type, the second argument wp_localize_script: $sh_settings = array_merge( array( 'unsaved_changes_txt' => __('Some changes have not been saved.', 'syntax-highlight') ), $sh_settings); wp_localize_script( $this->js_handle, 'shSettings', $sh_settings); Fix: if(is_array($sh_settings)) { $sh_settings = array_merge(array( 'unsaved_changes_txt' => __('Some changes have not been saved.', 'syntax-highlight') ), $sh_settings); }else{ $sh_settings= array(); } https://wordpress.org/plugins/syntax-highlight/ Hi vovasik, Thank you for noticing this and for providing the solution. However, it is a bit strange that sh_settings variable is not an array. In this case plugin might not work as intended – the settings will not work. Could you tell me what plugins you have activated? I think Syntax Highlight may collide with one of them. Thank you for your message. Regards, Lukasz May be a problem in a custom template of my site, I will write more tomorrow, need to look at the source code Okay, so I look forward to further information. Maybe you could provide me admin access to your WordPress instance? I could also take a look then. Best regards, Lukasz Доступа к своему сайту дать не могу , потому что он локальный. Я проверил плагин на стандартной конфигурации: wordpress 3.9; theme: Twenty Thirteen; plugins: – (только Syntax Highlight); дополнительная информация: php: 5.4 webserver: nginx 1.6 Но это не важно. Проблема в том что классclass SH_Settings возвращает по умолчанию строковые значения, если на странице настроек внести изминения одного из параметров /options-general.php?page=sh_settings то класс SH_Settings вернет массив натроек их из базы данных (get_option). Трудность отладки в вашей установке в этом. Попробуйте протестировать не внося изминений в /options-general.php?page=sh_settings. P.S. архив моей установки https://dl.dropboxusercontent.com/u/87478289/public_html.zip Thank you vovasik for sharing your WordPress installation. I have investigated the issue and the problem was in obtaining the default settings, when there have been no changes in the Settings page. In the latest version (1.0.1) this issue has been resolved. Please update to the latest version and, if it works fine now, I would be grateful, if you could express it on Syntax Highlight plugin page in the Compatibility section at the bottom of the page. Thanks again for noticing the issue. That’s what I tried you convey, thank you Ok, I see. I don’t know Russian and Google Translate didn’t deal good with your post. But most importantly, that the bug is fixed now 🙂

Comments

7 shown
lukasz.webmaster 2014-06-09T14:45:00+00:00

Hi vovasik, Thank you for noticing this and for providing the solution. However, it is a bit strange that sh_settings variable is not an array. In this case plugin might not work as intended – the settings will not work. Could you tell me what plugins you have activated? I think Syntax Highlight may collide with one of them. Thank you for your message. Regards, Lukasz

vovasik 2014-06-09T17:05:00+00:00

May be a problem in a custom template of my site, I will write more tomorrow, need to look at the source code

lukasz.webmaster 2014-06-09T19:15:00+00:00

Okay, so I look forward to further information. Maybe you could provide me admin access to your WordPress instance? I could also take a look then. Best regards, Lukasz

vovasik 2014-06-10T06:18:00+00:00

Доступа к своему сайту дать не могу , потому что он локальный. Я проверил плагин на стандартной конфигурации: wordpress 3.9; theme: Twenty Thirteen; plugins: – (только Syntax Highlight); дополнительная информация: php: 5.4 webserver: nginx 1.6 Но это не важно. Проблема в том что классclass SH_Settings возвращает по умолчанию строковые значения, если на странице настроек внести изминения одного из параметров /options-general.php?page=sh_settings то класс SH_Settings вернет массив натроек их из базы данных (get_option). Трудность отладки в вашей установке в этом. Попробуйте протестировать не внося изминений в /options-general.php?page=sh_settings. P.S. архив моей установки https://dl.dropboxusercontent.com/u/87478289/public_html.zip

lukasz.webmaster 2014-06-10T16:17:00+00:00

Thank you vovasik for sharing your WordPress installation. I have investigated the issue and the problem was in obtaining the default settings, when there have been no changes in the Settings page. In the latest version (1.0.1) this issue has been resolved. Please update to the latest version and, if it works fine now, I would be grateful, if you could express it on Syntax Highlight plugin page in the Compatibility section at the bottom of the page. Thanks again for noticing the issue.

vovasik 2014-06-10T19:07:00+00:00

That’s what I tried you convey, thank you

lukasz.webmaster 2014-06-11T12:41:00+00:00

Ok, I see. I don’t know Russian and Google Translate didn’t deal good with your post. But most importantly, that the bug is fixed now 🙂