Dev needed for simple (?) CC plugin idea

We have recently introduced a great checking feature in the migration plugin for CP that warns if you are using a WP5+ plugin that may not be compatible.

I recently posted an enhancement request on the Classic Commerce GitHib repo suggesting we have something similar in CC. I realise that it may be a while before we can move on this, but in the meantime I think it would be useful to have a small plugin that people could use to check the current plugins they are using on WC to see if migrating to CC may cause problems.

It is actually not that easy to find WC version compatibility - it is usually (always?) listed in the header of the plugin file, as:

 * WC requires at least: 3.5
 * WC tested up to: 5.1

I was thinking this plugin could run through all the plugin headers and simply display any instances of the “WC requires at least:” line that it finds. Doesn’t need to be too elaborate with fancy colours, etc. A statement at the top that says “Any plugins that are later than WC 3.5.3 might cause problems” is all that is needed - the user can work it out from there. If we can get this working then I will do a tutorial on the CC site explaining how to use it.

Any devs who might like to take this on please reply here or send me a DM. Thanks.

1 Like

I actually now have a working prototype for this (no-one more surprised than me!).

So I guess what I need is for someone to volunteer to make this into a plugin that is suitable to be shown to the general public (and checked so that it won’t fall over at the first hurdle).

1 Like

So this is what I have so far. It’s just one page of code and I’m sure fairly rough (since it’s copy-paste stuff). But it does seem to do what I had intended.

4 Likes

Did you use get_file_data()?

Can we do this via a repo at https://github.com/ClassicPress-research, or did you have something else in mind?

Yes. That and get_plugins().

Sure! I’ll put it up into my GitHub and send you a DM.

The plugin prototype is now available here if anyone feels like taking on a small project.

Note that get_plugin_data will only retrieve the custom WC tested up to and WC requires at least if CC (WC) is actually installed and active, otherwise it will not return those informations even if present in the header of a plugin.
Thus a check for wether the CC is active would be adequate.
Done (note that it will require CC. It wont accept WC. Not sure that would be required to change? Like if it is for a pre-flight check, we should allow WC or CC as the base plugins, I guess)

Also made a couple other changes, including but not limited to security, localisation and general code refactor to cope with WPCS.

Hope I did not ruin anything. Tested it locally a couple times, so … should work. Bumped version 1.0.0 as it is IMO stable for usage. PR:

Hey, thanks for looking at this @smileBeda .

Hey, you are right. I hadn’t realised that. I don’t really understand why that is, since the meta data is still right there in the header of each plugin.

Could it be made to do both? Or probably preferably WC. The idea of this plugin is to check your WC plugins before you migrate to CC, so it’s more likely you will have WC active and not CC.

That’s great. I was hoping someone would clean it all up. Make as many changes as you want. I’ll test it out now. Cheers! :+1:

I’ll have to wait until it is merged in before I can test it.

Can, will push it in a few minutes

Aren’t you the owner of said thing?
You can download my master if you want
Remember to rename the plugin (remove “master” or main or whatever it appends to the file)

It’s on the CP research area now. I actually have no idea how to download your master. :thinking:

The change is made
You can download it from here for now https://github.com/TukuToi/cc-plugin-checker
Click the green “Code” button, then “Download ZIP”, then unzip it, then rename the folder to cc-plugin-checker and install on the test site.

2 Likes

Great. Will do.

Fantastic! Thanks @smileBeda :clap:

Works with both CC and WC activated. The only little thing I can find is the “No WC Tag” should be in the pale grey, but the ones with the tags should be solid black.

screen

Now it’s a proper plugin!

I’ll look into that!

It still needs work
I don’t like how it echoes styles and generally how the html is generated, but that is rather a “cosmetic” thing, not really bound to functionality, so for usage it is fine.

Yes, do whatever you like. I found a similar sort of plugin on the WP repo and just modified it to suit. But even I could tell it was really badly written.

Are you happy to take this on and add it into the CP directory? It would need the Update Manager file added to it. I can sort it out if you prefer, but I’m not really in the business of looking after plugins. If we can get it up I will write a tutorial on the CC website about how to use it to check before migrating.

This is great! Many thanks. Nice to have something that was a vague idea a few days ago move along so fast.

2 Likes

About updater… I don’t really do that update manager thingy, I don’t like the idea.

Mainly because I don’t want to admin yet another website/server (I admin more than 20 of those, so each and every add-on server or site is a pain that I want to avoid, specially if it could affect other sites) and security concerns.

I also had (still have) my own updater system but I don’t ship it anymore in plugins/themes because of the security issue it implies.
Let’s assume my VPS on which I would have said repo gets hacked, and “evil” realises what it is used for, they just need to upload a poisoned file and increase version, the thing is then potentially on all sites using the plugin or theme. Which might be none, or hundreds, thousands (in my dreams)

I don’t like this idea, at all. This is why WP has WP Repo (for wp plugins) and we should have our own centrally managed server/update mech which gets monitored etc, or directly pulls from git.

Usually I just push to WP, but the problem with this plugin is that I can hardly mask it as a WP Plugin like I do with my other ones… so pushing it to WP repo will be tricky or impossible :stuck_out_tongue:

Also, I am not sure about this, aren’t the CP “research” plugins supposed to be somewhat “core” plugins?

I am happy to add it to my instance of the directory once we are happy with it, however… since you authored it I think the honours should be yours?
We anyway need to pep up our directory to also allow for “contributors” to show up there, not everything is a one-person-show

I will fiddle a bit more with the code later next week, maybe until then we have a taker who is willing to provide a update mech too.