HJI WP Membership Code Reference
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Slipstream API Docs

Namespaces

  • hji
    • AgentRoster
      • controllers
      • models
      • utils
    • common
      • factories
      • interfaces
      • models
      • utils
    • construction
      • admin
        • controllers
        • models
      • core
      • front
        • controllers
      • interfaces
      • models
        • listings
        • subdivisions
      • views
    • geofarms
      • common
      • controllers
      • models
      • widgets
    • homevalue
      • controllers
      • core
        • abstracts
      • models
    • lifestylefinder
    • listingstoblog
      • controllers
    • membership
      • abstracts
      • controllers
      • entities
      • extension
        • abstracts
        • interfaces
      • factories
      • includes
      • interfaces
      • models
        • data
        • webservice
          • abstracts
          • actions
          • interfaces
      • observers
      • services
    • recentsales
      • controllers
      • tinymce
      • widgets
    • ResponsiveIDX
      • abstracts
      • adapters
      • controllers
      • core
        • abstracts
      • entities
      • models
      • services
      • tinymce
      • utils
      • widgets
    • schools
      • controllers
      • tinymce
      • widgets
    • users
      • abstracts
      • admin
        • controllers
        • models
      • controllers
      • core
        • abstracts
      • entities
      • models
      • utils
  • None
  • REL
    • controllers
    • Models
    • Taxonomies
    • Utils
      • Convert
    • widgets

