Submit ClassicPress to W3Techs

I think that someone should submit ClassicPress to W3Techs. It’s the main site used for stats by a lot of people.

With the info needed so they can correctly detect a ClassicPress installation.

Link: https://w3techs.com/forum/category/content_management

5 Likes

Thanks Luis, and welcome!

I’ll ping @1stepforward about this. We will probably need to check how they detect a CP site.

2 Likes

This is my first message from what I can tell. I thought I had already posted before.

Thanks for the welcome. Even though I’m registered here for longer than you :slight_smile: But it’s my first message.

5 Likes

I think @james is the best person to answer this but in brief, detecting ClassicPress is not too easy at present. We are dependent on a meta tag similar to this:

<meta name="generator" content="WordPress 4.9.13 (compatible; ClassicPress 1.1.2)">

but this is quite unreliable. The generator tag is often removed or changed by themes and/or plugins.

ClassicPress has been submitted to W3Techs but it takes time.

Everyone can help by making sure that the generator meta tag exists in their website source code. Some security plugins may remove it in which case disable this option. Themes such as Divi and plugins such as LayerSlider change it.

If you find that the generator meta tag doesn’t exist or has been changed and you don’t know what’s causing it, you can always add the PHP code above to your theme’s header.php (between the opening <head> and the closing </head>) as a quick and dirty way around it.

Maybe this is worthy of an MU plugin???

But for now, any stats that you do see are likely to be way off the mark.

3 Likes

Split this into a seperate topic as, while related, it is already evolving into a side-discussion.

2 Likes

This is correct :+1:

There are other ways to detect ClassicPress such as the presence or content of certain files, but scanners need to implement these too, which I think hasn’t happened yet for the most part.

You may not want to do this if the generator tag already exists, since this will duplicate it.

Sure, this works for me:

<?php

if ( ! defined( 'ABSPATH' ) ) return;

function cp_restore_default_generator( $gen, $type ) {
    global $wp_version;

    $esc_wp_version = esc_attr( $wp_version );
    $esc_cp_version = esc_attr( classicpress_version_short() );

    return "<meta name=\"generator\" content=\"WordPress $esc_wp_version (compatible; ClassicPress $esc_cp_version)\">";
}
add_filter( 'get_the_generator_html', 'cp_restore_default_generator', 9999, 2 );
add_filter( 'get_the_generator_xhtml', 'cp_restore_default_generator', 9999, 2 );

We will also be releasing our own stats for number of sites, hopefully fairly soon. These should be much more accurate.

4 Likes

2 posts were split to a new topic: Code storage for gists / mu-plugins