Skip to content

Instantly share code, notes, and snippets.

View andrejIka's full-sized avatar

Andrej B. andrejIka

View GitHub Profile
wp core download
wp core config --dbname=sample --dbuser=root --dbpass=root
wp core install --url=http://example.dev --title="WordPress Sample Site" --admin_user=nishikawa --admin_password=pass [email protected]
wp plugin install show-current-template wp-basic-auth theme-check plugin-check wp-multibyte-patch --activate
wp plugin install wordpress-beta-tester jetpack contact-form-7 vk-all-in-one-expansion-unit
wp plugin delete hello
wp option update blogdescription "This is a new project!!"
wp option update posts_per_page 5
wp option update thread_comments 1
wp option update thread_comments_depth 3
@andrejIka
andrejIka / script.md
Created March 7, 2020 18:41 — forked from schlessera/script.md
Siteground webinar - Learn How WP-CLI Can Make Your Life Easier

Siteground webinar - Learn How WP-CLI Can Make Your Life Easier

Webinar description

WP-CLI, the command-line interface for WordPress, is one of the most popular tools among WordPress developers. However, it can be extremely helpful for anyone managing a WordPress site. In this webinar, the main person behind WP-CLI project: Alain Schlesser will show us the ins and outs of the tool. He will give us great examples on how it can be used to improve your workflow, for beginners to experienced developers and for projects big and small. We will give you invaluable examples on how to perform different tasks with WP-CLI automatically, saving you time and preventing you from making manual errors, like:

  • Keep forgetting to backup? Automate the process with WP-CLI.
  • Site not working? Get tips for easy troubleshoot with WP-CLI.
  • Too many spam comments? Learn how to clean them in no time.
  • Can’t log into your site? Reset your password with WP-CLI.
@andrejIka
andrejIka / books.md
Created March 23, 2020 20:40 — forked from rosswd/books.md
PHP Resources

Books

PHP

  • Modern PHP: New features and good practices (1491905018)
  • Programming PHP (1449392776)
  • PHP for the Web (0134291255)
  • PHP Advanced and Object Oriented Programming (0321832183)
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide 5e (0134301846)
  • Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (1491918667)
  • Laravel - Up and Running (1491936088)
@andrejIka
andrejIka / sample.md
Last active July 1, 2021 07:15
Best wordpress project ever

Use

  • custom class for queue
  • custom written wp-object class for caching, use redis
  • OOP - currently not everything is oop, twig not able to oop
  • mariadb
  • purge redis cache on post save - Put this on cron
  • PSR-4 autoload classes
  • timber everywhere
  • maximum symfony packages
@andrejIka
andrejIka / mac-setup-redis.md
Last active March 26, 2020 09:36 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@andrejIka
andrejIka / default
Created May 13, 2020 19:53 — forked from technopagan/default
High Performance Wordpress Webserver Stack with NGINX, PHP-FPM + APC and Varnish
# We only have one backend to define: NGINX
backend default {
.host = "127.0.0.1";
.port = "8080";
}
# Only allow purging from specific IPs
acl purge {
"localhost";
"127.0.0.1";

###Custom Post Types

Docs

function codex_custom_init() {
  $labels = array(
    'name'               => 'Books',
    'singular_name'      => 'Book',
    'add_new'            => 'Add New',
// ==UserScript==
// @name Aliexpress
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://trade.aliexpress.com/orderList.htm*
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
@andrejIka
andrejIka / wp-media-playground.js
Created August 25, 2020 21:42 — forked from dnaber-de/wp-media-playground.js
Play around with the wp.media API
myGlobalFrame = null;
/**
* @param wp wp namespace
* @param Backbone
* @param $ jQuery
*/
;( function( wp, Backbone, $ ) {
'use strict';
var myLibrary = wp.media.controller.FeaturedImage.extend(
@andrejIka
andrejIka / heartbeat-api-demo.php
Created August 29, 2020 15:46 — forked from strangerstudios/heartbeat-api-demo.php
Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
<?php
/*
Plugin Name: Heartbeat API Demo
Plugin URI: http://www.strangerstudios.com/wp/heartbeat-api-demo
Description: Minimal example demonstrating the WordPress Heartbeat API being added in WP version 3.6.
Version: .1
Author: strangerstudios
If logged in as a user and viewing the frontend of your website,
every 15 seconds you should see the following in your Javascript console: