Offload Media Library to other domain on a different server
Offload Media Library to other domain on a different server
Offload Media Library to other domain on a different server
Regarding the metadata portion of your question…I wonder if you could use the exif_read_data function? https://www.php.net/manual/en/function.exif-read-data.php
Instead of removing upload script you can make the upload error out if the user does not have admin privileges. Like this- function tomjn_only_upload_for_admin( $file ) { if ( ! current_user_can( ‘manage_options’ ) ) { $file[‘error’] = ‘You can\’t upload images without admin privileges!’; } return $file; } add_filter( ‘wp_handle_upload_prefilter’, ‘tomjn_only_upload_for_admin’ ); For other possible … Read more
The short answer is that this cannot be done with vanilla WordPress (I know, I tried). However, a little coding could make that happen. Images are stored in WordPress as a built-in post type – Attachments. This is what you would need to update on the remote sites with details of the CDN image as … Read more
I don’t know what the reason you upload a file to the plugin directory. The standard way to upload a file is to the WordPress uploads directory. In your code, I find this one is wrong $uploadPath = $currentDir . $uploadDirectory . basename($fileName); See, you merge two path together. Try $uploadPath = $uploadDirectory . basename($fileName); … Read more
You should change all URLs in the database from your local url to your production (live) URL. You can do this using a plugin like Better Search and Replace. Alternatively, if you can’t access WP Admin, you can use something like this script, which should be uploaded directly to the root of your WP install. … Read more
Yes, this is possible. You would need to hook show_user_profile – from /wp-admin/user-edit.php: if ( IS_PROFILE_PAGE ) { /** * Fires after the ‘About Yourself’ settings table on the ‘Your Profile’ editing screen. * * The action only fires if the current user is editing their own profile. * * @since 2.0.0 * * @param … Read more
Deleting the files out of the uploads folder is almost certainly the culprit here. Your theme may have custom code that affects the Media Library, but since you wrote it and you don’t think there is you’re probably right 🙂 So we can assume it’s the uploads folder. There is a database entry per file, … Read more
Well, what you want to achieve saving uploads in another domain? You want to share the uploads folder with another domain? Did you know you can use more than one domain (site) in a single WordPress Installation? It’s called Multisite: https://premium.wpmudev.org/blog/ultimate-guide-multisite/ To change the upload dir. Just use the filter upload_dir. It’s documented here: https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_dir … Read more
All files should be owned by the actual user’s account, not the user account used for the httpd process. Group ownership is irrelevant unless there are specific group requirements for the web-server process permissions checking. This is not usually the case. All directories should be 755 or 750. All files should be 644 or 640. … Read more