The approach is rather manual at first, but once done, it should allow for automating it all through using wp option update.
Here are the steps:
Install a clean WP instance.
Configure the plugin in interest on that instance.
Check all the wp_options settings entries that were created after the plugin activation.
Consider whether the plugin configuration might have changed already existing settings on the site in wp_options table, as these will have to be added to the list too.
Consider whether the plugin configuration might be keeping settings or data in other database tables, so that means of automating theese will have to be “invented” too.
Consider whether any of the options values should be v
For each wp_options entry that has been created or changed, we should create a corresponding WP-CLI command like this:
When the value is a simple string or a number: wp option update OPTION_NAME "OPTION_VALUE"
When the value is a serialized object or array: wp option update OPTION_NAME 'OPTION_VALUE' --format="json"
OPTION_VALUE in 4.2. is formed by getting the actual serialized string from the database and passing it through the unserialize() function in PHP. One could use php -a (the interactive mode) for executing the followin line: ‘var_export( unserialize( ‘OPTION_VALUE’ ) );which would print a data structure, in whicharray()wrappers should be replaced by` in order to reach a valid JSON format.
Testing each wp option update line against the test database and checking the values in the database + the plugin settings page for any issues is the final step that would verify that the commands are doing their job.
A custom post status is initialized by the function register_post_status. Funnily enough, one can’t remove it by using a “unregister” or “deregister” function. There just ain’t one. There isn’t a filter for altering the registration of that status either. Or at least I couldn’t find one in reasonable time.
Manipulating the original status registration parameters happens in one way only, and it’s by using the same function on the same status again, but with whatever new parameters one wants it to be. The documentation of the function states that it’s…
A simple function for creating or modifying a post status based on the parameters given
For a long period of time I used Members plugin for locking up the website and redirecting all requests to the default WordPress login page whenever I needed to create a private website. Recently I had a similar task, to I tried the same approach, but I was surprised by the changes that have taken place while I was “gone”.
The plugin is now called User Role Editor by Members – Best User, Role and Capability Management Plugin for WordPress. I do remember a rule that was saying a title has to be a title and not a bloody description of the plugin, but hey, who am I to judge?
Another change was the set of functionalities that the plugin now has. The current owners and developers have created something of a freemium add-ons based business model. That’s cool, but I just need a plugin for closing my site for the general public.
Anyways, I tried disabling all features but the one for redirecting anonymous traffic to my login page + restricting the feeds and the REST API… result was repeating redirection to the login page every time I provide correct credentials. Meh…
As I did not have enough time to investigate why it wouldn’t work on a mint WordPress 5.3.2 installation, I decided to move along and find another one that would fit my needs without all the new features.
My Private Site turned out to be a neat simple plugin that is no longer maintained, but yet – it works like a charm with just a single checkbox clicked from its settings. I guess I’ll be switching to this one on my other sites then.
P.S. It’s somewhat important to have in mind, that My Private Site falls short in hiding the content from the RSS Feeds and REST API, so you should take some extra measures to lock these. Disable Feeds and Disable REST API plugins did the job for me, but generally these could be achieved by a few lines of PHP code for returning “false” for a bunch of filters.
If you are fed up with Jetpack’s obtrusiveness, you might consider replacing it. One of the fine features I’ve seen in it is the image carousel with mosaic preview of the standard WordPress galleries.
Plugins I use and seem to be doing the job rather well are Tiled Galleries Carousel Without Jetpack, combined with Simple Lightbox. If you are using a modern version of WordPress, then you must be familiar with Gutenberg – the new content editor. Sadly, the Tiled Galleries Carousel Without Jetpack plugin is not actively maintained, so it does not work well with the new editor, which is why as a temporary workaround, you’ll have to install Classic Editor plugin too, in order to edit the posts or pages with galleries with it. It’s an inconvenience, but still a minor one.
I’ve been general translations editors for the Bulgarian language in the local WordPress community for years, yet I decided to write this article in English, as I believe the approach here could be followed for just any other language.
In order to contribute to WordPress through translating the project in another language, you should:
have solid knowledge in English and the language you are translating to. Needless to say, otherwise you could be dealing more harm than actually helping the community.
bring a laptop with yourself at the event you are attending or have one at home if you are contributing remotely.
know that you don’t need to be a programmer or be extremely experienced in WordPress in order to be helpful. Having that knowledge could be of use to you, but is definitelly not required.
Before you actually start translating:
There are a few resources you should get aquainted with, before you dive into the work you are preparing for:
Local language translation guidelines – each language with an active translating community should have such a source of documentation. For Bulgarian it’s located here: https://bg.wordpress.org/превод-на-български. If you can’t find such for your language of choice, contact folks in the #polyglots channel in wordpress.slack.com and ask them about it directly. Or even better, contact the local community, if listed in this page: https://make.wordpress.org/polyglots/handbook/about/teams/local-slacks/ Translating without getting to know these guidelines could lead to bad translations and lack of consistency between your translations and those already done by other translators.
Locale glossary – usually it’s located in GlotPress under the main local page. Here’s the one for Bulgarian: https://translate.wordpress.org/locale/bg/default/glossary/ . It’s the place where most common terms are listed with their translation for sake of consistency. Always check the glossary if you are unsure of what could be the best translation for a technical term. If you haven’t translated WordPress before, it’s a must-read.
Polyglots handbook – this is the general handbook for translations in WordPress: https://make.wordpress.org/polyglots/handbook/ It’s a pretty extensive material, so feel free to skip it if you feel confident enough or if you are too eager to already start translating.
GlotPress – it’s the software that is hosted on translate.wordpress.org, the main translations portal for the WordPress community. You can start your contribution here.
How it actually works?
Strings of all WordPress projects are available for translation in translate.wordpress.org, where anyone with an active account can contribute by suggesting translations to a specific language. The suggestions by all translators are then being reviewed by translation editors who could be global for the given language (GTE), or responsible for that specific project (PTE).
Start from picking a project that you’d like to contribute to:
Usually WordPress Core (button WordPress) from the list is the highest priority. From that list always focus on the current and future versions of the project, unless you want to edit a specific old string which is not translated well. There are separate projects for each major WordPress version, but no projects for the minor ones, as they don’t bring too many new strings.
Themes & Plugins buttons are self-explanatory, Meta is meant for internal projects as wordpress.org, make.wordpress.org, support forums, plugins and themes directories and a few others. Apps is used for two mobile applications, used by the SaaS wordpress.com, owned by Automattic (which is odd), and an Android app for WordCamps.
If you have difficulty deciding on the plugins or themes that it’s worth working on, have a look a the Stats divide in plugins and themes groups, where you’ll see the list of the most popular ones with info on how much work is left there.
Once you’ve chosen a project to work on, you might have to decide on the subproject. WordPress Core has a few sub projects, related to the context:
Plugins have different ones – development and stable, depending whether you’d be translating the latest string from “trunk” of the SVN repository (development) or the latest release of the plugin (stable). These two sub projects are divided further into strings from the project and strings from the readme.txt file, which is being displayed in the Plugin Directory.
As translations from Development are directly being applied to the Stable release, whenever they match, you should always prefer the Development sub projects, when translating a project.
There are a number of fields one can use for filtering the strings for adding a translation or editing existing ones. See the image below:
Searching for strings, containing a specific word is done by using the “Term” field. The rest of the options there are self-explanatory.
Above the search and filter form there is a number of statuses for direct filtering of all strings for the project. When you are starting your contribution efforts best is to focus on the“Untranslated“list. “Fuzzy” are suggestions that were once valid, but after changes in the strings from the code are in a state of uncertainty and need to be checked in order to ensure no bad translations are entering the project. “Warning” translations are such that have mismatched punctuation, placeholders, HTML tags, spacing or other issues, that are automatically detected. Some of them could easily be fixed, so feel free to go through them, if you find any. “Waiting” are the strings that someone already have a proposed translation. This doesn’t mean that you can’t suggest a better one.
While translating, GlotPress provides you a number of tools you can use for doing a better job with your contribution. See the image below:
Code references display the source of the string. If you have even the most basic understanding of PHP code, you will be able to gain additional context on the string that you are translating by checking the line in the code where this string is available.
The button clones the original string in the text field for translation. Helpful when you are translating a string with special characters and HTML – typing them again could lead to typos.
The help button provides some links to resources and explanation for the different statuses a translation might have.
Suggestions, listed in this section, are taken from the consistency search (see it in the “useful tools” section). These come quite handy sometimes, but you should be careful to not apply blindly translations that are from a different context.
In some rare occasions seeing the translation of the string in another language could help for making the right decision for your language.
Have in mind that if your translations get edited, even for just a typo or missing punctuation, they will no longer be accounted as your translations.
Useful tools during translation:
Google Translate – it’s the obvious one, but it’s important to remember, that it’s often far from perfect and the translation might totally miss the context of what you are translating. Still, it remains the best tool for getting a rough draft of a long paragraph that you could later edit and make more human-readable.
Glosbe Dictionary – extremely useful dictionary that searches terms in existing translations of documents, software and so on in order to provide the best options for the word or phrase you are looking for. I’ve had quite a few cases when this was more useful than Google Translate.
POEdit – it’s a desktop translation files editor that you can use in case you are offline or prefer not to work in the browser.
Consistency search – GlotPress provides a nice tool for searching a string in existing translations for the given locale within translate.wordpress.org. Bear in mind that not all translations are following the guidelines and and not all are relevant for your context.
Poopy Life – if you need a quick live test of a plugin or theme in order to see where a string is being displayed, this site will spin up a clean new WordPress instance in a minute and will remain for 24 hours. This is the perfect solution for anyone who doesn’t have a site of their own, nor a local testing environment. This could be used in combination with WP Reset and WP Rollback plugins in order to get a clean db after doing some tests or getting an older version of a plugin or theme.
This document was originally created for my team-mates from DevriX, who are organizing an internal contributor weekend (yay!). Hopefully it would help others get into translations as well!
Малко за контекста – това ми го писа една студентка, на която преподавах WordPress в един от първите ми, не до там изкусурени курсове (като че ли 2011-та). Пиша го тук, за да си напомням какви неща правят впечатление на хората и имат значение, когато става въпрос за обучение.
Радвам се, че ще правиш нов курс и с удоволствие ще ти дам обратна връзка, още по време на курса си мислех, че ще е добре да го направя, но като че ли не остана време или просто така се случи.
И тъй… относно програмата, за мен беше ок. Темите си вървяха последователно, бяха включени основни неща, които са необходими, за да навлезе някой, който няма никаква идея от wordpress. В тази посока нямам забележки, но и като човек, които все още не е навлязал кой знае колко, може би мнението ми в това отношение не е меродавно, защото нямам поглед какво друго е можело да се включи :)
Относно начина на преподаване, мога да те критикувам много, но и знам колко е трудно човек да намери по-ефективен начин на преподаване. Та по този въпрос, лично аз винаги съм намирала преподаването тип лекционнен формат за недостатъчно ефективно, неангажиращо участниците и в крайна сметка малко или много скучно. Обикновено, ако след това не преговориш или упражниш информацията (например поради липса на време) в главата ти не остава почти нищо. Струва ми се, че малко повечко практически упражнения по време на самия курс, а не вкъщи, ще е доста по-полезно. Забелязала съм също, че информация, която е поднесена след като си се поблъскал сам над даден проблем, остава доста по-сериозен отпечатък в паметта ти. Т.е. моето предложение е, ако е възможно и ако намериш начин, да увеличиш практическите задачки и занимания по време на лекцията и да съкратиш времето, в което ти говориш, а хората те слушат. Може би те биха могли вкъщи да си прочитат теоретичната част, онези слайдове с инфо бяха също много полезни, а когато са с теб направи така, че да те ползват на практика. Последните пъти например се чудех защо изобщо си влача компа :)
Друг проблем, който обаче не е твой… беше историята с домашните. Курсът вървеше доста бързо и стегнато, обаче ако човек няма време да се занимава вкъщи, поради същата тази скорост много лесно можеше да изостане, да не успее да си направи домашното и съответно да загуби желание да дойде на следващата лекция, защото ще се чувства като ученик, който идва неподготвен за часа :) Аз имах такива преживявания на няколко пъти и ми беше трудно да се накарам да дойда, особено след като установих колко полезна работа вършат слайдовете с обобщения на лекциите. Дори си мислех, 4е мога просто като ми остане време да седна и да чета, да се ровя тук там и да разбера нещата, които ми липсват, не са ми ясни или не знам как да направя.
В същата връзка ми е интересно колко човека в крайна сметка дойдоха на представянията на сайтовете, които са направили. Освен, че не бях в София на обявената дата, аз нямаше да имам готов сайт и това би ме спряло да дойда на лекцията, която доста ме интересуваше. Защото все още не знам как да си метна творетнието на адреса, който си имам запазен за сайт :)
Еми за сега не се сещам друго и единствено съвета ми е, да разчупиш малко повечко нещата, да си размърдаш въображението и да измислиш начин да накараш хората да си размърдат от своя страна мозъците, да се запалят и да разберат, че няма нищо сложно, просто трябва малко постоянство :)
Не редактирам, не удебелявам и не коментирам. Само пожелавам на всеки, занимаващ се с нещо подобно да получава откровена градивна критика като тази, защото това страшно много помогна за следващия такъв курс, който направихме 2012-та в init Lab.
As the last year’s Vlado was not wise enough to blog about this little problem that occurs after BuddyPress updates or server migrations, he is doing it one year later, when he comes again to such a problem.
all forum topics are missing;
creating a forum topic doesn’t show up;
checking topics from a specific group/user profile doesn’t show any results.
Simply you’ve got a mistake in your bb-config.php file, which should be located in the root folder of your WordPress installation. In case of server migration you should check your database credentials (db name, host, user and pass) and in case you have been a wise-ass and have changed your database tables prefix, you’ll have to update these manually in the the same file.
Next thing you’ll see are all your lovely forum topics coming back home.
Ако познаваш някой вело-фен, на който му се занимава казвай.
По-горното го получих като писмо от Емилиян Кадийски, другарче от ФМИ, който стартира бизнес с Вело Ателие и в същото време е гъст с по-горната организация. Не знам дали ще получите парично заплащане за работата си, но със сигурност ще се запознаете с готини хора, ще придобиете полезен опит, ако такъв ви липсва, и евентуално ще можете накрая да си разширите портфолиото с още един як сайт.
Пишете на e.kadiyski към гугълската поща за подробности.