Topic: Cannot Parse Gallery XML

I have a site with multiple simpleviewer pro galleries.

All galleries stopped working after a recent update:

http://www.backroadsproductions.com

I now have Wordpress 4.1, the simpleviewer 2.3.2.4 plugin, and the simpleviewer_pro_2.3.2’s svcore replacing the free version’s svcore directory.

The plugin had been working fine for about a year, up to this update.

I got through a previous update without incident.

I now get this instead of my galleries: “Cannot Parse Gallery XML”.

When I pull the code for just the gallery:

http://www.backroadsproductions.com/wp- … llery_id=1

… and put it in a (Firefox) browser window by itself, I get "This XML file does not appear to have any style information associated with it.”

The galleries are also broken in Safari, and Chrome (I’m on a Mac).

Re: Cannot Parse Gallery XML

The problem seems to be that there is extra HTML code at the end of your gallery's dynamically-generated XML file which is created by the plugin's 'config.php' file.
The extra line of code below the closing </simpleviewergallery> tag is as follows:

<a href="http://mediationcenterofwinchester.com/soma-and/">soma and</a>

This does not come from the stock WP-SimpleViewer files so it looks like your 'config.php' file might have been edited to include this line of code.
Try re-uploading a fresh version of the 'config.php' file (from the WP-SimpleViewer zip package which you can download from this web page) to the 'wp-content/plugins/wp-simpleviewer/' directory on your web server see if this solves your problem.

Steven Speirs
SimpleViewer Support Team

Re: Cannot Parse Gallery XML

RESOLVED!

Turned out to be a theme conflict, with Pinboard, to be specific.

I replaced the config.php in the plugin, but the galleries still didn't show.

After updating the theme, still no change, then...

Switched to a theme called Modularity Lite, and I'm back in business!

Close enough, maybe even better than the old look.

Thanks for your attention.

Re: Cannot Parse Gallery XML

I'm glad that you have been able to resolve your problem.
Thank you for posting back to let me know.

I have installed the Pinboard theme to investigate further. I have discovered that using all default values (for WordPress, Pinboard and WP-SimpleViewer), a SimpleViewer gallery does not display but not because of any problem with the dynamically-generated XML file.

I have discovered that the Pinboard theme loads the 'jquery.fitvids.js' file into your web pages.
This JavaScript file is designed to resize videos. However, it looks like the 'jquery.fitvids.js' JavaScript file sees the 'simpleviewer.swf' file (embedded internally using an <object> tag) as a video, fails to determine the correct aspect ratio and wraps the <object> tag in a parent container with a large CSS padding-top value pushing the gallery images down the container and out of view.

If you do not have any videos in your WordPress site, then you could simply prevent the loading of the 'jquery.fitvids.js' file by editing the 'pinboard/functions.php' file in a plain text editor and commenting out (by prepending two slashes '//' to the beginning of the line) or removing line 595:

wp_register_script( 'fitvids', get_template_directory_uri() . '/scripts/jquery.fitvids.js', array( 'jquery' ), null );

It looks like the order in which the 'jquery.fitvids.js' and 'simpleviewer.js' files are loaded into the web page also makes a difference.
In WP-SimpleViewer v2.4.2.4, try opening the 'wp-simpleviewer.php' file in a plain text editor and replace the shortcode_check function (lines 153 to 169 inclusive) with the following:

/**
 * Shortcode check
 *
 * @param array posts
 * @return array posts
 */
function shortcode_check($posts) {
    if (!empty($posts) && !is_search() && !$this->required_core) {
        foreach ($posts as $post) {
            if (preg_match('/\[simpleviewer.*?gallery_id="[1-9][0-9]*".*?\]/i', $post->post_content)) {
                $this->required_core = true;
                add_action('wp_enqueue_scripts', array(&$this, 'add_scripts_wp_core'));
                break;
            }
        }
    }
    return $posts;
}

I do not know if SimpleViewer can be made to prevent this from happening but I have notified the developers of this problem.

I hope this helps.

Steven Speirs
SimpleViewer Support Team