Coder Social home page Coder Social logo

davidanderson684 / simba-plugin-manager-updater Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 11.0 216 KB

An updates checker and UI for WordPress plugins that are hosted using the Simba Plugin Manager plugin

Home Page: https://wordpress.org/plugins/simba-plugin-updates-manager/

License: MIT License

PHP 100.00%

simba-plugin-manager-updater's Introduction

Simba Plugin Manager - Updater Class

This class is an updates checker and UI for WordPress plugins that are hosted using the Simba Plugin Manager plugin.

It is intended for plugins that require the supply of access credentials (a customer email address and password) to gain access to updates. For plugins that are available to everyone, you should instead use Yahnis Elsts' plugin update class without any modifications: https://github.com/YahnisElsts/plugin-update-checker

How to use this class

There are two ways you can install this class, depending on whether you wish to use composer or not. We recommend using composer, so that your dependencies remain up-to-date without having to take manual actions.

1. Install: Method one: Via composer (recommended)

If you do not already have a composer.json file, then create one.

{
    "require": {
		"davidanderson684/simba-plugin-manager-updater": "1.9.*"
    }
}

If you already have one, then just add davidanderson684/simba-plugin-manager-updater to the list of requirements (remember to keep the JSON valid, of course).

Then, in the same directory, run "composer update" (assuming you already have composer installed).

