# sync-basalam/1.10.9/includes/Services/BasalamAppStoreReview.php

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

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.9/code/includes/Services/BasalamAppStoreReview.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.9/raw/includes/Services/BasalamAppStoreReview.php
- Modified: 2026-08-16T11:47:32+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.9/code/includes/Services/BasalamAppStoreReview.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Services;

use SyncBasalam\Config\Endpoints;
use SyncBasalam\Logger\Logger;

defined('ABSPATH') || exit;

class BasalamAppStoreReview
{
    private string $BasalamAppReviewUrl;
    private $apiService;

    public function __construct()
    {
        $this->BasalamAppReviewUrl = Endpoints::APP_REVIEW;
        $this->apiService = syncBasalamContainer()->get(ApiServiceManager::class);
    }

    public function createReview($comment, $rating = 5)
    {
        $rating = intval($rating);
        if ($rating < 1) $rating = 1;
        if ($rating > 5) $rating = 5;

        $body = [
            "comment" => $comment,
            "rating"  => $rating,
        ];

        try {
            return $this->apiService->post($this->BasalamAppReviewUrl, $body);
        } catch (\Exception $e) {
            Logger::error('خطا در ثبت نظر افزونه: ' . $e->getMessage());
            return [
                'status_code' => 500,
                'body' => null,
                'error' => 'خطا در ثبت نظر: ' . $e->getMessage(),
            ];
        }
    }
}

```
