Settings';
array_unshift( $links, $settings_link );
return $links;
}
$plugin = plugin_basename(__FILE__);
add_filter( "plugin_action_links_$plugin", 'aiomh_plugin_settings_link' );
//Include
include('inc/translate.php');
//add style admin
add_action( 'admin_enqueue_scripts', 'aiomh_load_admin_style' );
function aiomh_load_admin_style() {
wp_register_style( 'all-in-one-must-have_admin',plugins_url( 'css/admin.css',__FILE__ ), false,AIOMH_VERSION );
wp_enqueue_style( 'all-in-one-must-have_admin' );
wp_enqueue_script('custom_admin_script', plugins_url( 'js/admin.js',__FILE__ ), array('jquery') ,AIOMH_VERSION);
}
function aiomh_check_exits_txt_file($str,$file=AIOMH_FWPCF){
$content = file_get_contents($file);
return strpos('1'.$content,$str)?true:false;
}
function aiomh_FileCheckPermissions($file=AIOMH_FWPCF)
{
if (!is_writable($file)) {
return false;
}
if (!function_exists('file') || !function_exists('file_get_contents') || !function_exists('file_put_contents'))
{
return false;
}
return true;
}
function aiomh_register_settings() {
register_setting( 'aiomh-setting', 'aiomh_translate' );
if(get_option('aiomh_translate')=='') {if(get_locale()!='vi') update_option( 'aiomh_translate', 'en' ); else update_option( 'aiomh_translate', 'vi' );}
register_setting( 'aiomh-setting', 'aiomh_ascii_file_name' );
if(get_option('aiomh_ascii_file_name')=='') update_option( 'aiomh_ascii_file_name', 1 );
register_setting( 'aiomh-setting', 'aiomh_jpeg_quality' );
if(get_option('aiomh_jpeg_quality')=='') update_option( 'aiomh_jpeg_quality', 1 );
register_setting( 'aiomh-setting', 'aiomh_jpeg_quality_value' );
if(get_option('aiomh_jpeg_quality_value')=='') update_option( 'aiomh_jpeg_quality_value', 75 );
register_setting( 'aiomh-setting', 'aiomh_auto_upload_and_set_thumb' );
if(get_option('aiomh_auto_upload_and_set_thumb')=='') update_option( 'aiomh_auto_upload_and_set_thumb', 1 );
register_setting( 'aiomh-setting', 'aiomh_post_views' );
if(get_option('aiomh_post_views')=='') update_option( 'aiomh_post_views', 1 );
register_setting( 'aiomh-setting', 'aiomh_check_duplicate_title' );
if(get_option('aiomh_check_duplicate_title')=='') update_option( 'aiomh_check_duplicate_title', 1 );
register_setting( 'aiomh-setting', 'aiomh_remove_emoji' );
if(get_option('aiomh_remove_emoji')=='') update_option( 'aiomh_remove_emoji', 1 );
register_setting( 'aiomh-setting', 'aiomh_remove_menu_class' );
if(get_option('aiomh_remove_menu_class')=='') update_option( 'aiomh_remove_menu_class', 1 );
register_setting( 'aiomh-setting', 'aiomh_remove_menu_class_value' );
if(get_option('aiomh_remove_menu_class_value')=='') update_option( 'aiomh_remove_menu_class_value', 'current-menu-item,menu-item-has-children,current-menu-parent' );
register_setting( 'aiomh-setting', 'aiomh_disable_comments' );
register_setting( 'aiomh-setting', 'aiomh_remove_jquery' );
register_setting( 'aiomh-setting', 'aiomh_remove_plugin_jscss' );
register_setting( 'aiomh-setting', 'aiomh_remove_plugin_jscss_all' );
register_setting( 'aiomh-setting', 'aiomh_remove_plugin_jscss_single' );
register_setting( 'aiomh-setting', 'aiomh_remove_plugin_jscss_category' );
register_setting( 'aiomh-setting', 'aiomh_move_js_to_footer' );
register_setting( 'aiomh-setting', 'aiomh_add_js_defer' );
register_setting( 'aiomh-setting', 'aiomh_add_js_defer_value' );
register_setting( 'aiomh-setting', 'aiomh_add_js_async' );
register_setting( 'aiomh-setting', 'aiomh_add_js_async_value' );
//Defence
register_setting( 'aiomh-setting', 'aiomh_change_dir_admin' );
register_setting( 'aiomh-setting', 'aiomh_change_dir_admin_value' );
if(get_option('aiomh_change_dir_admin_value')=='') update_option( 'aiomh_change_dir_admin_value', 'aiomh-login' );
register_setting( 'aiomh-setting', 'aiomh_lock_wpadmin' );
register_setting( 'aiomh-setting', 'aiomh_lock_wpadmin_user' );
register_setting( 'aiomh-setting', 'aiomh_lock_wpadmin_pass' );
register_setting( 'aiomh-setting', 'aiomh_disable_xmlrpc' );
register_setting( 'aiomh-setting', 'aiomh_hidden_verwp' );
register_setting( 'aiomh-setting', 'aiomh_change_key_salt' );
register_setting( 'aiomh-setting', 'aiomh_disallow_file_edit' );
if(aiomh_check_exits_txt_file('DISALLOW_FILE_EDIT')==true) update_option( 'aiomh_disallow_file_edit', 1 );
else update_option( 'aiomh_disallow_file_edit', 0 );
register_setting( 'aiomh-setting', 'aiomh_disallow_file_mods' );
if(aiomh_check_exits_txt_file('DISALLOW_FILE_MODS')==true) update_option( 'aiomh_disallow_file_mods', 1 );
else update_option( 'aiomh_disallow_file_mods', 0 );
}
function aiomh_create_menu(){
add_menu_page('All In One Must Have Settings', 'AIOMH Settings', 'administrator', __FILE__, 'aiomh_settings_page',plugins_url('/images/favicon.gif', __FILE__), 1);
add_action( 'admin_init', 'aiomh_register_settings' );
}
add_action('admin_menu', 'aiomh_create_menu');
$aiomh_ascii_file_name = get_option('aiomh_ascii_file_name');
function aiomh_settings_page() {
?>
'-',
'%20' => '-',
'_' => '-',
);
$sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );
$sanitized_filename = preg_replace('/[^A-Za-z0-9-\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .
$sanitized_filename = preg_replace('/\.(?=.*\.)/', '', $sanitized_filename); // Remove all but last .
$sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row
$sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end
$sanitized_filename = strtolower( $sanitized_filename ); // Lowercase
return $sanitized_filename;
}
if(get_option('aiomh_ascii_file_name')==1) add_filter( 'sanitize_file_name', 'aiomh_sanitize_file_name', 10, 1 );
// Nén ảnh
if(get_option('aiomh_jpeg_quality')==1) add_filter('jpeg_quality', function($arg){
$aiomh_jpeg_quality_value = get_option('aiomh_jpeg_quality_value')==''?75:get_option('aiomh_jpeg_quality_value');
return $aiomh_jpeg_quality_value;
});
// Tự thêm thumbnail
if(get_option('aiomh_auto_upload_and_set_thumb')==1)
{
function aiomh_sb_get_first_image_url_from_text($content) {
$doc = new DOMDocument();
@$doc->loadHTML($content);
$xpath = new DOMXPath($doc);
$src = $xpath->evaluate('string(//img/@src)');
return $src;
}
function aiomh_sb_get_image_attachments($post_id) {
return get_children(array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image'));
}
function aiomh_sb_get_first_image_attachment($post_id) {
$attach_images = aiomh_sb_get_image_attachments($post_id);
$result = null;
if(count($attach_images) > 0) {
$result = array_shift($attach_images);
}
return $result;
}
function aiomh_sb_create_folder($file_path) {
if(!file_exists($file_path)) {
mkdir($file_path);
}
}
function aiomh_sb_copy($source, $destination) {
if(@fclose(@fopen($source, 'r'))) {
copy($source, $destination);
return true;
}
return false;
}
function aiomh_sb_set_post_thumbnail($post_id) {
if(current_theme_supports('post-thumbnails') && !has_post_thumbnail($post_id)) {
$first_image = aiomh_sb_get_first_image_attachment($post_id);
if($first_image) {
set_post_thumbnail($post_id, $first_image->ID);
return true;
} else {
$post = get_post($post_id);
if($post) {
$first_image = aiomh_sb_get_first_image_url_from_text($post->post_content);
$attach_id = aiomh_sb_fetch_media($first_image);
if($attach_id > 0) {
set_post_thumbnail($post_id, $attach_id);
return true;
}
}
}
}
return false;
}
function aiomh_sb_auto_set_thumbnail($post_id) {
if (wp_is_post_revision($post_id)) {
return;
}
aiomh_sb_set_post_thumbnail($post_id);
}
add_action('save_post', 'aiomh_sb_auto_set_thumbnail');
function aiomh_sb_fetch_media($image_url) {
$attach_id = 0;
$wp_upload_dir = wp_upload_dir();
$base_dir = trailingslashit($wp_upload_dir['basedir']) . 'aiomh-img';
$base_url = trailingslashit($wp_upload_dir['url']) . 'aiomh-img';
aiomh_sb_create_folder($base_dir);
$parts = pathinfo($image_url);
$random = rand();
$random = md5($random);
$file_name = 'aiomh-img-' . $parts['filename'] . '-' . $random . '.' . $parts['extension'];
$file_path = trailingslashit($base_dir) . $file_name;
$file_url = trailingslashit($base_url) . $file_name;
if(aiomh_sb_copy($image_url, $file_path)) {
$attachment = array(
'guid' => $file_url
);
$attach_id = aiomh_sb_insert_attachment($attachment, $file_path);
}
return $attach_id;
}
function aiomh_sb_insert_attachment($attachment, $file_path) {
if(!file_exists($file_path)) {
return 0;
}
$file_type = wp_check_filetype(basename($file_path), null);
$attachment['post_mime_type'] = $file_type['type'];
if(!isset($attachment['guid'])) {
return 0;
}
$attachment['post_status'] = isset($attachment['post_status']) ? $attachment['post_status'] : 'inherit';
if(!isset($attachment['post_title'])) {
$attachment['post_title'] = preg_replace('/\.[^.]+$/', '', basename($file_path));
}
$attach_id = wp_insert_attachment($attachment, $file_path);
if($attach_id > 0) {
aiomh_sb_update_attachment_meta($attach_id, $file_path);
}
return $attach_id;
}
function aiomh_sb_update_attachment_meta($attach_id, $file_path) {
if(!function_exists('wp_generate_attachment_metadata')) {
require_once(ABSPATH . 'wp-admin/includes/image.php');
}
$attach_data = wp_generate_attachment_metadata($attach_id, $file_path);
wp_update_attachment_metadata($attach_id, $attach_data);
}
}
// Đếm lượt xem
if(get_option('aiomh_post_views')==1)
{
add_action('wp_loaded', 'aiomh_auto_set_post_view2');
function aiomh_auto_set_post_view2() {
if (!function_exists('getPostViews'))
{
function getPostViews($postID){ // hàm này dùng để lấy số người đã xem qua bài viết
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){ // Nếu như lượt xem không có
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "0"; // giá trị trả về bằng 0
}
return $count; // Trả về giá trị lượt xem
}
}
if(!function_exists('setPostViews'))
{
function setPostViews($postID) {// hàm này dùng để set và update số lượt người xem bài viết.
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
}else{
$count++; // cộng đồn view
update_post_meta($postID, $count_key, $count); // update count
}
}
}
add_action('wp_enqueue_scripts', 'aiomh_auto_set_post_view');
function aiomh_auto_set_post_view() {
if(is_single())
{
global $post;
setPostViews($post->ID);
}
}
}
}
// Kiểm tra tiêu đề trùng
if(get_option('aiomh_check_duplicate_title')==1)
{
function aiomh_add_my_admin_script(){
wp_enqueue_script('admin_script', plugins_url( 'all-in-one-must-have/js/check_duplicate_title.js' ), array('jquery'),AIOMH_VERSION);
wp_localize_script( 'admin_script', 'ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'we_value' => 1234 ) );
}
add_action('admin_enqueue_scripts', 'aiomh_add_my_admin_script');
add_action( 'wp_ajax_my_action', 'aiomh_my_action_callback' );
function aiomh_my_action_callback() {
global $wpdb;
$title_exists = $wpdb->get_results(
"
SELECT ID
FROM $wpdb->posts
WHERE
post_title LIKE '" . $_POST['this_convidado_title'] . "'
AND
post_type = '" . $_POST['post_type'] . "'
"
);
if($_POST['post_ID'] != ""){
foreach ($title_exists as $key => $this_id) {
if($_POST['post_ID'] == $this_id->ID){
$this_is_the_post = $this_id->ID;
}
}
}
if($this_is_the_post){
echo (count($title_exists)-1);
} else {
echo count($title_exists);
}
die();
}
}
// REMOVE WP EMOJI
if(get_option('aiomh_remove_emoji')==1)
{
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
}
// Remove nav id + class menu
if(get_option('aiomh_remove_menu_class')==1)
{
add_filter('nav_menu_css_class', 'aiomh_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'aiomh_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'aiomh_css_attributes_filter', 100, 1);
function aiomh_css_attributes_filter($var) {
$keep_menu_class = explode(',', get_option('aiomh_remove_menu_class_value').',');
return is_array($var) ? array_intersect($var, $keep_menu_class) : '';
}
}
// Disable comments
if(get_option('aiomh_disable_comments')==1)
{
// Disable support for comments and trackbacks in post types
function aiomh_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}
}
add_action('admin_init', 'aiomh_disable_comments_post_types_support');
// Close comments on the front-end
function aiomh_disable_comments_status() {
return false;
}
add_filter('comments_open', 'aiomh_disable_comments_status', 20, 2);
add_filter('pings_open', 'aiomh_disable_comments_status', 20, 2);
// Hide existing comments
function aiomh_disable_comments_hide_existing_comments($comments) {
$comments = array();
return $comments;
}
add_filter('comments_array', 'aiomh_disable_comments_hide_existing_comments', 10, 2);
// Remove comments page in menu
function aiomh_disable_comments_admin_menu() {
remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'aiomh_disable_comments_admin_menu');
// Redirect any user trying to access comments page
function aiomh_disable_comments_admin_menu_redirect() {
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url()); exit;
}
}
add_action('admin_init', 'aiomh_disable_comments_admin_menu_redirect');
// Remove comments metabox from dashboard
function aiomh_disable_comments_dashboard() {
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('admin_init', 'aiomh_disable_comments_dashboard');
// Remove comments links from admin bar
function aiomh_disable_comments_admin_bar() {
if (is_admin_bar_showing()) {
remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
}
}
add_action('init', 'aiomh_disable_comments_admin_bar');
}
//Change dir wp-admin
if(get_option('aiomh_change_dir_admin')==1)
{
function add_my_rule() {
$dir_admin = get_option('aiomh_change_dir_admin_value');
add_rewrite_rule($dir_admin.'?', 'wp-login.php?ok='.$dir_admin, 'top');
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
add_action('init', 'add_my_rule');
$admins = array(
home_url( 'wp-admin', 'relative' ),
home_url( 'dashboard', 'relative' ),
home_url( 'admin', 'relative' ),
site_url( 'dashboard', 'relative' ),
site_url( 'admin', 'relative' ),
home_url( 'wp-login.php', 'relative' ),
home_url( 'login', 'relative' ),
site_url( 'login', 'relative' ),
);
if ( $GLOBALS['pagenow'] === 'wp-login.php' || in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins ) ) {
$dir_admin = get_option('aiomh_change_dir_admin_value');
session_start();
$pass_level1 = $dir_admin;
if(isset($_GET["ok"])){$ok = $_GET["ok"];$_SESSION["ok"] = $ok;}
$ok = isset($_SESSION["ok"])?$_SESSION["ok"]:0;
if($ok!==$pass_level1){exit();}
}
}
if(get_option('aiomh_lock_wpadmin')==1)
{
$admins = array(
home_url( 'wp-admin', 'relative' ),
home_url( 'dashboard', 'relative' ),
home_url( 'admin', 'relative' ),
site_url( 'dashboard', 'relative' ),
site_url( 'admin', 'relative' ),
home_url( 'wp-login.php', 'relative' ),
home_url( 'login', 'relative' ),
site_url( 'login', 'relative' ),
);
if ( $GLOBALS['pagenow'] === 'wp-login.php' || in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins ) ) {
$config['user_aiomh'] = get_option('aiomh_lock_wpadmin_user');
$config['pass_aiomh'] = get_option('aiomh_lock_wpadmin_pass');
if ($_SERVER['PHP_AUTH_USER'] !== $config['user_aiomh'] || $_SERVER['PHP_AUTH_PW'] !== $config['pass_aiomh']){
header('WWW-Authenticate: Basic realm="Login?"');
header('HTTP/1.0 401 Unauthorized');
echo 'Wrong !';
exit();
}
}
}
// Disable xmlrpc
if(get_option('aiomh_disable_xmlrpc')==1)
{
add_filter('xmlrpc_enabled', '__return_false');
}
// Hidden verwp
if(get_option('aiomh_hidden_verwp')==1)
{
remove_action('wp_head', 'wp_generator');
}
// Remove jquery
if(get_option('aiomh_remove_jquery')==1)
{
function aiomh_remove_jquery() {
wp_deregister_script('jquery');
wp_register_script('jquery', false);
}
if (!is_admin()) {
add_action('init', 'aiomh_remove_jquery');
}
// add_filter( 'wp_default_scripts', 'aiomh_remove_jquery_migrate' );
// function aiomh_remove_jquery_migrate( &$scripts){
// if(!is_admin()){
// $scripts->remove( 'jquery');
// }
// }
}
// Remove js,css plugins
if(get_option('aiomh_remove_plugin_jscss')==1)
{
function aiomh_dequeue_my_css_fun($id) {
if($id!='')
{
$id = str_replace(array(', ',', ',', '),',',$id);
$remove_js_css = explode(',', $id.',');
$count_remove_js_css = count($remove_js_css);
for($i=0;$i<$count_remove_js_css-1;$i++)
{
wp_dequeue_style($remove_js_css[$i]);
wp_deregister_style($remove_js_css[$i]);
wp_dequeue_script($remove_js_css[$i]);
wp_deregister_script($remove_js_css[$i]);
add_action('wp_footer', 'wp_print_scripts', 5);
}
}
}
function aiomh_dequeue_my_css() {
aiomh_dequeue_my_css_fun(get_option('aiomh_remove_plugin_jscss_all'));
if(is_home() || is_front_page()) aiomh_dequeue_my_css_fun(get_option('aiomh_remove_plugin_jscss_home'));
if(is_category() || is_archive()) aiomh_dequeue_my_css_fun(get_option('aiomh_remove_plugin_jscss_category'));
if(is_single()) aiomh_dequeue_my_css_fun(get_option('aiomh_remove_plugin_jscss_single'));
}
add_action( 'wp_enqueue_scripts', 'aiomh_dequeue_my_css', 9999 );
}
// Move script to wp_footer()
if(get_option('aiomh_move_js_to_footer')==1)
{
function footer_enqueue_scripts() {
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
add_action('wp_footer', 'wp_print_scripts', 5);
add_action('wp_footer', 'wp_enqueue_scripts', 5);
add_action('wp_footer', 'wp_print_head_scripts', 5);
}
add_action('wp_enqueue_scripts', 'footer_enqueue_scripts');
//add_action('after_setup_theme', 'footer_enqueue_scripts');
}
// Add async script
if(get_option('aiomh_add_js_async')==1)
{
function aiomh_add_async_attribute($tag, $handle) {
$id = str_replace(array(', ',', ',', '),',',get_option('aiomh_add_js_async_value'));
$scripts_to_async = explode(',', $id.',');
foreach($scripts_to_async as $async_script) {
if ($async_script === $handle) {
$tag = str_replace('defer="defer" ', '', $tag);
$tag = str_replace(' src', ' async="async" src', $tag);
return $tag;
}
}
return $tag;
}
add_filter('script_loader_tag', 'aiomh_add_async_attribute', 10, 2);
}
// Add defer script
if(get_option('aiomh_add_js_defer')==1)
{
function aiomh_add_defer_attribute($tag, $handle) {
$id = str_replace(array(', ',', ',', '),',',get_option('aiomh_add_js_defer_value'));
$scripts_to_defer = explode(',', $id.',');
foreach($scripts_to_defer as $defer_script) {
if ($defer_script === $handle) {
$tag = str_replace('async="async" ', '', $tag);
$tag = str_replace(' src', ' defer="defer" src', $tag);
return $tag;
}
}
return $tag;
}
add_filter('script_loader_tag', 'aiomh_add_defer_attribute', 10, 2);
}
//Submit
if(isset($_GET['settings-updated']) && $_GET['settings-updated']=='true')
{
// Hidden verwp
if(get_option('aiomh_hidden_verwp')==1)
{
//Remove file readme.html
$file_readme = ABSPATH.'readme.html';
if(file_exists($file_readme)) unlink($file_readme);
}
// Change salt in wp-config
if(get_option('aiomh_change_key_salt')==1 )
{
if(aiomh_FileCheckPermissions()==true)
{
include_once(ABSPATH.'wp-includes/pluggable.php');
$wpconfig_content = file_get_contents(AIOMH_FWPCF);
if (!empty($wpconfig_content)){
$wpconfig_content = str_replace(AUTH_KEY,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(SECURE_AUTH_KEY,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(LOGGED_IN_KEY,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(NONCE_KEY,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(AUTH_SALT,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(SECURE_AUTH_SALT,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(LOGGED_IN_SALT,wp_generate_password( 64, true, true ),$wpconfig_content);
$wpconfig_content = str_replace(NONCE_SALT,wp_generate_password( 64, true, true ),$wpconfig_content);
$result = file_put_contents(AIOMH_FWPCF, $wpconfig_content);
}
}
update_option( 'aiomh_change_key_salt', 0 );
}
// Disallow edit files on themes,plugins in wp-admin
if(get_option('aiomh_disallow_file_edit')==1 && aiomh_FileCheckPermissions()==true && aiomh_check_exits_txt_file('DISALLOW_FILE_EDIT')!=true)
{
$wpconfig_content = file_get_contents(AIOMH_FWPCF);
$wpconfig_content = preg_replace( '/(<\?(?:php)?)/', "