Search This Blog

Showing posts with label WordPress. Show all posts
Showing posts with label WordPress. Show all posts

Thursday, April 4, 2019

WordPress new post editor has encountered an unexpected error

I tried:

  • Disabled all plugins (included SEO) and browser addons.
  • Attempt recovery doesn't work. Error code.
  • Switch to other themes.

Error Code:

TypeError: Cannot read property 'show_ui' of undefined
    at https://www.milliondollarserver.com/wp-includes/js/dist/editor.min.js?ver=9.0.11:55:241342
    at i (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.11:6:91)
    at An.filter (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/lodash.min.js?ver=4.17.11:99:338)
    at https://www.milliondollarserver.com/wp-includes/js/dist/editor.min.js?ver=9.0.11:55:241307
    at ph (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:97:88)
    at eg (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:125:307)
    at fg (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:126:168)
    at wc (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:138:237)
    at fa (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:137:115)
    at ng (https://www.milliondollarserver.com/wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3:149:69)

Environment
  • WordPress 5.1.1
  • Nginx 1.15
  • PHP-FPM 7.2
  • wp-supercache
Here is how I fix it:
#vi /etc/nginx/wp-supercache
Original:

location / {
    try_files $cachefile $uri $uri/ /index.php;
}
Changed to:
location / {
	try_files $cachefile $uri $uri/ /index.php$is_args$args;
}
Restart Nginx to apply the changes:
# sudo systemctl restart nginx
Related Bug: https://github.com/WordPress/gutenberg/issues/9912

Friday, June 29, 2018

Convert From WordPress to Blogger

Try to convert all my post from Wordpress to Blogger site.

Followed the guide:

How to Move Your Blog From WordPress to Blogger
https://www.lifewire.com/move-blog-from-wordpress-to-blogger-1616405

It turns out all 3 sites power by goolge app engine are gone at June 29, 2018.

I went download the latest code:
https://code.google.com/archive/p/google-blog-converters-appengine/downloads
google-blog-converters-r89.tar.gzUpdate for the r89 release. Quick bugfix for the blogger2wordpress conversion.  FeaturedMay 27, 201029.46MB
And hope it works.

1.Export my Wordpress all posts from the Dashboard.
2.On my local python server, created an new Python Virtual Environments:
# virtualenv -p /usr/bin/python2.7 wp2blog
# source wp2blog/bin/activate
3.Download the package and uncompress:
# wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/google-blog-converters-appengine/google-blog-converters-r89.tar.gz
# tar xzvf google-blog-converters-r89.tar.gz

4.Upload my Wordpress export file to the same folder
~/wp_blog/google-blog-converters-r89/milliondollarserver.wordpress.2018-06-29.xml
5.Run the convert and save it to an new .xml file for later import into the Blogger.
# cd ~/wp_blog/google-blog-converters-r89/
# bin/wordpress2blogger.sh milliondollarserver.wordpress.2018-06-29.xml mds_blogger.xml

Download the new mds_blogger.xml file, import it from the Google Blogger.

And I am back online again.

To clean up:
I removed the old nginx configure file and restart the nginx on the server.

Happy Canada Day!

Thursday, October 5, 2017

Configuring Wordpress Automatic Background Updates Plugin

Don't want always login to my WP admin Dashboard just for update the Plugin.

Here is how I do it:

Manually create folder: wp-content/mu-plugins/
Then put auto-update.php in there.

<?php
/*
Plugin Name: Plugin Background Auto-Update
Description: Automatic updates installed plugins and themes.
Author: Lambert@MillionDollarServer.com
*/
// [Configuring Automatic Background Updates] Reference: https://codex.wordpress.org/Configuring_Automatic_Background_Updates
// [Must Use Plugins] Reference: https://codex.wordpress.org/Must_Use_Plugins
// [Writing a Plugin]]Reference: https://codex.wordpress.org/Writing_a_Plugin
// Automatic updates for All plugins:
add_filter( 'auto_update_plugin', '__return_true' );
// Automatic updates for All themes:
add_filter( 'auto_update_theme', '__return_true' );


Make sure the permission:

chown -R www-data:www-data wp-content/mu-plugins/


And enjoy your day!

Tuesday, August 29, 2017

update Wordpress Plugin Advanced Custom Fields PRO

Just installed an new Wordpress theme, it requires plugin [Advanced Custom Fields PRO]

After automatic installation, the Wordpress installed the Version 5.5.

Then it pop message about an update version 5.6.1 available only for the paid user.

I found it is open public on github:

https://github.com/wp-premium/advanced-custom-fields-pro



    1. First I backup the version 5.5 plugin:

cp -r /var/www/wp-content/plugins/advanced-custom-fields-pro/ ~/acf_55/




    1. Then download the latest release:

wget https://github.com/wp-premium/advanced-custom-fields-pro/archive/5.6.1.tar.gz
tar xzvf 5.6.1.tar.gz


  1. Overwrite the download to the existing plugin files:
    dry-run to make sure before the changes:
    rsync -avhn ./advanced-custom-fields-pro-5.6.1/* /var/www/public/wp-content/plugins/advanced-custom-fields-pro/

    Final run overwrite:

rsync -avh ./advanced-custom-fields-pro-5.6.1/* /var/www/public/wp-content/plugins/advanced-custom-fields-pro/

PS: I switch my website to HHVM+SQLite now.

I will be really appreciate if you can give me some feedback about the changes like: load time, speed ...

Wednesday, October 22, 2014

Update WordPress to 4.0

Been busy on Life and Job, finally sit down and check my blog.

WOW, 4795 Comments!!!

11 Updates!!!

Just wget the latest from wordpress.org

wget https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
rsync -a ./wordpress/ /www/milliondollarserver.com/
service nginx restart


[poll id="4"]

Saturday, August 2, 2014

How to make blog safe.

This question came from one of blog reader friend couple days ago.

Few huge topic I can write about.

But let me start something simple:
For my understanding, you need considering at least these sections:

  1. A VPS/ISP have good tech support. (AWS/Lindo will be my first choice).

  2. Choice a safe OS. (My personal favour: Debian or CentOS).

  3. Make sure you have the latest blog software. (Wordpress or other).

  4. Setup firewall.

  5. Working on seal your Webservice. (Apache or Nginx).

  6. Make your database safe.

  7. Setup backup.

  8. Setup Monitor.


I have covered firewall part in few post.

If you are interesting of how to do it in detail.

Please let comments here.

I will create a new section to talk about this if comments reach 100.

 

Best Regards,

Thursday, July 3, 2014

Wordpress Twenty Fourteen theme width fit for high resolution monitors

Edit: /wp-content/themes/twentyfourteen/sytle.css
.site-content .entry-header,
.site-content .entry-content,
.site-content .entry-summary,
.site-content .entry-meta, .page-content {
/* Original max-width: 474px */
max-width: 80%;
}

