NF_Welcome

NF_Welcome Class.

Defined (1)

The class is defined in the following location(s).

/deprecated/includes/admin/welcome.php  
  1. class NF_Welcome { 
  2.  
  3. /** 
  4. * @var string The capability users should have to view the page 
  5. */ 
  6. public $minimum_capability = 'manage_options'; 
  7. public $display_version = NF_PLUGIN_VERSION; 
  8. public $header_text; 
  9. public $header_desc; 
  10.  
  11. /** 
  12. * Get things started 
  13. * @since 1.4 
  14. */ 
  15. public function __construct() { 
  16. add_action( 'admin_menu', array( $this, 'admin_menus') ); 
  17. add_action( 'admin_head', array( $this, 'admin_head' ) ); 
  18. add_action( 'admin_init', array( $this, 'welcome' ) ); 
  19.  
  20. $this->header_text = sprintf( __( 'Welcome to Ninja Forms %s', 'ninja-forms' ), $this->display_version ); 
  21. $this->header_desc = sprintf( __( 'Thank you for updating! Ninja Forms %s makes form building easier than ever before!', 'ninja-forms' ), $this->display_version ); 
  22.  
  23. /** 
  24. * Register the Dashboard Pages which are later hidden but these pages 
  25. * are used to render the Welcome and Credits pages. 
  26. * @access public 
  27. * @since 1.4 
  28. * @return void 
  29. */ 
  30. public function admin_menus() { 
  31. // About Page 
  32. add_dashboard_page( 
  33. __( 'Welcome to Ninja Forms', 'ninja-forms' ),  
  34. __( 'Welcome to Ninja Forms', 'ninja-forms' ),  
  35. $this->minimum_capability,  
  36. 'nf-about',  
  37. array( $this, 'about_screen' ) 
  38. ); 
  39.  
  40. // Changelog Page 
  41. add_dashboard_page( 
  42. __( 'Ninja Forms Changelog', 'ninja-forms' ),  
  43. __( 'Ninja Forms Changelog', 'ninja-forms' ),  
  44. $this->minimum_capability,  
  45. 'nf-changelog',  
  46. array( $this, 'changelog_screen' ) 
  47. ); 
  48.  
  49. // Getting Started Page 
  50. add_dashboard_page( 
  51. __( 'Getting started with Ninja Forms', 'ninja-forms' ),  
  52. __( 'Getting started with Ninja Forms', 'ninja-forms' ),  
  53. $this->minimum_capability,  
  54. 'nf-getting-started',  
  55. array( $this, 'getting_started_screen' ) 
  56. ); 
  57.  
  58. // Credits Page 
  59. add_dashboard_page( 
  60. __( 'The people who build Ninja Forms', 'ninja-forms' ),  
  61. __( 'The people who build Ninja Forms', 'ninja-forms' ),  
  62. $this->minimum_capability,  
  63. 'nf-credits',  
  64. array( $this, 'credits_screen' ) 
  65. ); 
  66.  
  67. /** 
  68. * Hide Individual Dashboard Pages 
  69. * @access public 
  70. * @since 1.4 
  71. * @return void 
  72. */ 
  73. public function admin_head() { 
  74. remove_submenu_page( 'index.php', 'nf-about' ); 
  75. remove_submenu_page( 'index.php', 'nf-changelog' ); 
  76. remove_submenu_page( 'index.php', 'nf-getting-started' ); 
  77. remove_submenu_page( 'index.php', 'nf-credits' ); 
  78.  
  79. // Ensures style is only on welcome page 
  80. if ((isset($_GET['page'])) && ($_GET['page']=='nf-about' || $_GET['page']=='nf-getting-started' || $_GET['page']=='nf-credits' || $_GET['page']=='nf-changelog')) { 
  81.  
  82. // Badge for welcome page 
  83. $badge_url = NF_PLUGIN_URL . 'assets/images/nf-badge.png'; 
  84. ?> 
  85. <style type="text/css" media="screen"> 
  86. /*<![CDATA[*/ 
  87. .nf-badge { 
  88. padding-top: 125px; 
  89. height: 52px; 
  90. width: 185px; 
  91. color: #fff; 
  92. font-weight: bold; 
  93. font-size: 14px; 
  94. text-align: center; 
  95. margin: 0 -5px; 
  96. background: url('<?php echo $badge_url; ?>') no-repeat; 
  97.  
  98. .about-wrap .nf-badge { 
  99. position: absolute; 
  100. top: 0; 
  101. right: 0; 
  102.  
  103. .nf-welcome-screenshots { 
  104. float: right; 
  105. margin-left: 10px!important; 
  106.  
  107. .about-wrap .feature-section { 
  108. margin-top: 20px; 
  109. .about-overview { 
  110. padding: 20px; 
  111. .about-overview iframe { 
  112. display: block; 
  113. margin: 0 auto; 
  114.  
  115. /*]]>*/ 
  116. </style> 
  117. <?php 
  118.  
  119. /** 
  120. * Navigation tabs 
  121. * @access public 
  122. * @since 1.9 
  123. * @return void 
  124. */ 
  125. public function tabs() { 
  126. $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'nf-about'; 
  127. ?> 
  128. <h2 class="nav-tab-wrapper"> 
  129. <a class="nav-tab <?php echo $selected == 'nf-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'nf-about' ), 'index.php' ) ) ); ?>"> 
  130. <?php _e( "What's New", 'ninja-forms' ); ?> 
  131. </a> 
  132. <a class="nav-tab <?php echo $selected == 'nf-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'nf-getting-started' ), 'index.php' ) ) ); ?>"> 
  133. <?php _e( 'Getting Started', 'ninja-forms' ); ?> 
  134. </a> 
  135. <a class="nav-tab <?php echo $selected == 'nf-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'nf-credits' ), 'index.php' ) ) ); ?>"> 
  136. <?php _e( 'Credits', 'ninja-forms' ); ?> 
  137. </a> 
  138. </h2> 
  139. <?php 
  140.  
  141. /** 
  142. * Render About Screen 
  143. * @access public 
  144. * @since 1.4 
  145. * @return void 
  146. */ 
  147. public function about_screen() { 
  148. ?> 
  149. <div class="wrap about-wrap"> 
  150. <h1><?php echo $this->header_text; ?></h1> 
  151. <div class="about-text"><?php echo $this->header_desc; ?></div> 
  152. <div class="nf-badge"><?php printf( __( 'Version %s', 'ninja-forms' ), $this->display_version ); ?></div> 
  153.  
  154. <?php $this->tabs(); ?> 
  155.  
  156. <div class="changelog"> 
  157.  
  158. <div class="about-overview"> 
  159. <iframe width="640" height="360" src="//www.youtube.com/embed/todRiV7Cel0" frameborder="0" allowfullscreen></iframe> 
  160. </div> 
  161. <h2 class="about-headline-callout"><?php _e( 'A simplified and more powerful form building experience.', 'ninja-forms' );?></h2> 
  162.  
  163. <div class="feature-section col two-col"> 
  164.  
  165. <div class="col-1"> 
  166. <img src="<?php echo NF_PLUGIN_URL . 'assets/images/screenshots/ss-builder.png'; ?>"> 
  167. <h4><?php _e( 'New Builder Tab', 'ninja-forms' );?></h4> 
  168. <p><?php _e( 'When creating and editing forms, go directly to the section that matters most.', 'ninja-forms' ); ?></p> 
  169. </div> 
  170.  
  171. <div class="col-2 last-feature"> 
  172. <img src="<?php echo NF_PLUGIN_URL . 'assets/images/screenshots/ss-field-settings.png'; ?>"> 
  173. <h4><?php _e( 'Better Organized Field Settings', 'ninja-forms' );?></h4> 
  174. <p><?php printf( __( 'The most common settings are shown immediately, while other, non-essential, settings are tucked away inside expandable sections.', 'ninja-forms' ), admin_url( 'edit.php?post_type=download&page=nf-settings&tab=misc' ) ); ?></p> 
  175. </div> 
  176.  
  177. </div> 
  178.  
  179. <hr /> 
  180.  
  181. <div class="feature-section col three-col"> 
  182.  
  183. <div class="col-1"> 
  184. <img src="<?php echo NF_PLUGIN_URL . 'assets/images/screenshots/ss-emails-actions.png'; ?>"> 
  185. <h4><?php _e( 'Improved clarity', 'ninja-forms' );?></h4> 
  186. <p><?php _e( 'Along with the "Build Your Form" tab, we\'ve removed "Notifications" in favor of "Emails & Actions." This is a much clearer indication of what can be done on this tab.', 'ninja-forms' ); ?></p> 
  187. </div> 
  188.  
  189. <div class="col-2"> 
  190. <img src="<?php echo NF_PLUGIN_URL . 'assets/images/screenshots/ss-nuke-option.png'; ?>"> 
  191. <h4><?php _e( 'Remove all Ninja Forms data', 'ninja-forms' );?></h4> 
  192. <p><?php _e( 'We\'ve added the option to remove all Ninja Forms data (submissions, forms, fields, options) when you delete the plugin. We call it the nuclear option.', 'ninja-forms' ); ?></p> 
  193. </div> 
  194.  
  195. <div class="col-3 last-feature"> 
  196. <img src="<?php echo NF_PLUGIN_URL . 'assets/images/screenshots/ss-licenses.png'; ?>"> 
  197. <h4><?php _e( 'Better license management', 'ninja-forms' );?></h4> 
  198. <p><?php _e( 'Deactivate Ninja Forms extension licenses individually or as a group from the settings tab.', 'ninja-forms' ); ?></p> 
  199. </div> 
  200.  
  201. </div> 
  202.  
  203. <hr /> 
  204.  
  205. <div class="feature-section col two-col"> 
  206.  
  207. <div class="col-1"> 
  208. <h4><?php _e( 'More to come', 'ninja-forms' ); ?></h4> 
  209. <p><?php _e( 'The interface updates in this version lay the groundwork for some great improvements in the future. Version 3.0 will build on these changes to make Ninja Forms an even more stable, powerful, and user-friendly form builder.', 'ninja-forms' ); ?></p> 
  210. </div> 
  211.  
  212. <div class="col-2 last-feature"> 
  213. <h4><?php _e( 'Documentation', 'ninja-forms' );?></h4> 
  214. <p><?php _e( 'Take a look at our in-depth Ninja Forms documentation below.', 'ninja-forms' ); ?></p> 
  215. <p> 
  216. <a href="<?php echo esc_url( 'http://docs.ninjaforms.com/?utm_medium=plugin&utm_source=welcome-screen&utm_campaign=Ninja+Forms+Welcome&utm_content=Ninja+Forms+Docs' ); ?>"><?php _e( 'Ninja Forms Documentation', 'ninja-forms' ); ?></a> · 
  217. <a href="<?php echo esc_url( 'https://ninjaforms.com/contact/?utm_medium=plugin&utm_source=welcome-screen&utm_campaign=Ninja+Forms+Welcome&utm_content=Ninja+Forms+Support' ); ?>"><?php _e( 'Get Support', 'ninja-forms' ); ?></a> 
  218. </p> 
  219. </div> 
  220.  
  221. </div> 
  222.  
  223. </div> 
  224.  
  225. <div class="return-to-dashboard"> 
  226. <a href="<?php echo esc_url( admin_url( 'index.php?page=ninja-forms' ) ); ?>"><?php _e( 'Return to Ninja Forms', 'ninja-forms' ); ?></a> · 
  227. <a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'nf-changelog' ), 'index.php' ) ) ); ?>"><?php _e( 'View the Full Changelog', 'ninja-forms' ); ?></a> 
  228. </div> 
  229. </div> 
  230. <?php 
  231.  
  232. /** 
  233. * Render Changelog Screen 
  234. * @access public 
  235. * @since 2.0.3 
  236. * @return void 
  237. */ 
  238. public function changelog_screen() { 
  239. list( $display_version ) = explode( '-', NF_PLUGIN_VERSION ); 
  240. ?> 
  241. <div class="wrap about-wrap"> 
  242. <h1><?php echo $this->header_text; ?></h1> 
  243. <div class="about-text"><?php echo $this->header_desc; ?></div> 
  244. <div class="nf-badge"><?php printf( __( 'Version %s', 'ninja-forms' ), $this->display_version ); ?></div> 
  245.  
  246. <?php $this->tabs(); ?> 
  247.  
  248. <div class="changelog"> 
  249. <h3><?php _e( 'Full Changelog', 'ninja-forms' );?></h3> 
  250.  
  251. <div class="feature-section"> 
  252. <?php echo $this->parse_readme(); ?> 
  253. </div> 
  254. </div> 
  255.  
  256. <div class="return-to-dashboard"> 
  257. <a href="<?php echo esc_url( admin_url( 'index.php?page=ninja-forms' ) ); ?>"><?php _e( 'Go to Ninja Forms', 'ninja-forms' ); ?></a> 
  258. </div> 
  259. </div> 
  260. <?php 
  261.  
  262. /** 
  263. * Render Getting Started Screen 
  264. * @access public 
  265. * @since 1.9 
  266. * @return void 
  267. */ 
  268. public function getting_started_screen() { 
  269. list( $display_version ) = explode( '-', NF_PLUGIN_VERSION ); 
  270. ?> 
  271. <div class="wrap about-wrap"> 
  272. <h1><?php echo $this->header_text; ?></h1> 
  273. <div class="about-text"><?php echo $this->header_desc; ?></div> 
  274. <div class="nf-badge"><?php printf( __( 'Version %s', 'ninja-forms' ), $this->display_version ); ?></div> 
  275.  
  276. <?php $this->tabs(); ?> 
  277.  
  278. <p class="about-description"><?php _e( 'Use the tips below to get started using Ninja Forms. You will be up and running in no time!', 'ninja-forms' ); ?></p> 
  279.  
  280. <div class="changelog"> 
  281.  
  282. <div class="feature-section"> 
  283. <h4><?php _e( 'All About Forms', 'ninja-forms' );?></h4> 
  284. <img style="width: 500px; height: 292px;" src="<?php echo NF_PLUGIN_URL . 'assets/images/screenshots/ss-new-form.png'; ?>" class="nf-welcome-screenshots"> 
  285.  
  286. <p><?php printf( __( 'The Forms menu is your access point for all things Ninja Forms. We\'ve already created your first %scontact form%s so that you have an example. You can also create your own by clicking %sAdd New%s.', 'ninja-forms' ), '<a href="admin.php?page=ninja-forms&tab=builder&form_id=1">', '</a>', '<a href="admin.php?page=ninja-forms&tab=builder&form_id=new">', '</a>' ); ?></p> 
  287.  
  288. <h4><?php _e( 'Build Your Form', 'ninja-forms' );?></h4> 
  289. <p><?php _e( 'This is where you\'ll build your form by adding fields and dragging them into the order you want them to appear. Each field will have an assortment of options such as label, label position, and placeholder.', 'ninja-forms' );?></p> 
  290.  
  291. <h4><?php _e( 'Emails & Actions', 'ninja-forms' );?></h4> 
  292. <p><?php _e( 'If you would like for your form to notify you via email when a user clicks submit, you can set those up on this tab. You can create an unlimited number of emails, including emails sent to the user who filled out the form.', 'ninja-forms' );?></p> 
  293.  
  294. <h4><?php _e( 'Settings', 'ninja-forms' );?></h4> 
  295. <p><?php _e( 'This tab hold general form settings, such as title and submission method, as well as display settings like hiding a form when it is successfully completed.', 'ninja-forms' );?></p> 
  296.  
  297. </div> 
  298.  
  299. </div> 
  300.  
  301. <hr /> 
  302.  
  303. <div class="changelog"> 
  304. <h3><?php _e( 'Displaying Your Form', 'ninja-forms' );?></h3> 
  305.  
  306. <div class="feature-section col two-col"> 
  307.  
  308. <div class="col-1"> 
  309. <h4><?php _e( 'Append to Page', 'ninja-forms' );?></h4> 
  310. <p><?php _e( 'Under Basic Form Behavior in the Form Settings you can easily select a page that you would like the form automatically appended to the end of that page\'s content. A similiar option is avaiable in every content edit screen in its sidebar.', 'ninja-forms' ); ?></p> 
  311. </div> 
  312.  
  313. <div class="col-2 last-feature"> 
  314. <h4><?php _e( 'Shortcode', 'ninja-forms' );?></h4> 
  315. <p><?php printf( __( 'Place %s in any area that accepts shortcodes to display your form anywhere you like. Even in the middle of your page or posts content.', 'ninja-forms' ), '[ninja_form id=1]' ); ?></p> 
  316. </div> 
  317.  
  318. </div> 
  319.  
  320. <div class="feature-section col two-col"> 
  321.  
  322. <div class="col-1"> 
  323. <h4><?php _e( 'Ninja Forms Widget', 'ninja-forms' );?></h4> 
  324. <p><?php printf( __( 'Ninja Forms provides a widget that you can place in any widgetized area of your site and select exactly which form you would like displayed in that space.', 'ninja-forms' ), admin_url( 'edit.php?post_type=download&page=nf-settings&tab=misc' ) ); ?></p> 
  325. </div> 
  326.  
  327. <div class="col-2 last-feature"> 
  328. <h4><?php _e( 'Template Function', 'ninja-forms' );?></h4> 
  329. <p><?php printf( __( 'Ninja Forms also comes with a simple template function that can be placed directly into a php template file. %s', 'ninja-forms' ), '<code>if( function_exists( \'ninja_forms_display_form\' ) ) { ninja_forms_display_form( 1 ); }</code>' ); ?></p> 
  330. </div> 
  331.  
  332. </div> 
  333.  
  334. </div> 
  335.  
  336. <hr /> 
  337.  
  338. <div class="changelog"> 
  339. <h3><?php _e( 'Need Help?', 'ninja-forms' );?></h3> 
  340.  
  341. <div class="feature-section col two-col"> 
  342.  
  343. <div class="col-1"> 
  344. <h4><?php _e( 'Growing Documentation', 'ninja-forms' );?></h4> 
  345. <p><?php printf( __( 'Documentation is available covering everything from %sTroubleshooting%s to our %sDeveloper API%s. New Documents are always being added.', 'ninja-forms' ), '<a href="http://docs.ninjaforms.com/customer/portal/articles/2045713-troubleshooting-ninja-forms/?utm_medium=plugin&utm_source=welcome-screen&utm_campaign=Ninja+Forms+Welcome&utm_content=Ninja+Forms+Docs">', '</a>', '<a href="http://docs.ninjaforms.com/customer/portal/topics/798123-developer-api/articles/?utm_medium=plugin&utm_source=welcome-screen&utm_campaign=Ninja+Forms+Welcome&utm_content=Ninja+Forms+Docs">', '</a>' ); ?></p> 
  346. </div> 
  347.  
  348. <div class="col-2 last-feature"> 
  349. <h4><?php _e( 'Best Support in the Business', 'ninja-forms' );?></h4> 
  350. <p><?php printf( __( 'We do all we can to provide every Ninja Forms user with the best support possible. If you encounter a problem or have a question, %splease contact us%s.', 'ninja-forms' ), '<a href="https://ninjaforms.com/contact/?utm_medium=plugin&utm_source=welcome-screen&utm_campaign=Ninja+Forms+Welcome&utm_content=Ninja+Forms+Support">', '</a>' ); ?></p> 
  351. </div> 
  352.  
  353. </div> 
  354.  
  355. </div> 
  356. </div> 
  357. <?php 
  358.  
  359. /** 
  360. * Render Credits Screen 
  361. * @access public 
  362. * @since 1.4 
  363. * @return void 
  364. */ 
  365. public function credits_screen() { 
  366. list( $display_version ) = explode( '-', NF_PLUGIN_VERSION ); 
  367. ?> 
  368. <div class="wrap about-wrap"> 
  369. <h1><?php printf( __( 'Welcome to Ninja Forms %s', 'ninja-forms' ), $display_version ); ?></h1> 
  370. <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! Ninja Forms %s is primed to make your experience managing submissions an enjoyable one!', 'ninja-forms' ), $display_version ); ?></div> 
  371. <div class="nf-badge"><?php printf( __( 'Version %s', 'ninja-forms' ), $display_version ); ?></div> 
  372.  
  373. <?php $this->tabs(); ?> 
  374.  
  375. <p class="about-description"><?php _e( 'Ninja Forms is created by a worldwide team of developers who aim to provide the #1 WordPress community form creation plugin.', 'ninja-forms' ); ?></p> 
  376.  
  377. <?php echo $this->contributors(); ?> 
  378. </div> 
  379. <?php 
  380.  
  381.  
  382. /** 
  383. * Parse the NF readme.txt file 
  384. * @since 2.0.3 
  385. * @return string $readme HTML formatted readme file 
  386. */ 
  387. public function parse_readme() { 
  388. $file = file_exists( NF_PLUGIN_DIR . 'readme.txt' ) ? NF_PLUGIN_DIR . 'readme.txt' : null; 
  389.  
  390. if ( ! $file ) { 
  391. $readme = '<p>' . __( 'No valid changelog was found.', 'ninja-forms' ) . '</p>'; 
  392. } else { 
  393. $readme = file_get_contents( $file ); 
  394. $readme = nl2br( esc_html( $readme ) ); 
  395.  
  396. $readme = explode( '== Changelog ==', $readme ); 
  397. $readme = end( $readme ); 
  398.  
  399. $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); 
  400. $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); 
  401. $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); 
  402. $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); 
  403. $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); 
  404.  
  405. return $readme; 
  406.  
  407.  
  408. /** 
  409. * Render Contributors List 
  410. * @since 1.4 
  411. * @uses NF_Welcome::get_contributors() 
  412. * @return string $contributor_list HTML formatted list of all the contributors for NF 
  413. */ 
  414. public function contributors() { 
  415. $contributors = $this->get_contributors(); 
  416.  
  417. if ( empty( $contributors ) ) 
  418. return ''; 
  419.  
  420. $contributor_list = '<ul class="wp-people-group">'; 
  421.  
  422. foreach ( $contributors as $contributor ) { 
  423. $contributor_list .= '<li class="wp-person">'; 
  424. $contributor_list .= sprintf( '<a href="%s" title="%s">',  
  425. esc_url( 'https://github.com/' . $contributor->login ),  
  426. esc_html( sprintf( __( 'View %s', 'ninja-forms' ), $contributor->login ) ) 
  427. ); 
  428. $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) ); 
  429. $contributor_list .= '</a>'; 
  430. $contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) ); 
  431. $contributor_list .= '</a>'; 
  432. $contributor_list .= '</li>'; 
  433.  
  434. $contributor_list .= '</ul>'; 
  435.  
  436. return $contributor_list; 
  437.  
  438. /** 
  439. * Retreive list of contributors from GitHub. 
  440. * @access public 
  441. * @since 1.4 
  442. * @return array $contributors List of contributors 
  443. */ 
  444. public function get_contributors() { 
  445. $contributors = get_transient( 'nf_contributors' ); 
  446.  
  447. if ( false !== $contributors ) 
  448. return $contributors; 
  449.  
  450. $response = wp_remote_get( 'https://api.github.com/repos/wpninjas/ninja-forms/contributors?&per_page=100', array( 'sslverify' => false ) ); 
  451.  
  452. if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) 
  453. return array(); 
  454.  
  455. $contributors = json_decode( wp_remote_retrieve_body( $response ) ); 
  456.  
  457. if ( ! is_array( $contributors ) ) 
  458. return array(); 
  459.  
  460. set_transient( 'nf_contributors', $contributors, 3600 ); 
  461.  
  462. return $contributors; 
  463.  
  464. /** 
  465. * Sends user to the Welcome page on first activation of NF as well as each 
  466. * time NF is upgraded to a new version 
  467. * @access public 
  468. * @since 1.4 
  469. * @global $nf_options Array of all the NF Options 
  470. * @return void 
  471. */ 
  472. public function welcome() { 
  473. global $nf_options; 
  474.  
  475. // Bail if no activation redirect 
  476. if ( ! get_transient( '_nf_activation_redirect' ) ) 
  477. return; 
  478.  
  479. // Delete the redirect transient 
  480. delete_transient( '_nf_activation_redirect' ); 
  481.  
  482. // Bail if activating from network, or bulk 
  483. if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) 
  484. return; 
  485.  
  486. $upgrade = get_option( 'nf_version_upgraded_from' ); 
  487.  
  488. if( ! $upgrade ) { // First time install 
  489. wp_safe_redirect( admin_url( 'index.php?page=nf-getting-started' ) ); exit; 
  490. } else { // Update 
  491. wp_safe_redirect( admin_url( 'index.php?page=nf-about' ) ); exit;