Git Product home page Git Product logo

oik-shortcodes's Introduction

oik shortcodes server

banner

Description

The oik shortcodes server is used to document and serve the help documentation for plugins and themes:

  • lazy smart shortcodes
  • oik APIs, classes and methods - documenting the public and private oik/bw Application Programming Interface
  • hooks - the action and filter hooks that oik plugins Invoke or Implement
  • blocks - for the WordPress block editor aka Gutenberg

It provides the following shortcodes:

  • [bw_api] - automatically report the syntax for an API
  • [api] - link to selected API(s)
  • [apis] - link to related APIs (in a list)
  • [blocks] - link to related Blocks
  • [classes] - list of classes
  • [codes] - link to related shortcodes
  • [file] - display file contents
  • [files] - list of files
  • [hook] - link to selected hook(s)
  • [hooks] - links to action / filter hooks
  • [md] - markdown

It provides an admin page where APIs can be added BUT is more useful when invoked using oik-batch, a WP-CLI like interface

In order for the Calls and Called by trees to be maintained you have to process each API twice.

Features

  • Advanced shortcodes to display content
  • Parsed APIs and files are stored to improve display performance. (v1.22)
  • Parses WordPress core, plugins and themes (v1.20)
  • Pagination of long lists
  • 'Compatible with Shortcake' checkbox?

New in version 1.41.0

  • [blocks] shortcode supports link to block variations

New in version 1.39.0

  • Supports Comments on Blocks and Block examples

New in version 1.38.0

  • Supports block variations as children of the parent block

New in version 1.37.0

  • Virtual field block_catalogued
  • WordPress APIs are now cached in a JSON file

New in version 1.35.0

  • Adds AJAX function to create a block post

New in version 1.34.0

  • Adds Depends on field for Block and Block examples custom post types

New in version 1.31.0

  • Adds support for WordPress Blocks and Block examples

New in version 1.22

  • The first time that the API or file is parsed then a new post is created, with a link to the source post.
  • The second parse will update the version, setting the _oik_parse_count field to the timestamp of the source file.
  • Subsequent parses will only update the saved version if the source file has changed, or been touched.
  • Display of APIs or files will check if the saved version is the latest.
  • Note: Cached parsed output is currently NOT paginated.

New in version 1.20

  • Support for themes, using on oik-themes server

New in version 1.19

  • [files] shortcode to list files delivered by a plugin
  • [file] shortcode for links to files
  • [classes] shortcode to list classes implemented in a plugin
  • Support for pagination of long lists

New in version 1.15

  • Support for recording files in the "oik_file" CPT
  • [file] shortcode to display the logic implemented in a file, ignoring classes, methods and APIs

New in version 1.10

  • Support for classes and methods
  • Reflection functions applied against dummy functions if not alreay loaded

New in version 1.08

  • routines to dynamically register action and filter hooks.
  • routines to associate APIs to hooks
  • listing of Invokers and Implementers of actions and hooks

