1908 posts YOU TOUCH IT YOU BUY IT
  • Top Monthly Author
  • Community Superstar
  • Author Level 11
  • Winner
+10 more
FRESHFACE
says

Hey guys,

how do you include custom plugins into your WP themes? I am asking about custom plugins, not plugins hosted on wordpress.org. We want to include Revolution Slider from CodeCanyon into our theme and are wandering how to do it.

Any tips and best practices are most appreciated :)

Thanks!

3804 posts
  • Elite Author
  • Author Level 11
  • Trendsetter
  • 7 Years of Membership
+12 more
KrownThemes
says

With include .. Of course, plugins which aren’t too OOP in order to give you high flexibility, need some level of customizing(for example, the plugins directory or other stuff).

So i customize it a bit(i try to keep this at minimum) and have a file where i record all changes(exact files, exact lines), so that when i update i know exactly what to change..

I’m not sure if this is the best way, but i don’t see another way with plugins that need to be modified in order to work..

I’ve bought a theme once, which added the plugin into my plugins folder. No includes, no anything. It simply added the plugin and activated it.. Have no idea how it had done that :D

1096 posts
  • 5 Years of Membership
  • Affiliate Level 1
  • Beta Tester
  • Collector Level 2
+5 more
Gareth_Gillman
says
3 posts
  • Exclusive Author
  • 5 Years of Membership
  • Collector Level 4
  • United States
momofone
says
I’ve bought a theme once, which added the plugin into my plugins folder. No includes, no anything. It simply added the plugin and activated it.. Have no idea how it had done that :D
Maybe this http://tgmpluginactivation.com/ ?
709 posts
  • Affiliate Level 2
  • Author Level 5
  • Beta Tester
  • Collector Level 2
+2 more
ChillThemes
says

I’ve bought a theme once, which added the plugin into my plugins folder. No includes, no anything. It simply added the plugin and activated it.. Have no idea how it had done that :D

Most use this http://tgmpluginactivation.com

There’s also this http://codex.wordpress.org/Must_Use_Plugins

65 posts
  • Power Elite Author
  • Author Level 12
  • Featured Item
  • Collector Level 4
+8 more
minti
says
1908 posts YOU TOUCH IT YOU BUY IT
  • Top Monthly Author
  • Community Superstar
  • Author Level 11
  • Winner
+10 more
FRESHFACE
says

Thanks everybody, TGM seems perfect :)

Just a question, can we add .htaccess file to limit access to the packaged plugin? Otherwise the zip files are publicly accessible from URL – didn’t have time to test it yet but I think TGM probably doesn’t have a way to protect those premium packages from being downloaded directly in browser. I think such vulnerability exceeds the use of extended license. Ideas?

60 posts
  • Affiliate Level 1
  • Author Level 3
  • Beta Tester
  • Collector Level 1
+3 more
DavidGuns
says

Sorry, I don’t want create new thread to ask this.

Can I use this plugin http://www.pixedelic.com/plugins/camera/wp.php to start selling here? moving the plugin source to my themes part.

Thank you

1908 posts YOU TOUCH IT YOU BUY IT
  • Top Monthly Author
  • Community Superstar
  • Author Level 11
  • Winner
+10 more
FRESHFACE
says

Since nobody replied, I will just share what we came up with. Giving restricted permissions on the zip files does not usually “stick” when uploading via FTP app, has inconsistencies in server environments etc so we went with that .htaccess file. We tried to block access with 403 but for some reason that did not work on our localhost (but did work on production server). So to play it on the safe side, we went with a simple redirect which should hopefully work in 99% cases. Here is the code in .htaccess:

RewriteEngine On
RewriteRule ^(.*)$ http://%{HTTP_HOST} [L,R=301]

What that does is it redirects all requests (recursively) from the /plugins/ directory to homepage.

We put this .htaccess file to:

/wp-content/themes/ourtheme/plugins/.htaccess

The plugins zip files are in this location:

/wp-content/themes/ourtheme/plugins/plugin.zip

This thread is still open for ideas, this is just me sharing what we want to use at this point.

501 posts
  • Affiliate Level 7
  • Author Level 10
  • Collector Level 2
  • Top Monthly Author
+10 more
pixelentity
says

What that does is it redirects all requests (recursively) from the /plugins/ directory to homepage.
you’re afraid of users trying to directly download the plugin zip from your theme folder ?
by
by
by
by
by
by