Git Product home page Git Product logo

oik's Introduction

oik

banner

Over 80 advanced, powerful shortcodes, and 9 blocks for displaying the content of your WordPress website.

Description

Now with 9 blocks:

  • Address - Displays your address from oik-options
  • Contact form - Displays a contact form
  • Contact field - Part of the Contact form
  • Countdown - Countdown / count since timer
  • Dynamic content - Dynamic content block
  • Follow me - Displays your social media links
  • Google Maps - Displays a Google Maps map using oik options
  • PayPal button - PayPal button for: Pay Now, Buy Now, Donate, Add to Cart, and View Cart / Checkout
  • Shortcode block for oik shortcodes - Expands oik shortcodes

The oik base plugin provides a series of advanced WordPress shortcodes that help you display dynamic content from your website's pages, posts, attachments, links and custom post types. The OIK Information Kit uses lazy smart shortcode technology to display your WordPress website's content including your often included key-information. The functionality in the oik base plugin is used by over 40 other WordPress plugins, providing powerful facilities for an efficient, performant website.

oik now provides over 80 shortcodes including:

  • [bw_pages], [bw_posts], [bw_thumbs], [bw_attachments], [bw_images], [bw_pdf] shortcodes to list subpages, posts, attachments or custom post types
  • [bw_cycle] to display content using jQuery cycle.
  • [bw_list], [bw_tree] to display lists of links to pages, posts, attachments or custom post types
  • [bw_table] to tabulate pages, posts or custom post types
  • [bw_bookmarks] to list links
  • [paypal] shortcodes for PayPal buttons: Pay Now, Buy Now, Donate, Add to Cart, View Cart/Checkout
  • [bw_block] & [bw_eblock], [div] & [ediv], [clear] - to create block structures within your pages, posts and even widgets
  • [bw_button], [bw_contact_button] - to provide call-to-action button style links for Artisteer themes
  • helper shortcodes for web designers and developers: [bw_editcss], [bwtrace], [bw_wpadmin], [bw_wtf], [stag] & [etag]

oik helps you to display information about you, your company, your social networking ids and your website using standard formats that search engines such as Google recognise.

  • You enter your information once, then use oik shortcodes to display it wherever you want; in titles, post and page content, header, sidebar and footer widgets.
  • Whenever you need to change a value you only need to update it in one place; and your website is updated instantly.
  • Shortcodes to display often included key information include: [bw_contact], [bw_telephone], [bw_mobile], [bw_mailto], [bw_company], [bw_address], [bw_show_googlemap], [bw_directions], [bw_logo], [bw_qrcode], [bw_copyright]
  • For your social networking use the [bw_follow_me] shortcode to display your links to Twitter, Facebook, LinkedIn, etcetera

Features:

  • oik provides buttons to help you write the shortcodes, showing you the parameters you can choose and default values
  • oik provides a shortcode discovery page where you can find out about every shortcode which is active in your site
  • lazy programming means that code is only loaded when it's actually needed
  • smart means that the shortcodes can recognise the content in which they're used and adjust their behaviour accordingly
  • oik is extendable - plugin developers can build on the oik base functionality
  • using the oik API: help, syntax information, examples AND HTML snippets can be produced for any plugin or theme that provides shortcodes
  • oik is theme independent; meaning that you can change your theme without having to worry about whether or not the shortcodes will still work.
  • oik uses microformats so that Google and other search engines can understand your content.

Installation

See Frequently Asked Questions

Frequently Asked Questions

