Once it was useful
-
***** for the past
* right nowThis plugin was very useful for many years, thank you for it. but for now it just shows a hexadecimal number instead of the code.
-
Hello Christoph. Thank you for taking the time to provide feedback. It would however be super nice if you could show specifics. While I have not updated the plugin in a long time, it works well on my demo page with the most recent WordPress release: https://gehrcke.de/wp-geshi-highlight-demo. With a tiny bit more information I might feel motivated to help address this. Thank you! Jan-Philip
- This reply was modified 1 year, 6 months ago by Jan-Philip Gehrcke.
- This reply was modified 1 year, 6 months ago by Jan-Philip Gehrcke.
- This reply was modified 1 year, 6 months ago by Jan-Philip Gehrcke.
Well, the problem is as specific as I already told you: “It just shows a hexadecimal number instead of the code.” After I deactivated the addon, the “pre” tags (even with the lang parameter) are displayed as usual.
I would appreciate if you could provide further details that allow for narrowing down the problem:
- Ideally you can let me have a look at the HTML document (source) as it was emitted by your WordPress setup. At the very least a screenshot or textual representation would help. “A hexadecimal number” is not well defined, and might be something like 1 or f or 1f or aa or aab or 0x3c or — well, you get the point: there are different notations, and an infinite amount of numbers. The description is not specific enough for me to know what you have seen.
- The PHP version and the version of the plugin you are/were using.
- Maybe you have an idea what changed in your environment between “Once it was useful” and now. The PHP version? Did you install other plugins? Did you start using a different editor?
Thank you for you help and best regards from Berlin,
Jan-PhilipUnfortunately I can’t provide those details anymore – it’s too long ago. All I can offer is to make another try.
I already installed the newest version again (v1.4.3, WP 6.2, PHP 7.4.33), which is activated right now. You may check the article https://www.juengling-edv.de/messagebox-deluxe/, which shall contain some “VB” code under the topic “Hilfsfunktion”. This code is declared as
<pre lang="VB">
. Instead of the highlighted code, the web site shows “1799831118644fbcadbb174_000000”.You may see the result online:
Public Function MsgBox2( _ Prompt As String, _ Optional Buttons As VbMsgBoxStyle = vbOKOnly + vbInformation, _ Optional Title As String = "", _ Optional HelpFile As String = "Message", _ Optional HelpContext As Long = 0, _ Optional Prompt2 As String = "", _ Optional Prompt3 As String = "") As Long Dim result As Long WizHook.Key = 51488399 result = WizHook.WizMsgBox(Prompt & "@" & Prompt2 & "@" & Prompt3 & "@", Title, Buttons, HelpContext, HelpFile) MsgBox2 = result End Function
- This reply was modified 1 year, 6 months ago by Christoph Jüngling.
Cool. That helps a lot! I also run PHP 7.4.33 and the specific snippet works for me: https://gehrcke.de/test-for-christoph/
Let’s debug this together! Doable.
The 179983…000 you see is the intended(!) outcome of https://plugins.trac.www.ads-software.com/browser/wp-geshi-highlight/tags/1.4.3/wp-geshi-highlight.php#L143. It’s a placeholder. The input was found and its placeholder was put into the doc (so that code ran fine, that’s super good to know!) but the output was not put back into the document.
If you look at ‘my’ test page, it shows (in the HTML doc) something like this:
<style type="text/css"> /** * GeSHi Dynamically Generated Stylesheet ... </style>
That is not in your HTML source code.
That is, either there was a ‘crash’ in https://plugins.trac.www.ads-software.com/browser/wp-geshi-highlight/tags/1.4.3/wp-geshi-highlight.php#L150 (but no PHP error message pops up on your site, or the remaining hooks were not executed. Line 171 is
add_filter('the_content', 'wp_geshi_insert_highlighted_code_filter', 99);
which basically asks wordpress and the theme to invoke a specific function with low priority (late in the processing), to replace the placeholder 179983…000 with the output of the highlighting routine. This function wp_geshi_insert_highlighted_code_filter() never seems to be executed though. We need to find out why that is.
Can you add this at line 151?
echo "<br> right after wp_geshi_highlight_and_generate_css(), this worked<br>";
and then maybe at the end of the function wp_geshi_main() another
echo "<br>executed all add_action() and add_filter() statements<br>";
If none of these show up in the resulting document then we know there is a crash/error in the main geshi routine. This would be hard to debug. If however these messages end up in the HTML document then the actions/filter that the plugin registers (with the main wordpress loop and the theme) were not executed. That might be a specific bad interaction with the theme then.
Would greatly appreciate if you can try this out and provide the feedback. Thank you!
Edit: maybe temporarily do the following in wp-config.php so that we see PHP-emitted errors when rendering the page?
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
- This reply was modified 1 year, 6 months ago by Jan-Philip Gehrcke.
Done. Both show up, but those 2 lines are the only ones of the article to be seen.
I removed those lines again, but can’t upload the screenshot.
- This reply was modified 1 year, 6 months ago by Christoph Jüngling.
OK. Thank you so much. As suspected before: that makes it highly likely that the remaining actions/filters are registered but after all not executed. To be 100 % sure that the filter functions do not get executed: you can try if the function ?wp_geshi_insert_highlighted_code_filter() is ever being called (via adding an echo statement there, again) around https://plugins.trac.www.ads-software.com/browser/wp-geshi-highlight/tags/1.4.3/wp-geshi-highlight.php#L356. If it is not called then it may be worth asking the Graphene Theme people about why it is not called: something gets in the way before the control is handed back wp-geshi-highlight. It might be the Graphene Theme.
- The topic ‘Once it was useful’ is closed to new replies.