Installation

  1. Upload the contents of the oik-shortcodes plugin to the `/wp-content/plugins/oik-shortcodes' directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Define your content using wp-admin or the Ajax interface

Frequently Asked Questions

Where is the FAQ?

oik FAQ

Can I get support?

Yes - see above

Screenshots

  1. Editing an oik_api - showing the API type select list
  2. Editing an oik_shortcode

Upgrade Notice

1.41.3

Upgrade for more changes for PHP 8.2 support.

Changelog

1.41.2

  • Changed: Update Copyright year #91
  • Fixed: Correct latest_hd5_hash to latest_md5_hash #84
  • Changed: Default description to '' not null #84
  • Changed: Declare $handlers #91
  • Tested: With WordPress 6.4-RC3 and WordPress Multisite
  • Tested: With Gutenberg 16.9.0
  • Tested: With PHP 8.0, PHP 8.1 and PHP 8.2
  • Tested: With PHPUnit 9.6

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"

For more information about the WordPress Code Reference

http://make.wordpress.org/docs/2013/03/07/better-wordpress-code-reference/

Where it's supposed to reside:

http://developer.wordpress.org/

How to document an action or filter hook:

http://make.wordpress.org/core/handbook/inline-documentation-standards/php-documentation-standards/#4-hooks-actions-and-filters

WP-parser:

https://github.com/rmccue/WP-Parser

Places where you can find Function reference material:

http://api.wordpress.org/core/handbook/1.0/?function=__return_true&version=3.6.1&locale=en_US&redirect=1 http://api.wordpress.org/core/handbook/1.0/?function=_return_true&version=3.6.1&locale=en_US&redirect=1

http://codex.wordpress.org/Function_Reference/_return_true

oik-shortcodes's People

Contributors

bobbingwide avatar

Stargazers

 avatar

Watchers

 avatar  avatar

oik-shortcodes's Issues

_oiksc_get_php_files should ignore the .git folder

Currently the _oiksc_get_php_files() function will return a list of all the files in a particular directory. This includes .git subdirectory.

The code should ignore any files in the .git directory.

Add component parameter to [codes] to force display of shortcodes for a plugin/theme

There are times when we want to display all the shortcodes for a plugin/theme but the current post is not that particular theme. The particular example is when the theme is a child theme and it's the template theme that is delivering the shortcodes.

We can use this for any child theme of the Genesis theme framework.
This solution will be used in oik-plugins.com and possibly genesis.wp-a2z

Proposed solution

  • Add component parameter to the [codes] shortcode.
  • The value passed is the post ID of the plugin/theme.
  • This is used as the value for the meta key _oik_sc_plugin

oikai_format_markdown_line() expanding more shortcodes than intended

When I added logic to cater for @see and @link in oikai_format_markdown_line I took a short cut and implemented the markdown expansion using shortcodes.

I didn't realise that there could be some shortcodes that I didn't want expanding.

When reprocessing the oik API the following Fatal message was issued.

Processing: bw_field_function_title,bw_field_function_title,includes/bw_formatter.inc

Fatal error: Uncaught Error: Call to undefined function gobang() in /home/oikplugi/public_html/wp-content/plugins/oik-bob-bing-wide/shortcodes/oik-plug.php:506
Stack trace:
#0 /home/oikplugi/public_html/wp-content/plugins/oik-bob-bing-wide/shortcodes/oik-plug.php(400): bw_get_readme_data('add-to-any')
#1 /home/oikplugi/public_html/wp-content/plugins/oik-bob-bing-wide/shortcodes/oik-plug.php(350): bw_get_local_plugin_data('add-to-any')
#2 /home/oikplugi/public_html/wp-content/plugins/oik-bob-bing-wide/shortcodes/oik-plug.php(184): bw_get_plugin_info2('add-to-any')
#3 /home/oikplugi/public_html/wp-content/plugins/oik-bob-bing-wide/shortcodes/oik-plug.php(55): bw_get_plugin_info_cache2('add-to-any')
#4 /home/oikplugi/public_html/wp-content/plugins/oik/oik-add-shortcodes.php(205): bw_plug(Array, '', 'bw_plug')
#5 /home/oikplugi/public_html/wp-includes/shortcodes.php(326): bw_shortcode_event(Array, '', 'bw_plug')
#6 [internal function]: do_shortcode_tag(Array)
#7 /home/oikplugi/public_html/wp-includes/shortcodes.php(223): preg in /home/oikplugi/public_html/wp-content/plugins/oik-bob-bing-wide/shortcodes/oik-plug.php on line 506
<table><tbody><tr><th>Plugin name and description</th><th>Plugin links</th><th>Version, total downloads, last update, tested</th></tr>

The shortcode that causes the most hassle is [bw_pages]. This will load content from the website and expand shortcodes within the content. The one that caused the system to crash was [bw_plug]. In oik-plugins.com it crashed because the code couldn't find the readme.txt file for the add-to-any plugin. That's because it's called README.txt in that plugin.

In my local copy I get a different message.... but that's due to another change. The bottom line is still the same. There are shortcodes in the comments that I don't want to be expanded.

Come to think of it, processing the markdown when parsing the code is rather unnecessary.

Improve performance of oiksc_create_file

Similar to issue #9, the performance of oiksc_create_file() is pretty dire in a largish system.
Some files implement many functions.
We need to find links for each of the functions and methods.
If each link takes .5 second to find then it will obviously take a long time to create the oik_parse_source for the file.
It should be able to use a similar caching method to that for APIs.

Improve performance by operating locally

Currently the createapi2.php file ( in oik-batch ) runs as a client server process.
Processing would be more efficient if run as a batch process, using a local database.

Proposed solution

Use oik-batch's oik-wp.php to invoke WordPress locally against the oik-shortcodes plugin passing the name of the plugin/theme to load, previous version etc.

oik-shortcodes.php will respond to the action hook "run_oik-shortcodes.php"

Improve display of shortcode parameters ( oik_sc_param post type)

Each shortcode may support a range of parameters. When a shortcode is registered using the oik options > create shortcode admin page it creates a number of posts with post type oik_sc_param.
At the moment, on oik-plugins, when you view a particular instance of a shortcode parameter you don't see much unless it has been manually edited.

Proposed solution

Automatically display the fields and the syntax for the shortcode.
Two changes are required:

  • Automate the creation of additional content for oik_sc_param to append [bw_code name=.] if there aren't already shortcodes in the content
  • Change the genesis-oik theme to display a sidebar and include the sidebar-alt widget area - which will display the Information using [bw_fields].

Add links to GitHub and/or TRAC where applicable

In the WordPress developer reference ( https://developer.wordpress.org ) there are links which allow you to view the source of PHP files on Trac. This then allows you to view version history using the Blame link.

GitHub also provides the ability to view source and Blame.

It would be nice if oik-shortcodes could also provide links, where applicable

Content type View on GitHub View on Trac Notes
API Yes Yes link to the starting line number
File Yes Yes link to line 1
Class No No View the File first
Hook No No Further work needed in this area

View on GitHub depends on the plugin / theme being defined with a GitHub repository
View on Trac will be available for WordPress core, and WordPress plugins & themes.

Better support for PHP reserved words and keywords

The PHP parser uses unique token ids for most keywords but there are some reserved words which get treated as T_STRING.

Since oikai_determine_function_type() uses get_defined_functions() to find if a function is a PHP function or not, then the logic to create pragmatic links currently creates links for keywords such as true and false.

This function should be extended to support the reserved words and keywords that are currently being missed.

[hooks] shortcode not listing anything for an oik-theme

When a hook is being created by oiksc_create_oik_hook() the post_meta field called '_oik_api_plugin' should be populated with the post_id of the plugin/theme to which the hook is related.

function oiksc_get_plugin() obtains this value from the global $plugin_post.

This field does not appear to be set for themes.

oiksc_create_shortcode dies in wp-admin

Having added some protection to admin/oik-create-apis.php oiksc_create_shortcode() now dies midway through processing an oik ptions > Create shortcode request.

Perhaps the oiksc_yoastseo() function needs to be extracted from the file. It's needed when creating both the oik_shortcode and the shortcode_params.

Improve the contents of oik_parsed_source

The oik_parsed_source post type stores the results of parsing a function, method or file.
The links reflect the primary URL of the site.
These use up more disk space than really necessary, are hardcoded for the http:// protocol.

Suggest that for links to the current site these are relative URLs.

Support formatting of documentation for parameters that are arrays

developer.wordpress.org nicely formats @param tags where the parameter type is an array.
Each array field is documented once when the array is first defined
e.g.

* @param array $args {
 *     Optional. An array of arguments.
 *
 *     @type type $key Description. Default 'value'. Accepts 'value', 'value'.
 *                     (aligned with Description, if wraps to a new line)
 *     @type type $key Description.
 * }

and then it's referenced in all other params via an @see tag.

* @param array $cargs {@see class::method()}
* @param array $fargs {@see function()}

WordPress documentation is here

https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-1-parameters-that-are-arrays

The WordPress documentation refers to phpDocumentor standards which uses a slightly different approach. e.g.

* @param array $args {
*     @var bool   $required Whether this element is required
*     @var string $label    The display name for this element
* }

Great! @var instead of @type

BTW: The WordPress documentation mentions something called hash notation. It doesn't describe what hash notation is supposed to be. But it does link to phpDocumentor PSR-5 recommendations... where there is no mention of the term.

Super..

:sarcasm off.

Notice: undefined offset: 1 in class-oiksc-parsed-source.php

When viewing a local version at wp.a2z/oik_file/wrapper-php I got the following 3 notices

Notice: Undefined offset: 1 in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\class-oiksc-parsed-source.php on line 479

Notice: Undefined offset: 1 in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\class-oiksc-parsed-source.php on line 494

Notice: Undefined offset: 1 in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\class-oiksc-parsed-source.php on line 492

The problem doesn't occur on the live site http://wp-a2z.org/oik-file/wrapper-php

Problems displaying oik_shortcodes when WordPress SEO is activated

Problem description

The oik_shortcodes post type will add a [bw_code] shortcode to the content
if no shortcodes are present. This shortcode is then run and further functionality invoked to display Examples, Snippets etc.

Sometimes this works.
Other times we get recursion, leading to an un-captured Fatal error and an Aw, snap message from Chrome.

Problem explanation

When WordPress SEO is trying to display OpenGraph tags in the header it attempts to obtain the meta description for the post. If this is not available it builds one from the excerpt. If that is not available WordPress creates an excerpt which invokes the_content.

Not knowing any better all the plugins that hook into the_content do their thing and then the excerpt gets produced.

Problems can occur if nested shortcode expansion is performed and 'the_content' filtering goes recursive.

Even if it doesn't go wrong, you'll notice that up to twice as much work is being done than is actually required.

Workaround

Either define a Meta Description in the WordPress SEO meta box.
or deactivate WordPress SEO.

Solution

Add oik_get_the_excerpt() to prevent recursion in 'the_content' processing.
Change the 'the_content' filter logic so that content is only 'enhanced' once.

paired_replacements() converts a single ' * ' to '<em>/em>'

In http://www.oik-plugins.com/oik_api/_bw_show_contact_form_oik/ the Description contains
Note: The * indicates Required field

Expected output

As shown. The single * should not be converted.

Actual output

Note: The <em>/em> indicates Required field

This leads to the rest of the content being italicised.

Explanation

The asterisk is incorrectly treated as markdown emphasis by the paired_replacements() function.

Proposed solution

Check for overlaps in the paired replacements.

Workaround

Change the Description

Improve class oiksc_function_loader for PHP 7

In order to be able to use PHP Reflection logic on function prototypes we create dummy functions called oiksc_dummy_function_$fid in temporary files and then load the functions using require_once.

In PHP 7, if the code contains parent:: or self:: then it produces PHP Fatal error: Cannot use "parent" when no class scope is active or Cannot use "self" when no class scope is active

This causes createapi2 to crash. We need a workaround.

Better support for &#nn; characters and HTML inside strings

In the dynamic reference for an API some of the code inside strings and comments was being processed by the browser, converting HTML entities and tags.
This made some logic difficult to read, especially in parts of the code where translation was being done from the HTML entity to the character or vice-versa.

Proposed solution

  • The parsing code should detect situations where HTML entities and tags are used in string constants and comments and adjust them accordingly
  • The code should allow for dynamically generated comments for the stripped down file display where function or method links are inserted. These links must continue work

Automate the creation of Yoast SEO post meta data

When creating an oik_api, oik_class or oik_file post type object we should also create the
post meta data that's used by Yoast SEO. This will save a bit of time during front-end run-time processing as Yoast SEO will not need to attempt to build the meta description from the post content.

The post meta data to be created includes _yoast_seo_focuskw and _yoast_seo_metadesc.

The same solution could apply when creating an oik_shortcode post type. See also #1

Aside: It would also be nice if we could convince Yoast SEO to stop nagging when the post content is dynamically generated from a single shortcode.

Fatal error when parsing shared library files

The original logic in oikai_pseudo_reflect() would use Reflection function logic against the actual class, method or function if it was already loaded

We also tested if docblock comments were actually available. WP Engine's code stripped them.

When parsing an updated shared library file this logic led to a Fatal error due to differences between the actual file being parsed and the file that had been loaded. In our case the file we were parsing was libs/bobbfunc.php ( part of oik ) which is shared by oik-bwtrace. The version loaded by oik-bwtrace was older so the start and end line numbers for the functions were different.

Solution

In addition to testing if docblock comments are available, check if shared libraries have been loaded.
If they have then don't trust the code that's already been loaded. It may not match the code we want to parse.

Improve performance with pragmatic links

Some shortcodes, such as [hook], [file] and [api] can take time to find the permalink.
There can be many links on a page.
But the user's only going to click on one of them.
So, unless there is some useful information in the link ( such as the API title) there's little point attempting to resolve the link immediately.
404 handling can be used to pragmatically deal with links that weren't found,
or, if it's enabled, we can attempt to use AJAX when the user shows some intent to click on the link.

Add _component_version virtual field to provide current status of the API Reference

In the Information block on oik-plugins and WP-a2z we display contextual information for content. Rather than having to manually configure this for the site it would be nice if we could display the version of the currently installed component.
For many custom post types, by following noderef links it is possible to determine the component name. Knowing the post type of the component we can then determine the currently installed version.

For the simplest implementation minor changes will be required to oik-plugins and oik-themes as well.
We'll refer to this issue for that.

oik_file display not paginated on wp-a2z.org

the logic in oiksc_display_oik_file() was changed between 1.27.2 and 1.27.6 and now it appears that pagination is no longer being performed. ie. oikai_navi_parsed_source() is not being called. Instead, the inefficient logic is being invoked. This introduces a serious performance issue.

Requests of form oik-shortcodes/shortcode/funcname result in 404 page

Up to v1.27.2 requests of the form oik-shortcodes/shortcode/funcname were handled via template_redirect hook invokingoiksc_template_redirect`. This was slightly inefficient since the main query was run, then the template redirect kicked in.

