ClassicPress "Next" Progress News

I am starting this topic so it serves as a central point for updates about a potential ClassicPress “Next” or “V2” version. After getting some positive and some negative feedback, and after many words, this is the situation:

CP is currently having a big problem which, essentially, is the incompatibility between old-compatibility and new-progress.

I decided to start doing something, to accompain my words with example. I started a CP fork not to compete with CP but to serve as an inspiration for those who care, where PRs will happen. You can find it here:

WP CMS: Code is not poetry. (github.com)

WP doesn’t stand for WordPress. It stands for the WP way, the old open source amazing CMS which ceased to exist once WordPress ran over it.

I spent over 10 hours so far removing XML-RPC (and the related Pingback/Trackback relic), removed Gravatar and added a core plugin to allow users use Local Avatars if they want to. I also updated the DB schema to remove three columns from the wp_posts table: ping, pinged, to_ping. I always hated those. Also updated the core accordingly, to make it work.

This week I will focus on testing this and cleaning it up as much as possible. I think that all the XML-RPC/Pingback references are now removed from Core, but I’ll keep looking.

The Avatars core plugin is working but I still hate it. It’s very messy. It’s a 7 years old plugin I rescued because it’s the closest to what I think is a good approach on this. And the goal now is to clean that up and organize it in a way that I believe should be used as an example of a clean WP Plugin.

I have many ideas in mind, but I won’t repeat the mistake of trying to achieve everything at once, which would lead to a broken product and wasted time. Until the two current tasks aren’t perfectly finished, I won’t move on to the next step.

@james feel free to fork my repo from within the ClassicPress github and I’ll PR everything I do. I don’t intend to do my own CMS. I’d love to see CP Next adopt my initiative, but for the sake of stopping this constant “ask for permission” barrier, I’ll keep this as a personal repo until there is more people joining the concept. If there ever are.

I will also keep posting news here on this topic. If the community doesn’t want to, just let know and I won’t.

3 Likes

I downloaded and installed it, I had no errors in the logs, so far, so nice!

What I saw was that all avatar options in wp-admin/options-discussion.php are the “same”:

Is that expected?

I also saw the default comment has a author email set to classicpress.net [email protected]
(I am not sure how that is in “normal” cp or wp, just something I noticed. Perhaps that should change to the current site/admin user?)

While I do not want to trigger you to do “everything at once” :stuck_out_tongue: - can I propose the removal of wp-admin/security.php and wp_links table too?
Let me know if you prefer issues in GitHub instead.

I will not be able to contribute with code to this atm, but I can do the occasional “testing”.

1 Like

Thanks for the practical feedback. I wanted to commit this working version because I saw other conversations on the forum which are again “dead end words”. So I said… let’s post this, let’s change the vibe. Let’s show some facts.

At the current moment I am reorganizing the Avatars plugin and I will PR this once I am happy with it 100%, instead of just halfway done.

Retro, wavatar, monsterid were generated by Gravatar. Since I cut Gravatar and replaced with a default or plugin avatar, the list is repeating the default image instead of taking it from the Gravatar servers. I will remove those monster things and leave it as “Mystery” or “Plugin selected image”. Blank doesn’t make sense, it’s just ugly. Mystery is blank enough.

I think GH issues is better, so this topic doesn’t get endless and unorganized, since I want to use it only for news, so I don’t pollute the forum with new topics for each new notice.

Let me clean up the Avatars thing and post what I will consider a working version for testing and critics.

1 Like

I appreciate your idea, as well as any idea that can improve CP.
But seems to me that there is a very big initial error: you forked src directory and not the whole repo, so you are cutting out, as examples, all the unit tests.

1 Like

Very true beans. Tests are the cherry of a good cake. But I don’t want to get lost in the cherry world before I fix the cake. A conscious choice aimed at simplicity.

I can understand, but maybe leaving tests failing is better that not having.

You work on avatars. Test on avatars is failig. Ok… let’ go on. But if the test failing is about filesystem probably you broke something else you don’t want to.

1 Like

I understand your reasoning, but I can’t put energy into that. For each change I’ll also have to go and review the tests and fix them accordingly. If the current project was the international reference for good practices I would take tests seriously. But at the current state, tests are the less relevant thing. Let’s see where this all brings. It may lead to nowhere, but at least I will have spent time in doing something relatively “decent” or “joyful”. Goal → A working version of a potential CP Next.

