Skip to content

Instantly share code, notes, and snippets.

View DKudleichuk's full-sized avatar
🇺🇦

DK DKudleichuk

🇺🇦
View GitHub Profile
@DKudleichuk
DKudleichuk / class-mo-oauth-widget.php
Last active November 17, 2022 09:24
Miniorange Login with Azure SSO redirect URL fix
<?php
class Mo_Oauth_Widget extends WP_Widget {
public function __construct() {
update_option( 'host_name', 'https://login.xecurify.com' );
add_action( 'wp_enqueue_scripts', array( $this, 'register_plugin_styles' ) );
add_action( 'init', array( $this, 'mo_oauth_start_session' ) );
add_action( 'wp_logout', array( $this, 'mo_oauth_end_session' ) );
add_action( 'login_form', array( $this, 'mo_oauth_wplogin_form_button' ) );
@DKudleichuk
DKudleichuk / wp-config.php
Created May 19, 2022 07:56
Dynamic WP_HOME and WP_SITEURL
<?php
$protocol = (!empty( $_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$domainName = $_SERVER['HTTP_HOST'] . '/';
$home = $protocol . $domainName;
define( 'WP_HOME', $home );
define( 'WP_SITEURL', $home );
@DKudleichuk
DKudleichuk / wp_install_demo_data.sh
Created March 7, 2022 07:00
WordPress Demo Data Installation Script
#!/bin/bash -e
alias wp=/e/srv/wp-cli/wp.bat
PATH=$PATH:wp;
clear
echo "Installing WP Importer Plugin"
wp plugin install wordpress-importer --activate
curl -O https://raw.githubusercontent.com/WPTT/theme-unit-test/master/themeunittestdata.wordpress.xml
wp import themeunittestdata.wordpress.xml --authors=create
@DKudleichuk
DKudleichuk / wp_install.sh
Created March 7, 2022 06:59
WordPress Bash installation script
#!/bin/bash -e
alias wp=/e/srv/wp-cli/wp.bat
PATH=$PATH:wp;
clear
echo "Welcome to WordPress auto installer!"
echo "Enter Site Title (question 1/5 ):"
read PROJECT_NAME