WordPress Trends Infographic

WordPress Trends Infographic

Interesting story about WordPress on elegant themes

 

WordPress Trends Infographic

 

How to Move a WordPress Site from One Server to Another

How to Move a WordPress Site from One Server to Another

Step 1: Make a Local Copy of the Existing WordPress Site Files

The first thing to do is connect to the FTP server which provides access to the files for the existing WordPress installation. Getting an entire site is time consuming and, with any decent FTP client, it’s automated, so I make this step one. Just connect via FTP and sync a directory on your local disk to the document root which contains your live WordPress install. Now, with files, we can move on to other steps.

Step 2: Get a Dump of Your Current WordPress Database

The easiest tool to use here is going to be PHPmyadmin All hosting providers offer this service to their users. Follow these steps to get your existing database exported:

  • Connect to the instance of phpMyAdmin which provides access to the database for your current site. Enter your credentials to log in to the management interface.
  • Select the database for your existing WordPress installation from the list on the left. (in this case my present database name is “craniumstorm”)

1

Click ‘Export’ at the top of the window

2

Ensure that the radio button for the ‘Quick’ export method is selected. Click the ‘Go’ button to download a .sql file containing a dump of your current database table structure along with all of your existing data.

3

Step 3: Change database name and new domain name

Make a copy of downloaded database file and Open the sql file in a text editor like notepad

  1. Find the old database name and replace it with your new database name.
  2. Find your old domain name and replace it with your new domain name.

Save the file.

 

Step 4: Import Your Database

Now you have to reverse the export process to populate your new database.

  1. Log in to the phpMyAdmin interface for the new database.
  2. Select the new database from the list on the left (see Fig. 1, above).
  3. This time, click the ‘Import’ tab at the top of the window.
  4. Now you’ll have to select the file you just downloaded containing your database dump so that you can upload it here. Click the ‘Choose File’ button and locate the .sql file which you have edited with new details.

4

All that’s left for this step is to click the ‘Go’ button to import your data.

Login to your admin panel with your old server Privileges and check is everything is ok.

Step 5: Upload the WordPress Site and Edit Your Configuration

Uploading the entire WordPress site is the next logical step here.

  1. When you’re ready, connect to the FTP host for the new site.
  2. Upload the entire contents of the site to its new home.
  3. Edit your /wp-config.php file to include the correct information for your new database:
    1. // ** MySQL settings – You can get this info from your web host ** //
    2. /** The name of the database for WordPress */
    3. define(‘DB_NAME’, ‘databasename’);
    4. /** MySQL database username */
    5. define(‘DB_USER’, ‘username’);
    6. /** MySQL database password */
    7. define(‘DB_PASSWORD’, ‘somePass’);
    8. /** MySQL hostname */
    9.  define(‘DB_HOST’, ‘localhost’);

This has come up a couple of times now, so I’m going to say here in advance that you should try logging into the admin panel in the new location at this point. If you get in without any problems, go to Settings > Permalinks and click ‘Update Permalinks’ to make sure WordPress updates the .htaccess file.

PHP interview questions and answers

PHP interview questions and answers

1)    What does a special set of tags <?= and ?> do in PHP?

2)    What’s the difference between include and require?

3)    I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

4)    Would I use print “$a dollars” or “{$a} dollars” to print out the amount of dollars in this example?

5)    How do you define a constant?

6)    How do you pass a variable by value?

7)    Will comparison of string “10” and integer 11 work in PHP?

8)    When are you supposed to use endif to end the conditional statement?

9)    Explain the ternary conditional operator in PHP?

10) How do I find out the number of parameters passed into function?

11) If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?

12) What’s the difference between accessing a class method via -> and via ::?

13) Are objects passed by value or by reference?

14) How do you call a constructor for a parent class?

15) What’s the special meaning of __sleep and __wakeup?

16) Why doesn’t the following code print the newline properly?

17) Would you initialize your strings with single quotes or double quotes?

18) How come the code <?php print “Contents: $arr[1]”; ?> works, but <?php print “Contents: $arr[1][2]”; ?> doesn’t for two-dimensional array of mine?

19) What is the difference between characters 23 and x23?

20) With a heredoc syntax, do I get variable substitution inside the heredoc contents?

 

 Just press Like button to download Answers

 

Multimedia and canvas elements in HTML5

Multimedia and canvas elements in HTML5

<canvas>

The <canvas> element was originally developed by Apple® for use in Mac OS X
Dashboard widgets and in Safari, but was later adopted by Mozilla® and Opera® in
their Web browsers. The element has been standardized and included in the HTML5
specification, along with a series of 2D drawing APIs that can be used to create
shapes, text, transitions, and animations inside the element.
Many believe that the <canvas> element is one of the most important aspects of
HTML5 as it facilitates the production of graphs, interactive games, paint
applications, and other graphics on the fly without requiring external plug-ins such as
Adobe Flash.

The <canvas> element itself is quite basic, defining the width, height, and unique ID
for the object. The developer must then use a series of JavaScript APIs to actually
draw objects on the canvas, typically when the Web page has finished rendering.
These APIs allow the developer to draw shapes and lines; apply color, opacity, and
gradients; create text; transform canvas objects; and perform animation. The APIs
also allow the <canvas> to be interactive and respond to user input such as mouse
events and key events, facilitating the production of games and Web applications on
the canvas. You will see an example of the <canvas> element in action in the
sample HTML5/CSS3 Web site later in this tutorial.

<audio> and <video>

In recent years, the popularity of video sharing sites such as YouTube and content
delivery platforms like Hulu has seen a huge explosion in the use of the Web for
multimedia streaming. Unfortunately, the Web was not built with such content in
mind, and as a result, the provision of video and audio has by and large been
facilitated by the Flash Video (.flv) file format and the Adobe Flash platform.
HTML5, however, includes support for two new elements, <audio> and <video>,
which allow Web developers to include multimedia content without relying on the
user to have additional browser plug-ins installed. Several browsers, including
Mozilla Firefox, Apple Safari, and Google Chrome, have begun supporting these
new elements and providing standard browser playback controls, should the user
choose to use them. In addition, a set of standard JavaScript APIs has been
provided to allow developers to create their own playback controls, should they wish
to do so. A key advantage to native multimedia playback is that it theoretically
requires less CPU resources, which can lead to energy savings.
A key issue with these new multimedia elements, however, is the file formats
supported by each browser and the patent licensing issues that go along with the
various codecs that these files can be encoded with. Mozilla and Opera want to use
the open source Theora video container and codec, which does not require patent
licensing for the inclusion of the codecs in the Web browser. On the other hand,
Apple and Google are not happy with the quality of Theora, particularly for the
delivery of high definition (HD) content on the likes of YouTube. They prefer the
H.264 codec, typically contained in MP4, MOV, or MKV files.
The issue is not just with video however, as the same problems reside with audio
codecs. The MP3 and AAC formats are restricted by patents, whereas the Vorbis
format is not. The problem with Vorbis audio is that it is not in widespread use, as
portable media players and many media software applications do not support it.
There are many decisions to be made about HTML5 <video> and <audio> in the
near future, and it will be interesting to see what codecs and formats are facilitated in
the final recommendation. In the meantime, you can try to support all browsers by
making video available in a variety of formats and by providing Flash video as a
fallback. Let’s hope that a final decision is made, and that it is not left to browser
vendors to decide which formats to support, as that would essentially render these
new elements useless.
Again, you will see the <video> element in action later in this tutorial.