In v1.27.3, under "Odds and Sods" the code was changed to implement the request filter.
The solution attempts to caters for DIY oik shortcodes, where the funcname is diy_oik_do_shortcode_simplified by not using this value in the query.

It did not correctly handle other funcname values. It passed a string value for _oik_sc_func, where an integer value ( a noderef ) is expected.

Pragmatic solution

Ignore the value of the funcname. There may be duplicates anyway. e.g. audio is implemented by both WordPress and JetPack.

If the request results in a 404 then perhaps we could either implement the original template redirect logic or, for Genesis based themes, continue to implement oiksc_genesis_404().

Parsing a theme produces "Source file not available"

The logic in oiksc_build_callees() assumes that it's building the caller/callee associations for a plugin. When invoked for a theme it doesn't find the correct "slug" for the theme, so it fails to determine the component_type and therefore can't find the right file.

Proposed solution

Implement a QAD solution to try getting the post meta value for _oikth_slug when it's failed to get a value for _oikp_slug.

Improve logic for hooks - parsing and displaying

In oiksc_create_oik_hook() a TODO mentions "We need to improve the docblock stuff and record multiple places where a hook is invoked."

The Genesis Theme Framework and its child themes spends a lot of time adding and removing actions and filters. We need to improve the logic for hooks to enable the Dynamic API Reference to be able to show where the hook is referenced.

