Sin descripción

class-wc-admin-notices.php 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. <?php
  2. /**
  3. * Display notices in admin
  4. *
  5. * @package WooCommerce\Admin
  6. * @version 3.4.0
  7. */
  8. use Automattic\Jetpack\Constants;
  9. defined( 'ABSPATH' ) || exit;
  10. /**
  11. * WC_Admin_Notices Class.
  12. */
  13. class WC_Admin_Notices {
  14. /**
  15. * Stores notices.
  16. *
  17. * @var array
  18. */
  19. private static $notices = array();
  20. /**
  21. * Array of notices - name => callback.
  22. *
  23. * @var array
  24. */
  25. private static $core_notices = array(
  26. 'update' => 'update_notice',
  27. 'template_files' => 'template_file_check_notice',
  28. 'legacy_shipping' => 'legacy_shipping_notice',
  29. 'no_shipping_methods' => 'no_shipping_methods_notice',
  30. 'regenerating_thumbnails' => 'regenerating_thumbnails_notice',
  31. 'regenerating_lookup_table' => 'regenerating_lookup_table_notice',
  32. 'no_secure_connection' => 'secure_connection_notice',
  33. WC_PHP_MIN_REQUIREMENTS_NOTICE => 'wp_php_min_requirements_notice',
  34. 'maxmind_license_key' => 'maxmind_missing_license_key_notice',
  35. 'redirect_download_method' => 'redirect_download_method_notice',
  36. 'uploads_directory_is_unprotected' => 'uploads_directory_is_unprotected_notice',
  37. 'base_tables_missing' => 'base_tables_missing_notice',
  38. );
  39. /**
  40. * Constructor.
  41. */
  42. public static function init() {
  43. self::$notices = get_option( 'woocommerce_admin_notices', array() );
  44. add_action( 'switch_theme', array( __CLASS__, 'reset_admin_notices' ) );
  45. add_action( 'woocommerce_installed', array( __CLASS__, 'reset_admin_notices' ) );
  46. add_action( 'wp_loaded', array( __CLASS__, 'add_redirect_download_method_notice' ) );
  47. add_action( 'wp_loaded', array( __CLASS__, 'hide_notices' ) );
  48. // @TODO: This prevents Action Scheduler async jobs from storing empty list of notices during WC installation.
  49. // That could lead to OBW not starting and 'Run setup wizard' notice not appearing in WP admin, which we want
  50. // to avoid.
  51. if ( ! WC_Install::is_new_install() || ! wc_is_running_from_async_action_scheduler() ) {
  52. add_action( 'shutdown', array( __CLASS__, 'store_notices' ) );
  53. }
  54. if ( current_user_can( 'manage_woocommerce' ) ) {
  55. add_action( 'admin_print_styles', array( __CLASS__, 'add_notices' ) );
  56. }
  57. }
  58. /**
  59. * Parses query to create nonces when available.
  60. *
  61. * @deprecated 5.4.0
  62. * @param object $response The WP_REST_Response we're working with.
  63. * @return object $response The prepared WP_REST_Response object.
  64. */
  65. public static function prepare_note_with_nonce( $response ) {
  66. wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '5.4.0' );
  67. return $response;
  68. }
  69. /**
  70. * Store notices to DB
  71. */
  72. public static function store_notices() {
  73. update_option( 'woocommerce_admin_notices', self::get_notices() );
  74. }
  75. /**
  76. * Get notices
  77. *
  78. * @return array
  79. */
  80. public static function get_notices() {
  81. return self::$notices;
  82. }
  83. /**
  84. * Remove all notices.
  85. */
  86. public static function remove_all_notices() {
  87. self::$notices = array();
  88. }
  89. /**
  90. * Reset notices for themes when switched or a new version of WC is installed.
  91. */
  92. public static function reset_admin_notices() {
  93. if ( ! self::is_ssl() ) {
  94. self::add_notice( 'no_secure_connection' );
  95. }
  96. if ( ! self::is_uploads_directory_protected() ) {
  97. self::add_notice( 'uploads_directory_is_unprotected' );
  98. }
  99. self::add_notice( 'template_files' );
  100. self::add_min_version_notice();
  101. self::add_maxmind_missing_license_key_notice();
  102. }
  103. /**
  104. * Show a notice.
  105. *
  106. * @param string $name Notice name.
  107. * @param bool $force_save Force saving inside this method instead of at the 'shutdown'.
  108. */
  109. public static function add_notice( $name, $force_save = false ) {
  110. self::$notices = array_unique( array_merge( self::get_notices(), array( $name ) ) );
  111. if ( $force_save ) {
  112. // Adding early save to prevent more race conditions with notices.
  113. self::store_notices();
  114. }
  115. }
  116. /**
  117. * Remove a notice from being displayed.
  118. *
  119. * @param string $name Notice name.
  120. * @param bool $force_save Force saving inside this method instead of at the 'shutdown'.
  121. */
  122. public static function remove_notice( $name, $force_save = false ) {
  123. self::$notices = array_diff( self::get_notices(), array( $name ) );
  124. delete_option( 'woocommerce_admin_notice_' . $name );
  125. if ( $force_save ) {
  126. // Adding early save to prevent more race conditions with notices.
  127. self::store_notices();
  128. }
  129. }
  130. /**
  131. * See if a notice is being shown.
  132. *
  133. * @param string $name Notice name.
  134. *
  135. * @return boolean
  136. */
  137. public static function has_notice( $name ) {
  138. return in_array( $name, self::get_notices(), true );
  139. }
  140. /**
  141. * Hide a notice if the GET variable is set.
  142. */
  143. public static function hide_notices() {
  144. if ( isset( $_GET['wc-hide-notice'] ) && isset( $_GET['_wc_notice_nonce'] ) ) { // WPCS: input var ok, CSRF ok.
  145. if ( ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wc_notice_nonce'] ) ), 'woocommerce_hide_notices_nonce' ) ) { // WPCS: input var ok, CSRF ok.
  146. wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
  147. }
  148. if ( ! current_user_can( 'manage_woocommerce' ) ) {
  149. wp_die( esc_html__( 'You don&#8217;t have permission to do this.', 'woocommerce' ) );
  150. }
  151. $hide_notice = sanitize_text_field( wp_unslash( $_GET['wc-hide-notice'] ) ); // WPCS: input var ok, CSRF ok.
  152. self::remove_notice( $hide_notice );
  153. update_user_meta( get_current_user_id(), 'dismissed_' . $hide_notice . '_notice', true );
  154. do_action( 'woocommerce_hide_' . $hide_notice . '_notice' );
  155. }
  156. }
  157. /**
  158. * Add notices + styles if needed.
  159. */
  160. public static function add_notices() {
  161. $notices = self::get_notices();
  162. if ( empty( $notices ) ) {
  163. return;
  164. }
  165. $screen = get_current_screen();
  166. $screen_id = $screen ? $screen->id : '';
  167. $show_on_screens = array(
  168. 'dashboard',
  169. 'plugins',
  170. );
  171. // Notices should only show on WooCommerce screens, the main dashboard, and on the plugins screen.
  172. if ( ! in_array( $screen_id, wc_get_screen_ids(), true ) && ! in_array( $screen_id, $show_on_screens, true ) ) {
  173. return;
  174. }
  175. wp_enqueue_style( 'woocommerce-activation', plugins_url( '/assets/css/activation.css', WC_PLUGIN_FILE ), array(), Constants::get_constant( 'WC_VERSION' ) );
  176. // Add RTL support.
  177. wp_style_add_data( 'woocommerce-activation', 'rtl', 'replace' );
  178. foreach ( $notices as $notice ) {
  179. if ( ! empty( self::$core_notices[ $notice ] ) && apply_filters( 'woocommerce_show_admin_notice', true, $notice ) ) {
  180. add_action( 'admin_notices', array( __CLASS__, self::$core_notices[ $notice ] ) );
  181. } else {
  182. add_action( 'admin_notices', array( __CLASS__, 'output_custom_notices' ) );
  183. }
  184. }
  185. }
  186. /**
  187. * Add a custom notice.
  188. *
  189. * @param string $name Notice name.
  190. * @param string $notice_html Notice HTML.
  191. */
  192. public static function add_custom_notice( $name, $notice_html ) {
  193. self::add_notice( $name );
  194. update_option( 'woocommerce_admin_notice_' . $name, wp_kses_post( $notice_html ) );
  195. }
  196. /**
  197. * Output any stored custom notices.
  198. */
  199. public static function output_custom_notices() {
  200. $notices = self::get_notices();
  201. if ( ! empty( $notices ) ) {
  202. foreach ( $notices as $notice ) {
  203. if ( empty( self::$core_notices[ $notice ] ) ) {
  204. $notice_html = get_option( 'woocommerce_admin_notice_' . $notice );
  205. if ( $notice_html ) {
  206. include dirname( __FILE__ ) . '/views/html-notice-custom.php';
  207. }
  208. }
  209. }
  210. }
  211. }
  212. /**
  213. * If we need to update the database, include a message with the DB update button.
  214. */
  215. public static function update_notice() {
  216. $screen = get_current_screen();
  217. $screen_id = $screen ? $screen->id : '';
  218. if ( WC()->is_wc_admin_active() && in_array( $screen_id, wc_get_screen_ids(), true ) ) {
  219. return;
  220. }
  221. if ( WC_Install::needs_db_update() ) {
  222. $next_scheduled_date = WC()->queue()->get_next( 'woocommerce_run_update_callback', null, 'woocommerce-db-updates' );
  223. if ( $next_scheduled_date || ! empty( $_GET['do_update_woocommerce'] ) ) { // WPCS: input var ok, CSRF ok.
  224. include dirname( __FILE__ ) . '/views/html-notice-updating.php';
  225. } else {
  226. include dirname( __FILE__ ) . '/views/html-notice-update.php';
  227. }
  228. } else {
  229. include dirname( __FILE__ ) . '/views/html-notice-updated.php';
  230. }
  231. }
  232. /**
  233. * If we have just installed, show a message with the install pages button.
  234. *
  235. * @deprecated 4.6.0
  236. */
  237. public static function install_notice() {
  238. _deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', __( 'Onboarding is maintained in WooCommerce Admin.', 'woocommerce' ) );
  239. }
  240. /**
  241. * Show a notice highlighting bad template files.
  242. */
  243. public static function template_file_check_notice() {
  244. $core_templates = WC_Admin_Status::scan_template_files( WC()->plugin_path() . '/templates' );
  245. $outdated = false;
  246. foreach ( $core_templates as $file ) {
  247. $theme_file = false;
  248. if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
  249. $theme_file = get_stylesheet_directory() . '/' . $file;
  250. } elseif ( file_exists( get_stylesheet_directory() . '/' . WC()->template_path() . $file ) ) {
  251. $theme_file = get_stylesheet_directory() . '/' . WC()->template_path() . $file;
  252. } elseif ( file_exists( get_template_directory() . '/' . $file ) ) {
  253. $theme_file = get_template_directory() . '/' . $file;
  254. } elseif ( file_exists( get_template_directory() . '/' . WC()->template_path() . $file ) ) {
  255. $theme_file = get_template_directory() . '/' . WC()->template_path() . $file;
  256. }
  257. if ( false !== $theme_file ) {
  258. $core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file );
  259. $theme_version = WC_Admin_Status::get_file_version( $theme_file );
  260. if ( $core_version && $theme_version && version_compare( $theme_version, $core_version, '<' ) ) {
  261. $outdated = true;
  262. break;
  263. }
  264. }
  265. }
  266. if ( $outdated ) {
  267. include dirname( __FILE__ ) . '/views/html-notice-template-check.php';
  268. } else {
  269. self::remove_notice( 'template_files' );
  270. }
  271. }
  272. /**
  273. * Show a notice asking users to convert to shipping zones.
  274. *
  275. * @todo remove in 4.0.0
  276. */
  277. public static function legacy_shipping_notice() {
  278. $maybe_load_legacy_methods = array( 'flat_rate', 'free_shipping', 'international_delivery', 'local_delivery', 'local_pickup' );
  279. $enabled = false;
  280. foreach ( $maybe_load_legacy_methods as $method ) {
  281. $options = get_option( 'woocommerce_' . $method . '_settings' );
  282. if ( $options && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) {
  283. $enabled = true;
  284. }
  285. }
  286. if ( $enabled ) {
  287. include dirname( __FILE__ ) . '/views/html-notice-legacy-shipping.php';
  288. } else {
  289. self::remove_notice( 'template_files' );
  290. }
  291. }
  292. /**
  293. * No shipping methods.
  294. */
  295. public static function no_shipping_methods_notice() {
  296. if ( wc_shipping_enabled() && ( empty( $_GET['page'] ) || empty( $_GET['tab'] ) || 'wc-settings' !== $_GET['page'] || 'shipping' !== $_GET['tab'] ) ) { // WPCS: input var ok, CSRF ok.
  297. $product_count = wp_count_posts( 'product' );
  298. $method_count = wc_get_shipping_method_count();
  299. if ( $product_count->publish > 0 && 0 === $method_count ) {
  300. include dirname( __FILE__ ) . '/views/html-notice-no-shipping-methods.php';
  301. }
  302. if ( $method_count > 0 ) {
  303. self::remove_notice( 'no_shipping_methods' );
  304. }
  305. }
  306. }
  307. /**
  308. * Notice shown when regenerating thumbnails background process is running.
  309. */
  310. public static function regenerating_thumbnails_notice() {
  311. include dirname( __FILE__ ) . '/views/html-notice-regenerating-thumbnails.php';
  312. }
  313. /**
  314. * Notice about secure connection.
  315. */
  316. public static function secure_connection_notice() {
  317. if ( self::is_ssl() || get_user_meta( get_current_user_id(), 'dismissed_no_secure_connection_notice', true ) ) {
  318. return;
  319. }
  320. include dirname( __FILE__ ) . '/views/html-notice-secure-connection.php';
  321. }
  322. /**
  323. * Notice shown when regenerating thumbnails background process is running.
  324. *
  325. * @since 3.6.0
  326. */
  327. public static function regenerating_lookup_table_notice() {
  328. // See if this is still relevent.
  329. if ( ! wc_update_product_lookup_tables_is_running() ) {
  330. self::remove_notice( 'regenerating_lookup_table' );
  331. return;
  332. }
  333. include dirname( __FILE__ ) . '/views/html-notice-regenerating-lookup-table.php';
  334. }
  335. /**
  336. * Add notice about minimum PHP and WordPress requirement.
  337. *
  338. * @since 3.6.5
  339. */
  340. public static function add_min_version_notice() {
  341. if ( version_compare( phpversion(), WC_NOTICE_MIN_PHP_VERSION, '<' ) || version_compare( get_bloginfo( 'version' ), WC_NOTICE_MIN_WP_VERSION, '<' ) ) {
  342. self::add_notice( WC_PHP_MIN_REQUIREMENTS_NOTICE );
  343. }
  344. }
  345. /**
  346. * Notice about WordPress and PHP minimum requirements.
  347. *
  348. * @since 3.6.5
  349. * @return void
  350. */
  351. public static function wp_php_min_requirements_notice() {
  352. if ( apply_filters( 'woocommerce_hide_php_wp_nag', get_user_meta( get_current_user_id(), 'dismissed_' . WC_PHP_MIN_REQUIREMENTS_NOTICE . '_notice', true ) ) ) {
  353. self::remove_notice( WC_PHP_MIN_REQUIREMENTS_NOTICE );
  354. return;
  355. }
  356. $old_php = version_compare( phpversion(), WC_NOTICE_MIN_PHP_VERSION, '<' );
  357. $old_wp = version_compare( get_bloginfo( 'version' ), WC_NOTICE_MIN_WP_VERSION, '<' );
  358. // Both PHP and WordPress up to date version => no notice.
  359. if ( ! $old_php && ! $old_wp ) {
  360. return;
  361. }
  362. if ( $old_php && $old_wp ) {
  363. $msg = sprintf(
  364. /* translators: 1: Minimum PHP version 2: Minimum WordPress version */
  365. __( 'Update required: WooCommerce will soon require PHP version %1$s and WordPress version %2$s or newer.', 'woocommerce' ),
  366. WC_NOTICE_MIN_PHP_VERSION,
  367. WC_NOTICE_MIN_WP_VERSION
  368. );
  369. } elseif ( $old_php ) {
  370. $msg = sprintf(
  371. /* translators: %s: Minimum PHP version */
  372. __( 'Update required: WooCommerce will soon require PHP version %s or newer.', 'woocommerce' ),
  373. WC_NOTICE_MIN_PHP_VERSION
  374. );
  375. } elseif ( $old_wp ) {
  376. $msg = sprintf(
  377. /* translators: %s: Minimum WordPress version */
  378. __( 'Update required: WooCommerce will soon require WordPress version %s or newer.', 'woocommerce' ),
  379. WC_NOTICE_MIN_WP_VERSION
  380. );
  381. }
  382. include dirname( __FILE__ ) . '/views/html-notice-wp-php-minimum-requirements.php';
  383. }
  384. /**
  385. * Add MaxMind missing license key notice.
  386. *
  387. * @since 3.9.0
  388. */
  389. public static function add_maxmind_missing_license_key_notice() {
  390. $default_address = get_option( 'woocommerce_default_customer_address' );
  391. if ( ! in_array( $default_address, array( 'geolocation', 'geolocation_ajax' ), true ) ) {
  392. return;
  393. }
  394. $integration_options = get_option( 'woocommerce_maxmind_geolocation_settings' );
  395. if ( empty( $integration_options['license_key'] ) ) {
  396. self::add_notice( 'maxmind_license_key' );
  397. }
  398. }
  399. /**
  400. * Add notice about Redirect-only download method, nudging user to switch to a different method instead.
  401. */
  402. public static function add_redirect_download_method_notice() {
  403. if ( 'redirect' === get_option( 'woocommerce_file_download_method' ) ) {
  404. self::add_notice( 'redirect_download_method' );
  405. } else {
  406. self::remove_notice( 'redirect_download_method' );
  407. }
  408. }
  409. /**
  410. * Display MaxMind missing license key notice.
  411. *
  412. * @since 3.9.0
  413. */
  414. public static function maxmind_missing_license_key_notice() {
  415. $user_dismissed_notice = get_user_meta( get_current_user_id(), 'dismissed_maxmind_license_key_notice', true );
  416. $filter_dismissed_notice = ! apply_filters( 'woocommerce_maxmind_geolocation_display_notices', true );
  417. if ( $user_dismissed_notice || $filter_dismissed_notice ) {
  418. self::remove_notice( 'maxmind_license_key' );
  419. return;
  420. }
  421. include dirname( __FILE__ ) . '/views/html-notice-maxmind-license-key.php';
  422. }
  423. /**
  424. * Notice about Redirect-Only download method.
  425. *
  426. * @since 4.0
  427. */
  428. public static function redirect_download_method_notice() {
  429. if ( apply_filters( 'woocommerce_hide_redirect_method_nag', get_user_meta( get_current_user_id(), 'dismissed_redirect_download_method_notice', true ) ) ) {
  430. self::remove_notice( 'redirect_download_method' );
  431. return;
  432. }
  433. include dirname( __FILE__ ) . '/views/html-notice-redirect-only-download.php';
  434. }
  435. /**
  436. * Notice about uploads directory begin unprotected.
  437. *
  438. * @since 4.2.0
  439. */
  440. public static function uploads_directory_is_unprotected_notice() {
  441. if ( get_user_meta( get_current_user_id(), 'dismissed_uploads_directory_is_unprotected_notice', true ) || self::is_uploads_directory_protected() ) {
  442. self::remove_notice( 'uploads_directory_is_unprotected' );
  443. return;
  444. }
  445. include dirname( __FILE__ ) . '/views/html-notice-uploads-directory-is-unprotected.php';
  446. }
  447. /**
  448. * Notice about base tables missing.
  449. */
  450. public static function base_tables_missing_notice() {
  451. $notice_dismissed = apply_filters(
  452. 'woocommerce_hide_base_tables_missing_nag',
  453. get_user_meta( get_current_user_id(), 'dismissed_base_tables_missing_notice', true )
  454. );
  455. if ( $notice_dismissed ) {
  456. self::remove_notice( 'base_tables_missing' );
  457. }
  458. include dirname( __FILE__ ) . '/views/html-notice-base-table-missing.php';
  459. }
  460. /**
  461. * Determine if the store is running SSL.
  462. *
  463. * @return bool Flag SSL enabled.
  464. * @since 3.5.1
  465. */
  466. protected static function is_ssl() {
  467. $shop_page = wc_get_page_permalink( 'shop' );
  468. return ( is_ssl() && 'https' === substr( $shop_page, 0, 5 ) );
  469. }
  470. /**
  471. * Wrapper for is_plugin_active.
  472. *
  473. * @param string $plugin Plugin to check.
  474. * @return boolean
  475. */
  476. protected static function is_plugin_active( $plugin ) {
  477. if ( ! function_exists( 'is_plugin_active' ) ) {
  478. include_once ABSPATH . 'wp-admin/includes/plugin.php';
  479. }
  480. return is_plugin_active( $plugin );
  481. }
  482. /**
  483. * Simplify Commerce is no longer in core.
  484. *
  485. * @deprecated 3.6.0 No longer shown.
  486. */
  487. public static function simplify_commerce_notice() {
  488. wc_deprecated_function( 'WC_Admin_Notices::simplify_commerce_notice', '3.6.0' );
  489. }
  490. /**
  491. * Show the Theme Check notice.
  492. *
  493. * @deprecated 3.3.0 No longer shown.
  494. */
  495. public static function theme_check_notice() {
  496. wc_deprecated_function( 'WC_Admin_Notices::theme_check_notice', '3.3.0' );
  497. }
  498. /**
  499. * Check if uploads directory is protected.
  500. *
  501. * @since 4.2.0
  502. * @return bool
  503. */
  504. protected static function is_uploads_directory_protected() {
  505. $cache_key = '_woocommerce_upload_directory_status';
  506. $status = get_transient( $cache_key );
  507. // Check for cache.
  508. if ( false !== $status ) {
  509. return 'protected' === $status;
  510. }
  511. // Get only data from the uploads directory.
  512. $uploads = wp_get_upload_dir();
  513. // Check for the "uploads/woocommerce_uploads" directory.
  514. $response = wp_safe_remote_get(
  515. esc_url_raw( $uploads['baseurl'] . '/woocommerce_uploads/' ),
  516. array(
  517. 'redirection' => 0,
  518. )
  519. );
  520. $response_code = intval( wp_remote_retrieve_response_code( $response ) );
  521. $response_content = wp_remote_retrieve_body( $response );
  522. // Check if returns 200 with empty content in case can open an index.html file,
  523. // and check for non-200 codes in case the directory is protected.
  524. $is_protected = ( 200 === $response_code && empty( $response_content ) ) || ( 200 !== $response_code );
  525. set_transient( $cache_key, $is_protected ? 'protected' : 'unprotected', 1 * DAY_IN_SECONDS );
  526. return $is_protected;
  527. }
  528. }
  529. WC_Admin_Notices::init();