Wordpress site performance related - php

I have a wordpress site and I replaced the home page with static html page with links to the posts in my site. In one section of the site I am loading recent 10 posts. For this I am using a notepad file, where I am storing the recent 10 posts links( In order to minimize database queries )
Will there be any advantage in calling the data from the notepad file, instead of a database query.
Please suggest me some tips to enhance the performance of my site.

Wordpress sites can quickly become pretty slow, especially if you're using a lot of plugins etc.. Fixing this by manually creating static pages seems a bit shortsighted to me, since you're basically throwing the main reason for using a CMS–like system out the window.
It sounds to me like caching should solve your problems just fine. Install and configure e.g. a plugin like WP Super Cache and you server will automatically create, update and serve static HTML for you.

Use WPSupercache + Cloudflare , All your traffic will be routed through the CloudFlare system, and you'll enjoy all this features and more for free :
- Cache all your static content automatically (FREE CDN).
- They protect your web site.
- Website preloader.
- (JS - CSS - HTML) Files compression.

Related

WORDPRESS - Clone Website on a New Installation to Update It

We need to recreate our site from scratch. When I mean from scratch I mean we want to keep the same content (pages, articles, URLs and tons of media) and move it to a new WordPress installation with a different theme.
A brief background to try to understand what the underlying problem is. The current site (the one to be copied and transferred) is HUGE. It has more than 1500 pages and 3000 articles. It is currently running on an old version of WordPress and an outdated theme. We are deliberately not updating WordPress, theme and PHP so as not to risk crashing and being left without a site (this has already happened in the past with another installation).
What we have done is to create (on the same hosting) a new, updated installation of WordPress (on another directory). This will be the new and definitive one. Then – when all is said and done – we should use the name of the first installation (but this will be another issue to deal with at the end). We decided to operate in this way because we want everything to be done as safely as possible.
Some details:
Objective: SITE 1 -> SITE 2
SITE 1: Installation: domain.org/directory1 WordPress 5.2 PHP 7.1.33
Theme: Awaken
SITE 2: Installation: domain.org/directory2 WordPress 5.7.1 PHP
7.1.33 Theme: Divi Builder
At the moment, we have already installed the new theme in directory2 and created the home page that will host all the pages and articles from the old site. We are not interested in keeping the plugins. Our aim is for the new installation to be as “clean” as possible, without the risk of dragging around old problems.
What do you think is the correct way to proceed? Again, the most important thing is that the links are not changed (so that the URLs will still work once the change has been made; I mean: domain.org/directory1/perma/link/article-written-in-the past = domain.org/directory2/perma/link/article-written-in-the past
Could the export/import tool do this job? How should I proceed to make sure that I don’t affect the performance of the new site? Is it possible to carry out a test with a few pages to see if this can be done?
Thank you all!
The first step is to create a backup of the existing site. You can do this manually, you need all of the site files plus the database.
However, Duplicator is a great plugin that will create a backup package that includes everything for you. One thing to be aware of is the size of your site may cause issues for the plugin do to server load, but its the easiest method. There are other plugins as well to help with migration.
Once you have everything you can copy it to a new domaon like dev.website.com. The installer from Duplicator will help with the url updates, but its pretty easy to adjust in the config file and database options table. If you use relative urls most things wont be an issue, but a simple find and replace in the database will easy update any absolute urls.
Once you have made all your changes in dev you just reverse the process by writing over the live site and your set. This is safe beacuse you have a backup of the live site from step one in case you need to revert to the current state.

Any downsides to using a CMS for a high-risk website?

I'm helping a client with their website (it's manually written using a Dreamweaver template and a ton of quadruple-nested table elements for design. Ouch), and I want to offer them a break from using Dreamweaver to write things.
I was thinking of using Wordpress or a similar CMS to do the job, as Wordpress is clean, fast, and really easy to design for. I've done it a few times, and it's almost as easy as just coding pure HTML.
My main concern is that the site has been hacked a few times before, even though it was pure HTML with no server-side code whatsoever. I can setup a manual Linux server for them, because the hosting company they use is one that I've never heard of.
The site owners are completely technologically impaired, so I don't want to scare them off by showing them a dynamic CMS with tons of features, as they think pure HTML is so much safer, they have to go out of their way to work with it.
I know this is a ton of writing, but what would be the most appropriate CMS for such a setup (hard-coding or dynamically generating content) for such a setup? I don't want to keep having the person manually write non-standards compliant quadruple-nested table layouts anymore, but I don't want to be responsible for having their site hacked...
Thanks!
A solution that allows for local editing, and the uploading of only static HTML files, would be the safest way to go. If it's a high-risk site, I would consider staying on that track.
If a site containing only static HTML was hacked, then most likely through some problem on web server or even operating system level - I am not aware of any exploits concerning static HTML resources. Problems usually come up when dynamic languages are involved.
Whatever you do, don't use Wordpress. It is bound to be subject of exploits and attacks simply due to its popularity.
If the site is pure HTML, then the insecurity is in the server, or the connection made between the server and the client.
I'd look into how to make the server more secure before making changes to the site, although doing both is a good idea. CMS's like WordPress use MySQL databases to store posts, etc, so that means client -> server connections. A way to make transfers of data more secure is to use https:// instead of vanilla http://. You can redirect using a .htaccess file if need be.
To summarise, I'd look at the server side of things for any vulnerabilities.
James
Wordpress has become a pretty wonderful CMS. If the site is high-risk, you might want to shy away from it, but I haven't had a site that I thought was too high-risk for WP myself. The site should keep up with regular updates and regular backups and there are some security tips that you can follow to help keep it more secure and less of a target.
First. Hide WP on the front end
Add this to your functions.php:
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
That will remove default header info that can be searched for by scripts.
Install wp in a directory that will help obscure its location and obscure the admin URL.
Change the name of wp-contents folder to something else and move it outside of the main wp directory. For instance, you could name it "includes" and put it into the root folder. and then links to template files will not have wp-contents in them.
On top of that, use a secure host, lock down your files (especially on shared hosting), and you can look at something like vaultpress, but it seems like if you use a solid backup plugin and a good host, that is unnecessary. You can also look at some of the security audit plugins, but don't keep them running after you get feedback.
This code in your wp-config.php file will help to install in a directory and move wp-contents outside of it into an "includes" folder:
define('WP_HOME', 'http://domain.com');
define('WP_SITEURL', WP_HOME .'/admin');
define('WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'].'/includes');
define('WP_CONTENT_URL', WP_HOME .'/includes');
Wordpress is good for blogs
Typo3 is a good cms but hard to learn at start
Joomla and Drupal can be used as cms

