User Tools

Site Tools


general:wordpress

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
general:wordpress [2020/11/17 18:16] sunkangeneral:wordpress [2022/11/28 12:11] (current) sunkan
Line 6: Line 6:
 One reason you may get PCLZIP_ERR_BAD_FORMAT is that php5-curl is missing \\ One reason you may get PCLZIP_ERR_BAD_FORMAT is that php5-curl is missing \\
 This was happening when trying to update striking theme This was happening when trying to update striking theme
 +
 +====== Clear redis cache ======
 +Sometimes with WPML there is a need for clearing the redis cache (noticed when restructuring the product categories)
 +
 +This can be done with this script (when we have multiple prefixes in the DB, otherwise use Redis command "flushall".
 +<code>
 +-- Usage: redis-cli --eval <thisfile.lua> , 'the_search_string_*'
 +-- Example: redis-cli --eval remove_matching_keys.lua , 'someprefix_*'
 +
 +-- Solution adapted from this: https://stackoverflow.com/a/65427976
 +-- the "," is to pass an argument and not a key to the lua script
 +
 +local searchstring=ARGV[1]
 +local keys_to_delete = redis.call('keys', searchstring)
 +-- return keys_to_delete
 +for _,k in ipairs(keys_to_delete) do
 +  redis.call('del', k)
 +end
 +</code>
general/wordpress.txt · Last modified: 2022/11/28 12:11 by sunkan

Donate Powered by PHP Valid HTML5 Valid CSS Run on Debian Driven by DokuWiki