public function generate_post_url($id = 0, $placeholder_flag = false)
 {
     //	$id = 0 means current post to get_permalink function
     $options = get_option('tt_plugin_options');
     //	Do we need to generate the URL? If URL is disabled, we don't.
     //	If one is already provided, we don't.
     if ($options['disable_url'] && is_null($this->my_url)) {
         if ($placeholder_flag) {
             $this->my_url = "";
             return array('shortlink' => '', 'is_placeholder' => false);
         } else {
             return "";
         }
     }
     if (is_null($this->my_url)) {
         //	Yes, we need to generate a URL
         //	Okay then, do we need to construct a shortlink
         if ($options['use_shortlink']) {
             //	Yes, we need a shortlink.
             //	Try getting one the default way
             $short = wp_get_shortlink($id);
             if (empty($short)) {
                 //	No shortlink for whatever reason
                 //	Try using custom functions provided by popular shortlink pluings
                 //	Shortn.it: https://wordpress.org/plugins/shortnit/
                 if (function_exists('the_full_shortn_url')) {
                     $short = get_the_full_shortn_url();
                 } else {
                     $short = get_permalink($id);
                 }
             }
             //	Okay. Now, if the post is not yet published, the shortlink
             //	will be the default WordPress shortlink (the domain and
             //	post id: http://domain.com/?p=123). Most shortlink
             //	customization plugins, like JetPack's WP.me module and
             //	WP Bitly don't generate shortlinks until after the post
             //	is published.
             //
             //	This means that the shortlink we just worked our butts
             //	off to get... might not be correct.  The shortlink
             //	might not have been constructed yet, and WordPress just
             //	doesn't know that.
             //
             //	If this is the case, then we want to return a placeholder
             //	URL that has similar/same length.
             //
             //	Fortunately, there's a function for that which determines
             //	whether the shortlink is accurate or not... sort of.
             if (TT_Tools::is_shortlink_accurate($short)) {
                 //	YAY! It's accurate... probably.  So, use $short
                 $this->my_url = $short;
                 $this->my_url_is_placeholder = false;
             } else {
                 //	Damn... now we need a placeholder...
                 //	Fortunately, there's a function for that...
                 $this->my_url = TT_Tools::placeholder_shortlink();
                 $this->my_url_is_placeholder = true;
             }
         } else {
             //	No, no shortlink, just use normal URL
             $this->my_url = get_permalink($id);
             $this->my_url_is_placeholder = false;
         }
     }
     if ($placeholder_flag) {
         return array('shortlink' => $this->my_url, 'is_placeholder' => $this->my_url_is_placeholder);
     }
     return $this->my_url;
 }