PluginProbe
Tiered Pricing Table for WooCommerce / 6.1.0
Tiered Pricing Table for WooCommerce v6.1.0
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
tier-pricing-table / src / BackgroundProcessing / Updater / Updater.php

Updater.php in Tiered Pricing Table for WooCommerce 6.1.0, at src/BackgroundProcessing/Updater/Updater.php

38 lines 749 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace TierPricingTable\BackgroundProcessing\Updater;
2
3 use TierPricingTable\TierPricingTablePlugin;
4
5 class Updater {
6
7 const DB_OPTION = 'tiered_price_table_version';
8
9 public function checkForUpdates() {
10 return $this->compare( TierPricingTablePlugin::DB_VERSION );
11 }
12
13 /**
14 * Compare plugin versions
15 *
16 * @param $version
17 *
18 * @return mixed
19 */
20 private function compare( $version ) {
21 $dbVersion = get_option( self::DB_OPTION, '1.0.0' );
22
23 return version_compare( $dbVersion, $version, '<' );
24 }
25
26 public function update() {
27 foreach ( $this->getUpdates() as $version => $callback ) {
28 if ( $this->compare( $version ) ) {
29 call_user_func( $callback );
30 }
31 }
32 }
33
34 public function getUpdates() {
35 return array();
36 }
37 }
38