'0.2.08' ); } // If actually a fresh install, then nothing more is necessary. if ( ! $options ) { return; } // Check if we have just upgraded from a lower version. $previous_version = $options['version']; $current_version = adaptive_images_plugin_get_version(); $plugin_upgraded = strcmp( $previous_version, $current_version ) < 0; if ( ! $plugin_upgraded ) { return; } // General plugin updated message. add_action( 'admin_notices', 'adaptive_images_upgrade_message_upgraded' ); // Check if upgrading from version 0.2.08 which needs some special handling. if ( $previous_version == '0.2.08' ) { adaptive_images_upgrade_action_upgraded_from_v0208(); add_action( 'admin_notices', 'adaptive_images_upgrade_message_upgraded_from_v0208' ); } // Check if upgrading to version 0.5.0 to show a nice informative message. if ( $current_version == '0.5.0' ) { add_action( 'admin_notices', 'adaptive_images_upgrade_message_upgraded_to_v050' ); } // Check if upgrading to version 0.7.0 to show a nice informative message. if ( $current_version == '0.7.0' ) { // Delete old sanitized option. unset( $options['sanitized'] ); add_action( 'admin_notices', 'adaptive_images_upgrade_message_upgraded_to_v070' ); } // Save current version in plugin settings. $options['version'] = $current_version; update_option( 'adaptive-images', $options ); } /** * Performs actions related to upgrading from version 0.2.08 because from that version and on major code and * settings changes took place. * * @author Nevma (info@nevma.gr) * * @return void */ function adaptive_images_upgrade_action_upgraded_from_v0208 () { // Try to remove old htaccess entry. $htaccess = adaptive_images_plugin_get_htaccess_file_path(); $htaccess_available = adaptive_images_debug_is_htaccess_writeable(); if ( $htaccess_available ) { $htaccess_old_contents = file_get_contents( $htaccess ); $htaccess_new_contents = preg_replace( '/# Adaptive Images.*# END Adaptive Images\n/s', '', $htaccess_old_contents ); @file_put_contents( $htaccess, $htaccess_new_contents ); } // Try to remove old cache directory. $old_cache_path = realpath( dirname( $_SERVER['SCRIPT_FILENAME'] ) . '/../wp-content/' ) . '/cache-ai/'; adaptive_images_actions_rmdir_recursive( $old_cache_path ); // Try to remove old options. delete_option( 'wprxr_include_paths' ); delete_option( 'wprxr_ai_config' ); } /** * Adds the admin notice message that informs the user when the plugin has been generally upgraded. * * @author Nevma (info@nevma.gr) * * @return void */ function adaptive_images_upgrade_message_upgraded () { $current_version = adaptive_images_plugin_get_version(); echo '
' . 'Adaptive Images' . '
' . '' . 'The Adaptive Images plugin has been succesfully upgraded to version ' . $current_version . '. Perhaps you would like to review its Settings.' . '
' . '' . 'Adaptive Images' . '
' . '' . 'The Adaptive Images plugin has been recently upgraded to version ' . $current_version . '.' . '
' . '' . 'You should probably save your settings once again in Adaptive Images Settings, because since version 0.2.08 major rewrites of the code have taken place.' . '
' . '' . 'We are very sorry for the inconvenience and we promise to keep a steady path from now on.'. '
' . '' . 'Adaptive Images' . '
' . '' . 'The plugin has been upgraded to version ' . $current_version . '. Version ' . $current_version . ' has some very interesting new features. Go to Adaptive Images Settings to check them out.' . '
' . '' . 'Adaptive Images' . '
' . '' . 'Hey there!' . '
' . '' . 'Just wanted to say a big thank you to all of you out there for trying out our plugin in its early versions. We struggle hard to keep it solid and reach a full stable version! You have probably noticed, or will notice in a just about a minute, that a number of enhancements and user interface improvements have been added in this version (0.7.0). The reason the last versions came up so close to one another was that, well honestly, it was August and we finally had some extra spare time!' . '
' . '' . 'As we are reaching version 1.0, the plugin features are becoming more and more stable and, we believe, more and more powerful. One of the most interesting, yet still a tiny bit experimental features that we have added, is support for CDN and other external caching solutions, like our beloved Varnish. Things are pretty tricky in this territory for what we are trying to accomplish and we really appreciate your feedback.' . '
' . '' . 'Once again, thank you so much and stay tuned :-)' . '
' . '' .
'Nevma.gr team
' .
'' .
'
' .
'' .
'
' . 'PS: Please, do save your settings once more after this upgrade ➥ Adaptive Images Settings ' . '
' . '