facetwp / github-updater-lite Goto Github PK
View Code? Open in Web Editor NEWDrop-in support for GitHub automatic updates
Drop-in support for GitHub automatic updates
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
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
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.
Update notifications do not appear when certain EDD_SL_Plugin_Updater
-based plugins (such as WP Recipe Maker Premium) are active.
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?
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.
Thanks for this helpful lib! Just a heads-up that I forked it to pull from release binaries instead of tags, since my plugin has build steps and isn't ready-to-use straight from the repository.
That's in a totc
branch in my fork here if you want to see:
https://github.com/NateWr/github-updater-lite/tree/totc
๐ฅ Cheers!
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
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:
include
s file manually, works just as it does now.Likely related to the get_plugin_data
function
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.