Plugin Directory

Changeset 2897747


Ignore:
Timestamp:
04/12/2023 10:47:44 AM (3 years ago)
Author:
smeunus
Message:

1.0.3 performance

Location:
dash-todo/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • dash-todo/trunk/README.txt

    r2897340 r2897747  
    55Requires at least: 5.9
    66Tested up to: 6.2
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    1515
    1616The Todo Plugin is a tool designed to enhance productivity and task management within the WordPress admin area. This plugin allows admins to easily create and manage tasks, keeping track of what needs to be done.
     17
     18You can manage the Todo from *Dashboard -> Todo* or from the *Dashboard widget*.
     19Note: If you toggle the *Todo widget*, a page reload is required. This is for Performance purpose.
    1720
    1821== Frequently Asked Questions ==
     
    2730
    28311. Screenshot of Dash Todo plugins interface.
     322. Screenshot of Dash Todo plugins widget.
    2933
    3034
     
    4246* Render raw title
    4347
     48= 1.0.3 =
     49* Performance
     50* Bug fix
     51
    4452== Upgrade Notice ==
    4553
     
    5058=1.0.2 =
    5159Feature updates
     60=1.0.2 =
     61Bug fix
  • dash-todo/trunk/build/index.asset.php

    r2897340 r2897747  
    1 <?php return array('dependencies' => array('react-dom', 'wp-api-fetch', 'wp-components', 'wp-element'), 'version' => 'cc6caa5544453326c6f7');
     1<?php return array('dependencies' => array('react-dom', 'wp-api-fetch', 'wp-components', 'wp-element'), 'version' => 'ba831b8f86f1801bf9fc');
  • dash-todo/trunk/build/index.css

    r2897340 r2897747  
    1 body.dash-todo .update-nag.notice.notice-warning.inline {
    2     display: none;
    3 }
    4 .dash-todo-header {
    5     background: #fff;
    6     border-bottom: 1px solid #dcdcde;
    7     margin: 0 0 2rem;
    8     text-align: center;
    9 }
    10 .dash-todo-header .dash-todo-title-section {
    11     align-items: center;
    12     clear: both;
    13     display: flex;
    14     justify-content: center;
    15     padding-top: 8px;
    16 }
    17 .dash-todo-header .dash-todo-title-section h1 {
    18     display: inline-block;
    19     font-size: 23px;
    20     font-weight: 600;
    21     line-height: 1.3;
    22     margin: 0 0.8rem 1rem;
    23     padding: 9px 0 4px;
    24 }
    25 .dash-todo #wpcontent,
    26 .dash-todo.auto-fold #wpcontent {
    27     padding-left: 0;
    28 }
    29 .dash-todo .dash-todo-layout .dash-todo-layout-body {
    30     margin: 0 auto;
    31     max-width: 800px;
    32 }
    33 .no-js {
    34     text-align: center;
    35 }
    36 .completed label {
    37     color: gray;
    38     text-decoration: line-through;
    39 }
    40 .single--todo .delete {
    41     display: none;
    42 }
    43 .single--todo:hover .delete {
    44     display: inherit;
    45     margin-bottom: 8px;
    46 }
    47 #dash_todo_admin_widget .dash-todo-header {
    48     display: none;
    49 }
    50 #dash_todo_admin_widget .components-card {
    51     box-shadow: none;
    52 }
    53 #dash_todo_admin_widget #app:empty:before {
    54     content: 'Please reload to see the content';
    55 }
     1body.dash-todo .update-nag.notice.notice-warning.inline{display:none}.dash-todo-header{background:#fff;border-bottom:1px solid #dcdcde;margin:0 0 2rem;text-align:center}.dash-todo-header .dash-todo-title-section{align-items:center;clear:both;display:flex;justify-content:center;padding-top:8px}.dash-todo-header .dash-todo-title-section h1{display:inline-block;font-size:23px;font-weight:600;line-height:1.3;margin:0 .8rem 1rem;padding:9px 0 4px}.dash-todo #wpcontent,.dash-todo.auto-fold #wpcontent{padding-left:0}.dash-todo .dash-todo-layout .dash-todo-layout-body{margin:0 auto;max-width:800px}.no-js{text-align:center}.completed label{color:gray;text-decoration:line-through}.single--todo .delete{display:none}.single--todo:hover .delete{display:inherit;margin-bottom:8px}#dash_todo_admin_widget .dash-todo-header{display:none}#dash_todo_admin_widget .components-card{box-shadow:none}#dash_todo_admin_widget #app:empty:before{content:"Please reload to see the content"}
  • dash-todo/trunk/build/index.js

    r2897340 r2897747  
    1 (()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var l in n)e.o(n,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:n[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,n=window.ReactDOM,l=window.wp.apiFetch;var a=e.n(l);const o=window.wp.components;function r(e){let{title:n,id:l,status:r,deleted:c}=e;const d=(0,t.useRef)(!1),[s,m]=(0,t.useState)("publish"===r),u=s?"publish":"pending";return(0,t.useEffect)((()=>{d.current?a()({path:`/wp/v2/todo/${l}`,method:"PUT",data:{status:u}}).then((()=>{})).catch((e=>console.log(e?.message))):d.current=!0}),[s,m]),(0,t.createElement)(o.__experimentalHStack,{alignment:"left",className:"single--todo"},(0,t.createElement)(o.CheckboxControl,{label:n,checked:s,onChange:m,className:s?"completed":"incomplete"}),(0,t.createElement)(o.Button,{style:{height:20},className:"delete",onClick:()=>{a()({path:`/wp/v2/todo/${l}?force=true`,method:"DELETE"}).then((()=>{c(!0)})).catch((e=>console.log(e?.message)))}},(0,t.createElement)(o.Icon,{icon:"trash",size:18,style:{color:"gray"}})))}function c(e){let{items:n,deleted:l}=e;return(0,t.createElement)(o.Card,null,(0,t.createElement)(o.CardBody,null,(0,t.createElement)(o.__experimentalVStack,null,n.map((e=>{var n;let{id:a,title:o,status:c}=e;return(0,t.createElement)(r,{key:a,title:null!==(n=o.raw)&&void 0!==n?n:o.rendered,id:a,status:c,deleted:l})})))))}function d(e){let{created:n}=e;const[l,r]=(0,t.useState)(""),c=e=>{e.preventDefault(),0!==l.trim().length&&(console.log(l),a()({path:"/wp/v2/todo",method:"POST",data:{title:l,status:"pending"}}).then((e=>{r(""),n(!0)})).catch((e=>console.log(e?.message))))};return(0,t.createElement)(o.Card,null,(0,t.createElement)(o.CardBody,null,(0,t.createElement)("form",{onSubmit:c},(0,t.createElement)(o.TextControl,{autoFocus:!0,label:"Add Todo item",hideLabelFromVision:!0,placeholder:"Type here and press Enter ↵",onChange:e=>r(e),value:l,onKeyDown:e=>{"Enter"===e.key&&c(e)}}))))}function s(){return(0,t.createElement)(o.Card,null,(0,t.createElement)(o.CardBody,null,(0,t.createElement)(o.__experimentalVStack,null,(0,t.createElement)(o.Spinner,null),(0,t.createElement)(o.Spinner,null))))}const m=document.getElementById("app");(0,n.render)((0,t.createElement)((function(){const[e,n]=(0,t.useState)([]),[l,o]=(0,t.useState)(!1),[r,m]=(0,t.useState)(!0);return(0,t.useEffect)((()=>{a()({path:"/wp/v2/todo?status=pending,publish&per_page=100&orderby=id&context=edit"}).then((e=>{n(e),m(!1)})).catch((e=>console.error(e?.message)))}),[l,o,r,m]),(0,t.createElement)("div",{className:"dash-todo-layout"},(0,t.createElement)("div",{className:"dash-todo-header"},(0,t.createElement)("div",{className:"dash-todo-title-section"},(0,t.createElement)("h1",null,"Todo"))),(0,t.createElement)("div",{className:"dash-todo-layout-body hide-if-no-js"},(0,t.createElement)(d,{created:()=>o(!l)}),r?(0,t.createElement)(s,null):(0,t.createElement)(c,{items:e,deleted:()=>o(!l)})))}),null),m)})();
     1(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var l in n)e.o(n,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:n[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,n=window.ReactDOM,l=window.wp.apiFetch;var a=e.n(l);const o=window.wp.components;function r(e){let{title:n,id:l,status:r,deleted:c}=e;const s=(0,t.useRef)(!1),[d,i]=(0,t.useState)("publish"===r),m=d?"publish":"pending";return(0,t.useEffect)((()=>{s.current?a()({path:`/wp/v2/todo/${l}`,method:"PUT",data:{status:m}}).then((()=>{})).catch((e=>console.log(e?.message))):s.current=!0}),[d,i]),(0,t.createElement)(o.__experimentalHStack,{alignment:"left",className:"single--todo"},(0,t.createElement)(o.CheckboxControl,{label:n,checked:d,onChange:i,className:d?"completed":"incomplete"}),(0,t.createElement)(o.Button,{style:{height:20},className:"delete",onClick:()=>{a()({path:`/wp/v2/todo/${l}?force=true`,method:"DELETE"}).then((()=>{c(!0)})).catch((e=>console.log(e?.message)))}},(0,t.createElement)(o.Icon,{icon:"trash",size:15,style:{color:"gray"}})))}function c(e){let{items:n,deleted:l}=e;return(0,t.createElement)(o.Card,null,(0,t.createElement)(o.CardBody,null,(0,t.createElement)(o.__experimentalVStack,null,n.map((e=>{var n;let{id:a,title:o,status:c}=e;return(0,t.createElement)(r,{key:a,title:null!==(n=o.raw)&&void 0!==n?n:o.rendered,id:a,status:c,deleted:l})})))))}function s(e){let{created:n}=e;const[l,r]=(0,t.useState)(""),c=e=>{e.preventDefault(),0!==l.trim().length&&a()({path:"/wp/v2/todo",method:"POST",data:{title:l,status:"pending"}}).then((e=>{r(""),n(!0)})).catch((e=>console.log(e?.message)))};return(0,t.createElement)(o.Card,null,(0,t.createElement)(o.CardBody,null,(0,t.createElement)("form",{onSubmit:c},(0,t.createElement)(o.TextControl,{autoFocus:!0,label:"Add Todo item",hideLabelFromVision:!0,placeholder:"Type here and press Enter ↵",onChange:e=>r(e),value:l,onKeyDown:e=>{"Enter"===e.key&&c(e)}}))))}function d(){return(0,t.createElement)(o.Card,null,(0,t.createElement)(o.CardBody,null,(0,t.createElement)(o.__experimentalVStack,null,(0,t.createElement)(o.Spinner,null),(0,t.createElement)(o.Spinner,null))))}const i=document.getElementById("TodoApp");(0,n.render)((0,t.createElement)((function(){const[e,n]=(0,t.useState)([]),[l,o]=(0,t.useState)(!1),[r,i]=(0,t.useState)(!0),m=new URLSearchParams({_fields:"id,title,status",status:"pending,publish",per_page:100,orderby:"id",context:"edit"});return(0,t.useEffect)((()=>{a()({path:`/wp/v2/todo?${m}`}).then((e=>{console.log("fetching"),n(e),i(!1)})).catch((e=>console.error(e?.message)))}),[l,o]),(0,t.createElement)("div",{className:"dash-todo-layout"},(0,t.createElement)("div",{className:"dash-todo-header"},(0,t.createElement)("div",{className:"dash-todo-title-section"},(0,t.createElement)("h1",null,"Todo"))),(0,t.createElement)("div",{className:"dash-todo-layout-body hide-if-no-js"},(0,t.createElement)(s,{created:()=>{o(!l)}}),r?(0,t.createElement)(d,null):(0,t.createElement)(c,{items:e,deleted:()=>{o(!l)}})))}),null),i)})();
  • dash-todo/trunk/dash-todo.php

    r2897340 r2897747  
    33/**
    44 * Plugin Name:       Dash Todo
    5  * Plugin URI:        https://github.com/shariffff/dash-todo
     5 * Plugin URI:        https://github.com/shariffff/wp-starter-plugin
    66 * Description:       A Todo management plugin for WordPress site admin. Stay consistent and never forget anything.
    77 * Text Domain:       dash-todo
     
    99 * Author:            Sharif Mohammad Eunus
    1010 * Author URI:       https://sharifff.com
    11  * Version:           1.0.2
     11 * Version:           1.0.3
    1212 * Requires at least: 5.9
    1313 * Tested up to:      6.2
     
    2828define('DASH_TODO_PLUGIN_FILE', __FILE__);
    2929define('DASH_TODO_PLUGIN_DIR', __DIR__);
    30 define('DASH_TODO_PLUGIN_VERSION', '1.0.2');
     30define('DASH_TODO_PLUGIN_VERSION', '1.0.3');
    3131
    3232require 'includes/enqueue-scripts-from-asset-file.php';
  • dash-todo/trunk/includes/admin-page.php

    r2897340 r2897747  
    8787function admin_page()
    8888{
    89     echo '<noscript>Enable JavaScript to visit this page</noscript><div id="app"></div>';
     89    echo '<noscript>Enable JavaScript to visit this page</noscript><div id="TodoApp"></div>';
     90    if (!wp_script_is('dash-todo-index')) {
     91
     92        _e('Please reload to see the todo items.', 'dash-todo');
     93    }
    9094}
    9195
  • dash-todo/trunk/includes/enqueue-scripts-from-asset-file.php

    r2897340 r2897747  
    1111
    1212
    13         if (in_array('wp-react-refresh-runtime', $script_asset['dependencies'], true) && !constant('SCRIPT_DEBUG')) {
     13        if (in_array('wp-react-refresh-runtime', $script_asset['dependencies'], true) && !defined('SCRIPT_DEBUG')) {
    1414            unset($script_asset['dependencies']['wp-react-refresh-runtime']);
    1515        }
Note: See TracChangeset for help on using the changeset viewer.