Notifications
Clear all

wpForo 1.x.x [Closed] Some suggestions for v. 1.1.1

9 Posts
2 Users
3 Reactions
8,175 Views
antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 8 years ago

Hi guys! I would like to say a BIG THANKS for this plugin wpForo. The idea is perfect, but wpForo is a young product and I hope that you will make it better and better!

In this version I have found some problems and would like explain their.

1. Untranslated phrases:

file: ajax.js
line: 183

$("#wpf-reply-form-title").html('Reply with quote');
Changed it to:
$("#wpf-reply-form-title").html(wpf_ajax_obj.phrases['reply with quote']);

line: 427

$("#wpf-reply-form-title").html('Edit post');
Changed it to:
$("#wpf-reply-form-title").html(wpf_ajax_obj.phrases['edit post']);

I added this phrases in admin part and now they are displaying correct.

2. The problem with subforums was described by pepi1025. I resolved it by changing file index.php (in folder wpf-themes). The problem was also with main forum title and links to topics in main forum which has a subforum. These links contain a slug from subforum kinda they placed in that subforum.

after line: 67 I added line 68:
<?php $forum = $wpforo->forum->get_forum( array( "slug" => $forum_slug ) ); ?>

After this change all works fine.

3. I have transferred some part of topics from my old forum. They was transferred with correct date and time, but when I am showing such topics an order of posts is incorrect. I changed next:

file: class-posts.php
line: 260
'orderby' => 'postid', // forumid, order, parentid
changed it to:
'orderby' => 'created', // forumid, order, parentid

Now order is right.

4. I don't know why, but on my production server I have a problem with date and time display changing. I would like to see date and time of posts like in WordPress not 'ago'. But this option in admin not worked for me. In any status of this option I see 'ago'. On local server everything works good. I a little bit changed wpforo_date function. May be this will be useful. I added a var $wfwpdate, see below.

function wpforo_date($date, $type = 'ago', $echo = true ) {
	global $wpforo;
	$d = $date;
	$sep = ' ';
	$timestamp = strtotime($date);
	$timezone_string = get_option('timezone_string');
	
	$current_offset = get_option('gmt_offset');
	
	$wfwpdate = wpforo_feature('wp-date-format', $wpforo);
	
	if(!is_string($type)) $type = 'ago';
	
	if( is_user_logged_in() && !empty($wpforo->current_user) ){
		if( isset($wpforo->current_user['timezone']) && $wpforo->current_user['timezone'] != '' ){
			if(preg_match('|UTC([\-\+]+.?)|is', $wpforo->current_user['timezone'], $timezone_array)){
				$timezone_string = '';
				$current_offset = str_replace('+', '', $timezone_array[1]);
			}
			else{
				if(in_array($wpforo->current_user['timezone'], timezone_identifiers_list())){
					$timezone_string = $wpforo->current_user['timezone'];
					$current_offset = '';
				}
				else{
					$timezone_string = '';
					$current_offset = '';
				}
			}
		}
	}
	
	if( $timezone_string == '' && $current_offset != '' ){
		$timezone_string = timezone_name_from_abbr('', $current_offset * 3600, false);	
	}
	
	if( class_exists('DateTime') && class_exists('DateTimeZone') && $timezone_string ){
		$dt = new DateTime("now", new DateTimeZone($timezone_string)); 
		if( method_exists($dt, 'setTimestamp') ) $dt->setTimestamp($timestamp); //DateTime::setTimestamp() available in PHP 5.3 and higher versions
		if( $type == 'human' && !$wfwpdate ){
			$d = human_time_diff($timestamp);
		}
		elseif( $type == 'ago' && !$wfwpdate ){
			$d = human_time_diff($timestamp) . '&nbsp;';
			$d = sprintf( wpforo_phrase('%s ago', false, false), $d );
		}
		else{
			if( $wfwpdate ){
				$date_format = get_option('date_format');
				$time_format = get_option('time_format');
				$type = $date_format . $sep . $time_format;
			}
			$d = date_i18n($type, strtotime($dt->format('d.m.Y H:i:s')));
		}
	}
	else{
		
		if( $type == 'human' && !$wfwpdate ){
			$d = human_time_diff($timestamp);
		}
		elseif( $type == 'ago' && !$wfwpdate ){
			$d = human_time_diff($timestamp) . '&nbsp;';
			$d = sprintf( wpforo_phrase('%s ago', false, false), $d );
		}
		else{
			if( $wfwpdate ){
				$date_format = get_option('date_format');
				$time_format = get_option('time_format');
				$type = $date_format . $sep . $time_format;
			}
			$d = date_i18n( $type, $timestamp);
		}
	}
	
	if( $echo ){
		echo $d;
	}
	else{
		return $d;
	}
}

Now it works! I don't know what a problem with this.

5. Extra space after phrase "Edited". It looks not good by eye. The problem was in next:

