1 <?php
 2 /**
 3  * Addons Page
 4  *
 5  * @author      WooThemes
 6  * @category    Admin
 7  * @package     WooCommerce/Admin
 8  * @version     2.1.0
 9  */
10 
11 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12 
13 if ( ! class_exists( 'WC_Admin_Addons' ) ) :
14 
15 /**
16  * WC_Admin_Addons Class
17  */
18 class WC_Admin_Addons {
19 
20     /**
21      * Handles output of the reports page in admin.
22      */
23     public function output() {
24 
25         if ( false === ( $addons = get_transient( 'woocommerce_addons_data' ) ) ) {
26             $addons_json = wp_remote_get( 'http://d3t0oesq8995hv.cloudfront.net/woocommerce-addons.json', array( 'user-agent' => 'WooCommerce Addons Page' ) );
27             if ( ! is_wp_error( $addons_json ) ) {
28                 $addons = json_decode( wp_remote_retrieve_body( $addons_json ) );
29                 if ( $addons ) {
30                     set_transient( 'woocommerce_addons_data', $addons, 60*60*24*7 ); // 1 Week
31                 }
32             }
33         }
34 
35         $view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : '';
36 
37         include_once( 'views/html-admin-page-addons.php' );
38     }
39 }
40 
41 endif;
42 
43 return new WC_Admin_Addons();
WooCommerce API documentation generated by ApiGen 2.8.0