woocommerce/includes/admin/class-wc-admin-welcome.php

392 lines
128 KiB
PHP
Raw Normal View History

2013-03-01 16:03:10 +00:00
<?php
/**
* Welcome Page Class
*
* Shows a feature overview for the new version (major) and credits.
*
* Adapted from code in EDD (Copyright (c) 2012, Pippin Williamson) and WP.
*
2014-11-17 15:56:36 +00:00
* @author WooThemes
* @category Admin
* @package WooCommerce/Admin
* @version 2.4.0
2013-03-01 16:03:10 +00:00
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
2013-03-01 16:03:10 +00:00
/**
2014-11-17 15:56:36 +00:00
* WC_Admin_Welcome class
2013-03-01 16:03:10 +00:00
*/
class WC_Admin_Welcome {
2013-03-01 16:03:10 +00:00
2015-04-28 11:48:01 +00:00
/** @var array Tweets user can optionally send after install */
private $tweets = array(
'WooCommerce kickstarts online stores. It\'s free and has been downloaded over 6 million times.',
'Building an online store? WooCommerce is the leading #eCommerce plugin for WordPress (and it\'s free).',
'WooCommerce is a free #eCommerce plugin for #WordPress for selling #allthethings online, beautifully.',
'Ready to ship your idea? WooCommerce is the fastest growing #eCommerce plugin for WordPress on the web'
);
2013-03-01 16:03:10 +00:00
/**
2014-11-17 15:56:36 +00:00
* Hook in tabs.
2013-03-01 16:03:10 +00:00
*/
public function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menus') );
add_action( 'admin_head', array( $this, 'admin_head' ) );
2015-04-28 11:48:01 +00:00
shuffle( $this->tweets );
2013-03-01 16:03:10 +00:00
}
/**
2014-11-17 15:56:36 +00:00
* Add admin menus/screens.
2013-03-01 16:03:10 +00:00
*/
public function admin_menus() {
$welcome_page_name = __( 'About WooCommerce', 'woocommerce' );
2013-03-18 12:52:00 +00:00
$welcome_page_title = __( 'Welcome to WooCommerce', 'woocommerce' );
2013-03-18 12:49:13 +00:00
switch ( $_GET['page'] ) {
case 'wc-about' :
$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'wc-about', array( $this, 'about_screen' ) );
2014-11-17 16:42:39 +00:00
add_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) );
break;
case 'wc-credits' :
$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'wc-credits', array( $this, 'credits_screen' ) );
2014-11-17 16:42:39 +00:00
add_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) );
break;
case 'wc-translators' :
$page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'wc-translators', array( $this, 'translators_screen' ) );
2014-11-17 16:42:39 +00:00
add_action( 'admin_print_styles-' . $page, array( $this, 'admin_css' ) );
break;
}
2013-03-01 16:03:10 +00:00
}
/**
* admin_css function.
*/
public function admin_css() {
2014-11-17 16:18:15 +00:00
wp_enqueue_style( 'woocommerce-activation', WC()->plugin_url() . '/assets/css/activation.css', array(), WC_VERSION );
2013-03-01 16:03:10 +00:00
}
/**
* Add styles just for this page, and remove dashboard page links.
*/
public function admin_head() {
remove_submenu_page( 'index.php', 'wc-about' );
remove_submenu_page( 'index.php', 'wc-credits' );
2014-02-07 13:06:20 +00:00
remove_submenu_page( 'index.php', 'wc-translators' );
2013-03-01 16:03:10 +00:00
?>
<style type="text/css">
/*<![CDATA[*/
2013-11-19 16:18:44 +00:00
.wc-badge:before {
font-family: WooCommerce !important;
content: "\e03d";
color: #fff;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 80px;
font-weight: normal;
width: 165px;
height: 165px;
line-height: 165px;
text-align: center;
position: absolute;
top: 0;
2014-08-27 20:26:45 +00:00
<?php echo is_rtl() ? 'right' : 'left'; ?>: 0;
2013-11-19 16:18:44 +00:00
margin: 0;
vertical-align: middle;
}
2013-03-01 16:03:10 +00:00
.wc-badge {
2014-08-28 00:55:32 +00:00
position: relative;
2013-11-19 16:18:44 +00:00
background: #9c5d90;
text-rendering: optimizeLegibility;
2013-03-01 16:03:10 +00:00
padding-top: 150px;
height: 52px;
2013-11-19 16:18:44 +00:00
width: 165px;
font-weight: 600;
2013-03-01 16:03:10 +00:00
font-size: 14px;
text-align: center;
2013-11-19 16:18:44 +00:00
color: #ddc8d9;
margin: 5px 0 0 0;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2);
box-shadow: 0 1px 3px rgba(0,0,0,.2);
2013-03-01 16:03:10 +00:00
}
.about-wrap .wc-badge {
position: absolute;
top: 0;
2014-08-27 20:26:45 +00:00
<?php echo is_rtl() ? 'left' : 'right'; ?>: 0;
2013-03-01 16:03:10 +00:00
}
2015-07-10 13:00:21 +00:00
.about-wrap .feature-section {
margin-bottom: 40px;
}
.about-wrap .last-feature-section {
border-bottom: 0;
padding-bottom: 0;
margin-bottom: 0;
}
2013-11-19 16:18:44 +00:00
.about-wrap .wc-feature {
overflow: visible !important;
*zoom:1;
}
.about-wrap h3 + .wc-feature {
margin-top: 0;
}
2013-11-19 16:18:44 +00:00
.about-wrap .wc-feature:before,
.about-wrap .wc-feature:after {
content: " ";
display: table;
}
.about-wrap .wc-feature:after {
clear: both;
}
.about-wrap div.icon {
width: 0 !important;
padding: 0;
2014-12-23 15:04:46 +00:00
margin: 20px 0 !important;
2013-11-19 16:18:44 +00:00
}
.about-integrations {
background: #fff;
margin: 20px 0;
padding: 1px 20px 10px;
}
2015-07-10 13:00:21 +00:00
.about-integrations .feature-section {
padding: 20px 0;
}
2014-09-10 11:18:43 +00:00
.changelog h4 {
line-height: 1.4;
}
2013-03-01 16:03:10 +00:00
/*]]>*/
</style>
<?php
}
/**
2014-11-17 15:56:36 +00:00
* Intro text/links shown on all about pages.
2013-03-01 16:03:10 +00:00
*/
private function intro() {
// Drop minor version if 0
2013-11-25 14:01:32 +00:00
$major_version = substr( WC()->version, 0, 3 );
2013-03-01 16:03:10 +00:00
?>
<h1><?php printf( __( 'Welcome to WooCommerce %s', 'woocommerce' ), $major_version ); ?></h1>
<div class="about-text woocommerce-about-text">
<?php
2014-11-17 17:14:49 +00:00
if ( ! empty( $_GET['wc-installed'] ) ) {
2013-03-01 16:03:10 +00:00
$message = __( 'Thanks, all done!', 'woocommerce' );
2014-11-17 17:14:49 +00:00
} elseif ( ! empty( $_GET['wc-updated'] ) ) {
2013-03-01 16:03:10 +00:00
$message = __( 'Thank you for updating to the latest version!', 'woocommerce' );
2014-11-17 17:14:49 +00:00
} else {
2013-03-01 16:03:10 +00:00
$message = __( 'Thanks for installing!', 'woocommerce' );
2014-11-17 17:14:49 +00:00
}
2013-03-01 16:03:10 +00:00
2014-09-10 11:18:43 +00:00
printf( __( '%s WooCommerce %s is more powerful, stable and secure than ever before. We hope you enjoy using it.', 'woocommerce' ), $message, $major_version );
2013-03-01 16:03:10 +00:00
?>
</div>
2013-11-25 14:01:32 +00:00
<div class="wc-badge"><?php printf( __( 'Version %s', 'woocommerce' ), WC()->version ); ?></div>
2013-03-01 16:03:10 +00:00
<p class="woocommerce-actions">
2013-10-22 16:26:18 +00:00
<a href="<?php echo admin_url('admin.php?page=wc-settings'); ?>" class="button button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/documentation/plugins/woocommerce/', 'woocommerce' ) ); ?>" class="docs button button-primary"><?php _e( 'Docs', 'woocommerce' ); ?></a>
2015-04-28 11:48:01 +00:00
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="<?php echo esc_attr( $this->tweets[0] ); ?>" data-via="WooThemes" data-size="large">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
2013-03-01 16:03:10 +00:00
</p>
<h2 class="nav-tab-wrapper">
<a class="nav-tab <?php if ( $_GET['page'] == 'wc-about' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-about' ), 'index.php' ) ) ); ?>">
<?php _e( "What's New", 'woocommerce' ); ?>
</a><a class="nav-tab <?php if ( $_GET['page'] == 'wc-credits' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-credits' ), 'index.php' ) ) ); ?>">
<?php _e( 'Credits', 'woocommerce' ); ?>
2014-02-07 13:06:20 +00:00
</a><a class="nav-tab <?php if ( $_GET['page'] == 'wc-translators' ) echo 'nav-tab-active'; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-translators' ), 'index.php' ) ) ); ?>">
<?php _e( 'Translators', 'woocommerce' ); ?>
2013-03-01 16:03:10 +00:00
</a>
</h2>
<?php
}
/**
* Output the about screen.
*/
public function about_screen() {
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
<div class="changelog">
2015-01-13 16:12:51 +00:00
<div class="changelog about-integrations">
2015-07-10 13:00:21 +00:00
<div class="wc-feature feature-section last-feature-section col three-col">
2015-01-13 16:12:51 +00:00
<div>
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Improved Product Variation Editor', 'woocommerce' ); ?></h4>
<p><?php _e( 'When editing product variations in the backend, we have added a new, paginated interface to make the process of adding complex product variations both quicker and more reliable.', 'woocommerce' ); ?></p>
2015-01-13 16:12:51 +00:00
</div>
<div>
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Frontend Variation Performance', 'woocommerce' ); ?></h4>
2015-07-10 13:26:39 +00:00
<p><?php _e( 'If your products have many variations (20+) they will use an ajax powered add-to-cart form. Select all options and the matching variation will be found via AJAX. This improves performance on the product page.', 'woocommerce' ); ?></p>
2015-01-13 16:12:51 +00:00
</div>
<div class="last-feature">
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Flat Rate Shipping, Simplified', 'woocommerce' ); ?></h4>
<p><?php _e( 'Flat Rate Shipping was overly complex in previous versions of WooCommerce. We have simplified the interface (without losing the flexibility) making Flat Rate and International Shipping much more intuitive.', 'woocommerce' ); ?></p>
2015-01-13 16:12:51 +00:00
</div>
2013-03-01 16:03:10 +00:00
</div>
</div>
2013-11-19 16:18:44 +00:00
</div>
2015-01-13 16:12:51 +00:00
<div class="changelog">
<div class="feature-section col three-col">
2013-03-01 16:03:10 +00:00
<div>
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Geolocation with Caching', 'woocommerce' ); ?></h4>
<p><?php printf( __( 'If you use static caching you may have found geolocation did not work for non-logged in customers. We have now introduced a new javascript based Geocaching solution to help. Enable this in the %ssettings%s.', 'woocommerce' ), '<a href="' . admin_url( 'admin.php?page=wc-settings' ) . '">', '</a>' ); ?></p>
2013-11-19 16:18:44 +00:00
</div>
<div>
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Onboarding Experience', 'woocommerce' ); ?></h4>
<p><?php _e( 'We have added our "WooCommerce 101" tutorial videos to the help tabs throughout admin if you need some help understanding how to use WooCommerce. New installs will also see the new setup wizard to help guide through initial setup.', 'woocommerce' ); ?></p>
2013-03-01 16:03:10 +00:00
</div>
<div class="last-feature">
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Custom AJAX Endpoints', 'woocommerce' ); ?></h4>
<p><?php printf( __( 'To improve performance on the frontend, we\'ve introduced new AJAX endpoints which avoid the overhead of making calls to admin-ajax.php for events such as adding products to the cart.', 'woocommerce' ), '<a href="https://wordpress.org/plugins/woocommerce-colors/">', '</a>' ); ?></p>
2013-03-01 16:03:10 +00:00
</div>
</div>
2015-07-10 13:00:21 +00:00
<div class="feature-section last-feature-section col three-col">
2013-03-01 16:03:10 +00:00
<div>
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Visual API Authentication', 'woocommerce' ); ?></h4>
<p><?php _e( 'Services which integrate with the REST API can now use the visual authentication endpoint so a user can login and grant API permission from a single page before being redirected back.', 'woocommerce' ); ?></p>
2013-03-01 16:03:10 +00:00
</div>
<div>
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Email Notification Improvements', 'woocommerce' ); ?></h4>
<p><?php _e( 'Email templates have been improved to support a wider array of email clients, and extra notifications, such as partial refund notifications, have been included.', 'woocommerce' ); ?></p>
2013-03-01 16:03:10 +00:00
</div>
<div class="last-feature">
2015-07-10 13:00:21 +00:00
<h4><?php _e( 'Shipping Method Priorities', 'woocommerce' ); ?></h4>
<p><?php _e( 'To give more control over which shipping method is selected by default for customers, each method can now be given a numeric priority.', 'woocommerce' ); ?></p>
2013-03-01 16:03:10 +00:00
</div>
</div>
2014-08-27 20:26:45 +00:00
</div>
2014-11-17 16:42:39 +00:00
<hr />
2013-03-01 16:03:10 +00:00
<div class="return-to-dashboard">
2013-10-22 16:26:18 +00:00
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-settings' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to WooCommerce Settings', 'woocommerce' ); ?></a>
2013-03-01 16:03:10 +00:00
</div>
</div>
<?php
}
/**
2014-11-17 15:56:36 +00:00
* Output the credits screen.
2013-03-01 16:03:10 +00:00
*/
public function credits_screen() {
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
2014-08-27 20:56:32 +00:00
<p class="about-description"><?php printf( __( 'WooCommerce is developed and maintained by a worldwide team of passionate individuals and backed by an awesome developer community. Want to see your name? <a href="%s">Contribute to WooCommerce</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md' ); ?></p>
2013-03-01 16:03:10 +00:00
<?php echo $this->contributors(); ?>
2014-02-07 13:06:20 +00:00
</div>
<?php
}
/**
2014-11-17 15:56:36 +00:00
* Output the translators screen.
2014-02-07 13:06:20 +00:00
*/
public function translators_screen() {
?>
<div class="wrap about-wrap">
<?php $this->intro(); ?>
2014-08-27 20:56:32 +00:00
<p class="about-description"><?php printf( __( 'WooCommerce has been kindly translated into several other languages thanks to our translation team. Want to see your name? <a href="%s">Translate WooCommerce</a>.', 'woocommerce' ), 'https://www.transifex.com/projects/p/woocommerce/' ); ?></p>
2013-03-01 16:03:10 +00:00
<?php
// Have to use this to get the list until the API is open...
/*
$contributor_json = json_decode( 'string from https://www.transifex.com/api/2/project/woocommerce/languages/', true );
$contributors = array();
foreach ( $contributor_json as $group ) {
$contributors = array_merge( $contributors, $group['coordinators'], $group['reviewers'], $group['translators'] );
}
$contributors = array_filter( array_unique( $contributors ) );
natsort( $contributors );
foreach ( $contributors as $contributor ) {
echo htmlspecialchars( '<a href="https://www.transifex.com/accounts/profile/' . $contributor . '">' . $contributor . '</a>, ' );
}
*/
?>
<p class="wp-credits-list">
2015-07-10 13:02:52 +00:00
<a href="https://www.transifex.com/accounts/profile/10tje">10tje</a>, <a href="https://www.transifex.com/accounts/profile/ABSOLUTE_Web">ABSOLUTE_Web</a>, <a href="https://www.transifex.com/accounts/profile/AIRoman">AIRoman</a>, <a href="https://www.transifex.com/accounts/profile/ANNEMARIEDEHAAN11">ANNEMARIEDEHAAN11</a>, <a href="https://www.transifex.com/accounts/profile/Abdullahali">Abdullahali</a>, <a href="https://www.transifex.com/accounts/profile/Abdumejid">Abdumejid</a>, <a href="https://www.transifex.com/accounts/profile/Adam_Bajer">Adam_Bajer</a>, <a href="https://www.transifex.com/accounts/profile/AddDesign">AddDesign</a>, <a href="https://www.transifex.com/accounts/profile/AeAdawi">AeAdawi</a>, <a href="https://www.transifex.com/accounts/profile/Aerendir">Aerendir</a>, <a href="https://www.transifex.com/accounts/profile/AhmedHadi">AhmedHadi</a>, <a href="https://www.transifex.com/accounts/profile/Ahmed_Na">Ahmed_Na</a>, <a href="https://www.transifex.com/accounts/profile/Alan345">Alan345</a>, <a href="https://www.transifex.com/accounts/profile/AlexSunnO">AlexSunnO</a>, <a href="https://www.transifex.com/accounts/profile/Aliom">Aliom</a>, <a href="https://www.transifex.com/accounts/profile/Almaz">Almaz</a>, <a href="https://www.transifex.com/accounts/profile/Ana_Sofia_Figueiredo">Ana_Sofia_Figueiredo</a>, <a href="https://www.transifex.com/accounts/profile/Andriy.Gusak">Andriy.Gusak</a>, <a href="https://www.transifex.com/accounts/profile/AngeloLazzari">AngeloLazzari</a>, <a href="https://www.transifex.com/accounts/profile/Anne19">Anne19</a>, <a href="https://www.transifex.com/accounts/profile/AntónioPinto">AntónioPinto</a>, <a href="https://www.transifex.com/accounts/profile/Apelsinova">Apelsinova</a>, <a href="https://www.transifex.com/accounts/profile/ArtGoddess">ArtGoddess</a>, <a href="https://www.transifex.com/accounts/profile/Ashleyking">Ashleyking</a>, <a href="https://www.transifex.com/accounts/profile/AslanDoma">AslanDoma</a>, <a href="https://www.transifex.com/accounts/profile/AtaSmrk">AtaSmrk</a>, <a href="https://www.transifex.com/accounts/profile/Atalanttore">Atalanttore</a>, <a href="https://www.transifex.com/accounts/profile/Axium">Axium</a>, <a href="https://www.transifex.com/accounts/profile/AzT">AzT</a>, <a href="https://www.transifex.com/accounts/profile/BaronAndrea">BaronAndrea</a>, <a href="https://www.transifex.com/accounts/profile/Bhuvanendran">Bhuvanendran</a>, <a href="https://www.transifex.com/accounts/profile/Bitly">Bitly</a>, <a href="https://www.transifex.com/accounts/profile/BlackJad">BlackJad</a>, <a href="https://www.transifex.com/accounts/profile/Bogusław">Bogusław</a>, <a href="https://www.transifex.com/accounts/profile/Buddhi">Buddhi</a>, <a href="https://www.transifex.com/accounts/profile/CAROLINAtrigo">CAROLINAtrigo</a>, <a href="https://www.transifex.com/accounts/profile/CVSz">CVSz</a>, <a href="https://www.transifex.com/accounts/profile/Chaos">Chaos</a>, <a href="https://www.transifex.com/accounts/profile/Charles_12">Charles_12</a>, <a href="https://www.transifex.com/accounts/profile/Chea">Chea</a>, <a href="https://www.transifex.com/accounts/profile/Chlupac">Chlupac</a>, <a href="https://www.transifex.com/accounts/profile/Clausen">Clausen</a>, <a href="https://www.transifex.com/accounts/profile/Closemarketing">Closemarketing</a>, <a href="https://www.transifex.com/accounts/profile/CoachBirgit">CoachBirgit</a>, <a href="https://www.transifex.com/accounts/profile/CodeSupply">CodeSupply</a>, <a href="https://www.transifex.com/accounts/profile/Compute">Compute</a>, <a href="https://www.transifex.com/accounts/profile/CreativeAngels">CreativeAngels</a>, <a href="https://www.transifex.com/accounts/profile/DAJOHH">DAJOHH</a>, <a href="https://www.transifex.com/accounts/profile/DCLXVI">DCLXVI</a>, <a href="https://www.transifex.com/accounts/profile/DJIO">DJIO</a>, <a href="https://www.transifex.com/accounts/profile/DNCTrung">DNCTrung</a>, <a href="https://www.transifex.com/accounts/profile/Daelity">Daelity</a>, <a href="https://www.transifex.com/accounts/profile/Daitenshi
</p>
2013-03-01 16:03:10 +00:00
</div>
<?php
}
/**
2014-11-17 15:56:36 +00:00
* Render Contributors List.
2013-03-01 16:03:10 +00:00
*
* @return string $contributor_list HTML formatted list of contributors.
*/
public function contributors() {
$contributors = $this->get_contributors();
if ( empty( $contributors ) ) {
2013-03-01 16:03:10 +00:00
return '';
}
2013-03-01 16:03:10 +00:00
$contributor_list = '<ul class="wp-people-group">';
foreach ( $contributors as $contributor ) {
$contributor_list .= '<li class="wp-person">';
$contributor_list .= sprintf( '<a href="%s" title="%s">',
esc_url( 'https://github.com/' . $contributor->login ),
esc_html( sprintf( __( 'View %s', 'woocommerce' ), $contributor->login ) )
);
$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
$contributor_list .= '</a>';
$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
$contributor_list .= '</a>';
$contributor_list .= '</li>';
}
$contributor_list .= '</ul>';
return $contributor_list;
}
/**
* Retrieve list of contributors from GitHub.
2013-03-01 16:03:10 +00:00
*
* @return mixed
2013-03-01 16:03:10 +00:00
*/
public function get_contributors() {
$contributors = get_transient( 'woocommerce_contributors' );
if ( false !== $contributors ) {
2013-03-01 16:03:10 +00:00
return $contributors;
}
2013-03-01 16:03:10 +00:00
$response = wp_safe_remote_get( 'https://api.github.com/repos/woothemes/woocommerce/contributors' );
2013-03-01 16:03:10 +00:00
if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
2013-03-01 16:03:10 +00:00
return array();
}
2013-03-01 16:03:10 +00:00
$contributors = json_decode( wp_remote_retrieve_body( $response ) );
if ( ! is_array( $contributors ) ) {
2013-03-01 16:03:10 +00:00
return array();
}
2013-03-01 16:03:10 +00:00
set_transient( 'woocommerce_contributors', $contributors, HOUR_IN_SECONDS );
2013-03-01 16:03:10 +00:00
return $contributors;
}
}
new WC_Admin_Welcome();