Add real-time features to messages

thanks it’s working now :slight_smile: Is it possible to translate all the shown words for the users in german without using Loco Translate? With Loco Translate I have to translate 1300 units manually…

I like it! The one thing I would suggest is providing the ability to add it to the account menu only if the user has sent at least one message, to make it more intuitive for HivePress. This code allows you to add an item to the menu:

add_filter(
	'hivepress/v1/menus/user_account',
	function( $menu ) {
		$menu['items']['custom_name_here'] = [
			'label'  => 'Conversations',
			'url'    => 'custom url here',
			'_order' => 20,
		];

		return $menu;
	}
);

There would need to be some additional code added here to display it only after the user has messaged one person.

3 Likes

Hi there!

I would suggest to translate only that part which you need. I believe there is alot of strings from settings page which is not needed to be translated etc, so there will be much less to translate in real case.

Also you can find some translations at wordpress.org

https://translate.wordpress.org/projects/wp-plugins/bp-better-messages/stable/de/default/?filters[status]=current

Hello, I have installed better messages but now I have 2 call to action button saying send a message and the chating panel has not changed at all.

Hi there!

One button is displayed by Better Messages and 2nd one is displayed by HivePress Messages.

When using Better Messages, you need to disable HivePress Messages plugin as it does not makes sense to use both of the plugins.

Thanks!

1 Like

Hello Andrij,

I am building a Listing website with Vendors and customers. While the listings will be visible without purchasing membership, the ability to message needs to be restricted until they Pay. Memberships will be implemented with the HivePress - Memberships Plugin.

Can the access to Messages be restricted till the user pays for the Membership? and how?

Rgds

Hi there!

Better Messages is currently does not integrated with HivePress - Memberships Plugin unfortunately, but it can be restricted with PHP filters:

Thanks!

Hello Encrypto, I hope you are well! I would like to know if you were able to solve this, I am trying to do the same and still can’t. I really appreciate if you have any information. Thank you so much!

Hi !

I know that there is much to do with all these features proposed by the community, but do you have some update to share for this ?

Thanks

Ethan, hi!

I appreciate your piece of code that made it possible for me to add a tab in my personal profile for posts.

Could you please help me with the code that allowed me to use the short code to substitute the number of missed messages for the “Messages” tab like in the standard plugin?

The shortcode itself is [better_messages_unread_counter hide_when_no_messages=“1” preserve_space=“1”]

But I catastrophically do not understand how to substitute it, for correct display on the site. I tried, but the messages icon is always in the wrong place.

Just released update which contain option to display messages item in HivePress User Menu with messages counter included.

1 Like

I’ve seen your update sir, it’s great :+1:

But, may I please know why the plugin is not sending emails like ’ Send email notifications every (minutes). Set to 0 to disable’ on Hivepress site?

No email is sent by Better Messages, unlike the native Hivepress message extension.

Secondly sir, for a website like Fiverr, can your message plugin handle trouble like the kind described at How to robustly filter contact details globally?

Furthermore, kindly also add CENTER as an option for ‘Onsite notifications position’.

But, may I please know why the plugin is not sending emails like ’ Send email notifications every (minutes). Set to 0 to disable’ on Hivepress site?

No email is sent by Better Messages, unlike the native Hivepress message extension.

Check if your WP Cron is working properly, this plugin is a great tool for that:

Secondly sir, for a website like Fiverr, can your message plugin handle trouble like the kind described at How to robustly filter contact details globally?

Better Messages has similar filter which you can use to make custom restriction like above:

1 Like

Perfect!

WordPress cron was disabled. I enabled it and emails are sent. Thank you.

I’m heading to wordpress.org to drop you 5stars💗

Also, please add an option for admin to monitor chats. That’s admin should be able view the conversation of any user and a vendor, just like Fiverr does, to ensure it doesn’t violate their policy of sharing contact details and taking communication and booking outside of the website.

There is no need to add it, as it already available in WP Admin → Better Messages → Administration page

1 Like

Perfect! :+1:

I wish I can give you more stars… If my project works, I will send Better Massages donations, since the free version is sufficient for me.

Thanks dear😘

Doesn’t work.

add_filter( 'better_messages_before_message_send', 'remove_contact_info_before_send', 10, 2 );

function remove_contact_info_before_send( $input_data, $recipient_id ) {
    // Extracting message from the input data
    $message = isset($input_data['message']) ? $input_data['message'] : '';

    // Define the patterns to search for contact details
    $patterns = array(
        '/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/', // Email pattern
        '/\b\d{10,}\b/' // Phone number pattern
    );

    // Loop through the patterns and check for matches in the message
    foreach ($patterns as $pattern) {
        $message = preg_replace($pattern, '', $message);
    }

    // Update the message in the input data
    $input_data['message'] = $message;

    return $input_data;
}

It will not work as it done completely wrong, you need help of developer to code proper hook