Classes

  • hji\AgentRoster\AgentRoster
  • hji\AgentRoster\controllers\AgentRosterAdmin
  • hji\AgentRoster\controllers\Testimonials
  • hji\AgentRoster\models\TestimonialsModel
  • hji\AgentRoster\utils\ContactForm
  • hji\common\factories\mcePluginFactory
  • hji\common\factories\WidgetTrioFactory
  • hji\common\interfaces\AbstractSettingsModel
  • hji\common\interfaces\Shortcode
  • hji\common\interfaces\Widget
  • hji\common\interfaces\WidgetShortcode
  • hji\common\models\Alerts
  • hji\common\models\GForms
  • hji\common\models\JsVars
  • hji\common\models\mcePluginModel
  • hji\common\models\Notices
  • hji\common\models\PluginJsVars
  • hji\common\utils\APIClient
  • hji\common\utils\Cookies
  • hji\common\utils\GFHelper
  • hji\common\utils\HTTP
  • hji\common\utils\ipAddress
  • hji\common\utils\MetaBoxes
  • hji\common\utils\Modal
  • hji\common\utils\Paths
  • hji\common\utils\SiteInfo
  • hji\common\utils\String
  • hji\common\utils\Updater
  • hji\common\utils\Validator
  • hji\common\utils\View
  • hji\common\utils\Views
  • hji\common\utils\WPCache
  • hji\common\utils\WPHelper
  • hji\construction\admin\AdminController
  • hji\construction\admin\controllers\GeneralPageController
  • hji\construction\admin\models\GeneralPageModel
  • hji\construction\App
  • hji\construction\core\Component
  • hji\construction\core\Controller
  • hji\construction\core\DataModel
  • hji\construction\core\DataObjectPostView
  • hji\construction\core\Model
  • hji\construction\core\Paths
  • hji\construction\core\PostModel
  • hji\construction\core\WebService
  • hji\construction\core\Widget
  • hji\construction\front\controllers\ListingsController
  • hji\construction\front\controllers\SubdivisionsController
  • hji\construction\front\FrontController
  • hji\construction\models\Images
  • hji\construction\models\Labels
  • hji\construction\models\listings\ListingModel
  • hji\construction\models\listings\ListingsGetFilters
  • hji\construction\models\listings\ListingsModel
  • hji\construction\models\listings\ListingsSearchFilters
  • hji\construction\models\NCSearchWidget
  • hji\construction\models\NCSearchWidgetViewModel
  • hji\construction\models\Pagination
  • hji\construction\models\Settings
  • hji\construction\models\subdivisions\SubdivisionModel
  • hji\construction\models\subdivisions\SubdivisionsGetFilters
  • hji\construction\models\subdivisions\SubdivisionsGetOptions
  • hji\construction\models\subdivisions\SubdivisionsModel
  • hji\construction\models\subdivisions\SubdivisionsSearchFilters
  • hji\construction\models\subdivisions\SubdivisionsSearchOptions
  • hji\construction\NewConstruction
  • hji\construction\ServiceContainer
  • hji\construction\views\ListingsView
  • hji\construction\views\SubdivisionsView
  • hji\geofarms\common\ImageResize
  • hji\geofarms\common\RewriteRules
  • hji\geofarms\controllers\AreaCache
  • hji\geofarms\controllers\CMB
  • hji\geofarms\controllers\CPT
  • hji\geofarms\controllers\FrontEnd
  • hji\geofarms\controllers\Settings
  • hji\geofarms\controllers\Shortcodes
  • hji\geofarms\controllers\Slipstream
  • hji\geofarms\controllers\Taxonomy
  • hji\geofarms\controllers\TinyMCE
  • hji\geofarms\controllers\UpdateNeighborhoods
  • hji\geofarms\GeoFarms
  • hji\geofarms\models\CMB
  • hji\geofarms\models\CPT
  • hji\geofarms\models\Settings
  • hji\geofarms\models\Slipstream
  • hji\geofarms\models\Taxonomy
  • hji\geofarms\models\TinyMCE
  • hji\geofarms\widgets\Display
  • hji\geofarms\widgets\Map
  • hji\homevalue\controllers\HomeValueTinyMCE
  • hji\homevalue\controllers\HomeValueWidget
  • hji\homevalue\controllers\Settings
  • hji\homevalue\controllers\Shortcodes
  • hji\homevalue\core\abstracts\Component
  • hji\homevalue\core\Controller
  • hji\homevalue\core\Model
  • hji\homevalue\HomeValue
  • hji\homevalue\models\Settings
  • hji\lifestylefinder\LifestyleFinder
  • hji\listingstoblog\controllers\ImportListings
  • hji\listingstoblog\controllers\Settings
  • hji\listingstoblog\ListingsToBlog
  • hji\membership\abstracts\Component
  • hji\membership\abstracts\Controller
  • hji\membership\abstracts\Model
  • hji\membership\controllers\APIClient
  • hji\membership\controllers\CommonScripts
  • hji\membership\controllers\Dependency
  • hji\membership\controllers\DependencyResolver
  • hji\membership\controllers\Dispatcher
  • hji\membership\controllers\Downloads
  • hji\membership\controllers\GForms
  • hji\membership\controllers\ProductManager
  • hji\membership\controllers\ProductRegistrar
  • hji\membership\controllers\RegistryEntry
  • hji\membership\controllers\RequireJs
  • hji\membership\controllers\Settings
  • hji\membership\controllers\UpdateManager
  • hji\membership\entities\Event
  • hji\membership\entities\UserActionEvent
  • hji\membership\extension\abstracts\Component
  • hji\membership\factories\ProductFactory
  • hji\membership\includes\CustomerInfoSynchronizer
  • hji\membership\interfaces\Product
  • hji\membership\Membership
  • hji\membership\models\APIClientModel
  • hji\membership\models\Customer
  • hji\membership\models\data\Address
  • hji\membership\models\data\Image
  • hji\membership\models\data\Images
  • hji\membership\models\data\Paging
  • hji\membership\models\data\Sorting
  • hji\membership\models\DependencyEntity
  • hji\membership\models\DependencyModel
  • hji\membership\models\PluginEntity
  • hji\membership\models\ProductDependencies
  • hji\membership\models\Settings
  • hji\membership\models\ThemeEntity
  • hji\membership\models\UserActionLogger
  • hji\membership\models\UserSession
  • hji\membership\models\webservice\abstracts\QueryProperties
  • hji\membership\models\webservice\abstracts\WebService
  • hji\membership\models\webservice\abstracts\WebServiceFilters
  • hji\membership\models\webservice\actions\ActionsSearchFilters
  • hji\membership\models\webservice\actions\ActionsWebService
  • hji\membership\models\webservice\WebServiceOptions
  • hji\membership\models\WpCatalog
  • hji\membership\observers\EventDispatcher
  • hji\membership\observers\EventLogger
  • hji\membership\services\CPT_Router
  • hji\membership\services\DependencyInjector
  • hji\membership\services\DependencyInjectorInterface
  • hji\membership\services\Request
  • hji\membership\services\Route
  • hji\membership\services\Router
  • hji\membership\services\ServiceContainer
  • hji\membership\services\SocialGraph
  • hji\recentsales\controllers\Shortcodes
  • hji\recentsales\RecentSales
  • hji\recentsales\tinymce\RecentSales
  • hji\recentsales\widgets\RecentSales
  • hji\ResponsiveIDX\abstracts\FilterSchema
  • hji\ResponsiveIDX\adapters\IdxAdapter
  • hji\ResponsiveIDX\adapters\LegalAdapter
  • hji\ResponsiveIDX\adapters\ListingAdapter
  • hji\ResponsiveIDX\controllers\BaseController
  • hji\ResponsiveIDX\controllers\IdxApp
  • hji\ResponsiveIDX\controllers\Pagination
  • hji\ResponsiveIDX\controllers\RecentlyViewed
  • hji\ResponsiveIDX\controllers\RegistrationForm
  • hji\ResponsiveIDX\controllers\Settings
  • hji\ResponsiveIDX\controllers\Upgrader
  • hji\ResponsiveIDX\core\abstracts\Component
  • hji\ResponsiveIDX\core\Controller
  • hji\ResponsiveIDX\core\Model
  • hji\ResponsiveIDX\entities\ComplianceRule
  • hji\ResponsiveIDX\entities\ListingEntity
  • hji\ResponsiveIDX\models\ComplianceModel
  • hji\ResponsiveIDX\models\ComplianceViewModel
  • hji\ResponsiveIDX\models\FieldLabels
  • hji\ResponsiveIDX\models\HashMap
  • hji\ResponsiveIDX\models\IdxSearchModel
  • hji\ResponsiveIDX\models\MarketMetadata
  • hji\ResponsiveIDX\models\PaginationViewModel
  • hji\ResponsiveIDX\models\QuickSearchViewModel
  • hji\ResponsiveIDX\models\SearchFilters
  • hji\ResponsiveIDX\models\SearchParams
  • hji\ResponsiveIDX\models\SearchResultsViewModel
  • hji\ResponsiveIDX\models\ShortcodesModel
  • hji\ResponsiveIDX\models\SpatialMatchModel
  • hji\ResponsiveIDX\ResponsiveIDX
  • hji\ResponsiveIDX\services\ServiceContainer
  • hji\ResponsiveIDX\tinymce\FeaturedListings
  • hji\ResponsiveIDX\utils\ArrayFormat
  • hji\ResponsiveIDX\utils\PluginDependency
  • hji\ResponsiveIDX\utils\StringFormat
  • hji\ResponsiveIDX\utils\View
  • hji\ResponsiveIDX\widgets\FeaturedListings_TinyMCE
  • hji\ResponsiveIDX\widgets\FeaturedListings_Widget
  • hji\ResponsiveIDX\widgets\QuickSearch_Widget
  • hji\schools\controllers\Shortcodes
  • hji\schools\Schools
  • hji\schools\tinymce\Schools
  • hji\schools\widgets\Schools
  • hji\users\abstracts\AdminPageModel
  • hji\users\abstracts\UserAdminTable
  • hji\users\admin\AdminController
  • hji\users\admin\BaseController
  • hji\users\admin\controllers\ActionsPageController
  • hji\users\admin\controllers\UsersPageController
  • hji\users\admin\models\ActionsPageModel
  • hji\users\admin\models\UsersPageModel
  • hji\users\controllers\GravityForms
  • hji\users\controllers\GravityFormsAdmin
  • hji\users\controllers\RegistrationPrompter
  • hji\users\controllers\Settings
  • hji\users\controllers\SocialAuth
  • hji\users\controllers\User
  • hji\users\controllers\UserPanel
  • hji\users\core\abstracts\Component
  • hji\users\core\Controller
  • hji\users\core\Model
  • hji\users\entities\GFEntry
  • hji\users\entities\User
  • hji\users\entities\UserProfile
  • hji\users\models\ActionsSearchFilters
  • hji\users\models\ActionsWebServiceOptions
  • hji\users\models\FavoritesViewModel
  • hji\users\models\FrontEndNotices
  • hji\users\models\RegistrationNotificationViewModel
  • hji\users\models\Request
  • hji\users\models\Settings
  • hji\users\models\SettingsTab
  • hji\users\models\User
  • hji\users\models\UserActionsModel
  • hji\users\models\UserFactory
  • hji\users\models\UsersSearchModel
  • hji\users\Users
  • hji\users\utils\GravityFormsHelper
  • hji\users\utils\UserActionsTable
  • hji\users\utils\UserAuth
  • hji\users\utils\UserFavoritesTable
  • hji\users\utils\UserFormEntriesTable
  • hji\users\utils\UserListTable
  • hji\users\utils\UserSearchesTable
  • hji\users\utils\UserSessionsTable
  • REL\controllers\Admin
  • REL\controllers\FSBO
  • REL\controllers\PocketListings
  • REL\controllers\rIDXImport
  • REL\Models\ListingViewModel
  • REL\Models\rIDXImport
  • REL\Models\Upgrades
  • REL\RealEstateListings
  • REL\Taxonomies\CustomTaxonomies
  • REL\Utils\Convert\ListingConverter
  • REL\widgets\PocketListingsSearchWidget
  • REL\widgets\PocketListingsWidget
  • SM_API_Client

