This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: DevPress Price Testing | |
* Plugin URI: https://devpress.com | |
* Description: A plugin to test different pricing variants based on cookies. | |
* Version: 1.0.0 | |
* Author: DevPress | |
* Author URI: https://devpress.com | |
* Text Domain: devpress-price-testing | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function example_ajax_enqueue() { | |
// Enqueue javascript on the frontend. | |
wp_enqueue_script( | |
'example-ajax-script', | |
get_template_directory_uri() . '/js/simple-ajax-example.js', | |
array( 'jquery' ) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Default false for flags | |
db=false | |
uploads=false | |
overwrite=false | |
# Checks for flags | |
while getopts dupo option | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace DevPress\Frontend; | |
/** | |
* Class Performance | |
* | |
* @package DevPress\Performance | |
*/ | |
class Performance { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Deletes customers without orders | |
* | |
* To run the script: | |
* wp eval-file delete-customers-without-orders.php | |
*/ | |
// Query for customers registered since this date. | |
$date_after = '2000-01-01'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.page-header { | |
background-color: #f3f3f7; | |
background-repeat: no-repeat; | |
background-position: right center; | |
background-size: auto 375px; | |
height: 375px; | |
// 600px viewport | |
@include breakpoint(m-lg) { | |
background-size: auto 600px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* High volume modifications to Action Scheduler. | |
* | |
* Adapted from https://github.com/woocommerce/action-scheduler-high-volume/ | |
* | |
* Increase Action Scheduler batch size, concurrency, timeout period, and claim action query | |
* ORDER BY to process large queues of actions more quickly on servers with more server resources. | |
* | |
* @package UniversalYums\ActionScheduler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This code requires one additional filter param to be added to edd_sl_license_response in EDD_Software_Licensing.php: | |
* $response = apply_filters( 'edd_sl_license_response', $params, $download, $data) | |
*/ | |
/** | |
* Allows EDD to bypass the name check for files | |
*/ | |
define( 'EDD_BYPASS_NAME_CHECK', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce code snippet that restricts which items can be added to cart: | |
* | |
* 1) The $trial_product should not be added to cart if existing items are in the cart. | |
* 2) Other products should not be added to cart if $trial_product is already in cart. | |
*/ | |
function example_cart_filtering( $passed_validation, $product_id ) { | |
// ID of the trial product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This script will delete all `on-hold` subscriptions and their orders and users. | |
* It will delete all subscriptions based on IP. | |
* | |
* wp eval-file delete-fraud-activity-by-ip.php 127.0.0.1 | |
* | |
* Dry run: | |
* wp eval-file delete-fraud-activity-by-ip 127.0.0.1 dry | |
* |
NewerOlder