Giter Club home page Giter Club logo

Comments (7)

froger-me avatar froger-me commented on September 16, 2024

Hello @digitalbread !
Thank you for reaching out.

To develop, integrate Plugin Update Checker and WP Update Server libraries, and test the plugin and its dummy plugins, I used a test server (Linux hosting) with a domain name and a subdomain - no work has been done with localhost, so I am not sure of the side effects there.

Note (not sure if that helps, but I thought I'd mention): one cannot use 1 install of Wordpress for both the server and the client - it is necessary to use 2 installs, because once the update process is starting, the client is put under maintenance. The server install of Wordpress acts as a proxy between the remote repository and the clients. Remote Repo > WP server > WP clients.

You are definitely right to point out path strings should be sanitised with wp_normalize_path to ensure portability - I will update the code ASAP.

In the meantime, would it be possible to let me know if the same issue occurs when not using localhost at all?

from wp-plugin-update-server.

froger-me avatar froger-me commented on September 16, 2024

Oh, and another thing: the URL to check for plugin updates is the following:
https://my-domain.tld/wp-update-server/?update_action=get_metadata&plugin_id=dummy-plugin%2Fdummy-plugin.php
It is a direct endpoint, without the wp-content/plugins/ part.

Visiting it should output a json response looking like:

{
    "name": "Dummy Plugin",
    "version": "1.0",
    "homepage": "https:\/\/domain.tld\/",
    "author": "Author Name",
    "author_homepage": "https:\/\/domain2.tld\/",
    "last_updated": "9999-99-99 99:99:99",
    "slug": "dummy-plugin",
    "request_time_elapsed": "0.000"
}

from wp-plugin-update-server.

digitalbread avatar digitalbread commented on September 16, 2024

Hey @froger-me ,
thank you for responding. I hope I'm helpful improving this great plugin you've created. I know it's a lot of work.

So, I've setup everything all over again starting from scratch. My setup looks like this:
WP Plugin Update Server + Software License Manager hosted in fresh WordPress install on Digital Ocean with Ubuntu 16. I also have the wppus-endpoint-optimizer.php in mu-plugins

(fyi - you have a typo on the Help page concerning the endpoint optimizer - it reads /srv/users/goodeggu/apps/digibreadapps/public/wp-contentmu-plugin/wppus-endpoint-optimiser.php you are missing a forward slash and I believe it should be mu-plugins not mu-plugin).

My dummy-plugin is in bitbucket private repo and I have the settings to use stable-branch. Everything works in WP Plugin Update Server when I update the plugin and request it in General screen.

As for localhost (i'm not installing wppus, I'm only testing dummy-plugin for updating),If this helps, I develop locally on Windows using Serverpress Desktop Server (Free version available - I highly recommend for testing plugin updates on localhost) this will reveal the path issue mentioned before. The endpoint link it tries to create is something like this
https://my-domain.tld/wp-update-server/?update_action=get_metadata&plugin_id=C%3A%5CX%5CAAA_PHPSTORM_PROJECTS%5Cmydev.dev.cc%5Cwp-content%5Cplugins%5Cdummy-plugin%5Cdummy-plugin.php
So getting plugin updates on localhost from WP Plugin Update Server doesn't work. However using this https://github.com/YahnisElsts/plugin-update-checker does work on localhost

Now since the initial upload of 1.1 I've created an update to 1.2 and pushed it to stable-branch. I went to wppus and retrieved it again under General and it shows 1.2.

I've installed my dummy-plugin v1.1 on a website hosted at MDDHosting (CPANEL on Linux) and when I click Check Updates I get this error:
Could not determine if updates are available for Dummy Plugin. Failed to parse update metadata. Try validating your .json file with http://jsonlint.com/ puc-invalid-json
When I click on View Details I get this:
An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.

Thank you for the clarification on the endpoint but when I go the endpoint https://my-domain.tld/wp-update-server/?update_action=get_metadata&plugin_id=dummy-plugin%2Fdummy-plugin.php it is stripping out the "wp-update-server/" so I get https://my-domain.tld/?update_action=get_metadata&plugin_id=dummy-plugin%2Fdummy-plugin.php and the WordPress standard 404 page. I'm sure this is probably whats causing the issues above. I have only wppus and software license plugins activated. I've tried turning off permalinks and on back on (to post name) but same issue. Theme is only Twenty Seventeen.

I'll email you my actual server address and a link to my v1.1 dummy-plugin.zip so you can see what I'm seeing.

Thanks @froger-me

from wp-plugin-update-server.

digitalbread avatar digitalbread commented on September 16, 2024

one more thing I found is that if i'm logged in and try to access the endpoint it does not strip the "wp-update-server/" permalink but still get the 404 page, if I'm logged out it strips. If I create a post or page with that permalink "wp-update-server/" it has the same behaviour. I've also tried with the optimization script both in and not it the mu-plugins folder.

After this testing I tried the plugin update from my MDDhosting site and get an new error:
Could not determine if updates are available for Dummy Plugin. HTTP response code is 404 (expected: 200) puc_unexpected_response_code

from wp-plugin-update-server.

froger-me avatar froger-me commented on September 16, 2024

Let's follow up by email - I'll report here where relevant.

from wp-plugin-update-server.

froger-me avatar froger-me commented on September 16, 2024

'wp-plugin-update-server/wp-plugin-update-server.php' should be added to wppus-endpoint-optimizer.php - although help mentions the $wppus_always_active_plugins can be edited to preserve plugins execution during update checks, WPPUS should be included by default:

if ( ! $wppus_always_active_plugins ) {
	$wppus_always_active_plugins = array(
		// Your plugins here to keep active during update checks.
		// 'my-plugin-slug/my-plugin-file.php',
		// 'my-other-plugin-slug/my-other-plugin-file.php',
		'wp-plugin-update-server/wp-plugin-update-server.php'
	);
}

Fixed.

from wp-plugin-update-server.

digitalbread avatar digitalbread commented on September 16, 2024

You're the man @froger-me it worked from my remote hosting but not localhost. I sent you an email and will open a new issue here. Thanks again for your promptness and great plugin. πŸ‘

from wp-plugin-update-server.

Related Issues (20)

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.