İlk sürüm: Eklenti temel yapısı ve metadata tanımları
This commit is contained in:
19
README.md
Normal file
19
README.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# himsakiye-wp-plugin
|
||||||
|
|
||||||
|
WordPress için Osmanlı temalı interaktif Ramazan İmsakiye eklentisi.
|
||||||
|
|
||||||
|
## Özellikler
|
||||||
|
- **2 Tip Gösterim:** Sidebar widget ve Tam ekran imsakiye (Shortcode).
|
||||||
|
- **Yerel Hesaplama:** Harici API bağımlılığı olmadan astronomik namaz vakti hesaplama.
|
||||||
|
- **İl Seçimi:** 81 il için koordinat tabanlı veri.
|
||||||
|
- **Geri Sayım:** İftar vaktine kalan süreyi anlık gösterim.
|
||||||
|
- **Modern Tasarım:** Gotik / Osmanlı Ramazan teması (Yeşil tonları).
|
||||||
|
- **PWA Uyumluluğu:** Mobil cihazlar için optimize edilmiş arayüz.
|
||||||
|
|
||||||
|
## Kurulum
|
||||||
|
1. Eklentiyi `/wp-content/plugins/` dizinine yükleyin.
|
||||||
|
2. WordPress admin panelinden eklentiyi aktif edin.
|
||||||
|
3. `[himsakiye]` kısa kodunu istediğiniz sayfaya ekleyin.
|
||||||
|
|
||||||
|
---
|
||||||
|
*hOLOlu tarafından Mustafa ÖZKAYA için geliştirilmiştir.*
|
||||||
69
himsakiye.php
Normal file
69
himsakiye.php
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Plugin Name: hImsakiye - Ramazan İmsakiye Eklentisi
|
||||||
|
* Plugin URI: https://www.mustafaozkaya.tr/
|
||||||
|
* Description: Osmanlı temalı, yerel hesaplama yöntemli interaktif Ramazan imsakiye eklentisi.
|
||||||
|
* Version: 1.0.0
|
||||||
|
* Author: Mustafa ÖZKAYA & hOLOlu
|
||||||
|
* Author URI: https://www.mustafaozkaya.tr/
|
||||||
|
* Text Domain: himsakiye
|
||||||
|
* Domain Path: /languages
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Doğrudan erişimi engelle
|
||||||
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sabitleri tanımla
|
||||||
|
define( 'HIMSAKIYE_VERSION', '1.0.0' );
|
||||||
|
define( 'HIMSAKIYE_PATH', plugin_dir_path( __FILE__ ) );
|
||||||
|
define( 'HIMSAKIYE_URL', plugin_dir_url( __FILE__ ) );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Eklenti Ana Sınıfı
|
||||||
|
*/
|
||||||
|
class HImsakiye {
|
||||||
|
private static $instance = null;
|
||||||
|
|
||||||
|
public static function get_instance() {
|
||||||
|
if ( null === self::$instance ) {
|
||||||
|
self::$instance = new self();
|
||||||
|
}
|
||||||
|
return self::$instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function __construct() {
|
||||||
|
$this->includes();
|
||||||
|
$this->init_hooks();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function includes() {
|
||||||
|
// Hesaplama motoru, widget ve shortcode sınıflarını buraya ekleyeceğiz
|
||||||
|
// require_once HIMSAKIYE_PATH . 'includes/class-himsakiye-calc.php';
|
||||||
|
// require_once HIMSAKIYE_PATH . 'includes/class-himsakiye-widget.php';
|
||||||
|
// require_once HIMSAKIYE_PATH . 'includes/class-himsakiye-shortcode.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
private function init_hooks() {
|
||||||
|
add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] );
|
||||||
|
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function load_textdomain() {
|
||||||
|
load_plugin_textdomain( 'himsakiye', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function enqueue_assets() {
|
||||||
|
wp_enqueue_style( 'himsakiye-theme', HIMSAKIYE_URL . 'assets/css/theme.css', [], HIMSAKIYE_VERSION );
|
||||||
|
wp_enqueue_script( 'himsakiye-main', HIMSAKIYE_URL . 'assets/js/main.js', [ 'jquery' ], HIMSAKIYE_VERSION, true );
|
||||||
|
|
||||||
|
wp_localize_script( 'himsakiye-main', 'hImsakiyeVars', [
|
||||||
|
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||||
|
'nonce' => wp_create_nonce( 'himsakiye_nonce' )
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Eklentiyi başlat
|
||||||
|
HImsakiye::get_instance();
|
||||||
Reference in New Issue
Block a user