bobbingwide / oik

OIK Information Kit
https://www.oik-plugins.com/oik-plugins/oik
GNU General Public License v2.0
2 stars 0 forks source link

Update to the latest @wordpress/scripts package and rework as required #202

Closed bobbingwide closed 2 years ago

bobbingwide commented 2 years ago

oik's blocks are currently delivered with one entry point /build/index.js. wp-scripts has been improved considerably. It now supports multiple blocks per plugin.

Requirement

Process

Prior to implementing the changes check for any improvement between wp-scripts v22.0.1 and v22.3.0 that might affect the actual implementation.

For plugins which have already been changed refer to the code changes in https://github.com/bobbingwide/sb-starting-block/issues/3 and https://github.com/bobbingwide/oik-bob-bing-wide/issues/42

bobbingwide commented 2 years ago

During testing I noticed that the GitHub icon wasn't appearing for the Follow-me block. I think it's because the icon name in SVG is github-link not github. The [github] shortcode works. Fix: In bw_follow_link_svg() change $lc_social to 'github-link' when it's 'github' before calling get_icon()

bobbingwide commented 2 years ago

During PHPUnit testing I noticed a number of things that needed changing

  1. Add a note in test-issue-69 that some plugins could cause the test to fail if they're activated
  2. Genesis-oik is now v1.3.0.
  3. UK translation of network1,network2 is network, network2. Need to change the original source and tests to allow for the space.
  4. There are 70 Warnings produced when running npm run makepot eg Warning: The string "%s comment" contains placeholders but has no "translators:" comment to clarify their meaning. (admin/class-bw-list-table.php:634)
bobbingwide commented 2 years ago

While resolving the Warnings from makepot I came across another warning

Warning: The string "Current version: %s" has 2 different translator comments. (admin/oik-admin.php:1101)

I came across this message a few more times. Another approach I used was to not include the translator's comment in subsequent usages or source files. How you're supposed to know which source file is the original is a challenge.

I used "Current version: %s" quite a few times. Sometimes the version was a plugin version, other times it was a theme. I'll have to check what actually appears in the .pot / .po files.

bobbingwide commented 2 years ago

I used "Current version: %s" quite a few times. Sometimes the version was a plugin version, other times it was a theme. I'll have to check what actually appears in the .pot / .po files.

I checked the oik.pot file. It was OK. But there was a problem with the translators comment for _sc_posts() in libs/oik-sc-help.php. It needed to be moved to after the first parameter.

, 'posts_per_page'  => BW_::bw_skv( null, __( "numeric", null ) . "|.",
                   /* translators: %s current number of posts per page */
                  sprintf( __( 'Number of posts per page. Use \'.\' for current value %1$s', null ) , get_option( "posts_per_page", null ) ) )            

Previous it was appearing against the string "numeric", which doesn't contain a placeholder.

bobbingwide commented 2 years ago

Delivered in v4.8.1