Plugin don't work after the update of wordpress 4.4
-
Hello, my shortcodes don’t work after the update of WordPress 4.4
Anyone else have this problem?
Thanks.
-
I managed to figure out a workaround. It seems that the issue lies in the format of the short code.
[sc:param]
I scanned the code and found that it use to work a different way and they included legacy support for the older versions.
I was able to get all my shortcodes working by using ‘name’ instead of the ‘:’. So,
[sc name="param"]
worked. (alsoname=param
works…quotes not required)weatheredwatcher And where and what to replace? Which files and what to edit?
Fixed version of the plug in here https://github.com/weatheredwatcher/wp-shortcoder
It will insert working code into the editor.
The reason I preferred Shortcoder over other options was because of the shorter shortcodes. Replacing : with name= puts it on par with other plugins. Also, if I have to go back and change every instance of my shortcodes, I might as well do it with a new plugin that’s more future-proof so I don’t have to do this again next year.
As I said earlier, I’ve installed ShortCodes UI and replicated the shortcodes from Shortcoder, so I didn’t have to make any changes to previous posts. It works pretty much the same (just make sure to add the “sc:” part in the new shortcodes), although it’s not intuitive at all and took me a while to figure out.
A quick workaround:
Earlier [sc:SHORTCODE] was working but not after WP 4.4 However, [sc name=SHORTCODE] is still working. If you are using very few shortcodes, you can replace it manually.If you have lots of shortcodes like me, manual update is impossible and error prone. To do it fast and error free, download this script(stable 2.1 version) and upload it to root of your WP installation: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Open the file in browser and go through each step(read carefully each and every instruction as it could permanently damage your database, test run on dev site highly recommended)
then search for “[sc:” and replace it with “[sc name=”
Hope it will help!
Hi All,
Extremely sorry for the delay.
Please insert the following code in any of the below files:
wp_content\themes\{active_theme}\functions.php (or) wp_content\plugins\shortcoder\shortcoder.php
Code:
function sc_replacecolon( $content ){ return str_replace( '[sc:', '[sc name=', $content ); } add_filter( 'the_content', 'sc_replacecolon', 5 );
This code can be inserted anywhere in these two files. There is no specific location in file.
The issue:
WordPress stopped recognizing shortcodes with ‘colon’ and other special characters in shortcode names in 4.4.
The fix/workaround:
Gladly, shortcoder supports a format without any ‘colon’ by using the name attribute.
not working: [sc:my_html] working: [sc name="my_html" ]
Please use the name=”your shortcode name” format for shortcoder in posts here onwards.
What the above code does ?
Before sending the post content for processing, the above code replaces ‘:’ with ‘name=’ so that shortcode is recognized by WordPress
Please use the code until I give an official update.
https://www.aakashweb.com/wordpress-plugins/shortcoder/#comment-2402678161
Thanks,
AakashThanks Aakash,
Just to check, is there any specific location where we have to insert mentioned code in wp_content\plugins\shortcoder\shortcoder.php
Thank you!
I’ve been trying to fix this across multiple sites all day.Thanks Aakash, this is the best plugin. Great work. Expecting the official update.
May the Code be with you. ??
I ended using the script that Neerav Dobaria posted above.
Here it is again:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/Replaced over 200 instances of my shortcodes on my site pretty easily. It can be risky to use, so use at your own risk. It did work well for me though.
If using the script above, here are some tips to prevent bad things:
1. back up your database, or even your entire site to be extra safe
2. follow the instructions in the script carefully.
3. select only the database tables that you need to edit. For me it was just the wp_posts table.
4. use the dry run feature to see how many changes it would make with your current settings.Glad that you’re still supporting the plugin @vaakash. I checked your website that looked a little untouched for a while and panicked for a bit. =)
Hi Vaakash, with your new update coming can I still use the ‘sc:’ format or do I need to go through my whole site to edit to something else?
I have hundreds of pages with the short code in it so having to edit it will be a nightmare.
ThanksIf plugin stops working, you can resolve the problem by PHPmyAdmin:
- !!! MAKE A BACKUP OF YOUR DB !!!
- open phpMyAdmin;
- open you DB;
- in SQL tab insert next:
UPDATE wp_posts SET post_content = replace(post_content, "[sc:", "[sc name=");
This will replace all entries in DB – from “sc:” to “sc name=”.
And all shortcodes will be ok.If you are using shortcodes in the excerpts, use:
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, "[sc:", "[sc name=");
This solution will work and on WP 4.3.x – so, you can check it even before update to WP4.4.
I appreciate the fix from vaakash. Note that the code update to shortcoder.php only seems to work on shortcodes in pages and posts, and NOT on shortcodes within widgets.
So pages/posts will now work with the colon, i.e. [sc:foo1], but widgets need the alternate structure, i.e. [sc name=”foo1″].
- The topic ‘Plugin don't work after the update of wordpress 4.4’ is closed to new replies.