Skip to content

Instantly share code, notes, and snippets.

View ciorici's full-sized avatar

Pavel Ciorici ciorici

View GitHub Profile
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active July 23, 2024 05:06
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@polevaultweb
polevaultweb / edd_perpetual_discounts.php
Last active June 28, 2022 08:31
EDD - Allow discounts to be set to apply to all renewals
<?php
// Add new Discount setting the to discount add and edit forms
add_action( 'edd_add_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_add_form' ) );
add_action( 'edd_edit_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_edit_form' ) );
// Handle saving the settings on form submission
add_filter( 'edd_update_discount', 'edd_perpetual_discounts_add_meta' );
add_filter( 'edd_insert_discount', 'edd_perpetual_discounts_add_meta' );
@ajitbohra
ajitbohra / functions.php
Last active June 5, 2021 06:13
Fixing Wordpress Media Upload HTTP Error on Godaddy / Shared Hosting
<?php
/**
* Facing HTTP Error on wordpress media upload on Godaddy / Shared Host ? This snippet might help you fix issue
* For more details about issue: http://www.lubus.in/blog/wordpress-media-upload-http-error-godaddy-shared-hosting-255
**/
/** Change graphic manuplation library used by wordpress **/
add_filter( 'wp_image_editors', 'change_graphic_lib' );
@ashleyfae
ashleyfae / edd-auto-apply-discount-code.php
Created August 30, 2016 12:13
Automatically applies an EDD discount code if certain cart conditions are met.
<?php
/**
* Plugin Name: EDD - Discounts for Subscribers
* Plugin URI: https://www.nosegraze.com/apply-edd-discount-code-cart-contents
* Description: Automatically applies an EDD discount code if certain cart conditions are met.
* Version: 1.0
* Author: Nose Graze
* Author URI: https://www.nosegraze.com
* License: GPL2
*
@slushman
slushman / customizer-links.php
Last active September 23, 2023 13:03
How to link into the WordPress Customizer
@nickcernis
nickcernis / mailchimp-popup-for-wordpress.md
Last active July 28, 2022 14:49
MailChimp Popup Script that works with WordPress sites

MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.

Including them in this way isn't always possible or easy with WordPress.

The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.

To use it, modify the baseUrl, uuid, and lid attributes with the ones from the original popup script that MailChimp supplies.

@kovshenin
kovshenin / image-shortcode.php
Created March 6, 2012 06:41
Image shortcode for WordPress
<?php
/**
* Image shortcode callback
*
* Enables the [kovshenin_image] shortcode, pseudo-TimThumb but creates resized and cropped image files
* from existing media library entries. Usage:
* [kovshenin_image src="http://example.org/wp-content/uploads/2012/03/image.png" width="100" height="100"]
*
* @uses image_make_intermediate_size
*/
@janfabry
janfabry / fixed-image-cropper.js
Created December 2, 2010 15:19
WordPress Fixed Image Cropper
// pxi: pixels in image scale
// pxc: pixels in crop scale
// Helper function to create an element with optional attributes
// Doesn't jQuery already have this?
Monkeyman_FixedImageCroppper_createElement = function(tagName, attr)
{
if (!attr) {
attr = {};
}
@janfabry
janfabry / on-demand-resize.php
Created November 13, 2010 16:03
WordPress On-Demand image resizer plugin (first public attempt)
<?php
/*
Plugin Name: On-Demand image resizer
Plugin URI: http://www.monkeyman.be
Description: Create and store images in different sizes on demand
Version: 1.0
Author: Jan Fabry
This plugins monitors 404 requests to the uploads directory and created new images of a requested size. They are saved as new files in the upload directory, not cached somewhere, so future requests are served directly by the server. This allows you to eliminate the creation of intermediate image sizes [see monkeyman-virtual-intermediate-images] or resize images based on the size used in the editor [see monkeyman-resize-image-tags].