Rewrite not working since upgrade to 5.9

I have the following code in my plugin:

add_action( 'init', 'hikingchallenges_rewrites_init', 10, 0 );

function hikingchallenges_rewrites_init(){
    add_rewrite_rule(
        'my-progress/([a-z-]+)[/]?$',
        'index.php?pagename=my-progressmy-progress-function=$matches[1]',
        'top' );
}

add_filter( 'query_vars', 'hikingchallenges_query_vars' );
function hikingchallenges_query_vars( $query_vars ){
    $query_vars[] = 'my-progress-function';
    return $query_vars;
}

With the intention that the url /my-progress/ loads a page with the slug 'my-progress' and urls with the format /my-progress/add-activity/ or /my-progress/view-activity will load the same page but pass the second part of the url as a function ie: my-progress-function=view-activity.

The 'my-progress' page contains a shortcode functions that handles everything I need. Everything was working fine until upgrading to 5.9 and now I cannot get it to work. Instead of loading the 'my-progress' page, instead it shows the archive page, however /my-progress/add-activity/ and /my-progress/view-activity do appear to work.

Can anyone shed any light?

Topic rewrite-rules upgrade plugin-development Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.