Blog

Your Vision, Our Passion

WordPress Themes Required Plugins

This tutorial will show you how you can alert the users installing the theme that the plugin requires certain plugins to be installed.

When developing a theme you often times rely on certain plugins to add additional functionality to your theme. In this case the following theme relied on 2 Plugins. Testimonials by WooThemes, and Features by WooThemes


The following code was taken from http://www.paulund.co.uk/theme-users-required-plugins. We use it on our themes and I will explain what it does.

  1. First we’re going to hook into the admin_notices hook in wordrpess and run a function called showAdminMessages.
  2. We create our function showAdminMessages and create an empty array $plugin_messages.
  3. Since we’re going to be using the function is_plugin_active we have to require the following file
    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
  4. We then use an if statement to check if the plugin is not active !is_plugin_active to check the plugins main file.
  5. If the plugin is not active we add a message to our $plugin_messages array notifying the user that the plugin is required and a link to downlod.
  6. We then use another if statement to count our $plugin_messages array > 0 and use foreach to loop through each message and echo out a <div id="message" class="error">

Blog

Your Vision, Our Passion

Search and Replace

Changing permalinks or any other string in a database can be a hassle especially if you don’t know MySql commands.  When working with WordPress you’ll soon run into this situation where you need to change a string across the entire database whether you’re changing permalinks when launching or migrating a site or just doing a find and replace on the entire database.

Luckily I came across this tool called Database Search and Replace Script in PHP

Installation & Use

To use the script, download the zip file from Database Search and Replace Script in PHP, extract the folder called search-replace-db-master, renaming it to something of your choosing, upload it to your web sites root directory, then navigate to that folder in your browser (domainname.com/your-secret-search-replace-folder). The script will automatically attempt to find and populate the database fields but make sure to double check that the information is correct.

The root WordPress structure would looks like this.

/your-secret-search-replace-folder
/wp-admin
/wp-content
/wp-includes


Navigating to the following url (domainname.com/your-secret-search-replace-folder) using your browser will bring up the following page.

  1. Fill in the field you want search for then fill in the field you want to replace with
  2. Database: Make sure the database field information is correct.
  3. Tables: Select Which tables you want to include
  4. Actions: Click dry run to run a scan first to see how many instances of your field will be replaced ( Will not change fields only runs a search )

After dry run is clicked it will go search through the database tables and look for the instance you defined in the search for field.

If you’re satisfied with the dry run then go ahead and click live run ( This will execute find/replace and change all the fields ).

*** Very Important *** After you’re done making your find/replace changes make sure to delete the folder ( /your-secret-search-replace-folder ) from your root directory.

Blog

Your Vision, Our Passion

iPhone Email Setup

These instructions will walk you through email setup on an Apple iPhone.


Step 1: Go to “Settings” from the home screen of your iPhone.


Step 2: Go to “Mail, Contacts, Calendars”.


Step 3: Under accounts, select “Add Account”.


Step 4: Select “Other“.


Step 5: Select “Add Mail Account”.


Step 6:

In the New Account menu, you will need to specify the following fields:

Name: your name, it will appear as a sender name.
Address: your full email address.
Password: password for this email address
Description: you can specify any description.

Select “Next”


Step 7:

fter Selecting “Next” you will need to enter in our mail server information.

Select POP

Incoming Mail Server
Host Name: Example “mail.yourdomainname.com”
User name: your full email address.
Password: If the password field is not filled in, re-enter it the password for this email address

Outgoing Mail Server
Host Name: Example “mail.yourdomainname.com”
User name: your full email address.
Password: enter the password for this email address

Select “Save”


Step 8:

It will Attempt to Verify. You will get a Message “Cannot Verify Server Identity” Click “Continue” (This may take a couple minutes).

When the verifying is finished you will be redirected to Mail, Contacts, Calendars screen. Please Select the account you just created. Scroll down the screen and select “Advanced“.

iphone-step-8

Incoming Settings
SSL: Set to off
Authentication: Password
Server Port: 110

Once the above settings are changed go back to the previous screen.


Step 9:

Select “SMTP”

Select “mail.yourdomainname.com”
Server: Set to On
SSL: Set to Off
Authentication: Password
Server Port: 25 (if your network provider blocks this port change Server Port: 8080)

Select “Done”


Step 10:

At this point you your email account should be all set. Make sure the settings are saved and then Select the mail icon from the home screen of your iPhone to begin retrieving your email.