PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
wp-optimize
/
includes
<?php if (!defined('ABSPATH')) die('Access denied.'); if (!class_exists('WPO_Image_Utils')) : class WPO_Image_Utils { /** * Get image paths to resized attachment images. * * @param int $attachment_id * @return array */ public static function get_attachment_files($attachment_id) { $attachment_images = array(); $upload_dir = wp_get_upload_dir(); // get sizes info from attachment metadata. $meta = wp_get_attachment_metadata($attachment_id); if (!is_array($meta) || !array_key_exists('sizes', $meta)) return $attachment_images; $image_sizes = array_keys($meta['sizes']); // build list of resized images. foreach ($image_sizes as $size) { $image = image_get_intermediate_size($attachment_id, $size); if (is_array($image)) { $file = trailingslashit($upload_dir['basedir']) . $image['path']; if (is_file($file) && !in_array($file, $attachment_images)) { $attachment_images[$size] = $file; } } } return $attachment_images; } /** * Returns an array of allowed extensions * * @return array */ public static function get_allowed_extensions() { return array('gif', 'jpeg', 'jpg', 'png'); } /** * Returns given file extension * * @param string $file * * @return string */ public static function get_extension($file) { $file_type = wp_check_filetype($file); return (string) $file_type['ext']; } /** * Tests if given extension is present in allowed extensions array * * @param string $ext Extension to check * @param array $allowed_extensions Array of allowed extensions * * @return bool */ public static function is_supported_extension($ext, $allowed_extensions) { return in_array($ext, $allowed_extensions); } } endif;
[-] class-updraft-logger-interface.php
[edit]
[-] class-wp-optimize-updates.php
[edit]
[-] class-updraft-smush-manager-commands.php
[edit]
[-] class-updraft-abstract-logger.php
[edit]
[-] class-wp-optimize-delay-js.php
[edit]
[-] class-wp-optimize-table-management.php
[edit]
[+]
blockui
[-] class-wp-optimization.php
[edit]
[-] class-wpo-onboarding.php
[edit]
[-] class-updraft-logger.php
[edit]
[-] class-updraft-ring-logger.php
[edit]
[-] class-updraft-smush-manager.php
[edit]
[-] class-wp-optimize-admin.php
[edit]
[-] class-wp-optimizer.php
[edit]
[-] class-wp-optimize-htaccess.php
[edit]
[-] class-wp-optimize-transients-cache.php
[edit]
[-] class-wpo-deactivation.php
[edit]
[-] class-wp-optimize-utils.php
[edit]
[-] class-updraft-email-logger.php
[edit]
[-] class-wpo-image-utils.php
[edit]
[-] class-wp-optimize-browser-cache.php
[edit]
[-] class-wp-optimize-database-information.php
[edit]
[-] class-wp-optimize-install-or-update-notice.php
[edit]
[-] class-wpo-page-optimizer.php
[edit]
[-] class-wp-optimize-performance.php
[edit]
[-] class-wp-optimize-commands.php
[edit]
[-] class-updraft-log-levels.php
[edit]
[-] class-wp-optimize-notices.php
[edit]
[-] class-wp-optimize-404-detector.php
[edit]
[-] class-wpo-uninstall.php
[edit]
[+]
tables
[-] class-wpo-activation.php
[edit]
[-] class-updraftcentral-wp-optimize-commands.php
[edit]
[-] class-wp-optimize-server-information.php
[edit]
[-] class-wp-optimize-options.php
[edit]
[-] class-wp-optimize-preloader.php
[edit]
[-] class-updraft-php-logger.php
[edit]
[-] class-updraft-smush-task.php
[edit]
[+]
..
[-] class-wp-optimize-http-error-codes-trait.php
[edit]
[+]
fragments
[-] class-re-smush-it-task.php
[edit]
[-] class-updraft-file-logger.php
[edit]
[-] class-wp-optimize-404-detector-cron.php
[edit]
[-] class-wpo-ajax.php
[edit]
[+]
list-tables
[-] class-wp-optimize-system-status-report.php
[edit]
[-] class-wp-optimize-gzip-compression.php
[edit]
[-] updraftcentral.php
[edit]
[-] class-wp-optimize-heartbeat.php
[edit]
[-] backward-compatibility-functions.php
[edit]