Skip to content

Instantly share code, notes, and snippets.

seedprod / remove_inline_css_and_style_tag.php
Last active Jul 22, 2021
This will remove inline css and style tag and will allows you to move to dedicated style sheet or head.
View remove_inline_css_and_style_tag.php
function semi_it( $string ) {
return rtrim( $string, ';' ) . ';';
function generate_random_string($length = 10) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyz';
View firsttouchcookie.js
function set_fta(){
var t = Math.round((new Date()).getTime() / 1e3);
var p = '';
var b = document.body;
if (this.fta_h_c(b,'single-post')) {
p = 'b--'
var n = location.pathname;
View rolling-updates.php
// we have a product upload record in our db. That upload record has things like:
//slug, zipfile, current_verison, wordpress_version_required, test_to, upgrade_notice etc
// when a update request comes in we run our checks.
// for example if we are checking for a legacy version
$is_legacy = false;
$latest_legacy_version = '5.12.8';
View rafflepress-invent-your-own.php
Plugin Name: RafflePress Invent Your Own
Plugin URI:
Description: Programmatically Add User and Complete Actions in RafflePress
Author URI:
License URI:
View gist:ee66ef9de9b6a350b05b0af405c471fc
<?php if (empty($giveaway->slug) || !empty($_GET['iframe'])) { ?>
<meta name="robots" content="noindex">
<?php } ?>
View gist:fbaeaa2d3b5728f9871f57863b108a77
document.addEventListener('om.Campaign.afterShow', function(event) {
// exit offer
if(event.detail.Campaign.numericId == '212237'){
var offer_ajax_url = '/checkout/exit_offer';
console.log( _self.$data);
).then(function (response) {
View RafflePress frontend string
$rp_frontend_translations = array(
'txt_1'=>__('Total Entries', 'rafflepress-pro'),
'txt_2'=>__('Your Entries', 'rafflepress-pro'),
'txt_3'=>__('Log In to Enter this Giveaway:', 'rafflepress-pro'),
'txt_4'=>__('Enter', 'rafflepress-pro'),
'txt_5'=>__('Logout', 'rafflepress-pro'),
'txt_6'=>__('Hi', 'rafflepress-pro'),
'txt_7'=>__('Ways to Enter', 'rafflepress-pro'),
View gist:1b8be963b47d7f8aad72a248c474ee51
// assign entering entries if enabled
$entries_tablename = $wpdb->prefix . 'rafflepress_entries';
$insert_arrays[] = array(
'giveaway_id' =>$giveaway_id,
'contestant_id' => $contestant['id'],
'meta' => '{"action":"Entering Giveaway"}',
rafflepress_pro_wp_insert_rows($insert_arrays, $entries_tablename);
$contestant['total_entries'] = 1;
//end assign entering entries if enabled
View gist:5b366557c651f1d408457c819c2f5930
## Unsafe SQL calls
When making database calls, it's highly important to protect your code from SQL injection vulnerabilities. You need to update your code to use prepare() with your queries to protect them.
Please review the following:
View gist:3c933f89f908d4106927c510552163b5
cursor: pointer;
#wpnbio-alert ul {
list-style: none;