Support » Plugin: WordPress Popular Posts » Sort by daily average missing in new block widget

  • Resolved tedivm

    (@tedivm)


    I tried to use the new block based widget instead of the classic but it’s missing the option to sort by daily average.

    Here’s a screenshot- https://imgur.com/1twqHVb

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Héctor Cabrera

    (@hcabrera)

    Yep, that option was deliberately left out.

    Over the years it seems that only a handful of people use that sorting option so as an experiment I purposely didn’t include it with the block to see what would happen. 4+ months later you’re the very first person to leave a comment about it 😛

    For the time being if you really need that sorting option for whatever reason then you may want consider installing the Classic Widgets plugin which will allow you to use the classic WordPress Popular Posts widget and its sort-by-average-views-count option with WordPress 5.8 and beyond.

    Thread Starter tedivm

    (@tedivm)

    When wordpress updates people to block widgets they embed the older widgets in as legacy widgets, so the older ones still work. I imagine there’s a lot of people who haven’t noticed that daily average is missing only because they already have their plugin configured.

    The problem with this is it’s impossible to edit the plugin in block mode (it literally just ignores setting changes). So even though it still works it can’t be changed. Using the Classic Widget plugin is a bandaid, and it also makes it so I can’t use the new block plugins.

    Thread Starter tedivm

    (@tedivm)

    Okay, I dug into the source and found out that it’s a one liner to add the feature back in. I went ahead and did so on my own plugin- I hope you’ll do the same. If not just let me know and I can fork it.

    Plugin Author Héctor Cabrera

    (@hcabrera)

    When wordpress updates people to block widgets they embed the older widgets in as legacy widgets, so the older ones still work.

    Indeed, the built-in WordPress widgets and many third-party ones do work with the Legacy Widget block. However that’s not the case with the classic WordPress Popular Posts widget. Due to its complexity (code wise) the WPP widget didn’t work all that well -and in some instances at all- with the Legacy Widget block (otherwise I wouldn’t have created a WordPress Popular Posts block in the first place), hence my recommendation to use the Classic Widgets plugin.

    If switching back to the Classic Widgets screen isn’t an option then you may also want to consider using the [wpp] shortcode as it still allows to sort posts by average views per day, however it has its own downsides as well.

    Pick your poison.

    Plugin Author Héctor Cabrera

    (@hcabrera)

    If not just let me know and I can fork it.

    That’s a valid solution as any other. Please be my guest.

    Thread Starter tedivm

    (@tedivm)

    The shortcode tip helped, I was able to slap together a replacement widget with it and some minor CSS work.

    I do wish you’d consider adding the option back into it, since it does appear that it’s just a one liner to do so.

    Thread Starter tedivm

    (@tedivm)

    Thanks for adding the option back, I really appreciate it!

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Don’t mention it, it really didn’t take much time (but you already knew that hahaha).

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Sort by daily average missing in new block widget’ is closed to new replies.