file: functions-template.php
line: 617
$edit_html = '<div class="wpf-post-edited">' . wpforo_phrase('Edited: ', false) . wpforo_date($post['modified'], 'ago', false) . '</div>';
changed it to:
$edit_html = '<div class="wpf-post-edited">' . wpforo_phrase('Edited:', false) . wpforo_date($post['modified'], 'ago', false) . '</div>';

6. Layout 3 modification. For me is logic when the author link in the column "Last post" goes to this last post not to author page.

http://i.imgur.com/SBXS1w0.png

And it is very difficult sometimes to click on a small arrow near author link. So I have modified template file: topic.php / layout 3

from:
<div class="wpforo-topic-stat-lastpost"> <span style="white-space:nowrap"> <?php wpforo_phrase('by') ?>&nbsp; <a href="<?php echo esc_url($last_poster['profile_url']) ?>"> <?php wpforo_text($last_poster['display_name'], 9); ?> </a> <a href="<?php echo esc_url($wpforo->post->get_post_url($last_post['postid'])) ?>" title="<?php wpforo_phrase('View the latest post') ?>"> <i class="fa fa-chevron-right fa-sx wpfcl-a"></i> </a> </span><br> <?php wpforo_date($last_post['created']); ?> </div>

to:
<div class="wpforo-topic-stat-lastpost"> <span style="white-space:nowrap"> <a href="<?php echo esc_url($wpforo->post->get_post_url($last_post['postid'])) ?>" title="<?php wpforo_phrase('View the latest post') ?>"> <?php wpforo_phrase('by') . '&nbsp;' . wpforo_text($last_poster['display_name'], 9); ?> <i class="fa fa-chevron-right fa-sx wpfcl-a"></i> </a> </span> <br> <?php wpforo_date($last_post['created']); ?> </div>

7. Please, add a function for changing a user of post. Now for this I every time go to phpMyAdmin. 

8. And the main problem is a number of queries! I checked on local server. I made a clean installation of wpForo and added test topic with 3 replies, opened this topic and page generation - 120 queries of wpForo. 

On my production server page generation of topic with 10 replies - 310 queries of wpForo. 

Topic with 1 question and 2 replies - 224 queries. This is incredible! (For monitoring I use plugin "query monitor")

I think that the main goal for next release must be a decreasing a number of queries and optimization. Not a new functions.

Also I have found some strange queries. In topic with 1 question and 2 replies. Look at image below. Queries: 115, 116, 133, 134. 

Topic id = 588, it has 3 messages in my database these messages have parentid = 0.

I don't understand what do these queries.

 

Thank you! I hope my post will be useful for improve wpForo. I really like it!

8 Replies
antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 8 years ago

Today I have found a problem with css of top menu in Edge and IE.

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Hi antonM

Thank you for this detailed explanation and your contribution. We'll look on all those closer. Please find some answers below:

Topic with 1 question and 2 replies - 224 queries. This is incredible! (For monitoring I use plugin "query monitor")
I think that the main goal for next release must be a decreasing a number of queries and optimization. Not a new functions.
Also I have found some strange queries. In topic with 1 question and 2 replies. Look at image below. Queries: 115, 116, 133, 134.

That's strange, we only see 14 queries when we load topic page with two replies. Have you made any customization? How do you log queries? Do you load widgets or other forum components?

3. I have transferred some part of topics from my old forum. They was transferred with correct date and time, but when I am showing such topics an order of posts is incorrect. I changed next:

Please don't use classes for customization, they get different arguments. This should be changed in template files. More info:

antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 8 years ago

Hi Robert!

That's strange, we only see 14 queries when we load topic page with two replies.

How? I use plugin "Query monitor". If you could explain me how I could make measurements without this plugin. The installation of wpForo is clean. No customizations, sidebars, widgets etc. Clean WP and from plugins only wpForo. 

Could you show your queries for test topic?

This is screenshot for clean WP & wpForo installation:

Please don't use classes for customization, they get different arguments.

Please, check my explanation above. I only added one var for direct method from this class and two checks of this var. Now all works fine, please, check this class. Maybe on different hostings this modification will be useful.

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

Ok, the database queries were cached, the real number of queries is about 120 and they take 0.1-0.2 sec. This is not a good result but this is normal for full functional forum plugin. wpForo is a powerful forum, it has almost all pro forum functions and features, it's like a separate CMS, it can't work with a few queries like other simple plugins. And at the moment I think this result is good for 1.1.x versions, the speed 0.1-0.2 is also not bad. We're improving wpForo performance every day, so please do not worry, this number of queries is being decreased with each update.

wpForo has dozens of more features than BuddyPress and bbPress, but it's faster and use less memory. However it has 32 more SQL query in current version. Here are the test result:

In any case thank you for keeping aware on this issue. We'll work hard to make wpForo as light and fast as possible for sure. The 1.1.x version is not the one which can be introduced with real/best performance, let's wait a little more.

Page 1 / 2