GithubHelp home page GithubHelp logo

krafit / wp-gitlab-updater Goto Github PK

View Code? Open in Web Editor NEW
57.0 57.0 24.0 30 KB

♻️ WordPress plugin to get updates for themes and plugins from private GitLab repos — can also be implemented into a plugin or theme.

PHP 100.00%
gitlab gitlab-updater wordpress-plugin

wp-gitlab-updater's Introduction

👋 I'm a WordPress Developer, Strategist, and Climate Activist based in Germany. 🇪🇺

If you're from Germany and interested in WordPress, you might know my weekly newsletter WP Letter. Feel free to get in touch or meet me at a Meetup or WordCamp somewhere (well, not now, obviously...).

Most recent work 👷‍♂️

See the more comprehensive list →

Recent Writing 📚

Trivia 🤪

  • 👴 WordPress since 2008
  • 🌱 Former biology nerd turned code nerd
  • 💬 Ask me about WordPress, WooCommerce, Open Source CMS
  • 📫 How to get in touch: Mastodon
  • 😄 Pronouns: he/him




Visit my website →

wp-gitlab-updater's People

Contributors

florianbrinkmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-gitlab-updater's Issues

Update not appearing randomly in some servers

Hi there. Sorry to bother again.. But for some reason it seems the updater doesn't work anymore again, similar to issue #7.

  • I followed the instructions step by step.
  • It's the right token and the access is still active.
  • When trying to get to the URL of the api using a browser, I get the versions as expected.

Actually the script worked once... But only once. (I remember there was even a glitch on the update page. The picture of the theme was "missing" what picture file wordpress is looking for, here?)
But when it happened, I remember the theme was in a folder with a different name than the theme (it was "duenarevival"). And when it updated, it put everything in a new folder with the right name (which was "duena"), while keeping the old version "duenarevival" in its folder. For now I activated the theme with the folder "duena" and deleted the other one. Maybe it's the cause of the problem?

In case you wanna check, here's the repository of the theme with the updater.

error 401 when trying to fetch tags

Hi. I'm trying to bundle this script inside my theme, i followed all the instructions of your repo, but I'm getting the same problem as issue #7 . Except the website where i'm trying it is not in localhost and is hosted outside. I found something odd though.

When I try the command curl --request GET --header with the token and the url, I get the tags fetched as expected:

max@VirtualBox:~$ curl --request GET --header "PRIVATE_TOKEN: XXXXXXXXXXX" https://gitlab.com/api/v4/projects/xxxxxxxx%2Fxxxxxxxxx/repository/tags/
[{"name":"2.2.1","message":"xxxxxxxx!","target":"XXXXXXXXXXX","commit":{"id":"XXXXXXXXXXXXX","short_id":"xxxx",...

But when I try the curl command using the url that the script uses in its code (line 54 in updater-base.php), i get this:

max@VirtualBox:~$ curl https://gitlab.com/api/v4/projects/xxxxxxxx%2Fxxxxxxxxx/repository/tags/?private_token=XXXXXXXXXXX
{"message":"401 Unauthorized"}

It's probably an error with gitlab but i don't understand it and it looks like it's preventing the script to work and fetch update. :/ any idea of what's wrong?

Commited but won't show up in wp updates.

Hi,
I just found your plugin and installed, but the commited update won't show up on plugins updates.

Do I need to change something on the plugin files other than just commit to gitlab and configure token/url/repo ?

Error detected with theme check plugin

Still working on my theme and, since it's apparently possible to post a fork of a theme, I decided to do the necessary to post mine there.

Among the errors the plugin "theme check" found, there's one about theme-updater.php from wp-gitlab-updater:

INFO: theme-updater.php The theme appears to use include or require. If these are being used to include separate sections of a template from independent files, then get_template_part() should be used instead.
Line 25: require_once 'updater-base.php';

Well I know wp-gitlab-updater is no longer necessary if you post the theme in wordpress repos. Though this error looks interesting and maybe it's good to know it. Maybe it's even related to my previous error #10 ?

Prevent crash with theme or plugin updates from W.org with the same slug

Currently, the script does not consider conflicts with theme or plugin updates from the W.org repo, where the slug is identical with a theme or plugin which uses the script.

Should be possible to check for that inside the theme_update() and plugin_update() method. If this runs after the core adds available updates from W.org to the transient, we can check there if a W.org update is set for our theme/plugin, and unset it.

Add options page

If used as a plugin, it would be more practical to render an options page where the user can insert one or more repos.

Example please

Hi,

I know opening an issue is probably not the best way to ask this but I can't get your code to work.

My (private) gitlab repo url is: https://gitlab.com/adtrak-web/easigrass-franchise-new/

And this is my code:
`/**

  • Include the file with the ThemeUpdater class.
    */
    require_once 'wp-gitlab-updater/theme-updater.php';

/**

  • Init the theme updater.
    */
    // $slug = get_stylesheet_directory();
    new Moenus\GitLabUpdater\ThemeUpdater( [
    'slug' => 'easigrass-parent',
    'access_token' => 'glpat-zXKj5xfQkuBxXrPBY8xe',
    'gitlab_url' => 'https://gitlab.com',
    'repo' => '31598612',
    ] );`

I can see the tags on the following url: https://gitlab.com/api/v4/projects/31598612/repository/tags/?private_token=glpat-dLmPWBwd6y7EuCUEx43y

I think it's just the 'slug' variable that I can't seem to get right so can you please give me an example of what it should be?

Thanks!

Time check ?

Hello

I'm using your plugin with gitlab repo private.
But I have one issue, how many times the plugin are checking for update ?
Because sometimes the plugin didn't see my new tags .. and I have to wait or try to changes the access token
(I checked with postman and everything is working (gitlab versio 14.7.0)

Thanks

Not working

Is it possible this plugin is not working anymore?

this not working

I am trying to update a plugin but i couldn't understand when you said ', put it into your plugin and call it:' what do you mean by this? i am a beginner in WP i don't know maybe i am wrong in some implementation but i am listing what i have tried.

i have a private repo which is apparently a WP plugin. i

i made a private gitlab repo
i pushed an apparently called WP plugin in that repo ( after 1. adding 'src/plugin-updater.php' and 'src/updater-base.php' from my local WP and 2. adding that repo access token, gitlab url and repo).
now as i already said. i don't know about 'put it into your plugin and call it'. so maybe thats the problem. otherwise what i think work now is, whenever i make a change in any file in gitlab repo. it should show me a message about updating that plugin on local. is this what it is ought to do? right?

Gitlab updated not working with new Worpdpress ?

Hello,

With my Wordpress 5.9.3 wp-gitlab-updater started to raise errors on line 56 of them-updater.php and 103 of plugin-updater.php

I guess that get_site_option does not return an array any more for some reason...

Is there somebody active in here to answer this question ?

With my best regards,
PVI

Doesn't working

I did everything right, I included in my theme with correct fields, but it doesn't work. I tested put the url directly and it returns tag data, but no updates shown in my wordpress administration panel.

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.