Mugambi-Ian / admin-chart-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

admin-chart-plugin

The plugin has a setting page

image

From here the adim is promted to enter data sample for 5 weeks, 7 days each week i.e week_1 = 1,2,42,50,790,123,5995

image

the values are stored in the wp_options table and when the admin visits the dashboard the values are then displayed with options to get the fisrt 7, 15 or 30 days.

image

image

Solution

The plugin:

  • implements a rest api that returns an array of values for the days requested. ie request days=5 will return an array of the 1st five values from week 1.
  • implements a widget on the dashboard to print a chart for the selected days.
  • implements an options page to act as the settings page for the plugin.

Getting started

  • The plugin uses react to load the widget. Run npm i in the plugin folder to load dependencies.
  • To run the plugin in development mode run npm script watch.
  • To run the plugin in production mode run npm script build to build a production version.

Video link

About


Languages

Language:PHP 46.9%Language:TypeScript 31.3%Language:JavaScript 15.0%Language:CSS 6.8%