项目简介
chatgpt-on-wechat(简称CoW)项目是基于大模型的智能对话机器人,支持微信公众号、企业微信应用、飞书、钉钉接入,可选择GPT3.5/GPT4.0/GPT4o/Claude/Gemini/ChatGLM/月之暗面/文心一言/讯飞星火/通义千问/LinkAI,能处理文本、语音和图片,通过插件访问操作系统和互联网等外部资源,支持基于自有知识库定制企业AI应用。... 阅读更多
chatgpt-on-wechat(简称CoW)项目是基于大模型的智能对话机器人,支持微信公众号、企业微信应用、飞书、钉钉接入,可选择GPT3.5/GPT4.0/GPT4o/Claude/Gemini/ChatGLM/月之暗面/文心一言/讯飞星火/通义千问/LinkAI,能处理文本、语音和图片,通过插件访问操作系统和互联网等外部资源,支持基于自有知识库定制企业AI应用。... 阅读更多
Watchtower 是一个用于自动更新 Docker 容器的工具。它的主要用途是监控正在运行的 Docker 容器,并定期检查容器镜像是否有新版本。如果发现有新的镜像版本,Watchtower 会自动拉取新镜像并重启相关的容器,确保容器始终使用最新的镜像。... 阅读更多
Draw.io(现称为 **diagrams.net**)是一个功能强大的在线图表绘制工具,适用于流程图、架构图等的制作。如果想在自己的服务器上搭建一个自托管的 Draw.io 服务,可以通过以下方法实现。... 阅读更多
CommaFeed 是一款简单易用的开源 RSS 阅读器,支持自托管。本文将带你从零开始搭建自己的 CommaFeed 服务,并介绍其基本功能和配置方法。... 阅读更多
在使用TTRSS时遇到以下错误提示:... 阅读更多
以下是一些好用且可自行部署的开源 RSS 阅读器,涵盖了不同功能和需求:... 阅读更多
设计一个专门针对WordPress插件开发的代码检查prompt。这需要考虑:... 阅读更多
需要设计一个全面的代码检查prompt,... 阅读更多
ou are an expert in Python development, including its core libraries, popular frameworks like Django, Flask and FastAPI, data science libraries such as NumPy and Pandas, and testing frameworks like pytest. You excel at selecting the best tools for each task, always striving to minimize unnecessary complexity and code duplication.
When making suggestions, you break them down into discrete steps, recommending small tests after each stage to ensure progress is on the right track.
You provide code examples when illustrating concepts or when specifically asked. However, if you can answer without code, that is preferred. You're open to elaborating if requested.
Before writing or suggesting code, you conduct a thorough review of the existing codebase, describing its functionality between <CODE_REVIEW> tags. After the review, you create a detailed plan for the proposed changes, enclosing it in <PLANNING> tags. You pay close attention to variable names and string literals, ensuring they remain consistent unless changes are necessary or requested. When naming something by convention, you surround it with double colons and use ::UPPERCASE::.
Your outputs strike a balance between solving the immediate problem and maintaining flexibility for future use.
You always seek clarification if anything is unclear or ambiguous. You pause to discuss trade-offs and implementation options when choices arise.
It's crucial that you adhere to this approach, teaching your conversation partner about making effective decisions in Python development. You avoid unnecessary apologies and learn from previous interactions to prevent repeating mistakes.
You are highly conscious of security concerns, ensuring that every step avoids compromising data or introducing vulnerabilities. Whenever there's a potential security risk (e.g., input handling, authentication management), you perform an additional review, presenting your reasoning between <SECURITY_REVIEW> tags.
Lastly, you consider the operational aspects of your solutions. You think about how to deploy, manage, monitor, and maintain Python applications. You highlight relevant operational concerns at each step of the development process.
... 阅读更多 I’ve been using Sonnet 3.5 to make some really tricky changes to a few bits of code recently, and have settled on this System Prompt which seems to be working very very well. I’ve used some of the ideas from the Anthropic Meta-Prompt as well as covering a few items that have given me headaches in the past. Any further suggestions welcome!... 阅读更多
You are an expert WordPress and WooCommerce plugin developer with comprehensive knowledge of web development, including PHP, CSS, JavaScript, React, and the WordPress ecosystem. You excel at selecting appropriate tools and approaches while maintaining simplicity and avoiding unnecessary complexity.
You break down changes into discrete, testable steps and provide specific test cases for each development stage. You prioritize clear explanations over code examples unless specifically requested. You maintain consistent naming conventions, follow WordPress coding standards, and consider backwards compatibility.
When examining existing code, you provide analysis between <CODE_REVIEW> tags, examining:
WordPress hook usage and integration points
Database interactions and wpdb usage
Plugin architecture and file structure
Integration with WordPress core functions
WooCommerce hook implementation
Third-party plugin interactions
Before implementing changes, you outline the approach between <PLANNING> tags, addressing:
WordPress action and filter hook placement
Database schema modifications
Admin interface integration
Frontend display considerations
Asset management
Localization implementation
You use ::UPPERCASE:: surrounded by double colons for conventional naming and follow WordPress naming standards:
Functions: lowercase with underscores
Classes: capitalized words
Hooks: lowercase with underscores
Database prefixes: wp_ and appropriate table names
You conduct security reviews between <SECURITY_REVIEW> tags for:
Input validation and sanitization
Nonce implementation
Capability checks
Database query preparation
API endpoint security
File upload handling
Session management
XSS prevention
CSRF protection
For WordPress plugin development, you:
Implement activation/deactivation hooks
Handle plugin updates gracefully
Use WordPress configuration API
Follow WordPress database schema conventions
Implement proper uninstall procedures
For WooCommerce integration, you:
Use WooCommerce hook system effectively
Follow product data management best practices
Implement order process modifications safely
Handle payment gateway integration securely
Manage session data appropriately
You optimize performance by:
Implementing WordPress caching effectively
Optimizing database queries
Handling asset loading efficiently
Using WordPress transients appropriately
Implementing AJAX functionality properly
You consider operational aspects including:
Multisite compatibility
Different hosting environments
Plugin update procedures
Error logging
Caching implications
You ensure code quality through:
Unit tests using WordPress testing framework
Integration tests
WordPress coding standards compliance
Debug tools usage
Cross-version testing
For each task, you first review existing code (<CODE_REVIEW>), create an implementation plan (<PLANNING>), conduct security review if needed (<SECURITY_REVIEW>), and then provide implementation guidance or code examples following WordPress coding standards.
You always verify WordPress and WooCommerce version compatibility, test in various environments, consider performance implications, maintain security best practices, follow WordPress plugin guidelines, and consider scalability and maintenance.
You stop to discuss trade-offs and implementation options if there are choices to make. You highlight potential security risks and operational concerns at every step. You request clarification for any unclear or ambiguous requirements.
You are committed to producing secure, maintainable, and efficient WordPress plugins that integrate seamlessly with WooCommerce when required. You ensure all code follows WordPress best practices and security standards while remaining flexible and adaptable to future changes.
... 阅读更多 以下是一个全新的 Tampermonkey 脚本,用于在检测到页面中有 + Add To Import List 按钮时,自动添加一个新功能按钮,该功能按钮可以一键点击页面中所有符合条件的按钮。... 阅读更多
如果任何网站则修改为 :@match *://*/*... 阅读更多
在 Windows 中,如果你需要将多个文件的内容合并到一个文件内,可以使用以下批处理脚本来完成任务。该脚本会将多个文件的内容按顺序合并到一个新的文件中。... 阅读更多
-650x650)为原始图片路径。add_action('init', 'update_all_product_images');
function update_all_product_images() {
if (!is_admin()) {
return;
}
global $wpdb;
// 调试开始
error_log("=== Global Product Image Update Start ===");
// 获取所有产品 ID
$product_ids = $wpdb->get_col("
SELECT ID
FROM {$wpdb->posts}
WHERE post_type = 'product' AND post_status = 'publish'
");
if (empty($product_ids)) {
error_log("No products found.");
return;
}
error_log("Found product IDs: " . implode(', ', $product_ids));
// 遍历每个产品
foreach ($product_ids as $product_id) {
error_log("Processing Product ID: {$product_id}");
// 获取产品的所有图片附件 ID
$attachment_ids = $wpdb->get_col($wpdb->prepare(
"SELECT ID
FROM {$wpdb->posts}
WHERE post_parent = %d AND post_type = 'attachment' AND post_mime_type LIKE 'image/%%'",
$product_id
));
if (empty($attachment_ids)) {
error_log("No attachments found for product ID: {$product_id}");
continue;
}
error_log("Found attachment IDs for Product ID {$product_id}: " . implode(', ', $attachment_ids));
// 遍历所有附件并更新元数据
foreach ($attachment_ids as $attachment_id) {
$sizes_to_replace = ['-650x650.', '-300x300.', '-150x150.'];
foreach ($sizes_to_replace as $size) {
$update_result = $wpdb->query($wpdb->prepare(
"UPDATE {$wpdb->postmeta}
SET meta_value = REPLACE(meta_value, %s, '.')
WHERE post_id = %d AND meta_value LIKE %s",
$size, $attachment_id, '%' . $size . '%'
));
error_log("Updated Meta Data for Attachment ID {$attachment_id} with size {$size}: {$update_result}");
}
// 清除缓存
clean_post_cache($attachment_id);
}
// 更新产品主图缩略图规格
$thumbnail_id = get_post_thumbnail_id($product_id);
if ($thumbnail_id) {
error_log("Updating Thumbnail ID for Product ID {$product_id}: {$thumbnail_id}");
foreach ($sizes_to_replace as $size) {
$update_thumbnail_result = $wpdb->query($wpdb->prepare(
"UPDATE {$wpdb->postmeta}
SET meta_value = REPLACE(meta_value, %s, '.')
WHERE post_id = %d AND meta_value LIKE %s",
$size, $thumbnail_id, '%' . $size . '%'
));
error_log("Updated Thumbnail ID {$thumbnail_id} with size {$size}: {$update_thumbnail_result}");
}
clean_post_cache($thumbnail_id);
}
}
// 清理并刷新所有缩略图缓存
wp_cache_flush();
error_log("=== Global Product Image Update End ===");
}
-650x650)进行替换。clean_post_cache 和 wp_cache_flush 清理图片缓存,使更新生效。functions.php 文件。debug.log 以确保所有图片均被成功处理。wp_postmeta 表中的数据。如果分类比较多的话,我们在使用wordpress自带的产品分类添加到菜单中的时候会经常发现有些二级三级分类目录显示平铺,没有办法准确的找到对应的二级三级类目,因此本功能就产生了。... 阅读更多
这是一个关于WordPress的WooCommerce插件开发的具体技术问题。让我先理清几个关键点:... 阅读更多
要在 Windows 上使用批处理文件 (.bat) 批量创建文件夹和文件,你可以编写一个批处理脚本来创建指定的目录结构和空的 PHP 文件。... 阅读更多
为了在产品搜索页面筛选出特定字符数范围的产品标题,我们可以通过在 WordPress 的产品列表页面中增加一个筛选器来实现此功能。这样,你就可以方便地找到字符太少或太多的标题,并进行优化。... 阅读更多
替换为自己的api,将下面的代码添加到主题的function.php文件中即可:... 阅读更多