• Resolved DaveHabets

    (@davehabets)


    Today my WP did autoupgrade to 4.01, but the imagemapper does only show the shortcode [imagemap id=”xxx”]. I can add the imagemap with media and i also can edit the excisting imagemaps, but i can’t get them to isplay instead of the shortcode. Please help

    https://www.ads-software.com/plugins/imagemapper/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Confirm – same problem here – nothing in error logs.

    Colored Horse

    (@productioncoloredhorsecom)

    Confirm – I am experiencing the same issue.

    rayw111

    (@rayw111)

    I’m using google maps and it is also not displaying since 4.0.1 upgrade.

    case42

    (@case42)

    same problem – no answers yet – very very bad form….

    grumo64

    (@grumo64)

    Same proble here
    See the shortcode in frontend [imagemap id= ?1132″]

    case42

    (@case42)

    going back a version solved it… but WHY?

    Going back to imagemapper v.1.2.2 brought back the admin menu for “Image map areas”

    However, the shortcode was still not processing – seems to be realated to the quotation marks being modified (note grumo64’s id= ? above)

    I got it to work by editing two lines to just remove the quotation marks (and then removed them from the post as well).

    So my post now has:
    [imagemap id=19]

    The lines I changed are in function ‘imgmap_replace_shortcode’, near line 867 in /wp-content/plugins/imagemapper/imagemapper.php

    /* Insert image map code in posts */
    function imgmap_replace_shortcode($content) {
    	global $imagemaps;
    	preg_match_all('/\[imagemap id=(.*?)\]/', $content, $maps);
    	foreach($maps[1] as $map) {
    		if(!isset($imagemaps[$map]))
    			$imagemaps[$map] = 0;
    		$imagemaps[$map]++;
    
    		$content = preg_replace('/\[imagemap id='.$map.'\]/', get_imgmap_frontend_image($map, $map.'-'.$imagemaps[$map]), $content, 1);
    	}
    	return $content;
    }

    The two lines changed are the two ‘preg_’ statements which were originally:

    preg_match_all('/\[imagemap id=\"(.*?)\"\]/', $content, $maps);
    
    ...
    
    $content = preg_replace('/\[imagemap id=\"'.$map.'\"\]/'...

    BTW, the code above is an example of the *wrong* way to process shortcodes.

    That function need to be re-written to expect the ‘id’ to be passed in, and then the shortcode ‘hooked’ with:

    add_shortcode( 'imagemap', 'imgmap_replace_shortcode' );

    As the developer has already stated on the front page that “[f]urther development resources are very limited. If you need something fixed, most likely you’ll need to fix it yourself.”

    It may be that someone else needs to take up his offer to become a co-author on this plugin.

    taridonohue

    (@taridonohue)

    I am having the same issue and don’t know how to edit. Night before Launch – please help!! If rolling back the version would fix I would need to learn how to do that.

    It is odd that this problem has just now come up. The curly quotation marks issue has been there for years – not sure what changed, probably the order that content filters are applied.

    I have taken a shot at fixing this the proper way, with the modified imagemapper.php file at https://pastebin.com/Afze2S9D

    @taridonohue, if you can get to the main plugin control panel, and click “edit” next to “ImageMapper” to get an edit window for “Editing imagemapper/imagemapper.php” where you can paste in the code from the above pastebin link.

    After that copy/paste, it will say that there’s an update available – an “update” will take you back to the original plugin version (1.2.3), undoing the pasted-in code.

    ssilver

    (@ssilver)

    Thank you Samatva – you are a life saver – could not understand why the image map was only the shortcode.

    Plugin Author Tarmo Toikkanen

    (@tatti)

    Coauthor here. I saw the same problem with 4.0.1. Glad to see you’ve already hacked the problem somewhat. I’ll try to find time today to see if I can pull Samatva’s changes into the main codebase.

    Plugin Author Tarmo Toikkanen

    (@tatti)

    Done. Version 1.2.4 is available and includes Samatva’s fixes.

    Marino Graphics

    (@marino-graphics)

    Thanks for the update, fixed everything!

    Bryan

    Plugin Author Tarmo Toikkanen

    (@tatti)

    Would Samatva be interested in coauthoring the plugin? You seem to have the necessary skills and motivation for it.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘ImageMapper not working after upgrading to WP4.01’ is closed to new replies.