When you post in WordPress with over 5MB text post, you may receive this error with red color. or you found in your php error log This is because WordPress need more time to execute and process and formatting your post over the maximum execution time. You may use the way below to solve this. Continue reading “Publishing Failed in WordPress”
Category Archives: Wordpress
Create WordPress widget template from scratch
I’ve save down the most basic widget code for WordPress, you can copy this to your plugin and modify it to start your first widget. You can save time on this tutorial to help you create wordpress widget from scratch. [code lang=”php”] <?php class example_widget extends WP_Widget { function __construct() { parent::__construct(false, $name = ‘Example Continue reading “Create WordPress widget template from scratch”
lazy-result.js ReferenceError: Promise is not defined
[code lang=”javascript”] node_modules/postcss/lib/lazy-result.js:157 this.processing = new Promise(function (resolve, reject) { ^ ReferenceError: Promise is not defined [/code] When I install the FoundationPress, after I run gulp build I saw this message, this is because the node version problem. the have mention in this post https://github.com/postcss/postcss-nested/issues/30 Solution [code lang=”shell”] vim node_modules/postcss/lib/lazy-result.js [/code] Put this to the Continue reading “lazy-result.js ReferenceError: Promise is not defined”
Connect to Jetpack using behind varnish and nginx
Normally if you use varnish or other reverse proxy, you may use other port in wordpress. So you are not able to connect to Jetpack, because to connect Jetpack, you must have port 80 to authorize. It may display the error like this from your Jetpack debugger [code] SELF: Array ( [headers] => Array ( Continue reading “Connect to Jetpack using behind varnish and nginx”
Delete expired _transient in wordpress to optimize the database
If you separate your database to another server, and if the wp_options table is going bigger to 2MB, then it will slow down your query time, because WordPress like to query all the data from the table wp_options always. You have to make the table smaller size to speed up the query. I always clean Continue reading “Delete expired _transient in wordpress to optimize the database”
Use Shortcodes in WordPress Widget without Plugins
You can add this to your function to enable your short code in widget without pain. [php] add_filter( ‘widget_text’, ‘shortcode_unautop’); add_filter( ‘widget_text’, ‘do_shortcode’); [/php]
How to Setup Temporary WordPress Staging Site
I’m going to Setup Temporary WordPress Staging Site using same MySQL database. It is very useful for you to develop themes or plugin without affect to your current running sites, and you need to use real data to test it out. Prepare your contents Copy all your current contents from [code lang=”bash”] /var/www/juzhax.com [/code] to Continue reading “How to Setup Temporary WordPress Staging Site”
How to remove ver from js and css in WordPress ?
Remove the ver=date behind the JS and CSS in wordpress. [php] // Load in any own plugin function juz_remove_wp_ver_css_js( $src ) { if ( strpos( $src, ‘ver=’ ) ) $src = remove_query_arg( ‘ver’, $src ); return $src; } add_filter( ‘style_loader_src’, ‘juz_remove_wp_ver_css_js’, 9999 ); add_filter( ‘script_loader_src’, ‘juz_remove_wp_ver_css_js’, 9999 ); [/php]
Query WordPress Jetpack Stats using API and return as CSV
http://stats.wordpress.com/csv.php?api_key=123456789abc&blog_id=56174071&end=2013-12-31&day=500&limit=-1 Error: api_key is a required parameter. Required parameters: api_key, blog_id or blog_uri. Optional parameters: table, post_id, end, days, limit, summarize. Parameters: api_key String A secret unique to your WordPress.com user account. blog_id Integer The number that identifies your blog. Find it in other stats URLs. blog_uri String The full URL to the root directory Continue reading “Query WordPress Jetpack Stats using API and return as CSV”
Delete WordPress old Revisions using SQL Query
DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = ‘revision’