Interfaces

  • hji\construction\interfaces\IPost
  • hji\membership\extension\interfaces\ExtensionInterface
  • hji\membership\interfaces\CRUD
  • hji\membership\interfaces\Dispatchable
  • hji\membership\interfaces\EventDispatcherInterface
  • hji\membership\interfaces\Loggable
  • hji\membership\models\webservice\interfaces\IGettable
  • hji\membership\models\webservice\interfaces\ISearchable

Functions

  • __admin_redirect
  • get_pocket_listing
  • hji\membership\controllers\__inject_plugin_table
  • hji\membership\controllers\__inject_theme_table
  • hji_user_favorite_toggle
  • hjigf_display
  • hjigf_display_map
  • hjigf_get_community_feature
  • hjigf_get_post_thumbnail
  • hjigf_has_area_map
  • ridx_get_listing
  • ridx_is_results_page
  • ridx_is_single
  • ridx_is_single_print
  • table_hjpl_cache
  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 
<?php
/**
 * Created by PhpStorm.
 * User: maxchirkov
 * Date: 10/8/14
 * Time: 10:07 AM
 */

namespace hji\common\utils;

SiteInfo::getInstance();

class SiteInfo
{

    /**
     * @var    object    Instance of this class
     */
    private static $instance;

    /**
     * Class constructor
     */
    function __construct()
    {
        if (isset($_GET['qq']))
        {
            $this->init();
        }
    }


