# propertyhive/2.3.1/includes/ph-pro-feature-functions.php

Property Hive, version 2.3.1. 60 lines.

- Page: https://pluginprobe.com/plugins/propertyhive/2.3.1/code/includes/ph-pro-feature-functions.php
- Raw: https://pluginprobe.com/plugins/propertyhive/2.3.1/raw/includes/ph-pro-feature-functions.php
- Modified: 2026-09-16T09:29:48+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/propertyhive/2.3.1/code/includes/ph-pro-feature-functions.php#L10-L20`.

```php
<?php

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}


// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Legacy public global helper get_ph_pro_features; the established callable name is part of the plugin/extension API and must remain stable.
function get_ph_pro_features()
{
    $features = array();

    // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only public feature metadata refresh; no installation, activation or licensing mutation is performed.
    if ( false === ( $features = get_transient( 'propertyhive_features' ) ) || isset($_GET['ph_force_get_features']) ) 
    {
        // It wasn't there, so regenerate the data and save the transient
        $response = wp_remote_get(
            'https://wp-property-hive.com/add-ons-json.php',
            array(
                'timeout' => 10
            )
        );

        if ( !is_wp_error( $response ) && is_array( $response ) )
        {
            $body = $response['body']; // use the content

            $add_ons = json_decode($body, TRUE);
            
            if ( $add_ons !== FALSE && is_array($add_ons) && !empty($add_ons) )
            {
                $features = $add_ons;
                set_transient( 'propertyhive_features', $features, DAY_IN_SECONDS );
            }
        }
    }

    $features = apply_filters( 'propertyhive_pro_features', $features );

    return $features;
}

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Legacy public global helper get_ph_pro_feature; the established callable name is part of the plugin/extension API and must remain stable.
function get_ph_pro_feature( $requested_feature )
{
	$features = get_ph_pro_features();

	foreach ( $features as $feature )
	{
        $slug = explode("/", $feature['wordpress_plugin_file']);
        $slug = $slug[0];

		if ( $slug == $requested_feature )
		{
			return $feature;
		}
	}

	return false;
}
```
