. */ /** * @package AllAccessible * @version 1.2.9 * @since 1.0 * @author AllAccessible Team * @copyright Copyright (c) 2022 AllAccessible * @link https://www.allaccessible.org/ * @license http://www.gnu.org/licenses/gpl.html */ if(!defined('ABSPATH')) { die('You are not allowed to call this page directly.'); } function aacb_load_textdomain() { load_plugin_textdomain( 'allaccessible', false, basename( dirname( __FILE__ ) ) . '/languages/' ); } add_action( 'init', 'aacb_load_textdomain' ); // ============================================= // Define Global Constants // ============================================= if ( !defined('AACB_NAME') ) { if (isset($GLOBALS['aacb_siteOptions']->isWhitelabel) && $GLOBALS['aacb_siteOptions']->isWhitelabel) { define('AACB_NAME', _e( "Accessibility", 'allaccessible' )); } else { define('AACB_NAME', 'AllAccessible'); } } //Set Current Plugin Version if ( !defined('AACB_VERSION') ) { define('AACB_VERSION','1.2.9'); } //Set Minimum WordPress version for compatibility if( !defined('AACB_WP_MIN_VERSION') ){ define('AACB_WP_MIN_VERSION','5.0'); } if ( !defined('AACB_TEXT') ) { define('AACB_TEXT','allaccessible'); } if ( !defined('AACB_DIR') ) { define('AACB_DIR', dirname( plugin_basename( __FILE__ ) ) ); } // Set constant URI to the plugin URL. if ( !defined('AACB_URL') ) { define('AACB_URL', plugin_dir_url( __FILE__ ) ); } // Set constant path to the plugin directory. if ( !defined('AACB_PATH') ) { define('AACB_PATH', plugin_dir_path( __FILE__ ) ); } // Set the constant path to the plugin's javascript directory. if( !defined('AACB_JS') ) { define('AACB_JS', AACB_URL . trailingslashit('assets') ); } // Set the constant path to the plugin's CSS directory. if( !defined('AACB_CSS') ) { define('AACB_CSS', AACB_URL . trailingslashit('assets') ); } // Set the constant path to the plugin's images directory. if( !defined('AACB_IMG') ) { define('AACB_IMG', AACB_URL . trailingslashit('assets') ); } // Set the constant path to the plugin's includes directory. if( !defined('AACB_INC') ) { define('AACB_INC', AACB_PATH . trailingslashit('inc') ); } // Set the constant path to the plugin's includes directory. if( !defined('AACB_SUPPORT') ) { define('AACB_SUPPORT','https://support.allaccessible.org/'); } /** * Load AllAccessible options */ function AllAccessible_getSiteOptions() { $apiUrl ='https://app.allaccessible.org/api/get-site-options/'; $apiResponse = wp_remote_post( $apiUrl, [ 'method' =>'POST', 'sslverify'=> false, 'headers' => [ 'content-type'=>'application/json', ], 'body' => json_encode(array('siteId'=> get_option('aacb_siteID'))) ] ); return json_decode( wp_remote_retrieve_body( $apiResponse ) ); } /** * Load AllAccessible Settings Page */ function AllAccessible_settings() { //TODO - improve $GLOBALS['aacb_accountID'] = get_option('aacb_accountID'); if(!get_option('aacb_siteID') && get_option('aacb_accountID')){ $apiUrl ='https://app.allaccessible.org/api/get-site-id/'; $apiResponse = wp_remote_post( $apiUrl, [ 'method' =>'POST', 'sslverify'=> false, 'headers' => [ 'content-type'=>'application/json', ], 'body' => json_encode(array('pageUrl'=> get_bloginfo('wpurl'),'accountID'=> get_option('aacb_accountID'))) ] ); $apiBody = json_decode( wp_remote_retrieve_body( $apiResponse ) ); update_option('aacb_siteID', $apiBody ); } $GLOBALS['aacb_accountID'] = get_option('aacb_siteID'); if(get_option('aacb_siteID')){ $GLOBALS['aacb_siteOptions'] = AllAccessible_getSiteOptions(); } include AACB_INC .'AllAccessibleSettings.php'; } //========================= // Add Script to Header //========================= if(get_option('aacb_accountID')){ function AllAccessible_loadWidget() { if(!is_admin() && empty($_GET['et_fb'])){ ?> 1, ); update_option('aacb_options', $opt ); } } /** * AllAccessible Admin Notices */ function aacb_activated_notice() { $options = get_option('aacb_options'); if ($options['aacb_installed'] && !get_option('aacb_accountID')) { $settings_url = admin_url('options-general.php?page=allaccessible'); ?>
AllAccessible needs additional configuration. Click here to configure the plugin settings.