Get latest stable Plugin or Theme download zip URL from wp.org

Plugin Download URL

You can add a download button on your website with the link of latest plugin zip. So, Your users always get the latest zip of your plugin which is hosted on wp.org.

Stable plugin download zip URL is:

https://downloads.wordpress.org/plugin/{plugin-slug}.latest-stable.zip

Note: You need to use the plugin slug for {plugin-slug}.

How to find the plugin slug?

Visit any WordPress plugin page.

E.g. If you visit the plugin page Sample Data.
This page URL is https://wordpress.org/plugins/sample-data/

So, Plugin slug is sample-data
And its latest plugin download link is:
https://downloads.wordpress.org/plugin/sample-data.latest-stable.zip

Note: Plugin name and plugin slug is not always the same.

Another example, If you visit the plugin page Bulk Clean.
This page URL is https://wordpress.org/plugins/easy-clean/

So, Plugin slug is easy-clean
And its latest plugin download link is:
https://downloads.wordpress.org/plugin/easy-clean.latest-stable.zip

Some more plugin examples:

  1. Contact Form 7
    https://downloads.wordpress.org/plugin/contact-form-7.latest-stable.zip
  2. Bulk Clean
    https://downloads.wordpress.org/plugin/easy-clean.latest-stable.zip
  3. Copy Anything to Clipboard
    https://downloads.wordpress.org/plugin/copy-the-code.latest-stable.zip
  4. Free Images
    https://downloads.wordpress.org/plugin/free-images.latest-stable.zip
  5. Sample Data
    https://downloads.wordpress.org/plugin/sample-data.latest-stable.zip
  6. Site Reset
    https://downloads.wordpress.org/plugin/site-reset.latest-stable.zip

Theme Download URL

Same like a plugin, You can add a download button on your website with the link of your latest theme zip. So, Your users always get the latest zip of your theme which is hosted on wp.org.

Stable theme download zip URL is:

https://downloads.wordpress.org/theme/{theme-slug}.latest-stable.zip

Note: You need to use the theme slug for {theme-slug}.

How to find the theme slug?

Same as the plugin, Visit any WordPress theme.

If you visit the theme Bhari
This page URL is https://wordpress.org/themes/bhari/

So, Theme slug is bhari
https://downloads.wordpress.org/theme/bhari.latest-stable.zip

Some more theme examples:

  1. Bhari
    https://downloads.wordpress.org/theme/bhari.latest-stable.zip
  2. Twenty Twelve
    https://downloads.wordpress.org/theme/twentytwelve.latest-stable.zip
  3. Twenty Sixteen
    https://downloads.wordpress.org/theme/twentysixteen.latest-stable.zip
  4. Twenty Seventeen
    https://downloads.wordpress.org/theme/twentyseventeen.latest-stable.zip
  5. Twenty Nineteen
    https://downloads.wordpress.org/theme/twentynineteen.latest-stable.zip

Advertisements

Multisite Support for Site Metadata in WordPress 5.1

Quick Highlights:

  • WordPress multisite introduces a new database table wp_blogmeta to store metadata associated with sites. This allows for the storage of arbitrary site data relevant in a multisite/network context.

  • It provides an alternative to using options and can be retrieved from multiple sites in a more performant way—without calling  switch_to_blog(). Sites can now also be queried by their meta with parameters supported by WP_Meta_Query.

  • Note: A network update is required to install the new database table.

  • New API functions:
get_site_meta( $id, $meta_key, $single )
update_site_meta( $id, $meta_key, $meta_value, $prev_value )
add_site_meta( $id, $meta_key, $meta_value, $unique )
delete_site_meta( $id, $meta_key, $meta_value )

All of these functions are ONLY available in multisite, however they work similarly to other metadata wrapper functions, such as for posts, terms, comments and users. In addition to these functions, it is now possible to use the common meta query arguments when querying sites with  WP_Site_Query or its wrapper  get_sites().


Read more at https://make.wordpress.org/core/2019/01/28/multisite-support-for-site-metadata-in-5-1/

PHP 5.6 is the intended version from WordPress 5.1

Quick Highlights:

Warning about outdated PHP version in WordPress backend

  • Provided filter wp_update_php_url for a more dynamic approach on the code level. Replacing the URL should happen in cases where a more specific guide to update PHP on the given environment exists. E.g. screenshot:
Warning about outdated PHP version with custom URL and related annotation

  • Fatal Error Protection with the so-called WSOD protection (white-screen-of-death protection), A mechanism has been implemented to detect fatal errors and, in certain designated areas of WordPress, recover from them. E.g. Screenshot.
Default output in the frontend when WSOD protection detects has detected an error

Note that, while the primary reason for implementing the fatal error protection mechanism was making the process of updating PHP less “dangerous”, it is technically not tied to the update at all. In fact, it will be enabled permanently and discover fatal errors under any circumstances.


  • The functionality can also be disabled entirely if that is preferred, via a new constant WP_DISABLE_FATAL_ERROR_HANDLER or, more dynamically, a corresponding wp_fatal_error_handler_enabled filter.

  • WordPress 5.1 will display a warning for those plugins that require a higher PHP version than the one currently active.

Read more at https://make.wordpress.org/core/2019/01/14/php-site-health-mechanisms-in-5-1/

PHP Date and Time format with examples and descriptions

Date Examples:

