Restarting a wordpress project - wordpress

I am a freelance developer, and I normally build sites from scratch without using any code generating sites like WordPress or Square Space. But my current client insists on using WordPress. However, I am rescuing this project from a previous developer who made a big mess because from the looks of it does not seem like they knew what they were doing.
Is there a way for me to restart everything, on a clean slate and template on WordPress? I would like to have none of what the previous developer has done. Also is there a way for me do do direct coding using HTML, CSS, JavaScript etc on a WordPress site?

Yes, you just need to look into how to create a theme, since themes are the basis of the Wordpress structure. Ultimately, if you have the code for a website, it can be broken into separate files that Wordpress can use.
See: http://www.wpexplorer.com/create-wordpress-theme-html-1/

If the previous developer has done all the work in the theme files, then simply switching the theme to a default theme (Like Twenty Sixteen) will give you a nice clean slate to dig in and jump off with. You will want to create a child theme of any existing theme if you want to make any changes. If, however, the developer has messed with other files besides the theme folder, then you will most likely want to export the content only (as a logged-in administrator, go to Tools > Export (here's a screenshot))
Then on a new environment (I prefer testing these things first on a local virtual environment like VVV, and then transition to a development subdomain on the same server that the site will eventually go live on and securing it with an htaccess user/password to block curious eyes), import the content on a fresh installation of wordpress via the same menu (Tools > Import). This will give you a fresh installation with the content that's been created, but without any of the mess.
For more information about importing content - here's the codex article.
I hope that's a good start - but if I've glossed over anything you don't understand, let me know - I'm happy to help.

Related

After migrating a WP site, changes made in the Customizer don't appear on the new site

I have a Wordpress site, built using the Hestia theme, on my local PC. I'd like to push the full site, exactly as everything looks locally, to production. I'm able to migrate the codebase, database, plugins, base theme, etc. using Duplicator plugin to prod.
The problem I have is that I did a variety of customizing to the theme in the WYSIWYG theme editor in Wordpress (the customizer) on my local PC and those updates aren't coming through to production with any type of import that I do (I've tried the duplicator and the Wordpress import tool).
Is there something I'm missing or doing wrong in the process? How do I get that customized theme / site to production looking exactly like it does on my local PC? Thanks!
The customizer contents are saved in the database AFAIK.
There is a plugin for export/umport of customizer data: https://wordpress.org/plugins/customizer-export-import/
I just ran into a similar issue and just got done banging my head against the wall, so I figured I'd share. My particular theme was Blocksy (though it sounds like your issue may be imilar).
It turns out that the theme settings were being stored in a wp_options entry named theme_mods_blocksy-child. I confirmed that they existed in the new database after restoring from the backed up SQL. However, as soon as I would visit the new WordPress installation, that entry was being deleted for some reason. I still don't know why this was happening, but luckily the solution was simple in my case. I created a backup of the theme settings here:
https://my_wordpress_site/wp-admin/customize.php
Exported the settings from: General Options > General > Manage Options
Then imported the backed up settings in the same fashion on the new installation.
It sounds from what I was reading that the customizer export import plugin would work well if your theme does not make this kind of import/export functionality readily available from the Customization screen like the theme I was using does.

Wordpress WP Clone plugin is resetting my site

I have a Wordpress site I need to clone for testing purposes. I used Open-Shift to host the scratch site that I will be working on. As for cloning, I am using the WP Clone plugin. When I create a backup file on the real site, it works, and then I paste the URL on the restore for the scratch site. When I go to my scratch site however, none of the content is their, and I have to re-setup Wordpress. Is there another, better, more reliable way to clone a Wordpress site, or am I doing something wrong?
I have used WP-Clone quite a bit, and unfortunately in this scenario, it is the most solid plugin I have found. If you want to go the same route you have been (ie: use a plugin)...you have multiple options. You could check out:
https://wordpress.org/plugins/all-in-one-wp-migration/
And if you don't mind a little bit of complexity - the most comprehensive solution is probably more like:
https://wordpress.org/plugins/duplicator/
I hope that helps. Sometimes those types of plugins can be a little buggy - and it is still a good idea to scan your database to make sure the information was transferred correctly.
Also, have you checked your wp-config file to make sure it is pointing at the correct database on the new site? Sometimes that requires a manual change, as they differ.
Cheers.

Wordpress 3.5 upgrade to 4.0. Theme compatibility

I got in charge of some small sites that are running on WP 3.5; they are all using the same theme (a customized version of Bones). I have only used Joomla some years ago so I have no idea if, after the upgrade, the theme will still be compatible. I want to upgrade my WP version because the current one is vulnerable: I keep getting spam links into my articles that are placed inside hidden divs.
How can I know if the template is compatible or how can I fix the security issue. Any of these will do great.
Thanks!
WordPress does a very good job of changing very little with regards to theme tags in a core update. That said, we have no idea how your theme(s) have been made, or what functions they use.
The best, and probably only realistic option here, is to create a test site (a duplicate) and update that site first, then test to make sure all is working as it should.
As for the vulnerability, this is likely due to an insecure admin password or an insecure plugin. You should ensure all your plugins are up to date and that your admin panel is suitably secure.
When you update wordpress, it will not affect the wp-content folder which is having themes and plugins. So, don't worry update it. But for the secure updation, please take the backup of whole website first. Take backup of database and all files before doing any update.
WP 4 hasn't been out that long. I'd hold off on the upgrade unless you absolutely have to, until you know that all of the plugins used on the sites are compatible w/ WP 4.
Try to install the site on your PC creating a local copy using XAMP (for Windows).
In this way, you can:
download the MySQL database to have all the information of the
website locally;
install the latest wordpress platform locally (on your PC);
test the website thorugh common browsers.
At the end, you'll be sure about the compatibility and you can update the main site.
I have built my own theme with the Artisteer software; then i modified many PHP file to manage the loop in some special ways; so, to be sure that everything is working after an update of the site Wordpress version, i test everything on my PC.
For the vulnerability, please verify your plugin and all your theme file.
In some experiences, there are some plugin or simply some codes place somewhere in your theme which can create something like this:
> <div id="headerblock"> <center> <div style="left: -2227px; position:
> absolute; top: -3337px">
The only thing to do is check all the theme file and plugin to see where this code is placed.
Please check here for more information.
If you only change your password, probably it will not solve you problem because the malicious code is already inside your system.
Sometimes the malicious code can be placed directly inside the MySQL database.

Static html to wordpress migration

I have a static HTML site (about ten years old) which I am going to migrate to a Wordpress site.
I have used Wordpress before but never as a migration target. From some initial background reading I have come up with the following process to perform the migration:
Check hosting provider/package for Wordpress suitability
Generate complete current site map
Make a complete backup of current site
Install Wordpress in subdirectory
Install Maintenance mode plugin and activate
Migrate content to Wordpress instance (looks like this could be
painstaking..)
Install suitable theme
Customise selected theme with Logo/fonts/colours etc.
Deactivate maintenance mode
Make Wordpress site available from domain root
Delete old static html site files
(The migration may take place over several weeks/months so I need the static HTML site to be available until step 10 is completed)
In my naivety are there any pitfalls in the above process, or additional issues I have failed to consider?
Are there any other accepted 'best practices' when performing this kind of migration?
Here's a good tutorial:
http://code.tutsplus.com/tutorials/creating-a-wordpress-theme-from-static-html-creating-template-files--wp-33939
For developers who want the theme converted from HTML in easy way (but no guarantee if it can produce the output as expected):
http://www.htmltowordpressconverter.com/
Hope this was helpful!!!!
WordPress theme styles come in all shapes and sizes. Converting from a static HTML site to something database driven like WordPress can be as easy or complicated as you want.
If you just want to integrate WordPress into an existing HTML theme it's as easy as installing WP, setup the database and config, then building in the old HTML structure using WP. This way everything will be the same but managed within WordPress i.e. Pages, Menus, Sidebars.
Here's are some useful links:
https://codex.wordpress.org/Using_Themes
https://codex.wordpress.org/Theme_Development
https://codex.wordpress.org/Stepping_Into_Templates
And here's a "Start from Scratch" theme that would be simple to start from. Just install it, activate it, then begin migrating the main content i.e. copy and images etc, and building the theme itself.
http://adopttheweb.com/start-from-scratch.zip

Fixing locally hosted wordpress site for migration (removing localhost)

A Wordpress novice and have set up my site locally using MAMP.
Unfortunately all the links to styles and I assume the database etc are by default pathed using 'localhost' so the site works ONLY on my machine. What is the correct way to change this pathing so that wordpress will correctly display the site?
For the database, you can edit the wp-config.php file at the root of your site.
As far as your styles are concerned, you'll have to go through the theme files that you've setup and adjust the relative path to those style sheets.
There are several options. Kyle is correct about editing wp-config.php, that will definitely take care of the new DB connection. However, I would advise against a manual adjustment of stylesheets and markup if possible. The easiest way for a novice might be this: export the DB from your local installation using "Settings > Export." Then, in your remote installation, use the WordPress Importer and it should tidy up all the links for you. This has worked for me several times.
You can learn more about other options here: http://wp.tutsplus.com/tutorials/hosting/how-to-break-a-wordpress-install-and-fix-it-again/
UPDATE: unless of course you've hardcoded "localhost" in your stylesheets and markup. In that case, use one of the solutions in the above link.
If your theme uses serialized data, you might have a problem when moving your website by simply doing a find and replace and changing the URL that way. I would recommend following WordPress's guide when you're moving your site.
http://codex.wordpress.org/Moving_WordPress
It involves using a special script to change the URL of your site.

Resources