• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

XenWord Development in December

Status
Not open for further replies.

LPH

Flight Director
Flight Instructor
During Thanksgiving, considerable progress was made on the Jefferson release. Two showstopper bugs remained. The activation bug was the most severe bug and it was fixed during the first week of December. The avatar bug remains. There is a switch in XenWord 3.0.0.06 to allow the administrator to use avatar code that works for WordPress 4.3. Working code for WordPress 4.4 remains elusive, but there is a partial solution.

XenWord 3.0.0.06 was made available to everyone with a license yesterday. This allows greater testing of all the new code.

There is now an roadmap in the Announcement forums as well as an updated changelog.

XenWord 3.0.0.07 is already activated on the local development server and should be updated on xenword.wpide.net soon. This is planned for today's major task. WPIDE still doesn't have team developer features but they are working on it.

Focus remains on moving the plugin to OOP and stable code for a general release. WordPress 4.4 may release Tuesday December 8.

@RLL joined the coding team the other day and is looking over the structure of the files as well as coming up to speed. His background is in C++ and not PHP. His contributions should push this plugin forward. In fact, we sat down for a few hours this past week and found and fixed a few bugs.

@LPH housing situation is slightly modified. Verizon will install FiOS 150/150 into his new home in the late afternoon on Monday December 14. Until then, internet access will be spotty.

@Gracie will work on the documentation articles. The article upgrades will be done first.
 

Tecca

Tween Bird
XenWord Owner
I haven't been around much lately since I haven't had the need to upgrade XenForo/WordPress on the site that runs XenWord. But decided I had the time tonight and made the jump from XenWord 2.4.1.07 to 3.0.0.08. All went smoothly. Thanks for all the hard work you put into this plugin, it's definitely not going unnoticed!
 

LPH

Flight Director
Flight Instructor
Thank you @Tecca.

The activation issues might finally be getting cleaned up, with more people installing the plugin. The avatars under WP 4.4 remain an issue but I'm sure we'll get it.
 

LPH

Flight Director
Flight Instructor
I've gone as far as possible with the discussion link bug. The remaining issue is the pulling of the comments from XenForo, therefore, the comments code will be split into two different files:
  1. class-xenword-wordpress-comments.php
    • -- Code writing WordPress comments to XenForo replies
  2. class-xenword-forum-replies.php
    • -- Code writing XenForo replies into WordPress comments
This will require the class-xenword-xenforo-replies.php to write XenForo replies to the WordPress database. Currently the plugin doesn't write to the WordPress comments table. This will be a massive change but important one so that replies can also be done in the WordPress admin panel by an admin.

A quick outline:
PHP:
if (XF_post_ID == post_id) {
    // return and do nothing
} else {
    // Write the XenForo reply to WordPress comment
}

It'll take time to do this work but it'll fix the comments bug as well as fix the final steps needing repair in the discussion link bug.

This morning I rewrote the 'recent blog post' widget on the XenForo side. This is now updated online for others to use. Basically the code now can pull the feature image as a thumbnail.

@RLL is still working on the avatar bug for WordPress 4.4. If you happen to be a developer and wish to help out then take a look at the code structure provided in 3.0.0.08 and go from there to get the conditionals and URLs built.

Happy Holidays.
 
Last edited:

dethfire

Baby Penguin
XenWord Professional
It'll take time to do this work but it'll fix the comments bug as well as fix the final steps needing repair in the discussion link bug.
Thanks, I just got another member asking why comments were messed up. Glad the issue is being worked on.
 

LPH

Flight Director
Flight Instructor
Thanks, I just got another member asking why comments were messed up. Glad the issue is being worked on.

Yes, this is important but the work attempted today is going to be wiped out. It blew apart the plugin so I'll start at a saved point tomorrow.

Also, you may notice that there is an attempt to have XenWord version 3.0 compatible with wpDiscuz 3.0. This requires the XenForo replies to be written to the WordPress comments table.
 

LPH

Flight Director
Flight Instructor
Finally reset the plugin so I could work on the comments properly. The first step was creating the files. Next, I've re-arranged the XenWord panel to get ready for the writing of WP comments to XenForo and XenForo replies to WP Comments.

There is now a "Thread System" with subsections as well as a "Comment System" with subsections. The main on/off switch for the two systems is the first setting available in each of the respective systems.

The WordPress toolbar also has an important change -- user permissions so that XenWord link can be turned on and not disturb all the other members.

