Support » Plugin: Map-Generator » [Plugin: Map-Generator] Parse error after update 1.1 -> 1.2

  • I got a parse error after updating from version map-generator 1.1 to 1.2

    Parse error: syntax error, unexpected ‘}’ in /home/eamel/domains/ on line 85

    I’m no hero in php so I haven’t got a clue what this is about. The ting I do know is that I have got a serious problem here; i’ve been using the map-generator plugin for a while now and it gives an error on both sites.

    I’ve tried to find a subversion of this thing (1.1) but it’s no-whwere to find. I’ve mailed the author but it must be night over there.

    Is there anything I can do right now?

    Please help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The code (map-generator.php: line 85 says: } else {

    Plugin Name: Map-Generator
    Plugin URI:
    Description: This Plugin adds custom maps from to your blog. You can now add multible marker, change the Marker apperance, size, view the map as StreetView and much more.
    Version: 1.2
    Author Email:

    Copyright 2012 (

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 3, as
    published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


    class MapGenerator {

    * Constants
    const name = ‘MapGenerator’;
    const slug = ‘mapgenerator’;

    * Constructor
    function __construct() {
    //Hook up to the init action
    add_action( ‘init’, array( &$this, ‘init_mapgenerator’ ) );

    * Runs when the plugin is activated
    function install_mapgenerator() {
    // do not generate any output here

    * Runs when the plugin is initialized
    function init_mapgenerator() {
    // Load JavaScript and stylesheets

    // Register the shortcode [MAP]
    add_shortcode(‘mapgen’, array( &$this, ‘render_shortcode’ ));


    function render_shortcode($atts) {
    // Extract the attributes
    ‘url’ => ‘’, //default url
    ‘width’ => ‘640px’, // default width
    ‘height’ => ‘350px’ // default height
    ), $atts));
    // you can now access the attribute values using $attr1 and $attr2

    // def regex for url
    $reg_exp = ‘/\d+/’;

    // extract the url from the link
    preg_match($reg_exp, $url, $map_gen_id, NULL, 0);

    // check if we got an url or just an id
    $pos = strpos($url, “http://”);

    if ($pos === false) {
    // we got just an id -> fall back to map-generator
    $map_path = “”.$map_gen_id[0].”.js”
    } else {
    // take the given url
    $map_path = $url.”.js”

    // build include tag
    $tag = “<div id=\”map_canvas_custom_”.$map_gen_id[0].”\” style=\”width:”.$width.”; height:”.$height.”\” ></div><script type=\”text/javascript\”>(function(d, t) {var g = d.createElement(t),s = d.getElementsByTagName(t)[0];g.src = \””.$map_path.”\”;s.parentNode.insertBefore(g, s);}(document, \”script\”));</script>”;

    return $tag;

    * Registers and enqueues stylesheets for the administration panel and the
    * public facing site.
    private function register_scripts_and_styles() {
    if ( is_admin() ) {
    add_filter( ‘mce_buttons’, array( $this, ‘filter_mce_button’ ) );
    add_filter( ‘mce_external_plugins’, array( $this, ‘filter_mce_plugin’ ) );

    } else {

    } // end if/else
    } // end register_scripts_and_styles

    function filter_mce_button( $buttons ) {
    // add a separation before our button, here our button’s id is "mygallery_button"
    array_push( $buttons, ‘|’, ‘mapgen_button’ );
    return $buttons;

    function filter_mce_plugin( $plugins ) {
    // this plugin file will work the magic of our button
    $plugins[‘mapgen’] = plugin_dir_url( __FILE__ ) . ‘js/map-generator.js’;
    return $plugins;

    } // end class
    new MapGenerator();


    Plugin Author MapGenerator


    thanks for debugging.

    Just for the record:
    The issue was solved in version 1.3.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Map-Generator] Parse error after update 1.1 -> 1.2’ is closed to new replies.