Skip to content

Instantly share code, notes, and snippets.

View indikatordesign's full-sized avatar

Bruno Bouyajdad indikatordesign

View GitHub Profile
@indikatordesign
indikatordesign / rewrite.php
Last active September 26, 2023 06:13
Bring your WordPress images into the modern Webp format
<?php
/*
Plugin Name: Rewrite JPG, JPEG, PNG, GIF to WEBP
Plugin URI: https://indikator-design.com/get-divi-theme-to-100-in-your-pagespeed-score/
Description: Rewrite image extensions from images in mediathek and linked in posts.
Version: 1.0
Author: Bruno Bouyajdad | Indikator Design
Author URI: https://indikator-design.com
Author Email: contact@indikator-design.com
*/
@indikatordesign
indikatordesign / functions.php
Last active July 26, 2023 15:05
[WooCommerce Subscriptions]Disallow downgrading for "WooCommerce Subscriptions" Grouped Product-Subscriptions
<?php
// Prevent Downgrading
add_filter( 'woocommerce_subscriptions_switch_is_identical_product', function( $is_identical_product, $product_id, $quantity, $variation_id, $subscription, $item )
{
if ( wc_get_product( (int) $product_id )->get_price() < $item->get_product()->get_price() )
{
$is_identical_product = true;
@indikatordesign
indikatordesign / wp-config.log
Last active February 11, 2023 18:28
WP-Config extended and enabling SMTP via PHPMailer WordPress
You don't need to leave the "wp-config.php" file in the root directory, you can put it one folder above.
Create the following structure under vhosts:
mydomain/public_html/*all-wp-files-and-folders
Put the "wp-config.php" in "mydomain", to the folder "public_html". In the host settings root the domain to "public_html".
If no plugins need write access to the "wp-config.php", set the permissions to 444, otherwise to 644.
@indikatordesign
indikatordesign / controller-helpers.php
Last active December 5, 2022 13:19
WordPress - Get the next 12 am timestamp (sheduled actions etc.)
<?php
/**
* Do not allow direct access
*
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) die( 'Nothing to find Ma\'am..' );
/**
* Your Plugin Name - Controller Helpers
@indikatordesign
indikatordesign / model-transients.php
Last active December 5, 2022 13:12
WordPress - Delete expired transients
<?php
/**
* Do not allow direct access
*
* @since 1.0
*/
if ( ! defined( 'ABSPATH' ) ) die( 'Nothing to find Ma\'am..' );
/**
* Your Plugin Name - Model Transients
@indikatordesign
indikatordesign / config
Last active December 5, 2022 13:06
NGINX - Config for Plesk as reverse proxy for WordPress
include mime.types;
types {
application/x-font-ttf ttc ttf;
application/x-font-woff woff;
image/webp webp;
image/x-icon cur ico;
}
gzip on;
gzip_http_version 1.1;
@indikatordesign
indikatordesign / functions.php
Last active November 5, 2021 01:29
[Combine "Divi - Filterable Blog Module" with the "Events Manager" plugin]
<?php
// Here you can see how to combine "Divi - Filterable Blog Module" with the free plugin "Events Manager": https://wordpress.org/plugins/events-manager/
// Just add these snippets to your themes functions.php and change them according to your needs.
// Combine Event Manager with "Divi – Filterable Blog Module" by changing the $query_args
// If you use it like this, the sorting starts with the current event and past events will be hidden automatically
add_filter( 'dfbm_query_args_output', function( $query_args )
{
@indikatordesign
indikatordesign / footer.php
Last active November 5, 2021 01:29
[Divi Footer Template]This footer.template let you setup easily your company name, wrapped into your website-url. It also takes care for automatic update of the year in your socket.You just need to change the values in the variables "$myCompany and $myURL" at the top of this code panel. Then simply put this file in the root of your child-theme.
@indikatordesign
indikatordesign / functions.php
Last active November 5, 2021 01:28
[Divi - Change the order for the default filterable portfolio module]
<?php
// Add this snippet to your themes "functions.php" to order the projects by title
add_action( 'parse_query', function( $vars )
{
if ( 'project' == $vars->query['post_type'] )
{
@indikatordesign
indikatordesign / functions.php
Last active December 15, 2018 13:45
[WordPress 5(+) - Remove Builder Info]
<?php
if ( is_admin() ) :
add_action( 'current_screen', function( $hook )
{
if ( 'edit' == $hook->base ) :
add_action( 'admin_print_styles', function()