# extendify/3.1.5/app/Shared/Controllers/SiteProfileController.php

Extendify, version 3.1.5. 46 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.5/code/app/Shared/Controllers/SiteProfileController.php
- Raw: https://pluginprobe.com/plugins/extendify/3.1.5/raw/app/Shared/Controllers/SiteProfileController.php
- Modified: 2026-08-12T16:23:58+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/extendify/3.1.5/code/app/Shared/Controllers/SiteProfileController.php#L10-L20`.

```php
<?php

/**
 * Controls Site Profile options
 */

namespace Extendify\Shared\Controllers;

defined('ABSPATH') || die('No direct access.');

use Extendify\Shared\Services\Sanitizer;

/**
 * The controller for persisting site data
 */

class SiteProfileController
{
    /**
     * Persist single data
     *
     * @param \WP_REST_Request $request - The request.
     * @return \WP_REST_Response
     */
    public static function store($request)
    {
        $value = $request->get_param('siteProfile');
        // sanitize_text_field() on the raw JSON entity-encodes from the first "<"
        // to the end, corrupting it. Decode first so we sanitize fields, not JSON.
        $siteProfile = is_string($value) ? json_decode($value, true) : $value;
        \update_option('extendify_site_profile', Sanitizer::sanitizeUnknown($siteProfile));
        return new \WP_REST_Response($siteProfile);
    }

    /**
     * Get option data by name.
     *
     * @return \WP_REST_Response
     */
    public static function get()
    {
        $siteProfile = \get_option('extendify_site_profile', []);
        return new \WP_REST_Response($siteProfile);
    }
}

```
