Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
wordpress-seo
/
admin
/
services
/
File Content:
class-file-size.php
<?php /** * WPSEO plugin file. * * @package WPSEO\Admin\Services */ /** * Represents the file size service. */ class WPSEO_File_Size_Service { /** * Retrieves an indexable. * * @param WP_REST_Request $request The request object. * * @return WP_REST_Response The response. */ public function get( WP_REST_Request $request ) { try { $file_url = $this->get_file_url( $request ); return new WP_REST_Response( [ 'type' => 'success', 'size_in_bytes' => $this->get_file_size( $file_url ), ], 200 ); } catch ( WPSEO_File_Size_Exception $exception ) { return new WP_REST_Response( [ 'type' => 'failure', 'response' => $exception->getMessage(), ], 404 ); } } /** * Retrieves the file url. * * @param WP_REST_Request $request The request to retrieve file url from. * * @return string The file url. * @throws WPSEO_File_Size_Exception The file is hosted externally. */ protected function get_file_url( WP_REST_Request $request ) { $file_url = rawurldecode( $request->get_param( 'url' ) ); if ( ! $this->is_externally_hosted( $file_url ) ) { return $file_url; } throw WPSEO_File_Size_Exception::externally_hosted( $file_url ); } /** * Checks if the file is hosted externally. * * @param string $file_url The file url. * * @return bool True if it is hosted externally. */ protected function is_externally_hosted( $file_url ) { return wp_parse_url( home_url(), PHP_URL_HOST ) !== wp_parse_url( $file_url, PHP_URL_HOST ); } /** * Returns the file size. * * @param string $file_url The file url to get the size for. * * @return int The file size. * @throws WPSEO_File_Size_Exception Retrieval of file size went wrong for unknown reasons. */ protected function get_file_size( $file_url ) { $file_config = wp_upload_dir(); $file_url = str_replace( $file_config['baseurl'], '', $file_url ); $file_size = $this->calculate_file_size( $file_url ); if ( ! $file_size ) { throw WPSEO_File_Size_Exception::unknown_error( $file_url ); } return $file_size; } /** * Calculates the file size using the Utils class. * * @param string $file_url The file to retrieve the size for. * * @return int|bool The file size or False if it could not be retrieved. */ protected function calculate_file_size( $file_url ) { return WPSEO_Image_Utils::get_file_size( [ 'path' => $file_url, ] ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
.DS_Store
10234 bytes
0644
20200616130143_ReplacePermalinkHashIndex.php
2293 bytes
0644
AjaxController.php
2162 bytes
0644
DownloadConfController.php
945 bytes
0644
JsonSerializable-20260705095652.php
577 bytes
0644
JsonSerializable.php
577 bytes
0644
LimitStream.php
4209 bytes
0644
README.md
2555 bytes
0644
RequestInterface-20260623233601.php
4894 bytes
0644
RequestInterface.php
4894 bytes
0644
article-modified-time-presenter.php
609 bytes
0644
base.php
2793 bytes
0644
class-file-size.php
2475 bytes
0644
class-plugin-availability.php
8440 bytes
0644
class-plugin-conflict.php
8640 bytes
0644
class-sitemaps-admin-20260703023908.php
3665 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-notification-center.php
23601 bytes
0644
class-yoast-notification.php
9611 bytes
0644
class-yoast-plugin-conflict-20260707003653.php
10390 bytes
0644
class-yoast-plugin-conflict.php
10390 bytes
0644
deactivation.php
21118 bytes
0644
description-presenter-20260623011438.php
1026 bytes
0644
duplicator-main.php
26907 bytes
0644
duplicator.php
1781 bytes
0644
elFinderPlugin-20260705182242.php
3331 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260705194237.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions.php
708 bytes
0644
image-helper.php
10231 bytes
0644
inc.validator.php
5401 bytes
0644
index.php
157663 bytes
0644
interface-sitemap-cache-data.php
1208 bytes
0644
loco-20260704102541.xml
657 bytes
0644
loco-20260705153209.php
5626 bytes
0644
loco.php
5626 bytes
0644
loco.xml
657 bytes
0644
manager.php
14659 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
module-20260707211431.php
1297 bytes
0644
module.php
1297 bytes
0644
quick-edit-handler-1650-20260707062343.js
1848 bytes
0644
quick-edit-handler-1650.js
1848 bytes
0644
social.php
725 bytes
0644
wordpress-seo-es_ES.json
25583 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-bs_BA.json
13790 bytes
0644
wordpress-seojs-fi.json
19387 bytes
0644
wordpress-seojs-uk.json
26506 bytes
0644
wp-seo-main.php
17504 bytes
0644
N4ST4R_ID | Naxtarrr