1. Install: Install manually (it's better to use composer, but if you insist...)

Check out a copy of Yahnis' Elsts' plugin update class, version (https://github.com/YahnisElsts/plugin-update-checker).

Download from https://github.com/YahnisElsts/plugin-update-checker and you can place it in a subdirectory "puc", relative to where this class is housed, such that the plugin updater class is in puc/plugin-update-checker.php. It will be looked for there if the composer directory does not exist. You should read the file composer.json which is part of this (the update manager class) project to see which versions are compatible (don't download an incompatible version).

2. Include the class in your plugin

Now that you're installed, you need to include the class. Your plugin's constructor is a good place to do this.

If you are using composer, you should copy the updater.php file into your plugin (if you edit the bundled copy in-place, then it will get over-written when you update), in the same directory as your composer.json and vendor directory are (or if otherwise, modify the paths mentioned in it).

include_once('path/to/your/plugin/updater.php');

3. Edit updater.php to point to where your plugins are hosted

updater.php is a very short file. Find this line ...

new Updraft_Manager_Updater_1_9('https://example.com/your/WP/mothership/homeurl', 1, 'plugin-dir/plugin-file.php');

... and:

  1. Change it to point to the home URL of your WordPress site that is hosting the plugin (i.e. that is running the Simba Plugin Manager).

  2. Change the 1 to be the user ID of the user on your WordPress plugin-distributing site who is hosting this plugin (i.e. the user ID logging into Simba Plugin Manager to provide updates of this plugin).

  3. Change the plugin path to be the path (relative to the WP plugin directory, by default wp-content/plugins) to your plugin's main file.

That's it! A fourth parameter is also available, an options array. Available options (specified as key/value pairs) include: debug (boolean), require_login (boolean), auto_backoff (boolean), interval_hours (integer).

simba-plugin-manager-updater's People

Contributors

andtown avatar bsetiawan88 avatar davidanderson684 avatar hjogiupdraftplus avatar jcb121 avatar kevinbatdorf avatar marcusig avatar porter707 avatar venkatraj avatar yordansoares avatar

Stargazers

 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

simba-plugin-manager-updater's Issues

[feature] PSR-4 for class

Hello bro, greetings could you add that your class has psr-4 I am adding unit tests to my plugins and I would like to be able to use your plugin better.

Thank you

Custom icons

Is there a way to define custom icon URLs in the updates page for plugins?

Screenshot 2024-01-25 at 11 13 23โ€ฏa m

Error in minor versions due to updating Updraft_Manager_Updater_1_8

I considered that the version 1.9 in PR #23 that was released should be renamed to a major version since it implies a change in my code from Updraft_Manager_Updater_1_8 to Updraft_Manager_Updater_1_9 and the semantic version is not preserved.
My current composer.json dependence
"require": { "davidanderson684/simba-plugin-manager-updater": "^1.8" },

The correct tag version of this update should be v2.0.0

Since other developers who use Simba as a dependency will have errors in their plugins, in my case I launched an update to my clients and their WordPress automatically received a failed error.

image

๐Ÿž[Bug] Error forbidden upload version

Hello,

When a .zip of a version is going to be uploaded, an error is presented in the http request that is generated when the page is loaded.

image

Apparently this causes that when clicking on the input file of the file, the native browser window does not appear to load the file.

image

Plugin Update Checker dependency

This dependency throws a couple of dynamic properties deprecation notices: https://github.com/DavidAnderson684/simba-plugin-manager-updater/blob/master/composer.json#L5

Deprecated: Creation of dynamic property Puc_v4p13_Plugin_Update::$x-spm-yourversion-tested is deprecated in /vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/Metadata.php on line 111

Deprecated: Creation of dynamic property Puc_v4p13_Plugin_Update::$x-spm-subscription-active is deprecated in /vendor/yahnis-elsts/plugin-update-checker/Puc/v4p13/Metadata.php on line 111

In addition last version is 5 while required version is locked on 4.13.*: https://github.com/YahnisElsts/plugin-update-checker/releases/tag/v5.0

Are there plans to update to target version 5?

Thanks!

Can't use method return value in write context

if (!empty($this->get_plugin_data('PluginURI'))) $plugin_label = '<a href="'.esc_attr($this->get_plugin_data('PluginURI')).'">'.$plugin_label.'</a>';

Hey David,

One user is reporting this

[Wed Sep 02 08:56:12.697457 2020] [:error] [pid 359330:tid 139711939032832] [client 23.16.24.245:49840] PHP Fatal error: Can't use method return value in write context in /home/username/public_html/wp-content/plugins/ml-slider-pro/vendor/davidanderson684/simba-plugin-manager-updater/class-udm-updater.php on line 719
[Wed Sep 02 08:56:05.767539 2020] [:error] [pid 359392:tid 139711980992256] [client 23.16.24.245:49835] PHP Fatal error: Can't use method return value in write context in /home/username/public_html/wp-content/plugins/ml-slider-pro/vendor/davidanderson684/simba-plugin-manager-updater/class-udm-updater.php on line 719, referer: https://username.com/wp-admin/plugins.php
[Wed Sep 02 08:56:05.163491 2020] [:error] [pid 359330:tid 139711980992256] [client 23.16.24.245:49834] PHP Fatal error: Can't use method return value in write context in /home/username/public_html/wp-content/plugins/ml-slider-pro/vendor/davidanderson684/simba-plugin-manager-updater/class-udm-updater.php on line 719, referer: https://username.com/wp-admin/plugins.php
[Wed Sep 02 08:55:55.261911 2020] [:error] [pid 359330:tid 139712022951680] [client 23.16.24.245:49832] PHP Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Puc_v4p7_Plugin_Info' not found in /home/username/public_html/wp-content/plugins/ml-slider-pro/vendor/yahnis-elsts/plugin-update-checker/Puc/v4p7/UpdateChecker.php on line 610, referer: https://username.com/wp-admin/plugins.php
[Wed Sep 02 08:55:53.681445 2020] [:error] [pid 359393:tid 139711960012544] [client 159.203.98.228:52750] PHP Fatal error: Can't use method return value in write context in /home/username/public_html/wp-content/plugins/ml-slider-pro/vendor/davidanderson684/simba-plugin-manager-updater/class-udm-updater.php on line 719

Google suggests it's to do with using empty() here.

https://www.google.com/search?q=Can%27t+use+method+return+value+in+write+context&oq=Can%27t+use+method+return+value+in+write+context&aqs=chrome..69i57j69i59j69i60&sourceid=chrome&ie=UTF-8

Additionally, the user included their info:
Screen-Shot-2020-09-02-at-10-18-54-AM

I could probably prepare a PR but not exactly sure how to test it properly. Let me know.

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.