is_settings_page() ) { return $footer_text; } if ( $this->is_pro_active() ) { return sprintf( /* translators: %1$s: opening link tag, %2$s: closing link tag */ esc_html__( 'Enjoying Accessibility Checker? %1$sPlease leave us a ★★★★★ rating.%2$s We really appreciate your support!', 'accessibility-checker' ), '', '' ); } $pro_link = edac_link_wrapper( 'https://equalizedigital.com/accessibility-checker/pricing/', 'admin-footer', 'admin-footer-text', false ); return sprintf( /* translators: %1$s: opening link tag, %2$s: closing link tag */ esc_html__( 'Want to do more with Accessibility Checker? %1$sUnlock Pro Features%2$s', 'accessibility-checker' ), '', '' ); } /** * Check if we are on the Accessibility Checker settings page. * * @since 1.27.0 * @return bool */ protected function is_settings_page() { // Check if we're on an admin page and have a page parameter. if ( ! is_admin() || ! isset( $_GET['page'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return false; } // Sanitize and check if it's an accessibility checker page. $page = sanitize_text_field( wp_unslash( $_GET['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended return strpos( $page, 'accessibility_checker' ) === 0; } /** * Check if Pro is active with a valid license. * * @since 1.27.0 * @return bool */ protected function is_pro_active() { // Pro is active if EDACP_VERSION is defined and license is valid. return defined( 'EDACP_VERSION' ) && defined( 'EDAC_KEY_VALID' ) && EDAC_KEY_VALID; } }