PHP 8.2.31
Preview: UnsecuredReportFiles.php Size: 2.12 KB
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/woocommerce/src/Internal/Admin/Notes/UnsecuredReportFiles.php

<?php
/**
 * WooCommerce Admin Unsecured Files Note.
 *
 * Adds a warning about potentially unsecured files.
 */

namespace Automattic\WooCommerce\Internal\Admin\Notes;

defined( 'ABSPATH' ) || exit;

use Automattic\WooCommerce\Admin\Notes\Note;

if ( ! class_exists( Note::class ) ) {
	class_alias( WC_Admin_Note::class, Note::class );
}

/**
 * Unsecured_Report_Files
 */
class UnsecuredReportFiles {

	/**
	 * Name of the note for use in the database.
	 */
	const NOTE_NAME = 'wc-admin-remove-unsecured-report-files';

	/**
	 * Get the note.
	 *
	 * @return Note|null
	 */
	public static function get_note() {
		$note = new Note();
		$note->set_title( __( 'Potentially unsecured files were found in your uploads directory', 'woocommerce' ) );
		$note->set_content(
			sprintf(
				/* translators: 1: opening analytics docs link tag. 2: closing link tag */
				__( 'Files that may contain %1$sstore analytics%2$s reports were found in your uploads directory - we recommend assessing and deleting any such files.', 'woocommerce' ),
				'<a href="https://woocommerce.com/document/woocommerce-analytics/" target="_blank">',
				'</a>'
			)
		);
		$note->set_content_data( (object) array() );
		$note->set_type( Note::E_WC_ADMIN_NOTE_ERROR );
		$note->set_name( self::NOTE_NAME );
		$note->set_source( 'woocommerce-admin' );
		$note->add_action(
			'learn-more',
			__( 'Learn more', 'woocommerce' ),
			'https://developer.woocommerce.com/2021/09/22/important-security-patch-released-in-woocommerce/',
			Note::E_WC_ADMIN_NOTE_UNACTIONED,
			true
		);
		$note->add_action(
			'dismiss',
			__( 'Dismiss', 'woocommerce' ),
			wc_admin_url(),
			Note::E_WC_ADMIN_NOTE_ACTIONED,
			false
		);

		return $note;
	}

	/**
	 * Add the note if it passes predefined conditions.
	 */
	public static function possibly_add_note() {
		$note = self::get_note();

		if ( self::note_exists() ) {
			return;
		}

		$note->save();
	}

	/**
	 * Check if the note has been previously added.
	 */
	public static function note_exists() {
		$data_store = \WC_Data_Store::load( 'admin-note' );
		$note_ids   = $data_store->get_notes_with_name( self::NOTE_NAME );
		return ! empty( $note_ids );
	}

}

Directory Contents

Dirs: 0 × Files: 30

Name Size Perms Modified Actions
2.35 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.20 KB lrw-r--r-- 2025-01-21 18:53:44
Edit Download
1.68 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.82 KB lrw-r--r-- 2025-06-02 15:59:32
Edit Download
1.63 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.18 KB lrw-r--r-- 2025-01-21 18:53:44
Edit Download
1.50 KB lrw-r--r-- 2022-08-24 02:07:06
Edit Download
4.58 KB lrw-r--r-- 2023-03-21 20:45:06
Edit Download
1.68 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.45 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
1.54 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
3.68 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.21 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
1.39 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
5.25 KB lrw-r--r-- 2022-09-20 22:53:36
Edit Download
1.74 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.68 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
9.15 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.14 KB lrw-r--r-- 2026-01-19 14:46:18
Edit Download
2.06 KB lrw-r--r-- 2026-01-19 14:46:18
Edit Download
1.64 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
1.91 KB lrw-r--r-- 2023-03-21 20:45:06
Edit Download
1.51 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
2.75 KB lrw-r--r-- 2026-01-19 14:46:18
Edit Download
2.38 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
3.17 KB lrw-r--r-- 2025-01-21 18:53:44
Edit Download
2.12 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
6.25 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
1.88 KB lrw-r--r-- 2024-04-10 16:54:10
Edit Download
13.25 KB lrw-r--r-- 2025-05-12 21:07:28
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).