REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 3.06 KB
Close
//proc/self/root/var/softaculous/sitepad/editor/site-data/plugins/siteseo/main/imageseo.php
Text
Base64
<?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class ImageSeo{ static function init(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return; // toggle disable } if(!empty($siteseo->advanced_settings['advanced_attachments'])){ add_action('template_redirect', '\SiteSEO\ImageSeo::redirect_attachment_to_parent'); } if(!empty($siteseo->advanced_settings['advanced_clean_filename'])){ add_filter('sanitize_file_name', '\SiteSEO\ImageSeo::clean_media_filename', 10, 1); } if(!empty($siteseo->advanced_settings['advanced_image_auto_alt_editor']) || !empty($siteseo->advanced_settings['advanced_image_auto_caption_editor']) || !empty($siteseo->advanced_settings['advanced_image_auto_desc_editor']) || !empty($siteseo->advanced_settings['advanced_image_auto_title_editor']) ){ add_action('add_attachment', '\SiteSEO\ImageSeo::set_image_content'); } } static function set_image_content($attachment_id){ global $siteseo; if(!wp_attachment_is_image($attachment_id)){ return; } $attachment = get_post($attachment_id); $file_name = pathinfo($attachment->guid, PATHINFO_FILENAME); $file_name = sanitize_file_name($file_name); $file_name = ucwords(str_replace(['-', '_'], ' ', $file_name)); // WooCommerce product img $is_woocommerce_product_image = false; $product_title = ''; $parent_id = $attachment->post_parent; if(!empty($parent_id)){ $parent_post = get_post($parent_id); if(!empty($parent_post) && $parent_post->post_type === 'product'){ $is_woocommerce_product_image = true; $product_title = get_the_title($parent_id); } } $file_name = $is_woocommerce_product_image ? $product_title : $file_name; // Adding alt text to the image if(!empty($siteseo->advanced_settings['advanced_image_auto_alt_editor'])){ update_post_meta($attachment_id, '_wp_attachment_image_alt', $file_name); } $options = []; $options['ID'] = $attachment_id; // Adding Title to the image if(!empty($siteseo->advanced_settings['advanced_image_auto_title_editor'])){ $options['post_title'] = $file_name; } // Adding Img Caption if(!empty($siteseo->advanced_settings['advanced_image_auto_caption_editor'])){ $options['post_content'] = $file_name; } // Adding Img Caption if(!empty($siteseo->advanced_settings['advanced_image_auto_desc_editor'])){ $options['post_excerpt'] = $file_name; } if(count($options) > 1){ wp_update_post($options); } } static function clean_media_filename($filename){ $filename = strtolower($filename); $filename = preg_replace('/[^a-z0-9-._]+/', '-', $filename); $filename = trim($filename, '-.'); return $filename; } static function redirect_attachment_to_parent(){ if(is_attachment()){ $attachment_id = get_queried_object_id(); $parent_id = wp_get_post_parent_id($attachment_id); if(!empty($parent_id)){ wp_safe_redirect(get_permalink($parent_id)); }else{ wp_safe_redirect(home_url()); } exit; } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 14
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
metaboxes
DIR
-
drwxr-xr-x
2026-04-25 02:31:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
settings
DIR
-
drwxr-xr-x
2026-04-25 02:31:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
admin.php
23.07 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
advanced.php
6.86 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ajax.php
21.63 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
columns.php
5.49 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generatesitemap.php
24.94 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
googleanalytics.php
25.99 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
imageseo.php
3.06 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
import.php
37.92 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
install.php
5.69 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
instantindexing.php
8.86 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
primarycategory.php
2.60 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
socialmetas.php
28.53 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
tableofcontent.php
5.26 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
titlesmetas.php
32.50 KB
lrw-r--r--
2026-04-22 07:17:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).