IsExcludingTrait.php
2 years ago
IsExportingTrait.php
2 years ago
RemoteUploadTrait.php
1 month ago
WithPluginsThemesMuPluginsTrait.php
3 years ago
IsExcludingTrait.php
185 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPStaging\Backup\Dto\Traits; |
| 4 | |
| 5 | use WPStaging\Core\WPStaging; |
| 6 | |
| 7 | trait IsExcludingTrait |
| 8 | { |
| 9 | /** @var bool */ |
| 10 | private $isExcludingSpamComments = false; |
| 11 | |
| 12 | /** @var bool */ |
| 13 | private $isExcludingPostRevision = false; |
| 14 | |
| 15 | /** @var bool */ |
| 16 | private $isExcludingDeactivatedPlugins = false; |
| 17 | |
| 18 | /** @var bool */ |
| 19 | private $isExcludingUnusedThemes = false; |
| 20 | |
| 21 | /** @var bool */ |
| 22 | private $isExcludingLogs = false; |
| 23 | |
| 24 | /** @var bool */ |
| 25 | private $isExcludingCaches = false; |
| 26 | |
| 27 | /** @var bool */ |
| 28 | private $isSmartExclusion = false; |
| 29 | |
| 30 | /** |
| 31 | * @param bool $checkSmartExclusion |
| 32 | * |
| 33 | * @return bool |
| 34 | */ |
| 35 | public function getIsExcludingSpamComments($checkSmartExclusion = true): bool |
| 36 | { |
| 37 | if ($checkSmartExclusion) { |
| 38 | return WPStaging::isPro() && $this->isSmartExclusion && $this->isExcludingSpamComments; |
| 39 | } |
| 40 | |
| 41 | return $this->isExcludingSpamComments; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @param bool $isExcludingSpamComments |
| 46 | * @return void |
| 47 | */ |
| 48 | public function setIsExcludingSpamComments($isExcludingSpamComments) |
| 49 | { |
| 50 | $this->isExcludingSpamComments = $isExcludingSpamComments; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * @param bool $checkSmartExclusion |
| 55 | * |
| 56 | * @return bool |
| 57 | */ |
| 58 | public function getIsExcludingPostRevision($checkSmartExclusion = true): bool |
| 59 | { |
| 60 | if ($checkSmartExclusion) { |
| 61 | return WPStaging::isPro() && $this->isSmartExclusion && $this->isExcludingPostRevision; |
| 62 | } |
| 63 | |
| 64 | return $this->isExcludingPostRevision; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @param bool $isExcludingPostRevision |
| 69 | * @return void |
| 70 | */ |
| 71 | public function setIsExcludingPostRevision($isExcludingPostRevision) |
| 72 | { |
| 73 | $this->isExcludingPostRevision = $isExcludingPostRevision; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * @param bool $checkSmartExclusion |
| 78 | * |
| 79 | * @return bool |
| 80 | */ |
| 81 | public function getIsExcludingDeactivatedPlugins($checkSmartExclusion = true): bool |
| 82 | { |
| 83 | if ($checkSmartExclusion) { |
| 84 | return WPStaging::isPro() && $this->isSmartExclusion && $this->isExcludingDeactivatedPlugins; |
| 85 | } |
| 86 | |
| 87 | return $this->isExcludingDeactivatedPlugins; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * @param bool $isExcludingDeactivatedPlugins |
| 92 | * @return void |
| 93 | */ |
| 94 | public function setIsExcludingDeactivatedPlugins($isExcludingDeactivatedPlugins) |
| 95 | { |
| 96 | $this->isExcludingDeactivatedPlugins = $isExcludingDeactivatedPlugins; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * @param bool $checkSmartExclusion |
| 101 | * |
| 102 | * @return bool |
| 103 | */ |
| 104 | public function getIsExcludingUnusedThemes($checkSmartExclusion = true): bool |
| 105 | { |
| 106 | if ($checkSmartExclusion) { |
| 107 | return WPStaging::isPro() && $this->isSmartExclusion && $this->isExcludingUnusedThemes; |
| 108 | } |
| 109 | |
| 110 | return $this->isExcludingUnusedThemes; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * @param bool $isExcludingUnusedThemes |
| 115 | * @return void |
| 116 | */ |
| 117 | public function setIsExcludingUnusedThemes($isExcludingUnusedThemes) |
| 118 | { |
| 119 | $this->isExcludingUnusedThemes = $isExcludingUnusedThemes; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * @param bool $checkSmartExclusion |
| 124 | * |
| 125 | * @return bool |
| 126 | */ |
| 127 | public function getIsExcludingLogs($checkSmartExclusion = true): bool |
| 128 | { |
| 129 | if ($checkSmartExclusion) { |
| 130 | return WPStaging::isPro() && $this->isSmartExclusion && $this->isExcludingLogs; |
| 131 | } |
| 132 | |
| 133 | return $this->isExcludingLogs; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * @param bool $isExcludingLogs |
| 138 | * @return void |
| 139 | */ |
| 140 | public function setIsExcludingLogs($isExcludingLogs) |
| 141 | { |
| 142 | $this->isExcludingLogs = $isExcludingLogs; |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * @param bool $checkSmartExclusion |
| 147 | * |
| 148 | * @return bool |
| 149 | */ |
| 150 | public function getIsExcludingCaches($checkSmartExclusion = true): bool |
| 151 | { |
| 152 | if ($checkSmartExclusion) { |
| 153 | return WPStaging::isPro() && $this->isSmartExclusion && $this->isExcludingCaches; |
| 154 | } |
| 155 | |
| 156 | return $this->isExcludingCaches; |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * @param bool $isExcludingCaches |
| 161 | * @return void |
| 162 | */ |
| 163 | public function setIsExcludingCaches($isExcludingCaches) |
| 164 | { |
| 165 | $this->isExcludingCaches = $isExcludingCaches; |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * @return bool |
| 170 | */ |
| 171 | public function getIsSmartExclusion(): bool |
| 172 | { |
| 173 | return $this->isSmartExclusion; |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * @param bool $isSmartExclusion |
| 178 | * @return void |
| 179 | */ |
| 180 | public function setIsSmartExclusion($isSmartExclusion) |
| 181 | { |
| 182 | $this->isSmartExclusion = $isSmartExclusion; |
| 183 | } |
| 184 | } |
| 185 |