# sync-basalam/1.10.18/includes/Utilities/TextConverter.php

ووسلام – همگام سازی ووکامرس و باسلام, version 1.10.18. 25 lines.

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.18/code/includes/Utilities/TextConverter.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.18/raw/includes/Utilities/TextConverter.php
- Modified: 2026-09-12T12:46:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sync-basalam/1.10.18/code/includes/Utilities/TextConverter.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Utilities;

defined('ABSPATH') || exit;
class TextConverter
{
    public static function convertHtmlToPlainText($data)
    {
        $data = preg_replace('/\[[^\]]+\]/', '', $data);

        $data = wp_strip_all_tags($data);

        $data = html_entity_decode($data, ENT_QUOTES | ENT_HTML5, 'UTF-8');

        $data = preg_replace('/\bhttps?:\/\/\S+/i', '', $data);

        $data = preg_replace('/\.(jpg|jpeg|png|gif|mp4|webm|avi|mov)\b/i', '', $data);

        $data = str_replace(["\xC2\xA0", '&nbsp;'], '', $data);

        return trim($data);
    }
}

```
