AfterMigrationNotice.php
2 years ago
BlackFridayNotice.php
3 months ago
ChangedTrackingNotice.php
3 years ago
DatabaseEngineNotice.php
1 year ago
DeprecatedFilterNotice.php
4 years ago
DisabledMailFunctionNotice.php
3 months ago
DisabledWPCronNotice.php
1 year ago
EmailWithInvalidSegmentNotice.php
3 years ago
HeadersAlreadySentNotice.php
3 months ago
InactiveSubscribersNotice.php
2 years ago
PHPVersionWarnings.php
3 months ago
PendingApprovalNotice.php
2 years ago
PermanentNotices.php
3 months ago
PremiumFeaturesAvailableNotice.php
3 years ago
SenderDomainAuthenticationNotices.php
5 months ago
SendingQueueBodyCleanupNotice.php
3 months ago
StuckPostNotificationNotice.php
3 months ago
UnauthorizedEmailInNewslettersNotice.php
5 months ago
UnauthorizedEmailNotice.php
5 months ago
WooCommerceVersionWarning.php
1 year ago
WordPressPlaygroundNotice.php
1 year ago
index.php
3 years ago
WordPressPlaygroundNotice.php
34 lines
| 1 | <?php declare(strict_types = 1); |
| 2 | |
| 3 | namespace MailPoet\Util\Notices; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoet\Doctrine\WPDB\Connection; |
| 9 | use MailPoet\WP\Notice; |
| 10 | |
| 11 | class WordPressPlaygroundNotice { |
| 12 | const OPTION_NAME = 'wordpress-playground-notice'; |
| 13 | |
| 14 | public function init($shouldDisplay): ?Notice { |
| 15 | if (!$shouldDisplay || !Connection::isSQLite()) { |
| 16 | return null; |
| 17 | } |
| 18 | return $this->display(); |
| 19 | } |
| 20 | |
| 21 | private function display(): Notice { |
| 22 | return Notice::displayWarning( |
| 23 | sprintf( |
| 24 | '<p><strong>%s</strong></p><p>%s</p>', |
| 25 | __('MailPoet Preview', 'mailpoet'), |
| 26 | __('This is a preview of the MailPoet plugin. Please note that some functionality may be limited.', 'mailpoet') |
| 27 | ), |
| 28 | null, |
| 29 | self::OPTION_NAME, |
| 30 | false |
| 31 | ); |
| 32 | } |
| 33 | } |
| 34 |