integratable php blog API for existing site?

I'm inheriting a php project of a complete website. It's currently static; the owner just wants a blog on the front page to keep things fresh. Is there a mature PHP blog software out there that I can make a few calls to and have a blog up and running on their front page, without having to convert their entire existing site to a blog or CMS software?
That's one of the use cases for Serendipity. It has a configuration option specifically for that. So unlike Wordpress you don't need to hack it. It's not as featureful and a somewhat bloated package, but has a far better security track record.
http://www.s9y.org/123.html <- embedding howto

How to "save" my wordpress blog's posts in same url format and remove wordpress?

I have a Wordpress blog running on my site and I have no time to continuously upgrade the software and I pretty much want to remove wordpress. It's broken at this point anyway, I can't really get into the admin area, but I suppose I could try to hack my way through.
Anyway, I'd like to save the posts that I have and keep them under the same URL structure so they're still relevant in the search results indexes.
Here's the site in question: http://www.danielfischer.com
Any suggestions on how to keep the site up but possibly turn it static yet keep the same url structure? A static archive of what used to be and have the urls still work pretty much?
Thanks.
You can use a mirroring tool like HTTrack to download the entire site to individual HTML files. HTT shouldn't have any problem making folders from the URL structure (though if there are any non-pretty URLs linked, it'll grab those too).
From there, just upload those files and call it an archive (maybe put them in a separate directory & point the server to it so Wordpress doesn't get totally wiped out, just in case).
Switch on WP-Cache or better yet, install WP-Super-Cache. Make sure it caches every page you have (set the cache timeout to never in settings). This will create static versions of every page within the cache folder. Once you have all pages cached, go into the cache folder (/wp-content/cache/supercache/%{HTTP_HOST}/ by default, where HTTP_HOST is your host name) and copy all of those files and folders into a new webroot (create a new site with whatever the hosting panel is you are using, or in apache manually). Switch your domain over to this new webroot and if everything is working, delete wordpress.
A good shortcut would be to setup a site (such as test.yourblogname.com) and point the sites directory straight into the cache directory (ie. point it to /wp-content/cache/supercache/hostname/). That way you can test it without risking anything.
This could be a help for you
http://www.setuptips.com/wordpress/recovering-a-broken-wordpress-blog-without-a-backup-copy/

Joomla to Static HTML website

I have a Hindi magazine website hosted on Joomla. Though helpful from publishing point of view the site was a maintenance nightmare. Joomla is so much susceptible to hacker attacks. My host will often shut down my site due to bots attacking my website. Recently I relaunched the site as a new Wordpress based site on a different name. The Joomla based website would therefore never be updated anymore. However, I do want to maintain the old content. I have used PHP but hardly am a power user.
I want to convert the files as plain HTML. I created a mirror of the website using HTTrack. But thanks to the fact that Joomla had variety of URLs for the same page (if you used a SEF URL plugin you would understand) the mirror is full of redundant content. Moreover I have repetitive HTML content (for header,footer,menu etc) in each page.
My questions are:
Which is a better option, create a static HTML site or PHP4.x pages (with Unicode content and having include PHP fragments for repetitive content)?
If latter is better should I use template system like Smarty? I am worried about caching since the content will hardly be updated I want caches to last forever.
Thanks for the help.
If the content is not going to change frequently I recommend using HTML files. They are static and hence faster.
However, if you are going to be updating content frequently, then you can either upgrade to the latest version of any popular CMS preferably joomla or drupal. I cite these two because they are actively developed and you can get a lot of support for them on the internet. Be sure to follow their security guide for hardening your installation.
If I were you I'd move everything over to WordPress since you have started using this. This way you will be maintaining a single website application keeping things better manageable in the long run.
You can copy the data out of Joomla using the Joomla administration interface. Or maybe even quicker using a database tool like MySQL Tools or Navicat which has a lot of export options.
Copying the HTML from Joomla using tools like HTTrack or TelePort Pro will result in lots of duplicate code and pages like you state.
Maintaining an extra PHP site just for the old content will be as much effort as getting everything into WordPress.
The "Static Content" project at: https://github.com/juliopontes/staticcontent does exactly what you are after although it looks like it may need to be updated for Joomla 3.5.

Categories