Plugin Directory

Changeset 1917953


Ignore:
Timestamp:
08/01/2018 03:19:10 AM (7 years ago)
Author:
userdeck
Message:

Tagging version 1.1.6

Location:
userdeck
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • userdeck/trunk/readme.txt

    r1873061 r1917953  
    44Requires at least: 3.7
    55Tested up to: 4.9
    6 Stable tag: 1.1.5
     6Stable tag: 1.1.6
    77
    88Easily integrate UserDeck's embedded support software into your WordPress website.
     
    5151== Upgrade Notice ==
    5252
     53= 1.1.6 =
     54Fixed bug with empty content when fetching guide seo content.
     55
    5356= 1.1.5 =
    5457Fixed bug with registering sitemaps with seo plugin if guide is not setup.
     
    8487
    8588== Changelog ==
     89
     90= 1.1.6 =
     91* Fixed bug with empty content when fetching guide seo content
    8692
    8793= 1.1.5 =
  • userdeck/trunk/userdeck.js

    r1213874 r1917953  
    1111        }
    1212
    13         var iframe = jQuery('<iframe id="iframe-guides" src="https://app.userdeck.com/' + type + '?redir=' + start + '" width="400" height="600" frameborder="0" ALLOWTRANSPARENCY="true"></iframe>')
     13        var iframe = jQuery('<iframe id="iframe-guides" src="https://app.userdeck.com/' + type + '?redir=' + start + '" width="400" height="600" frameborder="0" ALLOWTRANSPARENCY="true"></iframe>');
    1414
    1515        wrapper.append(iframe);
  • userdeck/trunk/userdeck.php

    r1873061 r1917953  
    44 * Plugin URI: http://wordpress.org/plugins/userdeck
    55 * Description: Embedded customer support from <a href="http://userdeck.com?utm_source=wordpress&utm_medium=link&utm_campaign=website">UserDeck</a> that embeds into your website.
    6  * Version: 1.1.5
     6 * Version: 1.1.6
    77 * Author: UserDeck
    88 * Author URI: http://userdeck.com?utm_source=wordpress&utm_medium=link&utm_campaign=website
     
    4545        $this->add_actions();
    4646        $this->add_filters();
    47         $this->add_shortcodes();
    4847       
    4948    }
     
    9291        add_filter( "plugin_action_links_$plugin", array( $this, 'add_action_links' ) );
    9392        add_filter( 'plugin_row_meta', array( $this, 'add_plugin_meta_links' ), 10, 4 );
    94     }
    95    
    96     public function add_shortcodes() {
    97        
    98         add_shortcode( 'userdeck_guides', array( $this, 'output_guides_shortcode') );
    99        
    10093    }
    10194   
     
    200193    }
    201194   
    202     public function has_guide_meta() {
    203        
    204         global $post;
     195    public function has_guide_meta( $post ) {
    205196       
    206197        $guides_key = get_post_meta($post->ID, 'userdeck_guides_key', true);
    207198       
    208199        if (!empty($guides_key)) {
    209             return true;
     200            return $guides_key;
    210201        }
    211202       
     
    255246        $post = $this->guide_page;
    256247       
    257         if ( empty( $post ) ) {
     248        $guides_key = $this->has_guide_meta( $post );
     249       
     250        if ( empty( $guides_key ) ) {
    258251            return '';
    259252        }
    260253       
    261         $guides_key = get_post_meta($post->ID, 'userdeck_guides_key', true);
    262 
    263254        $sitemap_url = 'https://userdeck.net/g/' . $guides_key . '/sitemap.xml';
    264255
     
    288279        $post = $this->guide_page;
    289280       
    290         if ( empty( $post ) ) {
     281        $guides_key = $this->has_guide_meta( $post );
     282       
     283        if ( empty( $guides_key ) ) {
    291284            return;
    292285        }
    293        
    294         $guides_key = get_post_meta($post->ID, 'userdeck_guides_key', true);
    295286
    296287        $sitemap_url = 'https://userdeck.net/g/' . $guides_key . '/sitemap.xml';
     
    435426        if ( isset( $post ) && is_page() ) {
    436427       
    437             $guides_key = get_post_meta($post->ID, 'userdeck_guides_key', true);
     428            $guides_key = $this->has_guide_meta( $post );
    438429           
    439430            if (!empty($guides_key)) {
     
    447438    }
    448439   
    449     public function output_guides_shortcode() {
    450        
    451         // retrieve the options
    452         $options = $this->get_settings();
    453        
    454         $guides_key = $options['guides_key'];
    455        
    456         return $this->output_guides_code($guides_key);
    457        
    458     }
    459    
    460440    /**
    461441     * output the userdeck guides javascript install code
     
    466446        $content = '';
    467447
    468         if (isset( $_GET['_escaped_fragment_'] )) {
    469 
    470             $path = '';
    471 
    472             if ( $_GET['_escaped_fragment_'] ) {
    473                 $path = $_GET['_escaped_fragment_'][0] == '/' ? substr( $_GET['_escaped_fragment_'], 1 ) : $_GET['_escaped_fragment_'];
    474             }
     448        if ( $this->is_escaped_fragment_request() ) {
     449
     450            $path = $this->escaped_fragment_path();
    475451
    476452            $base_uri = 'https://userdeck.net/g/' . $guides_key . '/';
     
    481457
    482458            $request = wp_remote_get( $base_uri . $path );
    483 
     459            $status = wp_remote_retrieve_response_code( $request );
    484460            $content = '';
    485 
    486             if ( wp_remote_retrieve_response_code( $request ) == 200 ) {
     461            $body = '';
     462           
     463            if ( $status == 200 ) {
    487464                $content = wp_remote_retrieve_body( $request );
    488465            }
    489466
    490             preg_match('/\<body\>(.*?)\<\/body\>/is', $content, $body);
    491             $body = $body[1];
     467            if ( preg_match('/\<body\>(.*?)\<\/body\>/is', $content, $body ) ) {
     468                $body = $body[1];
     469            }
     470            else {
     471                $body = $content;
     472            }
    492473           
    493474            $content = strstr($body, '<div class="content">');
    494            
    495475            $content = str_replace('/g/'.$guides_key.'/', get_permalink().'#!', $content);
    496476
     
    507487    }
    508488   
    509     public function generate_guides_shortcode($guides_key) {
    510        
    511         return '[userdeck_guides key="'.$guides_key.'"]';
     489    public function is_escaped_fragment_request() {
     490       
     491        return isset( $_GET['_escaped_fragment_'] );
     492       
     493    }
     494   
     495    public function escaped_fragment_path() {
     496       
     497        $path = '';
     498       
     499        if ( $_GET['_escaped_fragment_'] ) {
     500            $path = $_GET['_escaped_fragment_'][0] == '/' ? substr( $_GET['_escaped_fragment_'], 1 ) : $_GET['_escaped_fragment_'];
     501        }
     502       
     503        return $path;
    512504       
    513505    }
     
    518510       
    519511        if ( isset( $post ) && is_page() ) {
    520             if ($this->has_guide_meta() || has_shortcode( $post->post_content, 'userdeck_guides' ))
     512            if ( $this->has_guide_meta( $post ) )
    521513            ?>
    522514            <meta name="fragment" content="!">
Note: See TracChangeset for help on using the changeset viewer.