We also need to improve the logic associated with the docblock... displaying the parameters in the same was as we do for functions and methods.
This needs to take into account the fact that the hook may be invoked from multiple places.

Cater for deleted logic: files, classes, functions and methods

Some plugins remove logic between versions.
Some plugins deprecate functions, others simply remove them.
oik-shortcodes needs to cater for deletions of

  • files
  • classes
  • functions
  • methods

and possibly

  • hooks
  • shortcodes

Example.
The class Jetpack_VideoPress_Shortcode was in jetpack/modules/videopress/shortcode.php in v3.9.6.

The class no longer exists in the latest version ( 4.0.4 ); it was removed by changes in Automattic/jetpack@ba4af49

Improve performance of oiksc_create_api

In a largish site, as the number of records in wp_posts and wp_postmeta increases so the performance of SQL queries degrades. When parsing an API the time taken to find the post IDs of related APIs, classes, hooks etc causes server transactions to take an inordinate amount of time.

On my PC, with 47K posts and 230K post meta each query to find oik_api posts based on post meta data takes up to 500 milliseconds. Note: There are 15K oik_api posts with the same number of post meta rows with meta_key _oik_api_name

This is 3 times the elapsed time when there are a third of the number of records.

Note also that in the larger system the tables are InnoDB, in the other they're MyISAM. This may make a difference; I don't know. I'm using MySQL 5.6.15. InnoDB buffer pool size is 291MiB.

