Code Monkey home page Code Monkey logo

schunter's Introduction

schunter

Description

Short code hunter.

  1. Searches for shortcodes in your WordPress website

Planned features

  1. Allows selection of shortcodes to be registered
  2. Helps keep track of all known shortcodes

Installation

  1. Upload the contents of the schunter plugin to the `/wp-content/plugins/schunter' directory
  2. Activate the schunter plugin through the 'Plugins' menu in WordPress
  3. Use oik-batch to run the schunter logic

Frequently Asked Questions

What are the plugin dependencies?

schunter v0.0.1 is dependent upon oik or oik-lib It's designed to be run in batch mode using oik-batch which is something like WP-CLI. These plugins are available from github.

Screenshots

  1. schunter in action

Upgrade Notice

0.0.2

Now supports scanning of posts, postmeta and options, including serialized data

0.0.1

New plugin, available from github.

Changelog

0.0.2

  • Added: Fixes #1 - schunter should cater for script and CDATA sections
  • Added: Fixes #2 - schunter should cater for style tags
  • Added: Fixes #3 - schunter should cater for shortcodes which don't expand $content
  • Added: Fixes #4 - schunter should cater for postmeta and options, including serialized data

0.0.1

  • Added: New plugin. Dependent upon oik / oik-lib. Scans for shortcodes in posts.

Further reading

If you want to read more about the oik plugins then please visit the oik plugin "the oik plugin - for often included key-information"

schunter's People

Contributors

bobbingwide avatar

Watchers

 avatar  avatar

schunter's Issues

Add admin interface to view the found results

Where v0.0.1 implements a batch search facility we need an admin interface to view the results.

Requirements

  • pageable multi-column display of shortcodes that have been discovered
  • columns for shortcode, status flags, reference count and content links
  • action to display details of references
  • sortable by short code name, status and reference count
  • action to mark as 'not a shortcode'
  • tab to control building/re-building of the schunted data
  • checkboxes and other fields to control (re)build processing
  • NFRs: security, performance, operability

Proposed solution

  • display information using wp_list_table based classes
  • multi-tabbed admin page
  • extendable to allow other plugins to enhance the information
  • satisfy NFRs: security, performance, operability

schunter should cater for script and CDATA sections

There are quite a few places where things that might appear to be shortcodes are not actually shortcodes.

  • script and CDATA sections
  • shortcodes inside shortcodes which don't expand the shortcodes in $content
  • inline CSS inside style tags

These should be ignored by the routine that detects shortcodes.
This issue is for the CDATA problem.

Proposed solution

  • Use wp_html_split() to split the content
  • Ignore <script and <style tags

schunter should cater for style tags

As noted in #1 there are quite a few places where things that might appear to be shortcodes are not actually shortcodes.

If the content contains CSS enclosed in <style tags then we should ignore this content since the square brackets are more likely to be attribute selectors than shortcodes.

Proposed solution

  • Ignore content found within <style tags

schunter should cater for shortcodes which don't expand $content

Some shortcodes which accept enclosed content will process the content through shortcode expansion. Others don't.

The solution should cater for those shortcodes which don't process what appear to be shortcodes in enclosed content.

Example - enclosed content expanded
[bw_blockquote]Hello [wp][/bw_blockquote]
Expected output

Hello WordPress

Example - enclosed content NOT expanded
[bw_geshi html] Hello [wp][/bw_geshi]

Expected output
Hello [wp]

schunter should cater for serialized data in postmeta and options

Requirements

  • Search for shortcodes in postmeta data
  • Search for shortcodes in options
  • Search for shortcodes in serialized data

The original search logic was rather naive and could not handle processing complex serialized data.

It was easy to detect that the content might contain a shortcode but it wasn't doing a very good job of catering for the issues documented in #1, #2 and #3.

It also turns out that some plugins create options and/or post meta data which appear to contain shortcodes but aren't really. e.g. options fields: rewrite_rules, _site_transient_update_plugins, exploitscanner_results

Proposed solution

  • Extend the solution to scan postmeta at the same time as scanning posts
  • Extend the solution to scan options.
  • Support scanning of serialized data

We need to apply the same logic to serialized data as we do to plain text.
To achieve this we need to deserialize the serialized data, and process each nested array recursively.

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.