Skip to content

Instantly share code, notes, and snippets.

View mustafaslk's full-sized avatar
🎯
Focusing

Mustafa SOLAK mustafaslk

🎯
Focusing
View GitHub Profile
@mustafaslk
mustafaslk / settings.json
Created December 9, 2024 09:44
Optimized VSCode settings for web development with comprehensive configurations for PHP (WordPress standards), JavaScript/TypeScript, HTML/CSS. Includes code formatting, linting, Git integration, and enhanced editor features for improved productivity.
{
"editor.guides.bracketPairs": "active",
"editor.bracketPairColorization.enabled": true,
"editor.suggestSelection": "first",
"editor.wordWrap": "on",
"editor.linkedEditing": true,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
@mustafaslk
mustafaslk / .zshrc
Last active December 9, 2024 09:42
# Custom ZSH Configuration for macOS Development Environment
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH

** WP - Optimizations and Cleanup **

Here you can find a a list of WP optimization and cleanup functions and methodology.

  1. .htaccess
  • Force https to your site.
  • Enable Browser Cache for your static files. This will fix the "Leverage Browser Caching" in the google pagespeed results.
  • Enable file compreassion for faster page load.
  1. wp-config.php
@mustafaslk
mustafaslk / custom-functions.php
Created March 27, 2020 19:02 — forked from nathaningram/custom-functions.php
BBDC 2019 - Custom Functions Plugin
<?php
/*
Plugin Name: Nathan's Awesome Custom Functions Plugin
Plugin URI: https://nathaningram.com
Description: A set of custom functions for client websites from Nathan Ingram's Beaver Builder Developer Course Dec 2019.
Version: 1.0
Author: Nathan Ingram
Author URI: https://nathaningram.com
License: GPL2
*/
@mustafaslk
mustafaslk / add_recaptcha.php
Created March 27, 2020 17:17 — forked from BaskSerg/add_recaptcha.php
Add ReCaptcha to comments Wordpress
<?php
// Add to functions.php
add_action( 'wp_enqueue_scripts', 'add_recaptcha_js', 5, 1 );
function add_recaptcha_js() {
// Registration reCAPTHCA api.js, version - null, in footer - false
wp_register_script( 'recaptcha', 'https://www.google.com/recaptcha/api.js?hl=en', array(), null, false );
// Include reCAPTHCA api.js
wp_enqueue_script( 'recaptcha' );
}
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@mustafaslk
mustafaslk / add-wordpress-settings-page.php
Created March 11, 2020 21:36 — forked from DavidWells/add-wordpress-settings-page.php
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@mustafaslk
mustafaslk / wp-query-references.php
Created March 11, 2020 21:26 — forked from luetkemj/wp-query-ref.php
WP: Query $args References
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@mustafaslk
mustafaslk / remove-all.js
Created February 16, 2020 18:38 — forked from Shelob9/remove-all.js
Remove all notices in WP Admin, maybe.
jQuery('.error,.notice,.notice-error').remove();
@mustafaslk
mustafaslk / .htaccess
Created November 29, 2019 14:22 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/