/** * Runs after FooGallery has been updated via the backend */ function perform_housekeeping() { //allow extensions or other plugins to do stuff when foogallery is updated // this will catch both manual and auto updates! do_action('foogallery_admin_new_version_detected'); //clear the cached extensions if foogallery was updated $api = new FooGallery_Extensions_API(); $api->clear_cached_extensions(); //we need to clear the foogallery css load optimizations when we update the plugin, to ensure the latest CSS files are loaded foogallery_clear_all_css_load_optimizations(); }
/** * Runs after FooGallery has been updated via the backend * * @param $upgrader_object * @param $options */ function plugin_updated($upgrader_object, $options) { //only clear the extensions if foogallery was updated if (array_key_exists('plugin', $options) && 'foogallery/foogallery.php' === $options['plugin']) { $api = new FooGallery_Extensions_API(); $api->clear_cached_extensions(); } }
ob_start(); phpinfo(8); $info = ob_get_contents(); ob_end_clean(); $info = stristr($info, 'gd version'); preg_match('/\\d/', $info, $match); return $match[0]; } if (current_user_can('activate_plugins')) { $instance = FooGallery_Plugin::get_instance(); $info = $instance->get_plugin_info(); $title = apply_filters('foogallery_admin_systeminfo_title', sprintf(__('%s System Information', 'foogallery'), foogallery_plugin_name())); $support_text = apply_filters('foogallery_admin_systeminfo_supporttext', sprintf(__('Below is some information about your server configuration. You can use this info to help debug issues you may have with %s.'), foogallery_plugin_name())); $api = new FooGallery_Extensions_API(); //clear any extenasion cache $api->clear_cached_extensions(); $extension_slugs = $api->get_all_slugs(); //get all gallery templates $template_slugs = array(); foreach (foogallery_gallery_templates() as $template) { $template_slugs[] = $template['slug']; } //get all activated plugins $plugins = array(); foreach (get_option('active_plugins') as $plugin_slug => $plugin) { $plugins[] = $plugin; } $current_theme = wp_get_theme(); $debug_info = array(__('FooGallery version', 'foogallery') => $info['version'], __('WordPress version', 'foogallery') => $wp_version, __('Activated Theme', 'foogallery') => $current_theme['Name'], __('WordPress URL', 'foogallery') => get_site_url(), __('PHP version', 'foogallery') => phpversion(), __('PHP GD Loaded', 'foogallery') => extension_loaded('gd') && function_exists('gd_info') ? foogallery_gdversion() : __('Not found!', 'foogallery'), __('Extensions Endpoint', 'foogallery') => $api->get_extensions_endpoint(), __('Extensions Errors', 'foogallery') => $api->has_extension_loading_errors() == true ? $api->get_extension_loading_errors_response() : __('Nope, all good', 'foogallery'), __('Extensions', 'foogallery') => $extension_slugs, __('Extensions Active', 'foogallery') => array_keys($api->get_active_extensions()), __('Gallery Templates', 'foogallery') => $template_slugs, __('Lightboxes', 'foogallery') => apply_filters('foogallery_gallery_template_field_lightboxes', array()), __('Active Plugins', 'foogallery') => $plugins); $debug_info = apply_filters('foogallery_admin_debug_info', $debug_info); ?>