Connecting WordPress to Cloud Storage Services

For many of us, cloud storage has become a key component of our workflow. These services make it incredibly easy to back up files and share them with others. You can even set them up so they run quietly in the background – copying your files as you work.

Plus, most services offer more than one way to access your storage space. Sure, you could download an official mobile app or use their website. But, through the use of an API, other applications can also tap into the system – including WordPress.

There are a number of different reasons and use cases for hooking your WordPress site up to the cloud. Today, we’ll look at a few of the more popular scenarios and introduce you to some plugins that will help you to get started.

The WordPress Toolbox
Unlimited Downloads: 500,000+ WordPress Themes, Plugins, Templates & Design Assets

DOWNLOAD NOW

Serve Up Media

Media files can take up a lot of server space and eat away at your allotted bandwidth. Cloud storage can help by keeping media separate and quickly serving it up, much like a content delivery network (CDN).

WP Offload Media Lite

WP Offload Media Lite

WP Offload Media Lite works with a number of popular cloud providers, including Amazon S3, DigitalOcean and Google Cloud Storage. The plugin will automatically copy uploaded files to the cloud and changes the URL accordingly. Just note that a copy of the files you upload will remain on your hosting server – they just won’t be used. A pro version adds the ability to move existing media to the cloud and other goodies.

WP-Stateless

WP-Stateless

Users of Google Cloud Storage can leverage WP-Stateless to serve up media files through the tech behemoth’s redundant servers. Choose from one of three custom “modes”: Backup, CDN and Stateless – the latter storing and serving media exclusively from Google’s servers. There are a lot of customization possibilities here and the plugin will even automatically replace hard-coded media links to reflect their new location.

Media Cloud

Media Cloud

Media Cloud claims nearly identical functionality when compared to WP Offload Media, but in a completely free plugin. However, it also ties in with the imgix API, which adds some killer features such as the ability to upload media files directly to the cloud (bypassing WordPress), along with enhanced image editing and cropping capabilities. There’s also support for WP-CLI.

File Sharing

Providing easy access to files is what cloud services do best. However, it’s not necessarily a major strength of WordPress. But that’s why these plugins exist. Use one to share files with anyone, right through your website.

WordPress Download Manager

WordPress Download Manager

While WordPress Download Manager will help manage files on your server, it also connects with various cloud providers as well. Add files from services such as Box, DropBox, Google Drive and Microsoft OneDrive for you users to download. You’ll have control over who has access and the ability to display file listings in an attractive, easy-to-navigate UI.

Google Drive Embedder

Google Drive Embedder

With Google Drive Embedder, you can embed documents from your Google Drive account directly into a WordPress page or post. Alternatively, the plugin can add a direct download link to your files as well. A premium version adds the ability to share entire folders and more. Note that you’ll also need to install the free Google Apps Login plugin in order to enable your site to connect with Google Drive.

Contact Form 7 Dropbox

Contact Form 7 Dropbox

Accepting file uploads on your forms can be a headache. With Contact Form 7 Dropbox, you can streamline the process by allowing form attachments to be uploaded directly to your DropBox account. This keeps you from having to deal with large emails and will be easier to manage. As its name indicates, the plugin works with the free Contact Form 7 form builder.

Site Backup

Having a recent copy of your site backed up to the cloud is always a good idea. While many hosts offer on-site backup, a server crash could be catastrophic. When you back up to a separate cloud server, that allows you to access to everything should the worst happen.

Note that we already have a helpful listing of free WordPress backup plugins, some of which will sync with cloud services. However, we did want to highlight a couple of other choices which didn’t make that initial list.

Backup WD

Backup WD

Backup WD enables you to create a highly-customized backup of your site and store it on one of several cloud services (including Amazon S3, DropBox and Google Drive). You can choose to back up your entire website, database included, or just specific parts. And automated scheduling makes it easy to back things up daily, weekly or monthly.

XCloner

XCloner

Use XCloner to create custom backups that you can easily restore through the WordPress admin. It’s compatible with AWS, DropBox, Google Drive, Microsoft Azure and others for off-site storage. The plugin can even generate a backup before an automated WordPress core update. You’ll also receive an email notification whenever a backup process has been completed.

Reaching for the Cloud

In essence, the cloud is just a place to store files. However, its usefulness goes well beyond having some extra hard drive space. Indeed, its massive infrastructure can benefit your WordPress website in a number of ways.

Whether it’s circumventing storage limits on your host, boosting performance or offering an easy way to share documents, there are plugins available that will have you up and running within just minutes.

The post Connecting WordPress to Cloud Storage Services appeared first on Speckyboy Web Design Magazine.

Grav CMS: Permission problems on setup

I tried to setup a new site with Grav CMS 1.5.10 and ran into permission problems after unpacking one of the skeleton .zip files. The reason is that on my Linux machine I am running as user+group "cweiske", while Apache is running under "www-data" - and Grav wants to write some files even when it tries to reach the setup check screen.

Grav has a manual page about permissions which is complete nonsense if you want a secure system, and only give the web server process as few writable files and directories as possible. The manual page instructs you to change the permissions and group of every file and directory, which is unneeded.

Errors

Error messages I encountered before the setup check page worked:

Fatal error: Uncaught RuntimeException: Creating directory '/.../cache/compiled/files' failed on error

This is simple:

$ chgrp -R www-data cache
$ chmod -R g+w cache/

But now:

Fatal error: Uncaught RuntimeException: Opening file for writing failed on error

No more information. And what's worse: No stack trace, because Grav catches the Exception and throws it again.

The solution is to edit vendor/rockettheme/toolbox/File/src/File.php and let it output the file it tried to write:

- throw new \RuntimeException("Opening file for writing failed on error {$error['message']}");
+ throw new \RuntimeException("Opening file for writing failed on error {$error['message']}" . $this->filename);

We now see that it wants to write into user/config/security.yaml.

$ chgrp -R www-data user/config/
$ chmod -R g+w user/config/

And now I saw the setup check page.

Final solution

In the end I had to give this permissions:

$ chgrp -R www-data assets/ backup/ cache/ images/ logs/ system/config/ tmp/ user/accounts/ user/config/ user/data/ user/pages/
$ chmod -R g+w assets/ backup/ cache/ images/ logs/ system/config/ tmp/ user/accounts/ user/config/ user/data/ user/pages/

I'm also disappointed that Grav puts all files publicly available into the server's document root directory, because it does not have a public/ or www/ directory. The issue was closed without a proper solution; Grav's authors chose to patch their .htaccess file instead :/

Laravel News: The 10 Best Laravel Podcasts

                            Podcasts are a great way of keeping up with your favorite topics and Laravel is no exception.  As a community we have a lot of great podcasts to listen to and in this post we highlight ten of the most popular Laravel Podcasts. 

            Visit Laravel News f...

murze.be: The PHP UK videos have been released

PHP UK is one of my favourite conferences. Unfortunately I couldn't make it this year, but I'll be sure to watch the videos that have been published a little while ago. Here's a cool session on running PHP on AWS Lamba by Neal Brooks

You can watch all other talks in this playlist on YouTube.

Site News: Blast from the Past – One Year Ago in PHP (04.04.2019)

Here's what was popular in the PHP community one year ago today:

PHP Internals News: Episode 4: Short Arrow Functions

Powered by Gewgley