OutputFormatExample
15/02/19d/m/ydate( ‘d/m/y’ )
15-Feb-2019d-M-Ydate( ‘d-M-Y’ )
15 February 2019d F Ydate( ‘d F Y’ )
15th February 2019dS F Ydate( ‘dS F Y’ )
Feb, 15th 2019M, dS Ydate( ‘M, dS Y’ )

Time 12 hrs Examples:

OutputFormatExample
05:36 pmh:i adate( ‘h:i a’ )
05:36 PMh:i Adate( ‘h:i A’ )
05:36:18 pmh:i:s adate( ‘h:i:s a’ )
05:36:18 PMh:i:s Adate( ‘h:i:s A’ )

Time 24 hrs Examples:

OutputFormatExample
17:36 pmH:i adate( ‘H:i a’ )
17:36 PMH:i Adate( ‘H:i A’ )
17:36:18 pmH:i:s adate( ‘H:i:s a’ )
17:36:18 PMH:i:s Adate( ‘H:i:s A’ )

Date & Time Examples:

OutputFormatExample
15-02-2019 05:36:18 pmd-m-Y h:i:s adate( ‘d-m-Y h:i:s a’ )
15-Feb-2019 05:36:18 pmd-M-Y h:i:s adate( ‘d-M-Y h:i:s a’ )
15 February 2019 05:36 pmd F Y h:i adate( ‘d F Y h:i a’ )

All format with example and description:

FormatExampleDescription
d15d – The day of the month (from 01 to 31)
DFriD – A textual representation of a day (three letters)
j15j – The day of the month without leading zeros (1 to 31)
lFridayl (lowercase ‘L’) – A full textual representation of a day
N5N – The ISO-8601 numeric representation of a day (1 for Monday, 7 for Sunday)
SthS – The English ordinal suffix for the day of the month (2 characters st, nd, rd or th. Works well with j)
w5w – A numeric representation of the day (0 for Sunday, 6 for Saturday)
z45z – The day of the year (from 0 through 365)
W07W – The ISO-8601 week number of year (weeks starting on Monday)
FFebruaryF – A full textual representation of a month (January through December)
m02m – A numeric representation of a month (from 01 to 12)
MFebM – A short textual representation of a month (three letters)
n2n – A numeric representation of a month, without leading zeros (1 to 12)
t28t – The number of days in the given month
L0L – Whether it’s a leap year (1 if it is a leap year, 0 otherwise)
o2019o – The ISO-8601 year number
Y2019Y – A four digit representation of a year
y19y – A two digit representation of a year
apma – Lowercase am or pm
APMA – Uppercase AM or PM
B775B – Swatch Internet time (000 to 999)
g5g – 12-hour format of an hour (1 to 12)
G17G – 24-hour format of an hour (0 to 23)
h05h – 12-hour format of an hour (01 to 12)
H17H – 24-hour format of an hour (00 to 23)
i36i – Minutes with leading zeros (00 to 59)
s18s – Seconds, with leading zeros (00 to 59)
u000000u – Microseconds (added in PHP 5.2.2)
eUTCe – The timezone identifier (Examples: UTC, GMT, Atlantic/Azores)
I0I (capital i) – Whether the date is in daylights savings time (1 if Daylight Savings Time, 0 otherwise)
O+0000O – Difference to Greenwich time (GMT) in hours (Example: +0100)
P+00:00P – Difference to Greenwich time (GMT) in hours:minutes (added in PHP 5.1.3)
TUTCT – Timezone abbreviations (Examples: EST, MDT)
Z0Z – Timezone offset in seconds. The offset for timezones west of UTC is negative (-43200 to 50400)
c2019-02-15T17:36:18+00:00c – The ISO-8601 date (e.g. 2013-05-05T16:34:42+00:00)
rFri, 15 Feb 2019 17:36:18 +0000r – The RFC 2822 formatted date (e.g. Fri, 12 Apr 2013 12:01:05 +0200)
U1550252178U – The seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)

Get WooCommerce store notifications and key metrics on Android and iOS app powered by Jetpack

Great news for WooCommerce store owner. Your WooCommerce Store In Your Pocket.

Manage your orders, receive sales notifications, and view key metrics wherever you are.

Get the mobile app:

The WooCommerce app is powered by Jetpack. Learn how to connect to your store.

Available now for Android and iOS.

Fix: EventSource’s response has a charset (“iso-8859-1”) that is not UTF-8. Aborting the connection.

The issue is with the mismatch charset. You have default charset charset : iso-8859-1 and you are trying to use content which have charset=UTF-8.

To fix the error you need to set the charset=UTF-8 in which you have set the header. In my case, I have fix the error by setting the charset=UTF-8 in header. Check below code for reference:

header( 'Content-Type: text/event-stream, charset=UTF-8' );

I have created the PR for this fix for WordPress Importer created by
humanmade

PR: https://github.com/humanmade/WordPress-Importer/pull/168

Setup WP CLI (WordPress Command Line Interface) on Windows Operating System

Step 1

Create folder wp-cli in C drive.

Step 2

Download wp-cli.phar from https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Step 3

Move downloaded wp-cli.phar file in C:\wp-cli\

Step 4

Create wp.bat file in C:\wp-cli\ and write below code in it.

@ECHO OFF
php "C:\wp-cli\wp-cli.phar" %*

Or download file from gist https://gist.github.com/maheshwaghmare/848b5a9f21f27239600cf08693a0bedb

Step 5

Open system environment and set C:\wp-cli as environment path.

Done!


Open Command Prompt and type command wp and press Enter. It’ll show you the like the below screenshot.