WPPA+ Shortcode Generator
-
WPPA+ Shortcode Generator screen (tinymce) has no elements.
-
The general or the photo only generator, or both, and what editor do you use?
The Gutenberg editor in classic mode has the bug that my icons show up but do nothing.Gutenberg is disabled, Classic Editor plugin enabled. It’s the general generator (icon with Asterisk).
This is what i see:
https://betatest.opajaap.nl/wp-content/uploads/Shortcode-generator.PNGAnd this is, what I get: https://fotogruppe-bredenbeck.de/ShortcodeGenerator.PNG.
Btw: WPPA+ API Version: 7.3.08.006Are there (js) errors on the console?
No errors in Firefox or Chrome.
Hi @fgbmaster
I just had the same problem. Turned out there was a conflict with another active shortcode generator, called “Shortcodes Indep”. I simply disabled it and the WPPA+ generator worked again.
I recommand to simply deactivate your plugins one by one and see what happens.
Hope that helpsWhen you “inspect” the page, can you see a:
<div id=”TB_overlay” class=”TB_overlayBG”></div>
into which you might be able to dig further?This is what i figured out on my localhost (WINDOWS):
All went well with
PHP 7.1.32 | WP 5.3 | WPPA 7.2.14
PHP 7.1.32 | WP 5.3 | WPPA 7.3.10
PHP 7.1.32 | WP 5.4 | WPPA 7.3.10
No meore success with
PHP 7.3.16 | WP 5.4 | WPPA 7.3.10
PHP 7.4.4 | WP 5.4 | WPPA 7.3.10
No errors php | js
No plugins except WPPA and classic editorWhen loading the new post page, two ajax calls are made. The second one is:
https://localhost/fgb/wp-admin/admin-ajax.php?action=wppa&wppa-action=tinymcedialog Status is 200 OK, Answer is empty
After all the called WPPA script seems to return nothing or an empty string or null.
Next I dived into wppa-ajax.php
Line 864 callshtmlentities($result)
and this function returns an empty string.
If I callhtmlentities($result, ENT_IGNORE)
, all is fine and the dialog is filled!But
ENT_IGNORE
is discouraged because of security issues …Next I changed the blog language to english and no problem occured.
So the problem must be result of the german translation. There are some ?, ?, ü inside …
var_dump(mb_detect_encoding($result, "UTF-8, ISO-8859-1", true))
returnsstring(10) "ISO-8859-1"
, but If I callhtmlentities($result, "ISO-8859-1")
the ? is shown as ?¤, a typically issue with wrong charset.At last I inspected the file wppa-tinymce-shortcodes.php where
wppa_make_tinymce_dialog()
lives and saved it with no changes but encoding UTF-8.That’s it!
Brilliant sleuthing. Touch forelock!
??To make it short: this solution did not work on my linux machine, because wppa-tinymce-shortcodes.php is already saved with encoding utf-8 ?? and returns ISO-8859-1 anyway.
I checked the output step by step and figured out:
line 505 //'';return var_dump(mb_detect_encoding($result, "UTF-8, ISO-8859-1", true)); // returns UTF-8 :-) $result .= '<option' . ' value="' . $value . '"' . ' >' . $name . ' (' . wppa_get_album_name( $photo['album'] ) . ')' . '</option>'; } line 513 return var_dump(mb_detect_encoding($result, "UTF-8, ISO-8859-1", true)); // returns ISO-8859-1 :-(
Does the function
wppa_get_album_name( $photo['album'] )
return an ISO-string?@opajaap Jacob, I know there where issues with names of photos and/or albums with danish or swedish letters inside. Do you convert them e.g. by using utf8_decode() or utf8_encode? That will cause problems, when the input string is already utf8. Or another file involved is stored with encoding ISO-8859-1. Or a WP function returns an ISO by default. This is hard to find…
Any idea about this?
- This reply was modified 4 years, 7 months ago by FGBmaster.
Today i changed the translation of
Please select a display type
(wppa-tinymce-shortcodes.php:148) frombitte w?hle ...
tobitte wähle ...
and it seems to work.
btw: think there is no problem with 3 found utf8_encode() function calls.I changed the code from my penultimate post so that it converts to UTF8 if necessary.
@opajaap Sent you the file by email.
Thanx for line 505 etc. I will put it unchanged in the next release.
- The topic ‘WPPA+ Shortcode Generator’ is closed to new replies.