Skip to content

Instantly share code, notes, and snippets.

View brigleb's full-sized avatar

Raymond Brigleb brigleb

View GitHub Profile
@brigleb
brigleb / plugin-activity-logger.php
Last active December 11, 2024 17:07
This Plugin Activity Logger is a lightweight WordPress must-use plugin that tracks and logs all plugin-related activities, including installation, activation, deactivation, updates, and deletions. It logs each event with a timestamp, the WordPress version, the site’s URL, the plugin name, and the username of the person who performed the action. …
<?php
/**
* Plugin Name: Plugin Activity Logger
* Description: Logs plugin installations, activations, deactivations, updates (with from/to versions if available), and deletions. Handles both single and bulk updates. Attempts to log failed updates as well.
* Version: 3.3
* Author: Needmore Designs
*/
if (!defined('ABSPATH')) {
exit; // Exit if accessed directly.
@brigleb
brigleb / plugin-manager.php
Last active April 16, 2023 15:32
This plugin helps manage other WordPress plugins by tracking who installed them, the installation date, and a description. Just put in a folder of the same name, in the Plugins directory.
<?php
/*
Plugin Name: Plugin Manager
Description: This plugin helps manage other plugins by tracking who installed them, the installation date, and a description.
Version: 1.0
Author: Needmore Designs
*/
// Create custom table
function pm_create_table()
@brigleb
brigleb / oreilly.css
Created April 23, 2022 01:36
Use device native fonts by default in O’Reilly reader interface
/* Variables so we can try alternates. You can use serif fonts,
for example, by transposing some lines. */
body {
--font-variable-width: -apple-system-ui-serif, ui-serif, Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
--font-variable-width: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
--font-monospace: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;
}
/* General text */
body,
@brigleb
brigleb / front-page.php
Last active March 7, 2018 15:08
How I like to load ACF loops. `front-page.php` is an example template, calling multiple layouts. Alternately, the second example just finds out what layouts are used and calls them by name. Note the underscore is used in place of a forward slash.
<main>
<?php get_template_part( 'parts/layouts/home', 'intro' ); ?>
<?php get_template_part( 'parts/layouts/home', 'slider' ); ?>
<?php get_template_part( 'parts/product', 'grid' ); ?>
<?php get_template_part( 'parts/layouts/home', 'outro' ); ?>
<?php // or, you can just try to load them ALL, from the next template ?>
<?php get_template_part('parts/content', 'layouts'); ?>
@brigleb
brigleb / move_git.sh
Last active September 9, 2015 01:03
Move a git file from one host to another
#!/bin/bash
# move_git - A script to move a repo from bitbucket to beanstalk
# Assumes you use a ~/Sites folder for these things, and are in it?
# Will leave behind a tarred zipfile of the repository.
# Note: Remember to create the repo in Beanstalk first!
# Usage: move_git.sh repo_name
@brigleb
brigleb / project-outline.md
Last active August 29, 2015 14:13
General Project Outline
  1. Planning
  • Project Statement, Requirements Document
  • Content Inventory and Mood Boards
  • Site Map and Wireframes
  • Pre-Build Test
  1. Building
  • Design
  • Development
    • Markup layer
    • Element layer
@brigleb
brigleb / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@brigleb
brigleb / designer-goals.md
Last active August 29, 2015 14:12
Designer Goals at Needmore
  • Be an expert on web technologies involving images, typography, and layout.
  • Understand the goals and concept of a design.
  • Make a sitemap and wireframes that
    • look professional
    • answer the goals of the project and needs of the client
  • Mock up the website in Sketch or Photoshop,
    • Organizing and naming the layers intelligently
    • Using symbols and styles wherever possible
    • Build the style guide alongside the mockups
  • Hand off all required assets for production, including
@brigleb
brigleb / grunt-plugins.md
Last active August 29, 2015 14:12
Grunt Plugins

Of course you need grunt to start with. And then...

Solid

  • grunt-contrib-watch
  • grunt-contrib-uglify
  • grunt-contrib-imagemin
  • grunt-contrib-sass (or use faster/better grunt-sass?)
  • grunt-contrib/jshint
  • grunt-autoprefixer
@brigleb
brigleb / Gruntfile.js
Last active August 29, 2015 14:12
Gruntfile for the Sass-based Underscores WordPress theme - work in progress.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkgc: grunt.file.readJSON('package.json'),
// Watch files that may change and should trigger updates
watch: {
sass: {
files: ['sass/*.{scss,sass}', 'sass/**/*.scss'],