'.__('Settings').''; } // Return new embedded link. return $links; } // Function for plugin widget registration. function srp_install_widgets() { // Register widget. register_widget("WDG_SpecialRecentPosts"); } // This function checks whether the plugin has been updated. // If it's so, it performs several checks before updating the plugin db options. function srp_plugin_init() { // Importing global default options array. global $srp_default_plugin_values; // Checking if plugin db options exist. if (get_option('srp_plugin_options')) { // Setting current db options. $srp_current_options = get_option('srp_plugin_options'); // Checking if plugin has a db version option or if this is minor than the current version declared through the updated code. if ( (!isset($srp_current_options["srp_version"]) && isset($srp_default_plugin_values["srp_version"]) ) || ( version_compare($srp_current_options["srp_version"], $srp_default_plugin_values["srp_version"], '<')) ) { // Plugin version is prior to 1.5 or is lower to the current updated files. // For first, let's check for new array keys and eventually put them in the current array option. $srp_diff_array = array_diff_key($srp_default_plugin_values, $srp_current_options); // Check if there are no new array keys. In this case, we need to update only the version option. if (!empty($srp_diff_array)) { // Merge current option array with new values. $srp_result_array = array_merge($srp_current_options, $srp_diff_array); // Update current plugin option version. $srp_result_array["srp_version"] = $srp_default_plugin_values["srp_version"]; // Update db options. update_option('srp_plugin_options', $srp_result_array); } else { // Update current plugin option version. $srp_current_options["srp_version"] = $srp_default_plugin_values["srp_version"]; // Update db options. update_option('srp_plugin_options', $srp_current_options); } } else { // Current bulk is updated. Do Nothing. } } else { // First Install. Do nothing. } } /* | --------------------------------------------- | PLUGIN COMPATIBILITY CHECK | --------------------------------------------- */ function check_plugin_compatibility() { // Checking for PHP version. $current_ver = phpversion(); switch(version_compare($current_ver, SRP_REQUIRED_PHPVER)) { case -1: $error = new WP_Error('broke', __("Error! You're running an old version of PHP. In order for this plugin to work, you must enable your server with PHP support version 5.0.0+. Please contact your hosting/housing company support, and check how to enable it.")); if (is_wp_error($error)) { echo "
" . $error->get_error_message() . "
" . $error->get_error_message() . "
" . $error->get_error_message() . "
" . __('Settings Saved', SRP_TRANSLATION_ID) . "