1 Like

It’s a shame you didn’t fork off of the branch with all the PHP 8 changes.

1 Like

Seems awesome man!

1 Like

I did a complete rewrite of the Avatars Core Plugin to avoid using such a crazy amount of globals. Also, I’m not a fan of creating Classes just for the sake of avoiding names collision. So I moved everything into namespaced functions.

I am very open to critics for how I rewrote the plugin. My goal with this plugin is to show an example of good practices. You can see the file changes here (or just open the plugin locally and compare it with the original).

@smileBeda - I fixed the bug you noticed for deafult avatars in Settings → Discussion. Regarding the default email… it’s currently set that way, I don’t really care about that right now but if you think we should change that email to something else I will do it, because you always provide good reasons. It’s just a mere replace inside the wp_install_defaults() function.

Now my next steps are: convert the plugin’s jQuery into Vanilla JS (already done), fix potential bugs that I didn’t notice (feel free to open an issue and I will get it fixed) and work on this suggestion (an option to autogenerate an SVG image with first letter in the user’s display name). (already done). I also created a Spanish translation to make sure internationalization is done right.

2 Likes

I finished removing the things I wanted to remove (and the plugins I installed are all working, if you have a plugin suggestion let me know here and I will test it). Even though the Plugin and Themes directory were on the list (because there is no way that the WordPress plugins will keep working for long on this side), I’ll wait on that because progress is being made on the API. It’s a good chance to start forking some of the most used plugins and have a clean and native CP version.

I’m now working on the Core Plugins step. The first thing will be either REST API or Comments System. Both are very spread in core but yeah, nothing is impossible.

Before doing that I wanted to have three Core Plugins added, which I consider are essential:

  • Avatars: allow users to have local avatars. This is working.
  • Clone Posts: allow users to clone posts for a faster workflow and requested by @viktor. This is working (you may want to try it and leave some feedback, if you want).
  • Custom Posts: allow users to create custom post types from the admin area. In progress.

The reason I am adding before I take stuff away is because I’m still reading about singletons, functional, and … I want to come up with the most easy to understand and clean plugin structure before I work on those big Core Plugins.

2 things I would want to see here, which would help developers working with clients based on my experience working with CPTs:

  1. There should be a filter that will disable this functionality completely. Some devs like to lock things up, so clients can’t break things.

  2. Might be related to #1, there should be a filter that hides/disables UI but continues to generate CPTs saved in database. Similar to #1, we may create “team” CPT to manage team bios. But we don’t want clients to break things, so we’ll need to hide CPT.

Bonus: Might be good to have a custom capability for this. Admin can edit them, but another role can be granted this capability.

Will set aside time to test Next version. Exciting.

These are reasons why I’d put such functionality in a (core?) plugin.

I modified the plugin API calls to cut away from the WordPress Plugin Directory, because it makes no sense. Also, I was adding “Core Plugins” that aren’t actually “Core Plugins”. They are useful plugins, but they belong to the Plugin Directory.

So this is how it looks like:

I added a folder with JSON files where the info for the available plugins can be added (in separate files, to keep it clean) which emulates the WordPress API fields.

Something like this:

I actually like the JSON files approach because they can be commited to the repo and other devs can PR for plugin updates, and all the information is always public (and no one is tracking what plugins we have or not!).

The only problem I see here is about listening to plugin updates (when a new version is available), and it would be cool to handle this differently (for example, each plugin developer could provide an online txt file with the most recent version).

Also, I think that all the rating and active installs stuff is a bit of BS. Only good quality plugins should be added to the Directory (no point in having rating) and information about active installs is just irrelevant.

But yeah, this isn’t meant to be a Plugin Directory replacement, it’s just to have something that works and that shows that cutting from WordPress is possible (instead of just words).

If your idea (and my hope as well) is that someone will pick your changes from ClassicPress “Next”
please try to be very precise in your git workflow.

I’m following your progress and I’ve noticed that many plugins have i10n problems.
Tracking down the problem shows that in Update Avatar Core Plugin #5 (a PR that looks about avatars) you have removed a deprecation ($deprecated var from load_plugin_textdomain definition).

