| @@ -8,12 +8,12 @@ | ||
| 8 | 8 | * |
| 9 | 9 | * @wordpress-plugin |
| 10 | 10 | * Plugin Name: QuickWebP - Compress / Optimize Images & Convert WebP | SEO Friendly |
| 11 | 11 | * Plugin URI: https://webdeclic.com/projets/creation-de-lextension-wordpress-quickwebp/ |
| 12 | - * Description: QuickWebP is an image compression and optimization plugin for WordPress that automatically converts images to WebP when they are uploaded to the media library. It also optimizes the image to improve your site’s performance. | |
| 13 | - * Version: 3.2.6 | |
| 12 | + * Description: Convert JPG and PNG images to WebP, compress uploads locally, improve image SEO, and unlock AVIF with QuickWebP Pro. | |
| 13 | + * Version: 4.1.1 | |
| 14 | 14 | * Author: Webdeclic |
| 15 | - * Requires PHP: 7.4 | |
| 15 | + * Requires PHP: 8.1 | |
| 16 | 16 | * Author URI: https://webdeclic.com/ |
| 17 | 17 | * License: GPL-2.0+ |
| 18 | 18 | * License URI: https://www.gnu.org/licenses/gpl-2.0.txt |
| 19 | 19 | * Text Domain: quickwebp |
| @@ -27,13 +27,15 @@ | ||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Check if your are in local or production environment |
| 30 | 30 | */ |
| 31 | +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | |
| 31 | 32 | $is_local = isset($_SERVER['REMOTE_ADDR']) && ($_SERVER['REMOTE_ADDR'] == '127.0.0.1' || $_SERVER['REMOTE_ADDR'] == '::1'); |
| 32 | 33 | |
| 33 | 34 | /** |
| 34 | 35 | * If you are in local environment, you can use the version number as a timestamp for better cache management in your browser |
| 35 | 36 | */ |
| 37 | +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound | |
| 36 | 38 | $version = get_file_data( __FILE__, array( 'Version' => 'Version' ), false )['Version']; |
| 37 | 39 | |
| 38 | 40 | /** |
| 39 | 41 | * Currently plugin version. |
| @@ -47,8 +49,13 @@ | ||
| 47 | 49 | */ |
| 48 | 50 | define( 'QUICKWEBP_DEV_MOD', $is_local ); |
| 49 | 51 | |
| 50 | 52 | /** |
| 53 | + * Plugin File | |
| 54 | + */ | |
| 55 | +define( 'QUICKWEBP_PLUGIN_FILE', __FILE__ ); | |
| 56 | + | |
| 57 | +/** | |
| 51 | 58 | * Plugin Name text domain for internationalization. |
| 52 | 59 | */ |
| 53 | 60 | define( 'QUICKWEBP_TEXT_DOMAIN', 'quickwebp' ); |
| 54 | 61 | |
| @@ -65,9 +72,9 @@ | ||
| 65 | 72 | /** |
| 66 | 73 | * The code that runs during plugin activation. |
| 67 | 74 | * This action is documented in includes/class-quickwebp-activator.php |
| 68 | 75 | */ |
| 69 | -function activate_quickwebp() { | |
| 76 | +function quickwebp_activate() { | |
| 70 | 77 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-quickwebp-activator.php'; |
| 71 | 78 | Quickwebp_Activator::activate(); |
| 72 | 79 | } |
| 73 | 80 | |
| @@ -74,15 +81,15 @@ | ||
| 74 | 81 | /** |
| 75 | 82 | * The code that runs during plugin deactivation. |
| 76 | 83 | * This action is documented in includes/class-quickwebp-deactivator.php |
| 77 | 84 | */ |
| 78 | -function deactivate_quickwebp() { | |
| 85 | +function quickwebp_deactivate() { | |
| 79 | 86 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-quickwebp-deactivator.php'; |
| 80 | 87 | Quickwebp_Deactivator::deactivate(); |
| 81 | 88 | } |
| 82 | 89 | |
| 83 | -register_activation_hook( __FILE__, 'activate_quickwebp' ); | |
| 84 | -register_deactivation_hook( __FILE__, 'deactivate_quickwebp' ); | |
| 90 | +register_activation_hook( __FILE__, 'quickwebp_activate' ); | |
| 91 | +register_deactivation_hook( __FILE__, 'quickwebp_deactivate' ); | |
| 85 | 92 | |
| 86 | 93 | /** |
| 87 | 94 | * The core plugin class that is used to define internationalization, |
| 88 | 95 | * admin-specific hooks, and public-facing site hooks. |
| @@ -97,9 +104,9 @@ | ||
| 97 | 104 | * not affect the page life cycle. |
| 98 | 105 | * |
| 99 | 106 | * @since 1.0.0 |
| 100 | 107 | */ |
| 101 | -function run_quickwebp() { | |
| 108 | +function quickwebp_run() { | |
| 102 | 109 | |
| 103 | 110 | if ( ! version_compare( PHP_VERSION, '7.4', '>=' ) ) { |
| 104 | 111 | |
| 105 | 112 | add_action( 'admin_notices', function() { |
| @@ -104,9 +111,9 @@ | ||
| 104 | 111 | |
| 105 | 112 | add_action( 'admin_notices', function() { |
| 106 | 113 | ?> |
| 107 | 114 | <div class="notice notice-error"> |
| 108 | - <p><?php _e( "Oops! QuickWebP isn't running because PHP is outdated. Update to PHP version 7.4", QUICKWEBP_TEXT_DOMAIN ); ?></p> | |
| 115 | + <p><?php esc_html_e( "Oops! QuickWebP isn't running because PHP is outdated. Update to PHP version 7.4", 'quickwebp' ); ?></p> | |
| 109 | 116 | </div> |
| 110 | 117 | <?php |
| 111 | 118 | }); |
| 112 | 119 | |
| @@ -116,5 +123,5 @@ | ||
| 116 | 123 | $plugin->run(); |
| 117 | 124 | } |
| 118 | 125 | |
| 119 | 126 | } |
| 120 | -run_quickwebp(); | |
| 127 | +quickwebp_run(); | |