Skip to content

Instantly share code, notes, and snippets.

View pirate-bot's full-sized avatar

themeisle[bot] pirate-bot

View GitHub Profile
@pirate-bot
pirate-bot / sdk-disable-recommendations.php
Created February 26, 2026 08:15
Disable smart recommendations in Themeisle products
<?php
/**
* Plugin Name: Disable Themeisle SDK Recommendations
* Description: A lightweight plugin to disable the in-context helpful recommendations in Themeisle products.
* Version: 1.0
* Author: Themeisle
* License: GPL-2.0+
*/
if ( ! defined( 'ABSPATH' ) ) {
@pirate-bot
pirate-bot / sample-plugin-index.php
Last active February 26, 2026 08:15
Description fodsr first files
<??php_check_syntax
@pirate-bot
pirate-bot / revive-old-post-instant-share-with-postie-plugins.php
Created February 26, 2026 08:15
ROP tweak - Instant Sharing with Postie Plugins.
<?php
/*
* Plugin Name: ROP tweak - Instant Sharing with Postie Plugins.
* Version: 0.0.1
*/
/**
* Postie post after.
*
* @param array $details Post data.
@pirate-bot
pirate-bot / optimole-variation-removal.php
Created February 26, 2026 08:15
Force removal of WordPress image sizes in urls and use the original image. This can only be used with the main Optimole plugin.
<?php
/*
Plugin Name: Optimole Tweak - Force removal of wp variations
Description: Force removal of WordPress image sizes in urls and use the original image. This can only be used with main Optimole plugin.
Version: 0.0.1
*/
function optml_post_process_fixes($html){
$extracted_urls = Optml_Manager::instance()->extract_urls_from_content( $html );
@pirate-bot
pirate-bot / optimole-remove-image-sizes.php
Created February 26, 2026 08:15
Removes WordPress image sizes.
<?php
/*
* Plugin Name: Optimole Tweak - Remove image sizes.
* Version: 0.0.1
*/
add_action('intermediate_image_sizes_advanced', '__return_empty_array');
add_filter('big_image_size_threshold', '__return_false');
@pirate-bot
pirate-bot / optimole-remove-https.php
Created February 26, 2026 08:15
Remove 2nd https from the links.
<?php
/*
Plugin Name: Optimole Tweak - Remove 2nd https from image urls
Version: 0.0.1
*/
add_filter( 'optml_content_url', function ( $url ) {
$searchString = "https://";
$firstPos = strpos( $url, $searchString );
@pirate-bot
pirate-bot / optimole-optml-forced-format.php
Created February 26, 2026 08:15
Force a particular format for images
<?php
/*
Plugin Name: Optimole Tweak - Force a format for all images
Version: 0.0.1
Requires PHP: 7.0
Author URI: https://optimole.com
*/
function optml_forced_format() {
@pirate-bot
pirate-bot / optimole-hide-optimole-dam.php
Created February 26, 2026 08:15
Hide Optimole DAM tab during image model for non admins via custom CSS
<?php
add_action('admin_head', function () {
$current_user = wp_get_current_user();
// Hide for Editors and Contributors
if (in_array('editor', $current_user->roles) || in_array('contributor', $current_user->roles)) {
echo '<style>button#menu-item-optimole { display: none !important; }</style>';
}
});
@pirate-bot
pirate-bot / optimole-force-fill-resize.php
Created February 26, 2026 08:15
Force fill resize to all images
<?php
/*
Plugin Name: Optimole Tweak - Force resize fill to all images
Description: Force fill resize type to all images with smart cropping.
Version: 0.0.1
*/
add_filter('optml_image_args', function($args) {
$args['resize']['type'] = 'fill';
$args['resize']['gravity'] = 'sm';
@pirate-bot
pirate-bot / optimole-force-fill-resize-with-exclusion.php
Created February 26, 2026 08:15
Force fill resize to all images with exclusion rules
<?php
/*
Plugin Name: Optimole Tweak - Force resize fill to most images
Description: Force fill resize type to most images with smart cropping, excluding specific ones.
Version: 0.0.1
*/
add_filter('optml_image_args', function($args, $original_url) {
// List of image URLs (or parts of them) to exclude
$excluded_images = [