Server transaction times range considerably, but can easily take up to 30 seconds with SQL processing being 80% of the processing.

Proposed solution

We know that performance of queries against wp_postmeta is slow due to the lack of an index on the meta_value column ( one reason why /scribu/wp-posts2posts ), but we aren't yet ready to move away from using wp_postmeta.

We believe some performance gain will be made by pre-loading known information related to the API in question and using in-memory lookups for the relevant IDs and the like.

Uncaught Error: Cannot access self:: when no class scope is active

When attempting to detect the default value of a parameter to a class method we need to be able to cater for parameters declared with default values such as self::MY_CLASS_CONSTANT

The problem occurs in ReflectionParameter->getDefaultValue() in \oik-shortcodes\shortcodes\oik-api-importer.php.

Temporary workaround

Change the code to use the literal value of the constant

[hooks] shortcode not listing anything for wordpress-seo

I've recently parsed Yoast SEO (WordPress SEO) on wordpress-seo.wp0a2z.org.
No hooks were listed on the hooks tab. It appears that the _oik_hook_plugin post meta data is not being set.

Could be similar to #13. Note: It worked fine when running locally on Windows.

Docblock markdown formatting error for some functions

When a function's docblock contains a list prefixed by *'s then the generated output is displayed incorrectly.

Unexpected result

Instead of appearing as a list the '*' is converted into <em>/em>.

Expected result

We should deal with unnumbered lists which are prefixed by * as list items and not as emphasis

Support PHP 7.1

Add support for PHP 7.1.

Below is the first example of a problem with the current code under PHP 7.1

Expected output

When viewing an API such as http://qw/oikcom/oik_api/bw_shortcode_event/ we don't expect to see any Notice about tempnam.

Actual output

Notice: tempnam(): file created in the system's temporary directory in C:\apache\htdocs\wordpress\wp-content\plugins\oik-shortcodes\classes\class-oiksc-function-loader.php on line 116

Notes

I don't remember ever getting a Warning before!
http://php.net/manual/en/function.tempnam.php

Workaround

Create the directory called tmp used by the call $this->tempnam = tempnam( "/tmp", "oikscloa");

Proposed solution

No need to change if it's OK on the Linux servers, but we could change to use wp_tempnam() or call sys_get_temp_dir() in place of "/tmp".

Cater for remote git repositories when running locally

When running the parser locally, parsing a component which is a point release of a Git repository you have to ensure that you don't mix the location from which source code is loaded. If you do, and the code is slightly out of sync, this can lead to a Parse error: syntax error, unexpected end of file in tmpfilename on line n.

This happens because at one point in the processing oiksc_real_file() decides it can load it directly from the Git repo, but a subsequent invocation loads the file contents from the actual component's source file. The problem occurs because the function's start and end lines have been determined from the real file. The error occurs when they differ from the start and end positions in the actual file.

