This file contains hidden or 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 | |
declare(strict_types=1); | |
/** | |
* Create an override function, as to bypass Freemius in stupid plugins. | |
* @wordpress-muplugin | |
* Plugin Name: Freemius Stub | |
* Description: Global override for Freemius' "loader". | |
* Version: 1.1.0 |
This file contains hidden or 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
/** On Freemius purchase complete **/ | |
jQuery(document).on( | |
"wpt-freemius-checkout", | |
function(event, response, handler_args){ | |
}); |
This file contains hidden or 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 | |
class WpCsp { | |
public function register(): void | |
{ | |
add_filter('script_loader_tag', [$this, 'filter_script_loader_tag'], 3, 50); | |
add_filter('wp_inline_script_attributes', [$this, 'action_wp_inline_script_attributes']); |
This file contains hidden or 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 hidden or 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 | |
/* | |
* The ActionScheduler WordPress plugin removes 20 complete & canceled status actions older than | |
* the filtered `action_scheduler_retention_period` value in seconds. In large scale applications | |
* generating more than 20 actions per minute on average, this can cause run away growth of the | |
* wp_actionscheduler_actions and wp_actionscheduler_logs tables. | |
* | |
* This gist adds a second cleanup pass every time AS normally cleans up & runs the queue. | |
* | |
* No support provided. No warranties expressed or implied. |
This file contains hidden or 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 | |
/** @var \Freemius $myfreemiustag_fs Freemius global object. */ | |
global $myfreemiustag_fs; | |
if ( ! isset( $myfreemiustag_fs ) ) { | |
// Include Freemius SDK. | |
require_once 'mypath/includes/vendor/freemius/wordpress-sdk/start.php'; | |
$myfreemiustag_fs = fs_dynamic_init( array( | |
'id' => '10000', |
This file contains hidden or 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 | |
// AppSumo AJAX form submission | |
add_action( 'wp_ajax_nopriv_deo_appsumo_submission', 'deo_appsumo_submission' ); | |
add_action( 'wp_ajax_deo_appsumo_submission', 'deo_appsumo_submission' ); | |
function deo_appsumo_submission() { | |
check_ajax_referer( 'deo_ajax_nonce', 'nonce' ); | |
This file contains hidden or 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 | |
/** | |
* Get autoload heavy options from options table | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ | |
if( ! function_exists( 'prefix_get_heavy_autoload_options' ) ) : | |
function prefix_get_heavy_autoload_options() { |
This file contains hidden or 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 | |
/** | |
* Get Autoload Options Size | |
* | |
* Get the size of all options which are set as `autoload_size` in the WordPress `wp_options` ($wpdb->options) table. | |
* | |
* @todo Change the `prefix_` and with your own unique prefix. | |
* | |
* @since 1.0.0 | |
*/ |
NewerOlder