X-post: The Get Involved table at WCEU 2019

X-comment from +make.wordpress.org/community: Comment on The Get Involved table at WCEU 2019

Multiple Accounts Requirement

We’re adding an explicit multiple accounts requirement because some authors don’t really have a limit, even if we have a Trusted Authors program and the queue is at an all time low. The current situation is not fair to our reviewers and to honest authors that believe quality is better than quantity.


You can have multiple accounts with the following restrictions:

  • You can’t have more than one (1) open ticket in any of the trac reports/queues or under review. That means you can’t have one (1) theme ticket from an account and another one from a secondary account, simultaneously open in any of the queues.
  • Failing to respect the above requirement will result in the closing of all tickets and not having the possibility to upload those themes again. Also, a 1 month no upload possibility for each ticket closed. Depending on the severity of the case, you might also end up with a permanent ban on all your accounts
  • To avoid penalties, we request that you disclose all your accounts by emailing us at themes[at]wordpress.org.

In the last few days, we’ve penalised a few authors and are looking into other reports. Here are some stats:

  • 25+ accounts suspended
  • 4 TA accounts removed
  • 40+ themes suspended
  • Multiple penalties applied

To avoid such penalties, please refer to point 3 of the requirement.

New Privacy Policy page helpers coming in 5.2

In the WordPress 5.2 update new helpers have been added to make designing the Privacy Policy page easier.

In total 4 new items were added which are available to use in themes or plugins. There are 2 new CSS classes to help target the Privacy Policy page and menu items on the frontend, a new function that can be used in conditionals and a brand new template available to allow themes to design or style the Privacy Policy page anyway they choose.

  • is_privacy_policy() conditional query function
  • privacy-policy.php template
  • .privacy-policy body class
  • .menu-item-privacy-policy menu item class

You can start to take advantage of these items immediately upon the release of WordPress 5.2.

Backwards Compatibility

If the new additions are used on older versions of WordPress prior to 5.2 the template will not be used and the new CSS classes will not be output. The only backwards compatibility concern with using these new helpers is with the is_privacy_policy() function.

To support the is_privacy_policy() function pre-5.2 the following shim can be added to the theme or plugin;

<?php
if ( ! function_exists( 'is_privacy_policy' ) ) {
        function is_privacy_policy() {
                return get_option( 'wp_page_for_privacy_policy' ) && is_page( get_option( 'wp_page_for_privacy_policy' ) );
        }
}

Note for Themes about Core PHP Compatibility Changes in WordPress 5.2

With the release of WordPress 5.2 the minimum recommended PHP version changes from minimum of PHP 5.2 to a minimum of PHP 5.6.

Themes hosted in the WordPress.org directory can choose to fully support any version of PHP they want – but you also must ensure it does not cause any fatal errors when it is run on any of the PHP versions that WordPress itself supports.

Themes should include their own method of handling PHP version compatibility and providing a graceful fallback when it’s run on unsupported versions. The most common way to do this is by preventing activation of your theme on versions of PHP which you do not support and notifying the user about why.

You can do that using the after_switch_theme hook, the phpversion() function or PHP_VERSION constant and version_compare(). Here is some example code that prevents theme activation on a server that’s PHP version is below 5.6.

<?php

/**
 * Set a constant that holds the theme's minimum supported PHP version.
 */
define( 'THEMESLUG_MIN_PHP_VERSION', '5.6' );

/**
 * Immediately after theme switch is fired we we want to check php version and
 * revert to previously active theme if version is below our minimum.
 */
add_action( 'after_switch_theme', 'themeslug_test_for_min_php' );

/**
 * Switches back to the previous theme if the minimum PHP version is not met.
 */
function themeslug_test_for_min_php() {

	// Compare versions.
	if ( version_compare( PHP_VERSION, THEMESLUG_MIN_PHP_VERSION, '<' ) ) {
		// Site doesn't meet themes min php requirements, add notice...
		add_action( 'admin_notices', 'themeslug_min_php_not_met_notice' );
		// ... and switch back to previous theme.
		switch_theme( get_option( 'theme_switched' ) );
		return false;

	};
}

/**
 * An error notice that can be displayed if the Minimum PHP version is not met.
 */
function themeslug_min_php_not_met_notice() {
	?>
	<div class="notice notice-error is_dismissable">
		<p>
			<?php esc_html_e( 'You need to update your PHP version to run this theme.', 'themeslug' ); ?> <br />
			<?php
			printf(
				/* translators: 1 is the current PHP version string, 2 is the minmum supported php version string of the theme */
				esc_html__( 'Actual version is: %1$s, required version is: %2$s.', 'themeslug' ),
				PHP_VERSION,
				THEMESLUG_MIN_PHP_VERSION
			); // phpcs: XSS ok.
			?>
		</p>
	</div>
	<?php
}

X-post: Weekly Digest | Week 13

X-comment from +make.wordpress.org/updates: Comment on Weekly Digest | Week 13