Giter Site home page Giter Site logo

github-updater-lite's People

Contributors

afragen avatar mgibbs189 avatar natewr avatar schlessera 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

github-updater-lite's Issues

Github Rate Limiting not as restrictive as you think...

Hey @mgibbs189 I tried emailing you at facetwp.com, but it bounced back, so I figured I'd just open an issue here.

Just wanted to mention something I noticed over the weekend in the Github API docs. The rate limiting of 60 requests/hour is based on the client that's making the request (not the repo). So I'm thinking that as long as the updater plugin doesn't make a call to the API on every pageload in the dashboard, it would be unlikely to hit those limits for any given site.

https://developer.github.com/v3/#rate-limiting

For unauthenticated requests, the rate limit allows for up to 60 requests per hour. Unauthenticated requests are associated with the originating IP address, and not the user making requests.

I added an API call to display the Changelog in the "View Details" window (by retrieving the Releases info and formatting it nicely); that shouldn't cause a problem with rate limiting because it's only called once someone clicks "View Version x.x.x Details"... and they're not going to do that 60 times an hour. (I also coded it so that if the API returns a 403, it'll show a fallback that links to the webpage of the Releases instead.)

At the moment, the only part of my code that wouldn't work automatically for everyone is that I've hardcoded the $owner/$repo part of the API url.. since those variables were created in a different function and not already available. But if we get that part working, this could be added to the plugin so everyone could benefit from automatic changelog generation.

Just trying to help out here and give back a little, since you (and this code library!) have been so helpful! :)

Thanks,
Andrew

A little help / documentation perhaps..

I have a small repo on github with some customization for my wordpress "functions.php" written as a plugin. I believe I have followed the instructions but if I make any commits and changes I don't get any autoupdates or prompts to do so.

I have put the
include( dirname( FILE ) . '/github-updater.php' );
right near the top of
TKS-CustomFunctions.php

Have I integrated it wrongly?

Here is the repo
https://github.com/abclution/TKS-CustomFunctions

plugin_information override

Though the plugin info is not processed i also point out some strange things in the code:

                        'requires'      => '4.7',
                        'tested'        => get_bloginfo( 'version' ),
                        'last_updated'  => date( 'Y-m-d' ),

Why would you enforce the WP version of the plugin to 4.7 here? I don't understand this at all.
Why do you return the tested version as the current version of the blog? It has nothing to do with the plugin info.
Why is the last update the current date? It's wrong.

It looks wrong to me. Better not display anything than confusing information.

GitHub URI not recognized in plugin header

Have you run into any issues where the GitHub URI plugin header is not getting picked up? I'm trying to integrate this but I've found that the GitHub URI key is not a part of $info on this line:

https://github.com/FacetWP/github-updater-lite/blob/master/github-updater.php#L49

My plugin header, which is at /wp-content/plugins/totc-layout-control/totc-layout-control.php is the following:

<?php
/**
 * Plugin Name: Theme of the Crop Layout Control
 * Plugin URI: https://themeofthecrop.com
 * Description: Beautiful homepage layouts for themes from Theme of the Crop.
 * Version: 0.1.0
 * Author: Theme of the Crop
 * Author URI: https://themeofthecrop.com
 * License:     GNU General Public License v2.0 or later
 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
 * GitHub URI: NateWr/totc-layout-control
 *
 * Text Domain: totc-layout-control
 * Domain Path: /languages/
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write
 * to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
defined( 'ABSPATH' ) || exit;

// ...

Am I missing something obvious here?

How to show View Details?

I have tags setup:
image
The update process works. But the View Details link never shows...

I KNOW I'm being dense and this is an easy fix, but I can't seem to find the answer...

Update all active plugins?

I tried this and i'm bit confused how you intend to install this. Is it for a single plugin or globally for all plugins? In the readme you write copy it to your plugin folder and include it from your main plugin file. So i understand it's more for a single plugin and that's actually how i would like to use it. But the problem is it checks all active plugins, not only the current one it's installed in...

I think it's very bad idea to go and check all active plugins if this is installed in a single plugin, you shouldn't disturb how the other plugins are updating themselves. On the other hand if it's meant to be used for all plugins the documentation is not clear enough.

Only fire hooks when necessary

if $this->update_data is empty, then don't even run the filters, e.g.

plugins_api
pre_set_site_transient_update_plugins
upgrader_source_selection
extra_plugin_headers

Use Composer Autoloader

I recommend adding Composer autoloader support to this package, using the "files" directive of the autoloader.

The effect depends on how the package is being pulled in:

  1. Site-wide Composer stack: Site loads site-wide autoloader, GHU is automatically active.
  2. Plugin-local Composer installation: Plugin loads plugin-local autoloader, GHU is automatically active. Can be overridden by 1. as needed.
  3. No Composer: Plugin includes file manually, works just as it does now.

Throws a notice when installing another plugin

screen shot 2016-06-23 at 9 43 06 pm

This is from the version of the library in the latest version of FacetWP, so you may have already fixed this. At a quick glance, it looks like you just need an isset check for $hook_extra['plugin'] before continuing.

plugin_information not retrieved

All the information about the last available version is not processed correctly, you get a nasty error message instead.

I debugged the code and the reason is you mix up internally the "plugin path" and the "plugin slug". What you call "slug" when looking for active_plugins or get_plugins is not the slug but the plugin path (relative). Yes it's very poorly defined in Wordpress... and i'm not sure it would work well for singe-file plugins that are not installed in a folder. Many assume there is a folder for every plugin.

But at least for standard plugins in a folder i made a hotfix that works, i'll try to send it later through a PR.

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.