getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
634 stars 95 forks source link

Issue installing the example plugin #157

Open omerfarooX opened 7 years ago

omerfarooX commented 7 years ago

Hey, I am having some issues installing the example plugin. So here is the steps i follow.

Step 1: while inside wp-content/plugins git clone https://github.com/getherbert/example-plugin.git

Step 2: cd into the new directory then i do composer install, which downloads all the packages.

Then i try to activate the plugin, but i still cant activate the plugin from the plugin page. Is there something i am doing wrong??

ken-bem commented 7 years ago

Can you please provide the error that you receive?

omerfarooX commented 7 years ago

@ken-bem here is the error i am recieving.

Parse error: syntax error, unexpected '.' in C:\path\to\project\wp-content\plugins\example-plugin\vendor\illuminate\database\Capsule\Manager.php on line 199

ken-bem commented 7 years ago

You may need to check if there is any incompatibility with other plugins you have installed, I had an issue with Herbert + Gravity Forms + WP Rest. Needed to put GF in non conflict mode.

omerfarooX commented 7 years ago

Actually i was just testing it out, so i tried installing it on a completely fresh copy of wordpress without any plugin or themes.

jasonagnew commented 7 years ago

@omer414 I think you've forgot to run composer

This is an example plugin for Herbert. Remember to run composer install

omerfarooX commented 7 years ago

@jasonagnew thankyou jasonagnew for the quick response. Well this is my first time using herbert, but i have a bit of experience with laravel and composer. Can you please confirm that we just need to 1) place this plugin inside wp-content/plugins (like we do with other manual plugin installations) 2) Then "composer install" while being in this plugin's directory

Thats it, right?

jasonagnew commented 7 years ago

Not a problem

1) Download the example - lets keep it simple and use the Zip: https://github.com/getherbert/example-plugin/archive/master.zip

2) Unzip it will get folder called example-plugin-master we might aswell name it correctly to example-plugin

3) Now you’ll need composer on your machine (https://getcomposer.org/)

4) Go into your folder and run composer for example

cd ~/Downloads/example-plugin
composer install

5) You’ll see a new folder is added call vendor

6) You could copy it to your plugins folder or use Symbolic links mentioned in the Getting Started section: http://getherbert.com/

omerfarooX commented 7 years ago

@jasonagnew ok this is exactly what i have been doing, but still getting the same error. On the last step instead of symbolic link i am just pasting it in the plugins directory.

Here is the error i am recieving on plugin activation

Plugin could not be activated because it triggered a fatal error: Parse error: syntax error, unexpected '.' in C:\lamp\www\project-name\wp-content\plugins\example-plugin\vendor\illuminate\database\Capsule\Manager.php on line 199

Have you tried it on the latest wordpress version? Or is the because of old version of composer. My composer is around 6 months old, do you think it might be an issue?

jasonagnew commented 7 years ago

Naw its not that. It's pulling in code that requires php 5.6. You could open the composer.json in the the example-plugin and change it to:

{
  "name": "getherbert/herbert-plugin",
  "description": "Herbert plugin",
  "license": "MIT",
  "require": {
    "getherbert/framework": "~0.9",
    "illuminate/http": "5.1"
  },
  "config": {
    "preferred-install": "dist"
  },
  "minimum-stability": "dev",
  "autoload": {
    "psr-4": {
      "ApiPosts\\": "app/"
    }
  }
}

Then run composer again.

onigetoc commented 7 years ago

This is becoming boring the composer stuff. There's no way to use it on a shared server.

ken-bem commented 7 years ago

@onigetoc what do you mean?

onigetoc commented 7 years ago

@ken-bem You can't use composer or command line on a shared server. And why just no include all files in a project and it's done

ken-bem commented 7 years ago

Well, true, but you can overcome this by setting your IDE that every time you save it uploads the changes to the hosting via FTP. I use Intellij and my PHP files are transferred as soon as i save.

onigetoc commented 7 years ago

Hi @ken-bem Ok thank you Should you have to run php on your computer? because is never work well, it's always crashing

ken-bem commented 7 years ago

No i rarely run it on my computer, i have a partition on a shared hosting server where i put all my plugins and i test them on the live site, also helps prevent the usual works on my machine but not on the live page