=== Optimum Gravatar Cache === Contributors: jomisica Author URI: https://www.ncdc.pt/members/admin Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ETTJQCUA5Q6CE Tags: gravatar, cache, optimization, avatar, Lazy Load Requires PHP: 5.3 Requires MySQL at least: 5.0.95 Requires at least: 4.7 Tested up to: 4.9.6 Stable tag: 1.3.2 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html It stores optimized copies of gravatars locally, reducing the total number of requests. This will speed up site loading and consequently improve the user experience. == Description == Optimum Gravatar Cache allows you to create a local cache with optimized copies of gravatars. Optimization is accomplished by redimensioning the avatars to sizes used on your site as well as optimizing the images internally. Optimizations are performed to minimize the size of each avatar served by the plugin. The plugin uses Wordpress cron to accomplish heavier tasks. Avatars are resized in the background. Avatars are optimized internally in the background. Except in certain cases where it is even necessary to resize the avatars in the page request. The plugin handles all of your site's gravatar as long as the wordpress function get_avatar () is used. Works with plugins, themas, etc. The plugin allows customizing the avatar by default. This avatar is served whenever the user / visitor does not have a custom gravatar. This way greatly reducing the number of requests made by your page, improving the user experience. As well as allowing to frame the avatar by default with the theme of your site. The plugin after being configured and activated, starts by serving the default avatar for everyone. And begin to create the cache dynamically in the background with the sizes that are being collected by the requests as well as those configured in the page of the plugin. When the gravatar already exists in the cache the plugin serves the avatar in cache. The plugin is periodically checked if the user updated his avatar on gravatar.com and if yes is updated locally. This way keeping an updated cache. **The plugin intends the following:** ------------------------------------- * Work with the gravatars locally, cache; * Reduce the number of requests per page, thus reducing the total time required to load all files. This is achieved because most users do not have a custom gravatar, and for those, only one file needs to be downloaded; * Optimize all avatars by reducing their size and transfer time again. If you use the plugin, add your rating, so I can have some feedback. == Languages == 1. English (Not good, please help translate the sentences in US English) 2. Portuguese ==Dependencies== This plugin depends on the following PHP modules: * php-gd or php-imagick (So that it can resize the avatars) * php-curl (So that it can communicate with the gravatar using the same connection to update several avatars) == Installation == This section describes how to install the plugin and get it working. 1. Upload the `optimum-gravatar-cache` directory to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Go to "Gravatar Optimum Cache Settings" to configure the options to suit your needs. == Screenshots == 1. In this screenshot we can see the options to configure the cache. 2. In this screenshot, we can see the options that allow you to configure the default avatar. 3. In this screenshot we can see the optimization options. 4. In this screenshot we can see the options to configure Apache Server with the .htaccess file. 5. In this screenshot we can see the options to configure the NGinx Server. 6. In this screenshot we can see more options 7. In this screenshot we can see the options for Lazy Load 8. In this screenshot we can see some data of the cache of the plugin 9. In this screenshot we can see a comparison of the files that are downloaded when the plugin is in use and when it is not. == Upgrade Notice == = 1.3.2 = * Resolving warnings that were reported by @willstockstech. = 1.3.1 = * Added "wp-includes / pluggable.php" to resolve at the moment "Call to undefined function wp_get_current_user ()" * Fix variable name error = 1.3.0 = * A complete Lazy Load engine has been added to the plugin so you can save even more bytes. It is quite configurable to adapt and is optional. * Added an option that allows you to add CSS classes, so you can adapt the avatars to themes and plugins that need a certain class. * An option has been added that lets you choose whether the domain added to the avatars is resolved from the host returned by the 'site_url ()' or 'content_url ()' functions. This option allows the domain / subdomain returned by 'content_url ()' to be used for avatars links, if configured. * An option has been added that lets you choose whether to use gravatar until the avatar is cached. * An option has been added that allows you to choose whether to remove avatars from the cache when they are updated in gravatar and have a different file type. This is important when using cache plugins like 'WP Super Cache'. This way preventing the pages that are cached by these plugins have links to avatars that no longer exist in the cache. * Now the custom avatar is saved in the cache directory, this is necessary for the avatar not to be deleted in the process of updating the plugin. * Some option variable names have been modified to follow the same pattern. You will need to reconfigure the plugin. * The administrator can now configure the permissions of the directories and files in the cache. This way you can adapt to several different environments with different permissions needs. * The method that saved the options was separated. Now there is a way to save the options for each tab. This will facilitate development. * Now it is possible to configure the User Agent. * An option has been added that allows you to decide whether the User Agent is sent to the gravatar.com and resmush.it services. * The plugin configuration pages have been improved. Making the configuration on mobile devices normal. * Added an option to enable the use of query strings with avatars (Suggested by @rcgoncalves). = 1.2.2 = * The wrong name in a variable did not let you use a custom avatar. = 1.2.1 = * In the last update were not added some templates, lack of attention. = 1.2.0 = * A new tab has been added that gives you access to a sample configuration for NGinx Server. * A new tab has been added that allows you to create / delete / update the .htaccess file. * The .htaccess file is no longer created automatically whenever the options are saved. * The default optimization is disabled. * The default learning mode is disabled. = 1.1.1 = * Compatibility check with wordpress version 4.9.6. * Modify message for translation = 1.1.0 = * I removed the email column from the table because it was only needed for debugging purposes. * I added a new action so that when a user is deleted all associated avatars are removed from the cache. This is important for reasons of cache space as well as for adapting to RGPD, which the user has the right to be forgotten. = 1.0.9 = * Compatibility check with wordpress version 4.9.5. = 1.0.8 = * Compatibility check with wordpress version 4.9.4. = 1.0.7 = * Compatibility check with wordpress version 4.9.3. = 1.0.6 = * Compatibility check with wordpress version 4.9.3. = 1.0.5 = * Compatibility check with wordpress version 4.9.2. = 1.0.4 = * Modified the bp_core_fetch_avatar_url filter to be added only when ajax requests are made. This way preventing duplicate processing of avatars. = 1.0.3 = * Now the new sizes are added if they appear in the background. In order to anticipate the actions of the users so that it is avoided to solve the gravatars at the moment. * It was resolved how to add a new avatar of greater dimension than the existing ones in cache. It is slow because the avatar is resolved at the moment, however it is always shown the same avatar regardless of size. This is important when using avatars of different sizes at the same time, as is the case with buddypress. * Now it is possible to also handle bp_core_fetch_avatar_url filter. So the avatars that are part of the buddypress automatic popup menu suggestions already use the cache. = 1.0.2 = * Added option to precompress .SVG files. * When uninstalling the plugin, it is cleaned by removing the options used by it, removing the used table as well as the cache directory. * Added verification of the PHP modules needed for the correct operation of the plugin. * Solve a problem in the updateCache function in order to update the last check of a gravatar even when it has not changed. * Repairing the Portuguese translation in the .po file. = 1.0.1 = * Now the default avatars are already optimized. = 1.0 = * First realese == Changelog == = 1.3.2 = * Resolving warnings that were reported by @willstockstech. = 1.3.1 = * Added "wp-includes / pluggable.php" to resolve at the moment "Call to undefined function wp_get_current_user ()" * Fix variable name error = 1.3.0 = * A complete Lazy Load engine has been added to the plugin so you can save even more bytes. It is quite configurable to adapt and is optional. * Added an option that allows you to add CSS classes, so you can adapt the avatars to themes and plugins that need a certain class. * An option has been added that lets you choose whether the domain added to the avatars is resolved from the host returned by the 'site_url ()' or 'content_url ()' functions. This option allows the domain / subdomain returned by 'content_url ()' to be used for avatars links, if configured. * An option has been added that lets you choose whether to use gravatar until the avatar is cached. * An option has been added that allows you to choose whether to remove avatars from the cache when they are updated in gravatar and have a different file type. This is important when using cache plugins like 'WP Super Cache'. This way preventing the pages that are cached by these plugins have links to avatars that no longer exist in the cache. * Now the custom avatar is saved in the cache directory, this is necessary for the avatar not to be deleted in the process of updating the plugin. * Some option variable names have been modified to follow the same pattern. You will need to reconfigure the plugin. * The administrator can now configure the permissions of the directories and files in the cache. This way you can adapt to several different environments with different permissions needs. * The method that saved the options was separated. Now there is a way to save the options for each tab. This will facilitate development. * Now it is possible to configure the User Agent. * An option has been added that allows you to decide whether the User Agent is sent to the gravatar.com and resmush.it services. * The plugin configuration pages have been improved. Making the configuration on mobile devices normal. * Added an option to enable the use of query strings with avatars (Suggested by @rcgoncalves). = 1.2.2 = * The wrong name in a variable did not let you use a custom avatar. = 1.2.1 = * In the last update were not added some templates, lack of attention. = 1.2.0 = * A new tab has been added that gives you access to a sample configuration for NGinx Server. * A new tab has been added that allows you to create / delete / update the .htaccess file. * The .htaccess file is no longer created automatically whenever the options are saved. * The default optimization is disabled. * The default learning mode is disabled. = 1.1.1 = * Compatibility check with wordpress version 4.9.6. * Modify message for translation = 1.1.0 = * I removed the email column from the table because it was only needed for debugging purposes. * I added a new action so that when a user is deleted all associated avatars are removed from the cache. This is important for reasons of cache space as well as for adapting to RGPD, which the user has the right to be forgotten. = 1.0.9 = * Compatibility check with wordpress version 4.9.5. = 1.0.8 = * Compatibility check with wordpress version 4.9.4. = 1.0.7 = * Compatibility check with wordpress version 4.9.3. = 1.0.6 = * Compatibility check with wordpress version 4.9.3. = 1.0.5 = * Compatibility check with wordpress version 4.9.2. = 1.0.4 = * Modified the bp_core_fetch_avatar_url filter to be added only when ajax requests are made. This way preventing duplicate processing of avatars. = 1.0.3 = * Now the new sizes are added if they appear in the background. In order to anticipate the actions of the users so that it is avoided to solve the gravatars at the moment. * It was resolved how to add a new avatar of greater dimension than the existing ones in cache. It is slow because the avatar is resolved at the moment, however it is always shown the same avatar regardless of size. This is important when using avatars of different sizes at the same time, as is the case with buddypress. * Now it is possible to also handle bp_core_fetch_avatar_url filter. So the avatars that are part of the buddypress automatic popup menu suggestions already use the cache. = 1.0.2 = * Added option to precompress .SVG files. * When uninstalling the plugin, it is cleaned by removing the options used by it, removing the used table as well as the cache directory. * Added verification of the PHP modules needed for the correct operation of the plugin. * Solve a problem in the updateCache function in order to update the last check of a gravatar even when it has not changed. * Repairing the Portuguese translation in the .po file. = 1.0.1 = * Now the default avatars are already optimized. = 1.0 = * First realese