    function init()
    {
        $query = json_decode(base64_decode($_GET['qq']));

        if (json_last_error() != JSON_ERROR_NONE ||
            !isset($query->siteinfo))
        {
            return;
        }

        $filters = isset($query->filters) ? $query->filters : null;
        $info = json_encode($this->getSiteInfo($filters));
        die($info);
    }

    /**
     * Get the singleton instance of this class
     *
     * @return object
     */
    public static function getInstance() {
        if ( ! ( self::$instance instanceof self ) ) {
            self::$instance = new self();
        }

        return self::$instance;
    }

    /**
     * Main tracking function.
     */
    function getSiteInfo($filters = array()) {

//        $transient_key = 'yoast_tracking_cache';
//        $data          = get_transient( $transient_key );
//
//        // bail if transient is set and valid
//        if ( $data !== false ) {
//            return;
//        }
//
//        // Make sure to only send tracking data once a week
//        set_transient( $transient_key, 1, WEEK_IN_SECONDS );

        // Start of Metrics
        global $blog_id, $wpdb;

//        $hash = get_option( 'Yoast_Tracking_Hash', false );
//
//        if ( ! $hash || empty( $hash ) ) {
//            // create and store hash
//            $hash = md5( site_url() );
//            update_option( 'Yoast_Tracking_Hash', $hash );
//        }

        $pts        = array();
        $post_types = get_post_types( array( 'public' => true ) );
        if ( is_array( $post_types ) && $post_types !== array() ) {
            foreach ( $post_types as $post_type ) {
                $count             = wp_count_posts( $post_type );
                $pts[ $post_type ] = $count->publish;
            }
        }
        unset( $post_types );

        $comments_count = wp_count_comments();

        $theme_data     = wp_get_theme();
        $theme          = array(
            'name'       => $theme_data->display( 'Name', false, false ),
            'theme_uri'  => $theme_data->display( 'ThemeURI', false, false ),
            'version'    => $theme_data->display( 'Version', false, false ),
            'author'     => $theme_data->display( 'Author', false, false ),
            'author_uri' => $theme_data->display( 'AuthorURI', false, false ),
        );
        $theme_template = $theme_data->get_template();
        if ( $theme_template !== '' && $theme_data->parent() ) {
            $theme['template'] = array(
                'version'    => $theme_data->parent()->display( 'Version', false, false ),
                'name'       => $theme_data->parent()->display( 'Name', false, false ),
                'theme_uri'  => $theme_data->parent()->display( 'ThemeURI', false, false ),
                'author'     => $theme_data->parent()->display( 'Author', false, false ),
                'author_uri' => $theme_data->parent()->display( 'AuthorURI', false, false ),
            );
        } else {
            $theme['template'] = '';
        }
        unset( $theme_template );


        $plugins       = array();
        $active_plugin = get_option( 'active_plugins' );
        foreach ( $active_plugin as $plugin_path ) {
            if ( ! function_exists( 'get_plugin_data' ) ) {
                require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
            }

            $plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_path );

            $slug             = str_replace( '/' . basename( $plugin_path ), '', $plugin_path );
            $plugins[ $slug ] = array(
                'version'    => $plugin_info['Version'],
                'name'       => $plugin_info['Name'],
                'plugin_uri' => $plugin_info['PluginURI'],
                'author'     => $plugin_info['AuthorName'],
                'author_uri' => $plugin_info['AuthorURI'],
            );
        }
        unset( $active_plugins, $plugin_path );


