API_url = add_query_arg(array('main_product' => 'anspress'), $this->API_url); $this->set_results(); } /** * Fetch the results from AnsPress project site and cache it locally * @since 2.0.0-alpha2 * @return void */ public function set_results() { $fetch = get_transient( 'anspress_extensions_fetch' ); if($fetch === false){ $fetch = wp_remote_get( $this->API_url); $json = $fetch['body']; set_transient('anspress_extensions_fetch', $fetch, 60 * 5); } if(! is_wp_error($fetch) && !empty($json)){ $this->result = json_decode($json); } } /** * Print lists of extensosn * @return void * @since 2.0.0-alpha2 */ public function extensions_lists() { $this->extension_cards(); } public function extension_cards() { global $wp_version; if(!empty($this->result) && is_object($this->result)){ foreach($this->result->extensions as $ext): ?>

description), 0, 100) ?>

author_link.'">'. $ext->author.'') ?>

last_updated, current_time('timestamp') ) . ' ago'; ?>
$ext->tested_upto): ?> Compatible with your version of WordPress', 'ap') ?>