Skip to content

Instantly share code, notes, and snippets.

View devuri's full-sized avatar
🏠
Working from home

Uriel devuri

🏠
Working from home
View GitHub Profile
@devuri
devuri / _evp_api_req_types.php
Created April 20, 2024 23:05
_evp_api_req_types
<?php
// Hook into the '_evp_api_req_types' filter
add_filter('_evp_api_req_types', 'custom_evp_api_req_types_filter', 10, 1);
/**
* Custom filter to modify API request types.
*
* @param array $api_req_types An array of API request types.
@devuri
devuri / gist:2e0cb502f7e6543b084fa2afb4ad5e7f
Created October 14, 2023 21:29
Apache configuration rules to control access to the .user.ini
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
@devuri
devuri / custom_disclaimer_modifier.php
Created August 22, 2023 23:08
Modify the YouTube embedded videos disclaimer text for easy-video-publisher.
<?php
/**
* Modify the YouTube embedded videos disclaimer text. https://github.com/devuri/easy-video-publisher
*
* @param string $disclaimer The original disclaimer text.
* @return string Modified disclaimer text.
*/
function custom_disclaimer_modifier($disclaimer) {
// Modify the disclaimer text as needed
@devuri
devuri / most-recent-posts.php
Last active July 4, 2023 17:04
list WordPress post based on categories and limit number of returns
<?php
/*
Plugin Name: Most Recent Posts
Description: Lists posts based on categories and limits the number of returns
*/
function most_recent_posts_shortcode($atts) {
$a = shortcode_atts(
array(
'postnumber' => 3,
@devuri
devuri / Break Glass Plan for System Administrator.md
Created June 10, 2023 23:41
Break Glass Plan for System Administrator

Break Glass Plan for System Administrator with Multiple Account Access

Fictional Company: Acme Technologies

Author: John Doe Authorized Personnel: Jane Smith, Michael Johnson, Sarah Thompson

Accounts and Platforms:

  1. Cloud Platform A (Admin Access)
@devuri
devuri / disable-deactivate-plugins.php
Last active June 2, 2023 15:10
Prevent Admin users from deactivating plugins.
<?php
/**
* Prevent Admin users from deactivating plugins.
*
* While this will remove the deactivation link it does NOT prevent deactivation
* It will only hide the link to deactivate.
*/
add_filter( 'plugin_action_links', function ( $actions, $plugin_file, $plugin_data, $context ) {
@devuri
devuri / domain-replacer.php
Created February 22, 2023 13:28
Find and Replace a Domain in a WordPress Database
<?php
/**
* Plugin Name: Domain Replacer
* Plugin URI: https://www.example.com
* Description: A simple plugin to replace one domain with another domain in the WordPress database
* Version: 1.0
* Author: Your Name
* Author URI: https://www.example.com
*/
@devuri
devuri / .htaccess
Created June 25, 2021 20:09
Hiding the WordPress Login Page, Hide WordPress Login by restricting access to IP Address With .htaccess
# BEGIN WordPress
# https://wordpress.org/support/article/htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
@devuri
devuri / wpdb-table-list.php
Last active May 22, 2021 00:20
How to Retrieve a list of database table names for WordPress Database
<?php
namespace MyPlugin\Database;
class WPTable
{
/**
* Get wp database tables.
*
* @return object
@devuri
devuri / wp-config.php
Created February 1, 2021 05:37
WordPress Config File config file with environment variables using Composer
<?php
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\DebugClassLoader;
use Roots\WPConfig\Config;
use Dotenv\Dotenv;