        $data = array(
            'site'      => array(
                'domain'    => site_url(),
                'version'   => get_bloginfo( 'version' ),
                'multisite' => is_multisite(),
                'users'     => $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->users INNER JOIN $wpdb->usermeta ON ({$wpdb->users}.ID = {$wpdb->usermeta}.user_id) WHERE 1 = 1 AND ( {$wpdb->usermeta}.meta_key = %s )", 'wp_' . $blog_id . '_capabilities' ) ),
                'lang'      => get_locale(),
            ),
            'pts'       => $pts,
            'comments'  => array(
                'total'    => $comments_count->total_comments,
                'approved' => $comments_count->approved,
                'spam'     => $comments_count->spam,
                'pings'    => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
            ),
            'options'   => $this->getServerInfo(),
            'theme'     => $theme,
            'plugins'   => $plugins,
        );

        $args = array(
            'body'      => $data,
            'blocking'  => false,
            'sslverify' => false,
        );

        if (!empty($filters))
        {
            $result = array();

            foreach($filters as $filter)
            {
                if (isset($data[$filter]))
                {
                    $result[] = $data[$filter];
                }
            }

            return $result;
        }

        return $data;
//        wp_remote_post( 'https://tracking.yoast.com/', $args );

    }


    function getServerInfo() {
        if ( function_exists( 'curl_version' ) ) {
            $curl = curl_version();
        } else {
            $curl = null;
        }


        $options = array(
            'site_db_charset'             => DB_CHARSET,

            'webserver_apache'            => $this->_is_apache() ? 1 : 0,
            'webserver_apache_version'    => function_exists( 'apache_get_version' ) ? apache_get_version() : 0,
            'webserver_nginx'             => $this->_is_nginx() ? 1 : 0,

            'webserver_server_software'   => $_SERVER['SERVER_SOFTWARE'],
            'webserver_gateway_interface' => $_SERVER['GATEWAY_INTERFACE'],
            'webserver_server_protocol'   => $_SERVER['SERVER_PROTOCOL'],

            'php_version'                 => phpversion(),

            'php_max_execution_time'      => ini_get( 'max_execution_time' ),
            'php_memory_limit'            => ini_get( 'memory_limit' ),
            'php_open_basedir'            => ini_get( 'open_basedir' ),

            'php_bcmath_enabled'          => extension_loaded( 'bcmath' ) ? 1 : 0,
            'php_ctype_enabled'           => extension_loaded( 'ctype' ) ? 1 : 0,
            'php_curl_enabled'            => extension_loaded( 'curl' ) ? 1 : 0,
            'php_curl_version_a'          => phpversion( 'curl' ),
            'php_curl'                    => ( ! is_null( $curl ) ) ? $curl['version'] : 0,
            'php_dom_enabled'             => extension_loaded( 'dom' ) ? 1 : 0,
            'php_dom_version'             => phpversion( 'dom' ),
            'php_filter_enabled'          => extension_loaded( 'filter' ) ? 1 : 0,
            'php_mbstring_enabled'        => extension_loaded( 'mbstring' ) ? 1 : 0,
            'php_mbstring_version'        => phpversion( 'mbstring' ),
            'php_pcre_enabled'            => extension_loaded( 'pcre' ) ? 1 : 0,
            'php_pcre_version'            => phpversion( 'pcre' ),
            'php_pcre_with_utf8_a'        => @preg_match( '/^.{1}$/u', 'ñ', $UTF8_ar ),
            'php_pcre_with_utf8_b'        => defined( 'PREG_BAD_UTF8_ERROR' ),
            'php_spl_enabled'             => extension_loaded( 'spl' ) ? 1 : 0,
        );

        return $options;
    }


    /**
     * Check if the web server is running on Apache
     * @return bool
     */
    function _is_apache() {
        if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'apache' ) !== false ) {
            return true;
        }
        return false;
    }

    /**
     * Check if the web service is running on Nginx
     *
     * @return bool
     */
    function _is_nginx() {
        if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false ) {
            return true;
        }
        return false;
    }
}
HJI WP Membership Code Reference API documentation generated by ApiGen