Skip to content

Instantly share code, notes, and snippets.

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

Junaid Hassan junaidte14

🏠
Working from home
View GitHub Profile
@junaidte14
junaidte14 / codemirror-init.js
Created April 26, 2025 17:15
Managing custom tweaks for your WordPress site can be challenging — especially when switching themes or updating plugins. All your customizations risk being lost! To solve this, I created a simple, secure, and powerful plugin that lets you easily add your own custom CSS, JavaScript, and PHP code without touching your theme files.
jQuery(document).ready(function ($) {
const codemirrorSettings = wp.codeEditor.defaultSettings || {};
const textareas = {
'css': 'textarea[name*="[custom_css]"]',
'js': 'textarea[name*="[custom_js]"]',
'php': 'textarea[name*="[custom_php]"]'
};
for (const type in textareas) {
const textarea = document.querySelector(textareas[type]);
@junaidte14
junaidte14 / comments-importer.php
Created April 26, 2025 16:35
WordPress Plugin to Import Weebly Blog Comments Easily
<?php
/**
* Plugin Name: Comments Importer
* Description: Import comments into a WordPress post by pasting Weebly-style HTML.
* Version: 1.0
* Author: Junaid Hassan
*/
if (!defined('ABSPATH')) exit;
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Hello World!</h1>
<p>Welcome to my web page.</p>
</body>
</html>