Notas de desarrollo
Publicado por: restor el 27 enero, 2024.
En la carpeta de plugins agregar la carpeta con el nombre de tu plugin.
Crear el nombre del archivo de tu plugin, de preferencia name_folder_plugin/plugin_name.php
dentro del plugin_name.php
<?php
/**
* Conteo de clicks Whatts
*
* Plugin Name: Conteo Whatts
* Plugin URI: https://mecarox.com/plugins/WhattsConteoClick *Cambiar a GitHub
* Description: Este plugin hace cuentas de ciertos elementos estadisticos de los botones whatts.
* Author: mau_restor
* Version: 0.1
* Author URI: https://github.com/maurestor
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* Requires at least: 4.9
* Requires PHP: 5.2.4
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License version 2, as published by the Free Software Foundation. You may NOT assume
* that you can use any other version of the GPL.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
add_action('admin_menu', 'my_adm_link');
function my_adm_link(){
add_menu_page(
'Conteo Whatts',
'Conteo Whatts',
'manage_options',
'mi-plugin-dashboard', // Cambiado el slug para evitar problemas con nombres de archivo
'mi_plugin_dashboard_page', // Funcion a llamar
'dashicons-chart-pie', // Icono
4 //Posicion del menu
);
}
function mi_plugin_dashboard_page() {
$file_path = plugin_dir_path(__FILE__) . 'stat_page.php';
if (file_exists($file_path)) {
include $file_path;
} else {
echo '<p>El archivo stat_page.php no existe.</p>';
}
}