Submit
Path:
~
/
home
/
getwphos
/
www
/
almajd14
/
wp-content
/
plugins
/
qode-optimizer
/
classes
/
File Content:
class-qode-optimizer-image-factory.php
<?php /** * Implementation of image factory support procedures * * @package Qode */ if ( ! defined( 'ABSPATH' ) ) { // Exit if accessed directly. exit; } class Qode_Optimizer_Image_Factory { /** * Mime-type to object mapping */ const MIME_TYPE_OBJECT_MAPPING = array( 'image/jpeg' => 'Qode_Optimizer_Jpeg', 'image/png' => 'Qode_Optimizer_Png', 'image/gif' => 'Qode_Optimizer_Gif', 'image/svg+xml' => 'Qode_Optimizer_Svg', ); /** * Image object creation * * @param array $params * * @return Qode_Optimizer_Image|false */ public static function create( $params ) { if ( ! is_array( $params ) ) { $params = array(); } if ( array_key_exists( 'id', $params ) ) { $params['file'] = wp_get_original_image_path( intval( $params['id'] ) ); } elseif ( ! array_key_exists( 'file', $params ) || ! is_string( $params['file'] ) ) { $params['file'] = ''; } $file = realpath( $params['file'] ); $filesystem = new Qode_Optimizer_Filesystem(); if ( $filesystem->is_file( $file ) ) { $mime_type = $filesystem->get_mime_type( $file ); if ( array_key_exists( $mime_type, static::MIME_TYPE_OBJECT_MAPPING ) ) { /** * PHP 8+ * return new ( static::MIME_TYPE_OBJECT_MAPPING[ $mime_type ] )( $params ); * */ // PHP 7+. $image_classname = static::MIME_TYPE_OBJECT_MAPPING[ $mime_type ]; return new $image_classname( $params ); } } return false; } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
class-qode-optimizer-backup.php
20426 bytes
0644
class-qode-optimizer-bulk.php
31406 bytes
0644
class-qode-optimizer-db.php
8092 bytes
0644
class-qode-optimizer-filesystem.php
12549 bytes
0644
class-qode-optimizer-general.php
2952 bytes
0644
class-qode-optimizer-gif.php
18281 bytes
0644
class-qode-optimizer-image-factory.php
1458 bytes
0644
class-qode-optimizer-image.php
121107 bytes
0644
class-qode-optimizer-images.php
11898 bytes
0644
class-qode-optimizer-issue.php
9181 bytes
0644
class-qode-optimizer-jpeg.php
20101 bytes
0644
class-qode-optimizer-log.php
6121 bytes
0644
class-qode-optimizer-media.php
46101 bytes
0644
class-qode-optimizer-options.php
19112 bytes
0644
class-qode-optimizer-output.php
1413 bytes
0644
class-qode-optimizer-parser.php
19798 bytes
0644
class-qode-optimizer-png.php
25397 bytes
0644
class-qode-optimizer-support.php
22006 bytes
0644
class-qode-optimizer-svg.php
5759 bytes
0644
class-qode-optimizer-utility.php
27269 bytes
0644
class-qode-optimizer-web-server-apache.php
1144 bytes
0644
class-qode-optimizer-web-server-factory.php
1225 bytes
0644
class-qode-optimizer-web-server-nginx.php
631 bytes
0644
class-qode-optimizer-web-server.php
4147 bytes
0644
N4ST4R_ID | Naxtarrr