Why coding with WP Coding Standards ?

When a code source is sometime more than ten years old, it is now time to rewrite it with good practices.

The first step is to use efficient tools. The result speaks for itself with these two snapshots :

php w/o wpcs
php w/o wpcs
php-with-format
php-with-format

Red points on first image indicate formatting errors !

I let you guess the mass of work and checks when there are nearly 30,000 lines in 4 plugins!

Where is wiki xili ?

The xiki wiki is for the moment suspended because its content had become obsolete given the evolution of WP and the xili-language trilogy.

PHP 7.2 : how to replace DEPRECATED create_function to pass a var ?

create_function is now obsolete with PHP 7.2. How to rewrite it with anonymous function to pass a var in add_action() at end of a function calculating this var ? In this case, ‘admin_notices’ action display a message when the theme is activated.

Replace

add_action( 'admin_notices', create_function( '', 'echo "' . addcslashes( $msg, '"' ) . '";' ) );

by

add_action(
    'admin_notices',
    function() use ( &$msg ) {
       echo $msg;
    }
);

Note that var used by references ( &$msg ) in function.
See the functions.php to this theme in GitHub ( line 148 ).

Enjoy

FTP on Mac OSX high Sierra (10.3.x)

Regulary, each time my iMac for dev. is updated (now high Sierra 10.3.6), each time the FTP of MacOs server is discontinued (stopped) : impossible to use Fetch and FTP to update wordpress in web local server or mamp instance.
Again, after spending more than multiple hours searching useful posts or forums, here is resumed how to update ftp and activate sftp:

Step #1 : update ftp install via brew

if brew is installed, with homebrew you can accomplish this with the following brew command:
brew install inetutils
be patient, the process takes time and time to time is verbose

Step #2 : test ftp – the connection

if ftp is well installed, use terminal

bash-3.2$ ftp localhost
ftp: connect to address ::1: Connection refused
ftp: Trying 127.0.0.1 …
ftp: connect to address 127.0.0.1: Connection refused
ftp: Trying fe80::1%lo0 …
ftp: connect to address fe80::1%lo0: Connection refused
ftp: no response from host
ftp>

enter quit to recover here bash terminal

At this step, it was impossible to log with ftp (port 21) protocol and username/password 🙁 !

Step #3 : authentication via ssh (thanks to MAMP support)

• Go Mac OSX System Preferences => Sharing.
• Enable Remote Login.
You will see:
Remote Login: On
To log in to this computer remotely, type “ssh username@xxx.xxx.x.xx”.

Step #4 : set ftp client (here fetch)

In your FTP client, create a new SFTP connection with the settings:
• Server: xxx.xxx.x.xx
• User Name: username
• Password: your user password for the system

Step #5 : configure wp-config to enable automatic core or plugin updating

define(“FTP_HOST”, “xxx.xxx.x.xx:22”);
define(“FTP_USER”, “username”);
define(“FTP_PASS”, “your user password for the system”);
define(“FTP_SSL”, true);
define(“FS_METHOD”, “ssh2” ); // need ssh-sftp-updater-support plugin in localhost wp server if php server don’t have ssh2 extension

This plugin – ssh-sftp-updater-support – available in wp repository is important if php install of apache server don’t have ssh2 extension.

And now all is working with sftp … until the next macOSX update !

Now this website is powered by WP 4.9.5 and xili-language 2.22.10.

Where is xili-language 2.22.10 downloadable ?

in xiligroup GitHub.

What is the next target ?

Cleaning the code (some parts are 10 years old !) to ship 3.0 !!

Is xili-language compatible with Gutenberg ?

Yes since Gutenberg version 2.7 (April 18th 2018). Gutenberg now follow the rules to display (or not) custom taxonomies as language used by xili-language since 2009 in admin/editor post edit screen.