Spaces:
Sleeping
Sleeping
Download selfanalysis-ui/selfanalysis.php from devusman/analysis_tool: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/devusman/analysis_tool/resolve/main/selfanalysis-ui/selfanalysis.php
- Command line
-
hf download hf://spaces/devusman/analysis_tool/selfanalysis-ui/selfanalysis.php
-
curl -L -o selfanalysis.php https://huggingface.co/spaces/devusman/analysis_tool/resolve/main/selfanalysis-ui/selfanalysis.php
1.09 kB
| /** | |
| * Plugin Name: Self Analysis Tool | |
| * Description: Provides a shortcode [selfanalysistool] to embed the index.html file on any page or post. | |
| * Version: 1.2.0 | |
| * Author: Muhammad Usman | |
| * Author URI: https://devusman.vercel.app | |
| * License: GPL-2.0+ | |
| * License URI: http://www.gnu.org/licenses/gpl-2.0.txt | |
| * Text Domain: selfanalysistool | |
| */ | |
| // Abort if this file is called directly | |
| if (!defined('WPINC')) { | |
| die; | |
| } | |
| /** | |
| * Shortcode callback function | |
| */ | |
| function selfanalysistool_shortcode_handler($atts) | |
| { | |
| // Enqueue styles and scripts only when shortcode is used | |
| $file_path = plugin_dir_path(__FILE__) . 'index.html'; | |
| if (file_exists($file_path)) { | |
| ob_start(); | |
| include($file_path); | |
| return ob_get_clean(); | |
| } else { | |
| if (current_user_can('manage_options')) { | |
| return 'Error: index.html not found in selfanalysistool plugin directory.'; | |
| } | |
| return ''; | |
| } | |
| } | |
| add_shortcode('selfanalysistool', 'selfanalysistool_shortcode_handler'); | |