| @@ -1,50 +1,31 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* |
| 3 | 3 | Plugin Name: CoolClock |
| 4 | 4 | Plugin URI: https://status301.net/wordpress-plugins/coolclock/ |
| 5 | -Description: Add an analog clock to your sidebar. | |
| 5 | +Description: An analog clock for your site. | |
| 6 | 6 | Text Domain: coolclock |
| 7 | -Domain Path: languages | |
| 8 | -Version: 4.1 | |
| 7 | +Requires at least: 5.8 | |
| 8 | +Version: 4.3.9 | |
| 9 | 9 | Author: RavanH |
| 10 | 10 | Author URI: https://status301.net/ |
| 11 | +License: GPL-2.0-or-later | |
| 12 | +License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
| 11 | 13 | */ |
| 12 | 14 | |
| 13 | 15 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 14 | 16 | |
| 17 | +define( 'COOLCLOCK_DIR', plugin_dir_path(__FILE__) ); | |
| 18 | + | |
| 15 | 19 | /************** |
| 16 | 20 | * CLASSES |
| 17 | 21 | **************/ |
| 18 | 22 | |
| 19 | -require plugin_dir_path( __FILE__ ) . '/includes/class-coolclock.php'; | |
| 20 | -require plugin_dir_path( __FILE__ ) . '/includes/class-coolclock-widget.php'; | |
| 21 | -require plugin_dir_path( __FILE__ ) . '/includes/class-coolclock-shortcode.php'; | |
| 23 | +require COOLCLOCK_DIR . 'includes/class-coolclock.php'; | |
| 24 | +require COOLCLOCK_DIR . 'includes/class-coolclock-widget.php'; | |
| 25 | +require COOLCLOCK_DIR . 'includes/class-coolclock-shortcode.php'; | |
| 22 | 26 | |
| 23 | 27 | /************** |
| 24 | - * HOOKS | |
| 25 | - **************/ | |
| 26 | - | |
| 27 | -// text domain | |
| 28 | -add_action( 'plugins_loaded', array( 'CoolClock', 'textdomain' ) ); | |
| 29 | - | |
| 30 | -// widgets | |
| 31 | -add_action( 'widgets_init', array( 'CoolClock', 'register_widget' ) ); | |
| 32 | - | |
| 33 | -// enqueue scripts but only if shortcode or widget has been used | |
| 34 | -// so it has to be done as late as the wp_footer action | |
| 35 | -add_action( 'wp_footer', array( 'CoolClock', 'enqueue_scripts' ), 1 ); | |
| 36 | - | |
| 37 | -/************** | |
| 38 | - * SHORTCODE | |
| 39 | - **************/ | |
| 40 | - | |
| 41 | -add_shortcode( 'coolclock', array( 'CoolClock_Shortcode', 'handle_shortcode' ) ); | |
| 42 | - | |
| 43 | -// prevent texturizing shortcode content | |
| 44 | -add_filter( 'no_texturize_shortcodes', array( 'CoolClock_Shortcode', 'no_wptexturize') ); | |
| 45 | - | |
| 46 | -/************** | |
| 47 | 28 | * INITIATE |
| 48 | 29 | **************/ |
| 49 | 30 | |
| 50 | -new CoolClock( __FILE__ ); | |
| 31 | +new CoolClock( __FILE__, '4.3.9' ); | |