Support » Plugin: Cool Video Gallery » upgrade to 4.0.1 broke plugin

Viewing 15 replies - 1 through 15 (of 32 total)
  • I am having the same issue. Anyone know of a fix ?

    I downgraded back to 4.0 and it’s back working right again. Didn’t expect a security update in the same version to mess with anything. If anyone does find a fix, do share. Cheers.

    I did the same thing, downgraded to 4.0. CVG works fine now. I will wait for an update from CVG or wordpress to fix the issue.

    WordPress has changed how shortcode quotes work.

    Plugins that do not use the WordPress best practices and instead opt to do custom shortcode attribute parsing with regular expressions, or some other “hackery”, like Cool Video Gallery, will no longer work.

    https://wordpress.org/support/topic/issues-with-wordpress-401-and-shortcodes?replies=1

    Downgrading to 4.0 is not a good idea given the security implications.

    The CVG author needs to use the built-in WordPress shortcode processor.

    Thanks guys! I downgraded to WordPress 4.0 and it works again (I followed instructions at http://www.betterhostreview.com/downgrade-wordpress-earlier-version.html).
    I hope the CVG plugin will be updated soon because our websites can’t stay without it.

    I agree that downgrading to 4.0 is not a good idea for security reasons.

    I’m using something I forked from CVG a while back but that part of the code is still the same it appears. Here is a quick and dirty solution that corrected the problem for me. YMMV.

    Open the cool-video-gallery.php in the cool-video-gallery directory.

    Find the line:
    function CVGVideo_Render($matches){

    Scroll down a few lines and replace this line:
    $video_details = videoDB::find_video($arguments[‘videoId’]);

    With these lines:
    $numb = $arguments[‘videoId’] ;
    $numb = str_replace(‘xxx’, ”, $numb);
    $numb = str_replace(‘yyy’, ”, $numb);
    $video_details = videoDB::find_video( $numb );

    where xxx = the ampersand character(&), followed by the hash character(#), followed by 8217; (no spaces)

    where yyy = the ampersand character(&), followed by the hash character(#), followed by 8242; (no spaces)

    Good luck!
    Tom B

    Hi Tom,

    That didn’t work for me. 🙁

    Anybody else figure out a fix?

    Judy

    Hi Tom,

    Thanks for posting your solution, but it didn’t work for me either. Entering numbers returned the same result: [Gallery not found]. I’m curious as to why you substituted xxx, yyyy instead of simply typing in the &#8217 and &#8242 into the code itself. Are there other possibilities for substitution that might fix this problem?

    Mark

    I didn’t type in the & # 8217 ; as it got interpreted as a single quote character – which is what it is. (Maybe I should have used backticks?)

    You did put the trailing semi-colon at the end of the string?

    Your answer does not include it, and the fact that it hasn’t been converted to a single quote character implies that maybe this is the problem.

    So the lines should look like this without any spaces inside the quotes:

    $numb = str_replace(‘& # 8217 ;’, ”, $numb);
    $numb = str_replace(‘& # 8242 ;’, ”, $numb);

    There are also two other places below this where it uses similar logic. They didn’t need to be changed for me, but maybe yours do.

    Hi Tom,

    I see now, thanks for the clarification. I had missed the trailing semi-colon. Unfortunately, including it still did not solve the problem for me (I tried ‘& # 8217;’ with spaces and ‘ᰱ’ without spaces).

    Currently, my lines are as follows:


    $numb = $arguments[‘videoId’] ;
    $numb = str_replace(‘& # 8217 ;’, ”, $numb);
    $numb = str_replace(‘& # 8242 ;’, ”, $numb);
    $video_details = videoDB::find_video( $numb );

    Hi Mark

    Thanks for sticking at it! Now that change definitely did it for me. As I mentioned there are 2 further places in that php file where find_video is called. I suggest you search for find_video and replace those 2 lines as below, with the 4 lines of $numb code – but definitely no spaces inside the quotes.

    $videoDetails = videoDB::find_video($arguments["videoId"]);

    I note also that the author has used double quotes in these latter 2 cases for videoId – don’t believe that is significant in this case. (I can never remember which quote is which – one evaluates stuff inside it and one doesn’t).

    So that code should end up like ( backticks didnt work for me), with xxx and yyy sub’ed as above.:

    //original $video_details = videoDB::find_video($arguments['videoId']);
        $numb = $arguments['videoId'] ;
        $numb = str_replace('xxx', '', $numb);
        $numb = str_replace('yyy', '', $numb);
        $video_details = videoDB::find_video( $numb );

    Cheers

    Hi Tom,

    Thanks so much for being willing to help troubleshoot this! I too missed the trailing semi-colons. I adjusted the code and also changed the other two lines of find_video code, but still am getting the gallery not found message.

    I’ll keep an eye out for further developments and will see if I can find any other info out three. I am also happy to test out any theories. 🙂

    Judy

    Hi Judy

    Thanks for getting back to me. I am probably at the end of the line with any help I can offer as I forked away from the main plugin a few years ago (i.e. I hacked it about for my own purposes – though this part is still as it was). When mine was not working, the gallery maintenance under admin was still working i.e. you could keep an image for each gallery entry. Is that so for you?

    I’ll download the current plugin code and have a poke around – no promises. Also, the solution I offered is just a quick and dirty to get going again. The post above re using shortcode API rather than “rolling your own” is right on the money. That is the root of the problem and that is why we were getting back the video’s ID (just a number) but wrapped in single quotes, but the quotes were using that HTML (? or one of them) encoding which output them as & # 8127 ; etc etc. And the security patch thinks this may be someone being tricky and injecting something bad …. something like that.

    Sorry, I get carried away.

    Cheers

    Tom

    I checked out the latest code and the only other place that pops out is where it does something similar to show a gallery, rather than an individual video

    function CVGVideo_Gallery($matches){
    	  global $post, $wpdb;
    	  $output = '';
    	  preg_match_all('/([\.\w]*)=(.*?) /i', $matches[1], $attributes);
    	$arguments = array();
    
    	$arguments = CoolVideoGallery::splitargs($matches[1]);
    	$gallery_id = $arguments['galleryId'];

    If this is where you are having problems, then following that last line above insert 2 lines to do the str_replace as suggested but on $gallery_id i.e. add 2 lines that look like (with no spaces inside quotes):

    $gallery_id = str_replace('& # 8217 ; ', '', $gallery_id);
      $gallery_id = str_replace('& # 8242 ; ', '', $gallery_id);

    Hi Tom,

    Lol.

    Yeah, if I understand your question, everything is working fine in the back end.

    And I understand that any fix is temporary. I’m really hoping the developer will update the plugin to be compliant before too long. 🙂

    Judy

Viewing 15 replies - 1 through 15 (of 32 total)
  • The topic ‘upgrade to 4.0.1 broke plugin’ is closed to new replies.