Plugin Directory

Changeset 2475610


Ignore:
Timestamp:
02/16/2021 02:15:01 PM (5 years ago)
Author:
hyperise
Message:

improved fallbacks

Location:
hyperise-opengraph-tags/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hyperise-opengraph-tags/trunk/hyperise-opengraph-tags.php

    r2439687 r2475610  
    33* Plugin Name: HYPERISE Website Personalisation and OpenGraph personalised link previews
    44* Description: The plugin provides a simple way to add the Hyperise snippet to your website and start personalising your website. This plugin leverages Hyperise.com dynamic images to display personalised images in the preview pane, when you share a link with the utm_hyperef parameter added. Facebook OG tags into your blog's single posts which include Blog Title, Post Title, Description and Dynamic Image (if available).
    5 * Version: 2.5
     5* Version: 2.6
    66* Author: HYPERISE
    77* Author URI: https://hyperise.com
     
    151151       
    152152        if(strlen($meta_title)>0){
    153             $page_title = $meta_title;
     153            $page_title = $meta_title;
    154154        }else{
    155             $page_title = $post->post_title;   
     155            $page_title = $post->post_title;   
    156156        }   
    157157       
     
    208208
    209209        $EnrichedData->utm_hyperef=$utm_hyperef;
     210    }else{
     211        $EnrichedData->m_meta_snippet=get_option( 'hyperise-snippet' );
    210212    }
    211213    return $EnrichedData;
     
    215217
    216218function hyperise_opengraphsingle(){
    217     global $post,$EnrichedData;
     219    global $post,$EnrichedData;
    218220
    219221    if($EnrichedData->m_meta_title == '') {
     
    221223    }       
    222224
    223     echo $EnrichedData->m_meta_snippet;
     225    echo "<!-- HR-2.6: -->";
     226    echo $EnrichedData->m_meta_snippet;
    224227   
    225228    if ( is_single()  || is_page() ) {
     
    227230        if (isset($_GET['utm_hyperef']) || isset($_GET['email'])) {
    228231                       
    229             //Replace the page content personalisation tags with enriched data...
    230             $content = $post->post_content;     
    231             $post->post_content=str_replace("{{utm_hyperef}}",$EnrichedData->utm_hyperef,$post->post_content);
    232             $post->post_content=str_replace("{{email}}",$EnrichedData->email,$post->post_content);
    233             $post->post_content=str_replace("{{first_name}}",$EnrichedData->first_name,$post->post_content);       
    234             $post->post_content=str_replace("{{last_name}}",$EnrichedData->last_name,$post->post_content);     
    235             $post->post_content=str_replace("{{profile_image}}",$EnrichedData->profile_url,$post->post_content);
    236             $post->post_content=str_replace("{{job_title}}",$EnrichedData->job_title,$post->post_content);     
    237             $post->post_content=str_replace("{{business_name}}",$EnrichedData->business_name,$post->post_content); 
    238             $post->post_content=str_replace("{{business_industry}}",$EnrichedData->business_industry,$post->post_content);     
    239             $post->post_content=str_replace("{{business_address}}",$EnrichedData->business_address,$post->post_content);
    240             $post->post_content=str_replace("{{business_lat}}",$EnrichedData->business_lat,$post->post_content);
    241             $post->post_content=str_replace("{{business_long}}",$EnrichedData->business_long,$post->post_content);
    242             $post->post_content=str_replace("{{business_phone}}",$EnrichedData->business_phone,$post->post_content);                                       
    243             $post->post_content=str_replace("{{logo}}",$EnrichedData->logo_url,$post->post_content);
    244             $post->post_content=str_replace("{{website}}",$EnrichedData->website,$post->post_content);
    245             $post->post_content=str_replace("{{website_screenshot}}",$EnrichedData->website_screenshot,$post->post_content);       
     232            //Replace the page content personalisation tags with enriched data...
     233            $content = $post->post_content;     
     234            $post->post_content=str_replace("{{utm_hyperef}}",$EnrichedData->utm_hyperef,$post->post_content);
     235            $post->post_content=str_replace("{{email}}",$EnrichedData->email,$post->post_content);
     236            $post->post_content=str_replace("{{first_name}}",$EnrichedData->first_name,$post->post_content);       
     237            $post->post_content=str_replace("{{last_name}}",$EnrichedData->last_name,$post->post_content);     
     238            $post->post_content=str_replace("{{profile_image}}",$EnrichedData->profile_url,$post->post_content);
     239            $post->post_content=str_replace("{{job_title}}",$EnrichedData->job_title,$post->post_content);     
     240            $post->post_content=str_replace("{{business_name}}",$EnrichedData->business_name,$post->post_content); 
     241            $post->post_content=str_replace("{{business_industry}}",$EnrichedData->business_industry,$post->post_content);     
     242            $post->post_content=str_replace("{{business_address}}",$EnrichedData->business_address,$post->post_content);
     243            $post->post_content=str_replace("{{business_lat}}",$EnrichedData->business_lat,$post->post_content);
     244            $post->post_content=str_replace("{{business_long}}",$EnrichedData->business_long,$post->post_content);
     245            $post->post_content=str_replace("{{business_phone}}",$EnrichedData->business_phone,$post->post_content);                                       
     246            $post->post_content=str_replace("{{logo}}",$EnrichedData->logo_url,$post->post_content);
     247            $post->post_content=str_replace("{{website}}",$EnrichedData->website,$post->post_content);
     248            $post->post_content=str_replace("{{website_screenshot}}",$EnrichedData->website_screenshot,$post->post_content);       
     249       
     250            $post->post_content=str_replace("{{custom_image_1}}",$EnrichedData->custom_image_1,$post->post_content);       
     251            $post->post_content=str_replace("{{custom_image_2}}",$EnrichedData->custom_image_2,$post->post_content);       
     252            $post->post_content=str_replace("{{custom_image_3}}",$EnrichedData->custom_image_3,$post->post_content);
    246253           
    247             $post->post_content=str_replace("{{custom_image_1}}",$EnrichedData->custom_image_1,$post->post_content);       
    248             $post->post_content=str_replace("{{custom_image_2}}",$EnrichedData->custom_image_2,$post->post_content);       
    249             $post->post_content=str_replace("{{custom_image_3}}",$EnrichedData->custom_image_3,$post->post_content);
    250            
    251             $post->post_content=str_replace("{{custom_text_1}}",$EnrichedData->custom_text_1,$post->post_content);
    252             $post->post_content=str_replace("{{custom_text_2}}",$EnrichedData->custom_text_2,$post->post_content);
    253             $post->post_content=str_replace("{{custom_text_3}}",$EnrichedData->custom_text_3,$post->post_content);             
    254             $post->post_content=str_replace("{{custom_text_4}}",$EnrichedData->custom_text_4,$post->post_content);     
    255             $post->post_content=str_replace("{{custom_text_5}}",$EnrichedData->custom_text_5,$post->post_content);     
    256                    
    257             $post->post_title=$EnrichedData->m_meta_title;
    258        
    259             ob_start();
    260             ob_end_clean();
     254            $post->post_content=str_replace("{{custom_text_1}}",$EnrichedData->custom_text_1,$post->post_content);
     255            $post->post_content=str_replace("{{custom_text_2}}",$EnrichedData->custom_text_2,$post->post_content);
     256            $post->post_content=str_replace("{{custom_text_3}}",$EnrichedData->custom_text_3,$post->post_content);             
     257            $post->post_content=str_replace("{{custom_text_4}}",$EnrichedData->custom_text_4,$post->post_content);     
     258            $post->post_content=str_replace("{{custom_text_5}}",$EnrichedData->custom_text_5,$post->post_content);     
     259                           
     260            $post->post_title=$EnrichedData->m_meta_title;
     261   
     262            ob_start();
     263            ob_end_clean();
    261264                           
    262265            if($EnrichedData->seoInstalled <> true AND $EnrichedData->image_template<>"" AND $_GET['utm_hyperef']<>""){
     
    273276                echo '<meta property="og:title" content="',$EnrichedData->m_meta_title,'"/>';
    274277                echo "\n";
    275                 echo '<meta property="og:description" content="',$EnrichedData->m_meta_desc,'"/>';
    276                 echo "\n";
     278                echo '<meta property="og:description" content="',$EnrichedData->m_meta_desc,'"/>';
     279                echo "\n";
    277280                echo '<meta property="og:image" content="',$EnrichedData->image_url,'"/>';
    278281                echo "\n";
  • hyperise-opengraph-tags/trunk/readme.txt

    r2439687 r2475610  
    11=== HYPERISE Website Personalisation and OpenGraph personalised link previews ===
    22Plugin Name: HYPERISE Website Personalisation and OpenGraph personalised link previews
    3 Version: 2.5
     3Version: 2.6
    44Tags: personalisation, linkedin, facebook, hyperise, personalization, personalised,  images, image,  personalized, meta, og , opengraph
    55Author: HYPERISE
    66Author URI: https://hyperise.com
    77Requires at least: 2.9
    8 Tested up to: 5.5
     8Tested up to: 5.6
    99Stable tag: 2.5
    1010
Note: See TracChangeset for help on using the changeset viewer.