nilsnolde / wordpress-markdown-git

:loop: WordPress plugin to add file content (Markdown, Jupyter notebooks) from a Git based VCS to a WordPress post; replaces https://github.com/gis-ops/md-github-wordpress
GNU General Public License v3.0
48 stars 14 forks source link

WordPress Warning when plugin is activated #12

Closed LuigiBella closed 4 years ago

LuigiBella commented 4 years ago

Versions Wordpress: 5.4.1 Documents for Git: 1.0.1

Describe the bug Upon activation, the following errors are displayed in WordPress: Warning: include_once(../../documents-git.php): failed to open stream: No such file or directory in /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/includes/providers/class-base-loader.php on line 3

Warning: include_once(): Failed opening '../../documents-git.php' for inclusion (include_path='.:/usr/local/php73/pear') in /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/includes/providers/class-base-loader.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/includes/providers/class-base-loader.php:3) in /home/luigibe2/public_html/DAHelpGuide/wp-includes/functions.php on line 6221

Paste the shortcode and the censored contents of config.json Contents of includes/config.json: { "limit": 5, "classes": "", "Github": { "user": "", "token": "" }, "Bitbucket": { "user": "", "token": "" }, "Gitlab": { "user": "", "token": "" } }

To Reproduce Steps to reproduce the behavior:

  1. Install Plugin
  2. Activate

Screenshots

Screen Shot 2020-04-29 at 11 08 04 PM

Additional context This was tested across multiple WordPress installations with repeated results.

Thanks for your time!

nilsnolde commented 4 years ago

So sorry I didn't have the time until today to properly catch up on this @LuigiBella!

I can't reproduce this behavior. Neither with the current master nor with the release on the WP Plugin page. I tried with Docker and two images:

In all 4 situations I can just install the plugin and render any markdown.

I'm not the biggest WP user myself, but do you use multi-sites stuff? Or anything else that's rather special?

LuigiBella commented 4 years ago

No problem @nilsnolde ; I appreciate you taking the time to look into this.

The issue is happening on my Siteground hosting account using the latest version of WP(5.4.1) and the Documents from Git plugin from the WP Plugin page, I have tried contacting Siteground but they were unable to provide more information as to a possible cause.

Here is the URL of where the error can be seen: https://dahelpguide.luigibella.com/

Thanks again.

nilsnolde commented 4 years ago

Really weird! It's complaining that the file is not where it should be.

What's the structure inside /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/? E.g. tree -L 3 /home/luigibe2/public_html/DAHelpGuide/wp-content/plugins/documents-from-git/?

nilsnolde commented 4 years ago

Against all odds: is your provider running Windows servers? I could try changing the path separator to be platform agnostic, didn't really think about anyone using a OS where / is not the separator.

nilsnolde commented 4 years ago

Hmpf, I got it. Apparently that warning message was there all along, I just didn't realize it.. Just saw the same popping up in phpstorms debug output.

It's a circular reference anyways and apparently it works all the same without. Not sure why it was in there in the first place..

I'll push now some commits, which will close your issues. Forgot to take them to another branch. Can you please give master a try with the WP Pusher plugin? And let me know if all works for you now?

LuigiBella commented 4 years ago

Thank you Nils! It is no longer displaying any warnings and my attempt to display a MD file from BitBucket is working.

nilsnolde commented 4 years ago

Good to hear!

How about the other issues? Can I close them as well?