Giter Site home page Giter Site logo

versusbassz / entity-viewer Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 1.0 932 KB

Displays data (properties, custom fields) of WordPress entities (posts, users, terms, comments) for developers

Home Page: https://wordpress.org/plugins/entity-viewer/

License: GNU General Public License v2.0

PHP 47.12% JavaScript 37.07% SCSS 8.05% Makefile 4.41% Shell 3.35%
plugin custom-fields wordpress

entity-viewer's Introduction

Entity viewer

It's a WordPress plugin that displays properties and custom fields of WordPress entities (posts, users, terms, comments) for debugging/development purposes.

Features

  • Supported entities: posts (including custom post types), users, terms, comments
  • Displayed data: properties (e.g. ID, guid, post_type) and custom fields (e.g. _edit_lock, _thumbnail_id )
  • Sorting by different conditions (ASC/DESC)
  • Searching/filtering (with highlighting of found result)
  • Pretty viewing of serialized data
  • Auto-updating on Gutenberg's "publish/update" actions
  • Manual updating without refreshing a whole page

How it works

The plugin displays the metabox on "edit" pages of supported WordPress entities in the WP Admin Panel.
The required role to access the info is Administrator for "Single site" mode and Super Admin for "Multisite".

Links

Versioning and stability

The project follows https://semver.org/

License

The license of the project is GPL v2 (or later)

entity-viewer's People

Contributors

dependabot[bot] avatar versusbassz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

reswordpress

entity-viewer's Issues

glob-parent security issue

Dependabot cannot update glob-parent to a non-vulnerable version
The latest possible version that can be installed is 3.1.0 because of the following conflicting dependency:

@babel/[email protected] requires glob-parent@^3.1.0 via @nicolo-ribaudo/[email protected]
The earliest fixed version is 5.1.2.

GHSA-ww39-953v-wcq6

CVE-2020-28469
high severity
Vulnerable versions: < 5.1.2
Patched version: 5.1.2
This affects the package glob-parent before 5.1.2. The enclosure regex used to check for strings ending in enclosure containing path separator.

Discussions in the babel repo

Move to React

To do after #6 (upd: done)

Subtasks

  • Use real data from DB
  • state management (React.Context ???) --- IMO, it isn't necessary for now, coz the widget is too small and independent + it doesn't have too much sub-components
  • search for react-libraries to replace the current jquery-like ones
    • js-cookie library stays installed via npm
    • stupidtable removed
  • wrapping layout for entities that don't support Metabox API

Notes

Add an ability to toggle visibility of any field

The possible implemention:

  • count values lengths on the backend and add a prop to the field, sort of toggle: true
  • if the field is true add +/- toggle button (pos:a, r0, t0, visible on hover) to a related value
  • the field has to be closed by default, a fixed part of the field has to be visible in this state (with gradient)

Add a github workflow to do releases on wp.org automatically

Shoud be triggered by creating a release in the Github repository.

Tasks

  • deploy/release to wp-org
  • upload same .zip file to a created release on github --- cancelled, for now (wp.org is a good place to download zip-releases of the plugin; added the separate issue for that #75)

Notes

Github Actions

Test this on https://github.com/versusbassz/sortable-id-columns --- (done, see the comment below)

Examples in other plugins

Chose names for the plugin

  • visual name (on wp.org plugin's page - h1)
  • wp.org slug
  • github repo slug

Options:

  • db-data-viewer (the goals of the project are wider)
  • entity-viewer --- seems fit
  • meta-viewer (looks good, the goals of the project are wider)
  • metashark (copyright)
  • datashark (copyright)
  • metaui (copyright)
  • meta-explorer (the goals of the project are wider)
  • data-explorer ("data" is not an exact word for the goals)

The result

  • visual name (on wp.org plugin's page - h1): Entity Viewer
  • wp.org slug: entity-viewer
  • github repo slug: entity-viewer

i18n

The textdomain name: entity-viewer (the same as the slug of the plugin)
Also:

  • the plugin has to be compatible with translate.wordpress.org
  • add filter/setting to disable i18n if it's necessary --- filter vsm/is_plugin_allowed

Docs

Misc

"Refresh" button

TODO after #7

Subtasks

  • add "Refresh data" button to the top of the widget to the right of the "Search" functionality
  • something for AJAX requests: axios | native fetch (caniuse) --- let's start with native fetch (95% compatible)
  • Security: allow requests for REST API handler only for a user that "can_edit" requested item's data | capability "manage_options | delete_plugins ???" --- chose delete_users, for now
  • nonce
  • display smth if error happened
  • "Done!" message (color: green) on successful update, getting hidden after 1.5 sec.
  • display "Last update" even for an initial state
  • lock the button during request
  • phrase on the left: "Last updated: H:i:s am/pm"

Docs

Add nesting of displayed entities

For example, it should be possible to watch a metabox with a "last editor"'s user data (e.g., in modal window) when you explore _edit_lock field in the plugin's metabox on Post edit page

Better/additional type of displaying complex (serialized) values

Probably, like in https://wordpress.org/plugins/display-metadata/ (github) or in symfony/var-dumper or smth else.

Docs

Solutions

(if we discuss unserialize results)

improved var_export()

Also

Links

Migrate from node-sass to sass (Dart implementation)

https://sass-lang.com/blog/libsass-is-deprecated

It's also related to one of security alerts from Github.

History

First was the Ruby implementation. It was abaddoned in 2019.
After that was the C++ implementation (libsass). It was deprecated in October 2020, and also its wrapper for nodejs: https://github.com/sass/node-sass
Now it's recommended to move to the Dart implementation.

Dart SASS

Release on wordpress.org

Sub-tasks

  • chose a new name for the plugin --- see the comment below
  • comment-tags in the entry PHP-file (docs)
  • readme.txt (sample, docs-1, docs-2)
    • by Vladimir Sklyar + link
    • main section
    • changelog
  • rephrase admin noticies (display current/minimal versions)
  • license
  • a note about versioning (semver)

Update metabox content on Gutenberg "Publish/Update" actions

Add an ability to add custom entries for nesting

Do after: #43

It's for for users of the plugin.
For example, I add a custom field that contains an id of another entity item (post, user, etc), and I want to enable nesting for this field.
via filters ???

Add foundation for displaying data of entities themselves

The quite large task. Added a project for that: https://github.com/versusbassz/wp-meta-viewer/projects/2

Sub-tasks

  • refactor backend of meta fields to a Fetcher-class
  • "mysql" order for entity props
    • Fix visual problems (the width and wrapping of the "DB order" column in different situations)
  • memorize a chosen tab (by entity type, stored in localStorage as a json hashmap)
    • TTL for stored value --- See: #62
  • Improve displaying of tabs/sections names (human readable names, not ids)
  • to do smth with post_content (related to #2)
  • Handle wp_errors on the backend properly + display them on frontend

Misc

  • add an issue for better displaying of terms (maybe, several tables in one entity tab) --- See: #51
  • custom order (more convenient) for props of posts (to a separate issue) --- See: #52

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.