cloudverve / wordpress-cloud-media-offloader-plugin

A simple plugin that allows you to serve your WordPress Media Library files from the Backblaze B2 cloud storage service.
GNU General Public License v2.0
65 stars 14 forks source link

Fatal Error Thrown on Plugin Activation #7

Closed jgb-solutions closed 5 years ago

jgb-solutions commented 5 years ago

I just clone this repo in my wordpress plugins folder and it throw some fatal error. Can't be actived because Fatal error: Uncaught Error: Class 'CloudVerve\MediaOffloader\Plugin'

dmhendricks commented 5 years ago

Apologies. I haven't had time to work on this plugin for quite some time. I was hoping that Backblaze would sponsor some time but they instead told me to remove their branding. I will see if I can do something with it.

jgb-solutions commented 5 years ago

Wow! Sorry to hear that. Backblaze doesn't do much to serve the popular platforms that could use their service. They mostly rely on some third-party integration solutions. That's sad. Their business could have been more approachable then. Again thanks for your work! Hope you'll find some time to work on this plugin. It's worth it.

dmhendricks commented 5 years ago

I see the error you are referring to. For now, did you try the packaged ZIP (rather than cloning source)? https://github.com/cloudverve/wordpress-cloud-media-offloader-plugin/releases/download/0.7.4/cloud-media-offloader.zip

jgb-solutions commented 5 years ago

hello @dmhendricks . The link is not working.

dmhendricks commented 5 years ago

Sorry about that. This plugin really needs some TLC (I'm poking at it right now). You can maybe try this one: https://github.com/cloudverve/wordpress-cloud-media-offloader-plugin/releases/download/0.7.3/cloud-media-offloader.zip

There are a lot of hacks and sloppy code. I'm rebuilding it with better code.

jgb-solutions commented 5 years ago

Alright thanks! I'll try it and let you know how it goes.

jgb-solutions commented 5 years ago

screen shot 2018-10-23 at 2 44 26 pm it says "Unable to connect to the Backblaze B2 API" But I entered my API key and account ID in it. So still version 7.3 still not working for me. But at least it installed.

dmhendricks commented 5 years ago

I created a develop branch for the refactor, if you want to watch it.

Below is a ZIP of the new branch, but it has had almost no testing. It probably has issues. ~cloud-media-offloader.zip~

EDIT (2018-10-23 02:47 GMT-5): Oops, I forgot to include Carbon Fields dependency: cloud-media-offloader.zip - I just uploaded this one to my test instance running WordPress 5.0 and PHP 7.3. It appears to be working well.

If you can give me a bit more time, I can come up with something better. I also need to update the B2 SDK.

jgb-solutions commented 5 years ago

Thanks a lot for your work! Take your time. I will give you some feedback as I use it. It's gonna be awesome I feel it.

jgb-solutions commented 5 years ago

screen shot 2018-10-23 at 3 58 55 pm Plugin could not be activated because "The Carbon Fields framework is not loaded."

Take your time. and just let me know about it releases. I'll be watching this repository.

dmhendricks commented 5 years ago

Greetings,

I overhauled the code, updated the B2 SDK, fixed an issue when "Remove Files from Server" is enabled, and more. I created a Pre-Release (0.7.5) for testing.

The installable ZIP is cloud-media-offloader.zip - don't download the source files ZIP or tar.gz - those won't work as they do not contain dependencies.

jgb-solutions commented 5 years ago

Thanks @dmhendricks ! Will test it asap.

jgb-solutions commented 5 years ago

the 7.5 release is not working for me. I tried on 3 websites. screen shot 2018-10-24 at 2 36 06 pm screen shot 2018-10-24 at 2 40 48 pm on the 3rd site I tried to use the key ID instead of the account ID and it broke the site. screen shot 2018-10-24 at 2 35 14 pm screen shot 2018-10-24 at 2 39 02 pm Maybe you could use some Try Catch block to catch these kind of errors.

dmhendricks commented 5 years ago

Hmm... I will try it on some more sites. It had been working for me on PHP 7.2+WP4.9.8 and PHP 7.3+WP5.

I will also try it without HTTPS and PHP 5.6.

What is your environment like? OS, PHP version, web server type, anything else...

jgb-solutions commented 5 years ago

screen shot 2018-10-24 at 10 43 20 pm I'm on PHP 7.1, WordPress 4.9, Linux Ubuntu for the third site on a VPS I manage

the two former sites are on PHP 7.0, WordPress 4.9, some version of linux and shared hosting at hostinger... Hope that helps.

jgb-solutions commented 5 years ago

hello @dmhendricks I wanted to let you know that I got the plugin working. I kept putting in the application key for a bucket while the plugin needs the master application key. I think you should clarify that on the plugin's settings page. Thanks! Now what you could add is an option to change the domain for the storage. For example let's say I want to use Cloudflare as a free CDN in front of my Backblaze cloud storage, after setting this up (example here), I should be able to use something like cdn.mydomain.com/file/folder/file and still access the file stored on the cloud storage but through Cloudflare as a CDN. These are just some suggestions. Here are the screenshots for what I've been through: screenshot-secure backblaze com-2018 10 26-00-46-35 screenshot-secure backblaze com-2018 10 26-00-47-36

jgb-solutions commented 5 years ago

And now one last thing about the custom domain, it's still gonna be a challenge to use a CDN for all the content unless all the files in the media library is copied (or moved) to the cloud storage, other there would be some broken links. Since I got the plugin working I'm gonna close this issue. Thanks for your hard work!

dmhendricks commented 5 years ago

Hello and thank you, @jgb-solutions. For tracking purposes, would you mind opening a neew feature request Issue for the CloudFlare/CDN thing? You can keep it short if you like since I have this issue to reference.

Also, I'm not sure if you're fluent in a second language, but if you're interested in doing a translation, it would be great (if you don't have POedit Pro or know how to use it, I can send the strings in a text document). If not, no worries! I just thought I throw it out there. :blossom:

Thanks again, -D

jgb-solutions commented 5 years ago

hey @dmhendricks I'm Haitian, my native languages are creole and french but I'm fluent in English and a little bit of spanish. I won't mind translating it in french. Just send me the instructions to contribute if need to be. I'm on a Mac. hope that helps. I will open a feature request and give as much detail as I can. Good job!