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 .
*
* @ author WooThemes
* @ category Admin
* @ package WooCommerce / Admin
2013-11-19 16:18:44 +00:00
* @ version 2.1 . 0
2013-03-01 16:03:10 +00:00
*/
if ( ! defined ( 'ABSPATH' ) ) exit ; // Exit if accessed directly
/**
2013-07-24 16:01:36 +00:00
* WC_Admin_Welcome class .
2013-03-01 16:03:10 +00:00
*/
2013-07-24 16:01:36 +00:00
class WC_Admin_Welcome {
2013-03-01 16:03:10 +00:00
2013-03-05 18:50:44 +00:00
private $plugin ;
2013-03-01 16:03:10 +00:00
/**
* __construct function .
*
* @ access public
* @ return void
*/
public function __construct () {
2013-03-05 18:50:44 +00:00
$this -> plugin = 'woocommerce/woocommerce.php' ;
2013-03-01 16:03:10 +00:00
add_action ( 'admin_menu' , array ( $this , 'admin_menus' ) );
add_action ( 'admin_head' , array ( $this , 'admin_head' ) );
add_action ( 'admin_init' , array ( $this , 'welcome' ) );
}
/**
* Add admin menus / screens
*
* @ access public
* @ return void
*/
public function admin_menus () {
2014-04-29 13:03:10 +00:00
if ( empty ( $_GET [ 'page' ] ) ) {
return ;
}
2013-03-18 12:49:13 +00:00
2014-04-29 13:03:10 +00:00
$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
2014-04-29 13:03:10 +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' ) );
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' ) );
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' ) );
add_action ( 'admin_print_styles-' . $page , array ( $this , 'admin_css' ) );
break ;
}
2013-03-01 16:03:10 +00:00
}
/**
* admin_css function .
*
* @ access public
* @ return void
*/
public function admin_css () {
2014-02-12 09:23:06 +00:00
wp_enqueue_style ( 'woocommerce-activation' , plugins_url ( '/assets/css/activation.css' , WC_PLUGIN_FILE ), array (), WC_VERSION );
2013-03-01 16:03:10 +00:00
}
/**
* Add styles just for this page , and remove dashboard page links .
*
* @ access public
* @ return void
*/
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
// Badge for welcome page
2013-11-25 14:01:32 +00:00
$badge_url = WC () -> plugin_url () . '/assets/images/welcome/wc-badge.png' ;
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 : 80 px ;
font - weight : normal ;
width : 165 px ;
height : 165 px ;
line - height : 165 px ;
text - align : center ;
position : absolute ;
top : 0 ;
2014-05-01 08:50:19 +00:00
< ? php echo get_bloginfo ( 'text_direction' ) === '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 {
2013-11-19 16:18:44 +00:00
position : relative ;;
background : #9c5d90;
text - rendering : optimizeLegibility ;
2013-03-01 16:03:10 +00:00
padding - top : 150 px ;
height : 52 px ;
2013-11-19 16:18:44 +00:00
width : 165 px ;
font - weight : 600 ;
2013-03-01 16:03:10 +00:00
font - size : 14 px ;
text - align : center ;
2013-11-19 16:18:44 +00:00
color : #ddc8d9;
margin : 5 px 0 0 0 ;
- webkit - box - shadow : 0 1 px 3 px rgba ( 0 , 0 , 0 , . 2 );
box - shadow : 0 1 px 3 px rgba ( 0 , 0 , 0 , . 2 );
2013-03-01 16:03:10 +00:00
}
. about - wrap . wc - badge {
position : absolute ;
top : 0 ;
2014-05-01 08:50:19 +00:00
< ? php echo get_bloginfo ( 'text_direction' ) === 'rtl' ? 'left' : 'right' ; ?> : 0;
2013-03-01 16:03:10 +00:00
}
2013-11-19 16:18:44 +00:00
. about - wrap . wc - feature {
overflow : visible ! important ;
* zoom : 1 ;
}
. about - wrap . wc - feature : before ,
. about - wrap . wc - feature : after {
content : " " ;
display : table ;
}
. about - wrap . wc - feature : after {
clear : both ;
}
. about - wrap . feature - rest div {
width : 50 % ! important ;
2014-05-01 08:50:19 +00:00
padding -< ? php echo get_bloginfo ( 'text_direction' ) === 'rtl' ? 'left' : 'right' ; ?> : 100px;
2013-11-19 16:18:44 +00:00
- moz - box - sizing : border - box ;
box - sizing : border - box ;
margin : 0 ! important ;
}
. about - wrap . feature - rest div . last - feature {
2014-05-01 08:50:19 +00:00
padding -< ? php echo get_bloginfo ( 'text_direction' ) === 'rtl' ? 'right' : 'left' ; ?> : 100px;
padding -< ? php echo get_bloginfo ( 'text_direction' ) === 'rtl' ? 'left: ' : 'right' ; ?> : 0;
2013-11-19 16:18:44 +00:00
}
. about - wrap div . icon {
width : 0 ! important ;
padding : 0 ;
margin : 0 ;
}
. about - wrap . feature - rest div . icon : before {
font - family : WooCommerce ! important ;
font - weight : normal ;
width : 100 % ;
font - size : 170 px ;
line - height : 125 px ;
color : #9c5d90;
display : inline - block ;
position : relative ;
text - align : center ;
speak : none ;
2014-05-01 08:50:19 +00:00
margin : < ? php echo get_bloginfo ( 'text_direction' ) === 'rtl' ? '0 -100px 0 0' : '0 0 0 -100px' ; ?> ;
2013-11-19 16:18:44 +00:00
content : " \ e01d " ;
- webkit - font - smoothing : antialiased ;
- moz - osx - font - smoothing : grayscale ;
}
. about - integrations {
background : #fff;
margin : 20 px 0 ;
padding : 1 px 20 px 10 px ;
}
2013-03-01 16:03:10 +00:00
/*]]>*/
</ style >
< ? php
}
/**
* Into text / links shown on all about pages .
*
* @ access private
* @ return void
*/
private function intro () {
2013-03-06 13:43:53 +00:00
// Flush after upgrades
if ( ! empty ( $_GET [ 'wc-updated' ] ) || ! empty ( $_GET [ 'wc-installed' ] ) )
flush_rewrite_rules ();
2013-03-01 16:03:10 +00:00
// 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
if ( ! empty ( $_GET [ 'wc-installed' ] ) )
$message = __ ( 'Thanks, all done!' , 'woocommerce' );
elseif ( ! empty ( $_GET [ 'wc-updated' ] ) )
$message = __ ( 'Thank you for updating to the latest version!' , 'woocommerce' );
else
$message = __ ( 'Thanks for installing!' , 'woocommerce' );
printf ( __ ( '%s WooCommerce %s is more powerful, stable, and secure than ever before. We hope you enjoy it.' , 'woocommerce' ), $message , $major_version );
?>
</ 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>
2013-10-22 17:20:33 +00:00
< a class = " docs button button-primary " href = " <?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/documentation/plugins/woocommerce/', 'woocommerce' ) ); ?> " >< ? php _e ( 'Docs' , 'woocommerce' ); ?> </a>
2013-03-01 16:03:10 +00:00
< a href = " https://twitter.com/share " class = " twitter-share-button " data - url = " http://www.woothemes.com/woocommerce/ " data - text = " A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully. " data - via = " WooThemes " data - size = " large " data - hashtags = " WooCommerce " > 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 >
</ 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 point-releases " ></ div >-->
< div class = " changelog " >
2013-11-19 16:18:44 +00:00
< h3 >< ? php _e ( 'A new RESTful API developers will ❤' , 'woocommerce' ); ?> </h3>
< div class = " wc-feature feature-rest feature-section col three-col " >
< div >
< h4 >< ? php _e ( 'Access your data from 3rd party applications' , 'woocommerce' ); ?> </h4>
2014-04-15 15:56:35 +00:00
< p >< ? php _e ( 'Built on top of the WooCommerce API, and targeted directly at developers, the new REST API allows you to get data for <strong>Orders</strong>, <strong>Coupons</strong>, <strong>Customers</strong>, <strong>Products</strong> and <strong>Reports</strong> in both <code>XML</code> and <code>JSON</code> formats.' , 'woocommerce' ); ?> </p>
2013-11-19 16:18:44 +00:00
</ div >
< div class = " icon " ></ div >
< div class = " last-feature " >
< h4 >< ? php _e ( 'Authentication to keep data secure' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Authentication for the REST API is performed using HTTP Basic Auth if you have SSL enabled, or signed according to the <a href="http://tools.ietf.org/html/rfc5849">OAuth 1.0a</a> specification if you don\'t have SSL. Data is only available to authenticated users.' , 'woocommerce' ); ?> </p>
</ div >
2013-03-01 16:03:10 +00:00
</ div >
2013-11-19 16:18:44 +00:00
</ div >
< div class = " changelog " >
< h3 >< ? php _e ( 'UI and reporting improvements' , 'woocommerce' ); ?> </h3>
< div class = " wc-feature feature-section col three-col " >
2013-03-01 16:03:10 +00:00
< div >
2013-12-12 07:21:28 +00:00
< h4 >< ? php _e ( 'WordPress 3.8 admin UI compatibility' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'WooCommerce 2.1 has had its UI restyled to work with the new admin design in WordPress 3.8. All bitmap icons have been replaced with a custom, lightweight icon font for razor sharp clarity on retina devices as well as improved performance.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Simplified order UI' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'The orders panel has seen significant improvement to both the totals panel, and line item display making editing new and existing orders a breeze.' , 'woocommerce' ); ?> </p>
< p >< ? php _e ( 'Item meta has also been optimised and can now be viewed as HTML rather than stuck in a text input.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div class = " last-feature " >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Improved Reporting' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Reports have been redesigned with new <strong>filtering</strong> capabilities, a new <strong>customer report</strong> showing orders/spending, and the ability to <strong>export CSVs</strong>.' , 'woocommerce' ); ?> </p>
< p >< ? php _e ( 'The dashboard also has a new widget showing you an overview of current orders complete with sparklines for quick at-a-glance stats.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
</ div >
2013-11-19 16:18:44 +00:00
</ div >
< div class = " changelog about-integrations " >
< h3 >< ? php _e ( 'Separated integrations' , 'woocommerce' ); ?> </h3>
< div class = " wc-feature feature-section col three-col " >
2013-03-01 16:03:10 +00:00
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'New separate plugins' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'To make core more lean, some integrations have been removed and turned into dedicated plugins which you can install as and when you need them.' , 'woocommerce' ); ?> </p>
</ div >
< div >
< h4 >< ? php _e ( 'Google Analytics' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Add Google Analytics eCommerce tracking to your WooCommerce store.' , 'woocommerce' ); ?> </p>
< p >< a href = " http://wordpress.org/plugins/woocommerce-google-analytics-integration " class = " button " >< ? php _e ( 'Download' , 'woocommerce' ); ?> </a></p>
2013-03-01 16:03:10 +00:00
</ div >
< div class = " last-feature " >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Piwik' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Integrate WooCommerce with Piwik and the WP-Piwik plugin.' , 'woocommerce' ); ?> </p>
< p >< a href = " http://wordpress.org/plugins/woocommerce-piwik-integration/ " class = " button " >< ? php _e ( 'Download' , 'woocommerce' ); ?> </a></p>
2013-03-01 16:03:10 +00:00
</ div >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'ShareThis' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Add social network sharing buttons to products using ShareThis.' , 'woocommerce' ); ?> </p>
< p >< a href = " http://wordpress.org/plugins/woocommerce-sharethis-integration/ " class = " button " >< ? php _e ( 'Download' , 'woocommerce' ); ?> </a></p>
2013-03-01 16:03:10 +00:00
</ div >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Sharedaddy' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Add social network sharing buttons to products using Sharedaddy.' , 'woocommerce' ); ?> </p>
< p >< a href = " http://wordpress.org/plugins/woocommerce-sharedaddy-integration/ " class = " button " >< ? php _e ( 'Download' , 'woocommerce' ); ?> </a></p>
2013-03-01 16:03:10 +00:00
</ div >
< div class = " last-feature " >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'ShareYourCart' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Let users share their carts for a discount using the ShareYourCart service.' , 'woocommerce' ); ?> </p>
< p >< a href = " http://wordpress.org/plugins/shareyourcart/ " class = " button " >< ? php _e ( 'Download' , 'woocommerce' ); ?> </a></p>
2013-03-01 16:03:10 +00:00
</ div >
</ div >
</ div >
< div class = " changelog " >
< h3 >< ? php _e ( 'Under the Hood' , 'woocommerce' ); ?> </h3>
< div class = " feature-section col three-col " >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'PayPal PDT support' , 'woocommerce' ); ?> </h4>
2014-01-08 06:06:22 +00:00
< p >< ? php _e ( 'PayPal Data Transfer (PDT) is an alternative for PayPal IPN which sends back the status of an order when a customer returns from PayPal.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Stylesheet separation' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Frontend styles have been split into separate appearance/layout/smallscreen stylesheets to help with selective customisation.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div class = " last-feature " >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'New endpoints' , 'woocommerce' ); ?> </h4>
2013-12-28 20:19:20 +00:00
< p >< ? php _e ( 'Certain pages such as "Pay", "Order Received" and some account pages are now endpoints rather than pages to make checkout more reliable.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
</ div >
< div class = " feature-section col three-col " >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Default credit card form for gateways' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'We\'ve added a standardized, default credit card form for gateways to use if they support <code>default_credit_card_form</code>.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Coupon limits per customer' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Coupon usage limits can now be set per user (using email + ID) rather than global.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div class = " last-feature " >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Streamlined new-account process' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'During checkout, username and passwords are optional and can be automatically generated by WooCommerce.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
</ div >
< div class = " feature-section col three-col " >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Additional price display options' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Define whether prices should be shown incl. or excl. of tax on the frontend, and add an optional suffix.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Past order linking' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'Admins now have the ability to link past orders to a customer (before they registered) by email address.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
< div class = " last-feature " >
2013-11-19 16:18:44 +00:00
< h4 >< ? php _e ( 'Review improvements' , 'woocommerce' ); ?> </h4>
< p >< ? php _e ( 'We\'ve added a new option to restrict reviews to logged in purchasers, and made ratings editable from the backend.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
</ div >
</ div >
</ div >
< 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
}
/**
* Output the credits .
*/
public function credits_screen () {
?>
< div class = " wrap about-wrap " >
< ? php $this -> intro (); ?>
< p class = " about-description " >< ? php _e ( '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="https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md">Contribute to WooCommerce</a>.' , 'woocommerce' ); ?> </p>
< ? php echo $this -> contributors (); ?>
2014-02-07 13:06:20 +00:00
</ div >
< ? php
}
/**
* Output the translators screen
*/
public function translators_screen () {
?>
< div class = " wrap about-wrap " >
< ? php $this -> intro (); ?>
2014-02-21 15:29:42 +00:00
< p class = " about-description " >< ? php _e ( 'WooCommerce has been kindly translated into several other languages thanks to our translation team. Want to see your name? <a href="https://www.transifex.com/projects/p/woocommerce/">Translate WooCommerce</a>.' , 'woocommerce' ); ?> </p>
2013-03-01 16:03:10 +00:00
2014-02-07 13:06:20 +00:00
< p class = " wp-credits-list " >< 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/Andriy.Gusak " > Andriy . Gusak </ a > , < a href = " https://www.transifex.com/accounts/profile/Apelsinova " > Apelsinova </ a > , < a href = " https://www.transifex.com/accounts/profile/Chaos " > Chaos </ 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/DJIO " > DJIO </ a > , < a href = " https://www.transifex.com/accounts/profile/Dimis13 " > Dimis13 </ a > , < a href = " https://www.transifex.com/accounts/profile/GabrielGil " > GabrielGil </ a > , < a href = " https://www.transifex.com/accounts/profile/GeertDD " > GeertDD </ a > , < a href = " https://www.transifex.com/accounts/profile/Griga_M " > Griga_M </ a > , < a href = " https://www.transifex.com/accounts/profile/JKKim " > JKKim </ a > , < a href = " https://www.transifex.com/accounts/profile/Janjaapvandijk " > Janjaapvandijk </ a > , < a href = " https://www.transifex.com/accounts/profile/KennethJ " > KennethJ </ a > , < a href = " https://www.transifex.com/accounts/profile/Lazybadger " > Lazybadger </ a > , < a href = " https://www.transifex.com/accounts/profile/RistoNiinemets " > RistoNiinemets </ a > , < a href = " https://www.transifex.com/accounts/profile/SergeyBiryukov " > SergeyBiryukov </ a > , < a href = " https://www.transifex.com/accounts/profile/SzLegradi " > SzLegradi </ a > , < a href = " https://www.transifex.com/accounts/profile/TRFlavourart " > TRFlavourart </ a > , < a href = " https://www.transifex.com/accounts/profile/Thalitapinheiro " > Thalitapinheiro </ a > , < a href = " https://www.transifex.com/accounts/profile/TomiToivio " > TomiToivio </ a > , < a href = " https://www.transifex.com/accounts/profile/TopOSScz " > TopOSScz </ a > , < a href = " https://www.transifex.com/accounts/profile/Wen89 " > Wen89 </ a > , < a href = " https://www.transifex.com/accounts/profile/abdmc " > abdmc </ a > , < a href = " https://www.transifex.com/accounts/profile/adamedotco " > adamedotco </ a > , < a href = " https://www.transifex.com/accounts/profile/ahmedbadawy " > ahmedbadawy </ a > , < a href = " https://www.transifex.com/accounts/profile/alaa13212 " > alaa13212 </ a > , < a href = " https://www.transifex.com/accounts/profile/alichani " > alichani </ a > , < a href = " https://www.transifex.com/accounts/profile/amitgilad " > amitgilad </ a > , < a href = " https://www.transifex.com/accounts/profile/andrey.lima.ramos " > andrey . lima . ramos </ a > , < a href = " https://www.transifex.com/accounts/profile/arhipaiva " > arhipaiva </ a > , < a href = " https://www.transifex.com/accounts/profile/bobosbodega " > bobosbodega </ a > , < a href = " https://www.transifex.com/accounts/profile/calkut " > calkut </ a > , < a href = " https://www.transifex.com/accounts/profile/cglaudel " > cglaudel </ a > , < a href = " https://www.transifex.com/accounts/profile/claudiosmweb " > claudiosmweb </ a > , < a href = " https://www.transifex.com/accounts/profile/coenjacobs " > coenjacobs </ a > , < a href = " https://www.transifex.com/accounts/profile/corsonr " > corsonr </ a > , < a href = " https://www.transifex.com/accounts/profile/cpelham " > cpelham </ a > , < a href = " https://www.transifex.com/accounts/profile/culkman " > culkman </ a > , < a href = " https://www.transifex.com/accounts/profile/darudar " > darudar </ a > , < a href = " https://www.transifex.com/accounts/profile/deckerweb " > deckerweb </ a > , < a href = " https://www.transifex.com/accounts/profile/dekaru " > dekaru </ a > , < a href = " https://www.transifex.com/accounts/profile/denarefyev " > denarefyev </ a > , < a href = " https://www.transifex.com/accounts/profile/e01 " > e01 </ a > , < a href = " https://www.transifex.com/accounts/profile/espellcaste " > espellcaste </ a > , < a href = " https://www.transifex.com/accounts/profile/fdaciuk " > fdaciuk </ a > , < a href = " https://www.transifex.com/accounts/profile/flyingoff " > flyingoff </ a > , < a href = " https://www.transifex.com/accounts/profile/fnalescio " > fnalescio </ a > , < a href = " https://www.transifex.com/accounts/profile/fxbenard " > fxbenard </ a > , < a href = " https://www.transifex.com/accounts/profile/gingermig " > gingermig </ a > , < a href = " https://www.transifex.com/accounts/profile/gopress.co.il " > gopress . co
2013-03-01 16:03:10 +00:00
</ div >
< ? php
}
/**
* Render Contributors List
*
* @ access public
* @ return string $contributor_list HTML formatted list of contributors .
*/
public function contributors () {
$contributors = $this -> get_contributors ();
if ( empty ( $contributors ) )
return '' ;
$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 ;
}
/**
2013-11-27 09:03:47 +00:00
* Retrieve list of contributors from GitHub .
2013-03-01 16:03:10 +00:00
*
* @ access public
2013-11-27 09:03:47 +00:00
* @ return mixed
2013-03-01 16:03:10 +00:00
*/
public function get_contributors () {
$contributors = get_transient ( 'woocommerce_contributors' );
if ( false !== $contributors )
return $contributors ;
$response = wp_remote_get ( 'https://api.github.com/repos/woothemes/woocommerce/contributors' , array ( 'sslverify' => false ) );
if ( is_wp_error ( $response ) || 200 != wp_remote_retrieve_response_code ( $response ) )
return array ();
$contributors = json_decode ( wp_remote_retrieve_body ( $response ) );
if ( ! is_array ( $contributors ) )
return array ();
set_transient ( 'woocommerce_contributors' , $contributors , 3600 );
return $contributors ;
}
/**
* Sends user to the welcome page on first activation
*/
public function welcome () {
2013-03-05 18:50:44 +00:00
// Bail if no activation redirect transient is set
2013-03-01 16:03:10 +00:00
if ( ! get_transient ( '_wc_activation_redirect' ) )
return ;
// Delete the redirect transient
delete_transient ( '_wc_activation_redirect' );
2013-03-05 18:50:44 +00:00
// Bail if we are waiting to install or update via the interface update/install links
if ( get_option ( '_wc_needs_update' ) == 1 || get_option ( '_wc_needs_pages' ) == 1 )
2013-03-01 16:03:10 +00:00
return ;
2013-03-05 18:50:44 +00:00
// Bail if activating from network, or bulk, or within an iFrame
if ( is_network_admin () || isset ( $_GET [ 'activate-multi' ] ) || defined ( 'IFRAME_REQUEST' ) )
2013-03-01 16:03:10 +00:00
return ;
2013-03-04 20:38:01 +00:00
if ( ( isset ( $_GET [ 'action' ] ) && 'upgrade-plugin' == $_GET [ 'action' ] ) && ( isset ( $_GET [ 'plugin' ] ) && strstr ( $_GET [ 'plugin' ], 'woocommerce.php' ) ) )
return ;
2013-12-04 12:20:18 +00:00
wp_redirect ( admin_url ( 'index.php?page=wc-about' ) );
2013-03-01 16:03:10 +00:00
exit ;
}
}
2013-12-28 20:19:20 +00:00
new WC_Admin_Welcome ();