Skip to content

Instantly share code, notes, and snippets.

<?php
/*
* Plugin Name: Remove crazy counts slowing down my dashboard
* Plugin URI: https://pmgarman.me
* Description: Those comment counts are such a pain when you have a lot of comments
* Author: Patrick Garman
* Author URI: https://pmgarman.me
* Version: 1.0.0
* License: GPLv2
*/
@MikeNGarrett
MikeNGarrett / wp-cli-install-rec-plugins
Last active July 12, 2021 07:18
Chained WordPress CLI commands to install and activate recommended plugins.
# wordpress-seo provides ability to edit meta information and provides sitemap.
# w3-total-cache provides advanced caching no matter the server technology available.
# better-wp-security provides brute force protection and a number of WordPress enhancements.
# google-analytics-for-wordpress provides robust Google Analytics integration through the Google API.
# redirection detects 404s and 301s and allows admins to set up redirects in the WP admin.
# ewww-image-optimizer provides automatic optimization of uploaded images with local libraries instead of cloud-based services.
# backupwordpress simple backup solution that can store backups above web root.
# relevanssi provides better site search using a local index.
# cloudflare is the best. Free automatic CDN and security solution.
# jarvis is a quick search for the WordPress admin. Indespensible.
@luisabarca
luisabarca / get-vimeo-private-video-thumb.php
Last active April 20, 2020 02:15
Get a thumbnail from Vimeo private videos
<?php
// You need Vimeo API https://github.com/vimeo/vimeo.php
require 'path-to-your-lib/vimeo/vimeo.php';
// Get this from your account
$vimeo_client_id = 'xxxxx';
$vimeo_client_secret = 'xxxxxxxxxxx';
// This has to be generated on your site, plugin or theme
$vimeo_token = 'xxxxxx';
@rachelmccollin
rachelmccollin / dashboard_widget_function.php
Last active March 16, 2018 01:03
WPMU DEV Admin Messages
function rmcc_add_dashboard_widget() {
wp_add_dashboard_widget( 'rmcc_dashboard_welcome', 'Welcome', 'rmcc_welcome_widget_callback' );
}
add_action( 'wp_dashboard_setup', 'rmcc_add_dashboard_widget' );
<?php
/**
* Plugin Name: YOUR PLUGIN NAME
*/
include( dirname( __FILE__ ) . '/lib/requirements-check.php' );
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array(
'title' => 'YOUR PLUGIN NAME',
'php' => '5.4',
@jinsley8
jinsley8 / google-analytics.php
Created February 13, 2022 17:51
Enqueue Google Analytics 4 script without tracking Admin
/**
* Enqueue Google Analytics 4 script
*
*/
/* Add Google Analytics 4 Site Tag as close to
the opening <head> tag as possible
=====================================================*/
define("GA4","G-XXXXXX", false); // Replace GA4 ID