Git Product home page Git Product logo

bogo's Introduction

Bogo

This is the development repository for Bogo, a straight-forward multilingual plugin for WordPress. A copy of the plugin package is downloadable from the WordPress.org Plugin Directory.

License

This plugin is released under the GNU General Public License Version 2 (GPLv2). For details, see license.txt.



Code is Poetry.

bogo's People

Contributors

dependabot[bot] avatar itpixelz avatar takayukister avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

bogo's Issues

Prepare for 3.5 release

  • Update Stable tag in readme.txt to the current stable version (3.4)
  • Update Version and the BOGO_VERSION constant in bogo.php to 3.5
  • Update Tested up to in readme.txt to 5.7
  • Add 3.5 change log to readme.txt
  • Update the copyright year in license.txt to 2021

Avoid PHP notices

When opening Languages > Terms Translation you see two PHP notices because there are unidentified index used.

Overhaul rewrite rules generation

Major part of the current rewrite rules generating process (includes/rewrite.php) was implemented almost 10 years ago. We should be able to do a lot of things to improve it with the current rewrite API of WordPress.

Update Language Packs

  • de_AT
  • es_UY
  • hsb
  • pt_AO
  • snd
  • skr

These locale codes on the Languages > Language Packs menu page don't have their language names yet. Update bogo_languages() in includes/functions.php to add their locale code and language names (in English). Correct language names should be retrieved from https://translate.wordpress.org/

Add Privacy Notices to the plugin page

For example Contact Form 7 has the Privacy Notices section in its plugin page (readme.txt):

Privacy Notices

With the default configuration, this plugin, in itself, does not:

  • track users by stealth;
  • write any user personal data to the database;
  • send any data to external servers;
  • use cookies.

If you activate certain features in this plugin, the contact form submitter’s personal data, including their IP address, may be sent to the service provider. Thus, confirming the provider’s privacy policy is recommended. These features include:

  • reCAPTCHA (Google)
  • Akismet (Automattic)
  • Constant Contact (Endurance International Group)

Let's add an appropriate privacy notices to Bogo's page as well.

Use WP GUID for _original_post

While you'll find a post-ID-like integer in the _original_post post-meta value, it is actually not used as a reference to any post. It just indicates that "If there is another post with the same _original_post, it is a translation copy with the same origin." So, it can be any value, as long as it is unique.

To clarify this rule and ensure it works correctly even when you export posts to another site, let's use the GUID for the default value of _original_post. You can use get_the_guid() to get the GUID of a post.

Improve user locale management

Since WordPress 4.7 introduced the concept of user locale, its API has been improved a lot, and we can utilize it to improve Bogo's code around user locale management.

Modernize Bogo

The current Bogo's coding is mainly based on very old versions of WordPress (5+ years old), and there is much space where we can make it much more efficient using APIs the current WordPress provides.

The project aims to raise the minimum supported WordPress version to 5.3 in the next release (Bogo 3.3). This also means we can use new PHP features available in PHP 5.6.20+ in plugin development.

We plan to do coding modernization in the following areas:

  • Use the metadata API and register all meta keys using register_meta() and register_post_meta().
  • Use PHP anonymous function to define a WordPress filter/action function where it's appropriate (removal of the filter/action is not anticipated).
  • Use Block Editor features aggressively (but, keep a minimum level of Classic Editor compatibility).

Prepare for 3.3.3 release

  • Add 3.3.3 change log to readme.txt
  • Change Stable tag to 3.3.2 (previous version) in readme.txt
  • Update Version and the BOGO_VERSION constant to 3.3.3 in bogo.php

Improve on the use of bogo_access_locale capability

The bogo_access_locale capability determines if the user is permitted to access resources in the specific locale. The check of this capability should be done inside another meta capability check (such as edit_post or delete_post).

Customizable non-inheritable post-metas

In bogo_duplicate_post(), a new translation post inherits the original post's post-metas excluding non-inheritable post-metas. Non-inheritable post-metas are _locale and _original_post now, and they are not customizable. In some cases you'll need to add some post-metas to this list. For such cases let's add a filter hook that allows to do so.

If you have post-metas that you think should be in the non-inheritable list, take this opportunity to add them to the default list.

Improve language switcher

See includes/language-switcher.php

  • Link to a translation page even when the target locale is equal to the current locale
  • Wrap each label text (language name) with <span class="language-name"></span>
  • Add the current class to the current <li> and <a>
  • Add aria-current="page" to the current <a>

Drop cookie code

Bogo sets its lang cookie in bogo_init() (bogo.php), but this cookie has actually been unused for a long time. We have to decide to drop this setcookie(), or make its use restricted with new cookie settings.

Related issue: #11

Prepare for 3.3.4 release

  • Update Stable tag in readme.txt to the current stable version (3.3.3)
  • Update Version and the BOGO_VERSION constant in bogo.php to 3.3.4
  • Update Tested up to in readme.txt to 5.5
  • Add 3.3.4 change log to readme.txt

Prepare for 3.4 release

  • Update Stable tag in readme.txt to the current stable version (3.3.4)
  • Update Version and the BOGO_VERSION constant in bogo.php to 3.4
  • Update Tested up to in readme.txt to 5.6
  • Add 3.4 change log to readme.txt

Prepare for 3.3.1 release

  • Add 3.3.1 change log to readme.txt
  • Update Version and the BOGO_VERSION constant to 3.3.1 in bogo.php

Add "short name" option to bogo_available_languages()

Sometimes the display name of a language gets unnecessarily long. For example, you don't need to display the full name of "English (United States)" when you don't have other English languages like "English (UK)", you'll think just "English" is OK.

My suggestion is to add a "short name" option to bogo_available_languages(). The option should have a boolean value, and when the value is true, the output of the function will be shortened, as long as it's appropriate, by removing tails in parentheses.

Prepare for 3.3 release

Unintended locale selection in the Posts screen

When the user locale is en_US and in the Posts screen (Posts > All Posts) you select Japanese from the "Show all locales" filter, the whole UI should keep English, but it actually shows Japanese.

Prepare for 3.3.2 release

  • Add 3.3.2 change log to readme.txt
  • Update Tested up to (5.4)
  • Update Version and the BOGO_VERSION constant to 3.3.2 in bogo.php

Custom rewrite rule on top of Bogo not working anymore in 3.5

Hi, I have built a custom rewrite rule that includes also the locale.

Since the update to 3.5 it is not working anymore.

This is my custom rewrite rule:

// Photogallery filter pictures by event
add_rewrite_rule( '^([^/]*)?/?gallery/([^/]*)/([^/]*)/event/([0-9]+)/?$', 'index.php?competition=$matches[3]&external_id=$matches[2]&event=$matches[4]&lang=$matches[1]','top' );

The first capturing group is the locale. If I use the query string url is not working anymore.

Any quick clue? I will investigate more in the next hours, at the moment I hotfixed reverting the 3.4 back

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.