Posts Tagged ‘WORDPRESS’

You want to extend WordPress’ functionality and decided to download some plugins found in the Official WordPress Plugin repository. After searching the repo, you’ve found two plugins that accomplishes the tasks you needed to implement in your blog. Downloading the plugins gives you two ZIP files that when double-clicked, shows you the contents in the following format:
plugin-a.zip

plugin-a-folder
---- plugin-a-main-file.php
---- plugin-a-readme.txt

plugin-b.zip

plugin-b-folder
    ---- plugin-b-subfolder
    -------- plugin-b-main-file.php
    -------- plugin-b-readme.txt

There are two ways to install a plugin. Option 1 is to unzip the file and upload the contents to wordpress_root/wp-content/plugins/ directory. Option 2 is to use the Add New -> Upload option found in the left panel bar of the administrative page of WordPress. Let’s assume the two plugins went through the two installation options.

Installing ‘plugin-a.zip’ using Option 1

  1. Unzip the file
  2. Upload the contents to wordpress_root/wp-content/plugins/
  3. Login as admin and go to Plugins -> Installed.
  4. Locate plugin and click Activate link.
  5. Result:
    Plugin activated.

Installing ‘plugin-a.zip’ using Option 2

  1. Login as admin and go to Plugins -> Add New -> Upload
  2. Locate the file plugin-a.zip by clicking the Browse button.
  3. Click Install Now button.
  4. Result:
    Unpacking the package?
    Installing the plugin?
    Plugin installed successfully.
  5. Click Activate Plugin link.
  6. Result:
    Plugin activated.

Installing ‘plugin-b.zip’ using Option 1

  1. Unzip the file
  2. Upload the contents to wordpress_root/wp-content/plugins/
  3. Login as admin and go to Plugins -> Installed.
  4. Locate plugin and click Activate link.
  5. Error: Plugin does not exists in the list.

Installing ‘plugin-b.zip’ using Option 2

  1. Login as admin and go to Plugins -> Add New -> Upload
  2. Locate the file plugin-b.zip by clicking the Browse button.
  3. Click Install Now button.
  4. Result:
    Unpacking the package?
    Installing the plugin?
    Plugin installed successfully.
  5. Click Activate Plugin link.
  6. WordPress ? Error

The plugin does not have a valid header.

Based on our testing, plugin-b.zip seems to fail on both methods of installation. To find out what is causing the error, we have to understand how the plugin installation works. Upon checking the core files I found this excerpt in get_plugins() function:

* WordPress only supports plugin files in the base plugins directory
* (wp-content/plugins) and in one directory above the plugins directory
* (wp-content/plugins/my-plugin). The file it looks for has the plugin data and
* must be found in those two locations. It is recommended that do keep your
* plugin files in directories.

The plugin data that the function is looking for can be found below:

<?php
/*
Plugin Name: Name Of The Plugin
Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
Description: A brief description of the Plugin.
Version: The Plugin's Version Number, e.g.: 1.0
Author: Name Of The Plugin Author
Author URI: http://URI_Of_The_Plugin_Author
License: A "Slug" license name e.g. GPL2
*/
?>

So in order to properly install and activate a plugin, the following two conditions must be satisfied:

  • that a plugin main file (.php) must be placed in plugins root folder or in first-level subdirectory within plugins folder
  • and it should contain the necessary plugin data for identification/validation purposes

In the case of plugin-b.zip, although the main PHP file contains the needed plugin data, the validate_plugin() function returned an error since neither the file can be found or check if it contains the plugin data because it is placed in the second level subdirectory, a directory location in which the function is not designed to scan the content.

To fix the plugin-b.zip file, it needs to have the following content structure:
plugin-b.zip

plugin-b-folder
---- plugin-b-main-file.php
---- plugin-b-readme.txt

I hope this post will enlighten WordPress users who wants to maximize their blog’s potential 🙂

Just replace the URL in the fetch_rss line below with the RSS feed to your Twitter favorites. In fact this will work with any RSS feed.

<?php     
 include_once(ABSPATH . WPINC . '/feed.php');     
 $rss = fetch_feed('http://twitter.com/favorites/#######.rss');     
 $maxitems = $rss->get_item_quantity(3);     
 $rss_items = $rss->get_items(0, $maxitems); ?> 
 <ul>     
 <?php if ($maxitems == 0) echo '<li>No items.</li>';     
 else     // Loop through each feed item and display each item as a hyperlink.     
 foreach ( $rss_items as $item ) : ?>     <li>         
 <a href='<?php echo $item->get_permalink(); ?>'>             
 <?php echo $item->get_title(); ?>        
  </a>     
 </li>     
 <?php endforeach; ?>
 </ul>

The following is the best way to go about it. Add the following to the theme’s functions.php file:

if( !is_admin()){
   wp_deregister_script('jquery');
   wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false, '1.3.2');
   wp_enqueue_script('jquery');
}

Replace the URL with the location of what version of jQuery you want to use. The URL above (at the time of this writing) links to the latest version of jQuery on Google’s servers (v1.4) and has in the past linked to v1.3.2. Theoretically I would think it will continue to be the most latest version, until jQuery goes 2.0.

1. eShop
It is an accessible shopping cart plugin for WordPress packed with sophisticated features. eShop uses WordPress pages, or posts, to create products. There are various methods available for listing the products. Various methods available for listing products. It allows you to download data and upload downloadable products. The basic statics and sales data provided by the plugin is quite handy. The Admin has access to an order handling section. It sends automatic emails on successful purchase. The emails templates are user configurable. Various discounts options are also available.
eShop offers a number of payments options that include- Authorize.net, Paypal, Payson, eProcessingNetwork, Webtopay and Cash/Cheque. What’s more it offers several shipping options.
Download

2. Shopp Requirement Check
This plugin has been designed to ensure that the web hosting environment has the technologies to support Shopp. Shopp was a much needed ecommerce plugin solution for WordPress. It provides an online commerce platform that can easily handle larger online store operations without any complexity. For any small online shop owner it’s a great asset. The plugin is simple to use and focuses on balanced, efficient, and stable feature set to provide best ecommerce experience. Further it also extends the powerful flexibility and adaptability required by developers and designers. It offers advanced Thickbox product image galleries with smooth transition

Some of the key features in Shopp include

1. SEO shopping pages with pretty-url permalink support, product and category names in the page title, and more

2. Dynamic categories that highlights new product additions, featured products, on-sale products and bestselling products

3. Product RSS feeds for every category (including dynamic categories) enhanced for Google Bas

4. Run time-limited promotions like price discounts, free shipping or even buy 1 get 1 free support

5. Easy to set up multiple shipping methods with an intelligently simplified shipping rate manager

6. Options for payment through credit cards easily and securely

7. Offsite checkout through PayPal Express and/or Google Checkout
Download
(more…)

Problem: You need to add a class or id to the the unordered list in wp_page_menu. Maybe to implement some super-slick drop down page menus. But! That <ul> tag is trapped inside of wp_page_menu. What are you going to do?

Solution: Filter wp_page_menu. In the code example below we’ll use preg_replace to find the first—and only the first—

<ul> tag and swap it out for <ul id="nav">. Just drop this code snippet into your theme’s functions.php file and you’re set.
// Add ID and CLASS attributes to the first <ul> occurence in wp_page_menu

function add_menuclass($ulclass) { return preg_replace('/<ul>/', '<ul id="nav">', $ulclass, 1); } add_filter('wp_page_menu','add_menuclass');