BunnyWebhookUpgrade.php
4 months ago
OnboardingBackfillUpgrade.php
1 month ago
PerformanceUpgrade.php
1 year ago
TransientsUpgrade.php
3 weeks ago
Upgrades.php
1 month ago
VisitsUpgrade.php
1 year ago
PerformanceUpgrade.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace PrestoPlayer\Database\Upgrades; |
| 4 | |
| 5 | use PrestoPlayer\Models\Setting; |
| 6 | |
| 7 | class PerformanceUpgrade { |
| 8 | |
| 9 | protected $name = 'presto_player_pro_update_performance'; |
| 10 | |
| 11 | public function migrate() { |
| 12 | if ( get_option( $this->name, false ) ) { |
| 13 | return; |
| 14 | } |
| 15 | |
| 16 | // plugin has not yet been installed, default to off |
| 17 | if ( ! get_option( 'presto_player_visits_database_version', 0 ) ) { |
| 18 | update_option( $this->name, true, 'no' ); |
| 19 | return; |
| 20 | } |
| 21 | |
| 22 | // turn on setting if not yet set |
| 23 | Setting::set( 'performance', 'module_enabled', true ); |
| 24 | |
| 25 | update_option( $this->name, true, 'no' ); |
| 26 | } |
| 27 | } |
| 28 |