golden hour
/home/godaofbq/alienhyperbaric.com/wp-content/plugins/woocommerce/src/Internal/Admin/Notes
⬆️ Go Up
Upload
File/Folder
Size
Actions
.htaccess
420 B
Del
OK
AddFirstProduct.php
2.79 KB
Del
OK
ChoosingTheme.php
1.44 KB
Del
OK
CouponPageMoved.php
3.8 KB
Del
OK
CustomizeStoreWithBlocks.php
2.35 KB
Del
OK
CustomizingProductCatalog.php
2.14 KB
Del
OK
EUVATNumber.php
1.63 KB
Del
OK
EditProductsOnTheMove.php
1.68 KB
Del
OK
EmailNotification.php
5.16 KB
Del
OK
FirstProduct.php
2.12 KB
Del
OK
GivingFeedbackNotes.php
1.5 KB
Del
OK
InstallJPAndWCSPlugins.php
4.58 KB
Del
OK
LaunchChecklist.php
1.68 KB
Del
OK
MagentoMigration.php
2.45 KB
Del
OK
ManageOrdersOnTheGo.php
1.54 KB
Del
OK
MarketingJetpack.php
3.68 KB
Del
OK
MerchantEmailNotifications.php
3.38 KB
Del
OK
MigrateFromShopify.php
2.21 KB
Del
OK
MobileApp.php
1.39 KB
Del
OK
NewSalesRecord.php
5.25 KB
Del
OK
OnboardingPayments.php
1.74 KB
Del
OK
OnlineClothingStore.php
2.68 KB
Del
OK
OrderMilestones.php
9.15 KB
Del
OK
PaymentsMoreInfoNeeded.php
2.01 KB
Del
OK
PaymentsRemindMeLater.php
1.94 KB
Del
OK
PerformanceOnMobile.php
1.64 KB
Del
OK
PersonalizeStore.php
1.91 KB
Del
OK
RealTimeOrderAlerts.php
1.51 KB
Del
OK
SellingOnlineCourses.php
2.38 KB
Del
OK
TrackingOptIn.php
2.75 KB
Del
OK
UnsecuredReportFiles.php
2.12 KB
Del
OK
WooCommercePayments.php
6.25 KB
Del
OK
WooCommerceSubscriptions.php
1.88 KB
Del
OK
WooSubscriptionsNotes.php
14.34 KB
Del
OK
Edit: MarketingJetpack.php
<?php /** * WooCommerce Admin Jetpack Marketing Note Provider. * * Adds notes to the merchant's inbox concerning Jetpack Backup. */ namespace Automattic\WooCommerce\Internal\Admin\Notes; defined( 'ABSPATH' ) || exit; use Automattic\Jetpack\Constants; use Automattic\WooCommerce\Admin\Notes\Note; use Automattic\WooCommerce\Admin\Notes\Notes; use Automattic\WooCommerce\Admin\Notes\NoteTraits; use Automattic\WooCommerce\Admin\PluginsHelper; /** * Suggest Jetpack Backup to Woo users. * * Note: This should probably live in the Jetpack plugin in the future. * * @see https://developer.woocommerce.com/2020/10/16/using-the-admin-notes-inbox-in-woocommerce/ */ class MarketingJetpack { // Shared Note Traits. use NoteTraits; /** * Name of the note for use in the database. */ const NOTE_NAME = 'wc-admin-marketing-jetpack-backup'; /** * Product IDs that include Backup. */ const BACKUP_IDS = [ 2010, 2011, 2012, 2013, 2014, 2015, 2100, 2101, 2102, 2103, 2005, 2006, 2000, 2003, 2001, 2004, ]; /** * Maybe add a note on Jetpack Backups for Jetpack sites older than a week without Backups. */ public static function possibly_add_note() { /** * Check if Jetpack is installed. */ $installed_plugins = PluginsHelper::get_installed_plugin_slugs(); if ( ! in_array( 'jetpack', $installed_plugins, true ) ) { return; } $data_store = \WC_Data_Store::load( 'admin-note' ); // Do we already have this note? $note_ids = $data_store->get_notes_with_name( self::NOTE_NAME ); if ( ! empty( $note_ids ) ) { $note_id = array_pop( $note_ids ); $note = Notes::get_note( $note_id ); if ( false === $note ) { return; } // If Jetpack Backups was purchased after the note was created, mark this note as actioned. if ( self::has_backups() && Note::E_WC_ADMIN_NOTE_ACTIONED !== $note->get_status() ) { $note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED ); $note->save(); } return; } // Check requirements. if ( ! self::is_wc_admin_active_in_date_range( 'week-1-4', DAY_IN_SECONDS * 3 ) || ! self::can_be_added() || self::has_backups() ) { return; } // Add note. $note = self::get_note(); $note->save(); } /** * Get the note. */ public static function get_note() { $note = new Note(); $note->set_title( __( 'Protect your WooCommerce Store with Jetpack Backup.', 'woocommerce' ) ); $note->set_content( __( 'Store downtime means lost sales. One-click restores get you back online quickly if something goes wrong.', 'woocommerce' ) ); $note->set_type( Note::E_WC_ADMIN_NOTE_MARKETING ); $note->set_name( self::NOTE_NAME ); $note->set_layout( 'thumbnail' ); $note->set_image( WC_ADMIN_IMAGES_FOLDER_URL . '/admin_notes/marketing-jetpack-2x.png' ); $note->set_content_data( (object) array() ); $note->set_source( 'woocommerce-admin-notes' ); $note->add_action( 'jetpack-backup-woocommerce', __( 'Get backups', 'woocommerce' ), esc_url( 'https://jetpack.com/upgrade/backup-woocommerce/?utm_source=inbox&utm_medium=automattic_referred&utm_campaign=jp_backup_to_woo' ), Note::E_WC_ADMIN_NOTE_ACTIONED ); return $note; } /** * Check if this blog already has a Jetpack Backups product. * * @return boolean Whether or not this blog has backups. */ protected static function has_backups() { $product_ids = []; $plan = get_option( 'jetpack_active_plan' ); if ( ! empty( $plan ) ) { $product_ids[] = $plan['product_id']; } $products = get_option( 'jetpack_site_products' ); if ( ! empty( $products ) ) { foreach ( $products as $product ) { $product_ids[] = $product['product_id']; } } return (bool) array_intersect( self::BACKUP_IDS, $product_ids ); } }
Save