Skip to content

Instantly share code, notes, and snippets.

View WEBzaytsev's full-sized avatar

WEBZaytsev WEBzaytsev

View GitHub Profile
<?php
/**
* Setup development environment by manipulating plugin activation
* Replace the dev URLs and plugin paths accordingly
*/
function mysite_development_environment_setup() {
// define the development sites
$dev_envs = array(
'http://localhost:8888',
@WEBzaytsev
WEBzaytsev / functions.php
Created February 4, 2023 17:56 — forked from hmowais/functions.php
Speed Optimization WordPress (Manually)
<?php
//defer css
function add_rel_preload($html, $handle, $href, $media) {
if (is_admin())
return $html;
$html = <<<EOT
<link defer="defer" rel='stylesheet' href='$href' media="print" onload="this.media='all'" id='$handle' crossorigin="anonymous"/>
@WEBzaytsev
WEBzaytsev / wp-config.php
Created February 4, 2023 17:49 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@WEBzaytsev
WEBzaytsev / nginx.conf
Created December 25, 2022 15:55 — forked from markjaquith/nginx.conf
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@WEBzaytsev
WEBzaytsev / config
Created December 23, 2022 22:53 — forked from ichinya/config
при работе в разных ОС (Win, Unix, Mac) - делать одинаковые окончания строк в GIT
через терминал
в одном проекте
git config core.autocrlf true
во всех проектах
git config --global core.autocrlf true
или в файле проекта .git\config
[core]
autocrlf = true
@WEBzaytsev
WEBzaytsev / art-custom-edits.php
Created November 26, 2022 18:57 — forked from artikus11/art-custom-edits.php
Прогресс бар при скроле страницы
/**
* Прогресс бар при скроле страницы
*
* @author Artem Abramovich
* @verphp 7.0
*/
function art_progress_bar() {
?>
<style>
@WEBzaytsev
WEBzaytsev / menu_no_link
Created November 13, 2022 18:55 — forked from artikus11/menu_no_link
Уборка циклических ссылок в меню
@WEBzaytsev
WEBzaytsev / .htaccess
Created November 12, 2022 11:04 — forked from seoagentur-hamburg/.htaccess
Meine komplette .htaccess Datei inklusive Sicherheit, Caching, Komprimierung, WebP-Nutzung und CSS-Versionierung.
# ----------------------------------------------------------------------
# webP Grafiken statt jpgs verwenden
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
@WEBzaytsev
WEBzaytsev / .htaccess
Created November 12, 2022 09:53 — forked from seoagentur-hamburg/.htaccess
UPDATE 2022/10: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.6 - 10/2022
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################