Skip to content

Instantly share code, notes, and snippets.

View shameemreza's full-sized avatar
🇧🇩
Problem-Solver | WooCommerce Expert | Customer-First Mindset

Shameem Reza shameemreza

🇧🇩
Problem-Solver | WooCommerce Expert | Customer-First Mindset
View GitHub Profile
#Hotlinking
RewriteEngine on
RewriteCond% {HTTP_REFERER}! ^ $
RewriteCond% {HTTP_REFERER}! ^ Http (s)?: // (www \.)? Your-domain.com [NC]
RewriteCond% {HTTP_REFERER}! ^ Http (s)?: // (www \.)? Google.com [NC]
RewriteRule \. (Jpg | jpeg | png | gif) $ - [NC, F, L]
<?php
//save theme active time
function my_theme_activation_init() {
// Check if already saved the activation date & time
// to prevent over-writing if user deactive & active theme
// multiple time
if(!get_option('mytheme_activation_time', false)){
<script>
jQuery(document).ready(function($) {
var delay = 100; setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none'); }, delay);
});
</script>
<script>
if(window.outerWidth < 425) {
alert('jQuery(document).ready(function($) {
var delay = 100; setTimeout(function() {
$('.elementor-tab-title').removeClass('elementor-active');
$('.elementor-tab-content').css('display', 'none'); }, delay);
}); ');
}
</script>
/**
* Prevent update notification for plugin
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
function disable_plugin_updates( $value ) {
$pluginsToDisable = [
'plugin-folder/plugin.php',
'plugin-folder2/plugin2.php'
/**
* Disable WordPress Update nag
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
add_action('after_setup_theme','remove_core_updates');
function remove_core_updates()
{
if(! current_user_can('update_core')){return;}
/**
* Disable Plugin Update Notifications
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
remove_action('load-update-core.php','wp_update_plugins');
add_filter('pre_site_transient_update_plugins','__return_null');
/**
* Disable all the Nags & Notifications
* https://orixlab.net/disable-updates-for-specific-plugin-in-wordpress
* Place at bottom in theme functions.php
*/
function remove_core_updates(){
global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
}
add_filter('pre_site_transient_update_core','remove_core_updates');
@shameemreza
shameemreza / .htaccess
Created January 14, 2023 16:31
Force HTTPS in WordPress
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@shameemreza
shameemreza / disallowed-comment-keys.txt
Created January 16, 2023 03:13
Use these keys as Disallowed Comment Keys to your WordPress site's Discussion settings.
Amoxicillin
insurance companies
cashless society
Viagra
Zithromax
.net
.org
.com
mewkid.net
mewkid