This is a follow on to #17 and is related to #19.

Proposed solution

  1. Ensure the installed version matches the Git version
  2. Don't load files from the Git repository

Method 1. requires a manual update of the installed code. For some components it's not possible to operate the site with symlinks to the Git repo. It may work if the component is a clone of the Git repo.

Method 2 involves code adjustments.
The simplest approach would to change directory back to the original after determining the changes in the Git repo. A second stage would be to only load the file once.

Automate the creation of oik_shortcodes for a component

This issue formalises the need to be able to automatically create and update the shortcodes for a particular component from the latest help and syntax for each shortcode.

We've already developed a routine ( admin/oik-create-codes.php ). It needs to be extended to correctly select the shortcodes to be registered to a particular component.

For those components where oik-sc-help is currently providing the help and syntax, it will use oik-sc-help to perform the mapping of a component's shortcodes: jetpack, edd, woocommerce

Improve [hook] shortcode to handle new output from oik-bwtrace

The [hook] shortcode can be used to create a link to a hook - which is either an action hook or a filter.
Some of the output of the oik-bwtrace plugin is written as a combination of HTML and shortcodes.
The hook shortcode needs to be extended to cater for
nested hooks and additional information.
e.g.

[hook after_setup_theme action ],1
[hook after_setup_theme;determine_current_user filter 1],1
[hook after_setup_theme;determine_current_user;sanitize_user filter 3],1

Hopefully no-one uses semi-colons in their hook names!

See bobbingwide/oik-bwtrace#6

Attempt to eliminate the "Unterminated comment" messages

When viewing an API in the wp-a2z.org site you sometimes see

Warning: Unterminated comment starting line 99 in /home/bworguk/public_html/wp-content/plugins/oik-shortcodes/shortcodes/oik-api-importer.php on line 2257

It's a known problem - see the notes in oikai_syntax_source - but it's happening a little more often.
WIBNI if we didn't see this message.

Keep links to shortcode parameters local when running oik-shortcodes

The default logic for bw_form_sc_parm_help(), called by bw_form_sc_syntax to display the syntax of a shortcode, is to the result from oik_get_plugins_server().
When oik-shortcodes is active, we'd expect this to to be the current site.
This can be achieved by defining the BW_OIK_PLUGINS_SERVER constant.

Proposed solution

  • Define this constant in response to 'init', if not already set.
  • Remove the TODO ... where the URL should come from wherever we've defined the oik-shortcode server to be for the selected shortcode! from bw_form_sc_parm_help().

Blessed task - improve inline documentation in docblocks for API reference

When developing code in a hurry it's quite easy to forget to write all the inline documentation needed for the API reference. Or perhaps there's a small typo in the comment.
This blessed task allows us to make changes without having to resort to raising an issue for every dotted i or crossed t.

But it shouldn't be misused.

Display class variables

The display of the oik_class post type currently only shows information about the methods that are implemented. It doesn't know about the properties. The oik_file post type strips a class to only show the links to the methods. It doesn't know about properties either.
It would be nice to be able to view the properties of objects.

Reflect the folder structure in the oik_file post type hierarchy

Components often consist of multiple files in multiple folders. It would be nice to be able to see the structure of the component and traverse the file hierarchy.

This requires

  • creation of post_parents
  • ability to display the file hierarchy
  • simplification of the slug

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.