Showing posts with label Wordpress. Show all posts
Showing posts with label Wordpress. Show all posts

Friday, 3 June 2016

HTTP Header - Remove X-Powered-By: PleskLin and X-Pingback: xmlrpc.php

To check your HTTP header go to Web Tools : HTTP / HTTPS Header Check


To hide / remove a few annoying lines from the HTTP header, add those lines to "Additional nginx directives" in Plesk:

proxy_hide_header X-Powered-By;
proxy_hide_header X-Pingback;
proxy_hide_header X-Link;

Tuesday, 12 April 2016

You are currently editing the page that shows your latest posts. - Wordpress

You are currently editing the page that shows your latest posts. - Wordpress Issue likely with wp_posts structure, add primarykey to id and/or add increment

ALTER TABLE `wp_posts` MODIFY `ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=yourvaluehere;

Monday, 22 April 2013

Wordpress UTF8 Permalinks - UTF 8 Slug

In wordpress, to have longer article slugs so it can support long titles in UTF8 or Unicode:

1. In file wp-includes/formatting.php, replace 200 (1000 should be enough):
$title = utf8_uri_encode($title, 200); --> $title = utf8_uri_encode($title, 1000);


2. In file wp-includes/post.php search for 3 lines like the model below and replace 200 (same new value as in previous file, 1000):
$alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";

3. Open the mysql databse of your wordpress site:
In the table wp_posts: edit "post_name row" to support longer utf8 slug (set 1000)

The drawback: you have to backup your database before wordpress and do the following:
BEWARE

everytime you update wordpress core, wp will update db -> wp_posts -> post_name to default varchar = 200. this will cause all of your non-latin permalink that longer than 200 will cut off. your links will become 404 found. this cannot revert. you can change varchar back to 1000 but the slug that got cut won't be able to revert.

There're 5 resolution steps for this issue

ONE: BACKUP DATABASE EVERYTIME BEFORE UPDATE WORDPRESS CORE

TWO: DON'T USE AUTOMATIC UPDATE FOR WORDPRESS CORE / USE MANUAL UPDATE INSTEAD

THREE: YOU MUST EDIT SOME FILES BEFORE UPLOAD AND UPDATE WORDPRESS CORE

OPEN FILE wordpress\wp-admin\includes\schema.php

FIND post_name varchar(200) EDIT 200 TO 1000
FIND slug varchar(200) EDIT 200 TO 300, 500 OR MORE
FOUR: PACK WORDPRESS AS ZIP FILE AND UPLOAD TO YOUR FOLDER

FIVE: UPDATE WORDPRESS MANUALLY

YOU MUST DO IT EVERYTIME BEFORE UPDATE WORDPRESS CORE IF YOU THINK THIS IS SO HARD TO DO THEN DON'T CHANGE URL SLUG IF YOU THINK IT'S WORTH, JUST DO IT


Source: Stackexchange here

Sunday, 11 July 2010

Wordpress Maintenance Mode Problem

Your Wordpress is stuck in maintenance mode, the whole site even the /wp-admin just shows this message:

Briefly unavailable for scheduled maintenance. Check back in a minute.


Then try deleting, via FTP, the file named .maintenance in the root of the site's web folder.

That should disable the maintenance mode.
;-)

Saturday, 26 June 2010

Remote Post Wordpress Autoblog

A few ressources regarding remote posting to Wordpress with PHP, I have listed 3 methods:


- the best solution first: using Wordpress XML library --> Posting to Wordpress with php and XML RPC


- using CURL (but you'll need to make sure that the CURL and standard xmlrpc libraries are activated on your server first:
--> Initial Source (in French)
--> in English (but less information)

- using wordpress library without XMLrpc (not the best solution because the function wp_insert_post will sanitize/change your code)
--> not the best solution for Wordpress remote posting...

Wordpress Import Size Limit - How to increase?

I wanted to import a Wordpress eXtended RSS (WXR) file into my blog which is 8MB, but the limit on my blog is just 2MB.

I could have updated my php.ini but that's too complicated.
Better to temporarily update the htaccess file by adding the following snippet:

#Change upload limits
php_value memory_limit 34M
php_value post_max_size 33M
php_value upload_max_filesize 32M
php_value max_execution_time 600
#Change upload limits end

then I was able to upload my wordpress import file.
:)

Wordpress RSS MAGPIE Cache Change Update Frequency

(Wordpress 8 and up, older version look at thirstyofmind)
If you want to use the rssparser from wordpress and want this parser to always update, here's the procedure to follow:

In the folder wp-includes, edit the file rss.php:

1 look for RSS feed constant and update Magpie User Agent as below:
define('MAGPIE_USER_AGENT', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 GTB5');

2 look for function fetch_rss ($url) and update:
function fetch_rss ($url, $NoCache = false)

3 quite close to fetch rss look for ( MAGPIE_CACHE_ON ) { and change with:
if ( MAGPIE_CACHE_ON | $NoCache) {

4 now if you call teh fetching function like this: fetch_rss ($url, true) , the cache will be turned off and you'll have the latest items from the updated feed

5 look for class RSSCache
and change $Max AGe to something lower (12 hours = 43200 secsonds by default, thats too much)
for my part i updated to $MAX_AGE = 10;
:)

Optimize Wordpress

optimize wordpress -->here

Monday, 30 March 2009

Speed Up Wordpress - Fast Wordpress

Tips to speed up a wordpress blog:

15+ Tips to Speed Up Your Website, and Optimize Your Code!
--> here

***

Optimize the wordpress database:

Optimize your database tables without phpMyAdmin in one click for high performance.
--> WP DB Optimizer

***

Javascript compressor, CSS compressor