PluginProbe
WooCommerce / 11.1.0
WooCommerce v11.1.0
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Internal / Admin / Notes / LaunchChecklist.php
LaunchChecklist.php
61 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WooCommerce Admin Launch Checklist Note.
4 *
5 * Adds a note to cover pre-launch checklist items for store owners.
6 */
7
8 namespace Automattic\WooCommerce\Internal\Admin\Notes;
9
10 defined( 'ABSPATH' ) || exit;
11
12 use Automattic\WooCommerce\Admin\Notes\Note;
13 use Automattic\WooCommerce\Admin\Notes\NoteTraits;
14
15 /**
16 * Launch_Checklist
17 */
18 class LaunchChecklist {
19 /**
20 * Note traits.
21 */
22 use NoteTraits;
23
24 /**
25 * Name of the note for use in the database.
26 */
27 const NOTE_NAME = 'wc-admin-launch-checklist';
28
29 /**
30 * Get the note.
31 *
32 * @return Note
33 */
34 public static function get_note() {
35 // Only add this note if completing the task list or completed 3 tasks in 10 days.
36 $completed_tasks = get_option( 'woocommerce_task_list_tracked_completed_tasks', array() );
37 $ten_days_in_seconds = 10 * DAY_IN_SECONDS;
38 if (
39 ! get_option( 'woocommerce_task_list_complete' ) &&
40 (
41 count( $completed_tasks ) < 3 ||
42 self::is_wc_admin_active_in_date_range( 'week-1-4', $ten_days_in_seconds )
43 )
44 ) {
45 return;
46 }
47
48 $content = __( 'To make sure you never get that sinking "what did I forget" feeling, we\'ve put together the essential pre-launch checklist.', 'woocommerce' );
49
50 $note = new Note();
51 $note->set_title( __( 'Ready to launch your store?', 'woocommerce' ) );
52 $note->set_content( $content );
53 $note->set_content_data( (object) array() );
54 $note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );
55 $note->set_name( self::NOTE_NAME );
56 $note->set_source( 'woocommerce-admin' );
57 $note->add_action( 'learn-more', __( 'Learn more', 'woocommerce' ), 'https://woocommerce.com/posts/pre-launch-checklist-the-essentials/?utm_source=inbox&utm_medium=product' );
58 return $note;
59 }
60 }
61