Changeset 3477391
- Timestamp:
- 03/08/2026 11:41:22 AM (4 days ago)
- Location:
- popular-authors
- Files:
-
- 85 added
- 1 deleted
- 23 edited
-
tags/1.3.0/readme.txt (modified) (1 diff)
-
tags/1.4.0 (added)
-
tags/1.4.0/README.md (added)
-
tags/1.4.0/changelog.txt (added)
-
tags/1.4.0/includes (added)
-
tags/1.4.0/includes/admin (added)
-
tags/1.4.0/includes/admin/class-admin.php (added)
-
tags/1.4.0/includes/admin/class-dashboard-widget.php (added)
-
tags/1.4.0/includes/admin/css (added)
-
tags/1.4.0/includes/admin/css/dashboard-widget-rtl.css (added)
-
tags/1.4.0/includes/admin/css/dashboard-widget-rtl.min.css (added)
-
tags/1.4.0/includes/admin/css/dashboard-widget.css (added)
-
tags/1.4.0/includes/admin/css/dashboard-widget.min.css (added)
-
tags/1.4.0/includes/autoloader.php (added)
-
tags/1.4.0/includes/class-main.php (added)
-
tags/1.4.0/includes/css (added)
-
tags/1.4.0/includes/css/card-rtl.css (added)
-
tags/1.4.0/includes/css/card-rtl.min.css (added)
-
tags/1.4.0/includes/css/card.css (added)
-
tags/1.4.0/includes/css/card.min.css (added)
-
tags/1.4.0/includes/css/left-thumbs-rtl.css (added)
-
tags/1.4.0/includes/css/left-thumbs-rtl.min.css (added)
-
tags/1.4.0/includes/css/left-thumbs.css (added)
-
tags/1.4.0/includes/css/left-thumbs.min.css (added)
-
tags/1.4.0/includes/frontend (added)
-
tags/1.4.0/includes/frontend/blocks (added)
-
tags/1.4.0/includes/frontend/blocks/build (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-authors (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-authors/block.json (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-authors/index.asset.php (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-authors/index.js (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-posts (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-posts/block.json (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-posts/index.asset.php (added)
-
tags/1.4.0/includes/frontend/blocks/build/popular-posts/index.js (added)
-
tags/1.4.0/includes/frontend/blocks/class-blocks.php (added)
-
tags/1.4.0/includes/frontend/blocks/index.php (added)
-
tags/1.4.0/includes/frontend/blocks/src (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/block.json (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/components (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/components/AdvancedSettings.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/components/TimeSettings.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/components/icons.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/edit.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/editor.scss (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/index.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/utils (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-authors/utils/attributes.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-posts (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-posts/block.json (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-posts/edit.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-posts/icons.js (added)
-
tags/1.4.0/includes/frontend/blocks/src/popular-posts/index.js (added)
-
tags/1.4.0/includes/frontend/class-display.php (added)
-
tags/1.4.0/includes/frontend/class-popular-authors-display.php (added)
-
tags/1.4.0/includes/frontend/class-shortcodes.php (added)
-
tags/1.4.0/includes/frontend/class-styles-handler.php (added)
-
tags/1.4.0/includes/frontend/widgets (added)
-
tags/1.4.0/includes/frontend/widgets/class-authors-widget.php (added)
-
tags/1.4.0/includes/functions.php (added)
-
tags/1.4.0/includes/util (added)
-
tags/1.4.0/includes/util/class-hook-registry.php (added)
-
tags/1.4.0/index.php (added)
-
tags/1.4.0/languages (added)
-
tags/1.4.0/languages/index.php (added)
-
tags/1.4.0/languages/popular-authors-en_US.mo (added)
-
tags/1.4.0/languages/popular-authors-en_US.po (added)
-
tags/1.4.0/languages/popular-authors.pot (added)
-
tags/1.4.0/popular-authors.php (added)
-
tags/1.4.0/readme.txt (added)
-
trunk/README.md (modified) (1 diff)
-
trunk/includes/admin/class-admin.php (modified) (4 diffs)
-
trunk/includes/admin/class-dashboard-widget.php (added)
-
trunk/includes/admin/css (added)
-
trunk/includes/admin/css/dashboard-widget-rtl.css (added)
-
trunk/includes/admin/css/dashboard-widget-rtl.min.css (added)
-
trunk/includes/admin/css/dashboard-widget.css (added)
-
trunk/includes/admin/css/dashboard-widget.min.css (added)
-
trunk/includes/class-main.php (modified) (2 diffs)
-
trunk/includes/css/card-rtl.css (added)
-
trunk/includes/css/card-rtl.min.css (added)
-
trunk/includes/css/card.min.css (modified) (1 diff)
-
trunk/includes/css/left-thumbs-rtl.css (added)
-
trunk/includes/css/left-thumbs-rtl.min.css (added)
-
trunk/includes/css/left-thumbs.min.css (modified) (1 diff)
-
trunk/includes/frontend/blocks/build/popular-authors/block.json (modified) (1 diff)
-
trunk/includes/frontend/blocks/build/popular-authors/index.asset.php (modified) (1 diff)
-
trunk/includes/frontend/blocks/build/popular-authors/index.js (modified) (1 diff)
-
trunk/includes/frontend/blocks/build/popular-posts/index.asset.php (modified) (1 diff)
-
trunk/includes/frontend/blocks/build/popular-posts/index.js (modified) (1 diff)
-
trunk/includes/frontend/blocks/class-blocks.php (modified) (5 diffs)
-
trunk/includes/frontend/blocks/src/popular-authors/block.json (modified) (1 diff)
-
trunk/includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js (modified) (3 diffs)
-
trunk/includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js (modified) (3 diffs)
-
trunk/includes/frontend/class-display.php (modified) (12 diffs)
-
trunk/includes/frontend/class-shortcodes.php (modified) (2 diffs)
-
trunk/includes/frontend/class-styles-handler.php (modified) (2 diffs)
-
trunk/includes/frontend/widgets/class-authors-widget.php (modified) (5 diffs)
-
trunk/includes/util (added)
-
trunk/includes/util/class-hook-registry.php (added)
-
trunk/languages/popular-authors-en_US.mo (modified) (previous)
-
trunk/languages/popular-authors-en_US.po (modified) (4 diffs)
-
trunk/languages/popular-authors-en_US.pot (deleted)
-
trunk/languages/popular-authors.pot (added)
-
trunk/popular-authors.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
popular-authors/tags/1.3.0/readme.txt
r3311374 r3477391 5 5 Stable tag: 1.3.0 6 6 Requires at least: 6.3 7 Tested up to: 6.9 7 8 Requires PHP: 7.4 8 Tested up to: 6.89 9 License: GPLv2 or later 10 10 -
popular-authors/trunk/README.md
r3224591 r3477391 1 1 # Popular Authors 2 2 3 __Requires:__ WordPress 6. 3and Top 10 v3.0.03 __Requires:__ WordPress 6.6 and Top 10 v3.0.0 4 4 5 __Tested up to:__ 6. 75 __Tested up to:__ 6.9 6 6 7 7 __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html) -
popular-authors/trunk/includes/admin/class-admin.php
r3224591 r3477391 8 8 namespace WebberZone\Popular_Authors\Admin; 9 9 10 use WebberZone\Popular_Authors\Util\Hook_Registry; 11 10 12 if ( ! defined( 'WPINC' ) ) { 11 13 die; … … 20 22 21 23 /** 24 * Dashboard Widget. 25 * 26 * @since 1.4.0 27 * 28 * @var object Dashboard_Widget. 29 */ 30 public $dashboard_widget; 31 32 /** 22 33 * Constructor class. 23 34 * … … 25 36 */ 26 37 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(); 30 43 } 31 44 … … 130 143 'options' => false, 131 144 ), 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 ), 132 152 'wzpa_exclude_admin' => array( 133 153 'id' => 'wzpa_exclude_admin', -
popular-authors/trunk/includes/class-main.php
r2953495 r3477391 8 8 namespace WebberZone\Popular_Authors; 9 9 10 if ( ! defined( 'WPINC' ) ) { 11 exit; 12 } 10 use WebberZone\Popular_Authors\Util\Hook_Registry; 13 11 14 12 /** … … 109 107 */ 110 108 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' ) ); 122 110 } 123 111 -
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 46 46 "default": false 47 47 }, 48 "showPostCount": { 49 "type": "boolean", 50 "default": false 51 }, 48 52 "showFullName": { 49 53 "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 10 10 use WebberZone\Popular_Authors\Frontend\Display; 11 11 use WebberZone\Popular_Authors\Frontend\Styles_Handler; 12 use WebberZone\Popular_Authors\Util\Hook_Registry; 12 13 13 14 if ( ! defined( 'WPINC' ) ) { … … 26 27 */ 27 28 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 } 30 58 } 31 59 … … 83 111 84 112 // 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; 91 120 92 121 $arguments = array_merge( … … 150 179 151 180 $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, 161 190 ); 162 191 … … 173 202 return \wzpa_display_top_posts_by_author( 174 203 $attributes['author'], 175 isset( $attributes['field'] ) ? $attributes['field'] :'id',204 $attributes['field'] ?? 'id', 176 205 $arguments, 177 206 false 178 207 ); 179 208 } 180 181 /**182 * Enqueue scripts and styles for the block editor.183 *184 * @since 1.2.0185 */186 public static function enqueue_block_editor_assets() {187 }188 209 } -
popular-authors/trunk/includes/frontend/blocks/src/popular-authors/block.json
r3224591 r3477391 42 42 "default": false 43 43 }, 44 "showPostCount": { 45 "type": "boolean", 46 "default": false 47 }, 44 48 "showFullName": { 45 49 "type": "boolean", -
popular-authors/trunk/includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js
r3224591 r3477391 37 37 <ToggleControl 38 38 label={__('Show Avatar', 'popular-authors')} 39 help={40 showAvatar41 ? __('Avatar displayed', 'popular-authors')42 : __('No avatar displayed', 'popular-authors')43 }44 39 checked={showAvatar} 45 40 onChange={createAttributeToggle( … … 53 48 <ToggleControl 54 49 label={__('Exclude admin', 'popular-authors')} 55 help={56 excludeAdmin57 ? __(58 "'admin' account is excluded",59 'popular-authors'60 )61 : __(62 "'admin' account is included",63 'popular-authors'64 )65 }66 50 checked={excludeAdmin} 67 51 onChange={createAttributeToggle( … … 75 59 <ToggleControl 76 60 label={__('Hide authors with no posts', 'popular-authors')} 77 help={78 hideEmptyAuthors79 ? __(80 'Authors with no posts are excluded',81 'popular-authors'82 )83 : __(84 'Authors with no posts are included',85 'popular-authors'86 )87 }88 61 checked={hideEmptyAuthors} 89 62 onChange={createAttributeToggle( -
popular-authors/trunk/includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js
r3224591 r3477391 7 7 8 8 const DisplaySettings = ({ attributes, setAttributes }) => { 9 const { number, offset, showOptionCount } = attributes;9 const { number, offset, showOptionCount, showPostCount } = attributes; 10 10 11 11 return ( … … 39 39 <PanelRow> 40 40 <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')} 47 42 checked={showOptionCount} 48 43 onChange={createAttributeToggle( … … 53 48 /> 54 49 </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> 55 61 </> 56 62 ); -
popular-authors/trunk/includes/frontend/class-display.php
r3224591 r3477391 34 34 * @since 1.2.0 35 35 * 36 * @global wpdb $wpdb WordPress database abstraction object.36 * @global \wpdb $wpdb WordPress database abstraction object. 37 37 * 38 38 * @param array $args List of arguments. See self::list_popular_authors_args() for full list. … … 63 63 // Check if the cache is enabled and if the output exists. If so, return the output. 64 64 if ( $args['cache'] ) { 65 $cache_name = \WebberZone\Top_Ten\Frontend\Display::cache_get_key( $args );65 $cache_name = self::cache_get_key( $args ); 66 66 67 67 $output = get_transient( $cache_name ); … … 84 84 85 85 // 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' ); 88 89 89 90 foreach ( (array) $post_counts_query as $row ) { … … 188 189 ); 189 190 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 ) . ')'; 195 206 } 196 207 $link .= '</span>'; … … 235 246 * @since 1.0.0 236 247 * 237 * @global wpdb $wpdb WordPress database abstraction object.248 * @global \wpdb $wpdb WordPress database abstraction object. 238 249 * 239 250 * @param string|array $args { … … 314 325 $join .= " {$join_type} JOIN {$pop_posts_table} ON {$pop_posts_table}.postnumber={$posts_table}.ID AND {$pop_posts_table}.blog_id={$blog_id} "; 315 326 316 // Create the WHERE clause. 327 // Initialize prepare values array. 328 $prepare_values = array(); 329 317 330 // Parse and sanitize 'include'. 318 331 if ( ! empty( $args['include'] ) ) { … … 324 337 // Parse include or exclude arguments. Include is always prioritised. 325 338 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 ); 328 342 } 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 ); 331 347 } 332 348 … … 334 350 $from_date = \WebberZone\Top_Ten\Util\Helpers::get_from_date( null, (int) $args['daily_range'], (int) $args['hour_range'] ); 335 351 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; 337 354 } 338 355 339 356 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 ); 342 361 } 343 362 … … 354 373 355 374 if ( $offset ) { 356 $limits = $wpdb->prepare( 'LIMIT %d, %d', $offset, $number ); 375 $limits = 'LIMIT %d, %d'; 376 $prepare_values[] = $offset; 377 $prepare_values[] = $number; 357 378 } 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; 359 382 } 360 383 } … … 423 446 $limits = apply_filters_ref_array( 'wzpa_query_limits', array( $limits, $args ) ); 424 447 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 425 458 // Create the mySQL statement. 426 459 $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 } 427 464 428 465 $results = $wpdb->get_results( $sql ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared … … 478 515 'offset' => '', 479 516 'optioncount' => true, 517 'show_postcount' => false, 480 518 'exclude_admin' => false, 481 519 'post_type' => 'post', … … 584 622 return apply_filters( 'wzpa_get_avatar', $avatar, $author, $avatar_args ); 585 623 } 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 } 586 636 } -
popular-authors/trunk/includes/frontend/class-shortcodes.php
r3224591 r3477391 7 7 8 8 namespace WebberZone\Popular_Authors\Frontend; 9 10 use WebberZone\Popular_Authors\Util\Hook_Registry; 9 11 10 12 if ( ! defined( 'WPINC' ) ) { … … 25 27 */ 26 28 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 ); 29 36 } 30 37 -
popular-authors/trunk/includes/frontend/class-styles-handler.php
r3147782 r3477391 7 7 8 8 namespace WebberZone\Popular_Authors\Frontend; 9 10 use WebberZone\Popular_Authors\Util\Hook_Registry; 9 11 10 12 if ( ! defined( 'WPINC' ) ) { … … 25 27 */ 26 28 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' ) ); 28 30 } 29 31 -
popular-authors/trunk/includes/frontend/widgets/class-authors-widget.php
r2953495 r3477391 45 45 */ 46 46 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'] : ''; 57 58 58 59 ?> … … 75 76 <label for="<?php echo esc_attr( $this->get_field_id( 'optioncount' ) ); ?>"> 76 77 <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' ); ?> 77 83 </label> 78 84 </p> … … 134 140 */ 135 141 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; 147 154 148 155 /** … … 168 175 public function widget( $args, $instance ) { 169 176 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'] ) : ''; 180 188 181 189 /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ … … 183 191 184 192 $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, 197 206 ); 198 207 -
popular-authors/trunk/languages/popular-authors-en_US.po
r3224591 r3477391 3 3 "Project-Id-Version: Popular Authors\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2025-01-17 19:02+0000\n"6 "PO-Revision-Date: \n"7 5 "Last-Translator: Ajay D'Souza\n" 8 6 "Language-Team: WebberZone\n" 9 "Language: en\n"10 7 "MIME-Version: 1.0\n" 11 8 "Content-Type: text/plain; charset=UTF-8\n" 12 9 "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" 16 14 "X-Poedit-Basepath: ..\n" 17 15 "X-Generator: Poedit 3.4.2\n" … … 20 18 "X-Poedit-SearchPathExcluded-0: vendor/*\n" 21 19 22 #: includes/admin/class-admin.php:48 20 #. translators: 1: Force regenerate plugin link. 21 #: includes/admin/class-admin.php:61 23 22 #, 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: 6723 msgid "Popular Authors requires Top 10 v3 or above. Please install %1$s via Plugins > Add New or deactivate this plugin." 24 msgstr "" 25 26 #. Plugin Name of the plugin 27 #: popular-authors.php 28 #: includes/admin/class-admin.php:80 30 29 #: includes/frontend/widgets/class-authors-widget.php:29 31 #: includes/frontend/widgets/class-authors-widget.php:17 030 #: includes/frontend/widgets/class-authors-widget.php:177 32 31 msgid "Popular Authors" 33 32 msgstr "" 34 33 35 #: includes/admin/class-admin.php: 8634 #: includes/admin/class-admin.php:99 36 35 msgid "Cache output" 37 36 msgstr "" 38 37 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 39 msgid "Turn this ON to cache the HTML output. This option uses the same settings as Top 10 and creates similar cache keys." 40 msgstr "" 41 42 #: includes/admin/class-admin.php:106 46 43 msgid "Number of authors to display" 47 44 msgstr "" 48 45 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 47 msgid "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." 48 msgstr "" 49 50 #: includes/admin/class-admin.php:115 57 51 msgid "Default custom period range" 58 52 msgstr "" 59 53 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 55 msgid "The next two options allow you to set the default range for the custom period." 56 msgstr "" 57 58 #: includes/admin/class-admin.php:121 67 59 msgid "Day(s)" 68 60 msgstr "" 69 61 70 #: includes/admin/class-admin.php:1 1762 #: includes/admin/class-admin.php:130 71 63 msgid "Hour(s)" 72 64 msgstr "" 73 65 74 #: includes/admin/class-admin.php:1 2766 #: includes/admin/class-admin.php:140 75 67 msgid "Show views" 76 68 msgstr "" 77 69 78 #: includes/admin/class-admin.php:1 2870 #: includes/admin/class-admin.php:141 79 71 msgid "Show the total number of views in parenthesis next to the author's name" 80 72 msgstr "" 81 73 82 #: includes/admin/class-admin.php:1 3474 #: includes/admin/class-admin.php:154 83 75 msgid "Exclude 'admin' account" 84 76 msgstr "" 85 77 86 #: includes/admin/class-admin.php:1 4178 #: includes/admin/class-admin.php:161 87 79 msgid "Show full name" 88 80 msgstr "" 89 81 90 #: includes/admin/class-admin.php:1 4282 #: includes/admin/class-admin.php:162 91 83 msgid "Whether to show the author's full name instead of the display name" 92 84 msgstr "" 93 85 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 95 89 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:38 96 #: includes/frontend/widgets/class-authors-widget.php:9197 90 msgid "Show Avatar" 98 91 msgstr "" 99 92 100 #: includes/admin/class-admin.php:1 4993 #: includes/admin/class-admin.php:169 101 94 msgid "Whether to show the author's avatar" 102 95 msgstr "" 103 96 104 #: includes/admin/class-admin.php:1 5597 #: includes/admin/class-admin.php:175 105 98 msgid "Post types to include" 106 99 msgstr "" 107 100 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 102 msgid "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." 103 msgstr "" 104 105 #: includes/admin/class-admin.php:183 116 106 msgid "HTML to display" 117 107 msgstr "" 118 108 119 #: includes/admin/class-admin.php:1 69109 #: includes/admin/class-admin.php:189 120 110 msgid "Before the list of posts" 121 111 msgstr "" 122 112 123 #: includes/admin/class-admin.php:1 76113 #: includes/admin/class-admin.php:196 124 114 msgid "After the list of posts" 125 115 msgstr "" 126 116 127 #: includes/admin/class-admin.php: 183117 #: includes/admin/class-admin.php:203 128 118 msgid "Before each list item" 129 119 msgstr "" 130 120 131 #: includes/admin/class-admin.php: 190121 #: includes/admin/class-admin.php:210 132 122 msgid "After each list item" 133 123 msgstr "" 134 124 135 #: includes/admin/class-admin.php: 197125 #: includes/admin/class-admin.php:217 136 126 msgid "Styles" 137 127 msgstr "" 138 128 139 #: includes/admin/class-admin.php:2 03129 #: includes/admin/class-admin.php:223 140 130 msgid "Popular Authors style" 141 131 msgstr "" 142 132 143 #: includes/admin/class-admin.php:2 25133 #: includes/admin/class-admin.php:245 144 134 msgid "No styles" 145 135 msgstr "" 146 136 147 #: includes/admin/class-admin.php:2 26137 #: includes/admin/class-admin.php:246 148 138 msgid "Select this option if you plan to add your own styles" 149 139 msgstr "" 150 140 151 #: includes/admin/class-admin.php:2 30141 #: includes/admin/class-admin.php:250 152 142 msgid "Card Layout" 153 143 msgstr "" 154 144 155 #: includes/admin/class-admin.php:2 31145 #: includes/admin/class-admin.php:251 156 146 msgid "Display the popular authors in a card layout using CSS grid" 157 147 msgstr "" 158 148 159 #: includes/admin/class-admin.php:2 35149 #: includes/admin/class-admin.php:255 160 150 msgid "Left Thumbs" 161 151 msgstr "" 162 152 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 154 msgid "Display the popular authors in a grid with the image to the left of the text" 155 msgstr "" 156 157 #: includes/frontend/blocks/class-blocks.php:149 169 158 msgid "Select an author from the sidebar panel." 170 159 msgstr "" 171 160 161 #: includes/frontend/blocks/build/popular-authors/index.js:1 172 162 #: includes/frontend/blocks/src/popular-authors/components/AdvancedSettings.js:13 173 163 msgid "Other attributes" 174 164 msgstr "" 175 165 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 177 168 msgid "Enter other attributes in a URL-style string-query." 178 169 msgstr "" 179 170 171 #: includes/frontend/blocks/build/popular-authors/index.js:1 180 172 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:22 181 173 msgid "Show Full Name" 182 174 msgstr "" 183 175 176 #: includes/frontend/blocks/build/popular-authors/index.js:1 184 177 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:25 185 178 msgid "Full Name is displayed" 186 179 msgstr "" 187 180 181 #: includes/frontend/blocks/build/popular-authors/index.js:1 188 182 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:26 189 183 msgid "Display Name is displayed" 190 184 msgstr "" 191 185 186 #: includes/frontend/blocks/build/popular-authors/index.js:1 192 187 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:41 193 188 msgid "Avatar displayed" 194 189 msgstr "" 195 190 191 #: includes/frontend/blocks/build/popular-authors/index.js:1 196 192 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:42 197 193 msgid "No avatar displayed" 198 194 msgstr "" 199 195 196 #: includes/frontend/blocks/build/popular-authors/index.js:1 200 197 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:54 201 198 msgid "Exclude admin" 202 199 msgstr "" 203 200 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 205 203 msgid "'admin' account is excluded" 206 204 msgstr "" 207 205 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 209 208 msgid "'admin' account is included" 210 209 msgstr "" 211 210 211 #: includes/frontend/blocks/build/popular-authors/index.js:1 212 212 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:76 213 213 msgid "Hide authors with no posts" 214 214 msgstr "" 215 215 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 217 218 msgid "Authors with no posts are excluded" 218 219 msgstr "" 219 220 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 221 223 msgid "Authors with no posts are included" 222 224 msgstr "" 223 225 226 #: includes/frontend/blocks/build/popular-authors/index.js:1 224 227 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:98 225 228 msgid "Author IDs to include" 226 229 msgstr "" 227 230 228 #: includes/frontend/blocks/ src/popular-authors/components/AuthorSettings.js:102229 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 233 msgid "Comma-separated list of author IDs to include. This has priority over exclude." 234 msgstr "" 235 236 #: includes/frontend/blocks/build/popular-authors/index.js:1 234 237 #: includes/frontend/blocks/src/popular-authors/components/AuthorSettings.js:109 235 238 msgid "Author IDs to exclude" 236 239 msgstr "" 237 240 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 239 243 msgid "Comma-separated list of author IDs to exclude" 240 244 msgstr "" 241 245 246 #: includes/frontend/blocks/build/popular-authors/index.js:1 242 247 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:16 243 248 msgid "Max authors to display" 244 249 msgstr "" 245 250 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 253 msgid "Value -1 (all authors) is supported, but should be used with caution on larger sites." 254 msgstr "" 255 256 #: includes/frontend/widgets/class-authors-widget.php:72 257 #: includes/frontend/blocks/build/popular-authors/index.js:1 252 258 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:29 253 #: includes/frontend/widgets/class-authors-widget.php:71254 259 msgid "Offset" 255 260 msgstr "" 256 261 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 264 msgid "Number of authors to offset in retrieved results. Only applies if number of authors set above is >0" 265 msgstr "" 266 267 #: includes/frontend/widgets/class-authors-widget.php:77 268 #: includes/frontend/blocks/build/popular-authors/index.js:1 263 269 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:41 264 #: includes/frontend/widgets/class-authors-widget.php:76265 270 msgid "Show count" 266 271 msgstr "" 267 272 273 #: includes/frontend/blocks/build/popular-authors/index.js:1 268 274 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:44 269 275 msgid "Count displayed" 270 276 msgstr "" 271 277 278 #: includes/frontend/blocks/build/popular-authors/index.js:1 272 279 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:45 273 280 msgid "No count displayed" 274 281 msgstr "" 275 282 276 #: includes/frontend/blocks/ src/popular-authors/components/TimeSettings.js:15283 #: includes/frontend/blocks/build/popular-posts/index.js:1 277 284 #: includes/frontend/blocks/src/popular-posts/edit.js:210 278 285 msgid "Custom period?" 279 286 msgstr "" 280 287 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 294 289 #: includes/frontend/blocks/src/popular-posts/edit.js:217 295 290 msgid "Number of days" 296 291 msgstr "" 297 292 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 303 294 #: includes/frontend/blocks/src/popular-posts/edit.js:224 304 295 msgid "Number of hours" 305 296 msgstr "" 306 297 298 #: includes/frontend/blocks/build/popular-authors/index.js:1 307 299 #: includes/frontend/blocks/src/popular-authors/edit.js:21 308 300 msgid "Popular Authors Settings" 309 301 msgstr "" 310 302 303 #: includes/frontend/blocks/build/popular-posts/index.js:1 311 304 #: includes/frontend/blocks/src/popular-posts/edit.js:122 312 305 msgid "Settings" 313 306 msgstr "" 314 307 308 #: includes/frontend/blocks/build/popular-posts/index.js:1 315 309 #: includes/frontend/blocks/src/popular-posts/edit.js:127 316 310 msgid "Author" 317 311 msgstr "" 318 312 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 320 315 msgid "Select an author" 321 316 msgstr "" 322 317 318 #: includes/frontend/blocks/build/popular-posts/index.js:1 323 319 #: includes/frontend/blocks/src/popular-posts/edit.js:148 324 320 msgid "Number of posts" 325 321 msgstr "" 326 322 323 #: includes/frontend/blocks/build/popular-posts/index.js:1 327 324 #: includes/frontend/blocks/src/popular-posts/edit.js:157 328 325 msgid "Post Types" 329 326 msgstr "" 330 327 328 #: includes/frontend/blocks/build/popular-posts/index.js:1 331 329 #: includes/frontend/blocks/src/popular-posts/edit.js:176 332 330 msgid "Order By" 333 331 msgstr "" 334 332 333 #: includes/frontend/blocks/build/popular-posts/index.js:1 335 334 #: includes/frontend/blocks/src/popular-posts/edit.js:180 336 335 msgid "Visits" 337 336 msgstr "" 338 337 338 #: includes/frontend/blocks/build/popular-posts/index.js:1 339 339 #: includes/frontend/blocks/src/popular-posts/edit.js:184 340 340 msgid "Date" 341 341 msgstr "" 342 342 343 #: includes/frontend/widgets/class-authors-widget.php:62 344 #: includes/frontend/blocks/build/popular-posts/index.js:1 343 345 #: includes/frontend/blocks/src/popular-posts/edit.js:188 344 #: includes/frontend/widgets/class-authors-widget.php:61345 346 msgid "Title" 346 347 msgstr "" 347 348 349 #: includes/frontend/blocks/build/popular-posts/index.js:1 348 350 #: includes/frontend/blocks/src/popular-posts/edit.js:195 349 351 msgid "Order" 350 352 msgstr "" 351 353 354 #: includes/frontend/blocks/build/popular-posts/index.js:1 352 355 #: includes/frontend/blocks/src/popular-posts/edit.js:199 353 356 msgid "Descending" 354 357 msgstr "" 355 358 359 #: includes/frontend/blocks/build/popular-posts/index.js:1 356 360 #: includes/frontend/blocks/src/popular-posts/edit.js:203 357 361 msgid "Ascending" 358 362 msgstr "" 359 363 364 #: includes/frontend/blocks/build/popular-posts/index.js:1 360 365 #: includes/frontend/blocks/src/popular-posts/edit.js:234 361 366 msgid "Display post count?" … … 364 369 #: includes/frontend/class-display.php:60 365 370 msgid "Please install and activate Top 10 plugin to display popular authors." 366 msgstr ""367 368 #: includes/frontend/class-display.php:186369 #, php-format370 msgid "Posts by %s"371 371 msgstr "" 372 372 … … 380 380 msgstr "" 381 381 382 #: includes/frontend/widgets/class-authors-widget.php:6 6382 #: includes/frontend/widgets/class-authors-widget.php:67 383 383 msgid "No. of authors" 384 384 msgstr "" 385 385 386 #: includes/frontend/widgets/class-authors-widget.php:8 1386 #: includes/frontend/widgets/class-authors-widget.php:87 387 387 msgid "Exclude admins" 388 388 msgstr "" 389 389 390 #: includes/frontend/widgets/class-authors-widget.php: 86390 #: includes/frontend/widgets/class-authors-widget.php:92 391 391 msgid "Show full name of Author" 392 392 msgstr "" 393 393 394 #: includes/frontend/widgets/class-authors-widget.php: 95394 #: includes/frontend/widgets/class-authors-widget.php:101 395 395 msgid "Time range" 396 396 msgstr "" 397 397 398 #: includes/frontend/widgets/class-authors-widget.php: 97398 #: includes/frontend/widgets/class-authors-widget.php:103 399 399 msgid "Overall" 400 400 msgstr "" 401 401 402 #: includes/frontend/widgets/class-authors-widget.php: 98402 #: includes/frontend/widgets/class-authors-widget.php:104 403 403 msgid "Custom time period (Enter below)" 404 404 msgstr "" 405 405 406 #: includes/frontend/widgets/class-authors-widget.php:10 2406 #: includes/frontend/widgets/class-authors-widget.php:108 407 407 msgid "In days and hours (applies only to custom option above)" 408 408 msgstr "" 409 409 410 #: includes/frontend/widgets/class-authors-widget.php:1 04410 #: includes/frontend/widgets/class-authors-widget.php:110 411 411 msgid "days" 412 412 msgstr "" 413 413 414 #: includes/frontend/widgets/class-authors-widget.php:1 07414 #: includes/frontend/widgets/class-authors-widget.php:113 415 415 msgid "hours" 416 416 msgstr "" 417 418 #. Description of the plugin 419 #: popular-authors.php 420 msgid "Display a list of the popular authors. A Top 10 WordPress plugin addon." 421 msgstr "" 422 423 #. Author of the plugin 424 #: popular-authors.php 425 msgid "WebberZone" 426 msgstr "" 427 428 #. Author URI of the plugin 429 #: popular-authors.php 430 msgid "https://webberzone.com" 431 msgstr "" 432 433 #: includes/frontend/blocks/build/popular-authors/block.json 434 #: includes/frontend/blocks/src/popular-authors/block.json 435 msgctxt "block title" 436 msgid "Popular Authors" 437 msgstr "" 438 439 #: includes/frontend/blocks/build/popular-authors/block.json 440 #: includes/frontend/blocks/src/popular-authors/block.json 441 msgctxt "block keyword" 442 msgid "popular authors" 443 msgstr "" 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 449 msgctxt "block keyword" 450 msgid "author" 451 msgstr "" 452 453 #: includes/frontend/blocks/build/popular-authors/block.json 454 #: includes/frontend/blocks/src/popular-authors/block.json 455 msgctxt "block keyword" 456 msgid "top 10" 457 msgstr "" 458 459 #: includes/frontend/blocks/build/popular-authors/block.json 460 #: includes/frontend/blocks/src/popular-authors/block.json 461 msgctxt "block description" 462 msgid "Show the list of popular authors" 463 msgstr "" 464 465 #: includes/frontend/blocks/build/popular-posts/block.json 466 #: includes/frontend/blocks/src/popular-posts/block.json 467 msgctxt "block title" 468 msgid "Popular Posts by Author" 469 msgstr "" 470 471 #: includes/frontend/blocks/build/popular-posts/block.json 472 #: includes/frontend/blocks/src/popular-posts/block.json 473 msgctxt "block keyword" 474 msgid "popular posts" 475 msgstr "" 476 477 #: includes/frontend/blocks/build/popular-posts/block.json 478 #: includes/frontend/blocks/src/popular-posts/block.json 479 msgctxt "block keyword" 480 msgid "post" 481 msgstr "" 482 483 #: includes/frontend/blocks/build/popular-posts/block.json 484 #: includes/frontend/blocks/src/popular-posts/block.json 485 msgctxt "block description" 486 msgid "Show the list of popular posts by author" 487 msgstr "" 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 493 msgid "Show post count" 494 msgstr "" 495 496 #: includes/admin/class-admin.php:148 497 msgid "Show the number of posts in parenthesis next to the author's name" 498 msgstr "" 499 500 #: includes/admin/class-dashboard-widget.php:42 501 msgid "Top Authors" 502 msgstr "" 503 504 #: includes/admin/class-dashboard-widget.php:67 505 msgid "No authors found." 506 msgstr "" 507 508 #: includes/admin/class-dashboard-widget.php:77 509 msgid "Configure Popular Authors Settings" 510 msgstr "" 511 512 #: includes/frontend/blocks/build/popular-authors/index.js:1 513 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:60 514 msgid "Post count displayed" 515 msgstr "" 516 517 #: includes/frontend/blocks/build/popular-authors/index.js:1 518 #: includes/frontend/blocks/src/popular-authors/components/DisplaySettings.js:61 519 msgid "No post count displayed" 520 msgstr "" 521 522 #. Plugin URI of the plugin 523 #: popular-authors.php 524 msgid "https://webberzone.com/downlods/popular-authors/" 525 msgstr "" -
popular-authors/trunk/popular-authors.php
r3224591 r3477391 9 9 * @license GPL-2.0+ 10 10 * @link https://webberzone.com 11 * @copyright 2020-202 5WebberZone11 * @copyright 2020-2026 WebberZone 12 12 * 13 13 * @wordpress-plugin … … 15 15 * Plugin URI: https://webberzone.com/downlods/popular-authors/ 16 16 * Description: Display a list of the popular authors. A Top 10 WordPress plugin addon. 17 * Version: 1. 3.017 * Version: 1.4.0 18 18 * Author: WebberZone 19 19 * Author URI: https://webberzone.com … … 37 37 */ 38 38 if ( ! defined( 'POP_AUTHOR_VERSION' ) ) { 39 define( 'POP_AUTHOR_VERSION', '1. 3.0' );39 define( 'POP_AUTHOR_VERSION', '1.4.0' ); 40 40 } 41 41 -
popular-authors/trunk/readme.txt
r3311374 r3477391 2 2 Tags: popular, popular authors, author, top authors, views, top 10 3 3 Contributors: webberzone, Ajay 4 Donate link: https:// ajaydsouza.com/donate/5 Stable tag: 1. 3.06 Requires at least: 6. 34 Donate link: https://wzn.io/donate-wz 5 Stable tag: 1.4.0 6 Requires at least: 6.6 7 7 Requires PHP: 7.4 8 Tested up to: 6. 88 Tested up to: 6.9 9 9 License: GPLv2 or later 10 10 … … 95 95 == Changelog == 96 96 97 = 1.4.0 = 98 99 Release 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 97 105 = 1.3.0 = 98 106 … … 117 125 == Upgrade Notice == 118 126 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.com127 = 1.4.0 = 128 New features and bug fixes. Check the release post on WebberZone.com
Note: See TracChangeset
for help on using the changeset viewer.