Plugin Directory

Changeset 3477391


Ignore:
Timestamp:
03/08/2026 11:41:22 AM (4 days ago)
Author:
Ajay
Message:

1.4.0

Location:
popular-authors
Files:
85 added
1 deleted
23 edited

Legend:

Unmodified
Added
Removed
  • popular-authors/tags/1.3.0/readme.txt

    r3311374 r3477391  
    55Stable tag: 1.3.0
    66Requires at least: 6.3
     7Tested up to: 6.9
    78Requires PHP: 7.4
    8 Tested up to: 6.8
    99License: GPLv2 or later
    1010
  • popular-authors/trunk/README.md

    r3224591 r3477391  
    11# Popular Authors
    22
    3 __Requires:__ WordPress 6.3 and Top 10 v3.0.0
     3__Requires:__ WordPress 6.6 and Top 10 v3.0.0
    44
    5 __Tested up to:__ 6.7
     5__Tested up to:__ 6.9
    66
    77__License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
  • popular-authors/trunk/includes/admin/class-admin.php

    r3224591 r3477391  
    88namespace WebberZone\Popular_Authors\Admin;
    99
     10use WebberZone\Popular_Authors\Util\Hook_Registry;
     11
    1012if ( ! defined( 'WPINC' ) ) {
    1113    die;
     
    2022
    2123    /**
     24     * Dashboard Widget.
     25     *
     26     * @since 1.4.0
     27     *
     28     * @var object Dashboard_Widget.
     29     */
     30    public $dashboard_widget;
     31
     32    /**
    2233     * Constructor class.
    2334     *
     
    2536     */
    2637    public function __construct() {
    27         add_filter( 'admin_notices', array( $this, 'admin_notices' ) );
    28         add_filter( 'tptn_settings_sections', array( $this, 'add_settings_section' ) );
    29         add_filter( 'tptn_registered_settings', array( $this, 'settings_popular_authors' ) );
     38        Hook_Registry::add_action( 'admin_notices', array( $this, 'admin_notices' ) );
     39        Hook_Registry::add_filter( 'tptn_settings_sections', array( $this, 'add_settings_section' ) );
     40        Hook_Registry::add_filter( 'tptn_registered_settings', array( $this, 'settings_popular_authors' ) );
     41
     42        $this->dashboard_widget = new Dashboard_Widget();
    3043    }
    3144
     
    130143                    'options' => false,
    131144                ),
     145                'wzpa_show_postcount'      => array(
     146                    'id'      => 'wzpa_show_postcount',
     147                    'name'    => esc_html__( 'Show post count', 'popular-authors' ),
     148                    'desc'    => esc_html__( "Show the number of posts in parenthesis next to the author's name", 'popular-authors' ),
     149                    'type'    => 'checkbox',
     150                    'options' => false,
     151                ),
    132152                'wzpa_exclude_admin'       => array(
    133153                    'id'      => 'wzpa_exclude_admin',
  • popular-authors/trunk/includes/class-main.php

    r2953495 r3477391  
    88namespace WebberZone\Popular_Authors;
    99
    10 if ( ! defined( 'WPINC' ) ) {
    11     exit;
    12 }
     10use WebberZone\Popular_Authors\Util\Hook_Registry;
    1311
    1412/**
     
    109107     */
    110108    public function hooks() {
    111         add_action( 'init', array( $this, 'initiate_plugin' ) );
    112         add_action( 'widgets_init', array( $this, 'register_widgets' ) );
    113     }
    114 
    115     /**
    116      * Initialise the plugin translations and media.
    117      *
    118      * @since 1.2.0
    119      */
    120     public function initiate_plugin() {
    121         load_plugin_textdomain( 'popular-authors', false, dirname( plugin_basename( POP_AUTHOR_PLUGIN_FILE ) ) . '/languages/' );
     109        Hook_Registry::add_action( 'widgets_init', array( $this, 'register_widgets' ) );
    122110    }
    123111
  • popular-authors/trunk/includes/css/card.min.css

    r3224591 r3477391  
    1 .wzpa-card{--wzpa-font-family:inherit;--wzpa-margin:auto;--wzpa-min-column-width:96px;--wzpa-max-column-width:max-content;--wzpa-grid-gap:10px;--wzpa-li-border-color:#cccccc;--wzpa-li-background-color:#f0f0f0;--wzpa-li-border-radius:10px;--wzpa-li-font-size:1rem;--wzpa-li-hover-color:#e0e0e0;--wzpa-li-hover-shadow:0 0 10px rgba(0,0,0,.1);--wzpa-link-color:#333333;--wzpa-link-hover-color:#000000;--wzpa-author-img-radius:50%;}.wzpa_authors.wzpa-card{font-family:var(--wzpa-font-family);margin-left:var(--wzpa-margin);margin-right:var(--wzpa-margin);}.wzpa_authors.wzpa-card ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--wzpa-min-column-width),var(--wzpa-max-column-width)));grid-gap:var(--wzpa-grid-gap);align-items:stretch;list-style:none;padding:0;}.wzpa_authors.wzpa-card li{display:flex;flex-direction:column;border:1px solid var(--wzpa-li-border-color);padding:10px;border-radius:var(--wzpa-li-border-radius);background-color:var(--wzpa-li-background-color);text-align:center;font-size:var(--wzpa-li-font-size);}.wzpa_authors.wzpa-card li:hover{background-color:var(--wzpa-li-hover-color);box-shadow:var(--wzpa-li-hover-shadow);}.wzpa_authors.wzpa-card a{color:var(--wzpa-link-color);text-decoration:none;font-weight:bold;}.wzpa_authors.wzpa-card a:hover{color:var(--wzpa-link-hover-color);}.wzpa_authors.wzpa-card img{align-self:center;border-radius:var(--wzpa-author-img-radius);}
     1.wzpa-card{--wzpa-font-family:inherit;--wzpa-margin:auto;--wzpa-min-column-width:96px;--wzpa-max-column-width:max-content;--wzpa-grid-gap:10px;--wzpa-li-border-color:#cccccc;--wzpa-li-background-color:#f0f0f0;--wzpa-li-border-radius:10px;--wzpa-li-font-size:1rem;--wzpa-li-hover-color:#e0e0e0;--wzpa-li-hover-shadow:0 0 10px rgba(0, 0, 0, 0.1);--wzpa-link-color:#333333;--wzpa-link-hover-color:#000000;--wzpa-author-img-radius:50%}.wzpa_authors.wzpa-card{font-family:var(--wzpa-font-family);margin-left:var(--wzpa-margin);margin-right:var(--wzpa-margin)}.wzpa_authors.wzpa-card ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--wzpa-min-column-width),var(--wzpa-max-column-width)));grid-gap:var(--wzpa-grid-gap);align-items:stretch;list-style:none;padding:0}.wzpa_authors.wzpa-card li{display:flex;flex-direction:column;border:1px solid var(--wzpa-li-border-color);padding:10px;border-radius:var(--wzpa-li-border-radius);background-color:var(--wzpa-li-background-color);text-align:center;font-size:var(--wzpa-li-font-size)}.wzpa_authors.wzpa-card li:hover{background-color:var(--wzpa-li-hover-color);box-shadow:var(--wzpa-li-hover-shadow)}.wzpa_authors.wzpa-card a{color:var(--wzpa-link-color);text-decoration:none;font-weight:700}.wzpa_authors.wzpa-card a:hover{color:var(--wzpa-link-hover-color)}.wzpa_authors.wzpa-card img{align-self:center;border-radius:var(--wzpa-author-img-radius)}
  • popular-authors/trunk/includes/css/left-thumbs.min.css

    r2953495 r3477391  
    1 .wzpa-left-thumbs{--wzpa-font-family:inherit;--wzpa-margin:0;--wzpa-min-column-width:96px;--wzpa-max-column-width:1fr;--wzpa-grid-gap:10px;--wzpa-li-border-color:inherit;--wzpa-li-background-color:inherit;--wzpa-li-border-radius:10px;--wzpa-li-font-size:1rem;--wzpa-li-hover-color:#e0e0e0;--wzpa-li-hover-shadow:0 0 10px rgba(0,0,0,.1);--wzpa-link-color:#333333;--wzpa-link-hover-color:#000000;--wzpa-author-img-radius:50%;}.wzpa_authors.wzpa-left-thumbs{font-family:var(--wzpa-font-family);margin:var(--wzpa-margin);container:wzpaLeftThumbs / inline-size;}.wzpa_authors.wzpa-left-thumbs ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--wzpa-min-column-width),var(--wzpa-max-column-width)));grid-gap:var(--wzpa-grid-gap);grid-auto-rows:1fr;list-style:none;padding:0;}.wzpa_authors.wzpa-left-thumbs li{display:flex;border:1px solid var(--wzpa-li-border-color);padding:10px;border-radius:var(--wzpa-li-border-radius);background-color:var(--wzpa-li-background-color);font-size:var(--wzpa-li-font-size);align-items:start;justify-content:start;}.wzpa_authors.wzpa-left-thumbs li:hover{background-color:var(--wzpa-li-hover-color);box-shadow:var(--wzpa-li-hover-shadow);}.wzpa_authors.wzpa-left-thumbs a{color:var(--wzpa-link-color);text-decoration:none;font-weight:bold;}.wzpa_authors.wzpa-left-thumbs a:hover{color:var(--wzpa-link-hover-color);}.wzpa_authors.wzpa-left-thumbs img{align-self:center;border-radius:var(--wzpa-author-img-radius);}@container wzpaLeftThumbs (width < 400px){.wzpa_authors.wzpa-left-thumbs li{flex-direction:column;text-align:center;align-items:center}}@container wzpaLeftThumbs (width>=400px){.wzpa_authors.wzpa-left-thumbs ul{grid-template-columns:repeat(auto-fit,minmax(var(--wzpa-min-column-width),max-content))}.wzpa_authors.wzpa-left-thumbs li{flex-direction:row}}
     1.wzpa-left-thumbs{--wzpa-font-family:inherit;--wzpa-margin:0;--wzpa-min-column-width:96px;--wzpa-max-column-width:1fr;--wzpa-grid-gap:10px;--wzpa-li-border-color:inherit;--wzpa-li-background-color:inherit;--wzpa-li-border-radius:10px;--wzpa-li-font-size:1rem;--wzpa-li-hover-color:#e0e0e0;--wzpa-li-hover-shadow:0 0 10px rgba(0, 0, 0, 0.1);--wzpa-link-color:#333333;--wzpa-link-hover-color:#000000;--wzpa-author-img-radius:50%}.wzpa_authors.wzpa-left-thumbs{font-family:var(--wzpa-font-family);margin:var(--wzpa-margin);container:wzpaLeftThumbs/inline-size}.wzpa_authors.wzpa-left-thumbs ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--wzpa-min-column-width),var(--wzpa-max-column-width)));grid-gap:var(--wzpa-grid-gap);grid-auto-rows:1fr;list-style:none;padding:0}.wzpa_authors.wzpa-left-thumbs li{display:flex;border:1px solid var(--wzpa-li-border-color);padding:10px;border-radius:var(--wzpa-li-border-radius);background-color:var(--wzpa-li-background-color);font-size:var(--wzpa-li-font-size);align-items:start;justify-content:start}.wzpa_authors.wzpa-left-thumbs li:hover{background-color:var(--wzpa-li-hover-color);box-shadow:var(--wzpa-li-hover-shadow)}.wzpa_authors.wzpa-left-thumbs a{color:var(--wzpa-link-color);text-decoration:none;font-weight:700}.wzpa_authors.wzpa-left-thumbs a:hover{color:var(--wzpa-link-hover-color)}.wzpa_authors.wzpa-left-thumbs img{align-self:center;border-radius:var(--wzpa-author-img-radius)}@container wzpaLeftThumbs (width < 400px){.wzpa_authors.wzpa-left-thumbs li{flex-direction:column;text-align:center;align-items:center}}@container wzpaLeftThumbs (width >=400px){.wzpa_authors.wzpa-left-thumbs ul{grid-template-columns:repeat(auto-fit,minmax(var(--wzpa-min-column-width),max-content))}.wzpa_authors.wzpa-left-thumbs li{flex-direction:row}}
  • popular-authors/trunk/includes/frontend/blocks/build/popular-authors/block.json

    r3224591 r3477391  
    4646      "default": false
    4747    },
     48    "showPostCount": {
     49      "type": "boolean",
     50      "default": false
     51    },
    4852    "showFullName": {
    4953      "type": "boolean",
  • popular-authors/trunk/includes/frontend/blocks/build/popular-authors/index.asset.php

    r3224591 r3477391  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => 'c2eeaa6e0fe57786bfb3');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-i18n', 'wp-server-side-render'), 'version' => '964020e2ceb9bd81a580');
  • popular-authors/trunk/includes/frontend/blocks/build/popular-authors/index.js

    r3224591 r3477391  
    1 (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var l in a)e.o(a,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:a[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,a=window.React,l=window.wp.i18n,r=window.wp.serverSideRender;var o=e.n(r);const n=window.wp.blockEditor,u=window.wp.components,s=(e,t,a)=>()=>{e({[a]:!t[a]})},p=(e,t)=>a=>{["number","offset","daily_range","hour_range"].includes(t)&&(a=""===a?0:parseInt(a,10)),e({[t]:a})},i=({attributes:e,setAttributes:t})=>{const{number:r,offset:o,showOptionCount:n}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextControl,{type:"number",label:(0,l.__)("Max authors to display","popular-authors"),value:r,onChange:p(t,"number"),help:(0,l.__)("Value -1 (all authors) is supported, but should be used with caution on larger sites.","popular-authors"),min:-1})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextControl,{type:"number",label:(0,l.__)("Offset","popular-authors"),value:o,onChange:p(t,"offset"),help:(0,l.__)("Number of authors to offset in retrieved results. Only applies if number of authors set above is >0","popular-authors"),min:0})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.ToggleControl,{label:(0,l.__)("Show count","popular-authors"),help:n?(0,l.__)("Count displayed","popular-authors"):(0,l.__)("No count displayed","popular-authors"),checked:n,onChange:s(t,e,"showOptionCount")})))},h=({attributes:e,setAttributes:t})=>{const{daily:r,daily_range:o,hour_range:n}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.ToggleControl,{label:(0,l.__)("Custom period?","top-10"),help:r?(0,l.__)("Set range below","top-10"):(0,l.__)("Overall popular posts will be shown","top-10"),checked:r,onChange:s(t,e,"daily")})),r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextControl,{type:"number",label:(0,l.__)("Daily range","top-10"),value:o,onChange:p(t,"daily_range"),help:(0,l.__)("Number of days","top-10"),min:0})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextControl,{type:"number",label:(0,l.__)("Hour range","top-10"),value:n,onChange:p(t,"hour_range"),help:(0,l.__)("Number of hours","top-10"),min:0}))))},c=({attributes:e,setAttributes:t})=>{const{showFullName:r,showAvatar:o,excludeAdmin:n,hideEmptyAuthors:i,include:h,exclude:c}=e;return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.ToggleControl,{label:(0,l.__)("Show Full Name","popular-authors"),help:r?(0,l.__)("Full Name is displayed","popular-authors"):(0,l.__)("Display Name is displayed","popular-authors"),checked:r,onChange:s(t,e,"showFullName")})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.ToggleControl,{label:(0,l.__)("Show Avatar","popular-authors"),help:o?(0,l.__)("Avatar displayed","popular-authors"):(0,l.__)("No avatar displayed","popular-authors"),checked:o,onChange:s(t,e,"showAvatar")})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.ToggleControl,{label:(0,l.__)("Exclude admin","popular-authors"),help:n?(0,l.__)("'admin' account is excluded","popular-authors"):(0,l.__)("'admin' account is included","popular-authors"),checked:n,onChange:s(t,e,"excludeAdmin")})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.ToggleControl,{label:(0,l.__)("Hide authors with no posts","popular-authors"),help:i?(0,l.__)("Authors with no posts are excluded","popular-authors"):(0,l.__)("Authors with no posts are included","popular-authors"),checked:i,onChange:s(t,e,"hideEmptyAuthors")})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextControl,{label:(0,l.__)("Author IDs to include","popular-authors"),value:h,onChange:p(t,"include"),help:(0,l.__)("Comma-separated list of author IDs to include. This has priority over exclude.","popular-authors")})),(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextControl,{label:(0,l.__)("Author IDs to exclude","popular-authors"),value:c,onChange:p(t,"exclude"),help:(0,l.__)("Comma-separated list of author IDs to exclude","popular-authors")})))},d=({attributes:e,setAttributes:t})=>{const{other_attributes:r}=e;return(0,a.createElement)(n.InspectorControls,{group:"advanced"},(0,a.createElement)(u.PanelRow,null,(0,a.createElement)(u.TextareaControl,{label:(0,l.__)("Other attributes","popular-authors"),value:r,onChange:p(t,"other_attributes"),help:(0,l.__)("Enter other attributes in a URL-style string-query.","popular-authors")})))},m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"popular-authors/popular-authors","version":"1.0.0","title":"Popular Authors","category":"design","icon":"admin-users","keywords":["popular authors","author","top 10"],"description":"Show the list of popular authors","supports":{"html":false},"example":{},"attributes":{"className":{"type":"string","default":""},"number":{"type":"number","default":0},"daily":{"type":"boolean","default":false},"daily_range":{"type":"number","default":1},"hour_range":{"type":"number","default":0},"offset":{"type":"number","default":0},"showOptionCount":{"type":"boolean","default":false},"showFullName":{"type":"boolean","default":false},"showAvatar":{"type":"boolean","default":false},"excludeAdmin":{"type":"boolean","default":false},"hideEmptyAuthors":{"type":"boolean","default":true},"include":{"type":"string","default":""},"exclude":{"type":"string","default":""},"other_attributes":{"type":"string","default":""}},"textdomain":"popular-authors","editorScript":"file:./index.js"}'),_=(0,a.createElement)("svg",{fill:"#0a0a0a",height:200,width:200,xmlns:"http://www.w3.org/2000/svg",viewBox:"-19.81 -19.81 237.77 237.77",xmlSpace:"preserve"},(0,a.createElement)("rect",{x:-19.81,y:-19.81,width:237.77,height:237.77,rx:0,fill:"#FFBD59"}),(0,a.createElement)("g",{strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.createElement)("path",{d:"M195.536 68.18a10 10 0 0 0-7.392-3.265H10A10 10 0 0 0 .043 75.842l9.505 102.099a10 10 0 0 0 9.957 9.073h159.134a10 10 0 0 0 9.957-9.073l9.505-102.099a10 10 0 0 0-2.565-7.662m-63.11 97.893H65.739c-5.523 0-10-4.478-10-10 0-13.58 11.048-24.628 24.628-24.628h7.177c-7.381-4.078-12.393-11.94-12.393-20.952 0-13.19 10.731-23.922 23.922-23.922s23.922 10.731 23.922 23.922c0 9.012-5.012 16.874-12.393 20.952h7.177c13.303 0 24.176 10.603 24.614 23.802q.033.409.034.826c-.001 5.523-4.478 10-10.001 10m46.48-119.775a7.5 7.5 0 0 1-7.5 7.5H26.739c-4.142 0-7.5-3.357-7.5-7.5s3.358-7.5 7.5-7.5h144.667a7.5 7.5 0 0 1 7.5 7.5m-19.8-27.667a7.5 7.5 0 0 1-7.5 7.5H46.539c-4.142 0-7.5-3.357-7.5-7.5s3.358-7.5 7.5-7.5h105.066a7.5 7.5 0 0 1 7.501 7.5"}));(0,t.registerBlockType)(m.name,{...m,icon:_,edit:function({attributes:e,setAttributes:t}){const r=(0,n.useBlockProps)();return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(n.InspectorControls,null,(0,a.createElement)(u.PanelBody,{title:(0,l.__)("Popular Authors Settings","popular-authors"),initialOpen:!0},(0,a.createElement)(i,{attributes:e,setAttributes:t}),(0,a.createElement)(h,{attributes:e,setAttributes:t}),(0,a.createElement)(c,{attributes:e,setAttributes:t}))),(0,a.createElement)(d,{attributes:e,setAttributes:t}),(0,a.createElement)("div",{...r},(0,a.createElement)(u.Disabled,null,(0,a.createElement)(o(),{block:"popular-authors/popular-authors",attributes:e}))))}})})();
     1(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,o=window.wp.i18n,r=window.wp.serverSideRender;var a=e.n(r);const s=window.wp.blockEditor,l=window.wp.components,n=(e,t,o)=>()=>{e({[o]:!t[o]})},u=(e,t)=>o=>{["number","offset","daily_range","hour_range"].includes(t)&&(o=""===o?0:parseInt(o,10)),e({[t]:o})},i=window.ReactJSXRuntime,h=({attributes:e,setAttributes:t})=>{const{number:r,offset:a,showOptionCount:s,showPostCount:h}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextControl,{type:"number",label:(0,o.__)("Max authors to display","popular-authors"),value:r,onChange:u(t,"number"),help:(0,o.__)("Value -1 (all authors) is supported, but should be used with caution on larger sites.","popular-authors"),min:-1})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextControl,{type:"number",label:(0,o.__)("Offset","popular-authors"),value:a,onChange:u(t,"offset"),help:(0,o.__)("Number of authors to offset in retrieved results. Only applies if number of authors set above is >0","popular-authors"),min:0})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Show views","popular-authors"),checked:s,onChange:n(t,e,"showOptionCount")})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Show number of posts","popular-authors"),checked:h,onChange:n(t,e,"showPostCount")})})]})},p=({attributes:e,setAttributes:t})=>{const{daily:r,daily_range:a,hour_range:s}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Custom period?","top-10"),help:r?(0,o.__)("Set range below","top-10"):(0,o.__)("Overall popular posts will be shown","top-10"),checked:r,onChange:n(t,e,"daily")})}),r&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextControl,{type:"number",label:(0,o.__)("Daily range","top-10"),value:a,onChange:u(t,"daily_range"),help:(0,o.__)("Number of days","top-10"),min:0})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextControl,{type:"number",label:(0,o.__)("Hour range","top-10"),value:s,onChange:u(t,"hour_range"),help:(0,o.__)("Number of hours","top-10"),min:0})})]})]})},d=({attributes:e,setAttributes:t})=>{const{showFullName:r,showAvatar:a,excludeAdmin:s,hideEmptyAuthors:h,include:p,exclude:d}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Show Full Name","popular-authors"),help:r?(0,o.__)("Full Name is displayed","popular-authors"):(0,o.__)("Display Name is displayed","popular-authors"),checked:r,onChange:n(t,e,"showFullName")})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Show Avatar","popular-authors"),checked:a,onChange:n(t,e,"showAvatar")})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Exclude admin","popular-authors"),checked:s,onChange:n(t,e,"excludeAdmin")})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.ToggleControl,{label:(0,o.__)("Hide authors with no posts","popular-authors"),checked:h,onChange:n(t,e,"hideEmptyAuthors")})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextControl,{label:(0,o.__)("Author IDs to include","popular-authors"),value:p,onChange:u(t,"include"),help:(0,o.__)("Comma-separated list of author IDs to include. This has priority over exclude.","popular-authors")})}),(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextControl,{label:(0,o.__)("Author IDs to exclude","popular-authors"),value:d,onChange:u(t,"exclude"),help:(0,o.__)("Comma-separated list of author IDs to exclude","popular-authors")})})]})},c=({attributes:e,setAttributes:t})=>{const{other_attributes:r}=e;return(0,i.jsx)(s.InspectorControls,{group:"advanced",children:(0,i.jsx)(l.PanelRow,{children:(0,i.jsx)(l.TextareaControl,{label:(0,o.__)("Other attributes","popular-authors"),value:r,onChange:u(t,"other_attributes"),help:(0,o.__)("Enter other attributes in a URL-style string-query.","popular-authors")})})})},b=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"popular-authors/popular-authors","version":"1.0.0","title":"Popular Authors","category":"design","icon":"admin-users","keywords":["popular authors","author","top 10"],"description":"Show the list of popular authors","supports":{"html":false},"example":{},"attributes":{"className":{"type":"string","default":""},"number":{"type":"number","default":0},"daily":{"type":"boolean","default":false},"daily_range":{"type":"number","default":1},"hour_range":{"type":"number","default":0},"offset":{"type":"number","default":0},"showOptionCount":{"type":"boolean","default":false},"showPostCount":{"type":"boolean","default":false},"showFullName":{"type":"boolean","default":false},"showAvatar":{"type":"boolean","default":false},"excludeAdmin":{"type":"boolean","default":false},"hideEmptyAuthors":{"type":"boolean","default":true},"include":{"type":"string","default":""},"exclude":{"type":"string","default":""},"other_attributes":{"type":"string","default":""}},"textdomain":"popular-authors","editorScript":"file:./index.js"}'),x=(0,i.jsxs)("svg",{fill:"#0a0a0a",height:200,width:200,xmlns:"http://www.w3.org/2000/svg",viewBox:"-19.81 -19.81 237.77 237.77",xmlSpace:"preserve",children:[(0,i.jsx)("rect",{x:-19.81,y:-19.81,width:237.77,height:237.77,rx:0,fill:"#FFBD59"}),(0,i.jsx)("g",{strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M195.536 68.18a10 10 0 0 0-7.392-3.265H10A10 10 0 0 0 .043 75.842l9.505 102.099a10 10 0 0 0 9.957 9.073h159.134a10 10 0 0 0 9.957-9.073l9.505-102.099a10 10 0 0 0-2.565-7.662m-63.11 97.893H65.739c-5.523 0-10-4.478-10-10 0-13.58 11.048-24.628 24.628-24.628h7.177c-7.381-4.078-12.393-11.94-12.393-20.952 0-13.19 10.731-23.922 23.922-23.922s23.922 10.731 23.922 23.922c0 9.012-5.012 16.874-12.393 20.952h7.177c13.303 0 24.176 10.603 24.614 23.802q.033.409.034.826c-.001 5.523-4.478 10-10.001 10m46.48-119.775a7.5 7.5 0 0 1-7.5 7.5H26.739c-4.142 0-7.5-3.357-7.5-7.5s3.358-7.5 7.5-7.5h144.667a7.5 7.5 0 0 1 7.5 7.5m-19.8-27.667a7.5 7.5 0 0 1-7.5 7.5H46.539c-4.142 0-7.5-3.357-7.5-7.5s3.358-7.5 7.5-7.5h105.066a7.5 7.5 0 0 1 7.501 7.5"})]});(0,t.registerBlockType)(b.name,{...b,icon:x,edit:function({attributes:e,setAttributes:t}){const r=(0,s.useBlockProps)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.InspectorControls,{children:(0,i.jsxs)(l.PanelBody,{title:(0,o.__)("Popular Authors Settings","popular-authors"),initialOpen:!0,children:[(0,i.jsx)(h,{attributes:e,setAttributes:t}),(0,i.jsx)(p,{attributes:e,setAttributes:t}),(0,i.jsx)(d,{attributes:e,setAttributes:t})]})}),(0,i.jsx)(c,{attributes:e,setAttributes:t}),(0,i.jsx)("div",{...r,children:(0,i.jsx)(l.Disabled,{children:(0,i.jsx)(a(),{block:"popular-authors/popular-authors",attributes:e})})})]})}})})();
  • popular-authors/trunk/includes/frontend/blocks/build/popular-posts/index.asset.php

    r3224591 r3477391  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-i18n', 'wp-server-side-render'), 'version' => '0d809f8972a2f960ecc8');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-i18n', 'wp-server-side-render'), 'version' => '5ed08eb6caa18a5212b1');
  • popular-authors/trunk/includes/frontend/blocks/build/popular-posts/index.js

    r3224591 r3477391  
    1 (()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var o in a)e.o(a,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:a[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,a=window.React,o=(0,a.createElement)("svg",{fill:"#0a0a0a",xmlns:"http://www.w3.org/2000/svg",viewBox:"-47.45 -47.45 569.4 569.4",xmlSpace:"preserve"},(0,a.createElement)("rect",{x:-47.45,y:-47.45,width:569.4,height:569.4,rx:0,fill:"#FFBD59"}),(0,a.createElement)("g",{strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.createElement)("path",{d:"M120.252 169c15.843 11.233 33.784 17.167 51.879 17.167 23.687 0 47.017-9.958 65.688-28.043 4.979-4.827 10.189-10.468 11.591-12.131a14.4 14.4 0 0 0 1.646-2.476c17.936-33.883 14.934-68.928-8.227-96.151-5.497-6.457-10.369-11.933-12.121-13.627-.901-.868-2.008-1.645-3.283-2.3-16.123-8.292-32.451-12.5-48.53-12.5-22.099 0-43.439 7.836-63.416 23.285a12.8 12.8 0 0 0-2.283 2.247c-1.424 1.836-6.033 8.127-10.146 14.157C76.479 97.605 83.556 142.99 120.252 169m11.501-105.188c.406-.432.769-.883 1.102-1.34 1.404-1.945 7.426-7.185 14.416-10.697 15.282-7.681 32.388-9.328 49.435-4.783 7.992 2.133 19.042 8.955 24.62 15.208 14.429 16.161 18.984 34.974 13.178 54.398-2.184 7.305-5.746 13.784-6.965 15.068-13.238 17.778-31.77 27.424-52.417 27.424-25.21 0-49.13-14.665-58.166-35.668-4.852-11.288-9.396-34.053 14.797-59.61m214.605 222.542c-8.18.208-15.935.427-22.901.66.143 2.488.32 4.986.447 7.475 1.193 24.521 1.976 49.048 2.579 73.59.335 13.903.462 27.807.528 41.711-16.417.015-32.819.188-49.221 1.035-.884-35.159-2.671-79.236-4.148-105.602-.808-14.432-23.318-14.513-22.506 0 1.833 32.764 4.164 93.019 4.621 129.347-51.56-.193-103.116-1.006-154.678-1.184-.16-36.19-.843-94.439-.904-126.294-.025-14.513-22.531-14.513-22.505 0 .045 23.714.437 62.083.703 95.075-18.184.838-36.383 1.021-54.583 1.051-2.544-50.525-.589-101.042.421-151.604 4.581-9.449 11.824-16.328 21.896-19.646 31.91-3.361 63.987-4.74 96.06-5.21 32.194-.467 64.391.016 96.578.355 11.44.12 22.871-.033 34.312-.089 3.147-6.058 7.362-9.006 11.004-10.404-4.905-2.288-8.542-6.724-11.01-12.256-7.616.16-15.238.427-22.77.358-16.559-.15-33.116-.368-49.672-.515-33.134-.29-66.288-.279-99.396 1.206-18.583.838-37.153 2.127-55.652 4.093-1.419-.16-2.966-.046-4.634.464-16.09 4.913-29.744 15.958-36.727 31.427a15.2 15.2 0 0 0-1.244 4.388c-.731 1.427-1.196 3.093-1.231 5.042-1.056 53.786-3.291 107.512 0 161.277.287 4.626 2.808 7.759 6.058 9.425 1.663 1.584 3.94 2.63 6.911 2.63 21.287 0 42.566-.092 63.828-1.076.046 7.14.079 13.767.089 19.479.005 1.991.457 3.672 1.186 5.119 1.277 3.65 4.431 6.565 9.463 6.57 60.179.071 120.351 1.239 180.527 1.311 9.414.01 12.238-10.146 8.521-16.315-.021-2.377-.051-4.9-.086-7.516 17.229-.878 34.479-1.021 51.744-1.021 2.722 0 4.87-.884 6.5-2.244 6.18.924 13.147-2.646 13.132-10.725-.071-35.222-1.478-70.325-2.574-105.521-.264-8.601-.396-17.234-.666-25.866m-58.406-139.39c1.03.521 2.229.838 3.646.838.381 0 .782-.028 1.198-.074 20.927-2.506 149.801-3.801 170.834-5.04 12.812-.754 8.475-16.676 8.562-24.616.102-8.736 4.895-24.028-9.882-24.028-21.424 0-150.658.094-172.088 1.259-11.857.645-9.039 13.188-8.282 21.36.878 9.443-4.784 24.839 6.012 30.301m165.999-34.013s-2.225 6.246.381 11.408c-14.849.906-137.532 1.944-152.319 3.479.152-8.877-2.133-14.059-2.133-14.059 15.401-.619 138.659-.797 154.071-.828m10.714 47.594c-21.398-1.166-150.658-1.257-172.087-1.257-15.249 0-16.646 33.72-7.525 44.973 1.716 2.115 3.768 3.529 6.205 3.672 3.869.229 11.415.457 21.241.695 43.584 1.062 132.515 2.298 149.592 4.342a9 9 0 0 0 1.198.074c1.412 0 2.61-.317 3.642-.838 4.352-2.199 5.748-5.215 5.997-8.668.324-4.601-1.401-9.978-.904-15.213.62-6.515 4.864-16.704.595-22.668-1.383-2.756-4.023-4.899-7.954-5.112m-11.791 32.542c-14.792-1.536-137.471-2.574-152.323-3.479 2.609-5.159.381-11.41.381-11.41 15.411.03 138.669.208 154.07.828.005 0-2.285 5.18-2.128 14.061"}),(0,a.createElement)("path",{d:"M469.043 227.374c-1.523-1.701-3.763-2.838-6.733-2.838-14.808 0-81.07.045-127.691.457-20.854.183-37.79.441-44.412.802-1.346.071-2.508.557-3.6 1.201-11.918 7.066-8.902 45.278 1.341 50.457 1.03.523 2.229.838 3.646.838q.573-.001 1.198-.071c4.937-.594 15.925-1.117 30.042-1.584a2934 2934 0 0 1 23.089-.67c45.438-1.158 104.104-1.98 117.702-2.783 13.808-.822 8.506-25.958 10.304-35.434.918-4.805-1.525-8.466-4.886-10.375m-124.558 29.579c-8.46.172-16.245.345-22.846.527-9.603.265-16.723.549-19.627.849.152-8.877-2.133-14.062-2.133-14.062 2.93-.121 9.791-.218 19.053-.305 6.738-.061 14.771-.121 23.501-.172 42.289-.244 101.174-.325 111.518-.351 0 0-2.225 6.246.381 11.41-9.917.611-67.989 1.276-109.847 2.104"})),l=window.wp.i18n,r=window.wp.components,n=window.wp.blockEditor,s=window.wp.serverSideRender;var p=e.n(s);const u=window.wp.data;window.wp.coreData;const i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"popular-authors/popular-posts","version":"1.0.0","title":"Popular Posts by Author","category":"design","icon":"admin-users","keywords":["popular posts","post","author"],"description":"Show the list of popular posts by author","supports":{"html":false},"example":{},"attributes":{"className":{"type":"string","default":""},"author":{"type":"string","default":""},"postsPerPage":{"type":"number","default":10},"postType":{"type":"string","default":"post"},"orderby":{"type":"string","default":"visits"},"order":{"type":"string","default":"DESC"},"daily":{"type":"boolean","default":false},"dailyRange":{"type":"number","default":1},"hourRange":{"type":"number","default":0},"showOptionCount":{"type":"boolean","default":false},"other_attributes":{"type":"string","default":""}},"textdomain":"popular-authors","editorScript":"file:./index.js"}');(0,t.registerBlockType)("popular-authors/popular-posts",{...i,icon:o,edit:function(e){const{attributes:t,setAttributes:o}=e,s=(0,n.useBlockProps)(),{author:i,postsPerPage:c,postType:d,orderby:m,order:h,daily:g,dailyRange:_,hourRange:b,showOptionCount:y}=t,{authors:w,isLoading:f,postTypes:v,postTypeMap:E}=(0,u.useSelect)((e=>{const{getUsers:t}=e("core"),{getPostTypes:a}=e("core"),o={per_page:-1,has_published_posts:!0,context:"edit"},l={},r=a({per_page:-1})?.filter((e=>e.viewable))||[];return r.forEach((e=>{l[e.slug]=e.name})),{authors:t(o),isLoading:!e("core").hasFinishedResolution("getUsers",[o]),postTypes:r,postTypeMap:l}}),[]),C=d?d.split(","):["post"],S=v?.map((e=>({value:e.slug,label:e.name})))||[];return(0,a.createElement)("div",{...s},(0,a.createElement)(n.InspectorControls,null,(0,a.createElement)(r.PanelBody,{title:(0,l.__)("Settings","popular-authors")},f?(0,a.createElement)(r.Spinner,null):(0,a.createElement)(r.SelectControl,{label:(0,l.__)("Author","popular-authors"),value:i,options:[{label:(0,l.__)("Select an author","popular-authors"),value:""},...w?w.map((e=>{let t="";return t=e.first_name&&e.last_name?`${e.first_name} ${e.last_name}`:e.first_name?e.first_name:e.last_name?e.last_name:e.display_name?e.display_name:e.name,{label:t,value:e.id.toString()}})):[]],onChange:e=>{o({author:e,field:"id"})}}),(0,a.createElement)(r.RangeControl,{label:(0,l.__)("Number of posts","popular-authors"),value:c,onChange:e=>o({postsPerPage:e}),min:1,max:100}),(0,a.createElement)(r.FormTokenField,{label:(0,l.__)("Post Types","popular-authors"),value:C.map((e=>S.find((t=>t.value===e))?.label||e)),suggestions:S.map((e=>e.label)),onChange:e=>{const t=e.map((e=>S.find((t=>t.label===e))?.value||e));o({postType:t.join(",")})},__experimentalShowHowTo:!1,__experimentalExpandOnFocus:!0}),(0,a.createElement)(r.SelectControl,{label:(0,l.__)("Order By","popular-authors"),value:m,options:[{label:(0,l.__)("Visits","popular-authors"),value:"visits"},{label:(0,l.__)("Date","popular-authors"),value:"date"},{label:(0,l.__)("Title","popular-authors"),value:"title"}],onChange:e=>o({orderby:e})}),(0,a.createElement)(r.SelectControl,{label:(0,l.__)("Order","popular-authors"),value:h,options:[{label:(0,l.__)("Descending","popular-authors"),value:"DESC"},{label:(0,l.__)("Ascending","popular-authors"),value:"ASC"}],onChange:e=>o({order:e})}),(0,a.createElement)(r.ToggleControl,{label:(0,l.__)("Custom period?","popular-authors"),checked:g,onChange:e=>o({daily:e})}),g&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(r.RangeControl,{label:(0,l.__)("Number of days","popular-authors"),value:_,onChange:e=>o({dailyRange:e})}),(0,a.createElement)(r.RangeControl,{label:(0,l.__)("Number of hours","popular-authors"),value:b,onChange:e=>o({hourRange:e}),max:24})),(0,a.createElement)(r.ToggleControl,{label:(0,l.__)("Display post count?","popular-authors"),checked:y,onChange:e=>o({showOptionCount:e})}))),(0,a.createElement)("div",{...s},(0,a.createElement)(r.Disabled,null,(0,a.createElement)(p(),{block:"popular-authors/popular-posts",attributes:t}))))}})})();
     1(()=>{"use strict";var e={n:a=>{var o=a&&a.__esModule?()=>a.default:()=>a;return e.d(o,{a:o}),o},d:(a,o)=>{for(var t in o)e.o(o,t)&&!e.o(a,t)&&Object.defineProperty(a,t,{enumerable:!0,get:o[t]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a)};const a=window.wp.blocks,o=window.ReactJSXRuntime,t=(0,o.jsxs)("svg",{fill:"#0a0a0a",xmlns:"http://www.w3.org/2000/svg",viewBox:"-47.45 -47.45 569.4 569.4",xmlSpace:"preserve",children:[(0,o.jsx)("rect",{x:-47.45,y:-47.45,width:569.4,height:569.4,rx:0,fill:"#FFBD59"}),(0,o.jsx)("g",{strokeLinecap:"round",strokeLinejoin:"round"}),(0,o.jsx)("path",{d:"M120.252 169c15.843 11.233 33.784 17.167 51.879 17.167 23.687 0 47.017-9.958 65.688-28.043 4.979-4.827 10.189-10.468 11.591-12.131a14.4 14.4 0 0 0 1.646-2.476c17.936-33.883 14.934-68.928-8.227-96.151-5.497-6.457-10.369-11.933-12.121-13.627-.901-.868-2.008-1.645-3.283-2.3-16.123-8.292-32.451-12.5-48.53-12.5-22.099 0-43.439 7.836-63.416 23.285a12.8 12.8 0 0 0-2.283 2.247c-1.424 1.836-6.033 8.127-10.146 14.157C76.479 97.605 83.556 142.99 120.252 169m11.501-105.188c.406-.432.769-.883 1.102-1.34 1.404-1.945 7.426-7.185 14.416-10.697 15.282-7.681 32.388-9.328 49.435-4.783 7.992 2.133 19.042 8.955 24.62 15.208 14.429 16.161 18.984 34.974 13.178 54.398-2.184 7.305-5.746 13.784-6.965 15.068-13.238 17.778-31.77 27.424-52.417 27.424-25.21 0-49.13-14.665-58.166-35.668-4.852-11.288-9.396-34.053 14.797-59.61m214.605 222.542c-8.18.208-15.935.427-22.901.66.143 2.488.32 4.986.447 7.475 1.193 24.521 1.976 49.048 2.579 73.59.335 13.903.462 27.807.528 41.711-16.417.015-32.819.188-49.221 1.035-.884-35.159-2.671-79.236-4.148-105.602-.808-14.432-23.318-14.513-22.506 0 1.833 32.764 4.164 93.019 4.621 129.347-51.56-.193-103.116-1.006-154.678-1.184-.16-36.19-.843-94.439-.904-126.294-.025-14.513-22.531-14.513-22.505 0 .045 23.714.437 62.083.703 95.075-18.184.838-36.383 1.021-54.583 1.051-2.544-50.525-.589-101.042.421-151.604 4.581-9.449 11.824-16.328 21.896-19.646 31.91-3.361 63.987-4.74 96.06-5.21 32.194-.467 64.391.016 96.578.355 11.44.12 22.871-.033 34.312-.089 3.147-6.058 7.362-9.006 11.004-10.404-4.905-2.288-8.542-6.724-11.01-12.256-7.616.16-15.238.427-22.77.358-16.559-.15-33.116-.368-49.672-.515-33.134-.29-66.288-.279-99.396 1.206-18.583.838-37.153 2.127-55.652 4.093-1.419-.16-2.966-.046-4.634.464-16.09 4.913-29.744 15.958-36.727 31.427a15.2 15.2 0 0 0-1.244 4.388c-.731 1.427-1.196 3.093-1.231 5.042-1.056 53.786-3.291 107.512 0 161.277.287 4.626 2.808 7.759 6.058 9.425 1.663 1.584 3.94 2.63 6.911 2.63 21.287 0 42.566-.092 63.828-1.076.046 7.14.079 13.767.089 19.479.005 1.991.457 3.672 1.186 5.119 1.277 3.65 4.431 6.565 9.463 6.57 60.179.071 120.351 1.239 180.527 1.311 9.414.01 12.238-10.146 8.521-16.315-.021-2.377-.051-4.9-.086-7.516 17.229-.878 34.479-1.021 51.744-1.021 2.722 0 4.87-.884 6.5-2.244 6.18.924 13.147-2.646 13.132-10.725-.071-35.222-1.478-70.325-2.574-105.521-.264-8.601-.396-17.234-.666-25.866m-58.406-139.39c1.03.521 2.229.838 3.646.838.381 0 .782-.028 1.198-.074 20.927-2.506 149.801-3.801 170.834-5.04 12.812-.754 8.475-16.676 8.562-24.616.102-8.736 4.895-24.028-9.882-24.028-21.424 0-150.658.094-172.088 1.259-11.857.645-9.039 13.188-8.282 21.36.878 9.443-4.784 24.839 6.012 30.301m165.999-34.013s-2.225 6.246.381 11.408c-14.849.906-137.532 1.944-152.319 3.479.152-8.877-2.133-14.059-2.133-14.059 15.401-.619 138.659-.797 154.071-.828m10.714 47.594c-21.398-1.166-150.658-1.257-172.087-1.257-15.249 0-16.646 33.72-7.525 44.973 1.716 2.115 3.768 3.529 6.205 3.672 3.869.229 11.415.457 21.241.695 43.584 1.062 132.515 2.298 149.592 4.342a9 9 0 0 0 1.198.074c1.412 0 2.61-.317 3.642-.838 4.352-2.199 5.748-5.215 5.997-8.668.324-4.601-1.401-9.978-.904-15.213.62-6.515 4.864-16.704.595-22.668-1.383-2.756-4.023-4.899-7.954-5.112m-11.791 32.542c-14.792-1.536-137.471-2.574-152.323-3.479 2.609-5.159.381-11.41.381-11.41 15.411.03 138.669.208 154.07.828.005 0-2.285 5.18-2.128 14.061"}),(0,o.jsx)("path",{d:"M469.043 227.374c-1.523-1.701-3.763-2.838-6.733-2.838-14.808 0-81.07.045-127.691.457-20.854.183-37.79.441-44.412.802-1.346.071-2.508.557-3.6 1.201-11.918 7.066-8.902 45.278 1.341 50.457 1.03.523 2.229.838 3.646.838q.573-.001 1.198-.071c4.937-.594 15.925-1.117 30.042-1.584a2934 2934 0 0 1 23.089-.67c45.438-1.158 104.104-1.98 117.702-2.783 13.808-.822 8.506-25.958 10.304-35.434.918-4.805-1.525-8.466-4.886-10.375m-124.558 29.579c-8.46.172-16.245.345-22.846.527-9.603.265-16.723.549-19.627.849.152-8.877-2.133-14.062-2.133-14.062 2.93-.121 9.791-.218 19.053-.305 6.738-.061 14.771-.121 23.501-.172 42.289-.244 101.174-.325 111.518-.351 0 0-2.225 6.246.381 11.41-9.917.611-67.989 1.276-109.847 2.104"})]}),s=window.wp.i18n,r=window.wp.components,l=window.wp.blockEditor,n=window.wp.serverSideRender;var p=e.n(n);const u=window.wp.data;window.wp.coreData;const i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"popular-authors/popular-posts","version":"1.0.0","title":"Popular Posts by Author","category":"design","icon":"admin-users","keywords":["popular posts","post","author"],"description":"Show the list of popular posts by author","supports":{"html":false},"example":{},"attributes":{"className":{"type":"string","default":""},"author":{"type":"string","default":""},"postsPerPage":{"type":"number","default":10},"postType":{"type":"string","default":"post"},"orderby":{"type":"string","default":"visits"},"order":{"type":"string","default":"DESC"},"daily":{"type":"boolean","default":false},"dailyRange":{"type":"number","default":1},"hourRange":{"type":"number","default":0},"showOptionCount":{"type":"boolean","default":false},"other_attributes":{"type":"string","default":""}},"textdomain":"popular-authors","editorScript":"file:./index.js"}');(0,a.registerBlockType)("popular-authors/popular-posts",{...i,icon:t,edit:function(e){const{attributes:a,setAttributes:t}=e,n=(0,l.useBlockProps)(),{author:i,postsPerPage:d,postType:h,orderby:c,order:g,daily:_,dailyRange:m,hourRange:b,showOptionCount:y}=a,{authors:w,isLoading:x,postTypes:f,postTypeMap:v}=(0,u.useSelect)(e=>{const{getUsers:a}=e("core"),{getPostTypes:o}=e("core"),t={per_page:-1,has_published_posts:!0,context:"edit"},s={},r=o({per_page:-1})?.filter(e=>e.viewable)||[];return r.forEach(e=>{s[e.slug]=e.name}),{authors:a(t),isLoading:!e("core").hasFinishedResolution("getUsers",[t]),postTypes:r,postTypeMap:s}},[]),j=h?h.split(","):["post"],C=f?.map(e=>({value:e.slug,label:e.name}))||[];return(0,o.jsxs)("div",{...n,children:[(0,o.jsx)(l.InspectorControls,{children:(0,o.jsxs)(r.PanelBody,{title:(0,s.__)("Settings","popular-authors"),children:[x?(0,o.jsx)(r.Spinner,{}):(0,o.jsx)(r.SelectControl,{label:(0,s.__)("Author","popular-authors"),value:i,options:[{label:(0,s.__)("Select an author","popular-authors"),value:""},...w?w.map(e=>{let a="";return a=e.first_name&&e.last_name?`${e.first_name} ${e.last_name}`:e.first_name?e.first_name:e.last_name?e.last_name:e.display_name?e.display_name:e.name,{label:a,value:e.id.toString()}}):[]],onChange:e=>{t({author:e,field:"id"})}}),(0,o.jsx)(r.RangeControl,{label:(0,s.__)("Number of posts","popular-authors"),value:d,onChange:e=>t({postsPerPage:e}),min:1,max:100}),(0,o.jsx)(r.FormTokenField,{label:(0,s.__)("Post Types","popular-authors"),value:j.map(e=>C.find(a=>a.value===e)?.label||e),suggestions:C.map(e=>e.label),onChange:e=>{const a=e.map(e=>C.find(a=>a.label===e)?.value||e);t({postType:a.join(",")})},__experimentalShowHowTo:!1,__experimentalExpandOnFocus:!0}),(0,o.jsx)(r.SelectControl,{label:(0,s.__)("Order By","popular-authors"),value:c,options:[{label:(0,s.__)("Visits","popular-authors"),value:"visits"},{label:(0,s.__)("Date","popular-authors"),value:"date"},{label:(0,s.__)("Title","popular-authors"),value:"title"}],onChange:e=>t({orderby:e})}),(0,o.jsx)(r.SelectControl,{label:(0,s.__)("Order","popular-authors"),value:g,options:[{label:(0,s.__)("Descending","popular-authors"),value:"DESC"},{label:(0,s.__)("Ascending","popular-authors"),value:"ASC"}],onChange:e=>t({order:e})}),(0,o.jsx)(r.ToggleControl,{label:(0,s.__)("Custom period?","popular-authors"),checked:_,onChange:e=>t({daily:e})}),_&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.RangeControl,{label:(0,s.__)("Number of days","popular-authors"),value:m,onChange:e=>t({dailyRange:e})}),(0,o.jsx)(r.RangeControl,{label:(0,s.__)("Number of hours","popular-authors"),value:b,onChange:e=>t({hourRange:e}),max:24})]}),(0,o.jsx)(r.ToggleControl,{label:(0,s.__)("Display post count?","popular-authors"),checked:y,onChange:e=>t({showOptionCount:e})})]})}),(0,o.jsx)("div",{...n,children:(0,o.jsx)(r.Disabled,{children:(0,o.jsx)(p(),{block:"popular-authors/popular-posts",attributes:a})})})]})}})})();
  • popular-authors/trunk/includes/frontend/blocks/class-blocks.php

    r3224591 r3477391  
    1010use WebberZone\Popular_Authors\Frontend\Display;
    1111use WebberZone\Popular_Authors\Frontend\Styles_Handler;
     12use WebberZone\Popular_Authors\Util\Hook_Registry;
    1213
    1314if ( ! defined( 'WPINC' ) ) {
     
    2627     */
    2728    public function __construct() {
    28         add_action( 'init', array( $this, 'register_blocks' ) );
    29         add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) );
     29        Hook_Registry::add_action( 'init', array( $this, 'register_blocks' ) );
     30        Hook_Registry::add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_editor_assets' ) );
     31    }
     32
     33    /**
     34     * Enqueue block editor assets.
     35     *
     36     * @since 1.4.0
     37     */
     38    public function enqueue_editor_assets() {
     39        $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
     40
     41        $style_array = Styles_Handler::get_style();
     42
     43        if ( ! empty( $style_array['name'] ) ) {
     44            $style     = $style_array['name'];
     45            $extra_css = $style_array['extra_css'];
     46
     47            wp_enqueue_style(
     48                "wzpa-editor-style-{$style}",
     49                plugins_url( "includes/css/{$style}{$suffix}.css", POP_AUTHOR_PLUGIN_FILE ),
     50                array(),
     51                POP_AUTHOR_VERSION
     52            );
     53
     54            if ( ! empty( $extra_css ) ) {
     55                wp_add_inline_style( "wzpa-editor-style-{$style}", $extra_css );
     56            }
     57        }
    3058    }
    3159
     
    83111
    84112        // Map block attributes to PHP attributes.
    85         $attributes['extra_class']   = isset( $attributes['className'] ) ? $attributes['className'] : '';
    86         $attributes['optioncount']   = $attributes['showOptionCount'];
    87         $attributes['show_fullname'] = $attributes['showFullName'];
    88         $attributes['show_avatar']   = $attributes['showAvatar'];
    89         $attributes['exclude_admin'] = $attributes['excludeAdmin'];
    90         $attributes['hide_empty']    = $attributes['hideEmptyAuthors'];
     113        $attributes['extra_class']    = $attributes['className'] ?? '';
     114        $attributes['optioncount']    = $attributes['showOptionCount'] ?? false;
     115        $attributes['show_postcount'] = $attributes['showPostCount'] ?? false;
     116        $attributes['show_fullname']  = $attributes['showFullName'] ?? false;
     117        $attributes['show_avatar']    = $attributes['showAvatar'] ?? false;
     118        $attributes['exclude_admin']  = $attributes['excludeAdmin'] ?? false;
     119        $attributes['hide_empty']     = $attributes['hideEmptyAuthors'] ?? true;
    91120
    92121        $arguments = array_merge(
     
    150179
    151180        $arguments = array(
    152             'extra_class'     => isset( $attributes['extra_class'] ) ? $attributes['extra_class'] : '',
    153             'posts_per_page'  => $attributes['postsPerPage'],
    154             'post_type'       => $attributes['postType'],
    155             'orderby'         => $attributes['orderby'],
    156             'order'           => $attributes['order'],
    157             'daily'           => $attributes['daily'],
    158             'daily_range'     => $attributes['dailyRange'],
    159             'hour_range'      => $attributes['hourRange'],
    160             'disp_list_count' => $attributes['showOptionCount'],
     181            'extra_class'     => $attributes['extra_class'] ?? '',
     182            'posts_per_page'  => $attributes['postsPerPage'] ?? 5,
     183            'post_type'       => $attributes['postType'] ?? 'post',
     184            'orderby'         => $attributes['orderby'] ?? 'comment_count',
     185            'order'           => $attributes['order'] ?? 'DESC',
     186            'daily'           => $attributes['daily'] ?? false,
     187            'daily_range'     => $attributes['dailyRange'] ?? 7,
     188            'hour_range'      => $attributes['hourRange'] ?? 24,
     189            'disp_list_count' => $attributes['showOptionCount'] ?? false,
    161190        );
    162191
     
    173202        return \wzpa_display_top_posts_by_author(
    174203            $attributes['author'],
    175             isset( $attributes['field'] ) ? $attributes['field'] : 'id',
     204            $attributes['field'] ?? 'id',
    176205            $arguments,
    177206            false
    178207        );
    179208    }
    180 
    181     /**
    182      * Enqueue scripts and styles for the block editor.
    183      *
    184      * @since 1.2.0
    185      */
    186     public static function enqueue_block_editor_assets() {
    187     }
    188209}
  • popular-authors/trunk/includes/frontend/blocks/src/popular-authors/block.json

    r3224591 r3477391  
    4242            "default": false
    4343        },
     44        "showPostCount": {
     45            "type": "boolean",
     46            "default": false
     47        },
    4448        "showFullName": {
    4549            "type": "boolean",
  • popular-authors/trunk/includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js

    r3224591 r3477391  
    3737                <ToggleControl
    3838                    label={__('Show Avatar', 'popular-authors')}
    39                     help={
    40                         showAvatar
    41                             ? __('Avatar displayed', 'popular-authors')
    42                             : __('No avatar displayed', 'popular-authors')
    43                     }
    4439                    checked={showAvatar}
    4540                    onChange={createAttributeToggle(
     
    5348                <ToggleControl
    5449                    label={__('Exclude admin', 'popular-authors')}
    55                     help={
    56                         excludeAdmin
    57                             ? __(
    58                                     "'admin' account is excluded",
    59                                     'popular-authors'
    60                                 )
    61                             : __(
    62                                     "'admin' account is included",
    63                                     'popular-authors'
    64                                 )
    65                     }
    6650                    checked={excludeAdmin}
    6751                    onChange={createAttributeToggle(
     
    7559                <ToggleControl
    7660                    label={__('Hide authors with no posts', 'popular-authors')}
    77                     help={
    78                         hideEmptyAuthors
    79                             ? __(
    80                                     'Authors with no posts are excluded',
    81                                     'popular-authors'
    82                                 )
    83                             : __(
    84                                     'Authors with no posts are included',
    85                                     'popular-authors'
    86                                 )
    87                     }
    8861                    checked={hideEmptyAuthors}
    8962                    onChange={createAttributeToggle(
  • popular-authors/trunk/includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js

    r3224591 r3477391  
    77
    88const DisplaySettings = ({ attributes, setAttributes }) => {
    9     const { number, offset, showOptionCount } = attributes;
     9    const { number, offset, showOptionCount, showPostCount } = attributes;
    1010
    1111    return (
     
    3939            <PanelRow>
    4040                <ToggleControl
    41                     label={__('Show count', 'popular-authors')}
    42                     help={
    43                         showOptionCount
    44                             ? __('Count displayed', 'popular-authors')
    45                             : __('No count displayed', 'popular-authors')
    46                     }
     41                    label={__('Show views', 'popular-authors')}
    4742                    checked={showOptionCount}
    4843                    onChange={createAttributeToggle(
     
    5348                />
    5449            </PanelRow>
     50            <PanelRow>
     51                <ToggleControl
     52                    label={__('Show number of posts', 'popular-authors')}
     53                    checked={showPostCount}
     54                    onChange={createAttributeToggle(
     55                        setAttributes,
     56                        attributes,
     57                        'showPostCount'
     58                    )}
     59                />
     60            </PanelRow>
    5561        </>
    5662    );
  • popular-authors/trunk/includes/frontend/class-display.php

    r3224591 r3477391  
    3434     * @since 1.2.0
    3535     *
    36      * @global wpdb $wpdb WordPress database abstraction object.
     36     * @global \wpdb $wpdb WordPress database abstraction object.
    3737     *
    3838     * @param array $args List of arguments. See self::list_popular_authors_args() for full list.
     
    6363        // Check if the cache is enabled and if the output exists. If so, return the output.
    6464        if ( $args['cache'] ) {
    65             $cache_name = \WebberZone\Top_Ten\Frontend\Display::cache_get_key( $args );
     65            $cache_name = self::cache_get_key( $args );
    6666
    6767            $output = get_transient( $cache_name );
     
    8484
    8585        // Set the post counts for each author.
    86         $post_counts       = array();
    87         $post_counts_query = $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . ' GROUP BY post_author' ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
     86        $post_counts = array();
     87        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
     88        $post_counts_query = $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . ' GROUP BY post_author' );
    8889
    8990        foreach ( (array) $post_counts_query as $row ) {
     
    188189                );
    189190
    190                 if ( $args['optioncount'] ) {
    191                     $link .= sprintf(
    192                         ' <span class="wzpa_optioncount">(%1$s)</span>',
    193                         number_format_i18n( $views )
    194                     );
     191                if ( $args['optioncount'] || $args['show_postcount'] ) {
     192                    $count_parts = array();
     193                    if ( $args['optioncount'] ) {
     194                        $count_parts[] = sprintf(
     195                            '<span class="wzpa_optioncount">%1$s</span>',
     196                            number_format_i18n( $views )
     197                        );
     198                    }
     199                    if ( $args['show_postcount'] ) {
     200                        $count_parts[] = sprintf(
     201                            '<span class="wzpa_postcount">%1$s</span>',
     202                            number_format_i18n( $no_of_posts )
     203                        );
     204                    }
     205                    $link .= ' (' . implode( ' / ', $count_parts ) . ')';
    195206                }
    196207                $link .= '</span>';
     
    235246     * @since 1.0.0
    236247     *
    237      * @global wpdb $wpdb WordPress database abstraction object.
     248     * @global \wpdb $wpdb WordPress database abstraction object.
    238249     *
    239250     * @param string|array $args {
     
    314325        $join .= " {$join_type} JOIN {$pop_posts_table} ON {$pop_posts_table}.postnumber={$posts_table}.ID AND {$pop_posts_table}.blog_id={$blog_id} ";
    315326
    316         // Create the WHERE clause.
     327        // Initialize prepare values array.
     328        $prepare_values = array();
     329
    317330        // Parse and sanitize 'include'.
    318331        if ( ! empty( $args['include'] ) ) {
     
    324337        // Parse include or exclude arguments. Include is always prioritised.
    325338        if ( ! empty( $include ) ) {
    326             $ids    = implode( ',', $include );
    327             $where .= " AND $wpdb->users.ID IN ($ids)";
     339            $placeholders   = array_fill( 0, count( $include ), '%d' );
     340            $where         .= " AND $wpdb->users.ID IN (" . implode( ',', $placeholders ) . ')';
     341            $prepare_values = array_merge( $prepare_values, $include );
    328342        } elseif ( ! empty( $args['exclude'] ) ) {
    329             $ids    = implode( ',', wp_parse_id_list( $args['exclude'] ) );
    330             $where .= " AND $wpdb->users.ID NOT IN ($ids)";
     343            $exclude        = wp_parse_id_list( $args['exclude'] );
     344            $placeholders   = array_fill( 0, count( $exclude ), '%d' );
     345            $where         .= " AND $wpdb->users.ID NOT IN (" . implode( ',', $placeholders ) . ')';
     346            $prepare_values = array_merge( $prepare_values, $exclude );
    331347        }
    332348
     
    334350            $from_date = \WebberZone\Top_Ten\Util\Helpers::get_from_date( null, (int) $args['daily_range'], (int) $args['hour_range'] );
    335351
    336             $where .= $wpdb->prepare( " AND {$pop_posts_table}.dp_date >= %s ", $from_date ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
     352            $where           .= " AND {$pop_posts_table}.dp_date >= %s ";
     353            $prepare_values[] = $from_date;
    337354        }
    338355
    339356        if ( $args['post_type'] ) {
    340             $post_type = wp_parse_list( $args['post_type'] );
    341             $where    .= " AND {$posts_table}.post_type IN ('" . implode( "', '", esc_sql( $post_type ) ) . "')";
     357            $post_type      = wp_parse_list( $args['post_type'] );
     358            $placeholders   = array_fill( 0, count( $post_type ), '%s' );
     359            $where         .= " AND {$posts_table}.post_type IN (" . implode( ',', $placeholders ) . ')';
     360            $prepare_values = array_merge( $prepare_values, $post_type );
    342361        }
    343362
     
    354373
    355374            if ( $offset ) {
    356                 $limits = $wpdb->prepare( 'LIMIT %d, %d', $offset, $number );
     375                $limits           = 'LIMIT %d, %d';
     376                $prepare_values[] = $offset;
     377                $prepare_values[] = $number;
    357378            } else {
    358                 $limits = $wpdb->prepare( 'LIMIT %d, %d', $number * ( $args['paged'] - 1 ), $number );
     379                $limits           = 'LIMIT %d, %d';
     380                $prepare_values[] = $number * ( $args['paged'] - 1 );
     381                $prepare_values[] = $number;
    359382            }
    360383        }
     
    423446        $limits = apply_filters_ref_array( 'wzpa_query_limits', array( $limits, $args ) );
    424447
     448        /**
     449         * Filters the prepare values for the query.
     450         *
     451         * @since 1.4.0
     452         *
     453         * @param array $prepare_values The prepare values array.
     454         * @param array $args           Arguments array.
     455         */
     456        $prepare_values = apply_filters( 'wzpa_query_prepare_values', $prepare_values, $args );
     457
    425458        // Create the mySQL statement.
    426459        $sql = "SELECT $fields FROM {$wpdb->users} $join WHERE 1=1 $where $groupby $orderby $limits";
     460
     461        if ( ! empty( $prepare_values ) ) {
     462            $sql = $wpdb->prepare( $sql, $prepare_values ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
     463        }
    427464
    428465        $results = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
     
    478515            'offset'           => '',
    479516            'optioncount'      => true,
     517            'show_postcount'   => false,
    480518            'exclude_admin'    => false,
    481519            'post_type'        => 'post',
     
    584622        return apply_filters( 'wzpa_get_avatar', $avatar, $author, $avatar_args );
    585623    }
     624
     625    /**
     626     * Generate cache key for the given arguments.
     627     *
     628     * @since 1.2.0
     629     *
     630     * @param array $args Arguments array.
     631     * @return string Cache key.
     632     */
     633    public static function cache_get_key( $args ) {
     634        return 'wzpa_' . md5( wp_json_encode( $args ) );
     635    }
    586636}
  • popular-authors/trunk/includes/frontend/class-shortcodes.php

    r3224591 r3477391  
    77
    88namespace WebberZone\Popular_Authors\Frontend;
     9
     10use WebberZone\Popular_Authors\Util\Hook_Registry;
    911
    1012if ( ! defined( 'WPINC' ) ) {
     
    2527     */
    2628    public function __construct() {
    27         add_shortcode( 'wzpa_popular_authors', array( __CLASS__, 'wzpa_popular_authors' ) );
    28         add_shortcode( 'wzpa_author_top_posts', array( __CLASS__, 'wzpa_author_top_posts' ) );
     29        Hook_Registry::add_action(
     30            'init',
     31            function () {
     32                add_shortcode( 'wzpa_popular_authors', array( __CLASS__, 'wzpa_popular_authors' ) );
     33                add_shortcode( 'wzpa_author_top_posts', array( __CLASS__, 'wzpa_author_top_posts' ) );
     34            }
     35        );
    2936    }
    3037
  • popular-authors/trunk/includes/frontend/class-styles-handler.php

    r3147782 r3477391  
    77
    88namespace WebberZone\Popular_Authors\Frontend;
     9
     10use WebberZone\Popular_Authors\Util\Hook_Registry;
    911
    1012if ( ! defined( 'WPINC' ) ) {
     
    2527     */
    2628    public function __construct() {
    27         add_action( 'wp_enqueue_scripts', array( __CLASS__, 'register_styles' ) );
     29        Hook_Registry::add_action( 'wp_enqueue_scripts', array( __CLASS__, 'register_styles' ) );
    2830    }
    2931
  • popular-authors/trunk/includes/frontend/widgets/class-authors-widget.php

    r2953495 r3477391  
    4545     */
    4646    public function form( $instance ) {
    47         $title         = isset( $instance['title'] ) ? $instance['title'] : '';
    48         $number        = isset( $instance['number'] ) ? $instance['number'] : '';
    49         $offset        = isset( $instance['offset'] ) ? $instance['offset'] : '';
    50         $daily         = isset( $instance['daily'] ) ? $instance['daily'] : 'overall';
    51         $daily_range   = isset( $instance['daily_range'] ) ? $instance['daily_range'] : '';
    52         $hour_range    = isset( $instance['hour_range'] ) ? $instance['hour_range'] : '';
    53         $optioncount   = isset( $instance['optioncount'] ) ? $instance['optioncount'] : '';
    54         $exclude_admin = isset( $instance['exclude_admin'] ) ? $instance['exclude_admin'] : '';
    55         $show_fullname = isset( $instance['show_fullname'] ) ? $instance['show_fullname'] : '';
    56         $show_avatar   = isset( $instance['show_avatar'] ) ? $instance['show_avatar'] : '';
     47        $title          = isset( $instance['title'] ) ? $instance['title'] : '';
     48        $number         = isset( $instance['number'] ) ? $instance['number'] : '';
     49        $offset         = isset( $instance['offset'] ) ? $instance['offset'] : '';
     50        $daily          = isset( $instance['daily'] ) ? $instance['daily'] : 'overall';
     51        $daily_range    = isset( $instance['daily_range'] ) ? $instance['daily_range'] : '';
     52        $hour_range     = isset( $instance['hour_range'] ) ? $instance['hour_range'] : '';
     53        $optioncount    = isset( $instance['optioncount'] ) ? $instance['optioncount'] : '';
     54        $show_postcount = isset( $instance['show_postcount'] ) ? $instance['show_postcount'] : '';
     55        $exclude_admin  = isset( $instance['exclude_admin'] ) ? $instance['exclude_admin'] : '';
     56        $show_fullname  = isset( $instance['show_fullname'] ) ? $instance['show_fullname'] : '';
     57        $show_avatar    = isset( $instance['show_avatar'] ) ? $instance['show_avatar'] : '';
    5758
    5859        ?>
     
    7576            <label for="<?php echo esc_attr( $this->get_field_id( 'optioncount' ) ); ?>">
    7677                <input id="<?php echo esc_attr( $this->get_field_id( 'optioncount' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'optioncount' ) ); ?>" type="checkbox" <?php checked( true, $optioncount, true ); ?> /> <?php esc_html_e( 'Show count', 'popular-authors' ); ?>
     78            </label>
     79        </p>
     80        <p>
     81            <label for="<?php echo esc_attr( $this->get_field_id( 'show_postcount' ) ); ?>">
     82                <input id="<?php echo esc_attr( $this->get_field_id( 'show_postcount' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'show_postcount' ) ); ?>" type="checkbox" <?php checked( true, $show_postcount, true ); ?> /> <?php esc_html_e( 'Show post count', 'popular-authors' ); ?>
    7783            </label>
    7884        </p>
     
    134140     */
    135141    public function update( $new_instance, $old_instance ) {
    136         $instance                  = $old_instance;
    137         $instance['title']         = wp_strip_all_tags( $new_instance['title'] );
    138         $instance['number']        = $new_instance['number'];
    139         $instance['offset']        = $new_instance['offset'];
    140         $instance['daily']         = $new_instance['daily'];
    141         $instance['daily_range']   = wp_strip_all_tags( $new_instance['daily_range'] );
    142         $instance['hour_range']    = wp_strip_all_tags( $new_instance['hour_range'] );
    143         $instance['optioncount']   = isset( $new_instance['optioncount'] ) ? (bool) $new_instance['optioncount'] : false;
    144         $instance['exclude_admin'] = isset( $new_instance['exclude_admin'] ) ? (bool) $new_instance['exclude_admin'] : false;
    145         $instance['show_fullname'] = isset( $new_instance['show_fullname'] ) ? (bool) $new_instance['show_fullname'] : false;
    146         $instance['show_avatar']   = isset( $new_instance['show_avatar'] ) ? (bool) $new_instance['show_avatar'] : false;
     142        $instance                   = $old_instance;
     143        $instance['title']          = wp_strip_all_tags( $new_instance['title'] );
     144        $instance['number']         = $new_instance['number'];
     145        $instance['offset']         = $new_instance['offset'];
     146        $instance['daily']          = $new_instance['daily'];
     147        $instance['daily_range']    = wp_strip_all_tags( $new_instance['daily_range'] );
     148        $instance['hour_range']     = wp_strip_all_tags( $new_instance['hour_range'] );
     149        $instance['optioncount']    = isset( $new_instance['optioncount'] ) ? (bool) $new_instance['optioncount'] : false;
     150        $instance['show_postcount'] = isset( $new_instance['show_postcount'] ) ? (bool) $new_instance['show_postcount'] : false;
     151        $instance['exclude_admin']  = isset( $new_instance['exclude_admin'] ) ? (bool) $new_instance['exclude_admin'] : false;
     152        $instance['show_fullname']  = isset( $new_instance['show_fullname'] ) ? (bool) $new_instance['show_fullname'] : false;
     153        $instance['show_avatar']    = isset( $new_instance['show_avatar'] ) ? (bool) $new_instance['show_avatar'] : false;
    147154
    148155        /**
     
    168175    public function widget( $args, $instance ) {
    169176
    170         $title         = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Popular Authors', 'popular-authors' ) : $instance['title'] );
    171         $number        = isset( $instance['number'] ) ? $instance['number'] : '';
    172         $offset        = isset( $instance['offset'] ) ? $instance['offset'] : 0;
    173         $daily         = ( isset( $instance['daily'] ) && ( 'daily' === $instance['daily'] ) ) ? true : false;
    174         $daily_range   = empty( $instance['daily_range'] ) ? null : $instance['daily_range'];
    175         $hour_range    = empty( $instance['hour_range'] ) ? null : $instance['hour_range'];
    176         $optioncount   = isset( $instance['optioncount'] ) ? esc_attr( $instance['optioncount'] ) : '';
    177         $exclude_admin = isset( $instance['exclude_admin'] ) ? esc_attr( $instance['exclude_admin'] ) : '';
    178         $show_fullname = isset( $instance['show_fullname'] ) ? esc_attr( $instance['show_fullname'] ) : '';
    179         $show_avatar   = isset( $instance['show_avatar'] ) ? esc_attr( $instance['show_avatar'] ) : '';
     177        $title          = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Popular Authors', 'popular-authors' ) : $instance['title'] );
     178        $number         = isset( $instance['number'] ) ? $instance['number'] : '';
     179        $offset         = isset( $instance['offset'] ) ? $instance['offset'] : 0;
     180        $daily          = ( isset( $instance['daily'] ) && ( 'daily' === $instance['daily'] ) ) ? true : false;
     181        $daily_range    = empty( $instance['daily_range'] ) ? null : $instance['daily_range'];
     182        $hour_range     = empty( $instance['hour_range'] ) ? null : $instance['hour_range'];
     183        $optioncount    = isset( $instance['optioncount'] ) ? esc_attr( $instance['optioncount'] ) : '';
     184        $show_postcount = isset( $instance['show_postcount'] ) ? esc_attr( $instance['show_postcount'] ) : '';
     185        $exclude_admin  = isset( $instance['exclude_admin'] ) ? esc_attr( $instance['exclude_admin'] ) : '';
     186        $show_fullname  = isset( $instance['show_fullname'] ) ? esc_attr( $instance['show_fullname'] ) : '';
     187        $show_avatar    = isset( $instance['show_avatar'] ) ? esc_attr( $instance['show_avatar'] ) : '';
    180188
    181189        /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
     
    183191
    184192        $arguments = array(
    185             'is_widget'     => 1,
    186             'instance_id'   => $args['widget_id'],
    187             'number'        => $number,
    188             'offset'        => $offset,
    189             'daily'         => $daily,
    190             'daily_range'   => $daily_range,
    191             'hour_range'    => $hour_range,
    192             'optioncount'   => $optioncount,
    193             'exclude_admin' => $exclude_admin,
    194             'show_fullname' => $show_fullname,
    195             'show_avatar'   => $show_avatar,
    196             'echo'          => false,
     193            'is_widget'      => 1,
     194            'instance_id'    => $args['widget_id'],
     195            'number'         => $number,
     196            'offset'         => $offset,
     197            'daily'          => $daily,
     198            'daily_range'    => $daily_range,
     199            'hour_range'     => $hour_range,
     200            'optioncount'    => $optioncount,
     201            'show_postcount' => $show_postcount,
     202            'exclude_admin'  => $exclude_admin,
     203            'show_fullname'  => $show_fullname,
     204            'show_avatar'    => $show_avatar,
     205            'echo'           => false,
    197206        );
    198207
  • popular-authors/trunk/languages/popular-authors-en_US.po

    r3224591 r3477391  
    33"Project-Id-Version: Popular Authors\n"
    44"Report-Msgid-Bugs-To: \n"
    5 "POT-Creation-Date: 2025-01-17 19:02+0000\n"
    6 "PO-Revision-Date: \n"
    75"Last-Translator: Ajay D'Souza\n"
    86"Language-Team: WebberZone\n"
    9 "Language: en\n"
    107"MIME-Version: 1.0\n"
    118"Content-Type: text/plain; charset=UTF-8\n"
    129"Content-Transfer-Encoding: 8bit\n"
    13 "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
    14 "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
    15 "_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
     10"POT-Creation-Date: 2025-01-17 19:02+0000\n"
     11"PO-Revision-Date: \n"
     12"Language: en\n"
     13"X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
    1614"X-Poedit-Basepath: ..\n"
    1715"X-Generator: Poedit 3.4.2\n"
     
    2018"X-Poedit-SearchPathExcluded-0: vendor/*\n"
    2119
    22 #: includes/admin/class-admin.php:48
     20#. translators: 1: Force regenerate plugin link.
     21#: includes/admin/class-admin.php:61
    2322#, php-format
    24 msgid ""
    25 "Popular Authors requires Top 10 v3 or above. Please install %1$s via Plugins "
    26 "> Add New or deactivate this plugin."
    27 msgstr ""
    28 
    29 #: includes/admin/class-admin.php:67
     23msgid "Popular Authors requires Top 10 v3 or above. Please install %1$s via Plugins > Add New or deactivate this plugin."
     24msgstr ""
     25
     26#. Plugin Name of the plugin
     27#: popular-authors.php
     28#: includes/admin/class-admin.php:80
    3029#: includes/frontend/widgets/class-authors-widget.php:29
    31 #: includes/frontend/widgets/class-authors-widget.php:170
     30#: includes/frontend/widgets/class-authors-widget.php:177
    3231msgid "Popular Authors"
    3332msgstr ""
    3433
    35 #: includes/admin/class-admin.php:86
     34#: includes/admin/class-admin.php:99
    3635msgid "Cache output"
    3736msgstr ""
    3837
    39 #: includes/admin/class-admin.php:87
    40 msgid ""
    41 "Turn this ON to cache the HTML output. This option uses the same settings as "
    42 "Top 10 and creates similar cache keys."
    43 msgstr ""
    44 
    45 #: includes/admin/class-admin.php:93
     38#: includes/admin/class-admin.php:100
     39msgid "Turn this ON to cache the HTML output. This option uses the same settings as Top 10 and creates similar cache keys."
     40msgstr ""
     41
     42#: includes/admin/class-admin.php:106
    4643msgid "Number of authors to display"
    4744msgstr ""
    4845
    49 #: includes/admin/class-admin.php:94
    50 msgid ""
    51 "Maximum number of authors that will be displayed in the list. This option is "
    52 "used if you do not specify the number of posts in the block, widget or "
    53 "shortcode."
    54 msgstr ""
    55 
    56 #: includes/admin/class-admin.php:102
     46#: includes/admin/class-admin.php:107
     47msgid "Maximum number of authors that will be displayed in the list. This option is used if you do not specify the number of posts in the block, widget or shortcode."
     48msgstr ""
     49
     50#: includes/admin/class-admin.php:115
    5751msgid "Default custom period range"
    5852msgstr ""
    5953
    60 #: includes/admin/class-admin.php:103
    61 msgid ""
    62 "The next two options allow you to set the default range for the custom "
    63 "period."
    64 msgstr ""
    65 
    66 #: includes/admin/class-admin.php:108
     54#: includes/admin/class-admin.php:116
     55msgid "The next two options allow you to set the default range for the custom period."
     56msgstr ""
     57
     58#: includes/admin/class-admin.php:121
    6759msgid "Day(s)"
    6860msgstr ""
    6961
    70 #: includes/admin/class-admin.php:117
     62#: includes/admin/class-admin.php:130
    7163msgid "Hour(s)"
    7264msgstr ""
    7365
    74 #: includes/admin/class-admin.php:127
     66#: includes/admin/class-admin.php:140
    7567msgid "Show views"
    7668msgstr ""
    7769
    78 #: includes/admin/class-admin.php:128
     70#: includes/admin/class-admin.php:141
    7971msgid "Show the total number of views in parenthesis next to the author's name"
    8072msgstr ""
    8173
    82 #: includes/admin/class-admin.php:134
     74#: includes/admin/class-admin.php:154
    8375msgid "Exclude 'admin' account"
    8476msgstr ""
    8577
    86 #: includes/admin/class-admin.php:141
     78#: includes/admin/class-admin.php:161
    8779msgid "Show full name"
    8880msgstr ""
    8981
    90 #: includes/admin/class-admin.php:142
     82#: includes/admin/class-admin.php:162
    9183msgid "Whether to show the author's full name instead of the display name"
    9284msgstr ""
    9385
    94 #: includes/admin/class-admin.php:148
     86#: includes/admin/class-admin.php:168
     87#: includes/frontend/widgets/class-authors-widget.php:97
     88#: includes/frontend/blocks/build/popular-authors/index.js:1
    9589#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:38
    96 #: includes/frontend/widgets/class-authors-widget.php:91
    9790msgid "Show Avatar"
    9891msgstr ""
    9992
    100 #: includes/admin/class-admin.php:149
     93#: includes/admin/class-admin.php:169
    10194msgid "Whether to show the author's avatar"
    10295msgstr ""
    10396
    104 #: includes/admin/class-admin.php:155
     97#: includes/admin/class-admin.php:175
    10598msgid "Post types to include"
    10699msgstr ""
    107100
    108 #: includes/admin/class-admin.php:156
    109 msgid ""
    110 "At least one option should be selected above. Select which post types you "
    111 "want to include in the list of posts. This field can be overridden using a "
    112 "comma separated list of post types when using the manual display."
    113 msgstr ""
    114 
    115 #: includes/admin/class-admin.php:163
     101#: includes/admin/class-admin.php:176
     102msgid "At least one option should be selected above. Select which post types you want to include in the list of posts. This field can be overridden using a comma separated list of post types when using the manual display."
     103msgstr ""
     104
     105#: includes/admin/class-admin.php:183
    116106msgid "HTML to display"
    117107msgstr ""
    118108
    119 #: includes/admin/class-admin.php:169
     109#: includes/admin/class-admin.php:189
    120110msgid "Before the list of posts"
    121111msgstr ""
    122112
    123 #: includes/admin/class-admin.php:176
     113#: includes/admin/class-admin.php:196
    124114msgid "After the list of posts"
    125115msgstr ""
    126116
    127 #: includes/admin/class-admin.php:183
     117#: includes/admin/class-admin.php:203
    128118msgid "Before each list item"
    129119msgstr ""
    130120
    131 #: includes/admin/class-admin.php:190
     121#: includes/admin/class-admin.php:210
    132122msgid "After each list item"
    133123msgstr ""
    134124
    135 #: includes/admin/class-admin.php:197
     125#: includes/admin/class-admin.php:217
    136126msgid "Styles"
    137127msgstr ""
    138128
    139 #: includes/admin/class-admin.php:203
     129#: includes/admin/class-admin.php:223
    140130msgid "Popular Authors style"
    141131msgstr ""
    142132
    143 #: includes/admin/class-admin.php:225
     133#: includes/admin/class-admin.php:245
    144134msgid "No styles"
    145135msgstr ""
    146136
    147 #: includes/admin/class-admin.php:226
     137#: includes/admin/class-admin.php:246
    148138msgid "Select this option if you plan to add your own styles"
    149139msgstr ""
    150140
    151 #: includes/admin/class-admin.php:230
     141#: includes/admin/class-admin.php:250
    152142msgid "Card Layout"
    153143msgstr ""
    154144
    155 #: includes/admin/class-admin.php:231
     145#: includes/admin/class-admin.php:251
    156146msgid "Display the popular authors in a card layout using CSS grid"
    157147msgstr ""
    158148
    159 #: includes/admin/class-admin.php:235
     149#: includes/admin/class-admin.php:255
    160150msgid "Left Thumbs"
    161151msgstr ""
    162152
    163 #: includes/admin/class-admin.php:236
    164 msgid ""
    165 "Display the popular authors in a grid with the image to the left of the text"
    166 msgstr ""
    167 
    168 #: includes/frontend/blocks/class-blocks.php:148
     153#: includes/admin/class-admin.php:256
     154msgid "Display the popular authors in a grid with the image to the left of the text"
     155msgstr ""
     156
     157#: includes/frontend/blocks/class-blocks.php:149
    169158msgid "Select an author from the sidebar panel."
    170159msgstr ""
    171160
     161#: includes/frontend/blocks/build/popular-authors/index.js:1
    172162#: includes/frontend/blocks/src/popular-authors/components/AdvancedSettings.js:13
    173163msgid "Other attributes"
    174164msgstr ""
    175165
    176 #: includes/frontend/blocks/src/popular-authors/components/AdvancedSettings.js:20
     166#: includes/frontend/blocks/build/popular-authors/index.js:1
     167#: includes/frontend/blocks/src/popular-authors/components/AdvancedSettings.js:19
    177168msgid "Enter other attributes in a URL-style string-query."
    178169msgstr ""
    179170
     171#: includes/frontend/blocks/build/popular-authors/index.js:1
    180172#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:22
    181173msgid "Show Full Name"
    182174msgstr ""
    183175
     176#: includes/frontend/blocks/build/popular-authors/index.js:1
    184177#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:25
    185178msgid "Full Name is displayed"
    186179msgstr ""
    187180
     181#: includes/frontend/blocks/build/popular-authors/index.js:1
    188182#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:26
    189183msgid "Display Name is displayed"
    190184msgstr ""
    191185
     186#: includes/frontend/blocks/build/popular-authors/index.js:1
    192187#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:41
    193188msgid "Avatar displayed"
    194189msgstr ""
    195190
     191#: includes/frontend/blocks/build/popular-authors/index.js:1
    196192#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:42
    197193msgid "No avatar displayed"
    198194msgstr ""
    199195
     196#: includes/frontend/blocks/build/popular-authors/index.js:1
    200197#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:54
    201198msgid "Exclude admin"
    202199msgstr ""
    203200
    204 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:58
     201#: includes/frontend/blocks/build/popular-authors/index.js:1
     202#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:57
    205203msgid "'admin' account is excluded"
    206204msgstr ""
    207205
    208 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:62
     206#: includes/frontend/blocks/build/popular-authors/index.js:1
     207#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:61
    209208msgid "'admin' account is included"
    210209msgstr ""
    211210
     211#: includes/frontend/blocks/build/popular-authors/index.js:1
    212212#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:76
    213213msgid "Hide authors with no posts"
    214214msgstr ""
    215215
    216 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:80
     216#: includes/frontend/blocks/build/popular-authors/index.js:1
     217#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:79
    217218msgid "Authors with no posts are excluded"
    218219msgstr ""
    219220
    220 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:84
     221#: includes/frontend/blocks/build/popular-authors/index.js:1
     222#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:83
    221223msgid "Authors with no posts are included"
    222224msgstr ""
    223225
     226#: includes/frontend/blocks/build/popular-authors/index.js:1
    224227#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:98
    225228msgid "Author IDs to include"
    226229msgstr ""
    227230
    228 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:102
    229 msgid ""
    230 "Comma-separated list of author IDs to include. This has priority over "
    231 "exclude."
    232 msgstr ""
    233 
     231#: includes/frontend/blocks/build/popular-authors/index.js:1
     232#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:101
     233msgid "Comma-separated list of author IDs to include. This has priority over exclude."
     234msgstr ""
     235
     236#: includes/frontend/blocks/build/popular-authors/index.js:1
    234237#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:109
    235238msgid "Author IDs to exclude"
    236239msgstr ""
    237240
    238 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:113
     241#: includes/frontend/blocks/build/popular-authors/index.js:1
     242#: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:112
    239243msgid "Comma-separated list of author IDs to exclude"
    240244msgstr ""
    241245
     246#: includes/frontend/blocks/build/popular-authors/index.js:1
    242247#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:16
    243248msgid "Max authors to display"
    244249msgstr ""
    245250
    246 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:20
    247 msgid ""
    248 "Value -1 (all authors) is supported, but should be used with caution on "
    249 "larger sites."
    250 msgstr ""
    251 
     251#: includes/frontend/blocks/build/popular-authors/index.js:1
     252#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:19
     253msgid "Value -1 (all authors) is supported, but should be used with caution on larger sites."
     254msgstr ""
     255
     256#: includes/frontend/widgets/class-authors-widget.php:72
     257#: includes/frontend/blocks/build/popular-authors/index.js:1
    252258#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:29
    253 #: includes/frontend/widgets/class-authors-widget.php:71
    254259msgid "Offset"
    255260msgstr ""
    256261
    257 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:33
    258 msgid ""
    259 "Number of authors to offset in retrieved results. Only applies if number of "
    260 "authors set above is >0"
    261 msgstr ""
    262 
     262#: includes/frontend/blocks/build/popular-authors/index.js:1
     263#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:32
     264msgid "Number of authors to offset in retrieved results. Only applies if number of authors set above is >0"
     265msgstr ""
     266
     267#: includes/frontend/widgets/class-authors-widget.php:77
     268#: includes/frontend/blocks/build/popular-authors/index.js:1
    263269#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:41
    264 #: includes/frontend/widgets/class-authors-widget.php:76
    265270msgid "Show count"
    266271msgstr ""
    267272
     273#: includes/frontend/blocks/build/popular-authors/index.js:1
    268274#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:44
    269275msgid "Count displayed"
    270276msgstr ""
    271277
     278#: includes/frontend/blocks/build/popular-authors/index.js:1
    272279#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:45
    273280msgid "No count displayed"
    274281msgstr ""
    275282
    276 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:15
     283#: includes/frontend/blocks/build/popular-posts/index.js:1
    277284#: includes/frontend/blocks/src/popular-posts/edit.js:210
    278285msgid "Custom period?"
    279286msgstr ""
    280287
    281 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:18
    282 msgid "Set range below"
    283 msgstr ""
    284 
    285 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:20
    286 msgid "Overall popular posts will be shown"
    287 msgstr ""
    288 
    289 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:37
    290 msgid "Daily range"
    291 msgstr ""
    292 
    293 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:43
     288#: includes/frontend/blocks/build/popular-posts/index.js:1
    294289#: includes/frontend/blocks/src/popular-posts/edit.js:217
    295290msgid "Number of days"
    296291msgstr ""
    297292
    298 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:50
    299 msgid "Hour range"
    300 msgstr ""
    301 
    302 #: includes/frontend/blocks/src/popular-authors/components/TimeSettings.js:56
     293#: includes/frontend/blocks/build/popular-posts/index.js:1
    303294#: includes/frontend/blocks/src/popular-posts/edit.js:224
    304295msgid "Number of hours"
    305296msgstr ""
    306297
     298#: includes/frontend/blocks/build/popular-authors/index.js:1
    307299#: includes/frontend/blocks/src/popular-authors/edit.js:21
    308300msgid "Popular Authors Settings"
    309301msgstr ""
    310302
     303#: includes/frontend/blocks/build/popular-posts/index.js:1
    311304#: includes/frontend/blocks/src/popular-posts/edit.js:122
    312305msgid "Settings"
    313306msgstr ""
    314307
     308#: includes/frontend/blocks/build/popular-posts/index.js:1
    315309#: includes/frontend/blocks/src/popular-posts/edit.js:127
    316310msgid "Author"
    317311msgstr ""
    318312
    319 #: includes/frontend/blocks/src/popular-posts/edit.js:132
     313#: includes/frontend/blocks/build/popular-posts/index.js:1
     314#: includes/frontend/blocks/src/popular-posts/edit.js:131
    320315msgid "Select an author"
    321316msgstr ""
    322317
     318#: includes/frontend/blocks/build/popular-posts/index.js:1
    323319#: includes/frontend/blocks/src/popular-posts/edit.js:148
    324320msgid "Number of posts"
    325321msgstr ""
    326322
     323#: includes/frontend/blocks/build/popular-posts/index.js:1
    327324#: includes/frontend/blocks/src/popular-posts/edit.js:157
    328325msgid "Post Types"
    329326msgstr ""
    330327
     328#: includes/frontend/blocks/build/popular-posts/index.js:1
    331329#: includes/frontend/blocks/src/popular-posts/edit.js:176
    332330msgid "Order By"
    333331msgstr ""
    334332
     333#: includes/frontend/blocks/build/popular-posts/index.js:1
    335334#: includes/frontend/blocks/src/popular-posts/edit.js:180
    336335msgid "Visits"
    337336msgstr ""
    338337
     338#: includes/frontend/blocks/build/popular-posts/index.js:1
    339339#: includes/frontend/blocks/src/popular-posts/edit.js:184
    340340msgid "Date"
    341341msgstr ""
    342342
     343#: includes/frontend/widgets/class-authors-widget.php:62
     344#: includes/frontend/blocks/build/popular-posts/index.js:1
    343345#: includes/frontend/blocks/src/popular-posts/edit.js:188
    344 #: includes/frontend/widgets/class-authors-widget.php:61
    345346msgid "Title"
    346347msgstr ""
    347348
     349#: includes/frontend/blocks/build/popular-posts/index.js:1
    348350#: includes/frontend/blocks/src/popular-posts/edit.js:195
    349351msgid "Order"
    350352msgstr ""
    351353
     354#: includes/frontend/blocks/build/popular-posts/index.js:1
    352355#: includes/frontend/blocks/src/popular-posts/edit.js:199
    353356msgid "Descending"
    354357msgstr ""
    355358
     359#: includes/frontend/blocks/build/popular-posts/index.js:1
    356360#: includes/frontend/blocks/src/popular-posts/edit.js:203
    357361msgid "Ascending"
    358362msgstr ""
    359363
     364#: includes/frontend/blocks/build/popular-posts/index.js:1
    360365#: includes/frontend/blocks/src/popular-posts/edit.js:234
    361366msgid "Display post count?"
     
    364369#: includes/frontend/class-display.php:60
    365370msgid "Please install and activate Top 10 plugin to display popular authors."
    366 msgstr ""
    367 
    368 #: includes/frontend/class-display.php:186
    369 #, php-format
    370 msgid "Posts by %s"
    371371msgstr ""
    372372
     
    380380msgstr ""
    381381
    382 #: includes/frontend/widgets/class-authors-widget.php:66
     382#: includes/frontend/widgets/class-authors-widget.php:67
    383383msgid "No. of authors"
    384384msgstr ""
    385385
    386 #: includes/frontend/widgets/class-authors-widget.php:81
     386#: includes/frontend/widgets/class-authors-widget.php:87
    387387msgid "Exclude admins"
    388388msgstr ""
    389389
    390 #: includes/frontend/widgets/class-authors-widget.php:86
     390#: includes/frontend/widgets/class-authors-widget.php:92
    391391msgid "Show full name of Author"
    392392msgstr ""
    393393
    394 #: includes/frontend/widgets/class-authors-widget.php:95
     394#: includes/frontend/widgets/class-authors-widget.php:101
    395395msgid "Time range"
    396396msgstr ""
    397397
    398 #: includes/frontend/widgets/class-authors-widget.php:97
     398#: includes/frontend/widgets/class-authors-widget.php:103
    399399msgid "Overall"
    400400msgstr ""
    401401
    402 #: includes/frontend/widgets/class-authors-widget.php:98
     402#: includes/frontend/widgets/class-authors-widget.php:104
    403403msgid "Custom time period (Enter below)"
    404404msgstr ""
    405405
    406 #: includes/frontend/widgets/class-authors-widget.php:102
     406#: includes/frontend/widgets/class-authors-widget.php:108
    407407msgid "In days and hours (applies only to custom option above)"
    408408msgstr ""
    409409
    410 #: includes/frontend/widgets/class-authors-widget.php:104
     410#: includes/frontend/widgets/class-authors-widget.php:110
    411411msgid "days"
    412412msgstr ""
    413413
    414 #: includes/frontend/widgets/class-authors-widget.php:107
     414#: includes/frontend/widgets/class-authors-widget.php:113
    415415msgid "hours"
    416416msgstr ""
     417
     418#. Description of the plugin
     419#: popular-authors.php
     420msgid "Display a list of the popular authors. A Top 10 WordPress plugin addon."
     421msgstr ""
     422
     423#. Author of the plugin
     424#: popular-authors.php
     425msgid "WebberZone"
     426msgstr ""
     427
     428#. Author URI of the plugin
     429#: popular-authors.php
     430msgid "https://webberzone.com"
     431msgstr ""
     432
     433#: includes/frontend/blocks/build/popular-authors/block.json
     434#: includes/frontend/blocks/src/popular-authors/block.json
     435msgctxt "block title"
     436msgid "Popular Authors"
     437msgstr ""
     438
     439#: includes/frontend/blocks/build/popular-authors/block.json
     440#: includes/frontend/blocks/src/popular-authors/block.json
     441msgctxt "block keyword"
     442msgid "popular authors"
     443msgstr ""
     444
     445#: includes/frontend/blocks/build/popular-authors/block.json
     446#: includes/frontend/blocks/build/popular-posts/block.json
     447#: includes/frontend/blocks/src/popular-authors/block.json
     448#: includes/frontend/blocks/src/popular-posts/block.json
     449msgctxt "block keyword"
     450msgid "author"
     451msgstr ""
     452
     453#: includes/frontend/blocks/build/popular-authors/block.json
     454#: includes/frontend/blocks/src/popular-authors/block.json
     455msgctxt "block keyword"
     456msgid "top 10"
     457msgstr ""
     458
     459#: includes/frontend/blocks/build/popular-authors/block.json
     460#: includes/frontend/blocks/src/popular-authors/block.json
     461msgctxt "block description"
     462msgid "Show the list of popular authors"
     463msgstr ""
     464
     465#: includes/frontend/blocks/build/popular-posts/block.json
     466#: includes/frontend/blocks/src/popular-posts/block.json
     467msgctxt "block title"
     468msgid "Popular Posts by Author"
     469msgstr ""
     470
     471#: includes/frontend/blocks/build/popular-posts/block.json
     472#: includes/frontend/blocks/src/popular-posts/block.json
     473msgctxt "block keyword"
     474msgid "popular posts"
     475msgstr ""
     476
     477#: includes/frontend/blocks/build/popular-posts/block.json
     478#: includes/frontend/blocks/src/popular-posts/block.json
     479msgctxt "block keyword"
     480msgid "post"
     481msgstr ""
     482
     483#: includes/frontend/blocks/build/popular-posts/block.json
     484#: includes/frontend/blocks/src/popular-posts/block.json
     485msgctxt "block description"
     486msgid "Show the list of popular posts by author"
     487msgstr ""
     488
     489#: includes/admin/class-admin.php:147
     490#: includes/frontend/widgets/class-authors-widget.php:82
     491#: includes/frontend/blocks/build/popular-authors/index.js:1
     492#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:57
     493msgid "Show post count"
     494msgstr ""
     495
     496#: includes/admin/class-admin.php:148
     497msgid "Show the number of posts in parenthesis next to the author's name"
     498msgstr ""
     499
     500#: includes/admin/class-dashboard-widget.php:42
     501msgid "Top Authors"
     502msgstr ""
     503
     504#: includes/admin/class-dashboard-widget.php:67
     505msgid "No authors found."
     506msgstr ""
     507
     508#: includes/admin/class-dashboard-widget.php:77
     509msgid "Configure Popular Authors Settings"
     510msgstr ""
     511
     512#: includes/frontend/blocks/build/popular-authors/index.js:1
     513#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:60
     514msgid "Post count displayed"
     515msgstr ""
     516
     517#: includes/frontend/blocks/build/popular-authors/index.js:1
     518#: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:61
     519msgid "No post count displayed"
     520msgstr ""
     521
     522#. Plugin URI of the plugin
     523#: popular-authors.php
     524msgid "https://webberzone.com/downlods/popular-authors/"
     525msgstr ""
  • popular-authors/trunk/popular-authors.php

    r3224591 r3477391  
    99 * @license   GPL-2.0+
    1010 * @link      https://webberzone.com
    11  * @copyright 2020-2025 WebberZone
     11 * @copyright 2020-2026 WebberZone
    1212 *
    1313 * @wordpress-plugin
     
    1515 * Plugin URI:  https://webberzone.com/downlods/popular-authors/
    1616 * Description: Display a list of the popular authors. A Top 10 WordPress plugin addon.
    17  * Version:     1.3.0
     17 * Version:     1.4.0
    1818 * Author:      WebberZone
    1919 * Author URI:  https://webberzone.com
     
    3737 */
    3838if ( ! defined( 'POP_AUTHOR_VERSION' ) ) {
    39     define( 'POP_AUTHOR_VERSION', '1.3.0' );
     39    define( 'POP_AUTHOR_VERSION', '1.4.0' );
    4040}
    4141
  • popular-authors/trunk/readme.txt

    r3311374 r3477391  
    22Tags: popular, popular authors, author, top authors, views, top 10
    33Contributors: webberzone, Ajay
    4 Donate link: https://ajaydsouza.com/donate/
    5 Stable tag: 1.3.0
    6 Requires at least: 6.3
     4Donate link: https://wzn.io/donate-wz
     5Stable tag: 1.4.0
     6Requires at least: 6.6
    77Requires PHP: 7.4
    8 Tested up to: 6.8
     8Tested up to: 6.9
    99License: GPLv2 or later
    1010
     
    9595== Changelog ==
    9696
     97= 1.4.0 =
     98
     99Release post: [https://webberzone.com/announcements/popular-authors-1-4-0](https://webberzone.com/announcements/popular-authors-1-4-0)
     100
     101* Features:
     102    * New option to display post count in the Popular Authors block.
     103    * Added a dashboard widget to display popular authors on the WordPress dashboard.
     104
    97105= 1.3.0 =
    98106
     
    117125== Upgrade Notice ==
    118126
    119 = 1.3.0 =
    120 Fixes several bugs and introduces a new feature to display popular posts by author. Check the release post on WebberZone.com
     127= 1.4.0 =
     128New features and bug fixes. Check the release post on WebberZone.com
Note: See TracChangeset for help on using the changeset viewer.