Title: [Plugin: Portfolio Slideshow] Validation errors
Last modified: August 20, 2016

---

# [Plugin: Portfolio Slideshow] Validation errors

 *  Resolved [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/)
 * The plugin throws 22 validation errors upon activation against a strict doctype.
 * It’s not properly wrapped, is missing tags, using non-conformant attributes and
   outputting a css link in the document body.
 * [http://wordpress.org/extend/plugins/portfolio-slideshow/](http://wordpress.org/extend/plugins/portfolio-slideshow/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Thread Starter [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445275)
 * Solved 21 of those errors by stripping the noscript tags from the plugin’s functions.
   php and shorcode.php files.
 *  Plugin Contributor [Dalton Rooney](https://wordpress.org/support/users/daltonrooney/)
 * (@daltonrooney)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445417)
 * The plugin is coded against HTML5 and validates OK in my testing. I haven’t used
   a strict doctype in years…
 *  Thread Starter [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445798)
 * That’s fair enough, I’ve fixed what I need to.
 * You might like to check the plugin in wp debug however – it throws a bunch of
   undefined variables and enque’ing errors.
 *  Thread Starter [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445799)
 * I’ve managed to cure the WP notices etc. by
 * 1. in shortcode.php changing:
    L70: if ( $duration ) to if (!empty($duration))
   L73: if ( $carouselsize >= $ps_count ) to if (!empty($carouselsize) && $carouselsize
   >= $ps_count )
 * 2. in inc/functions.php wrapping all enque script calls as per:
 * function my_scripts_method() {
    //enque scripts go here } add_action(‘wp_enqueue_scripts’,‘
   my_scripts_method’);
 * 3. in inc/functions.php ripping out $ps_options[‘version’], from lines 134 and
   136 – not an especially tidy solution, but I tried everything my limited knowledge
   permits to cure the “undefined variable”, and it works.
 *  Thread Starter [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445800)
 * also I used the enqueue function in portfolio-slideshow-admin.php which cured
   the WP notices in wp-admin.
 *  Plugin Contributor [Dalton Rooney](https://wordpress.org/support/users/daltonrooney/)
 * (@daltonrooney)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445801)
 * Thanks for the heads up. You’re right, we should be running WP-DEBUG when we’re
   testing our plugins. I’ll look into it.
 * FYI – removing the noscript tag from the body will cause problems for users without
   javascript. If at all possible I recommend switching to an HTML doctype and keeping
   it in there.
 *  Plugin Contributor [Dalton Rooney](https://wordpress.org/support/users/daltonrooney/)
 * (@daltonrooney)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445814)
 * OK, we’ve removed all deprecated functions, cleaned up a few unset variables,
   and properly wrapped the enqueue scripts in an init function. I don’t currently
   see any errors with WP-DEBUG turned on. Thanks again for the heads up.
 *  Thread Starter [aljuk](https://wordpress.org/support/users/aljuk/)
 * (@aljuk)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445829)
 * Hi no problem. It’s working fine now except for the following, perhaps worth 
   a heads up:
 * Scenario: user creates post (in my case it’s a custom post type), but forgets
   to upload any images. In the template file that outputs the post I have this 
   call for the plugin: echo do_shortcode(‘[portfolio_slideshow]’). On the front
   end, if I navigate to the post (which has no attached images) I find this:
 * Notice: Undefined variable: ps_nav in /{my-path}/wp-content/plugins/portfolio-
   slideshow/inc/shortcode.php on line 324
 * Notice: Undefined variable: ps_pager in /{my-path}/wp-content/plugins/portfolio-
   slideshow/inc/shortcode.php on line 328
 * I cured it by wrapping at those line numbers like this:
 * if ( $navpos == “bottom” ) {
    if(!empty($ps_nav)) { $slideshow .= $ps_nav; } }
 * if ( $pagerpos == “bottom” ) {
    if(!empty($ps_pager)) { $slideshow .= $ps_pager;}}
 * It’s a guess. I’m not sure if I’m doing the right thing, but it kills the errors
   and all seems well.
 * I realise this is not necessarily a common situation and of course I don’t run
   wp-debug on the production server. I’m just trying to bomb-proof the site for
   my (inexperienced) client and kill debug output messages on my production site
   mirror.
 *  Plugin Contributor [Dalton Rooney](https://wordpress.org/support/users/daltonrooney/)
 * (@daltonrooney)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445837)
 * Thanks again for the heads up, I’ll make sure that’s fixed in the next version.
 *  [netbjarne](https://wordpress.org/support/users/netbjarne/)
 * (@netbjarne)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445906)
 * Hi 🙂
 * First, thanks for a great plugin 🙂
 * I have an otherwise [XHTML 1.0 Strict valid website](http://goo.gl/Y4Ag0), that
   only fails validation once I enable Portfolio Slideshow. Its down to only 7 errors.
 * Is there any chance that the plugin can be modified to valid xhtml?
 * Best regards,
    Bjarne
 *  Plugin Contributor [Dalton Rooney](https://wordpress.org/support/users/daltonrooney/)
 * (@daltonrooney)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445907)
 * Hi Bjarne,
    Sorry, the plugin will not be modified to conform to an XHTML doctype.
   The plugin is 100% compatible with the HTML5 doctype and should work fine in 
   your theme regardless of the doctype. I guess my question for you is why haven’t
   you updated your doctype yet? 🙂
 * Dalton
 *  [lee718](https://wordpress.org/support/users/lee718/)
 * (@lee718)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445913)
 * Hi Dalton,
 * I am using the html5 doctype and have got a similar error as above in my media
   library content.
 * Notice: Undefined variable: post in /Applications/MAMP/htdocs/my-site/wp-content/
   plugins/portfolio-slideshow/inc/functions.php on line 20
 * Notice: Trying to get property of non-object in /Applications/MAMP/htdocs/my-
   site/wp-content/plugins/portfolio-slideshow/inc/functions.php on line 20
 * Any ideas on how I can fix this?

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘[Plugin: Portfolio Slideshow] Validation errors’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/portfolio-slideshow_ffffff.svg)
 * [Portfolio Slideshow](https://wordpress.org/plugins/portfolio-slideshow/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/portfolio-slideshow/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/portfolio-slideshow/)
 * [Active Topics](https://wordpress.org/support/plugin/portfolio-slideshow/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/portfolio-slideshow/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/portfolio-slideshow/reviews/)

 * 12 replies
 * 4 participants
 * Last reply from: [lee718](https://wordpress.org/support/users/lee718/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-validation-errors/#post-2445913)
 * Status: resolved