Screen Shot 2015-12-23 at 11.43.57 AM.png

I've also run into a huge snag with the way the plugin was written years ago. It's not appropriate for a WordPress plugin to modify core tables. I didn't know this when I started. It'll take time to move away from this method -- but should be noted that it's important to get rid of that step.

I'll keep working on the comments -- and maybe figure out how to get rid of that part of modifying the comments table -- as well as get comments to properly use the meta information.
 

LPH

Flight Director
Flight Instructor
One more change that wasn't mentioned above ...

The Advanced User Mapping has been painful alpha code. The Redux Framework development team showed me today how to get a pull down of the UserGroup IDs and Titles from XenForo into an array for the framework init file. It's not exactly what is needed but this is a huge leap forward on understanding the arrays in the framework.

Screen Shot 2015-12-23 at 1.15.49 PM.png

It sure would be nice to get this feature back into XenWord 3.0 -- especially since it was in the 1.0 releases ;)
 

LPH

Flight Director
Flight Instructor
Uploaded the XenWord 3.0.0.09 files and activated the plugin on the collaboration server. Immediately noticed that the default XenForo avatar is now loading properly in the WordPress Users Panel.

XW 3.0.0.09 Users Screenshot.png

Cool. Maybe I just didn't notice in 3.0.0.08. ;)
 

LPH

Flight Director
Flight Instructor
Kevin from Redux Framework has been a tremendous help and showed me how to include arguments in the XenWord init file. He spent the evening working on the User Mapping and now the Advanced User Mapping is back -- and out of alpha. The feature has been moved to beta. Make sure you check out this feature once 3.0.0.09 is available for download !

XenWord 3.0.0.09 User Mapping.png
 

LPH

Flight Director
Flight Instructor
Unbelievable. I was sitting with family and a few lines of code were bothering me. Long story short -- I sat down with the computer, looked at the code and realized all of the excuses for not using postmeta table were just silly.

Thread creation was nothing more than these two lines:

PHP:
            update_post_meta ( $post->ID , 'thread_id', $thread_id );
            update_post_meta ( $post->ID , 'forum_id', $thread_id );

There was absolutely no reason to modify the WordPress post table. Calling the thread_id is simple, too:

PHP:
        $thread_ids = get_post_custom_values( 'thread_id', $post_id );

        foreach ( $thread_ids as $thread_id) {
            if ( $thread_id != 0 ) {
                return $thread_id;
            } else {
                return false;
            }
        }

And that is it ! With a few tweaks of XenWord code, the release 3.0.0.10 no longer relies on modifying the post table. After two years of doing this "the wrong way" -- it's now fixed.

This leaves learning how to add/update comments to the comments table.

PS. Yes, it's 2:41 am in the morning. The final parts to the code were swirling around in my head and I couldn't sleep. Now, it's time to get some sleep.
 

LPH

Flight Director
Flight Instructor
Spent the last few days trying to figure out why the above update_post_meta stopped working on a test environment. I reset the WordPress database and the WordPress post wouldn't write to the XenForo database. After days of stripping things out and re-writing files, it turned out to be a "hidden bug" that existed since the beginning of XenWord.

The function xenword_insert_thread in the file class-xenword-thread-creation.php set the variable $author to user_nicename. If the user_nicename is empty then the thread wouldn't write to the XenForo database.

PHP:
    $author_id      = $post->post_author;
    $author         = get_the_author_meta( 'user_nicename', $author_id );

    if (empty( $author )) {
        $visitor = XenWord::getVisitor();
        $author= $visitor['username'];
    }

Now I can move forward and look at the comments, however, the preprocess_comments hook is going to be a challenge.
 

LPH

Flight Director
Flight Instructor
Jeremy at XenForo helped me tonight fix code so that WordPress tags are now copied into the XenForo thread tags. Here is a sample screenshot.

Screen Shot 2015-12-30 at 9.08.50 PM.png
 

LPH

Flight Director
Flight Instructor
Spent a little time working on the login widget. In particular adding some of the span tags and adding CSS to the class-public.css. The challenge in the CSS is pointing to the URL of the images for twitter and Google. They are hardcoded for the local development environment. The Google button isn't working right now, either. But the login widget is starting to take shape.

Screen Shot 2015-12-31 at 3.17.37 PM.png
 
Status
Not open for further replies.
Top