Deprecated: Creation of dynamic property WpUserNameChange\WpUserNameChange::$db is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/wp-user-profile-avatar/admin/templates/wp-username-change.php on line 17

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the the-events-calendar domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/diahhrsav9xp/public_html/chinagold.com/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the translatepress-multilingual domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/diahhrsav9xp/public_html/chinagold.com/wp-includes/functions.php on line 6114

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$elementor is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/elementor/module.php on line 390

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$gutenberg is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/gutenberg/module.php on line 185

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$form_submit is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/forms/classes/submit.php on line 806

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$form_display is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/forms/classes/display.php on line 1829

Deprecated: Creation of dynamic property Frontend_Admin\Classes\Validate_Form::$errors is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/forms/classes/validation.php on line 30

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$form_validate is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/forms/classes/validation.php on line 372

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$dynamic_values is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/forms/classes/shortcodes.php on line 1245

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$local_actions is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/forms/actions/user.php on line 616

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$frontend is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/frontend/module.php on line 625

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$submissions_handler is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/admin-pages/submissions/crud.php on line 530

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$plans_handler is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/admin-pages/plans/crud.php on line 384

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$subscriptions_handler is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/admin-pages/subscriptions/crud.php on line 192

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$admin_tools is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/admin-pages/main/admin-tools.php on line 245

Deprecated: Creation of dynamic property FEA_Form_Import::$icon is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/admin-pages/forms/tools/import.php on line 29

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$form_builder is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/admin-pages/forms/settings.php on line 718

Deprecated: Creation of dynamic property Frontend_Admin\Plugin::$admin_settings is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/acf-frontend-form-element/main/admin/module.php on line 351

Deprecated: version_compare(): Passing null to parameter #2 ($version2) of type string is deprecated in /home/diahhrsav9xp/public_html/chinagold.com/wp-content/plugins/elementor/core/experiments/manager.php on line 170
WordPress Blog Sites Should Not Let Authors Upload Videos - 中国金 Leisure Metaverse
网站

WordPress Blog Sites Should Not Let Authors Upload Videos

Many WordPress blogging sites have faced the same question, whether to let bloggers upload videos to the same web server as your site, i.e. self-hosted videos. The answer is No! Especially if your website is hosted on a shared server. A high definition video files can easily exceed 100-200 MB, take up a lot of hard drive and memory but also demand bandwidth and other resources, quickly exceed the limits of the web server hosting your website, and overwhelm your website and other websites also hosted on the same server.

The best way to add video to your website is with a video hosting service such as YouTube. Let the blogger upload the video to a video hosting service first, then paste the video URL to embed the video in a WordPress post or page. This way videos will be streamed from video host’s global server network without using your website’s bandwidth. It will also increase the visibility of the video and your web site.

How can you stop bloggers from uploading videos to your site? On the WordPress blog site, add a snippet as follows.

function adjust_mime_types($mime_types){
unset($mime_types[‘mp4|m4v’]);  // block mp4 video
unset($mime_types[‘mov|qt’]); // block quicktime mov video
unset($mime_types[‘pdf’]); // block pdf files
return $mime_types;
}
add_filter(‘upload_mimes’, ‘adjust_mime_types’);

If bloggers upload a video MOV, they get the error message: “Sorry, you don’t have permission for this file type”

One thing worth noting is the MIME Type. If you look up the MIME Type of MOV online, you will get video/quicktime.

But the video/quicktime type doesn’t work in Snippet. Bloggers will still be able to upload videos. Only if the MIME type is defined in WordPress that can prevent video uploading. Where can you find these definitions? WordPress has a list of registered MIME types stored in wp-includes/functions.php for developers use wp_get_allowed_mime_types() getting MIME file types. These are MIME file types recognized by WordPress. By looking the functions.php source code, you will find that ‘mov|qt’ is for blocking video files with the MOV extension.

 


一览众山

留言

您的电子邮箱地址不会被公开。 必填项已用*标注

简体中文
Verified by MonsterInsights