Plugin Directory

Changeset 3372929


Ignore:
Timestamp:
10/04/2025 05:52:42 PM (6 months ago)
Author:
universam
Message:

add plugin

Location:
universam-demo/trunk
Files:
11 added
93 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • universam-demo/trunk/includes/media/media_gallery.class.php

    r3371969 r3372929  
    66{
    77    private $post_attacment;
    8     private $image_format = 'webp';
     8    private static $image_format = 'webp';
    99    function __construct( )
    1010    {
     
    3232    public static function process_file_after_upload( $file )
    3333    {
    34         if( $this->image_format == 'webp' )
     34        if( self::$image_format == 'webp' )
    3535            $result = usam_create_image_webp( $file['tmp_name'] );
    3636        else
     
    3939        {           
    4040            $file['size'] = filesize( $file['tmp_name'] );
    41             $file['type'] = 'image/'.$this->image_format;
     41            $file['type'] = 'image/'.self::$image_format;
    4242        }       
    4343        return $file;
     
    180180        if ( !$new_file_name )
    181181            $new_file_name = $path_parts['filename'];       
    182         $new_ext = $path_parts['extension'] != $this->image_format ? $this->image_format : $path_parts['extension'];                       
     182        $new_ext = $path_parts['extension'] != self::$image_format ? self::$image_format : $path_parts['extension'];                       
    183183        // Проверим, имя файла на соответствие желаемому стандарту         
    184184        if ( stripos($path_parts['filename'], $new_file_name) !== false && $new_ext == $path_parts['extension'] )
     
    204204        elseif ( !file_exists($new_filepath) )
    205205        {   
    206             if( $this->image_format == 'webp' )
     206            if( self::$image_format == 'webp' )
    207207                $result = usam_create_image_webp($old_filepath, $new_filepath);
    208208            else
     
    240240                $meta_new_filename = str_replace( $noext_old_filename, $noext_sanitized_media_title, $meta_size['file'] );
    241241                $meta_new_filepath = $directory . '/' . $meta_new_filename;             
    242                 $new_filepath = substr_replace($meta_new_filepath , $this->image_format, strrpos($meta_new_filepath , '.') +1);             
    243                 if( $this->image_format == 'webp' )
     242                $new_filepath = substr_replace($meta_new_filepath , self::$image_format, strrpos($meta_new_filepath , '.') +1);             
     243                if( self::$image_format == 'webp' )
    244244                    $result = usam_create_image_webp($old_filepath, $new_filepath);
    245245                else
    246246                    $result = usam_create_image_avif($old_filepath, $new_filepath);
    247247                if ( $result )
    248                     $meta_new_filename = substr_replace($meta_new_filename , $this->image_format, strrpos($meta_new_filename , '.') +1);               
     248                    $meta_new_filename = substr_replace($meta_new_filename , self::$image_format, strrpos($meta_new_filename , '.') +1);               
    249249                elseif ( !file_exists($meta_new_filepath) || is_writable($meta_new_filepath) )
    250250                   rename($old_filepath, $meta_new_filepath);
    251                 $sizes[$size]['mime-type'] = 'image/'.$this->image_format;
     251                $sizes[$size]['mime-type'] = 'image/'.self::$image_format;
    252252                $sizes[$size]['file'] = $meta_new_filename;
    253253            }
  • universam-demo/trunk/readme.txt

    r3371969 r3372929  
    44Requires at least: 6.6
    55Tested up to: 6.8
    6 Stable tag: 8.72.26
     6Stable tag: 8.72.27
    77Requires PHP: 7.4
    88License: GPLv1
  • universam-demo/trunk/universam.php

    r3371969 r3372929  
    44 * Plugin URI: https://wp-universam.ru
    55 * Description: Платформа для управления бизнесом и интернет-магазином. Встроенный парсинг, CRM, соц. сети, мессенджеры, карты, план продаж, управление остатками, контакт-центр, коммерческие предложения, счета, акты, инструменты для продвижения сайта, конструктор отчетов, файлы, рассылки, СМС.
    6  * Version: 8.72.26
     6 * Version: 8.72.27
    77 * Author: universam
    88 * Author URI: https://wp-universam.ru
     
    1414{   
    1515    protected static $_instance = null;
    16     private          $version = '8.72.26';
     16    private          $version = '8.72.27';
    1717    public function __construct()
    1818    {
Note: See TracChangeset for help on using the changeset viewer.