| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | |
| 9 | 9 | use Extendify\AdminPageRouter; |
| 10 | 10 | use Extendify\Assist\Admin as AssistAdmin; |
| 11 | 11 | use Extendify\Agent\Admin as AgentAdmin; |
| 12 | +use Extendify\ComingSoon\Frontend as ComingSoonFrontend; | |
| 12 | 13 | use Extendify\Config; |
| 13 | 14 | use Extendify\Draft\Admin as DraftAdmin; |
| 14 | 15 | use Extendify\HelpCenter\Admin as HelpCenterAdmin; |
| 15 | 16 | use Extendify\Insights; |
| @@ -20,20 +21,24 @@ | ||
| 20 | 21 | use Extendify\Agent\Frontend as AgentFrontend; |
| 21 | 22 | use Extendify\QuickEdit\Frontend as QuickEditFrontend; |
| 22 | 23 | use Extendify\PageCreator\Admin as PageCreatorAdmin; |
| 23 | 24 | use Extendify\PartnerData; |
| 24 | -use Extendify\PartnerNotification\Admin as PartnerNotificationAdmin; | |
| 25 | +use Extendify\Notifications\Admin as NotificationsAdmin; | |
| 26 | +use Extendify\Notifications\Frontend as NotificationsFrontend; | |
| 25 | 27 | use Extendify\Toolbar\Admin as ToolbarAdmin; |
| 26 | 28 | use Extendify\Toolbar\Frontend as ToolbarFrontend; |
| 27 | 29 | use Extendify\Recommendations\Admin as RecommendationsAdmin; |
| 28 | 30 | use Extendify\PluginNotifications\Admin as PluginNotificationsAdmin; |
| 29 | 31 | use Extendify\Shared\Admin as SharedAdmin; |
| 30 | -use Extendify\Shared\DataProvider\PartnerNotificationData; | |
| 32 | +use Extendify\Shared\DataProvider\NotificationData; | |
| 31 | 33 | use Extendify\Shared\DataProvider\ResourceData; |
| 34 | +use Extendify\Shared\Services\BlockStyleVariations; | |
| 32 | 35 | use Extendify\Shared\Services\ForcePluginReinstall; |
| 33 | 36 | use Extendify\Shared\Services\Import\ImagesImporter; |
| 34 | 37 | use Extendify\Shared\Services\PluginRedirectDisabler; |
| 38 | +use Extendify\Shared\Services\PluginsActivation\SimplyBook; | |
| 35 | 39 | use Extendify\Shared\Services\VersionMigrator; |
| 40 | +use Extendify\SiteVisibility; | |
| 36 | 41 | |
| 37 | 42 | if (!defined('EXTENDIFY_REQUIRED_CAPABILITY')) { |
| 38 | 43 | define('EXTENDIFY_REQUIRED_CAPABILITY', 'manage_options'); |
| 39 | 44 | } |
| @@ -104,8 +109,14 @@ | ||
| 104 | 109 | |
| 105 | 110 | // Force-reinstall support for /wp/v2/plugins (opt-in via request header). |
| 106 | 111 | ForcePluginReinstall::register(); |
| 107 | 112 | |
| 113 | + // Keeps our design variation names registered so global styles can hold them. | |
| 114 | + BlockStyleVariations::register(); | |
| 115 | + | |
| 116 | + // Their registration callback comes in unauthenticated, so this cannot sit behind the capability gate. | |
| 117 | + SimplyBook::register(); | |
| 118 | + | |
| 108 | 119 | // This class will fetch and cache partner data to be used |
| 109 | 120 | // throughout every class below. If opt in. |
| 110 | 121 | new PartnerData(); |
| 111 | 122 | |
| @@ -114,12 +125,16 @@ | ||
| 114 | 125 | |
| 115 | 126 | // Set up scheduled cache (if opt-in and active). |
| 116 | 127 | if (!PartnerData::setting('deactivated')) { |
| 117 | 128 | ResourceData::scheduleCache(); |
| 118 | - PartnerNotificationData::scheduleCache(); | |
| 129 | + NotificationData::scheduleCache(); | |
| 119 | 130 | } |
| 120 | 131 | |
| 121 | 132 | if (!current_user_can(EXTENDIFY_REQUIRED_CAPABILITY)) { |
| 133 | + if (!SiteVisibility::isPublished()) { | |
| 134 | + new ComingSoonFrontend(); | |
| 135 | + } | |
| 136 | + | |
| 122 | 137 | return; |
| 123 | 138 | } |
| 124 | 139 | |
| 125 | 140 | // The config class will collect information about the |
| @@ -191,11 +206,10 @@ | ||
| 191 | 206 | if (PartnerData::setting('showProductRecommendations') || constant('EXTENDIFY_DEVMODE')) { |
| 192 | 207 | new RecommendationsAdmin(); |
| 193 | 208 | } |
| 194 | 209 | |
| 195 | - if (PartnerData::setting('showPartnerNotifications') || constant('EXTENDIFY_DEVMODE')) { | |
| 196 | - new PartnerNotificationAdmin(); | |
| 197 | - } | |
| 210 | + new NotificationsAdmin(); | |
| 211 | + new NotificationsFrontend(); | |
| 198 | 212 | |
| 199 | 213 | if (PartnerData::setting('showDraft') || constant('EXTENDIFY_DEVMODE')) { |
| 200 | 214 | new DraftAdmin(); |
| 201 | 215 | } |