function get_bundled_plugins($template) { $brainstrom_products = get_option('brainstrom_products') ? get_option('brainstrom_products') : array(); $bsf_product_themes = isset($brainstrom_products['themes']) ? $brainstrom_products['themes'] : array(); if (empty($bsf_product_themes)) { return false; } $id = get_bsf_product_id($template); if (!$id) { return false; } global $bsf_product_validate_url; $path = $bsf_product_validate_url; $data = array('action' => 'bsf_get_bundled_products', 'id' => $id); $request = @wp_remote_post($path, array('body' => $data, 'timeout' => '30', 'sslverify' => false)); if (!is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) { $brainstrom_bundled_products = get_option('brainstrom_bundled_products') ? get_option('brainstrom_bundled_products') : array(); $result = json_decode($request['body']); if (!empty($brainstrom_bundled_products)) { foreach ($result as $bp) { $is_found_in_local = false; foreach ($brainstrom_bundled_products as $key => $bp_local) { if ($bp->id === $bp_local->id) { $is_found_in_local = true; } } if (!$is_found_in_local) { $brainstrom_bundled_products[] = $bp; } } } else { $brainstrom_bundled_products = (array) $result; } update_option('brainstrom_bundled_products', $brainstrom_bundled_products); } }
<div class="bend-content-wrap"> <hr class="bsf-extensions-lists-separator"> <h3 class="bf-ext-sub-title"><?php echo __('Available Extensions', 'bsf'); ?> </h3> <?php global $bsf_theme_template; if (is_multisite()) { $template = $bsf_theme_template; } else { $template = get_template(); } $product_id = get_bsf_product_id($template); $status = check_bsf_product_status($product_id); ?> <?php $brainstrom_bundled_products = get_option('brainstrom_bundled_products') ? get_option('brainstrom_bundled_products') : array(); ?> <?php usort($brainstrom_bundled_products, "bsf_sort"); ?> <?php if (!empty($brainstrom_bundled_products)) { //echo '<pre>'; //print_r($brainstrom_bundled_products); //echo '</pre>'; $global_plugin_installed = $global_plugin_activated = 0; $total_bundled_plugins = count($brainstrom_bundled_products);