I’m not here to criticize your work, but if you go on investing a lot of time and it’s not possible to “cherry pick” your commits it’s not useful (my personal opinion) for the ClassicPress community.

1 Like

Yes, second parameter for load_plugin_textdomain() is a deprecated parameter. It makes no sense to keep carrying that on. As I said here: “Thoughts on breaking changes and a native CP pre-Gutenberg plugins ecosystem”, the time to break from WordPress with a CP native Plugin (and themes) directory is now.

In the process of doing that, some subtle changes will have to be applied to those plugins, but nothing crazy. And removing a useless variable that has been sitting there for years is something that takes less than 15 seconds to do. It takes longer to write your message than to fork a pre-Gutenberg plugin and apply the two or three subtle changes… :wink: - Also, I offered to do that myself, for plugins requested by the community: “What are some of the most important open source plugins in the pre-Gutenberg WP ecosystem? I want to try to keep them compatible with the CP Next version I am working on” (with the idea that they can get into the potential new Plugin Directory)

I’m not removing anything crazy from core. And actually, I’ve already removed everything I wanted to. The next step is all about separating core stuff into plugins.

1 Like

@alvarofranz the specific thing you removed messes up the i18n (internalization) of the core and plugins, and the needed steps to make i18n good again haven’t been taken. What this means is that in removing this specific thing you left a whole piece of the job hanging there.
And this is a problem because not only it can cause breaking changes, but creates a not so clear and choerent git history.
Why haven’t you responded to this instead of venting?
Sorry to be brutal but it’s a very good question.
You could have said that you were going to handle this at a later time, you could have thanked for the heads up about it or you could have just acknowledged that the issue needed to be solved.
I want to know what will you do about i18n. I am a translator and for some month I was translation team lead before COVID decided to strike… I could help with CP next but I want clear processes and directions.

2 Likes

My message was not about removing something deprecated (but check because you removed it from the function declaration but not in the function itself).

If I like your work on avatar and I want to take it to ClassicPress I’ll cherry-pick ffce677cbfc7c5ab0f0c0aa804bca5e7d5e65ba8, but that commit is 99% about avatars and 1% about removing deprecated functions. A commit should be 100% on what is supposed to do in the description.

It takes longer to write your message than to fork a pre-Gutenberg plugin and apply the two or three subtle changes… :wink:

It took longer to clone wp-cms and test all my plugins, trust me :wink:

2 Likes

Nothing has been broken. If you look at the function definition: load_plugin_textdomain() | Function, you will see that the $deprectaed param is not being used. It’s just used to detect if it exists and say: “Hey, this is deprecated, don’t use it”.

Also, I don’t know why you say I left hanging work to do. The only thing that had to be done in Core was to update the _get_plugin_data_markup_translate() function (which I did…).

The only required change to make i18n work is on plugins. Specifically, replace:

load_plugin_textdomain('whatever', false, 'plugin-path')

to

load_plugin_textdomain('whatever', 'plugin-path')

In any forked plugin. And I don’t think that’s a problem.

Forking pre-Gutenberg plugins and replacing load_plugin_textdomain('whatever', false, 'plugin-path') with load_plugin_textdomain('whatever', 'plugin-path') seems a pretty neat start to me. Not just to have that silly replacement, but to actually make the first step in having a WordPress independent list of plugins with their corresponding repos (which are Gutenberg fuss free and can have an independent evolution from there on!) :slight_smile:

Fair point! I will make sure to follow this principle from now on! :wink:

Fact is that just forking/altering plugins and removing things isn’t secure.
Have you seen Elementor for example? It is a very actively developed plugin, they discovered a vulnerability affecting all the sites using it.
You fork a pre-gb thing, but you need to maintain it. And actively develop it to stay current with security standards.
The hanging job is making sure that plugin devs adopt your change to CP core.
You can’t just fork, alter and maintain a whole ecosystem on your own.
So instead of removing things just for the sake of it, why don’t you just try to call on dev to be aware you are removing things (giving them an ETA about that) and ask them if they are willing to adopt a theme or plugin and keep it current with CP next? There are devs already involved in developing for CP, you could have enlisted their help in building the ecosystem (this was already started and things like classicSEO, CC and others were born out of it - aside from people abandoning the projects they started this was and is a good idea, you need devs behind plugins and themes, to be sure no vulnerability comes up for luck of maintenance)