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

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博客网站不要让作者上传视频 - 中国金 Leisure Metaverse
Website

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 URto 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 getthe 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.

一览众山

Leave a Reply

Your email address will not be published. Required fields are marked *

English
Verified by MonsterInsights