GithubHelp home page GithubHelp logo

Installation? about tgm-plugin-activation HOT 20 CLOSED

tgmpa avatar tgmpa commented on August 20, 2024
Installation?

from tgm-plugin-activation.

Comments (20)

thomasgriffin avatar thomasgriffin commented on August 20, 2024

Hey Jason,

Sorry that you had trouble installing the class. Hopefully these instructions will help some.

  1. Download the class from github and make sure all the files are contained within the folder tgm-plugin-activation.

  2. Next, upload the class via FTP into your theme. I tend to place all included things like this in a lib folder at the root of my themes. You could also do an includes folder or whatever you prefer.

  3. Next, before you copy the code from the example.php file, you need to make sure you run a require_once to instantiate the class, like this:

require_once( get_stylesheet_directory() . '/lib/tgm-plugin-activation/class-tgm-plugin-activation.php' );

Change the lib to whatever folder you have placed tgm-plugin-activation in.

  1. Do like you did and copy the example.php contents to your functions.php file below the require_once call.

Everything should work now. You can change out the default plugins to those of your own choosing. Let me know if you have any other questions or issues. :)

Thomas

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

Thanks Thomas!

I added the folder into my /lib/ folder within my child theme folder.

I ran the require once, in as much as I pasted it into my functions.php file for my child theme and saved it.

I am guessing that I did that wrong since when I went back and pasted the code from the example.php, I got the same breakage as before?

I guess its obvious this is my first child theme, sorry to be such a noob.

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

Keep the require_once statement in your functions file because the example code will need it as a reference for the API function. And no worries, everyone starts somewhere. :)

from tgm-plugin-activation.

GaryJones avatar GaryJones commented on August 20, 2024

A slightly simpler alternative method of installation:

  1. Copy the class-tgm-plugin-activation.php file into the root of your theme (next to style.css, functions.php et al)
  2. Copy ALL of the contents of example.php into your functions.php file.
  3. Amend the require_once line from those copied contents to be:
require_once get_stylesheet_directory() . '/class-tgm-plugin-activation.php';

Refresh the admin dashboard, and you should be getting a couple of admin notices (if you've not got the default registered plugins installed and active already).

I prefer to keep this class file in lib/plugins/ but get it installed in the theme root first, and you can move it (and the require_once reference to it), once you're happy it's all working.

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

Thanks guys!!!! I used Gary's install steps and the admin notices are there.

When I move it to my lib/plugins/ directory, I only move the class-tgm-plugin-activation.php into the folder tgm-plugin-activation, correct?

Thanks for the help!

from tgm-plugin-activation.

GaryJones avatar GaryJones commented on August 20, 2024

Correct, but you'll need to update the require_once reference (now in your functions.php along with the rest of example.php that you copied) to point to the new location e.g.:

require_once get_stylesheet_directory() . '/lib/plugins/class-tgm-plugin-activation.php';

should do it (which I think is what the original example.php file comes with anyway).

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

Thanks again! Awesome, just awesome.

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

Glad you got it sorted out! I plan on making a video to explain step by step how to do this so that there isn't any confusion. I'd love to see this adopted by a large portion of developers, so explaining the process of getting it setup would be a good investment.

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

Video would certainly help simplify its use.

Any idea why the admin prompt remains even though the plugin is installed and active? Only happening with the one that I supplied the plugin zip file within the lib/plugins/ directory.

Here is how its setup, in case:
array(
'name' => 'Google Maps Lite Plugin', // The plugin name
'slug' => '33490_wordpress-google-maps-plugin-lite-2.1.1.zip', // The plugin slug (typically the folder name)
'source' => get_stylesheet_directory() . '/lib/plugins/33490_wordpress-google-maps-plugin-lite-2.1.1.zip', // The plugin source
'required' => false,
),

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

You have a screenshot or a link I can look at to see the issue in action?

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

Its still on my local server at this time but here is a screenshot of the plugin, bottom one, which is active:
http://cl.ly/AhRy

Here is the admin notice:
http://cl.ly/AhZq

Is there a way to give the user an option to kill the notice? I am using this more as a way to suggest and simplify the process of tracking down the plugins, would be nice if they could kill the notice in the event they do not want a or some plugins that are suggested.

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

I think the issue you are running into is that the plugin name you've specified (Google Maps Lite Plugin) is not that same name as the actual plugin (WPMU DEV Maps Lite). Try changing the plugin name in the array to WPMU DEV Maps Lite and see if that fixes the issue for you.

We are currently working on this issue you mentioned about dismissable admin notices here: #35

You can following along with the progress of that. I tried somewhat unsuccessfully to implement a solution based on adding options and checking them, but for some reason I can get the add_option() function to work with a foreach statement. :(

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

With debug on, I get this error with that plugin:

Notice: Use of undefined constant AgmPluginInstaller - assumed 'AgmPluginInstaller' in /home/seoinfo/public_html/wp-content/plugins/wordpress-google-maps/wpmu_dev_maps_plugin.php on line 59

And I checked and it wasn't naming that was the issue. It must be the error code that the plugin is spitting out that is causing the issues.

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

I will follow along on #35, that will be a nice add to a really nice plugin!

I thought the same thing after posting here and went and changed the name (I had originally named it based on the .zip file name) but still same thing. I also, removed the plugin and reinstalled it using the notice link but the notice is still there.

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

I just fixed the error and it is still appearing as an admin notice like you have posted. I'm going to re-open this so we can see about getting the issue fixed.

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

My guess is that it is an issue with this particular plugin. It is spitting out a lot of unwanted header information and is throwing up bugs for me left and right in debug mode. I know our code isn't completely polished yet, but I've tried a vast array of plugins and have never had this issue. Nevertheless we will still look into it, but I'd like to check it and see again when that plugin gets some of the bugs ironed out.

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

I zipped a copy of my child theme and installed it on a test server of mine after removing the Maps plugin, so there were 2 plugins from the repository, woocommerce and jetpack, and it worked. :)

from tgm-plugin-activation.

thomasgriffin avatar thomasgriffin commented on August 20, 2024

Awesome! I'm pumped that it did :) Be sure to open up another issue ticket if something else arises so we can tackle it. :)

from tgm-plugin-activation.

GaryJones avatar GaryJones commented on August 20, 2024

The clue appears to be in your code:

'slug' => '33490_wordpress-google-maps-plugin-lite-2.1.1.zip', // The plugin slug (typically the folder name)

You've specified a zip file name, rather than a plugin slug, which I would expect to be something like wordpress-google-maps-plugin-lite or google-maps-plugin-lite (or whatever the folder name is that it extracts into).

We add comments to the example file for a reason ;-)

from tgm-plugin-activation.

jasonhobbsllc avatar jasonhobbsllc commented on August 20, 2024

Yep, my bad, I mixed up the slug and the file source. So the slug should be the folder that the plugins unzip into. Pertinent, since that plugin I was trying, unzips into something different than its .zip name. Thanks guys!

from tgm-plugin-activation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.