Plugin Directory

Changeset 3330608


Ignore:
Timestamp:
07/19/2025 11:45:57 AM (9 months ago)
Author:
plance
Message:

Complete code refactoring.

Location:
my-maps
Files:
28 added
5 edited

Legend:

Unmodified
Added
Removed
  • my-maps/trunk/my-maps.php

    r1805195 r3330608  
    11<?php
    2 /*
    3 Plugin Name: My Maps
    4 Plugin URI: http://wordpress.org/plugins/my-maps/
    5 Description: Creating shortcode maps, using friendly interface
    6 Version: 1.0
    7 Author: Pavel
    8 Author URI: http://plance.top/
    9 */
     2/**
     3 * Main plugin file.
     4 *
     5 * @package Plance\Plugin\My_Maps
     6 *
     7 * Plugin Name: My Maps
     8 * Description: Creating shortcode maps, using friendly interface
     9 * Plugin URI:  https://plance.top/
     10 * Version:     1.1.0
     11 * Author:      plance
     12 * Author URI:  http://plance.top/
     13 * License:     GPL v2 or later
     14 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     15 * Text Domain: my-maps
     16 * Domain Path: /languages/
     17 */
    1018
    11 defined('ABSPATH') or die('No script kiddies please!');
     19namespace Plance\Plugin\My_Maps;
    1220
    13 //Include language
    14 load_plugin_textdomain('plance', false, basename(__DIR__).'/languages/');
     21defined( 'ABSPATH' ) || exit;
    1522
    16 if(class_exists('Plance_Include') == false)
    17 {
    18     require_once(plugin_dir_path(__FILE__).'vendor/plance/wp-plugin-library/include.php');
    19 }
    2023
    21 Plance_Include::load(array(
    22     'index' => array(
    23         array(
    24             'class'=> 'Plance_Registry',
    25             'path' => plugin_dir_path(__FILE__).'vendor/plance/wp-plugin-library/registry.php',
    26             'call' => function() {
    27                 add_action('plugins_loaded', function() {
    28                     Plance_Registry::setPlugin(basename(__DIR__));
    29                     Plance_Registry::set('path_to_plugin', plugin_dir_path(__FILE__));
    30                     Plance_Registry::set('url_to_plugin', plugin_dir_url(__FILE__));
    31                 });
    32             }
    33         ),
    34         array(
    35             'class' => 'Plance_Flash',
    36             'path'  => plugin_dir_path(__FILE__).'vendor/plance/wp-plugin-library/flash.php',
    37             'call' => function() {
    38                 Plance_Flash::instance() -> init();
    39             }
    40         ),
    41         'Plance_Validate'   => plugin_dir_path(__FILE__).'vendor/plance/library/validate.php',
    42         'Plance_View'       => plugin_dir_path(__FILE__).'vendor/plance/library/view.php',
    43         'Plance_Request'    => plugin_dir_path(__FILE__).'vendor/plance/library/request.php',
    44        
    45         /*InIt*/
    46         plugin_dir_path(__FILE__).'app/index_init.php',
    47     ),
    48     'admin' => array(
    49         /* System */
    50         'WP_List_Table'     => ABSPATH.'wp-admin/includes/class-wp-list-table.php',
    51        
    52         'Plance_Interface'  => plugin_dir_path(__FILE__).'vendor/plance/wp-plugin-library/interface.php',
    53         'Plance_Controller' => plugin_dir_path(__FILE__).'vendor/plance/wp-plugin-library/controller.php',
    54         'Plance_Validate'   => plugin_dir_path(__FILE__).'vendor/plance/library/validate.php',
    55        
    56         /* InIt */
    57         plugin_dir_path(__FILE__).'app/db.php',
    58         plugin_dir_path(__FILE__).'app/admin_init.php',
    59        
    60         /* Controllers */
    61         plugin_dir_path(__FILE__).'app/controller/admin/Data.php',
    62        
    63         /* View */
    64         plugin_dir_path(__FILE__).'app/view/admin/data/index.php',
    65     ),
    66 ));
     24/**
     25 * Bootstrap.
     26 */
     27require_once __DIR__ . '/bootstrap.php';
    6728
    68 add_action('plugins_loaded', function() {
    69     if(is_admin() == TRUE)
    70     {
    71         new Plance_MSM_Admin_INIT();
    72     }
    73     else
    74     {
    75         new Plance_MSM_Index_INIT();
    76     }
    77 });
    78    
    79 if(is_admin() == TRUE)
    80 {
    81     register_activation_hook(__FILE__, 'Plance_MSM_DB::activate');
    82     register_uninstall_hook(__FILE__, 'Plance_MSM_DB::uninstall');
    83 }
    84 
    85 Plance_Registry::clean();
     29/**
     30 * Actions.
     31 */
     32require_once __DIR__ . '/actions.php';
  • my-maps/trunk/readme.txt

    r1402788 r3330608  
    11=== My Maps ===
    22Contributors: plance
    3 Tags: shortcode, map, google
     3Tags: shortcode, map, google maps, location, embed
    44Requires at least: 4.0.0
    5 Tested up to: 4.5
    6 Stable tag: 1.0
     5Tested up to: 6.8
     6Stable tag: 1.1.0
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    99
     10My Maps is a simple and lightweight WordPress plugin that allows you to easily embed Google Maps on your site using shortcodes.
     11
    1012== Description ==
    11 The plugin
     13My Maps is a simple and lightweight WordPress plugin that allows you to easily embed Google Maps on your site using shortcodes.
    1214
    13 Using this plugin you can create shortcode maps and set them in your posts or pages.
     15With this plugin, you can:
     16- Create custom maps and assign them to shortcodes.
     17- Add a single location to the map by specifying a valid address.
     18- Display the map anywhere on your site using the shortcode: `[my-map id="8"]`, where `id` is the unique identifier of the map.
    1419
    15 Используя данный плагин, вы сможете создавать шорткоды карт и размещать их на своем сайте.
    16 
    17 
     20Perfect for contact pages, location previews, or any situation where a map with a single address pin is required.
    1821
    1922== Installation ==
    20 * Use standart WordPress instalator
    21 * Or extract archive into "/wp-content/plugins/" folder
     231. Upload the plugin to the `/wp-content/plugins/` directory or install it using the WordPress plugin installer.
     242. Activate the plugin through the 'Plugins' menu in WordPress.
     253. Go to the "My Maps" menu in the admin panel to create your maps and generate shortcodes.
     26
     27== Frequently Asked Questions ==
     28
     29= How do I embed a map on my site? =
     30Use the shortcode `[my-map id="X"]` where `X` is the ID of the map you've created.
     31
     32= Can I add more than one location to the map? =
     33Currently, the plugin supports only one location per map based on an address.
     34
     35== Screenshots ==
     361. Admin table listing all created map shortcodes.
     372. Map creation form where you enter the map title and address.
    2238
    2339== Changelog ==
    2440
     41= 1.1.0 =
     42* Complete code refactoring.
     43
    2544= 1.0 =
    26 First version plugin
     45* Initial release – allows creation of maps with single address markers and embedding via shortcode.
Note: See TracChangeset for help on using the changeset viewer.