This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: OtakuPahp Security Measures | |
Description: Some Wordpress Hacks to improve site security | |
Author: Pablo Hernandez (OtakuPahp) | |
Author URI: https://otakupahp.llc | |
Version: 1.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Plugin Name === | |
. | |
. | |
. | |
Requires at least: 5.9 | |
Tested up to: 5.9.3 | |
Requires PHP: 8.0 | |
WC requires at least: 6.0 | |
WC tested up to: 6.0 | |
License: GPLv2 or later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# After enquequing the JS add this localization to add the nonce and other variables | |
$params = [ | |
'action' => 'your_action', | |
'wp_nonce' => wp_create_nonce( 'wp_ajax_nonce' ), | |
'error' => __('There was an error with the Ajax call. Please try again later'), | |
]; | |
wp_localize_script( 'custom_ajax_params', 'wp_globals', $params ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @since 1.0.0 | |
* | |
* @param $plugin_name | |
*/ | |
public static function activate($plugin_name) { | |
# Initialize variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function( $ ) { | |
'use strict'; | |
// DOM ready | |
$(function() { | |
}); | |
// Window loaded | |
$(window).on("load",function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Enable WP_DEBUG mode, logging to the /wp-content/debug.log file , without displaying on screen errors and warnings | |
define('WP_DEBUG', true); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); | |
@ini_set( 'display_errors', 0 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix EOL error for multiple environments for text files | |
*.* text eol=lf | |
# set image and fonts as binary | |
*.png binary | |
*.jpg binary | |
*.gif binary | |
*.pdf binary | |
*.eps binary | |
*.zip binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WDS Hello World | |
Plugin URI: https://webdevstudios.com/ | |
Description: Teaching the basics of WP-CLI | |
Author: Web Dev Studios | |
Version: 1.0.0 | |
Author URI: https://webdevstudios.com/ | |
*/ | |
class WDS_CLI { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |