Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mahesh Waghmare maheshwaghmare

🎯
Focusing
View GitHub Profile
@maheshwaghmare
maheshwaghmare / .htaccess
Created Jul 14, 2020 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
View .htaccess
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
@maheshwaghmare
maheshwaghmare / add-current-post-updated-year.php
Created Jul 6, 2020
WordPress SEO - Register current post updated year as a custom tag or variable in to the Yoast SEO plugin. We can use the %%post_updated_year%% into the title. Read more at https://maheshwaghmare.com/doc/yoast-seo-custom-template-variable/
View add-current-post-updated-year.php
<?php
if( ! function_exists( 'prefix_yoast_register_post_updated_year' ) ) :
/**
* Register Current Post Publish Year
*
* @todo Change the `prefix_` with your own custom prefix.
* @since 1.0.0
* @return void
*/
function prefix_yoast_register_post_updated_year() {
@maheshwaghmare
maheshwaghmare / add-current-post-publish-year.php
Created Jul 6, 2020
WordPress SEO - Register current post publish year as a custom tag or variable in to the Yoast SEO plugin. We can use the %%post_publish_year%% into the title. Read more at https://maheshwaghmare.com/doc/yoast-seo-custom-template-variable/
View add-current-post-publish-year.php
<?php
if( ! function_exists( 'prefix_yoast_register_post_publish_year' ) ) :
/**
* Register Current Post Publish Year
*
* @todo Change the `prefix_` with your own custom prefix.
* @since 1.0.0
* @return void
*/
function prefix_yoast_register_post_publish_year() {
@maheshwaghmare
maheshwaghmare / wordpress-npm-packages.md
Created Jun 20, 2020
List of all WordPress NPM packages which are used in Gutenberg plugin.
View wordpress-npm-packages.md
npm install @wordpress/a11y --save
npm install @wordpress/annotations --save
npm install @wordpress/api-fetch --save
npm install @wordpress/autop --save
npm install @wordpress/babel-plugin-import-jsx-pragma
npm install @wordpress/babel-plugin-makepot --save-dev
npm install @wordpress/babel-preset-default --save-dev
npm install @wordpress/base-styles --save-dev
npm install @wordpress/blob --save
@maheshwaghmare
maheshwaghmare / get-heavy-options.php
Created Jun 8, 2020
Get autoload heavy options from the WordPress `wp_options` ($wpdb->options) table.
View get-heavy-options.php
<?php
/**
* Get autoload heavy options from options table
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*/
if( ! function_exists( 'prefix_get_heavy_autoload_options' ) ) :
function prefix_get_heavy_autoload_options() {
@maheshwaghmare
maheshwaghmare / get-autoload-options-size.php
Created Jun 8, 2020
Get the size of all options which are set as `autoload_size` in the WordPress `wp_options` ($wpdb->options) table.
View get-autoload-options-size.php
<?php
/**
* Get Autoload Options Size
*
* Get the size of all options which are set as `autoload_size` in the WordPress `wp_options` ($wpdb->options) table.
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*/
View perform-scheduled-task.php
<?php
/**
* Task to perform
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @return void
*/
@maheshwaghmare
maheshwaghmare / add-schedule-event.php
Created Jun 2, 2020
Add schedule event OR Cron event with wp_schedule_event(). See https://maheshwaghmare.com/doc/wordpress-cron/
View add-schedule-event.php
<?php
/**
* Add schedule event or Cron event with wp_schedule_event()
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @return void
*/
@maheshwaghmare
maheshwaghmare / add-cron-schedules.php
Created Jun 2, 2020
Add custom cron schedules with filter `cron_schedules`. See https://maheshwaghmare.com/doc/wordpress-cron/
View add-cron-schedules.php
<?php
/**
* Add Cron Schedules
*
* @todo Change the `prefix_` and with your own unique prefix.
*
* @since 1.0.0
*
* @param array() $schedules Existing schedules.
* @return array
@maheshwaghmare
maheshwaghmare / get-schedules.php
Created Jun 2, 2020
Use function wp_get_schedules() to see all scheduled events. See https://maheshwaghmare.com/doc/wordpress-cron/
View get-schedules.php
<?php
print_r( wp_get_schedules() );
// Array
// (
// [hourly] => Array
// (
// [interval] => 3600
// [display] => Once Hourly
// )
You can’t perform that action at this time.