Skip to content

Instantly share code, notes, and snippets.

View lordspace's full-sized avatar

Svetoslav Marinov lordspace

View GitHub Profile
lordspace / woo-subscr-fix.php
Created November 4, 2023 15:03
fix for Site crashes with out of memory error when adding a downloadable product and hitting Update button
// file:
* Grant downloadable file access to any newly added files on any existing subscriptions
* which don't have existing permissions pre WC3.0 and all subscriptions post WC3.0.
* @param int $product_id
* @param int $variation_id
* @param array $downloadable_files product downloadable files
lordspace / r-debug.php
Created September 8, 2021 20:31 — forked from Rarst/r-debug.php
R Debug (set of dump helpers for debug)
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: |
License: MIT
lordspace / qs_blog675_grant_customizer_access.php
Last active February 14, 2021 16:46
How to Allow Non-Admin Users to Access WordPress Customizer. Check the latest version on the qSandbox -
* How to Allow Non-Admin Users to Access WordPress Customizer. Published on the qSandbox -
* <a href="" title="Free Test/Staging WordPress site by">Free Test/Staging WordPress site by</a>
* @param array $all_caps
* @param array $cap
* @param array $args
* @return array array
* @see
lordspace / openssl.cnf
Created May 7, 2019 12:50
This file is from Apache installation and it's referenced by this tutorial : How to Generate Certificate Authority (CA) Key and SSL Certificate with OpenSSL at
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
lordspace / wc-css-make-storefront-product-tabs-horizontal
Created May 23, 2018 12:53 — forked from vanbo/wc-css-make-storefront-product-tabs-horizontal
WooCommerce: CSS to make Storefront product tabs horizontal again
.product .woocommerce-tabs ul.tabs {
width: 100%;
float: none;
margin-right: 5.8823529412%;
lordspace / orbisius_quick_fix_wc_ext_opt_co_fields.php
Created August 7, 2017 09:51
This code allows you to make some WooCommerce Checkout Fields optional.
This code allows you to make some WooCommerce Checkout Fields optional.
Blog post
Author: Svetoslav Marinov (Slavi)
Author URI:
lordspace / set_up_ssl_for_wp_news_site.txt
Last active December 19, 2016 14:52
These are instructions related to this article (How to Properly Set up an SSL Certificate for a News Site Based on WordPress)
How To Setup Let's Encrypt SSL certificate for a news Site and Fix Mixed Content Error
// put this in wp-config.php
// GPL
ob_start( 'orbisius_custom_link_corrector_global' );
* This is used here to correct all links that are not ssl
lordspace / mandrill_email_test.php
Last active November 6, 2015 16:29
This is an sample php code that uses mandrill service to send emails. It uses PHPMailer. Here is an article how to do the setup:
// Author: Slavi Marinov | &
// 0) Read this article
// 1) Join Mandrill at
// 2) Download PHPMailer from
// Adapted example from: shared/PHPMailer-master/examples/mailing_list.phps
require_once 'shared/PHPMailer-master/class.phpmailer.php';
require_once 'shared/PHPMailer-master/class.smtp.php';
$message = "This is a test message prepared on: " . date( 'r' ) . " from " . $_SERVER['HTTP_HOST'] . ' ' . $_SERVER['REMOTE_ADDR'];
lordspace / load-assets.php
Created October 28, 2015 14:04
How to load WordPress assets and append last modified time so the browser loads them only when necessary.
// the vhost has this line to define the environment 'SetEnv DEV_ENV development'
$suffix = empty($_SERVER['DEV_ENV']) ? '.min' : '';
wp_register_style('my-awesome-plugin', plugins_url("/assets/main{$suffix}.css", __FILE__), false,
filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.css" ) );
wp_enqueue_script( 'jquery' );
wp_register_script( 'my-awesome-plugin', plugins_url("/assets/main{$suffix}.js", __FILE__), array('jquery', ),
filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.js" ), true);
Plugin Name: Orbisius Facebook Share Image Preview Fix
Plugin URI:
Description: Makes sure that post's featured image is 1200x630 so facebook can use it as preview.
Version: 1.0.0
Author: Svetoslav Marinov (Slavi)
Author URI: