| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Fired during plugin updates |
| 4 | 4 | * |
| 5 | - * @link https://wpsmartpost.com/ | |
| 5 | + * @link https://smartpostshow.com/ | |
| 6 | 6 | * @since 2.2.0 |
| 7 | 7 | * |
| 8 | 8 | * @package Smart_Post_Show |
| 9 | 9 | * @subpackage Smart_Post_Show/includes |
| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // don't call the file directly. |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; // Exit if accessed directly. | |
| 14 | + exit; | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Fired during plugin updates. |
| @@ -17,8 +17,13 @@ | ||
| 17 | 17 | /** |
| 18 | 18 | * Fired during plugin updates. |
| 19 | 19 | * |
| 20 | 20 | * This class defines all code necessary to run during the plugin's updates. |
| 21 | + * | |
| 22 | + * @since 2.2.0 | |
| 23 | + * @package Smart_Post_Show | |
| 24 | + * @subpackage Smart_Post_Show/includes | |
| 25 | + * @author ShapedPlugin <[email protected]> | |
| 21 | 26 | */ |
| 22 | 27 | class Smart_Post_Show_Updates { |
| 23 | 28 | |
| 24 | 29 | /** |
| @@ -26,12 +31,9 @@ | ||
| 26 | 31 | * |
| 27 | 32 | * @var array |
| 28 | 33 | */ |
| 29 | 34 | private static $updates = array( |
| 30 | - '2.2.0' => 'updates/update-2.2.0.php', | |
| 31 | - '2.4.13' => 'updates/update-2.4.13.php', | |
| 32 | - '3.0.0' => 'updates/update-3.0.0.php', | |
| 33 | - '3.0.6' => 'updates/update-3.0.6.php', | |
| 35 | + '2.2.0' => 'updates/update-2.2.0.php', | |
| 34 | 36 | ); |
| 35 | 37 | |
| 36 | 38 | /** |
| 37 | 39 | * Binding all events |
| @@ -100,21 +102,15 @@ | ||
| 100 | 102 | $installed_version = get_option( 'smart_post_show_version' ); |
| 101 | 103 | |
| 102 | 104 | foreach ( self::$updates as $version => $path ) { |
| 103 | 105 | if ( version_compare( $installed_version, $version, '<' ) ) { |
| 104 | - $allowed_paths = array( | |
| 105 | - 'updates/update-2.2.0.php', | |
| 106 | - 'updates/update-2.4.13.php', | |
| 107 | - 'updates/update-3.0.0.php', | |
| 108 | - 'updates/update-3.0.6.php', | |
| 109 | - ); | |
| 110 | - if ( in_array( $path, $allowed_paths ) && file_exists( SP_PC_PATH . 'includes/' . $path ) ) { | |
| 111 | - require_once SP_PC_PATH . 'includes/' . $path; | |
| 112 | - } | |
| 106 | + include $path; | |
| 113 | 107 | update_option( 'smart_post_show_version', $version ); |
| 114 | 108 | } |
| 115 | 109 | } |
| 116 | 110 | |
| 117 | 111 | update_option( 'smart_post_show_version', SMART_POST_SHOW_VERSION ); |
| 112 | + | |
| 118 | 113 | } |
| 114 | + | |
| 119 | 115 | } |
| 120 | 116 | new Smart_Post_Show_Updates(); |