PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
admin-site-enhancements
/
classes
<?php namespace ASENHA\Classes; /** * Class for Obfuscate Author Slugs module * * @since 6.9.5 */ class Obfuscate_Author_Slugs { /** * If an author name is queried, decrypt it. Used by pre_get_posts action. * * @link https://plugins.trac.wordpress.org/browser/smart-user-slug-hider/tags/4.0.2/inc/class-smart-user-slug-hider.php * @since 2.1.0 */ function alter_author_query( $query ) { // Check if it's a query for author data, and that 'author_name' is not empty if ( $query->is_author() && $query->query_vars['author_name'] != '' ) { // Check for character(s) representing a hexadecimal digit if ( ctype_xdigit( $query->query_vars['author_name'] ) ) { // Get user by the decrypted user ID $user = get_user_by( 'id', $this->decrypt( $query->query_vars['author_name'] ) ); if ( $user ) { $query->set( 'author_name', $user->user_nicename ); } else { // No user found $query->is_404 = true; $query->is_author = false; $query->is_archive = false; } } else { // No hexadecimal digit detected in URL, i.e. someone is trying to access URL with original author slug $query->is_404 = true; $query->is_author = false; $query->is_archive = false; } } return; } /** * Replace author slug in author link to encrypted value. Used by author_link filter. * * @link https://plugins.trac.wordpress.org/browser/smart-user-slug-hider/tags/4.0.2/inc/class-smart-user-slug-hider.php * @since 2.1.0 */ function alter_author_link( $link, $user_id, $author_slug ) { $encrypted_author_slug = $this->encrypt( $user_id ); return str_replace ( '/' . $author_slug, '/' . $encrypted_author_slug, $link ); } /** * Replace author slug in REST API /users/ endpoint to encrypted value. Used by rest_prepare_user filter. * * @link https://plugins.trac.wordpress.org/browser/smart-user-slug-hider/tags/4.0.2/inc/class-smart-user-slug-hider.php * @since 2.1.0 */ function alter_json_users($response, $user, $request) { $data = $response->get_data(); $data['slug'] = $this->encrypt($data['id']); $response->set_data($data); return $response; } /** * Helper function to return an encrypted user ID, which will then be used to replace the author slug. * * @link https://plugins.trac.wordpress.org/browser/smart-user-slug-hider/trunk/inc/class-smart-user-slug-hider.php * @since 2.1.0 */ private function encrypt( $user_id ) { // Returns encrypted encrypted author slug from user ID, e.g. encrypt user ID 3 to author slug 4e3062d8c8626a14 return bin2hex( openssl_encrypt( base_convert( $user_id, 10, 36 ), 'DES-EDE3', md5( ASENHA_URL ), OPENSSL_RAW_DATA ) ); } /** * Helper function to decrypt an (encrypted) author slug and returns the user ID * * @link https://plugins.trac.wordpress.org/browser/smart-user-slug-hider/trunk/inc/class-smart-user-slug-hider.php * @since 2.1.0 */ private function decrypt( $encrypted_author_slug ) { // Returns user ID, e.g. decrypts author slug 4e3062d8c8626a14 into user ID 3 return base_convert( openssl_decrypt( pack('H*', $encrypted_author_slug), 'DES-EDE3', md5( ASENHA_URL ), OPENSSL_RAW_DATA ), 36, 10 ); } }
[-] class-hide-admin-bar.php
[edit]
[-] class-svg-upload.php
[edit]
[-] class-disable-gutenberg.php
[edit]
[-] class-cleanup-admin-bar.php
[edit]
[-] class-disable-rest-api.php
[edit]
[-] class-multiple-user-roles.php
[edit]
[-] class-disable-updates.php
[edit]
[-] class-image-upload-control.php
[edit]
[-] class-hide-admin-notices.php
[edit]
[-] class-content-duplication.php
[edit]
[-] class-insert-head-body-footer-code.php
[edit]
[-] class-media-replacement.php
[edit]
[-] class-password-protection.php
[edit]
[-] class-heartbeat-control.php
[edit]
[-] class-email-address-obfuscator.php
[edit]
[-] class-settings-sanitization.php
[edit]
[-] class-wp-config-transformer.php
[edit]
[-] class-content-order.php
[edit]
[-] class-custom-css.php
[edit]
[-] class-enhance-list-tables.php
[edit]
[-] class-login-logout-menu.php
[edit]
[-] class-search-engines-visibility.php
[edit]
[-] class-limit-login-attempts.php
[edit]
[-] class-disable-xml-rpc.php
[edit]
[-] class-common-methods.php
[edit]
[-] class-email-delivery.php
[edit]
[-] class-obfuscate-author-slugs.php
[edit]
[-] class-external-permalinks.php
[edit]
[-] class-wider-admin-menu.php
[edit]
[-] class-display-system-summary.php
[edit]
[-] class-admin-menu-organizer.php
[edit]
[-] class-redirect-fourofour.php
[edit]
[-] class-manage-robots-txt.php
[edit]
[-] class-site-identity-on-login-page.php
[edit]
[-] class-avif-upload.php
[edit]
[-] class-disable-comments.php
[edit]
[-] class-manage-ads-appads-txt.php
[edit]
[-] class-various-admin-ui-enhancements.php
[edit]
[-] class-admin-menu-svg-icon-mask.php
[edit]
[-] class-deactivation.php
[edit]
[-] class-activation.php
[edit]
[-] class-view-admin-as-role.php
[edit]
[-] class-maintenance-mode.php
[edit]
[-] class-custom-body-class.php
[edit]
[-] class-disable-dashboard-widgets.php
[edit]
[-] class-login-id-type.php
[edit]
[-] class-image-sizes-panel.php
[edit]
[-] class-redirect-after-login.php
[edit]
[-] class-settings-sections-fields.php
[edit]
[-] class-auto-publish-posts-with-missed-schedule.php
[edit]
[-] class-revisions-control.php
[edit]
[+]
..
[-] class-registration-date-column.php
[edit]
[-] class-disable-embeds.php
[edit]
[-] class-show-custom-taxonomy-filters.php
[edit]
[-] class-custom-nav-menu-items-in-new-tab.php
[edit]
[-] class-disable-feeds.php
[edit]
[-] class-captcha-protection.php
[edit]
[-] class-custom-admin-footer-text.php
[edit]
[-] class-change-login-url.php
[edit]
[-] class-last-login-column.php
[edit]
[-] class-settings-fields-render.php
[edit]
[-] class-disable-smaller-components.php
[edit]
[-] class-disable-author-archives.php
[edit]
[-] class-redirect-after-logout.php
[edit]
[-] class-open-external-links-in-new-tab.php
[edit]