Installation

  1. Upload the contents of the oik plugin to the `/wp-content/plugins/oik' directory
  2. Activate the oik base plugin through the 'Plugins' menu in WordPress
  3. Go to oik options > options to fill in your often included key information
  4. Use the blocks or shortcodes when writing your content

Where is the FAQ?

oik FAQ

Is there a support forum?

Yes - please use the oik plugin forum

Can I get support?

Yes - see above

Where are the blocks documented?

oik blocks

For blocks of many other WordPress plugins ( including WordPress SEO, Jetpack, WooCommerce ) see blocks.wp-a2z.org

Where are the shortcodes documented?

oik shortcodes

The shortcode reference includes the standard WordPress shortcodes and help for shortcodes provided by other oik plugins.

For other popular WordPress plugins (e.g. Jetpack, Easy-Digital-Downloads, WooCommerce) see WP-a2z.org

Screenshots

  1. oik options - Options
  2. Demonstrating [bw_pages] and [bw_thumbs]
  3. [bw_contact_form] - Contact form and [bw_show_googlemap] - Google Map
  4. Option to display post IDs on admin pages
  5. Custom CSS button
  6. oik button dialog - to create the [bw_button] shortcode
    1. oik PayPal dialog - create PayPal buttons: Pay Now, Buy Now, Donate, Add to Cart and View Cart/Checkout
  1. oik shortcodes dialog - showing syntax for [bw_block]
  2. oik options - Shortcode help - lists ALL active shortcodes
  3. oik options - Buttons

Upgrade Notice

4.10.3

Tested with WordPress 6.5

Changelog

4.10.3

  • Changed: Update build files
  • Tested: With WordPress 6.5 and WordPress Multisite
  • Tested: With PHP 8.3
  • 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"

Other plugins

Other plugins which depend upon the oik API are available on WordPress.org:

  • bbboing - obfuscate text but leave it readable
  • cookie-cat - [cookies] shortcode to list the cookies your website may use
  • oik-batchmove - batch change post categories or published date
  • oik-nivo-slider - [nivo] shortcode for the jQuery "Nivo slider" for posts, pages, attachments and custom post types
  • oik-privacy-policy - generate a privacy policy page, compliant with UK cookie law (EU cookie directive)
  • oik-read-more - progressively reveal content by clicking on "read more" buttons

Plugins which participate with oik shared libraries are:

  • oik-bwtrace - Debug trace for WordPress, including action and filter tracing
  • oik-css - [bw_css] for CSS styling per page
  • uk-tides - [bw_tides] shortcode for tide times and heights in the UK (replaces oik-tides)

These plugins are not dependent upon oik:

More FREE and Premium plugins are available from oik-plugins.com including:

oik plugins are suitable for:

  • WordPress site owners
  • WordPress site administrators
  • WordPress designers
  • WordPress web site developers
  • WordPress plugin developers

oik plugins are tested with:

  • WordPress
  • WordPress Multisite
  • PHP 8.1, PHP 8.2 and PHP 8.3
  • PHPUnit 9.6

All of the plugins are developed using a set of functions that can make PHP and HTML coding a bit easier. These are known as the OIK Application Programming Interface (OIK API)

oik's People

Contributors

bobbingwide avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

oik's Issues

Cater for noderef select fields which may have many entries

There is a limit to how many posts can be loaded when populating the select list for a noderef field. When there are thousands of nodes the #options array becomes quite unwieldly.
Also there is a distinct possibility that the server runs out of memory.

When editing an oik_hook post type ( part of the oik-shortcodes plugin ), the Fields metabox fails to display due to.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16781312 bytes) in C:\apache\htdocs\wporg\wp-includes\functions.php on line 3464

This is because there are over 16K posts with post type of oik_api.

Ditto for any other post type that attempts to display a select field for a noderef of post type oik_api

Workaround

Exclude the fields from the Fields meta box by not registering its association to the post type.

Proposed solution

Implement a select2 like field or another solution that works with mega data.

Note: The logic to load a noderef field's values ( bw_load_noderef2() ) is actually part of the oik plugin.

Fatal error: call to undefined function bw_trace2() in oik_libs/oik_boot.php on line 190

I've had a report from someone installing oik-privacy-policy v1.3.2.
When he installed oik v3.0.2 the following message was displayed in the dashboard.

"Plugin could not be activated because it triggered a fatal error. Fatal error: Call to undefined function bw_trace2() in /home1/web2guy/public_html/projectmenudashboard/wp-content/plugins/oik/libs/oik_boot.php on line 190"

oik_box() produces messages when $id=null and $callback is a method

The following code in oik_box() produces a Warning message when the $callback parameter is a class method and the $id parameter is null.

if ( $id == NULL ) {
    $id = $callback;
  } 

Workaround

Note: The original code wasn't designed with OO in mind.
Passing a non-null value for $id when using OO code avoids the issue.

Preferred solution

Detect that the $callback is an array and choose the $id accordingly.

100% translatable and localizable on WordPress.org

The oik base plugin was developed in the UK English language using smart APIs that defer processing until the content is really needed. In some cases translation of language strings is deferred.

In order to create the .pot file we've been using a fork of the WordPress tool that searches for translatable strings and have extended it to handle a super set of APIs.

The WordPress translation tool used at https://translate.wordpress.org/projects/wp-plugins/oik
does not recognise these APIs. Therefore the set of strings to be translated is only a small subset of the actual set.

Two options

  1. Change oik to use the WordPress APIs
  2. Improve the makepot logic to support additional APIs depending on plugin/theme.

Each of these options have their Pros and Cons.
We'll not discuss these now other than for me to say that my preference is for option 2.
I'm just raising this as an Issue to be resolved.

Create oik_themes shared library

It's already been done for "oik_plugins", we now need to make admin/oik-themes.inc into a shared library called "oik_themes". This is needed by oik-shortcodes for the _component_version virtual field, where the object being displayed is part of a theme.

Add support for pagination of multi-value fields

Some fields stored in post meta data may contain a lot of data.
Either there are multiple values, each stored separately in a wp_postmeta row, or the data is stored in a textarea field, with each line representing separately displayable content.

The values should be paginatable, ideally with pagination being ajaxified.

For these large fields, it makes sense to add pagination to the [bw_field] / [bw_fields] shortcodes.
Alternatively, the [bw_navi] shortcode could be extended to support selection of the field to be displayed, using a new field=field_name parameter.

Proposed solution

Develop the extension to [bw_navi] first.

Add DONOTCACHE option for certain shortcodes

Some content may contain output from shortcodes that should not be cached.
It would be nice if we could easily advise caching plugins when this happens.

Requirements

  • Ensure that caching does not adversely affect the user experience
  • Support popular caching plugins: WP-Super-Cache, w3-super-cache

Proposed solution

tbd

Note: Wordfence no longer supports caching.

Change priority for handling init from 11 to 20

I noticed a problem where oik-types was unable to override the definition of post type supports definitions added by the Genesis theme framework. These were also being added in response to 'init' at priority 11, but since the theme is loaded after the plugin Genesis's hook was overriding oik-types' settings.

Solution:

In the oik base plugin, increase the priority for handling the 'init' action, to 20, from 11.

Add BW_Options_List_Table class to administer serialized data from wp_options

WordPress options data can be stored in multiple ways; plain, serialized, serialized arrays.

When the data is stored as serialized or serialized arrays then the core admin logic simply shows 'serialized data'., Obviously you can't edit data like this.

There are many cases where data benefits from being stored in the wp_options table as serialized data. Often the data is almost self defining.
Each entry has a key and each field has a label and value. Given the label name and the context it should be possible to determine the field type and user friendly label for the field.
It should therefore be possible to provide admin pages which deal with serialized options data.

The oik base plugin, and quite a few of the plugins which are dependent upon it, uses serialized arrays for options data. Users would greatly benefit from a consistent admin UI managed by common code.
Therefore we propose to develop a new BW_Options_List_Table class that extends the BW_List_Table class to provide a admin UI for options fields.

Add 'oik_add_shortcode' filter logic to bw_add_shortcode()

The oik base plugin defers shortcode registration until it's determined that they're needed.
It uses the oik_add_shortcodes action hook to initiate the logic to register shortcodes.
Plugins that respond to this action hook then invoke bw_add_shortcode().
This function currently registers every shortcode, regardless of whether or not the shortcode is going to be used.
If you only want to use one or two shortcodes at the most then the performance of subsequent processing during shortcode expansion can be slightly degraded.
We need a simple solution that will allow the shortcode registration to be overridden.

Proposed solution

Add a filter ( 'oik_add_shortcode' ) to determine the function to register. If the filter returns null then the shortcode will not be registered.
This hook will not necessarily be implemented by the oik base plugin.

Selectively disable plugin update requests

For a variety of reasons there may be some plugins for which you neither want updates to be checked nor applied. Some of these reasons are:

  1. You need to stick with a particular version until another version has been updated
  2. The plugin is installed as a symlinked version

The requirement is to support the disabling of plugin updates on a plugin by plugin basis.

[bw_show_googlemap] shortcode messing up google map controls

In the latest version, the output of the [bw_show_googlemap] shortcode is messing up google maps controls - particularly the zoom slider. This seems to happen regardless of the theme.
The problem is almost exactly as documented here
http://stackoverflow.com/questions/9904379/google-map-zoom-controls-not-displaying-correctly
In a previous version a fix had been provided in oik-css.
The problem was introduced when I added support for multiple googlemaps.
The fix adds a new class ( bw_map_canvas)
which is then styled by the CSS.
.bw_map_canvas { height: 100%; min-height: 100% } .bw_map_canvas img { max-width: none; }

Display memory_limit using [wp] shortcode

We want to be able to display the current setting of the PHP memory_limit using the shortcode [wp v p m]. The bw_wp() function, that implements the wp shortcode, is delivered by oik.

This is a pre-requisite change to support bobbingwide/oik-bob-bing-wide#8

Suggestion for the future

One day migrate all the logic for the wp shortcode to oik-bob-bing-wide, or use shared libraries?

[bw_logo] should use site_icon if oik option not specified

There are 3 requirements

  • the bw_logo shortcode should use the site_icon image if the option is not set
  • if the bw_logo is selected for the Login form this should also use the site_icon.
  • Optionally, in WPMS, use the value for the default site, if none is specified for the current site.

Improve [bw_contact_form]: allow predefined / fixed subject

Improve the contact form so that the Subject: field is either pre-defined or selectable or otherwise.

For some contact forms we really only need the message.
By default the email produced by the bw_contact_form already shows the page from which the form was submitted but it makes it easier for the user to select.

Optionally we could make use of existing contact form plugins or even the theme's contact form.

[bw_logo] shortcode does not support WPMS

In WPMS, although the [bw_logo] shortcode finds the correct image to display as the logo image, using a link='/' parameter does not produce a link to the currently active site.

So if used in the content of the [bw_blogs] shortcode, as below, all the links are to the current site.

[bw_blogs]
[bw_logo link='/'] 
[/bw_blogs]

Proposed solution

It would be nice to support WPMS so that the links are to the "bw_domain" registered for the site.

What should [bw_link ID] do when ?p=ID would produce a 404?

Imagine this scenario.

  • Some content contains a [bw_link ID] shortcode, where ID is the post ID of a registered post type.
  • Clicking on the link displays the post.
  • The post type is then de-registered

How should the link now appear?

Actual Result

It displays an invalid permalink conforming to the custom structure defined in Permalink Settings.

e.g. for post ID 32932, published on 2016/05/25, with slug 'reactjs', using the Day and name permalink structure we get http://example.com/2016/05/25/reactjs/

Clicking on the link displays the 404 page.

Expected result

Good question. Help wanted here.
See also humanmade/WordPress-Importer#38 (comment)

Notes about current implementation

  • Currently, when the post ID is NOT found e.g. [bw_link 1010101010101] then no link is shown.
  • When the post ID is 0, then it produces a link to the current post.
  • When the post ID is negative then no link is shown.

Allow kv() $value param to be an array

For oik-ajax we need to be able to cater for shortcode parameters which are stored in the $atts array to be arrays. e.g. meta_query, post__in.

Either oika_flatten_atts() or kv() should convert any array using implode.

For the time being we'll assume that arrays aren't nested.

Alter bw_load_noderef2_flat to allow it to list attachments

bw_load_noderef2_flat() uses bw_get_posts() to load a list of posts matching the selected post type.
When the post type is "attachment" and the post_parent is not set then bw_get_posts() will set it to the parent of the current post.

For the [bw_new] shortcode, if we want to select an attached file using a media type field then we need a list of all images, not just those which aren't attached.

One solution to the problem is to trick bw_get_posts() into allowing not setting the value for post_parent. This could be done either by ensuring bw_current_post_id returns null OR
by avoiding the test.

proposed solution

Avoid the test on post_parent by passing an array of post types where the second post type will never return any posts.

Multi shortcode pagination not working consistently

When you have a page with multiple paginatable shortcodes and have already paged an earlier shortcode, paginating a shortcode that appears later in the page can cause the pagination of the earlier shortcode to be reset to page 1.

Problem explanation

In bw_navi_paginate_links() the fix introduced for WordPress 4.1.1 ( #13 ) made a permanent change to the value of $_SERVER['REQUEST_URI'], removing the values of the query args for earlier shortcodes. The links for the subsequent shortcodes therefore did not have this query arg, so on the pagination request for a subsequent shortcode the previous shortcodes reset themselves to page 1

Problem solution

Save the value of $_SERVER['REQUEST_URI'] and reset it before leaving the function.

Workaround required for atrocious performance of textarea fields in Chrome

While developing oik-requests I started using textarea fields to store post meta data for information about files loaded, hooks invoked and queries performed. These fields can run to many many lines.
I noticed that in the WordPress edit page, pasting large amounts of data into the textarea fields brought Chrome to a standstill.

Google searches came up with the actual problem https://bugs.chromium.org/p/chromium/issues/detail?id=109587
but they didn't explain the easy workaround, which is to disable spell checking.
See http://stackoverflow.com/questions/254712/disable-spell-checking-on-html-textfields

So now we need a way to add the "spellcheck=false" parameter to selected textarea fields.
The lowest level API that might need changing is iarea(), though we could get away with changing the logic for displaying a sctextarea field using new logic.

As an aside

There are other things that might be good to have for input fields:

<input type="text" placeholder="My Field" name="myfield"
    autocapitalize="off" autocorrect="off" autocomplete="off" />

Cater for shortcode syntax with parm name aliases

Some shortcodes accept a parameter which basically contains the same value but has multiple names.
e.g. for the audio shortcode src parameter the aliases are mp3, m4a, ogg, wav, wma.

The oik shortcode syntax logic currently attempts to link to the first parameter name listed, but the shortcode parameter is registered using all the values.

Clicking on a link leads to 404.

Proposed workaround

In bw_form_sc_parm_help(), don't call bw_form_sc_get_first_parm_name()
just assign the value directly.

Verify the validity of the id= parameter returned by _sc_classes()

There are a range of helper functions which are used for displaying the syntax of parameters that are common to many shortcodes. The _sc_classes() function defines

  • the 'class' parameter as a set of CSS class names
  • the 'id' parameter as a unique identifier.

It's not clear whether the 'id' is a post ID or a CSS ID.
It could be that the ambiguity is acceptable, depending on the context of the shortcode.
We need to check.

Improve messages from deprecated files loaded by PHPUnit

While developing tests for #47, I started getting a lot of debug backtrace output in HTML comments.
Having determined that they weren't from the files I originally thought they came from ( which would have indicated a different problem ), I used oik-bwtrace to locate the culprit file.

This turned out to be a deprecated file. ( admin/oik-plugins.inc )

On closer inspection, I realised that even though the file contained

_doing_it_wrong( __FILE__, '<br />Please use oik_require_lib( "oik_plugins" );<br />', "oik v3.0.0" );

this message about the deprecated file wasn't showing in PHPUnit's output.

I need to add some unique identifying mark to the unwanted output.

echo __FILE__;

should do the job.

Support update from Github

Like many other plugins and themes the oik base plugin includes logic to allow a plugin or theme to be updated from a repository other than WordPress. For plugins which are a) delivered from an oik-plugins server, and b) already dependent on some part of oik, this logic is enabled through oik_register_plugin_server().

You can also manually enable this logic using http://www.oik-plugins.com/wordpress-plugins-from-oik-plugins/oik-base-plugin/oik-options/oik-options-plugins/oik-options-plugins-add-plugin/

Currently the plugin server has to be running the oik-plugins server logic.

We have a new requirement to be able to update the plugin from a github repository.

Proposed solution

  • Allow the "server" to be specified as a github repository e.g. https://github/bobbingwide/bbboing
  • The plugin update logic will detect this and direct requests to check for updates from github
  • It may have to fetch the .zip file directly from github and perform post processing before the plugin can be successfully installed.

There are multiple stages to this development.

The solution may enable 'local' zip files to be installed, allowing optional/recommended plugins to be delivered as part of another plugin/theme.

Add option field for GitHub and include in bw_follow_me

As for Twitter, Facebook etc, it would be nice if the [bw_follow_me] shortcode could display a link to the user's GitHub account. All it needs to store is the "owner" part, the rest of the GitHub url can be created.

Whether or not there needs to be a separate shortcode is debatable. If the [github] shortcode exists then we can probably use that? But what happens with the oik-user plugin.

An icon with the GitHub mark will also be needed for 'backward compatibility' when [bw_follow_me] is coded without theme=gener.

make oik v2.5.x compatible with oik-bwtrace v2.0.9

oik v2.5.1 should be compatible with oik-bwtrace v2.0.9

Currently, you need a version of oik v3.0.0 in order to be able to run both oik and oik-bwtrace. i.e. oik v2.5 is not compatible with oik-bwtrace v2.0.9.
We want to release a new branch of oik to wordpress.org to deliver a workaround to a problem introduced in WordPress 4.4 ( Issue #13).
We need to apply some changes to make oik compatible with the shared library solution supported by oik-lib, oik-bwtrace and the new version.

Create bw_json_decode() API for safer JSON decoding

When an HTTP request is expecting the response to be in JSON, things can go wrong if the server inadvertently produces PHP Warnings, Notices or other unexpected output.
The oik-clone plugin is rather sensitive to this.
Instead of using json_decode( $result ) we should call bw_json_decode( $result )
This new API will attempt to protect the caller from failing due to unexpected output.
The API will strip off anything before the first { and trace this as a Warning message.

In the first instance the routine will not check for json errors.

Plugins which are currently using the oik-remote.inc file and using json_decode() should be updated to
use bw_json_decode(). Other plugins should wait until the logic is available in a shared library.

Known list of plugins to update

  • oik-clone - in oik-save-post.php

Should bw_navi_paginate_links() be hard coding [] around page numbers?

In bw_navi_paginate_links() there is code that creates the $args parameter to the paginate_links() function. It currently hardcodes two parameters as "before_page_number" => "[" and "after_page_number" => "]".

This is inconsistent with theme pagination. Should these values be
a. continue to be hardcoded
b. optionally set
c. omitted

Protect against Fatal errors when activating renamed plugins

In some edge case scenarios it's possible to cause Fatal errors in wp-admin when attempting to activate a plugin for which the folder has been renamed.

This is related to the following WordPress support forum topic.
https://wordpress.org/support/topic/should-update-be-available-for-a-renamed-plugin?replies=1#post-8809638

Steps to reproduce

  1. Deactivate the oik-privacy-policy plugin
  2. Deactivate the oik plugin
  3. Rename the folder for oik-privacy-policy to oik-css
  4. Search for, with the intention on installing it, oik-css
  5. Find that it appears to be installed and see that you can simply "Activate" it
  6. Click on Activate.

Unexpected result

Warning: require_once(C:\apache\htdocs/wp-content/plugins/oik-privacy-policy/admin/oik-privacy-policy.php): failed to open stream: No such file or directory in C:\apache\htdocs\wp-content\plugins\oik\libs\oik_boot.php on line 78

This then becomes an 'unrecoverable' Fatal error. It remains an Unrecoverable error until you rename the folder back to the orginal name at which point you get
The plugin oik-css/oik-privacy-policy.php has been deactivated due to an error: Plugin file does not exist.

Pagination not working in WordPress 4.4

It took me a while to notice, but after upgrading to WordPress 4.4, we realised that pagination was not working properly. The x to y of z information and the paging links were correct, but the listed content being displayed was always from page one.

Explanation

The function _bw_get_posts() which is used when we need the total number of posts was passing the default value for offset, 0. It seems that this should now be ''.

Temporary fix

Change the code in _bw_get_posts() from 'offset' => 0 to 'offset' => ''
File oik/includes/bw_posts.inc
This fix has been applied to oik-plugins.com

Permanent fix

Publish a new version of the oik base plugin. Rather than issue v2.5.1 we may decide to officially release version v3.0.0.

Add honeypot support for [bw_contact_form] with API for extensions

Plugins such as justintadlock's registration-honeypot protect the login and registration forms.
We need something that can be used to check [bw_contact_form] and other forms that spambots might try completing
This can probably be achieved by some very simply action hooks, implemented by the oik base plugin.

Proposed solution

  • Add oik-honeypot shared library
  • Add "oik_add_honeypot" action to allow extension to include the honeypot field in a form
  • Add "oik_check_honeypot" action to allow extension to check the honeypot field has not been completed
  • Add some defaults for the message to be displayed when the trap has been sprung.
  • Change [bw_contact_form] to use the new logic

AND, for the extensions,

  • Change oik-squeeze to use the new code in [bw_squeeze]
  • Change oik-fields to use the new code in [bw_new]

sol() - support $extra parameter to allow for start=index for ordered lists

For paginated ordered lists, it would be nice if we could specify the list start number, rather than having it start from 1. each time.

Proposed solution

  • Change sol() to accept the $extra parameter
  • Change bw_sl() to pass the start index
  • Change bw_navi_posts() to determine the start index when required.

Backslash problem with bw_textarea()

In some instances where textarea fields are being redisplayed by bw_textarea() any backslashes in the content are duplicated. This is seen when the form is being redisplayed, and the value parameter is null, which causes the code to access the current value from $_REQUEST. The value needs to be sanitized before being passed to iarea(). wp_strip_all_tags() already provides a partial solution, but we also need to call stripslashes().

bw_blockquote should allow HTML and shortcodes

Requirement

Allow [bw_blockquote] to accept $content which includes HTML and/or embedded shortcodes

Solution

bw_blockquote() will first check for $content. If it exists then it will use that in preference to the text parameter, which is used in preference to the positional parameter.

[bw_show_googlemap] needs an API key

When I first changed [bw_show_googlemap] to use Google maps API v3 it didn't require the API key that was needed in v2. This was in oik v 1.3.

Some time ago Google started displaying Warning messages in the JavaScript console saying.

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required

On most of my accounts the Google map is displaying correctly.

On a new 1&1 account however the Google map is displayed briefly before it switches to

Sorry! Something went wrong.
This page didn't load Google Maps correctly. See the JavaScript console for technical details.

Where we see not only the two warnings but also an Error.

Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error_.ab @ js?sensor=false&region=GB:32(anonymous function) @ common.js:51(anonymous function) @ common.js:189c @ common.js:45(anonymous function) @ AuthenticationService.Authenticate?1shttp%3A%2F%2Fwww.irenelock.co.uk%2Fcourse_location%2Fbridestow…:1

Workaround

Providing an API key and removing the sensor=false parameter, in a custom version of the code, resolves the problems.

Proposed solution

Add support for specifying the Google maps API key in oik options, reusing the google_maps_api_key option name.

[bw_link /path] link incorrect when domain not set

When the path in the [bw_link] shortcode is prefixed with a '/' then the domain is determined to be the local domain. The logic uses the oik option "domain". If that's not set it obtains "siteurl".
The current logic creates a link with two schemes. e.g. http://http://example.com/path
There should only be one. It confuses Chrome.

bw_custom_column_admin() should check the context

I was developing a new plugin which handles its own display of a custom column.
During debugging, I registered the field using oik-types
When the column was being shown on a custom post type, bw_custom_column_admin() displayed the value using its own logic.
This was in addition to the custom column being formatted by the new plugin.
bw_custom_column_admin() should have checked that the column was a valid column for the given post type.

Workaround.

Remove the field registration

Better setting of ABSPATH when not already defined

Background

In September 2015 I started writing up a problem which I had been experiencing for many months. Today ( 2 Nov) I finally published the post.
http://herbmiller.me/2015/11/02/h2gd-part-50-cannot-redeclare-func-previously-declared-in-filexx-in-fileyy/

One of my attempts to fix the seemingly random problems was to attempt to standardize the setting of ABSPATH. There are some situations where ABSPATH is set in shared library files.
This Issue is raised to log the changes to set ABSPATH in oik_boot.php

Unable to set Show IDs on admin pages on one MultiSite site

In a WordPress MultiSite installation, for one of the sites, it's not possible to enable the
Show IDs on admin pages checkbox using oik options > Overview.

I have't debugged it yet, so it could be a problem introduced when importing data directly into the options table.

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.