Cron job with WordPress

Cron job with WordPress

Many time cron will slow your site to end user. It’s little bit complex to debug.

WP-Cron works different way. It’s not based on the server, or the server’s clock.

In WordPress, It check every time a person calls one of your pages or posts. Every time WordPress goes to work, it checks to see if there are any jobs that need to leverage WP-Cron.

But that’s a bit uncertain, as you might imagine. Especially for sites that don’t get hit very often. and for large site, every request can  execute process that goes to work and takes up server resources. That might easily bring your server down if you don’t have adequate resources.

So in the end, WP-Cron will not work small sites as well as very large site.

We need to another mechanism to run WP-cron job,  The mechanism is Cronjob [ based on server ].

Continue reading “Cron job with WordPress”

Advertisements

BuddyPress Profile Views

I am happy to introduce Buddypress profile view plugin Which allow you to manage your member profile views. We got idea of this plugin form Linked profile view.  This plugin provide similar functionality for buddypress.

Idea :

  • No of view of member profile
  • To know which member is popular on network
  • Display popular member  list
  • Member can access their profile view graph

Feature of this plugin:

  • View count on Profile
  • Profile view statistics
  • Language support
  • Live Notification on profile view

Roadmap:

  • Add provision to disable Notification
  • Widget based on profile views

Download : https://wordpress.org/plugins/buddy-views/

Contributors : @DipsKakadiya @mehulkaklotar @yapareshya @Utkarsh_ME @Sanket

Make Private Buddypress Member directory

function make_private_members_profiles(){
// Bail if not a profile page.

if ( ! bp_is_user_profile() && ! bp_is_members_directory() )
return;

// Allow admin users.
if ( current_user_can( 'manage_options' ) )
return;

// Allow the profile owner.
if ( bp_is_user_profile() && bp_loggedin_user_id() == bp_displayed_user_id() )
return;

// If we get to here, redirect to homepage.
bp_core_redirect( home_url() );
}

add_action( 'bp_init', 'make_private_members_profiles') );

Replace BuddyPress Group as Community or something else

For replacing Group with other name like Community, team etc, there is more than one solution.

  1. Update it using Language file
  2. Update it using template override and lot’s of filter
  3. Using ‘gettext’ filter

I prefer to go with ‘gettext’ filter, It is the easiest way to do.

function smartcom_replace_group_labels( $text ) {

   // this code help to replace group label only in frontend
   if ( true === is_admin() ) {
      return $text;
   }

   $text = str_replace( 'Groups', 'Communities', $text );
   $text = str_replace( 'Group', 'Community', $text );
   $text = str_replace( 'groups', 'communities', $text );
   $text = str_replace( 'group', 'community', $text );
   return $text;
}
add_filter( 'gettext', 'smartcom_replace_group_labels' );
add_filter( 'ngettext', 'smartcom_replace_group_labels' );
add_filter( 'gettext_with_context', 'smartcom_replace_group_labels' );

I’m at #WcNashik

I’m at #WcNashik

This wordcamp was my 4th wordcamp as attendee. I knew about this wordcamp by social media and my colleagues. One of my colleagues was speaker for this wordcamp.

I planned for WCNashik just before week. First I booked ticket for WC WCNashik and arranged travel to reached the venue.

WCNashik was a great experience for me. This event was well organized, I loved it.

I am living in surat so my journey start for #WCNashik day before it’s. I reached  at nashik early morning by bus and I reached the venue within 30 min. As I reached there,  Some people were already arrived.  I had introduction talk with them. After some time, registration process was stated. I collected my WC ticket with swags and entered in a hall. The venue was good and well organized.

Continue reading “I’m at #WcNashik”