Plugin Directory

Changeset 3438710


Ignore:
Timestamp:
01/13/2026 02:51:59 PM (3 weeks ago)
Author:
kubiq
Message:

4.9

  • info banner about new free Images to AVIF plugin
  • prioritize GD library
  • readme small changes
Location:
images-to-webp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • images-to-webp/trunk/images-to-webp.php

    r3407357 r3438710  
    44    Plugin URI: https://www.paypal.me/jakubnovaksl
    55    Description: Convert JPG, PNG and GIF images to WEBP, speed up your web
    6     Version: 4.8
     6    Version: 4.9
    77    Author: KubiQ
    88    Author URI: https://kubiq.sk
     
    3333        add_action( 'fly_image_created', array( $this, 'fly_images_to_webp' ), 10, 2 );
    3434        add_action( 'bis_image_created', array( $this, 'bis_images_to_webp' ), 10, 2 );
     35
     36        $avif_plugin_file = WP_PLUGIN_DIR . '/images-to-avif/images-to-avif.php';
     37        if( ! file_exists( $avif_plugin_file ) ){
     38            add_action( 'admin_notices', array( $this, 'admin_notices' ) );
     39            add_action( 'wp_ajax_avif_notice_dismissed', array( $this, 'avif_notice_dismissed' ) );
     40        }
     41    }
     42
     43    function admin_notices(){
     44        if( current_user_can('manage_options') && ! get_user_meta( get_current_user_id(), 'avif_notice_dismissed' ) ){
     45            if( function_exists('get_current_screen') && isset( get_current_screen()->id ) && in_array( get_current_screen()->id, array( 'dashboard', 'plugins', 'plugin-install', 'upload', 'attachment' ) ) ){ ?>
     46                <div class="avif-notice notice notice-info is-dismissible"><p><?php printf( esc_html__( 'There is a new %sImages to AVIF%s plugin that can improve your load time even more and it works perfectly with Images to WebP too.', 'images-to-webp' ), '<a href="' . admin_url( 'plugin-install.php?s=kubiq%20Images%20to%20AVIF&tab=search&type=term' ) . '" target="_blank">', '</a>' ) ?></p></div>
     47                <script>
     48                jQuery(document).ready(function($){
     49                    $(document).on('click', '.avif-notice .notice-dismiss', function(){
     50                        $.post( ajaxurl, { action: 'avif_notice_dismissed', _wpnonce: '<?php echo wp_create_nonce('avif_notice_dismissed') ?>' });
     51                    });
     52                });
     53                </script><?php
     54            }
     55        }
     56    }
     57
     58    function avif_notice_dismissed(){
     59        if( defined('DOING_AJAX') && DOING_AJAX && check_ajax_referer('avif_notice_dismissed') ){
     60            add_user_meta( get_current_user_id(), 'avif_notice_dismissed', 1, true );
     61        }
    3562    }
    3663
     
    172199        } ?>
    173200        <div class="wrap">
    174             <h2><?php _e( 'Images to WebP', 'images-to-webp' ); ?></h2>
    175             <?php $this->plugin_admin_tabs( $this->tab ); ?>
    176             <?php include_once 'tabs/tab-' . $this->tab . '.php'; ?>
     201            <h2><?php _e( 'Images to WebP', 'images-to-webp' ); ?></h2><?php
     202           
     203            $avif_plugin_file = WP_PLUGIN_DIR . '/images-to-avif/images-to-avif.php';
     204            if( ! file_exists( $avif_plugin_file ) ){
     205                echo '<div class="notice notice-info"><p>' . sprintf( esc_html__( 'There is a new %sImages to AVIF%s plugin that can improve your load time even more and it works perfectly with this plugin too.', 'images-to-webp' ), '<a href="' . admin_url( 'plugin-install.php?s=kubiq%20Images%20to%20AVIF&tab=search&type=term' ) . '" target="_blank">', '</a>' ) . '</p></div>';
     206            }
     207
     208            $this->plugin_admin_tabs( $this->tab );
     209           
     210            include_once 'tabs/tab-' . $this->tab . '.php'; ?>
    177211        </div><?php
    178212    }
  • images-to-webp/trunk/readme.txt

    r3407360 r3438710  
    33Donate link: https://www.paypal.me/jakubnovaksl
    44Tags: pictures, optimize, convert, media
    5 Requires at least: 3.0.1
    6 Requires PHP: 5.6
     5Requires at least: 5.0
     6Requires PHP: 7.0
    77Tested up to: 6.9
    8 Stable tag: 4.8
     8Stable tag: 4.9
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    195195== Changelog ==
    196196
     197= 4.9 =
     198* info banner about new free Images to AVIF plugin
     199* prioritize GD library
     200* readme small changes
     201
    197202= 4.8 =
    198203* Tested on WP 6.9
  • images-to-webp/trunk/tests/server.php

    r2826965 r3438710  
    33defined('ABSPATH') || exit;
    44
    5 if( version_compare( PHP_VERSION, '5.6.12', '<' ) ){
     5if( version_compare( PHP_VERSION, '7.0', '<' ) ){
    66    deactivate_plugins( __DIR__ );
    7     wp_die( __( 'Please update your PHP to version 5.6.12 or higher, then try activate <strong>Images to WebP</strong> again.', 'images-to-webp' ) );
     7    wp_die( __( 'Please update your PHP to version 7.0 or higher, then try activate <strong>Images to WebP</strong> again.', 'images-to-webp' ) );
    88}
    99
     
    1414
    1515$methods = array();
    16 
    17 if( extension_loaded('imagick') ){
    18     if( class_exists('Imagick') ){
    19         $image = new Imagick();
    20         if( in_array( 'WEBP', $image->queryFormats() ) ){
    21             $methods['imagick'] = __( 'Imagick', 'images-to-webp' );
    22         }
    23     }
    24 }
    2516
    2617if(
     
    3526}
    3627
     28if( extension_loaded('imagick') ){
     29    if( class_exists('Imagick') ){
     30        $image = new Imagick();
     31        if( in_array( 'WEBP', $image->queryFormats() ) ){
     32            $methods['imagick'] = __( 'Imagick', 'images-to-webp' );
     33        }
     34    }
     35}
     36
    3737if( count( $methods ) === 0 ){
    3838    deactivate_plugins( __DIR__ );
Note: See TracChangeset for help on using the changeset viewer.