license->get_license_type(); $valid_license = false; if ( $license_type == 'old' ) { $license = PH()->license->get_current_license(); if ( is_array($license) && empty($license) && get_option( 'propertyhive_license_key', '' ) != '' ) { } elseif ( isset($license['active']) && $license['active'] != '1' ) { } else { if ( isset($license['expires_at']) && $license['expires_at'] != '' ) { if ( strtotime($license['expires_at']) <= time() ) { // Expired } else { // Valid $valid_license = true; } } } } elseif ( $license_type == 'pro' ) { // get new license information if ( get_option('propertyhive_pro_license_key', '') != '' ) { if ( PH()->license->is_valid_pro_license_key() ) { $valid_license = true; } } } if ( !$valid_license ) { $add_ons = ''; if ( false === ( $add_ons = 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) ) { set_transient( 'propertyhive_features', $add_ons, DAY_IN_SECONDS ); } } } if ($add_ons !== FALSE && !empty($add_ons)) { foreach ($add_ons as $add_on) { $url = trim($add_on['url'], '/'); if ( isset($add_on['wordpress_plugin_file']) && $add_on['wordpress_plugin_file'] != '' && $add_on['wordpress_plugin_file'] != false && isset($add_on['wordpress_version_option_name']) && $add_on['wordpress_version_option_name'] != '' && $add_on['wordpress_version_option_name'] != false ) { $plugin_file = $add_on['wordpress_plugin_file']; if ( is_plugin_active($plugin_file) ) { $current_version = get_option($add_on['wordpress_version_option_name'], ''); if ( $current_version != '' ) { // check if add on update available $new_version = $add_on['version']; if ( version_compare($new_version, $current_version) == 1 ) { add_action( 'after_plugin_row_' . $plugin_file, array( $this, 'test' ), 10, 3 ); } } } } } } } } } public function test( $plugin_file, $plugin_data, $status ) { if ( is_network_admin() ) { $active_class = is_plugin_active_for_network( $plugin_file ) ? ' active' : ''; } else { $active_class = is_plugin_active( $plugin_file ) ? ' active' : ''; } echo '