Monday, April 29, 2013

Add Wordpress plugin WP-Syntax for syntax highlighting using GeSHi

I am a coder without any art DNA.

WP-Syntax provides clean syntax highlighting using GeSHi -- supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

It avoids conflicts with other 3rd party plugins by running an early pre-filter and a late post-filter that substitutes and pulls the code snippets out first and then pushes them back in with highlighting at the end. The result is source code formatted and highlighted the way you intended.

http://wordpress.org/extend/plugins/wp-syntax/

Wrap code blocks with <pre lang="LANGUAGE" line="1"> and </pre> where "LANGUAGE"
is a GeSHi supported language syntax.
The line attribute is optional. More usage examples

Friday, December 21, 2012

Add Jetpack by WordPress.com for Publicize on FaceBook Twitter and LinkedIn

I should done this earlier.

I do not like FaceBooks's Plugin for wordpress, specially my cell phone from Wind Mobile can't receive confirmation code to Active APPs.

And I like the Publicize function from wordpress.com

Install jetpack from wordpress.

Connect it with Facebook, twitter and LinkedIn.

And within minutes all my post will be available on Everywhere!

Friday, November 9, 2012

Customizing WordPress Theme Twenty Eleven Automatic Width

First I don't know any about CSS.

Do not edit the Twenty Eleven theme. It is the default WordPress theme and having access to an unedited version of the theme is vital when dealing with a range of site issues.

For this reason, it is recommended that you consider creating a child theme for your customisations.

wget http://wordpress.org/extend/themes/download/twentyeleven.1.4.zip
unzip twentyeleven.1.4.zip
mv twentyeleven twentyeleven_child
cd twentyeleven_child/


Modify sytle.css

Change the Theme Name to a different name like : Twenty Eleven Child


/*
Theme Name: Twenty Eleven Child
Theme URI: http://wordpress.org/extend/themes/twentyeleven
Author: the WordPress team
Author URI: http://wordpress.org/


mv twentyeleven_child /www/wordpress/wp-content


Once your child theme is active, we should be able to help with the customisation.

To make your WordPress width fits any resolution Automatic, just common out the [max-width:] line.

/* =Structure
----------------------------------------------- */

body {
padding: 0 2em;
}
#page {
margin: 2em auto;
/* max-width: 1000px;*/
}


Then active the child Theme, and you are done!

Tuesday, August 14, 2012

Install Yoast WordPress SEO Plugin


cd wordpress//wp-content/plugins/
wget http://downloads.wordpress.org/plugin/wordpress-seo.1.2.5.zip
unzip wordpress-seo.1.2.5.zip
rm wordpress-seo.1.2.5.zip

chown -R apache /wordpress
chcon -R -h -t httpd_sys_content_t /wordpress
service httpd restart