1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Roadmap Version 1.8

Discussion in 'RoadMap' started by shibuya246, Dec 11, 2014.

  1. valMETNG

    valMETNG Administrator Staff Member Admin

    According to this (with reference to this), Hotaru will not send out one email to multiple people given the way it's setup (lines 73 and 161 in libs/EmailFunctions.php). There needs to be a foreach loop. Especially because some hosting providers limit the number of emails per hour, this could become important to larger sites (e.g., if there are multiple people who are subscribed to a comment thread, you don't want to email each individually but, instead, send one bulk email to all recipients).
     
  2. valMETNG

    valMETNG Administrator Staff Member Admin

    I believe function setCurrentUser (line 166) in libs/UserBase.php needs something like the following for plugins like save_post and bookmarking (i.e., function getUserSettings) to work properly:
    Code:
    if (isset($user->user_profile)) { $this->profile = unserialize($user->user_profile); }
    if (isset($user->user_settings)) { $this->settings = unserialize($user->user_settings); }
    (I'm not sure yet if it's needed also in function set or not.)
     
  3. valMETNG

    valMETNG Administrator Staff Member Admin

    I suggest changing how the email confirmation code is generated in function sendPasswordConf of libs/UserBase.php. Currently, it reads:
    Code:
    $pass_conf = md5(crypt(md5($email),md5($email)));
    However, this means that it always generates the same code. We might want to consider something a bit more random.

    Edit: Suggested code for line 520 in libs/UserBase.php:
    Code:
    $pass_conf = md5(crypt(md5($email),md5(random_string(10))));
    Suggested code to replace lines 567-570:
    Code:
        $sql = "SELECT user_id FROM " . TABLE_USERS . " WHERE user_id = %d AND user_password_conf = %s";
         $pass_conf_check = $h->db->get_var($h->db->prepare($sql, $userid, $passconf));
    
         if (!$pass_conf_check) { return false; }
    
         // now clear the code from database
         $sql = "UPDATE " . TABLE_USERS . " SET user_password_conf = NULL WHERE user_id = %d";
         $h->db->query($h->db->prepare($sql, $userid));
     
    Last edited: Feb 6, 2015
  4. Nappingrabbit

    Nappingrabbit New Member

    I am new to hotaru, but I like it and am planning on implementing it. I was disappointed to see that there doesnt seem to have been any development in the last 4 years or so. Now I see thispost where you are talking about a 1.8.

    Is there some underground hole where people are actively working on this project? If so, why nothing in the last 4 years?

    Either way, THANKS! I love it, I find it very fast and efficient enough. Robust, while not a pain in the ass to deal with if you wanna replace some guts.
     
    valMETNG likes this.
  5. valMETNG

    valMETNG Administrator Staff Member Admin

    Welcome. There was a lull but @shibuya246 changed the music and put in a disco ball. Now this party is rockin' :)
     
    shibuya246 and sereban like this.
  6. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Thanks, great to have new people joining in and enjoying themselves at the same time :)

    There was a brief lull period around 2011-12 but we released v 1.5 in 2013 and v 1.6 and v 1.7 in 2014
    We are set for a v 1.8 release in the next few months

    Great to have you on board

    @valMETNG has been doing some great work testing and debugging various parts of the code which have been fed back into the next planned release. Feel free to add anything you see on this thread or start a new thread in the general discussion area as well
     
  7. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    thanks. I will look into all your email code comments here and cook something up. defiintalty an area that
     
  8. valMETNG

    valMETNG Administrator Staff Member Admin

    Looks like the User Manager's Edit Default User Settings is a bit off with <div> alignment. I also see that breadcrumbs seems to be displaying User_manager as the title.

    upload_2015-2-8_14-12-38.png
     
    Song S. Kim likes this.
  9. valMETNG

    valMETNG Administrator Staff Member Admin

    Considering Hotaru is now using summernote, it might be time to start considering a more formal way to clean content. I use htmlpurifier. It's a bit of a pain when it comes to whitelisting sites for iframe videos, but I've worked through it in my build.
     
    shibuya246 likes this.
  10. operan

    operan New Member

    Hello Shibuya, here are some plugins which i believe should be in the future HotaruCMS versions.

    - Advanced Search ( Search for Comments, Users and Posts )
    - Social Login
    -Live Notifications
    -Instant Update
    - Report Comment
    - Filter - the liked/disliked

    I can even help you with the interface if needed on my free time. Below are screenshot for my hotaru site which i'm still working out.
    comment.png index.png write_comment.png
     
  11. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Sure, that would be a good idea.
    If you work on some interfaces I will work on some code to match
     
  12. valMETNG

    valMETNG Administrator Staff Member Admin

    Might be a bit overkill for some sites, but I integrated Zend Search Lucene into might build. (If anyone would like to see how it works, please PM me and I'll PM you my site URL.) It is far too integrated with all of my other customizations to pull out as a plugin, but I can provide general direction and bits of code if this is what is used.

    Effectively, it works on building various indices instead of using MySQL's LIKE. But, to use it effectively, you have to add or remove from you indices after each relevant action. For example, when you add a post, comment, or user (and don't forget category), you need to also add that information to the appropriate index. Likewise, when you delete or modify, you have to do the same. It's quite a bit more complex than a LIKE search, but it also brings more power. You also have to sometimes rebuild the indices because they get inefficient after many adds and deletes (similar to why you sometimes need to run OPTIMIZE on database tables).

    I also integrated flagging for comments but, again, it's not something that can be easily pulled out because it's also integrated with highly customized modqueue and transaction processing functionality. But I should be able to provide some insights as the code is built.
     
  13. valMETNG

    valMETNG Administrator Staff Member Admin

    I'm 99% certain this is a problem with my customizations somewhere but, before I spend too much more time looking for this, wanted to describe a problem I'm seeing. It seems the language cache (on the server) is being deleted at random times and is not being automatically rebuilt. Under what circumstances does Hotaru delete and rebuild the language cache? Shouldn't the language cache be deleted and rebuilt only upon the installation or removal of a plugin?
     
  14. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    the language cache only gets rebuilt on plugin install, or when you manually recreate them in admin maintenance. It should not really be changing any other place. I will try and check the code and see also
     
  15. valMETNG

    valMETNG Administrator Staff Member Admin

    I haven't tracked down the cause of this problem yet, but I noticed something that might be a bug. On line 109 of libs/Language.php, it appears $lang would always be undefined:
    Code:
      public function includeLanguage($h, $folder = '', $filename = '')
       {
         $folder = ($folder) ? $folder : $h->plugin->folder;
    
         if( $folder ) {
    
           // If not filename given, make the plugin name the file name
           $filename = ($filename) ? $filename : $folder;
    
           $file1 = THEMES . THEME . 'languages/' . $filename . '_language.php';
           $file2 = PLUGINS . $folder . '/languages/' . $filename . '_language.php';
    
           // check if this language is already cached
           if( $this->checkLanguageCached($h, $file1) || $this->checkLanguageCached($h, $file2) ) {
             return TRUE;
           }
    
           // Look for the file to load.
           if (file_exists($file1)) {
             // It is in the user theme languages folder.
             $this->addLanguageFile($h, $file1);
           } elseif (file_exists($file2)) {
             // It is in the plugin folder.
             $this->addLanguageFile($h, $file2);
           }
    
           // Add new language to our lang property
           if (isset($lang)) {
             foreach($lang as $l => $text) {
               $h->lang[$l] = $text;
             }
           }
         }
       }
     
  16. valMETNG

    valMETNG Administrator Staff Member Admin

    Thanks. That's what I would have thought. But when I put a few print statements into libs/Language.php, I see that it's constantly cycling through function includeLanguage for each page refresh. For example, when I print file1 and file2 in that function, I see that post_images_language (one of the plugins that appears to not be included in the language cache) appears 210 times. That means that for that plugin alone, this function was called 105 times. That's a problem.
     
  17. valMETNG

    valMETNG Administrator Staff Member Admin

    It's not clear to me how all the language caching works, but here's what I've discovered. Perhaps it will help.

    It appears function callMethodFromPlugin in libs/PluginFunction.php is repeatedly calling function includeLanguage. It's not clear why you'd need to call includeLanguage at all if the language cache is built upon plugin install or admin maintenance. (What harm would it do to remove the calls from lines 228 and 234?) Also, function singleWidget in content/plugins/widgets/widget.php and widget_functions.php both call function includeLanguage as well but, again, it's not clear why you would need to. I'm not sure either of these issues relate to the language cache being partially rebuilt automatically, but fixing them will likely improve performance a bit.

    As an aside, I noticed widget_functions.php also has the following at the top:
    Code:
    require_once('../../../config/settings.php');
    require_once('../../../Hotaru.php');  // Not the cleanest way of getting to the root...
    
    $h = new Hotaru();
    $h->start();
    (Grins)
     
    shibuya246 likes this.
  18. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    yes, It looks like the call to addLanguageFile does the include of the language file and then adds that to $h->lang. There are 2 routes to call the $this->addLanguageFile and then after it makes an attempt to loop through $lang again but as you say $lang doesnt exist here. I think the following on lines 109-113 can be safely deleted with no difference in the result

    Code:
    // Add new language to our lang property
                if (isset($lang)) {
                    foreach($lang as $l => $text) {
                        $h->lang[$l] = $text;
                    }
                }
    
     
    valMETNG likes this.
  19. valMETNG

    valMETNG Administrator Staff Member Admin

    I haven't been able to figure out why the language cache does not always get properly rebuilt (i.e., some plugin language files are left out), but I was able to prevent the issue by commenting out the daily deletion. If anyone else sees this problem, you can comment out the following lines in function getLanguageCache within libs/Language.php so that it looks something like this:
    Code:
      public function getLanguageCache($timeout = 1440)
       {
         if (LANG_CACHE != 'true') { return false; }
    
         $cache_length = $timeout*60;  // seconds
         $cache = CACHE . 'lang_cache/';
         $file = $cache . "language.php";
    
         if (file_exists($file)) {
           // unclear why language cache isn't being rebuilt properly and there isn't any reason we should be rebuilding every 24 hours anyway
    /*       $last_modified = filemtime($file);
           if ($last_modified <= (time() - $cache_length)) {
             // delete cache
             @unlink($file);
             return false;
           } else {
     */
             include($file);
             if (isset($lang) && !empty($lang)) {
               return $lang; // file exists and the language array has been included
             }
           }
    //     }
    
         return false;
       }
     
  20. valMETNG

    valMETNG Administrator Staff Member Admin

    @shibuya246: I'm going to upgrade to PHP 5.6. Anything you're aware of that I should watch out for? Have you tried 5.6 yet? Anything in Hotaru you think will cause issues?
     

Share This Page