pojo-accessibility
Last commit date
assets
1 year ago
classes
1 year ago
includes
1 year ago
modules
1 year ago
vendor
1 year ago
plugin.php
1 year ago
pojo-accessibility.php
1 year ago
readme.txt
1 year ago
wpml-config.xml
10 years ago
pojo-accessibility.php
97 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: Ally - Web Accessibility - Implement Accessibility Features: Widget and Statement Generator |
| 4 | Plugin URI: https://elementor.com/ |
| 5 | Description: Improve your website’s accessibility with ease. Customize capabilities such as text resizing, contrast modes, link highlights, and easily generate an accessibility statement to demonstrate your commitment to inclusivity. |
| 6 | Author: Elementor.com |
| 7 | Author URI: https://elementor.com/ |
| 8 | Version: 3.0.0 |
| 9 | Text Domain: pojo-accessibility |
| 10 | Domain Path: /languages/ |
| 11 | */ |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } // Exit if accessed directly |
| 15 | |
| 16 | // Legacy |
| 17 | define( 'POJO_A11Y_CUSTOMIZER_OPTIONS', 'pojo_a11y_customizer_options' ); |
| 18 | |
| 19 | define( 'EA11Y_VERSION', '3.0.0' ); |
| 20 | define( 'EA11Y_MAIN_FILE', __FILE__ ); |
| 21 | define( 'EA11Y_BASE', plugin_basename( EA11Y_MAIN_FILE ) ); |
| 22 | define( 'EA11Y_PATH', plugin_dir_path( __FILE__ ) ); |
| 23 | define( 'EA11Y_URL', plugins_url( '/', __FILE__ ) ); |
| 24 | define( 'EA11Y_ASSETS_PATH', EA11Y_PATH . 'assets/' ); |
| 25 | define( 'EA11Y_ASSETS_URL', EA11Y_URL . 'assets/' ); |
| 26 | |
| 27 | final class Pojo_Accessibility { |
| 28 | |
| 29 | /** |
| 30 | * @var Pojo_Accessibility The one true Pojo_Accessibility |
| 31 | * @since 1.0.0 |
| 32 | */ |
| 33 | public static $instance = null; |
| 34 | |
| 35 | public function i18n() { |
| 36 | load_plugin_textdomain( 'pojo-accessibility' ); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Throw error on object clone |
| 41 | * The whole idea of the singleton design pattern is that there is a single |
| 42 | * object therefore, we don't want the object to be cloned. |
| 43 | * @return void |
| 44 | * @since 1.0.0 |
| 45 | */ |
| 46 | public function __clone() { |
| 47 | // Cloning instances of the class is forbidden |
| 48 | _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'pojo-accessibility' ), '1.0.0' ); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Disable unserializing of the class |
| 53 | * @return void |
| 54 | * @since 1.0.0 |
| 55 | */ |
| 56 | public function __wakeup() { |
| 57 | // Unserializing instances of the class is forbidden |
| 58 | _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'pojo-accessibility' ), '1.0.0' ); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * @return Pojo_Accessibility |
| 63 | */ |
| 64 | public static function instance() { |
| 65 | if ( is_null( self::$instance ) ) { |
| 66 | self::$instance = new self(); |
| 67 | } |
| 68 | |
| 69 | return self::$instance; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Initialize the plugin |
| 74 | * Do your Validations here: |
| 75 | * for example checks for basic plugin requirements, if one check fail don't continue, |
| 76 | * if all check have passed include the plugin class. |
| 77 | * Fired by `plugins_loaded` action hook. |
| 78 | * @since 2.2.0 |
| 79 | * @access public |
| 80 | */ |
| 81 | public function init() { |
| 82 | // Once we get here, We have passed all validation checks, so we can safely include our plugin |
| 83 | require_once 'plugin.php'; |
| 84 | } |
| 85 | |
| 86 | private function __construct() { |
| 87 | // Load translation |
| 88 | add_action( 'init', [ $this, 'i18n' ] ); |
| 89 | |
| 90 | // Init Plugin |
| 91 | add_action( 'plugins_loaded', [ $this, 'init' ] ); |
| 92 | } |
| 93 | |
| 94 | } |
| 95 | |
| 96 | Pojo_Accessibility::instance(); |
| 97 |