IsExcludingTrait.php
1 day ago
IsExportingTrait.php
1 day ago
RemoteUploadTrait.php
1 day ago
WithPluginsThemesMuPluginsTrait.php
1 day 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 | |
| 10 | private $isExcludingSpamComments = false; |
| 11 | |
| 12 | |
| 13 | private $isExcludingPostRevision = false; |
| 14 | |
| 15 | |
| 16 | private $isExcludingDeactivatedPlugins = false; |
| 17 | |
| 18 | |
| 19 | private $isExcludingUnusedThemes = false; |
| 20 | |
| 21 | |
| 22 | private $isExcludingLogs = false; |
| 23 | |
| 24 | |
| 25 | private $isExcludingCaches = false; |
| 26 | |
| 27 | |
| 28 | private $isSmartExclusion = false; |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 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 | |
| 46 | |
| 47 | |
| 48 | public function setIsExcludingSpamComments($isExcludingSpamComments) |
| 49 | { |
| 50 | $this->isExcludingSpamComments = $isExcludingSpamComments; |
| 51 | } |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 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 | |
| 69 | |
| 70 | |
| 71 | public function setIsExcludingPostRevision($isExcludingPostRevision) |
| 72 | { |
| 73 | $this->isExcludingPostRevision = $isExcludingPostRevision; |
| 74 | } |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 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 | |
| 92 | |
| 93 | |
| 94 | public function setIsExcludingDeactivatedPlugins($isExcludingDeactivatedPlugins) |
| 95 | { |
| 96 | $this->isExcludingDeactivatedPlugins = $isExcludingDeactivatedPlugins; |
| 97 | } |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 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 | |
| 115 | |
| 116 | |
| 117 | public function setIsExcludingUnusedThemes($isExcludingUnusedThemes) |
| 118 | { |
| 119 | $this->isExcludingUnusedThemes = $isExcludingUnusedThemes; |
| 120 | } |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 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 | |
| 138 | |
| 139 | |
| 140 | public function setIsExcludingLogs($isExcludingLogs) |
| 141 | { |
| 142 | $this->isExcludingLogs = $isExcludingLogs; |
| 143 | } |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 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 | |
| 161 | |
| 162 | |
| 163 | public function setIsExcludingCaches($isExcludingCaches) |
| 164 | { |
| 165 | $this->isExcludingCaches = $isExcludingCaches; |
| 166 | } |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | public function getIsSmartExclusion(): bool |
| 172 | { |
| 173 | return $this->isSmartExclusion; |
| 174 | } |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | public function setIsSmartExclusion($isSmartExclusion) |
| 181 | { |
| 182 | $this->isSmartExclusion = $isSmartExclusion; |
| 183 | } |
| 184 | } |
| 185 |