1 <?php
  2 /**
  3  * Welcome Page Class
  4  *
  5  * Shows a feature overview for the new version (major) and credits.
  6  *
  7  * Adapted from code in EDD (Copyright (c) 2012, Pippin Williamson) and WP.
  8  *
  9  * @author      WooThemes
 10  * @category    Admin
 11  * @package     WooCommerce/Admin
 12  * @version     2.1.0
 13 */
 14 
 15 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
 16 
 17 /**
 18  * WC_Admin_Welcome class.
 19  */
 20 class WC_Admin_Welcome {
 21 
 22     private $plugin;
 23 
 24     /**
 25      * __construct function.
 26      *
 27      * @access public
 28      * @return void
 29      */
 30     public function __construct() {
 31         $this->plugin             = 'woocommerce/woocommerce.php';
 32 
 33         add_action( 'admin_menu', array( $this, 'admin_menus') );
 34         add_action( 'admin_head', array( $this, 'admin_head' ) );
 35         add_action( 'admin_init', array( $this, 'welcome'    ) );
 36     }
 37 
 38     /**
 39      * Add admin menus/screens
 40      *
 41      * @access public
 42      * @return void
 43      */
 44     public function admin_menus() {
 45         if ( empty( $_GET['page'] ) ) {
 46             return;
 47         }
 48 
 49         $welcome_page_name  = __( 'About WooCommerce', 'woocommerce' );
 50         $welcome_page_title = __( 'Welcome to WooCommerce', 'woocommerce' );
 51 
 52         switch ( $_GET['page'] ) {
 53             case 'wc-about' :
 54                 $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'wc-about', array( $this, 'about_screen' ) );
 55                 add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) );
 56             break;
 57             case 'wc-credits' :
 58                 $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'wc-credits', array( $this, 'credits_screen' ) );
 59                 add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) );
 60             break;
 61             case 'wc-translators' :
 62                 $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'wc-translators', array( $this, 'translators_screen' ) );
 63                 add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) );
 64             break;
 65         }
 66     }
 67 
 68     /**
 69      * admin_css function.
 70      *
 71      * @access public
 72      * @return void
 73      */
 74     public function admin_css() {
 75         wp_enqueue_style( 'woocommerce-activation', plugins_url(  '/assets/css/activation.css', WC_PLUGIN_FILE ), array(), WC_VERSION );
 76     }
 77 
 78     /**
 79      * Add styles just for this page, and remove dashboard page links.
 80      *
 81      * @access public
 82      * @return void
 83      */
 84     public function admin_head() {
 85         remove_submenu_page( 'index.php', 'wc-about' );
 86         remove_submenu_page( 'index.php', 'wc-credits' );
 87         remove_submenu_page( 'index.php', 'wc-translators' );
 88 
 89         // Badge for welcome page
 90         $badge_url = WC()->plugin_url() . '/assets/images/welcome/wc-badge.png';
 91         ?>
 92         <style type="text/css">
 93             /*<![CDATA[*/
 94             .wc-badge:before {
 95                 font-family: WooCommerce !important;
 96                 content: "\e03d";
 97                 color: #fff;
 98                 -webkit-font-smoothing: antialiased;
 99                 -moz-osx-font-smoothing: grayscale;
100                 font-size: 80px;
101                 font-weight: normal;
102                 width: 165px;
103                 height: 165px;
104                 line-height: 165px;
105                 text-align: center;
106                 position: absolute;
107                 top: 0;
108                 <?php echo get_bloginfo( 'text_direction' ) === 'rtl' ? 'right' : 'left'; ?>: 0;
109                 margin: 0;
110                 vertical-align: middle;
111             }
112             .wc-badge {
113                 position: relative;;
114                 background: #9c5d90;
115                 text-rendering: optimizeLegibility;
116                 padding-top: 150px;
117                 height: 52px;
118                 width: 165px;
119                 font-weight: 600;
120                 font-size: 14px;
121                 text-align: center;
122                 color: #ddc8d9;
123                 margin: 5px 0 0 0;
124                 -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.2);
125                 box-shadow: 0 1px 3px rgba(0,0,0,.2);
126             }
127             .about-wrap .wc-badge {
128                 position: absolute;
129                 top: 0;
130                 <?php echo get_bloginfo( 'text_direction' ) === 'rtl' ? 'left' : 'right'; ?>: 0;
131             }
132             .about-wrap .wc-feature {
133                 overflow: visible !important;
134                 *zoom:1;
135             }
136             .about-wrap .wc-feature:before,
137             .about-wrap .wc-feature:after {
138                 content: " ";
139                 display: table;
140             }
141             .about-wrap .wc-feature:after {
142                 clear: both;
143             }
144             .about-wrap .feature-rest div {
145                 width: 50% !important;
146                 padding-<?php echo get_bloginfo( 'text_direction' ) === 'rtl' ? 'left' : 'right'; ?>: 100px;
147                 -moz-box-sizing: border-box;
148                 box-sizing: border-box;
149                 margin: 0 !important;
150             }
151             .about-wrap .feature-rest div.last-feature {
152                 padding-<?php echo get_bloginfo( 'text_direction' ) === 'rtl' ? 'right' : 'left'; ?>: 100px;
153                 padding-<?php echo get_bloginfo( 'text_direction' ) === 'rtl' ? 'left' : 'right'; ?>: 0;
154             }
155             .about-wrap div.icon {
156                 width: 0 !important;
157                 padding: 0;
158                 margin: 0;
159             }
160             .about-wrap .feature-rest div.icon:before {
161                 font-family: WooCommerce !important;
162                 font-weight: normal;
163                 width: 100%;
164                 font-size: 170px;
165                 line-height: 125px;
166                 color: #9c5d90;
167                 display: inline-block;
168                 position: relative;
169                 text-align: center;
170                 speak: none;
171                 margin: <?php echo get_bloginfo( 'text_direction' ) === 'rtl' ? '0 -100px 0 0' : '0 0 0 -100px'; ?>;
172                 content: "\e01d";
173                 -webkit-font-smoothing: antialiased;
174                 -moz-osx-font-smoothing: grayscale;
175             }
176             .about-integrations {
177                 background: #fff;
178                 margin: 20px 0;
179                 padding: 1px 20px 10px;
180             }
181             /*]]>*/
182         </style>
183         <?php
184     }
185 
186     /**
187      * Into text/links shown on all about pages.
188      *
189      * @access private
190      * @return void
191      */
192     private function intro() {
193 
194         // Flush after upgrades
195         if ( ! empty( $_GET['wc-updated'] ) || ! empty( $_GET['wc-installed'] ) )
196             flush_rewrite_rules();
197 
198         // Drop minor version if 0
199         $major_version = substr( WC()->version, 0, 3 );
200         ?>
201         <h1><?php printf( __( 'Welcome to WooCommerce %s', 'woocommerce' ), $major_version ); ?></h1>
202 
203         <div class="about-text woocommerce-about-text">
204             <?php
205                 if ( ! empty( $_GET['wc-installed'] ) )
206                     $message = __( 'Thanks, all done!', 'woocommerce' );
207                 elseif ( ! empty( $_GET['wc-updated'] ) )
208                     $message = __( 'Thank you for updating to the latest version!', 'woocommerce' );
209                 else
210                     $message = __( 'Thanks for installing!', 'woocommerce' );
211 
212                 printf( __( '%s WooCommerce %s is more powerful, stable, and secure than ever before. We hope you enjoy it.', 'woocommerce' ), $message, $major_version );
213             ?>
214         </div>
215 
216         <div class="wc-badge"><?php printf( __( 'Version %s', 'woocommerce' ), WC()->version ); ?></div>
217 
218         <p class="woocommerce-actions">
219             <a href="<?php echo admin_url('admin.php?page=wc-settings'); ?>" class="button button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a>
220             <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>
221             <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>
222 <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>
223         </p>
224 
225         <h2 class="nav-tab-wrapper">
226             <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' ) ) ); ?>">
227                 <?php _e( "What's New", 'woocommerce' ); ?>
228             </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' ) ) ); ?>">
229                 <?php _e( 'Credits', 'woocommerce' ); ?>
230             </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' ) ) ); ?>">
231                 <?php _e( 'Translators', 'woocommerce' ); ?>
232             </a>
233         </h2>
234         <?php
235     }
236 
237     /**
238      * Output the about screen.
239      */
240     public function about_screen() {
241         ?>
242         <div class="wrap about-wrap">
243 
244             <?php $this->intro(); ?>
245 
246             <!--<div class="changelog point-releases"></div>-->
247 
248             <div class="changelog">
249                 <h3><?php _e( 'A new RESTful API developers will &#10084;', 'woocommerce' ); ?></h3>
250                 <div class="wc-feature feature-rest feature-section col three-col">
251                     <div>
252                         <h4><?php _e( 'Access your data from 3rd party applications', 'woocommerce' ); ?></h4>
253                         <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>
254                     </div>
255                     <div class="icon"></div>
256                     <div class="last-feature">
257                         <h4><?php _e( 'Authentication to keep data secure', 'woocommerce' ); ?></h4>
258                         <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>
259                     </div>
260                 </div>
261             </div>
262             <div class="changelog">
263                 <h3><?php _e( 'UI and reporting improvements', 'woocommerce' ); ?></h3>
264                 <div class="wc-feature feature-section col three-col">
265                     <div>
266                         <h4><?php _e( 'WordPress 3.8 admin UI compatibility', 'woocommerce' ); ?></h4>
267                         <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>
268                     </div>
269                     <div>
270                         <h4><?php _e( 'Simplified order UI', 'woocommerce' ); ?></h4>
271                         <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>
272                         <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>
273                     </div>
274                     <div class="last-feature">
275                         <h4><?php _e( 'Improved Reporting', 'woocommerce' ); ?></h4>
276                         <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>
277                         <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>
278                     </div>
279                 </div>
280             </div>
281             <div class="changelog about-integrations">
282                 <h3><?php _e( 'Separated integrations', 'woocommerce' ); ?></h3>
283                 <div class="wc-feature feature-section col three-col">
284                     <div>
285                         <h4><?php _e( 'New separate plugins', 'woocommerce' ); ?></h4>
286                         <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>
287                     </div>
288                     <div>
289                         <h4><?php _e( 'Google Analytics', 'woocommerce' ); ?></h4>
290                         <p><?php _e( 'Add Google Analytics eCommerce tracking to your WooCommerce store.', 'woocommerce' ); ?></p>
291                         <p><a href="http://wordpress.org/plugins/woocommerce-google-analytics-integration" class="button"><?php _e( 'Download', 'woocommerce' ); ?></a></p>
292                     </div>
293                     <div class="last-feature">
294                         <h4><?php _e( 'Piwik', 'woocommerce' ); ?></h4>
295                         <p><?php _e( 'Integrate WooCommerce with Piwik and the WP-Piwik plugin.', 'woocommerce' ); ?></p>
296                         <p><a href="http://wordpress.org/plugins/woocommerce-piwik-integration/" class="button"><?php _e( 'Download', 'woocommerce' ); ?></a></p>
297                     </div>
298                     <div>
299                         <h4><?php _e( 'ShareThis', 'woocommerce' ); ?></h4>
300                         <p><?php _e( 'Add social network sharing buttons to products using ShareThis.', 'woocommerce' ); ?></p>
301                         <p><a href="http://wordpress.org/plugins/woocommerce-sharethis-integration/" class="button"><?php _e( 'Download', 'woocommerce' ); ?></a></p>
302                     </div>
303                     <div>
304                         <h4><?php _e( 'Sharedaddy', 'woocommerce' ); ?></h4>
305                         <p><?php _e( 'Add social network sharing buttons to products using Sharedaddy.', 'woocommerce' ); ?></p>
306                         <p><a href="http://wordpress.org/plugins/woocommerce-sharedaddy-integration/" class="button"><?php _e( 'Download', 'woocommerce' ); ?></a></p>
307                     </div>
308                     <div class="last-feature">
309                         <h4><?php _e( 'ShareYourCart', 'woocommerce' ); ?></h4>
310                         <p><?php _e( 'Let users share their carts for a discount using the ShareYourCart service.', 'woocommerce' ); ?></p>
311                         <p><a href="http://wordpress.org/plugins/shareyourcart/" class="button"><?php _e( 'Download', 'woocommerce' ); ?></a></p>
312                     </div>
313                 </div>
314             </div>
315             <div class="changelog">
316                 <h3><?php _e( 'Under the Hood', 'woocommerce' ); ?></h3>
317 
318                 <div class="feature-section col three-col">
319                     <div>
320                         <h4><?php _e( 'PayPal PDT support', 'woocommerce' ); ?></h4>
321                         <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>
322                     </div>
323 
324                     <div>
325                         <h4><?php _e( 'Stylesheet separation', 'woocommerce' ); ?></h4>
326                         <p><?php _e( 'Frontend styles have been split into separate appearance/layout/smallscreen stylesheets to help with selective customisation.', 'woocommerce' ); ?></p>
327                     </div>
328 
329                     <div class="last-feature">
330                         <h4><?php _e( 'New endpoints', 'woocommerce' ); ?></h4>
331                         <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>
332                     </div>
333                 </div>
334                 <div class="feature-section col three-col">
335 
336                     <div>
337                         <h4><?php _e( 'Default credit card form for gateways', 'woocommerce' ); ?></h4>
338                         <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>
339                     </div>
340 
341                     <div>
342                         <h4><?php _e( 'Coupon limits per customer', 'woocommerce' ); ?></h4>
343                         <p><?php _e( 'Coupon usage limits can now be set per user (using email + ID) rather than global.', 'woocommerce' ); ?></p>
344                     </div>
345 
346                     <div class="last-feature">
347                         <h4><?php _e( 'Streamlined new-account process', 'woocommerce' ); ?></h4>
348                         <p><?php _e( 'During checkout, username and passwords are optional and can be automatically generated by WooCommerce.', 'woocommerce' ); ?></p>
349                     </div>
350 
351                 </div>
352                 <div class="feature-section col three-col">
353 
354                     <div>
355                         <h4><?php _e( 'Additional price display options', 'woocommerce' ); ?></h4>
356                         <p><?php _e( 'Define whether prices should be shown incl. or excl. of tax on the frontend, and add an optional suffix.', 'woocommerce' ); ?></p>
357                     </div>
358 
359                     <div>
360                         <h4><?php _e( 'Past order linking', 'woocommerce' ); ?></h4>
361                         <p><?php _e( 'Admins now have the ability to link past orders to a customer (before they registered) by email address.', 'woocommerce' ); ?></p>
362                     </div>
363 
364                     <div class="last-feature">
365                         <h4><?php _e( 'Review improvements', 'woocommerce' ); ?></h4>
366                         <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>
367                     </div>
368 
369                 </div>
370             </div>
371 
372             <div class="return-to-dashboard">
373                 <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>
374             </div>
375         </div>
376         <?php
377     }
378 
379     /**
380      * Output the credits.
381      */
382     public function credits_screen() {
383         ?>
384         <div class="wrap about-wrap">
385 
386             <?php $this->intro(); ?>
387 
388             <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>
389 
390             <?php echo $this->contributors(); ?>
391         </div>
392         <?php
393     }
394 
395     /**
396      * Output the translators screen
397      */
398     public function translators_screen() {
399         ?>
400         <div class="wrap about-wrap">
401 
402             <?php $this->intro(); ?>
403 
404             <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>
405 
406             <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.il</a>, <a href="https://www.transifex.com/accounts/profile/greguly">greguly</a>, <a href="https://www.transifex.com/accounts/profile/henryk.ibemeinhardt">henryk.ibemeinhardt</a>, <a href="https://www.transifex.com/accounts/profile/iagomelanias">iagomelanias</a>, <a href="https://www.transifex.com/accounts/profile/ideodora">ideodora</a>, <a href="https://www.transifex.com/accounts/profile/inceptive">inceptive</a>, <a href="https://www.transifex.com/accounts/profile/inpsyde">inpsyde</a>, <a href="https://www.transifex.com/accounts/profile/israel.cefrin">israel.cefrin</a>, <a href="https://www.transifex.com/accounts/profile/jameskoster">jameskoster</a>, <a href="https://www.transifex.com/accounts/profile/jeanmichell">jeanmichell</a>, <a href="https://www.transifex.com/accounts/profile/jluisfreitas">jluisfreitas</a>, <a href="https://www.transifex.com/accounts/profile/joelbal">joelbal</a>, <a href="https://www.transifex.com/accounts/profile/joesalty">joesalty</a>, <a href="https://www.transifex.com/accounts/profile/josh_marom">josh_marom</a>, <a href="https://www.transifex.com/accounts/profile/jpBenfica">jpBenfica</a>, <a href="https://www.transifex.com/accounts/profile/jujjer">jujjer</a>, <a href="https://www.transifex.com/accounts/profile/karistuck">karistuck</a>, <a href="https://www.transifex.com/accounts/profile/kraudio">kraudio</a>, <a href="https://www.transifex.com/accounts/profile/lad.ruz">lad.ruz</a>, <a href="https://www.transifex.com/accounts/profile/lubalee">lubalee</a>, <a href="https://www.transifex.com/accounts/profile/maayehkhaled">maayehkhaled</a>, <a href="https://www.transifex.com/accounts/profile/marcosof">marcosof</a>, <a href="https://www.transifex.com/accounts/profile/martian36">martian36</a>, <a href="https://www.transifex.com/accounts/profile/martinproject">martinproject</a>, <a href="https://www.transifex.com/accounts/profile/math_beck">math_beck</a>, <a href="https://www.transifex.com/accounts/profile/mattyza">mattyza</a>, <a href="https://www.transifex.com/accounts/profile/me2you">me2you</a>, <a href="https://www.transifex.com/accounts/profile/mikejolley">mikejolley</a>, <a href="https://www.transifex.com/accounts/profile/mjepson">mjepson</a>, <a href="https://www.transifex.com/accounts/profile/mobarak">mobarak</a>, <a href="https://www.transifex.com/accounts/profile/mom0916">mom0916</a>, <a href="https://www.transifex.com/accounts/profile/mortifactor">mortifactor</a>, <a href="https://www.transifex.com/accounts/profile/nsitbon">nsitbon</a>, <a href="https://www.transifex.com/accounts/profile/perdersongedal">perdersongedal</a>, <a href="https://www.transifex.com/accounts/profile/potgieterg">potgieterg</a>, <a href="https://www.transifex.com/accounts/profile/rabas.marek">rabas.marek</a>, <a href="https://www.transifex.com/accounts/profile/rafaelfunchal">rafaelfunchal</a>, <a href="https://www.transifex.com/accounts/profile/ragulka">ragulka</a>, <a href="https://www.transifex.com/accounts/profile/ramoonus">ramoonus</a>, <a href="https://www.transifex.com/accounts/profile/rcovarru">rcovarru</a>, <a href="https://www.transifex.com/accounts/profile/renatofrota">renatofrota</a>, <a href="https://www.transifex.com/accounts/profile/richardshaylor">richardshaylor</a>, <a href="https://www.transifex.com/accounts/profile/rickserrat">rickserrat</a>, <a href="https://www.transifex.com/accounts/profile/rodrigoprior">rodrigoprior</a>, <a href="https://www.transifex.com/accounts/profile/scottbasgaard">scottbasgaard</a>, <a href="https://www.transifex.com/accounts/profile/sennbrink">sennbrink</a>, <a href="https://www.transifex.com/accounts/profile/stgoos">stgoos</a>, <a href="https://www.transifex.com/accounts/profile/stuk88">stuk88</a>, <a href="https://www.transifex.com/accounts/profile/sumodirjo">sumodirjo</a>, <a href="https://www.transifex.com/accounts/profile/sylvie_janssens">sylvie_janssens</a>, <a href="https://www.transifex.com/accounts/profile/tinaswelt">tinaswelt</a>, <a href="https://www.transifex.com/accounts/profile/toszcze">toszcze</a>, <a href="https://www.transifex.com/accounts/profile/tshowhey">tshowhey</a>, <a href="https://www.transifex.com/accounts/profile/tszming">tszming</a>, <a href="https://www.transifex.com/accounts/profile/tue.holm">tue.holm</a>, <a href="https://www.transifex.com/accounts/profile/uworx">uworx</a>, <a href="https://www.transifex.com/accounts/profile/vanbo">vanbo</a>, <a href="https://www.transifex.com/accounts/profile/viamarket">viamarket</a>, <a href="https://www.transifex.com/accounts/profile/wasim">wasim</a>, <a href="https://www.transifex.com/accounts/profile/zodiac1978">zodiac1978</a></p>
407         </div>
408         <?php
409     }
410 
411     /**
412      * Render Contributors List
413      *
414      * @access public
415      * @return string $contributor_list HTML formatted list of contributors.
416      */
417     public function contributors() {
418         $contributors = $this->get_contributors();
419 
420         if ( empty( $contributors ) )
421             return '';
422 
423         $contributor_list = '<ul class="wp-people-group">';
424 
425         foreach ( $contributors as $contributor ) {
426             $contributor_list .= '<li class="wp-person">';
427             $contributor_list .= sprintf( '<a href="%s" title="%s">',
428                 esc_url( 'https://github.com/' . $contributor->login ),
429                 esc_html( sprintf( __( 'View %s', 'woocommerce' ), $contributor->login ) )
430             );
431             $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
432             $contributor_list .= '</a>';
433             $contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
434             $contributor_list .= '</a>';
435             $contributor_list .= '</li>';
436         }
437 
438         $contributor_list .= '</ul>';
439 
440         return $contributor_list;
441     }
442 
443     /**
444      * Retrieve list of contributors from GitHub.
445      *
446      * @access public
447      * @return mixed
448      */
449     public function get_contributors() {
450         $contributors = get_transient( 'woocommerce_contributors' );
451 
452         if ( false !== $contributors )
453             return $contributors;
454 
455         $response = wp_remote_get( 'https://api.github.com/repos/woothemes/woocommerce/contributors', array( 'sslverify' => false ) );
456 
457         if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) )
458             return array();
459 
460         $contributors = json_decode( wp_remote_retrieve_body( $response ) );
461 
462         if ( ! is_array( $contributors ) )
463             return array();
464 
465         set_transient( 'woocommerce_contributors', $contributors, 3600 );
466 
467         return $contributors;
468     }
469 
470     /**
471      * Sends user to the welcome page on first activation
472      */
473     public function welcome() {
474 
475         // Bail if no activation redirect transient is set
476         if ( ! get_transient( '_wc_activation_redirect' ) )
477             return;
478 
479         // Delete the redirect transient
480         delete_transient( '_wc_activation_redirect' );
481 
482         // Bail if we are waiting to install or update via the interface update/install links
483         if ( get_option( '_wc_needs_update' ) == 1 || get_option( '_wc_needs_pages' ) == 1 )
484             return;
485 
486         // Bail if activating from network, or bulk, or within an iFrame
487         if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) )
488             return;
489 
490         if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'woocommerce.php' ) ) )
491             return;
492 
493         wp_redirect( admin_url( 'index.php?page=wc-about' ) );
494         exit;
495     }
496 }
497 
498 new WC_Admin_Welcome();
499 
WooCommerce API documentation generated by ApiGen 2.8.0