Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
damiencarbery / list-active-plugins.php
Last active January 10, 2023 01:39
List name, version and description of active plugins.
<?php
/*
// Restrict who can access this script.
$permitted_ips = array('12.34.56.78', );
if (in_array($_SERVER['REMOTE_ADDR'], $permitted_ips) == false) {
header('HTTP/1.0 403 Forbidden');
die();
}
*/
?>
1. Highlight a recommended option,

2. Allow users to switch currency (€/$/£)

3. Allow users to switch pricing monthly/yearly

4. Keep the entire pricing plan area clickable

5. Use slider to calculate how much a user would save

6. Provide free first month for good engagement

7. Prominently highlight testimonials prominently

8. Repeating call to action on top and bottom

9. Sell benefits instead of features

10. Indicate that users can cancel any time

@RadGH
RadGH / recalculate-acf-locations.php
Last active July 19, 2023 19:16
Get latitude and longitude for addresses saved in Advanced Custom Fields, using Google's GeoLocation API
<?php
global $acf_recalc_settings;
// IMPORTANT: Customize these settings for your website.
$acf_recalc_settings = array(
// How many updates to do each page load. As of November 2018, Google's GeoLocation API limit is 100 per second.
'posts_per_run' => 16,
@mojaray2k
mojaray2k / jsbin.burut.html
Last active September 19, 2023 15:42
CSS only custom-styled select Todd Parker - Filament Group Inc. How this works: This styles a native select consistently cross-platform with only minimal CSS. The native select is then styled so it is essentially invisible (no appearance, border, bg) leaving only the select's text visible. There is a wrapper around the select that has the majori…
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
@barneycarroll
barneycarroll / README.md
Last active August 29, 2022 12:02
Lock and unlock a page's scroll position.

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa
@y0mbo
y0mbo / Contract Killer 3.md
Last active August 12, 2020 01:40 — forked from malarkey/Contract Killer 3.md
This is a contract based on Andy Clark's Contract Killer 3.

Killer Contract

(Based on the Contract Killer 3 by Andy Clarke at Stuff and Nonsense) See: https://gist.github.com/malarkey/4031110

Contract

Summary

I always do my best to fulfill your needs and meet your expectations, but it's still important to have things written down so that we both know what's what, who should do what and when, and what will happen if something goes terribly wrong. You won't find any complicated legal terms or long, unreadable text here. I have no desire to trick you into signing something you might later regret. I want us to do what is best for both of us, now and in the future. This is the start of a great relationship!

@DrewAPicture
DrewAPicture / clean_404_emails.php
Last active September 27, 2023 09:03
Original snippet by wp-mix.com at http://wp-mix.com/wordpress-404-email-alerts/ With the improved OOP style, implementation is a lot more straightforward, just add <?php new Clean_404_Email; to the top of your 404.php template.
<?php
// Just require() this class via your theme's functions.php file.
/* Then instantiate this at the top of your 404.php file with:
if ( class_exists( 'Clean_404_Email' ) )
new Clean_404_Email;
*/
class Clean_404_Email {
var $time, $request, $blog, $email, $theme, $theme_data, $site, $referer, $string, $address, $remote, $agent, $message;