定制 ssnepenthe/wp-hashids 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ssnepenthe/wp-hashids

Composer 安装命令:

composer require ssnepenthe/wp-hashids

包简介

A Hashids implementation for WordPress

README 文档

README

This plugin provides a Hashids implementation for WordPress.

Requirements

WordPress 4.7 or greater, PHP 5.6 or greater and Composer.

Installation

Install using Composer:

$ composer require ssnepenthe/wp-hashids

Usage

Once the plugin is activated, browse to wp-admin > settings > permalinks and set a custom structure which contains the tag %hashid%.

If you need to manually interact with the underlying Hashids instance for some reason, it can be accessed by calling _wph_instance( 'hashids' ).

Configuration

Sensible defaults are automatically set for you.

If you wish to set custom values, there are two methods for doing so:

  1. Define any number of WP_HASHIDS_* constants (preferred)
  2. Browse to wp-admin > settings > wp hashids and set the values via the provided interface.

The following constants can be used for configuration:

  • WP_HASHIDS_ALPHABET - valid options are lower, upper, lowerupper, lowernumber, uppernumber, and all. You will need to manually flush rewrite rules after changing this constant by going to settings > permalinks.
  • WP_HASHIDS_MIN_LENGTH - can be any integer >= 0.
  • WP_HASHIDS_SALT - should be a unique string to ensure hashids are unique to your site.

Keep in mind that any changes to the plugin settings will immediately change all post URLs that use the %hashid% rewrite tag, and as such, should only be modified immediately after plugin activation.

If all three constants are configured, the WP Hashids settings page will not be visible.

Considerations

As mentioned previously, changing any config value will result in all of your post URLs changing. This should only be done immediately after installing the plugin.

This plugin provides a method of obfuscating post IDs in URLs, however it makes no attempt to hide them anywhere else. If you need to completely mask post IDs from your users, look elsewhere.

Custom post types are supported but you will need to configure a custom permastruct using add_permastruct() if you want to remove the post name from the URL.

Warning

HASHIDS ONLY PROVIDES OBFUSCATION OF IDS IN PERMALINKS.

IT DOES NOT PROVIDE ENCRYPTION AND IT IS NOT SECURE.

YOU SHOULD ASSUME THAT YOUR SALT CAN AND WILL BE READ BY ANYONE THAT CAN VIEW YOUR SITE!

FOR THIS REASON, YOU SHOULD NOT (RE)USE ANY SENSITIVE INFORMATION (LIKE PASSWORDS OR CORE SALTS) FOR YOUR HASHIDS SALT.

YOUR SALT SHOULD BE A UNIQUE VALUE THAT IS ONLY USED BY THIS PLUGIN.

FOR MORE INFORMATION, CHECK THE LINKS LISTED HERE.

ssnepenthe/wp-hashids 适用场景与选型建议

ssnepenthe/wp-hashids 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25 次下载、GitHub Stars 达 3, 最近一次更新时间为 2017 年 05 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ssnepenthe/wp-hashids 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ssnepenthe/wp-hashids 我们能提供哪些服务?
定制开发 / 二次开发

基于 ssnepenthe/wp-hashids 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2017-05-18