ClassicPress / classic-commerce

A simple but powerful e-commerce platform built for ClassicPress. Forked from WooCommerce and compatible with many Woo extensions.
https://classiccommerce.cc/
GNU General Public License v3.0
51 stars 15 forks source link

Update to the Plugin Update Manager file #211

Open bahiirwa opened 4 years ago

bahiirwa commented 4 years ago

The current update manager client file needs an update since the new release.

This looks like a partial update to the Update Manager code. I'm not sure this change is correct anyway but that would be an issue to take up with https://github.com/codepotent/Update-Manager.

Since this is not related to the purpose of this PR it should be removed from here and written up separately.

_Originally posted by @nylen in https://github.com/_render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjMxMDEwODY2OnYy/pull_request_review_threads/discussion_

xxsimoxx commented 4 years ago

Version 2 is out now and an update will improve performances. I can do a PR if you want, but i need 2 answer before:

  1. Now UpdateClient.class.php has removed text domains. More info here: codepotent/Update-Manager#44. As those are core strings, it's up to CP to translate them, but if you want i can add CC text-domain.
  2. Images in CC are in assets/images and this is fixed hardcoded in the class. There are two filters now to do that. I can modify the class or use the filters, but in the latter case please let me know which is the preferred location to add those filters.
bahiirwa commented 4 years ago

About

  1. I think we need to ignore this for now. With version 2 of the CP repo, we shall have plugins update straight out of the box. It means this file will be removed. It’s a temporary measure and we don’t need to translate it as part of the core plugin.

Thoughts welcome.

timbocode commented 4 years ago

I'm not sure I want to be introducing any significant changes just as we're ready to release beta1 of CC so for beta1 at least, I'd say it's business as usual.

ghost commented 2 years ago

There is a new version of the Update manager client file that adds an extra line for security to lock the download location.

I'm not sure what happened with this issue, but do we want to look at updating the client file in the next release?

xxsimoxx commented 2 years ago

I can update the client and make the necessary to make it fully works. Now it points to https://officialplugins.classicpress.net/ that seems not to be active. Am I wrong?

ghost commented 2 years ago

The update server should be: const UPDATE_SERVER = 'https://classiccommerce.cc/';

Is that what you were asking?

ghost commented 2 years ago

Also for anyone updating this, note that the client file has been renamed to: class-wc-update-client.php

and the path to the images needs to be:

// Set path and URL to this plugin's own images directory.
$image_path = untrailingslashit(WP_PLUGIN_DIR).'/'.$plugin.'/assets/images';
$image_url  = untrailingslashit(WP_PLUGIN_URL).'/'.$plugin.'/assets/images';
xxsimoxx commented 2 years ago

and the path to the images needs to be

I'm writing a PR to use filters to do this, and also to support usage statistics opt-out. So when/if a new version of the client will be released the update will be easier.