updated plugin Simple Local Avatars
version 2.7.6
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
* Plugin Name: Simple Local Avatars
|
||||
* Plugin URI: https://10up.com/plugins/simple-local-avatars-wordpress/
|
||||
* Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight.
|
||||
* Version: 2.7.5
|
||||
* Version: 2.7.6
|
||||
* Requires at least: 5.7
|
||||
* Requires PHP: 7.4
|
||||
* Author: 10up
|
||||
@ -15,12 +15,59 @@
|
||||
* @package SimpleLocalAvatars
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get the minimum version of PHP required by this plugin.
|
||||
*
|
||||
* @since 2.7.6
|
||||
*
|
||||
* @return string Minimum version required.
|
||||
*/
|
||||
function minimum_php_requirement(): string {
|
||||
return '7.4';
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether PHP installation meets the minimum requirements
|
||||
*
|
||||
* @since 2.7.6
|
||||
*
|
||||
* @return bool True if meets minimum requirements, false otherwise.
|
||||
*/
|
||||
function site_meets_php_requirements(): bool {
|
||||
return version_compare( phpversion(), minimum_php_requirement(), '>=' );
|
||||
}
|
||||
|
||||
// Try to load the plugin files, ensuring our PHP version is met first.
|
||||
if ( ! site_meets_php_requirements() ) {
|
||||
add_action(
|
||||
'admin_notices',
|
||||
function() {
|
||||
?>
|
||||
<div class="notice notice-error">
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_post(
|
||||
sprintf(
|
||||
/* translators: %s: Minimum required PHP version */
|
||||
__( 'Simple Local Avatars requires PHP version %s or later. Please upgrade PHP or disable the plugin.', 'simple-local-avatars' ),
|
||||
esc_html( minimum_php_requirement() )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
define( 'SLA_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
||||
|
||||
require_once dirname( __FILE__ ) . '/includes/class-simple-local-avatars.php';
|
||||
|
||||
// Global constants.
|
||||
define( 'SLA_VERSION', '2.7.5' );
|
||||
define( 'SLA_VERSION', '2.7.6' );
|
||||
define( 'SLA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||||
|
||||
if ( ! defined( 'SLA_IS_NETWORK' ) ) {
|
||||
|
Reference in New Issue
Block a user