Skip to content

Instantly share code, notes, and snippets.

View kafleg's full-sized avatar

Ganga Kafle kafleg

View GitHub Profile
@kafleg
kafleg / WordPress Theme Review Standards
Last active August 29, 2015 14:26
WordPress Theme Review Standards
Why theme Review?
Contribution to WordPress Community.
Get Recognition.
Enhance skill.
Build international partners and co-workers.
Start earning.
Reduce the queue for theme check
Make WordPress with full standards
Beginning theme review on your local system.
@kafleg
kafleg / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kafleg
kafleg / htaccess
Created August 20, 2015 07:35
WordPress htaccess code for Optimization of WordPress site.
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@kafleg
kafleg / htaccess.txt
Created June 15, 2018 05:55
Make WordPress Website Fast - Put this code on HTACCESS file
# BEGIN Browser Cache
<IfModule mod_mime.c>
AddType text/css .css
AddType application/x-javascript .js
AddType text/x-component .htc
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
@kafleg
kafleg / crawl-data.php
Created July 18, 2018 04:37
Crawl data from third party website
<?php
$username='username'; //username for fetching data
$password='password'; //password for login
$URL='https://example.com'; //Url of third party website
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
@kafleg
kafleg / sanitize-functions.php
Created July 24, 2018 10:54
Sanitize Function for WordPress
<?php
/**
* Customizer: Sanitization Callbacks
*
* This file demonstrates how to define sanitization callback functions for various data types.
*
* @package code-examples
* @copyright Copyright (c) 2015, WordPress Theme Review Team
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*/
@kafleg
kafleg / theme-review-requirements.txt
Last active September 8, 2019 16:18
This is the requirements text of theme review guidelines
* Promotional text on screenshot are not allowed. Please replace it with some lorem text.
* Use the below code just below the body tag. https://make.wordpress.org/themes/2019/03/29/addition-of-new-wp_body_open-hook/
{{{ //wp_body_open hook from WordPress 5.2
if ( function_exists( 'wp_body_open' ) ) {
wp_body_open();
}
}}}
* Authors who wish to have their theme in the .org repo must not sell or distribute WordPress themes or plugins that are not GPL licensed or 100% GPL Compatible.
@kafleg
kafleg / Optimization WordPress Sites
Created February 20, 2020 12:24
Put this codes on functions.php
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );